diff --git a/src/plugins/clearcase/checkoutdialog.cpp b/src/plugins/clearcase/checkoutdialog.cpp index b2c6ef5657959dd1b2de1f2c5d755b55b6f134f1..b473a22e55a50b101be11a11e53f760d0d6db2c5 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 e42249bc8fe227669bc4d8d2d7249b8272851e96..b8ccd31cfa2bc55f309974309297ed2cd70d7bfd 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 33a400b8da0f573fccbe341a1cda35973554344e..e08e39238123b2c8b3614bf532957137b41a81b5 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 f02c354d33499d232b27c40cd7d812436309471a..1c75fae46b77ea40a57fc4f08f5c96e55a504b4e 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 f8892985d5ef56286e73d4f43a3b27d4dbd121a2..f0fe8446aa50a55add7476e651c92c4d03ce8c1d 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 88e06e34806feb0a19dc40e1fea8c5611728b6ea..cefb10b688761deb5c10fb08f506f3018450abe3 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 47c89abfa53e38ef4f614a33e0cad0e0ce4d3100..654412b7b852c61c0a042aea5f9efb99c6518496 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&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&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 &not prompt for comment during check out or check in</string> + </property> + </widget> + </item> </layout> </widget> </item>