Mercurial > hg > easyhg
diff src/settingsdialog.cpp @ 489:86cdaa346e59
Merge
author | Chris Cannam |
---|---|
date | Wed, 17 Aug 2011 22:13:51 +0100 |
parents | 896b7903e8f2 |
children | 533519ebc0cb |
line wrap: on
line diff
--- a/src/settingsdialog.cpp Wed Aug 17 22:13:14 2011 +0100 +++ b/src/settingsdialog.cpp Wed Aug 17 22:13:51 2011 +0100 @@ -151,15 +151,6 @@ pathsLayout->addWidget(browse, row++, 1); connect(browse, SIGNAL(clicked()), this, SLOT(sshPathBrowse())); - pathsLayout->addWidget(new QLabel(tr("External text editor:")), row, 0); - - m_editPathLabel = new QLineEdit(); - pathsLayout->addWidget(m_editPathLabel, row, 2); - - browse = new QPushButton(tr("Browse...")); - pathsLayout->addWidget(browse, row++, 1); - connect(browse, SIGNAL(clicked()), this, SLOT(editPathBrowse())); - pathsLayout->addWidget(new QLabel(tr("EasyHg Mercurial extension:")), row, 0); m_extensionPathLabel = new QLineEdit(); @@ -222,12 +213,6 @@ } void -SettingsDialog::editPathBrowse() -{ - browseFor(tr("External text editor"), m_editPathLabel); -} - -void SettingsDialog::extensionPathBrowse() { browseFor(tr("EasyHg Mercurial extension"), m_extensionPathLabel); @@ -275,7 +260,6 @@ findDiffBinaryName(); findMergeBinaryName(); findSshBinaryName(); - findEditorBinaryName(); } void @@ -409,40 +393,6 @@ } void -SettingsDialog::findEditorBinaryName() -{ - QSettings settings; - settings.beginGroup("Locations"); - QString editor = settings.value("editorbinary", "").toString(); - if (editor != "" && QFile(editor).exists()) { - return; - } - QStringList bases; - bases -#if defined Q_OS_WIN32 - << "wordpad.exe" - << "C:\\Program Files\\Windows NT\\Accessories\\wordpad.exe" - << "notepad.exe" -#elif defined Q_OS_MAC - << "/Applications/TextEdit.app/Contents/MacOS/TextEdit" -#else - << "gedit" << "kate" -#endif - ; - bool found = false; - foreach (QString base, bases) { - editor = findInPath(base, m_installPath, true); - if (editor != "") { - found = true; - break; - } - } - if (found) { - settings.setValue("editorbinary", editor); - } -} - -void SettingsDialog::clear() { // Clear everything that has a default setting @@ -458,10 +408,9 @@ settings.remove("extdiffbinary"); settings.remove("mergebinary"); settings.remove("sshbinary"); - settings.remove("editorbinary"); settings.remove("extensionpath"); settings.endGroup(); - settings.beginGroup("General"); + settings.beginGroup(""); settings.remove("useextension"); settings.endGroup(); } @@ -488,10 +437,9 @@ m_diffPathLabel->setText(settings.value("extdiffbinary").toString()); m_mergePathLabel->setText(settings.value("mergebinary").toString()); m_sshPathLabel->setText(settings.value("sshbinary").toString()); - m_editPathLabel->setText(settings.value("editorbinary").toString()); m_extensionPathLabel->setText(settings.value("extensionpath").toString()); settings.endGroup(); - settings.beginGroup("General"); + settings.beginGroup(""); m_useExtension->setChecked(settings.value("useextension", true).toBool()); settings.endGroup(); } @@ -536,10 +484,9 @@ settings.setValue("extdiffbinary", m_diffPathLabel->text()); settings.setValue("mergebinary", m_mergePathLabel->text()); settings.setValue("sshbinary", m_sshPathLabel->text()); - settings.setValue("editorbinary", m_editPathLabel->text()); settings.setValue("extensionpath", m_extensionPathLabel->text()); settings.endGroup(); - settings.beginGroup("General"); + settings.beginGroup(""); settings.setValue("useextension", m_useExtension->isChecked()); settings.endGroup(); QDialog::accept();