Commit 6fe3d3bd authored by Tobias Hunger's avatar Tobias Hunger

Git: Only show note about perl if perl is not found in PATH

Task-number: QTCREATORBUG-17154
Change-Id: I4602084204a3b26ead8d4e3e8108d6d4642c829a
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
parent e37539a1
......@@ -29,9 +29,11 @@
#include "gitclient.h"
#include <coreplugin/icore.h>
#include <coreplugin/messagebox.h>
#include <vcsbase/vcsbaseconstants.h>
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <coreplugin/messagebox.h>
#include <QDir>
#include <QDebug>
......@@ -58,9 +60,13 @@ SettingsPageWidget::SettingsPageWidget(QWidget *parent) : VcsClientOptionsPageWi
} else {
m_ui.winHomeCheckBox->setVisible(false);
}
updateNoteField();
m_ui.repBrowserCommandPathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui.repBrowserCommandPathChooser->setHistoryCompleter("Git.RepoCommand.History");
m_ui.repBrowserCommandPathChooser->setPromptDialogTitle(tr("Git Repository Browser Command"));
connect(m_ui.pathLineEdit, &QLineEdit::textChanged, this, &SettingsPageWidget::updateNoteField);
}
VcsBaseClientSettings SettingsPageWidget::settings() const
......@@ -90,6 +96,17 @@ void SettingsPageWidget::setSettings(const VcsBaseClientSettings &s)
m_ui.repBrowserCommandPathChooser->setPath(s.stringValue(GitSettings::repositoryBrowserCmd));
}
void SettingsPageWidget::updateNoteField()
{
Utils::Environment env = Utils::Environment::systemEnvironment();
env.prependOrSetPath(m_ui.pathLineEdit->text());
bool showNote = env.searchInPath("perl").isEmpty();
m_ui.noteFieldlabel->setVisible(showNote);
m_ui.noteLabel->setVisible(showNote);
}
// -------- SettingsPage
SettingsPage::SettingsPage(Core::IVersionControl *control) :
VcsClientOptionsPage(control, GitPlugin::client())
......
......@@ -53,6 +53,8 @@ public:
void setSettings(const VcsBase::VcsBaseClientSettings &s) override;
private:
void updateNoteField();
Ui::SettingsPage m_ui;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment