forked from qt-creator/qt-creator
Missing files of previous commit
This commit is contained in:
@@ -59,6 +59,7 @@ private:
|
|||||||
|
|
||||||
class VCSBaseSettingsPage : public Core::IOptionsPage
|
class VCSBaseSettingsPage : public Core::IOptionsPage
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit VCSBaseSettingsPage(QObject *parent = 0);
|
explicit VCSBaseSettingsPage(QObject *parent = 0);
|
||||||
virtual ~VCSBaseSettingsPage();
|
virtual ~VCSBaseSettingsPage();
|
||||||
@@ -74,6 +75,9 @@ public:
|
|||||||
|
|
||||||
VCSBaseSettings settings() const { return m_settings; }
|
VCSBaseSettings settings() const { return m_settings; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void settingsChanged(const VCSBase::Internal::VCSBaseSettings &s);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateNickNames();
|
void updateNickNames();
|
||||||
QPointer<VCSBaseSettingsWidget> m_widget;
|
QPointer<VCSBaseSettingsWidget> m_widget;
|
||||||
|
|||||||
@@ -13,25 +13,62 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QCheckBox" name="promptForSubmitCheckBox">
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="promptForSubmitLabel">
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Prompt for submit:</string>
|
<string>Prompt to submit</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
<widget class="QCheckBox" name="promptForSubmitCheckBox"/>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="lineWrapCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Wrap submit message at:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item>
|
||||||
|
<widget class="QSpinBox" name="lineWrapSpinBox">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>40</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>200</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>72</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QFormLayout" name="formLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="submitMessageCheckScriptLabel">
|
<widget class="QLabel" name="submitMessageCheckScriptLabel">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
|
<string>An executable which is called with the submit message in a temporary file as first argument. It should return with an exit != 0 and a message on standard error to indicate failure.</string>
|
||||||
@@ -41,10 +78,10 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="Core::Utils::PathChooser" name="submitMessageCheckScriptChooser" native="true"/>
|
<widget class="Core::Utils::PathChooser" name="submitMessageCheckScriptChooser"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="nickNameMailMapLabel">
|
<widget class="QLabel" name="nickNameMailMapLabel">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>A file listing user names and email addresses in a 4-column mailmap format:
|
<string>A file listing user names and email addresses in a 4-column mailmap format:
|
||||||
@@ -55,10 +92,10 @@ name <email> alias <email></string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="Core::Utils::PathChooser" name="nickNameMailMapChooser" native="true"/>
|
<widget class="Core::Utils::PathChooser" name="nickNameMailMapChooser"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="nickNameFieldsFileLabel">
|
<widget class="QLabel" name="nickNameFieldsFileLabel">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>A simple file containing lines with field names like "Reviewed-By:" which will be added below the submit editor.</string>
|
<string>A simple file containing lines with field names like "Reviewed-By:" which will be added below the submit editor.</string>
|
||||||
@@ -68,8 +105,10 @@ name <email> alias <email></string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="Core::Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
|
<widget class="Core::Utils::PathChooser" name="nickNameFieldsFileChooser"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -136,6 +136,13 @@ VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *pa
|
|||||||
if (!settings.nickNameFieldListFile.isEmpty())
|
if (!settings.nickNameFieldListFile.isEmpty())
|
||||||
createUserFields(settings.nickNameFieldListFile);
|
createUserFields(settings.nickNameFieldListFile);
|
||||||
connect(m_d->m_widget, SIGNAL(fieldDialogRequested(int)), this, SLOT(slotSetFieldNickName(int)));
|
connect(m_d->m_widget, SIGNAL(fieldDialogRequested(int)), this, SLOT(slotSetFieldNickName(int)));
|
||||||
|
|
||||||
|
// wrapping. etc
|
||||||
|
slotUpdateEditorSettings(settings);
|
||||||
|
connect(Internal::VCSBasePlugin::instance(),
|
||||||
|
SIGNAL(settingsChanged(VCSBase::Internal::VCSBaseSettings)),
|
||||||
|
this, SLOT(slotUpdateEditorSettings(VCSBase::Internal::VCSBaseSettings)));
|
||||||
|
|
||||||
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
|
Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
|
||||||
aggregate->add(new Find::BaseTextFind(m_d->m_widget->descriptionEdit()));
|
aggregate->add(new Find::BaseTextFind(m_d->m_widget->descriptionEdit()));
|
||||||
aggregate->add(this);
|
aggregate->add(this);
|
||||||
@@ -148,6 +155,12 @@ VCSBaseSubmitEditor::~VCSBaseSubmitEditor()
|
|||||||
delete m_d;
|
delete m_d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VCSBaseSubmitEditor::slotUpdateEditorSettings(const Internal::VCSBaseSettings &s)
|
||||||
|
{
|
||||||
|
setLineWrapWidth(s.lineWrapWidth);
|
||||||
|
setLineWrap(s.lineWrap);
|
||||||
|
}
|
||||||
|
|
||||||
void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
|
void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
|
||||||
{
|
{
|
||||||
QFile fieldFile(fieldConfigFile);
|
QFile fieldFile(fieldConfigFile);
|
||||||
@@ -160,7 +173,8 @@ void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile)
|
|||||||
if (fields.empty())
|
if (fields.empty())
|
||||||
return;
|
return;
|
||||||
// Create a completer on user names
|
// Create a completer on user names
|
||||||
QCompleter *completer = new QCompleter(Internal::NickNameDialog::nickNameList(), this);
|
const QStandardItemModel *nickNameModel = Internal::VCSBasePlugin::instance()->nickNameModel();
|
||||||
|
QCompleter *completer = new QCompleter(Internal::NickNameDialog::nickNameList(nickNameModel), this);
|
||||||
foreach(const QString &field, fields) {
|
foreach(const QString &field, fields) {
|
||||||
const QString trimmedField = field.trimmed();
|
const QString trimmedField = field.trimmed();
|
||||||
if (!trimmedField.isEmpty())
|
if (!trimmedField.isEmpty())
|
||||||
@@ -202,6 +216,26 @@ void VCSBaseSubmitEditor::setFileListSelectionMode(QAbstractItemView::SelectionM
|
|||||||
m_d->m_widget->setFileListSelectionMode(sm);
|
m_d->m_widget->setFileListSelectionMode(sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool VCSBaseSubmitEditor::lineWrap() const
|
||||||
|
{
|
||||||
|
return m_d->m_widget->lineWrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VCSBaseSubmitEditor::setLineWrap(bool w)
|
||||||
|
{
|
||||||
|
m_d->m_widget->setLineWrap(w);
|
||||||
|
}
|
||||||
|
|
||||||
|
int VCSBaseSubmitEditor::lineWrapWidth() const
|
||||||
|
{
|
||||||
|
return m_d->m_widget->lineWrapWidth();
|
||||||
|
}
|
||||||
|
|
||||||
|
void VCSBaseSubmitEditor::setLineWrapWidth(int w)
|
||||||
|
{
|
||||||
|
m_d->m_widget->setLineWrapWidth(w);
|
||||||
|
}
|
||||||
|
|
||||||
void VCSBaseSubmitEditor::slotDescriptionChanged()
|
void VCSBaseSubmitEditor::slotDescriptionChanged()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -412,7 +446,7 @@ VCSBaseSubmitEditor::PromptSubmitResult
|
|||||||
QString VCSBaseSubmitEditor::promptForNickName()
|
QString VCSBaseSubmitEditor::promptForNickName()
|
||||||
{
|
{
|
||||||
if (!m_d->m_nickNameDialog)
|
if (!m_d->m_nickNameDialog)
|
||||||
m_d->m_nickNameDialog = new Internal::NickNameDialog(m_d->m_widget);
|
m_d->m_nickNameDialog = new Internal::NickNameDialog(Internal::VCSBasePlugin::instance()->nickNameModel(), m_d->m_widget);
|
||||||
if (m_d->m_nickNameDialog->exec() == QDialog::Accepted)
|
if (m_d->m_nickNameDialog->exec() == QDialog::Accepted)
|
||||||
return m_d->m_nickNameDialog->nickName();
|
return m_d->m_nickNameDialog->nickName();
|
||||||
return QString();
|
return QString();
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ class VCSBASE_EXPORT VCSBaseSubmitEditor : public Core::IEditor
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(int fileNameColumn READ fileNameColumn WRITE setFileNameColumn DESIGNABLE false)
|
Q_PROPERTY(int fileNameColumn READ fileNameColumn WRITE setFileNameColumn DESIGNABLE false)
|
||||||
Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true)
|
Q_PROPERTY(QAbstractItemView::SelectionMode fileListSelectionMode READ fileListSelectionMode WRITE setFileListSelectionMode DESIGNABLE true)
|
||||||
|
Q_PROPERTY(bool lineWrap READ lineWrap WRITE setLineWrap DESIGNABLE true);
|
||||||
|
Q_PROPERTY(int lineWrapWidth READ lineWrapWidth WRITE setLineWrapWidth DESIGNABLE true);
|
||||||
public:
|
public:
|
||||||
typedef QList<int> Context;
|
typedef QList<int> Context;
|
||||||
|
|
||||||
@@ -121,6 +123,12 @@ public:
|
|||||||
QAbstractItemView::SelectionMode fileListSelectionMode() const;
|
QAbstractItemView::SelectionMode fileListSelectionMode() const;
|
||||||
void setFileListSelectionMode(QAbstractItemView::SelectionMode sm);
|
void setFileListSelectionMode(QAbstractItemView::SelectionMode sm);
|
||||||
|
|
||||||
|
bool lineWrap() const;
|
||||||
|
void setLineWrap(bool);
|
||||||
|
|
||||||
|
int lineWrapWidth() const;
|
||||||
|
void setLineWrapWidth(int);
|
||||||
|
|
||||||
// Core::IEditor
|
// Core::IEditor
|
||||||
virtual bool createNew(const QString &contents);
|
virtual bool createNew(const QString &contents);
|
||||||
virtual bool open(const QString &fileName);
|
virtual bool open(const QString &fileName);
|
||||||
@@ -161,6 +169,7 @@ private slots:
|
|||||||
void slotCheckSubmitMessage();
|
void slotCheckSubmitMessage();
|
||||||
void slotInsertNickName();
|
void slotInsertNickName();
|
||||||
void slotSetFieldNickName(int);
|
void slotSetFieldNickName(int);
|
||||||
|
void slotUpdateEditorSettings(const VCSBase::Internal::VCSBaseSettings &);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* These hooks allow for modifying the contents that goes to
|
/* These hooks allow for modifying the contents that goes to
|
||||||
|
|||||||
Reference in New Issue
Block a user