Skip to content
Snippets Groups Projects
Commit db7fbc68 authored by Knut Petter Svendsen's avatar Knut Petter Svendsen Committed by Orgad Shaneh
Browse files

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: default avatarOrgad Shaneh <orgads@gmail.com>
parent a49134c4
No related branches found
No related tags found
No related merge requests found
......@@ -920,9 +920,14 @@ void ClearCasePlugin::undoCheckOutCurrent()
QDialog uncoDlg;
uncoUi.setupUi(&uncoDlg);
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)
return;
keep = uncoUi.chkKeep->isChecked();
if (keep != m_settings.keepFileUndoCheckout) {
m_settings.keepFileUndoCheckout = keep;
m_settings.toSettings(ICore::settings());
}
}
vcsUndoCheckOut(state.topLevel(), file, keep);
}
......
......@@ -43,6 +43,7 @@ static const char historyCountKeyC[] = "HistoryCount";
static const char timeOutKeyC[] = "TimeOut";
static const char autoCheckOutKeyC[] = "AutoCheckOut";
static const char noCommentKeyC[] = "NoComment";
static const char keepFileUndoCheckoutKeyC[] = "KeepFileUnDoCheckout";
static const char diffTypeKeyC[] = "DiffType";
static const char diffArgsKeyC[] = "DiffArgs";
static const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
......@@ -69,6 +70,7 @@ ClearCaseSettings::ClearCaseSettings() :
autoAssignActivityName(true),
autoCheckOut(true),
noComment(false),
keepFileUndoCheckout(true),
promptToCheckIn(false),
disableIndexer(false),
extDiffAvailable(false),
......@@ -84,6 +86,7 @@ void ClearCaseSettings::fromSettings(QSettings *settings)
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), 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();
switch (sDiffType[0].toUpper().toLatin1()) {
case 'G': diffType = GraphicalDiff; break;
......@@ -112,6 +115,7 @@ void ClearCaseSettings::toSettings(QSettings *settings) const
settings->setValue(QLatin1String(commandKeyC), ccCommand);
settings->setValue(QLatin1String(autoCheckOutKeyC), autoCheckOut);
settings->setValue(QLatin1String(noCommentKeyC), noComment);
settings->setValue(QLatin1String(keepFileUndoCheckoutKeyC), keepFileUndoCheckout);
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
QString sDiffType;
switch (diffType) {
......@@ -136,16 +140,17 @@ void ClearCaseSettings::toSettings(QSettings *settings) const
bool ClearCaseSettings::equals(const ClearCaseSettings &s) const
{
return ccCommand == s.ccCommand
&& historyCount == s.historyCount
&& timeOutS == s.timeOutS
&& autoCheckOut == s.autoCheckOut
&& noComment == s.noComment
&& diffType == s.diffType
&& diffArgs == s.diffArgs
return ccCommand == s.ccCommand
&& historyCount == s.historyCount
&& timeOutS == s.timeOutS
&& autoCheckOut == s.autoCheckOut
&& noComment == s.noComment
&& keepFileUndoCheckout == s.keepFileUndoCheckout
&& diffType == s.diffType
&& diffArgs == s.diffArgs
&& autoAssignActivityName == s.autoAssignActivityName
&& promptToCheckIn == s.promptToCheckIn
&& disableIndexer == s.disableIndexer
&& indexOnlyVOBs == s.indexOnlyVOBs
&& totalFiles == s.totalFiles;
&& promptToCheckIn == s.promptToCheckIn
&& disableIndexer == s.disableIndexer
&& indexOnlyVOBs == s.indexOnlyVOBs
&& totalFiles == s.totalFiles;
}
......@@ -69,6 +69,7 @@ public:
bool autoAssignActivityName;
bool autoCheckOut;
bool noComment;
bool keepFileUndoCheckout;
bool promptToCheckIn;
bool disableIndexer;
bool extDiffAvailable;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment