forked from qt-creator/qt-creator
ClearCase: Persist save keep file on undo checkout
When undoing checkout on a modified file the user is prompted to preserve the contents of the checked-out version under a file-name of the form element-name.keep. Save the user's choice and use it on subsequent undo checkout actions. Change-Id: I26a73c7f1f456ae0cf1cad6741d30ff2aab4bf3f Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
a49134c47a
commit
db7fbc687a
@@ -920,9 +920,14 @@ void ClearCasePlugin::undoCheckOutCurrent()
|
|||||||
QDialog uncoDlg;
|
QDialog uncoDlg;
|
||||||
uncoUi.setupUi(&uncoDlg);
|
uncoUi.setupUi(&uncoDlg);
|
||||||
uncoUi.lblMessage->setText(tr("Do you want to undo the check out of \"%1\"?").arg(fileName));
|
uncoUi.lblMessage->setText(tr("Do you want to undo the check out of \"%1\"?").arg(fileName));
|
||||||
|
uncoUi.chkKeep->setChecked(m_settings.keepFileUndoCheckout);
|
||||||
if (uncoDlg.exec() != QDialog::Accepted)
|
if (uncoDlg.exec() != QDialog::Accepted)
|
||||||
return;
|
return;
|
||||||
keep = uncoUi.chkKeep->isChecked();
|
keep = uncoUi.chkKeep->isChecked();
|
||||||
|
if (keep != m_settings.keepFileUndoCheckout) {
|
||||||
|
m_settings.keepFileUndoCheckout = keep;
|
||||||
|
m_settings.toSettings(ICore::settings());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
vcsUndoCheckOut(state.topLevel(), file, keep);
|
vcsUndoCheckOut(state.topLevel(), file, keep);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ static const char historyCountKeyC[] = "HistoryCount";
|
|||||||
static const char timeOutKeyC[] = "TimeOut";
|
static const char timeOutKeyC[] = "TimeOut";
|
||||||
static const char autoCheckOutKeyC[] = "AutoCheckOut";
|
static const char autoCheckOutKeyC[] = "AutoCheckOut";
|
||||||
static const char noCommentKeyC[] = "NoComment";
|
static const char noCommentKeyC[] = "NoComment";
|
||||||
|
static const char keepFileUndoCheckoutKeyC[] = "KeepFileUnDoCheckout";
|
||||||
static const char diffTypeKeyC[] = "DiffType";
|
static const char diffTypeKeyC[] = "DiffType";
|
||||||
static const char diffArgsKeyC[] = "DiffArgs";
|
static const char diffArgsKeyC[] = "DiffArgs";
|
||||||
static const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
|
static const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
|
||||||
@@ -69,6 +70,7 @@ ClearCaseSettings::ClearCaseSettings() :
|
|||||||
autoAssignActivityName(true),
|
autoAssignActivityName(true),
|
||||||
autoCheckOut(true),
|
autoCheckOut(true),
|
||||||
noComment(false),
|
noComment(false),
|
||||||
|
keepFileUndoCheckout(true),
|
||||||
promptToCheckIn(false),
|
promptToCheckIn(false),
|
||||||
disableIndexer(false),
|
disableIndexer(false),
|
||||||
extDiffAvailable(false),
|
extDiffAvailable(false),
|
||||||
@@ -84,6 +86,7 @@ void ClearCaseSettings::fromSettings(QSettings *settings)
|
|||||||
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
|
||||||
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
|
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
|
||||||
noComment = settings->value(QLatin1String(noCommentKeyC), false).toBool();
|
noComment = settings->value(QLatin1String(noCommentKeyC), false).toBool();
|
||||||
|
keepFileUndoCheckout = settings->value(QLatin1String(keepFileUndoCheckoutKeyC), true).toBool();
|
||||||
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
|
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
|
||||||
switch (sDiffType[0].toUpper().toLatin1()) {
|
switch (sDiffType[0].toUpper().toLatin1()) {
|
||||||
case 'G': diffType = GraphicalDiff; break;
|
case 'G': diffType = GraphicalDiff; break;
|
||||||
@@ -112,6 +115,7 @@ void ClearCaseSettings::toSettings(QSettings *settings) const
|
|||||||
settings->setValue(QLatin1String(commandKeyC), ccCommand);
|
settings->setValue(QLatin1String(commandKeyC), ccCommand);
|
||||||
settings->setValue(QLatin1String(autoCheckOutKeyC), autoCheckOut);
|
settings->setValue(QLatin1String(autoCheckOutKeyC), autoCheckOut);
|
||||||
settings->setValue(QLatin1String(noCommentKeyC), noComment);
|
settings->setValue(QLatin1String(noCommentKeyC), noComment);
|
||||||
|
settings->setValue(QLatin1String(keepFileUndoCheckoutKeyC), keepFileUndoCheckout);
|
||||||
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
|
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
|
||||||
QString sDiffType;
|
QString sDiffType;
|
||||||
switch (diffType) {
|
switch (diffType) {
|
||||||
@@ -141,6 +145,7 @@ bool ClearCaseSettings::equals(const ClearCaseSettings &s) const
|
|||||||
&& timeOutS == s.timeOutS
|
&& timeOutS == s.timeOutS
|
||||||
&& autoCheckOut == s.autoCheckOut
|
&& autoCheckOut == s.autoCheckOut
|
||||||
&& noComment == s.noComment
|
&& noComment == s.noComment
|
||||||
|
&& keepFileUndoCheckout == s.keepFileUndoCheckout
|
||||||
&& diffType == s.diffType
|
&& diffType == s.diffType
|
||||||
&& diffArgs == s.diffArgs
|
&& diffArgs == s.diffArgs
|
||||||
&& autoAssignActivityName == s.autoAssignActivityName
|
&& autoAssignActivityName == s.autoAssignActivityName
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ public:
|
|||||||
bool autoAssignActivityName;
|
bool autoAssignActivityName;
|
||||||
bool autoCheckOut;
|
bool autoCheckOut;
|
||||||
bool noComment;
|
bool noComment;
|
||||||
|
bool keepFileUndoCheckout;
|
||||||
bool promptToCheckIn;
|
bool promptToCheckIn;
|
||||||
bool disableIndexer;
|
bool disableIndexer;
|
||||||
bool extDiffAvailable;
|
bool extDiffAvailable;
|
||||||
|
|||||||
Reference in New Issue
Block a user