comparison src/settingsdialog.cpp @ 628:5dc24f89b791

* "Use extension" check box now appears to the left of the button and label, and enables/disables the button and label depending on its state
author Sam Izzo <sam@humbug.net>
date Sun, 26 Aug 2012 02:39:08 +1000
parents 2d5b831c1a0a
children db62a0cb3037
comparison
equal deleted inserted replaced
627:d39d236a0ce8 628:5dc24f89b791
155 155
156 browse = new QPushButton(tr("Browse...")); 156 browse = new QPushButton(tr("Browse..."));
157 pathsLayout->addWidget(browse, row++, 1); 157 pathsLayout->addWidget(browse, row++, 1);
158 connect(browse, SIGNAL(clicked()), this, SLOT(sshPathBrowse())); 158 connect(browse, SIGNAL(clicked()), this, SLOT(sshPathBrowse()));
159 159
160 pathsLayout->addWidget(new QLabel(tr("EasyHg Mercurial extension:")), row, 0); 160 //!!! more info plz
161 m_useExtension = new QCheckBox(tr("Use EasyHg Mercurial extension"));
162 pathsLayout->addWidget(m_useExtension, row, 0);
163 connect(m_useExtension, SIGNAL(stateChanged(int)), this, SLOT(useExtension(int)));
161 164
162 m_extensionPathLabel = new QLineEdit(); 165 m_extensionPathLabel = new QLineEdit();
163 pathsLayout->addWidget(m_extensionPathLabel, row, 2); 166 pathsLayout->addWidget(m_extensionPathLabel, row, 2);
164 167
165 browse = new QPushButton(tr("Browse...")); 168 m_extensionBrowse = new QPushButton(tr("Browse..."));
166 pathsLayout->addWidget(browse, row++, 1); 169 pathsLayout->addWidget(m_extensionBrowse, row++, 1);
167 connect(browse, SIGNAL(clicked()), this, SLOT(extensionPathBrowse())); 170 connect(m_extensionBrowse, SIGNAL(clicked()), this, SLOT(extensionPathBrowse()));
168
169 //!!! more info plz
170 m_useExtension = new QCheckBox(tr("Use EasyHg Mercurial extension"));
171 pathsLayout->addWidget(m_useExtension, row++, 2);
172 171
173 pathsLayout->setRowStretch(row, 20); 172 pathsLayout->setRowStretch(row, 20);
174 173
175 174
176 reset(); // loads current defaults from settings 175 reset(); // loads current defaults from settings
220 219
221 void 220 void
222 SettingsDialog::extensionPathBrowse() 221 SettingsDialog::extensionPathBrowse()
223 { 222 {
224 browseFor(tr("EasyHg Mercurial extension"), m_extensionPathLabel); 223 browseFor(tr("EasyHg Mercurial extension"), m_extensionPathLabel);
224 }
225
226 void
227 SettingsDialog::useExtension(int)
228 {
229 m_extensionPathLabel->setEnabled(m_useExtension->isChecked());
230 m_extensionBrowse->setEnabled(m_useExtension->isChecked());
225 } 231 }
226 232
227 void 233 void
228 SettingsDialog::browseFor(QString title, QLineEdit *edit) 234 SettingsDialog::browseFor(QString title, QLineEdit *edit)
229 { 235 {
446 m_sshPathLabel->setText(settings.value("sshbinary").toString()); 452 m_sshPathLabel->setText(settings.value("sshbinary").toString());
447 m_extensionPathLabel->setText(settings.value("extensionpath").toString()); 453 m_extensionPathLabel->setText(settings.value("extensionpath").toString());
448 settings.endGroup(); 454 settings.endGroup();
449 settings.beginGroup(""); 455 settings.beginGroup("");
450 m_useExtension->setChecked(settings.value("useextension", true).toBool()); 456 m_useExtension->setChecked(settings.value("useextension", true).toBool());
457 useExtension(m_useExtension->isChecked());
451 settings.endGroup(); 458 settings.endGroup();
452 } 459 }
453 460
454 void 461 void
455 SettingsDialog::accept() 462 SettingsDialog::accept()