aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKnut Petter Svendsen <knutpett@pvv.org>2015-01-02 16:13:57 +0100
committerOrgad Shaneh <orgads@gmail.com>2015-06-11 09:07:57 +0000
commita49134c47a48e2cded439c70e9ebf52dc0577d2c (patch)
treed4d2061582cf629fd9e7a6220756ec4f2952ecf8
parenta4890d838d4e216c45a7eca2bfd8492cdceb756f (diff)
ClearCase: Add setting to not prompt for comment
Change-Id: I30807991e2a839088c9523280eab1dacd22a1bf4 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rw-r--r--src/plugins/clearcase/checkoutdialog.cpp13
-rw-r--r--src/plugins/clearcase/checkoutdialog.h3
-rw-r--r--src/plugins/clearcase/clearcaseplugin.cpp8
-rw-r--r--src/plugins/clearcase/clearcasesettings.cpp5
-rw-r--r--src/plugins/clearcase/clearcasesettings.h1
-rw-r--r--src/plugins/clearcase/settingspage.cpp2
-rw-r--r--src/plugins/clearcase/settingspage.ui45
7 files changed, 59 insertions, 18 deletions
diff --git a/src/plugins/clearcase/checkoutdialog.cpp b/src/plugins/clearcase/checkoutdialog.cpp
index b2c6ef56579..b473a22e55a 100644
--- a/src/plugins/clearcase/checkoutdialog.cpp
+++ b/src/plugins/clearcase/checkoutdialog.cpp
@@ -41,7 +41,7 @@
namespace ClearCase {
namespace Internal {
-CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, QWidget *parent) :
+CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, bool showComment, QWidget *parent) :
QDialog(parent), ui(new Ui::CheckOutDialog), m_actSelector(0)
{
ui->setupUi(this);
@@ -59,6 +59,9 @@ CheckOutDialog::CheckOutDialog(const QString &fileName, bool isUcm, QWidget *par
ui->verticalLayout->insertWidget(1, line);
}
+ if (!showComment)
+ hideComment();
+
ui->buttonBox->button(QDialogButtonBox::Ok)->setFocus();
}
@@ -67,6 +70,14 @@ CheckOutDialog::~CheckOutDialog()
delete ui;
}
+void CheckOutDialog::hideComment()
+{
+ ui->lblComment->hide();
+ ui->txtComment->hide();
+ ui->verticalLayout->invalidate();
+ adjustSize();
+}
+
QString CheckOutDialog::activity() const
{
return m_actSelector ? m_actSelector->activity() : QString();
diff --git a/src/plugins/clearcase/checkoutdialog.h b/src/plugins/clearcase/checkoutdialog.h
index e42249bc8fe..b8ccd31cfa2 100644
--- a/src/plugins/clearcase/checkoutdialog.h
+++ b/src/plugins/clearcase/checkoutdialog.h
@@ -46,7 +46,7 @@ class CheckOutDialog : public QDialog
Q_OBJECT
public:
- explicit CheckOutDialog(const QString &fileName, bool isUcm, QWidget *parent = 0);
+ explicit CheckOutDialog(const QString &fileName, bool isUcm, bool showComment, QWidget *parent = 0);
~CheckOutDialog();
QString activity() const;
QString comment() const;
@@ -56,6 +56,7 @@ public:
bool isUseHijacked() const;
void hideHijack();
+ void hideComment();
private slots:
void toggleUnreserved(bool checked);
diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp
index 33a400b8da0..e08e3923812 100644
--- a/src/plugins/clearcase/clearcaseplugin.cpp
+++ b/src/plugins/clearcase/clearcaseplugin.cpp
@@ -1586,7 +1586,7 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
const QString relFile = QDir(topLevel).relativeFilePath(absPath);
const QString file = QDir::toNativeSeparators(relFile);
const QString title = QString::fromLatin1("Checkout %1").arg(file);
- CheckOutDialog coDialog(title, m_viewData.isUcm);
+ CheckOutDialog coDialog(title, m_viewData.isUcm, !m_settings.noComment);
// Only snapshot views can have hijacked files
bool isHijacked = (!m_viewData.isDynamic && (vcsStatus(absPath).status & FileStatus::Hijacked));
@@ -1598,11 +1598,13 @@ bool ClearCasePlugin::vcsOpen(const QString &workingDir, const QString &fileName
FileChangeBlocker fcb(absPath);
QStringList args(QLatin1String("checkout"));
- QString comment = coDialog.comment();
- if (comment.isEmpty())
+
+ const QString comment = coDialog.comment();
+ if (m_settings.noComment || comment.isEmpty())
args << QLatin1String("-nc");
else
args << QLatin1String("-c") << comment;
+
args << QLatin1String("-query");
const bool reserved = coDialog.isReserved();
const bool unreserved = !reserved || coDialog.isUnreserved();
diff --git a/src/plugins/clearcase/clearcasesettings.cpp b/src/plugins/clearcase/clearcasesettings.cpp
index f02c354d334..1c75fae46b7 100644
--- a/src/plugins/clearcase/clearcasesettings.cpp
+++ b/src/plugins/clearcase/clearcasesettings.cpp
@@ -42,6 +42,7 @@ static const char commandKeyC[] = "Command";
static const char historyCountKeyC[] = "HistoryCount";
static const char timeOutKeyC[] = "TimeOut";
static const char autoCheckOutKeyC[] = "AutoCheckOut";
+static const char noCommentKeyC[] = "NoComment";
static const char diffTypeKeyC[] = "DiffType";
static const char diffArgsKeyC[] = "DiffArgs";
static const char autoAssignActivityKeyC[] = "AutoAssignActivityName";
@@ -67,6 +68,7 @@ ClearCaseSettings::ClearCaseSettings() :
diffArgs(QLatin1String(defaultDiffArgs)),
autoAssignActivityName(true),
autoCheckOut(true),
+ noComment(false),
promptToCheckIn(false),
disableIndexer(false),
extDiffAvailable(false),
@@ -81,6 +83,7 @@ void ClearCaseSettings::fromSettings(QSettings *settings)
ccBinaryPath = Utils::Environment::systemEnvironment().searchInPath(ccCommand).toString();
timeOutS = settings->value(QLatin1String(timeOutKeyC), defaultTimeOutS).toInt();
autoCheckOut = settings->value(QLatin1String(autoCheckOutKeyC), false).toBool();
+ noComment = settings->value(QLatin1String(noCommentKeyC), false).toBool();
QString sDiffType = settings->value(QLatin1String(diffTypeKeyC), QLatin1String("Graphical")).toString();
switch (sDiffType[0].toUpper().toLatin1()) {
case 'G': diffType = GraphicalDiff; break;
@@ -108,6 +111,7 @@ void ClearCaseSettings::toSettings(QSettings *settings) const
settings->beginGroup(QLatin1String(groupC));
settings->setValue(QLatin1String(commandKeyC), ccCommand);
settings->setValue(QLatin1String(autoCheckOutKeyC), autoCheckOut);
+ settings->setValue(QLatin1String(noCommentKeyC), noComment);
settings->setValue(QLatin1String(timeOutKeyC), timeOutS);
QString sDiffType;
switch (diffType) {
@@ -136,6 +140,7 @@ bool ClearCaseSettings::equals(const ClearCaseSettings &s) const
&& historyCount == s.historyCount
&& timeOutS == s.timeOutS
&& autoCheckOut == s.autoCheckOut
+ && noComment == s.noComment
&& diffType == s.diffType
&& diffArgs == s.diffArgs
&& autoAssignActivityName == s.autoAssignActivityName
diff --git a/src/plugins/clearcase/clearcasesettings.h b/src/plugins/clearcase/clearcasesettings.h
index f8892985d5e..f0fe8446aa5 100644
--- a/src/plugins/clearcase/clearcasesettings.h
+++ b/src/plugins/clearcase/clearcasesettings.h
@@ -68,6 +68,7 @@ public:
QHash<QString, int> totalFiles;
bool autoAssignActivityName;
bool autoCheckOut;
+ bool noComment;
bool promptToCheckIn;
bool disableIndexer;
bool extDiffAvailable;
diff --git a/src/plugins/clearcase/settingspage.cpp b/src/plugins/clearcase/settingspage.cpp
index 88e06e34806..cefb10b6887 100644
--- a/src/plugins/clearcase/settingspage.cpp
+++ b/src/plugins/clearcase/settingspage.cpp
@@ -63,6 +63,7 @@ ClearCaseSettings SettingsPageWidget::settings() const
rc.ccBinaryPath = m_ui.commandPathChooser->path();
rc.timeOutS = m_ui.timeOutSpinBox->value();
rc.autoCheckOut = m_ui.autoCheckOutCheckBox->isChecked();
+ rc.noComment = m_ui.noCommentCheckBox->isChecked();
if (m_ui.graphicalDiffRadioButton->isChecked())
rc.diffType = GraphicalDiff;
else if (m_ui.externalDiffRadioButton->isChecked())
@@ -82,6 +83,7 @@ void SettingsPageWidget::setSettings(const ClearCaseSettings &s)
m_ui.commandPathChooser->setPath(s.ccCommand);
m_ui.timeOutSpinBox->setValue(s.timeOutS);
m_ui.autoCheckOutCheckBox->setChecked(s.autoCheckOut);
+ m_ui.noCommentCheckBox->setChecked(s.noComment);
bool extDiffAvailable = !Environment::systemEnvironment().searchInPath(QLatin1String("diff")).isEmpty();
if (extDiffAvailable) {
m_ui.diffWarningLabel->setVisible(false);
diff --git a/src/plugins/clearcase/settingspage.ui b/src/plugins/clearcase/settingspage.ui
index 47c89abfa53..654412b7b85 100644
--- a/src/plugins/clearcase/settingspage.ui
+++ b/src/plugins/clearcase/settingspage.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>363</width>
- <height>403</height>
+ <width>512</width>
+ <height>589</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@@ -65,7 +65,16 @@
<bool>false</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
- <property name="margin">
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
<number>0</number>
</property>
<item>
@@ -190,16 +199,6 @@
</property>
</widget>
</item>
- <item row="5" column="0">
- <widget class="QCheckBox" name="autoAssignActivityCheckBox">
- <property name="toolTip">
- <string>Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name.</string>
- </property>
- <property name="text">
- <string>Aut&amp;o assign activity names</string>
- </property>
- </widget>
- </item>
<item row="7" column="0">
<widget class="QCheckBox" name="promptCheckBox">
<property name="text">
@@ -231,6 +230,26 @@
</property>
</widget>
</item>
+ <item row="5" column="0">
+ <widget class="QCheckBox" name="autoAssignActivityCheckBox">
+ <property name="toolTip">
+ <string>Check this if you have a trigger that renames the activity automatically. You will not be prompted for activity name.</string>
+ </property>
+ <property name="text">
+ <string>Aut&amp;o assign activity names</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="noCommentCheckBox">
+ <property name="toolTip">
+ <string>Check out or check in files with no comment (-nc/omment).</string>
+ </property>
+ <property name="text">
+ <string>Do &amp;not prompt for comment during check out or check in</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>