forked from qt-creator/qt-creator
VCS: Aspectify common settings page
Change-Id: Ib860e40ba476b428c92766312bced2950d0390ac Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -6,7 +6,6 @@ add_qtc_plugin(VcsBase
|
|||||||
basevcseditorfactory.cpp basevcseditorfactory.h
|
basevcseditorfactory.cpp basevcseditorfactory.h
|
||||||
basevcssubmiteditorfactory.cpp basevcssubmiteditorfactory.h
|
basevcssubmiteditorfactory.cpp basevcssubmiteditorfactory.h
|
||||||
cleandialog.cpp cleandialog.h cleandialog.ui
|
cleandialog.cpp cleandialog.h cleandialog.ui
|
||||||
commonsettingspage.cpp commonsettingspage.h commonsettingspage.ui
|
|
||||||
commonvcssettings.cpp commonvcssettings.h
|
commonvcssettings.cpp commonvcssettings.h
|
||||||
diffandloghighlighter.cpp diffandloghighlighter.h
|
diffandloghighlighter.cpp diffandloghighlighter.h
|
||||||
nicknamedialog.cpp nicknamedialog.h nicknamedialog.ui
|
nicknamedialog.cpp nicknamedialog.h nicknamedialog.ui
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#include "commonsettingspage.h"
|
|
||||||
#include "vcsbaseconstants.h"
|
|
||||||
|
|
||||||
#include "ui_commonsettingspage.h"
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
|
||||||
#include <coreplugin/iversioncontrol.h>
|
|
||||||
#include <coreplugin/vcsmanager.h>
|
|
||||||
|
|
||||||
#include <utils/environment.h>
|
|
||||||
#include <utils/hostosinfo.h>
|
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
|
|
||||||
using namespace Utils;
|
|
||||||
|
|
||||||
namespace VcsBase {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// ------------------ VcsBaseSettingsWidget
|
|
||||||
|
|
||||||
CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) :
|
|
||||||
QWidget(parent),
|
|
||||||
m_ui(new Ui::CommonSettingsPage)
|
|
||||||
{
|
|
||||||
m_ui->setupUi(this);
|
|
||||||
m_ui->submitMessageCheckScriptChooser->setExpectedKind(PathChooser::ExistingCommand);
|
|
||||||
m_ui->submitMessageCheckScriptChooser->setHistoryCompleter(QLatin1String("Vcs.MessageCheckScript.History"));
|
|
||||||
m_ui->nickNameFieldsFileChooser->setExpectedKind(PathChooser::File);
|
|
||||||
m_ui->nickNameFieldsFileChooser->setHistoryCompleter(QLatin1String("Vcs.NickFields.History"));
|
|
||||||
m_ui->nickNameMailMapChooser->setExpectedKind(PathChooser::File);
|
|
||||||
m_ui->nickNameMailMapChooser->setHistoryCompleter(QLatin1String("Vcs.NickMap.History"));
|
|
||||||
m_ui->sshPromptChooser->setExpectedKind(PathChooser::ExistingCommand);
|
|
||||||
m_ui->sshPromptChooser->setHistoryCompleter(QLatin1String("Vcs.SshPrompt.History"));
|
|
||||||
|
|
||||||
updatePath();
|
|
||||||
|
|
||||||
connect(Core::VcsManager::instance(), &Core::VcsManager::configurationChanged,
|
|
||||||
this, &CommonSettingsWidget::updatePath);
|
|
||||||
connect(m_ui->cacheResetButton, &QPushButton::clicked,
|
|
||||||
Core::VcsManager::instance(), &Core::VcsManager::clearVersionControlCache);
|
|
||||||
}
|
|
||||||
|
|
||||||
CommonSettingsWidget::~CommonSettingsWidget()
|
|
||||||
{
|
|
||||||
delete m_ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
CommonVcsSettings CommonSettingsWidget::settings() const
|
|
||||||
{
|
|
||||||
CommonVcsSettings rc;
|
|
||||||
rc.nickNameMailMap = m_ui->nickNameMailMapChooser->filePath().toString();
|
|
||||||
rc.nickNameFieldListFile = m_ui->nickNameFieldsFileChooser->filePath().toString();
|
|
||||||
rc.submitMessageCheckScript = m_ui->submitMessageCheckScriptChooser->filePath().toString();
|
|
||||||
rc.lineWrap= m_ui->lineWrapCheckBox->isChecked();
|
|
||||||
rc.lineWrapWidth = m_ui->lineWrapSpinBox->value();
|
|
||||||
rc.sshPasswordPrompt = m_ui->sshPromptChooser->filePath().toString();
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommonSettingsWidget::setSettings(const CommonVcsSettings &s)
|
|
||||||
{
|
|
||||||
m_ui->nickNameMailMapChooser->setPath(s.nickNameMailMap);
|
|
||||||
m_ui->nickNameFieldsFileChooser->setPath(s.nickNameFieldListFile);
|
|
||||||
m_ui->submitMessageCheckScriptChooser->setPath(s.submitMessageCheckScript);
|
|
||||||
m_ui->lineWrapCheckBox->setChecked(s.lineWrap);
|
|
||||||
m_ui->lineWrapSpinBox->setValue(s.lineWrapWidth);
|
|
||||||
m_ui->sshPromptChooser->setPath(s.sshPasswordPrompt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommonSettingsWidget::updatePath()
|
|
||||||
{
|
|
||||||
Environment env = Environment::systemEnvironment();
|
|
||||||
QStringList toAdd = Core::VcsManager::additionalToolsPath();
|
|
||||||
env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator()));
|
|
||||||
m_ui->sshPromptChooser->setEnvironment(env);
|
|
||||||
}
|
|
||||||
|
|
||||||
// --------------- VcsBaseSettingsPage
|
|
||||||
CommonOptionsPage::CommonOptionsPage()
|
|
||||||
{
|
|
||||||
m_settings.fromSettings(Core::ICore::settings());
|
|
||||||
|
|
||||||
setId(Constants::VCS_COMMON_SETTINGS_ID);
|
|
||||||
setDisplayName(QCoreApplication::translate("VcsBase", Constants::VCS_COMMON_SETTINGS_NAME));
|
|
||||||
setCategory(Constants::VCS_SETTINGS_CATEGORY);
|
|
||||||
// The following act as blueprint for other pages in the same category:
|
|
||||||
setDisplayCategory(QCoreApplication::translate("VcsBase", "Version Control"));
|
|
||||||
setCategoryIconPath(":/vcsbase/images/settingscategory_vcs.png");
|
|
||||||
}
|
|
||||||
|
|
||||||
QWidget *CommonOptionsPage::widget()
|
|
||||||
{
|
|
||||||
if (!m_widget) {
|
|
||||||
m_widget = new CommonSettingsWidget;
|
|
||||||
m_widget->setSettings(m_settings);
|
|
||||||
}
|
|
||||||
return m_widget;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommonOptionsPage::apply()
|
|
||||||
{
|
|
||||||
if (m_widget) {
|
|
||||||
const CommonVcsSettings newSettings = m_widget->settings();
|
|
||||||
if (newSettings != m_settings) {
|
|
||||||
m_settings = newSettings;
|
|
||||||
m_settings.toSettings(Core::ICore::settings());
|
|
||||||
emit settingsChanged(m_settings);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommonOptionsPage::finish()
|
|
||||||
{
|
|
||||||
delete m_widget;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace VcsBase
|
|
||||||
@@ -1,78 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of Qt Creator.
|
|
||||||
**
|
|
||||||
** Commercial License Usage
|
|
||||||
** Licensees holding valid commercial Qt licenses may use this file in
|
|
||||||
** accordance with the commercial license agreement provided with the
|
|
||||||
** Software or, alternatively, in accordance with the terms contained in
|
|
||||||
** a written agreement between you and The Qt Company. For licensing terms
|
|
||||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
||||||
** information use the contact form at https://www.qt.io/contact-us.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU
|
|
||||||
** General Public License version 3 as published by the Free Software
|
|
||||||
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
||||||
** included in the packaging of this file. Please review the following
|
|
||||||
** information to ensure the GNU General Public License requirements will
|
|
||||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "commonvcssettings.h"
|
|
||||||
|
|
||||||
#include <coreplugin/dialogs/ioptionspage.h>
|
|
||||||
|
|
||||||
#include <QPointer>
|
|
||||||
|
|
||||||
namespace VcsBase {
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
namespace Ui { class CommonSettingsPage; }
|
|
||||||
|
|
||||||
class CommonSettingsWidget : public QWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit CommonSettingsWidget(QWidget *parent = nullptr);
|
|
||||||
~CommonSettingsWidget() override;
|
|
||||||
|
|
||||||
CommonVcsSettings settings() const;
|
|
||||||
void setSettings(const CommonVcsSettings &s);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updatePath();
|
|
||||||
|
|
||||||
Ui::CommonSettingsPage *m_ui;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommonOptionsPage final : public Core::IOptionsPage
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit CommonOptionsPage();
|
|
||||||
|
|
||||||
QWidget *widget() override;
|
|
||||||
void apply() override;
|
|
||||||
void finish() override;
|
|
||||||
|
|
||||||
CommonVcsSettings settings() const { return m_settings; }
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void settingsChanged(const VcsBase::Internal::CommonVcsSettings &s);
|
|
||||||
|
|
||||||
private:
|
|
||||||
QPointer<CommonSettingsWidget> m_widget;
|
|
||||||
CommonVcsSettings m_settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace VcsBase
|
|
||||||
@@ -1,181 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>VcsBase::Internal::CommonSettingsPage</class>
|
|
||||||
<widget class="QWidget" name="VcsBase::Internal::CommonSettingsPage">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>350</width>
|
|
||||||
<height>212</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<property name="fieldGrowthPolicy">
|
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
||||||
</property>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QCheckBox" name="lineWrapCheckBox">
|
|
||||||
<property name="text">
|
|
||||||
<string>Wrap submit message at:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QSpinBox" name="lineWrapSpinBox">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>false</bool>
|
|
||||||
</property>
|
|
||||||
<property name="suffix">
|
|
||||||
<string> characters</string>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>40</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>200</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>72</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="submitMessageCheckScriptLabel">
|
|
||||||
<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>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Submit message &check script:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>submitMessageCheckScriptChooser</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="submitMessageCheckScriptChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="nickNameMailMapLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>A file listing nicknames in a 4-column mailmap format:
|
|
||||||
'name <email> alias <email>'.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>User/&alias configuration file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>nickNameMailMapChooser</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="nickNameMailMapChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="nickNameFieldsFileLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>A simple file containing lines with field names like "Reviewed-By:" which will be added below the submit editor.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>User &fields configuration file:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>nickNameFieldsFileChooser</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="nickNameFieldsFileChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="sshPromptLabel">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Specifies a command that is executed to graphically prompt for a password,
|
|
||||||
should a repository require SSH-authentication (see documentation on SSH and the environment variable SSH_ASKPASS).</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>&SSH prompt command:</string>
|
|
||||||
</property>
|
|
||||||
<property name="buddy">
|
|
||||||
<cstring>sshPromptChooser</cstring>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="Utils::PathChooser" name="sshPromptChooser" native="true"/>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="0">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="1">
|
|
||||||
<widget class="QPushButton" name="cacheResetButton">
|
|
||||||
<property name="toolTip">
|
|
||||||
<string>Reset information about which version control system handles which directory.</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Reset VCS Cache</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<customwidgets>
|
|
||||||
<customwidget>
|
|
||||||
<class>Utils::PathChooser</class>
|
|
||||||
<extends>QWidget</extends>
|
|
||||||
<header location="global">utils/pathchooser.h</header>
|
|
||||||
<container>1</container>
|
|
||||||
<slots>
|
|
||||||
<signal>editingFinished()</signal>
|
|
||||||
<signal>browsingFinished()</signal>
|
|
||||||
</slots>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>lineWrapCheckBox</sender>
|
|
||||||
<signal>toggled(bool)</signal>
|
|
||||||
<receiver>lineWrapSpinBox</receiver>
|
|
||||||
<slot>setEnabled(bool)</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>175</x>
|
|
||||||
<y>21</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>216</x>
|
|
||||||
<y>21</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
||||||
@@ -25,87 +25,164 @@
|
|||||||
|
|
||||||
#include "commonvcssettings.h"
|
#include "commonvcssettings.h"
|
||||||
|
|
||||||
|
#include "vcsbaseconstants.h"
|
||||||
|
|
||||||
|
#include <coreplugin/icore.h>
|
||||||
|
#include <coreplugin/iversioncontrol.h>
|
||||||
|
#include <coreplugin/vcsmanager.h>
|
||||||
|
|
||||||
|
#include <utils/environment.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
|
#include <utils/layoutbuilder.h>
|
||||||
|
|
||||||
#include <QSettings>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QPushButton>
|
||||||
|
|
||||||
static const char settingsGroupC[] = "VCS";
|
using namespace Utils;
|
||||||
static const char nickNameMailMapKeyC[] = "NickNameMailMap";
|
|
||||||
static const char nickNameFieldListFileKeyC[] = "NickNameFieldListFile";
|
|
||||||
static const char submitMessageCheckScriptKeyC[] = "SubmitMessageCheckScript";
|
|
||||||
static const char lineWrapKeyC[] = "LineWrap";
|
|
||||||
static const char lineWrapWidthKeyC[] = "LineWrapWidth";
|
|
||||||
static const char sshPasswordPromptKeyC[] = "SshPasswordPrompt";
|
|
||||||
|
|
||||||
static const int lineWrapWidthDefault = 72;
|
|
||||||
static const bool lineWrapDefault = true;
|
|
||||||
|
|
||||||
// Return default for the ssh-askpass command (default to environment)
|
|
||||||
static inline QString sshPasswordPromptDefault()
|
|
||||||
{
|
|
||||||
const QByteArray envSetting = qgetenv("SSH_ASKPASS");
|
|
||||||
if (!envSetting.isEmpty())
|
|
||||||
return QString::fromLocal8Bit(envSetting);
|
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
|
||||||
return QLatin1String("win-ssh-askpass");
|
|
||||||
return QLatin1String("ssh-askpass");
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
CommonVcsSettings::CommonVcsSettings() :
|
// Return default for the ssh-askpass command (default to environment)
|
||||||
sshPasswordPrompt(sshPasswordPromptDefault()),
|
static QString sshPasswordPromptDefault()
|
||||||
lineWrap(lineWrapDefault),
|
|
||||||
lineWrapWidth(lineWrapWidthDefault)
|
|
||||||
{
|
{
|
||||||
|
const QByteArray envSetting = qgetenv("SSH_ASKPASS");
|
||||||
|
if (!envSetting.isEmpty())
|
||||||
|
return QString::fromLocal8Bit(envSetting);
|
||||||
|
if (HostOsInfo::isWindowsHost())
|
||||||
|
return QLatin1String("win-ssh-askpass");
|
||||||
|
return QLatin1String("ssh-askpass");
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonVcsSettings::toSettings(Utils::QtcSettings *s) const
|
CommonVcsSettings::CommonVcsSettings()
|
||||||
{
|
{
|
||||||
s->beginGroup(settingsGroupC);
|
setSettingsGroup("VCS");
|
||||||
s->setValueWithDefault(nickNameMailMapKeyC, nickNameMailMap);
|
setAutoApply(false);
|
||||||
s->setValueWithDefault(nickNameFieldListFileKeyC, nickNameFieldListFile);
|
|
||||||
s->setValueWithDefault(submitMessageCheckScriptKeyC, submitMessageCheckScript);
|
registerAspect(&nickNameMailMap);
|
||||||
s->setValueWithDefault(lineWrapKeyC, lineWrap, lineWrapDefault);
|
nickNameMailMap.setSettingsKey("NickNameMailMap");
|
||||||
s->setValueWithDefault(lineWrapWidthKeyC, lineWrapWidth, lineWrapWidthDefault);
|
nickNameMailMap.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
s->setValueWithDefault(sshPasswordPromptKeyC, sshPasswordPrompt, sshPasswordPromptDefault());
|
nickNameMailMap.setExpectedKind(PathChooser::File);
|
||||||
s->endGroup();
|
nickNameMailMap.setHistoryCompleter("Vcs.NickMap.History");
|
||||||
|
nickNameMailMap.setLabelText(tr("User/&alias configuration file:"));
|
||||||
|
nickNameMailMap.setToolTip(tr("A file listing nicknames in a 4-column mailmap format:\n"
|
||||||
|
"'name <email> alias <email>'."));
|
||||||
|
|
||||||
|
registerAspect(&nickNameFieldListFile);
|
||||||
|
nickNameFieldListFile.setSettingsKey("NickNameFieldListFile");
|
||||||
|
nickNameFieldListFile.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
|
nickNameFieldListFile.setExpectedKind(PathChooser::File);
|
||||||
|
nickNameFieldListFile.setHistoryCompleter("Vcs.NickFields.History");
|
||||||
|
nickNameFieldListFile.setLabelText(tr("User &fields configuration file:"));
|
||||||
|
nickNameFieldListFile.setToolTip(tr("A simple file containing lines with field names like "
|
||||||
|
"\"Reviewed-By:\" which will be added below the submit editor."));
|
||||||
|
|
||||||
|
registerAspect(&submitMessageCheckScript);
|
||||||
|
submitMessageCheckScript.setSettingsKey("SubmitMessageCheckScript");
|
||||||
|
submitMessageCheckScript.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
|
submitMessageCheckScript.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
|
submitMessageCheckScript.setHistoryCompleter("Vcs.MessageCheckScript.History");
|
||||||
|
submitMessageCheckScript.setLabelText(tr("Submit message &check script:"));
|
||||||
|
submitMessageCheckScript.setToolTip(tr("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."));
|
||||||
|
|
||||||
|
registerAspect(&sshPasswordPrompt);
|
||||||
|
sshPasswordPrompt.setSettingsKey("SshPasswordPrompt");
|
||||||
|
sshPasswordPrompt.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||||
|
sshPasswordPrompt.setExpectedKind(PathChooser::ExistingCommand);
|
||||||
|
sshPasswordPrompt.setHistoryCompleter("Vcs.SshPrompt.History");
|
||||||
|
sshPasswordPrompt.setDefaultValue(sshPasswordPromptDefault());
|
||||||
|
sshPasswordPrompt.setLabelText(tr("&SSH prompt command:"));
|
||||||
|
sshPasswordPrompt.setToolTip(tr("Specifies a command that is executed to graphically prompt "
|
||||||
|
"for a password,\nshould a repository require SSH-authentication "
|
||||||
|
"(see documentation on SSH and the environment variable SSH_ASKPASS)."));
|
||||||
|
|
||||||
|
registerAspect(&lineWrap);
|
||||||
|
lineWrap.setSettingsKey("LineWrap");
|
||||||
|
lineWrap.setDefaultValue(72);
|
||||||
|
lineWrap.setLabelText(tr("Wrap submit message at:"));
|
||||||
|
|
||||||
|
registerAspect(&lineWrapWidth);
|
||||||
|
lineWrapWidth.setSettingsKey("LineWrapWidth");
|
||||||
|
lineWrapWidth.setSuffix(tr(" characters"));
|
||||||
|
lineWrapWidth.setDefaultValue(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommonVcsSettings::fromSettings(QSettings *s)
|
// CommonSettingsWidget
|
||||||
|
|
||||||
|
class CommonSettingsWidget final : public Core::IOptionsPageWidget
|
||||||
{
|
{
|
||||||
s->beginGroup(QLatin1String(settingsGroupC));
|
public:
|
||||||
nickNameMailMap = s->value(QLatin1String(nickNameMailMapKeyC), QString()).toString();
|
CommonSettingsWidget(CommonOptionsPage *page);
|
||||||
nickNameFieldListFile = s->value(QLatin1String(nickNameFieldListFileKeyC), QString()).toString();
|
|
||||||
submitMessageCheckScript = s->value(QLatin1String(submitMessageCheckScriptKeyC), QString()).toString();
|
void apply() final;
|
||||||
lineWrap = s->value(QLatin1String(lineWrapKeyC), lineWrapDefault).toBool();
|
|
||||||
lineWrapWidth = s->value(QLatin1String(lineWrapWidthKeyC), lineWrapWidthDefault).toInt();
|
private:
|
||||||
sshPasswordPrompt = s->value(QLatin1String(sshPasswordPromptKeyC), sshPasswordPromptDefault()).toString();
|
void updatePath();
|
||||||
s->endGroup();
|
CommonOptionsPage *m_page;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
CommonSettingsWidget::CommonSettingsWidget(CommonOptionsPage *page)
|
||||||
|
: m_page(page)
|
||||||
|
{
|
||||||
|
CommonVcsSettings &s = m_page->settings();
|
||||||
|
|
||||||
|
auto cacheResetButton = new QPushButton(CommonVcsSettings::tr("Reset VCS Cache"));
|
||||||
|
cacheResetButton->setToolTip(CommonVcsSettings::tr("Reset information about which "
|
||||||
|
"version control system handles which directory."));
|
||||||
|
|
||||||
|
updatePath();
|
||||||
|
|
||||||
|
using namespace Layouting;
|
||||||
|
Column {
|
||||||
|
Row { s.lineWrap, s.lineWrapWidth, Stretch() },
|
||||||
|
Form {
|
||||||
|
s.submitMessageCheckScript,
|
||||||
|
s.nickNameMailMap,
|
||||||
|
s.nickNameFieldListFile,
|
||||||
|
s.sshPasswordPrompt,
|
||||||
|
{}, cacheResetButton
|
||||||
|
}
|
||||||
|
}.attachTo(this);
|
||||||
|
|
||||||
|
connect(Core::VcsManager::instance(), &Core::VcsManager::configurationChanged,
|
||||||
|
this, &CommonSettingsWidget::updatePath);
|
||||||
|
connect(cacheResetButton, &QPushButton::clicked,
|
||||||
|
Core::VcsManager::instance(), &Core::VcsManager::clearVersionControlCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CommonVcsSettings::equals(const CommonVcsSettings &rhs) const
|
void CommonSettingsWidget::updatePath()
|
||||||
{
|
{
|
||||||
return lineWrap == rhs.lineWrap
|
Environment env = Environment::systemEnvironment();
|
||||||
&& lineWrapWidth == rhs.lineWrapWidth
|
QStringList toAdd = Core::VcsManager::additionalToolsPath();
|
||||||
&& nickNameMailMap == rhs.nickNameMailMap
|
env.appendOrSetPath(toAdd.join(HostOsInfo::pathListSeparator()));
|
||||||
&& nickNameFieldListFile == rhs.nickNameFieldListFile
|
m_page->settings().sshPasswordPrompt.setEnvironment(env);
|
||||||
&& submitMessageCheckScript == rhs.submitMessageCheckScript
|
|
||||||
&& sshPasswordPrompt == rhs.sshPasswordPrompt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug operator<<(QDebug d,const CommonVcsSettings& s)
|
void CommonSettingsWidget::apply()
|
||||||
{
|
{
|
||||||
d.nospace() << " lineWrap=" << s.lineWrap
|
CommonVcsSettings &s = m_page->settings();
|
||||||
<< " lineWrapWidth=" << s.lineWrapWidth
|
if (s.isDirty()) {
|
||||||
<< " nickNameMailMap='" << s.nickNameMailMap
|
s.apply();
|
||||||
<< "' nickNameFieldListFile='" << s.nickNameFieldListFile
|
emit m_page->settingsChanged();
|
||||||
<< "'submitMessageCheckScript='" << s.submitMessageCheckScript
|
}
|
||||||
<< "'sshPasswordPrompt='" << s.sshPasswordPrompt
|
}
|
||||||
<< "'\n";
|
|
||||||
return d;
|
// CommonOptionsPage
|
||||||
|
|
||||||
|
CommonOptionsPage::CommonOptionsPage()
|
||||||
|
{
|
||||||
|
m_settings.readSettings(Core::ICore::settings());
|
||||||
|
|
||||||
|
setId(Constants::VCS_COMMON_SETTINGS_ID);
|
||||||
|
setDisplayName(QCoreApplication::translate("VcsBase", Constants::VCS_COMMON_SETTINGS_NAME));
|
||||||
|
setCategory(Constants::VCS_SETTINGS_CATEGORY);
|
||||||
|
// The following act as blueprint for other pages in the same category:
|
||||||
|
setDisplayCategory(QCoreApplication::translate("VcsBase", "Version Control"));
|
||||||
|
setCategoryIconPath(":/vcsbase/images/settingscategory_vcs.png");
|
||||||
|
setWidgetCreator([this] { return new CommonSettingsWidget(this); });
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -25,44 +25,51 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <coreplugin/dialogs/ioptionspage.h>
|
||||||
|
|
||||||
|
#include <utils/aspects.h>
|
||||||
#include <utils/qtcsettings.h>
|
#include <utils/qtcsettings.h>
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
class QDebug;
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
// Common VCS settings, message check script and user nick names.
|
class CommonVcsSettings : public Utils::AspectContainer
|
||||||
class CommonVcsSettings
|
|
||||||
{
|
{
|
||||||
|
Q_DECLARE_TR_FUNCTIONS(VcsBase::Internal::CommonVcsSettings)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CommonVcsSettings();
|
CommonVcsSettings();
|
||||||
|
|
||||||
QString nickNameMailMap;
|
Utils::StringAspect nickNameMailMap;
|
||||||
QString nickNameFieldListFile;
|
Utils::StringAspect nickNameFieldListFile;
|
||||||
|
|
||||||
QString submitMessageCheckScript;
|
Utils::StringAspect submitMessageCheckScript;
|
||||||
|
|
||||||
// Executable run to graphically prompt for a SSH-password.
|
// Executable run to graphically prompt for a SSH-password.
|
||||||
QString sshPasswordPrompt;
|
Utils::StringAspect sshPasswordPrompt;
|
||||||
|
|
||||||
bool lineWrap;
|
Utils::BoolAspect lineWrap;
|
||||||
int lineWrapWidth;
|
Utils::IntegerAspect lineWrapWidth;
|
||||||
|
|
||||||
void toSettings(Utils::QtcSettings *) const;
|
|
||||||
void fromSettings(QSettings *);
|
|
||||||
|
|
||||||
bool equals(const CommonVcsSettings &rhs) const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool operator==(const CommonVcsSettings &s1, const CommonVcsSettings &s2) { return s1.equals(s2); }
|
|
||||||
inline bool operator!=(const CommonVcsSettings &s1, const CommonVcsSettings &s2) { return !s1.equals(s2); }
|
|
||||||
|
|
||||||
QDebug operator<<(QDebug, const CommonVcsSettings &);
|
QDebug operator<<(QDebug, const CommonVcsSettings &);
|
||||||
|
|
||||||
|
class CommonOptionsPage final : public Core::IOptionsPage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit CommonOptionsPage();
|
||||||
|
|
||||||
|
CommonVcsSettings &settings() { return m_settings; }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void settingsChanged();
|
||||||
|
|
||||||
|
private:
|
||||||
|
CommonVcsSettings m_settings;
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ HEADERS += vcsbase_global.h \
|
|||||||
basevcssubmiteditorfactory.h \
|
basevcssubmiteditorfactory.h \
|
||||||
submitfilemodel.h \
|
submitfilemodel.h \
|
||||||
commonvcssettings.h \
|
commonvcssettings.h \
|
||||||
commonsettingspage.h \
|
|
||||||
nicknamedialog.h \
|
nicknamedialog.h \
|
||||||
vcsoutputwindow.h \
|
vcsoutputwindow.h \
|
||||||
cleandialog.h \
|
cleandialog.h \
|
||||||
@@ -44,7 +43,6 @@ SOURCES += vcsplugin.cpp \
|
|||||||
basevcssubmiteditorfactory.cpp \
|
basevcssubmiteditorfactory.cpp \
|
||||||
submitfilemodel.cpp \
|
submitfilemodel.cpp \
|
||||||
commonvcssettings.cpp \
|
commonvcssettings.cpp \
|
||||||
commonsettingspage.cpp \
|
|
||||||
nicknamedialog.cpp \
|
nicknamedialog.cpp \
|
||||||
vcsoutputwindow.cpp \
|
vcsoutputwindow.cpp \
|
||||||
cleandialog.cpp \
|
cleandialog.cpp \
|
||||||
@@ -58,7 +56,7 @@ SOURCES += vcsplugin.cpp \
|
|||||||
|
|
||||||
RESOURCES += vcsbase.qrc
|
RESOURCES += vcsbase.qrc
|
||||||
|
|
||||||
FORMS += commonsettingspage.ui \
|
FORMS += \
|
||||||
nicknamedialog.ui \
|
nicknamedialog.ui \
|
||||||
cleandialog.ui \
|
cleandialog.ui \
|
||||||
submiteditorwidget.ui
|
submiteditorwidget.ui
|
||||||
|
|||||||
@@ -28,9 +28,6 @@ QtcPlugin {
|
|||||||
"cleandialog.cpp",
|
"cleandialog.cpp",
|
||||||
"cleandialog.h",
|
"cleandialog.h",
|
||||||
"cleandialog.ui",
|
"cleandialog.ui",
|
||||||
"commonsettingspage.cpp",
|
|
||||||
"commonsettingspage.h",
|
|
||||||
"commonsettingspage.ui",
|
|
||||||
"commonvcssettings.cpp",
|
"commonvcssettings.cpp",
|
||||||
"commonvcssettings.h",
|
"commonvcssettings.h",
|
||||||
"diffandloghighlighter.cpp",
|
"diffandloghighlighter.cpp",
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ QString findRepositoryForDirectory(const QString &dirS, const QString &checkFile
|
|||||||
// Is SSH prompt configured?
|
// Is SSH prompt configured?
|
||||||
QString sshPrompt()
|
QString sshPrompt()
|
||||||
{
|
{
|
||||||
return Internal::VcsPlugin::instance()->settings().sshPasswordPrompt;
|
return Internal::VcsPlugin::instance()->settings().sshPasswordPrompt.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isSshPromptConfigured()
|
bool isSshPromptConfigured()
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ using namespace Utils;
|
|||||||
|
|
||||||
static inline QString submitMessageCheckScript()
|
static inline QString submitMessageCheckScript()
|
||||||
{
|
{
|
||||||
return VcsPlugin::instance()->settings().submitMessageCheckScript;
|
return VcsPlugin::instance()->settings().submitMessageCheckScript.value();
|
||||||
}
|
}
|
||||||
|
|
||||||
class VcsBaseSubmitEditorPrivate
|
class VcsBaseSubmitEditorPrivate
|
||||||
@@ -199,32 +199,33 @@ void VcsBaseSubmitEditor::setParameters(const VcsBaseSubmitEditorParameters &par
|
|||||||
connect(descriptionEdit, &QTextEdit::textChanged,
|
connect(descriptionEdit, &QTextEdit::textChanged,
|
||||||
this, &VcsBaseSubmitEditor::fileContentsChanged);
|
this, &VcsBaseSubmitEditor::fileContentsChanged);
|
||||||
|
|
||||||
const CommonVcsSettings settings = VcsPlugin::instance()->settings();
|
const CommonVcsSettings &settings = VcsPlugin::instance()->settings();
|
||||||
// Add additional context menu settings
|
// Add additional context menu settings
|
||||||
if (!settings.submitMessageCheckScript.isEmpty() || !settings.nickNameMailMap.isEmpty()) {
|
if (!settings.submitMessageCheckScript.value().isEmpty()
|
||||||
|
|| !settings.nickNameMailMap.value().isEmpty()) {
|
||||||
auto sep = new QAction(this);
|
auto sep = new QAction(this);
|
||||||
sep->setSeparator(true);
|
sep->setSeparator(true);
|
||||||
d->m_widget->addDescriptionEditContextMenuAction(sep);
|
d->m_widget->addDescriptionEditContextMenuAction(sep);
|
||||||
// Run check action
|
// Run check action
|
||||||
if (!settings.submitMessageCheckScript.isEmpty()) {
|
if (!settings.submitMessageCheckScript.value().isEmpty()) {
|
||||||
auto checkAction = new QAction(tr("Check Message"), this);
|
auto checkAction = new QAction(tr("Check Message"), this);
|
||||||
connect(checkAction, &QAction::triggered,
|
connect(checkAction, &QAction::triggered,
|
||||||
this, &VcsBaseSubmitEditor::slotCheckSubmitMessage);
|
this, &VcsBaseSubmitEditor::slotCheckSubmitMessage);
|
||||||
d->m_widget->addDescriptionEditContextMenuAction(checkAction);
|
d->m_widget->addDescriptionEditContextMenuAction(checkAction);
|
||||||
}
|
}
|
||||||
// Insert nick
|
// Insert nick
|
||||||
if (!settings.nickNameMailMap.isEmpty()) {
|
if (!settings.nickNameMailMap.value().isEmpty()) {
|
||||||
auto insertAction = new QAction(tr("Insert Name..."), this);
|
auto insertAction = new QAction(tr("Insert Name..."), this);
|
||||||
connect(insertAction, &QAction::triggered, this, &VcsBaseSubmitEditor::slotInsertNickName);
|
connect(insertAction, &QAction::triggered, this, &VcsBaseSubmitEditor::slotInsertNickName);
|
||||||
d->m_widget->addDescriptionEditContextMenuAction(insertAction);
|
d->m_widget->addDescriptionEditContextMenuAction(insertAction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Do we have user fields?
|
// Do we have user fields?
|
||||||
if (!settings.nickNameFieldListFile.isEmpty())
|
if (!settings.nickNameFieldListFile.value().isEmpty())
|
||||||
createUserFields(settings.nickNameFieldListFile);
|
createUserFields(settings.nickNameFieldListFile.value());
|
||||||
|
|
||||||
// wrapping. etc
|
// wrapping. etc
|
||||||
slotUpdateEditorSettings(settings);
|
slotUpdateEditorSettings();
|
||||||
connect(VcsPlugin::instance(), &VcsPlugin::settingsChanged,
|
connect(VcsPlugin::instance(), &VcsPlugin::settingsChanged,
|
||||||
this, &VcsBaseSubmitEditor::slotUpdateEditorSettings);
|
this, &VcsBaseSubmitEditor::slotUpdateEditorSettings);
|
||||||
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
connect(Core::EditorManager::instance(), &Core::EditorManager::currentEditorChanged,
|
||||||
@@ -250,10 +251,11 @@ VcsBaseSubmitEditor::~VcsBaseSubmitEditor()
|
|||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VcsBaseSubmitEditor::slotUpdateEditorSettings(const CommonVcsSettings &s)
|
void VcsBaseSubmitEditor::slotUpdateEditorSettings()
|
||||||
{
|
{
|
||||||
setLineWrapWidth(s.lineWrapWidth);
|
const CommonVcsSettings &s = VcsPlugin::instance()->settings();
|
||||||
setLineWrap(s.lineWrap);
|
setLineWrapWidth(s.lineWrapWidth.value());
|
||||||
|
setLineWrap(s.lineWrap.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return a trimmed list of non-empty field texts
|
// Return a trimmed list of non-empty field texts
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ private:
|
|||||||
void slotCheckSubmitMessage();
|
void slotCheckSubmitMessage();
|
||||||
void slotInsertNickName();
|
void slotInsertNickName();
|
||||||
void slotSetFieldNickName(int);
|
void slotSetFieldNickName(int);
|
||||||
void slotUpdateEditorSettings(const VcsBase::Internal::CommonVcsSettings &);
|
void slotUpdateEditorSettings();
|
||||||
|
|
||||||
void createUserFields(const QString &fieldConfigFile);
|
void createUserFields(const QString &fieldConfigFile);
|
||||||
bool checkSubmitMessage(QString *errorMessage) const;
|
bool checkSubmitMessage(QString *errorMessage) const;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "vcsbaseconstants.h"
|
#include "vcsbaseconstants.h"
|
||||||
#include "vcsbasesubmiteditor.h"
|
#include "vcsbasesubmiteditor.h"
|
||||||
|
|
||||||
#include "commonsettingspage.h"
|
#include "commonvcssettings.h"
|
||||||
#include "nicknamedialog.h"
|
#include "nicknamedialog.h"
|
||||||
#include "vcsoutputwindow.h"
|
#include "vcsoutputwindow.h"
|
||||||
#include "wizard/vcscommandpage.h"
|
#include "wizard/vcscommandpage.h"
|
||||||
@@ -140,7 +140,7 @@ VcsPlugin *VcsPlugin::instance()
|
|||||||
return m_instance;
|
return m_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommonVcsSettings VcsPlugin::settings() const
|
CommonVcsSettings &VcsPlugin::settings() const
|
||||||
{
|
{
|
||||||
return d->m_settingsPage.settings();
|
return d->m_settingsPage.settings();
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ QStandardItemModel *VcsPlugin::nickNameModel()
|
|||||||
void VcsPlugin::populateNickNameModel()
|
void VcsPlugin::populateNickNameModel()
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!NickNameDialog::populateModelFromMailCapFile(settings().nickNameMailMap,
|
if (!NickNameDialog::populateModelFromMailCapFile(settings().nickNameMailMap.value(),
|
||||||
d->m_nickNameModel,
|
d->m_nickNameModel,
|
||||||
&errorMessage)) {
|
&errorMessage)) {
|
||||||
qWarning("%s", qPrintable(errorMessage));
|
qWarning("%s", qPrintable(errorMessage));
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
static VcsPlugin *instance();
|
static VcsPlugin *instance();
|
||||||
|
|
||||||
CommonVcsSettings settings() const;
|
CommonVcsSettings &settings() const;
|
||||||
|
|
||||||
// Model of user nick names used for the submit
|
// Model of user nick names used for the submit
|
||||||
// editor. Stored centrally here to achieve delayed
|
// editor. Stored centrally here to achieve delayed
|
||||||
@@ -60,7 +60,7 @@ public:
|
|||||||
QStandardItemModel *nickNameModel();
|
QStandardItemModel *nickNameModel();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void settingsChanged(const VcsBase::Internal::CommonVcsSettings &s);
|
void settingsChanged();
|
||||||
void submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *e, bool *result);
|
void submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *e, bool *result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user