Mercurial > hg > easyhg
comparison src/settingsdialog.cpp @ 472:2d57b81671de
Open the settings dialog at Paths tab when invoking it because of a failure to run hg
| author | Chris Cannam | 
|---|---|
| date | Thu, 14 Jul 2011 13:56:20 +0100 | 
| parents | 46ef2f03273c | 
| children | 7e8688784980 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 471:8a10d3c396e8 | 472:2d57b81671de | 
|---|---|
| 39 setWindowTitle(tr("Settings")); | 39 setWindowTitle(tr("Settings")); | 
| 40 | 40 | 
| 41 QGridLayout *mainLayout = new QGridLayout; | 41 QGridLayout *mainLayout = new QGridLayout; | 
| 42 setLayout(mainLayout); | 42 setLayout(mainLayout); | 
| 43 | 43 | 
| 44 QTabWidget *tw = new QTabWidget; | 44 m_tabs = new QTabWidget; | 
| 45 mainLayout->addWidget(tw, 0, 0); | 45 mainLayout->addWidget(m_tabs, 0, 0); | 
| 46 | 46 | 
| 47 | 47 | 
| 48 // QGroupBox *meBox = new QGroupBox(tr("User details")); | 48 // QGroupBox *meBox = new QGroupBox(tr("User details")); | 
| 49 // mainLayout->addWidget(meBox, 0, 0); | 49 // mainLayout->addWidget(meBox, 0, 0); | 
| 50 | 50 | 
| 51 QWidget *meBox = new QWidget; | 51 QWidget *meBox = new QWidget; | 
| 52 tw->addTab(meBox, tr("User details")); | 52 m_tabs->addTab(meBox, tr("User details")); | 
| 53 | 53 | 
| 54 QGridLayout *meLayout = new QGridLayout; | 54 QGridLayout *meLayout = new QGridLayout; | 
| 55 meBox->setLayout(meLayout); | 55 meBox->setLayout(meLayout); | 
| 56 | 56 | 
| 57 int row = 0; | 57 int row = 0; | 
| 71 | 71 | 
| 72 // QGroupBox *lookBox = new QGroupBox(tr("Presentation")); | 72 // QGroupBox *lookBox = new QGroupBox(tr("Presentation")); | 
| 73 // mainLayout->addWidget(lookBox, 1, 0); | 73 // mainLayout->addWidget(lookBox, 1, 0); | 
| 74 | 74 | 
| 75 QWidget *lookBox = new QWidget; | 75 QWidget *lookBox = new QWidget; | 
| 76 tw->addTab(lookBox, tr("Presentation")); | 76 m_tabs->addTab(lookBox, tr("Presentation")); | 
| 77 | 77 | 
| 78 QGridLayout *lookLayout = new QGridLayout; | 78 QGridLayout *lookLayout = new QGridLayout; | 
| 79 lookBox->setLayout(lookLayout); | 79 lookBox->setLayout(lookLayout); | 
| 80 | 80 | 
| 81 row = 0; | 81 row = 0; | 
| 104 | 104 | 
| 105 lookLayout->setRowStretch(row, 20); | 105 lookLayout->setRowStretch(row, 20); | 
| 106 | 106 | 
| 107 | 107 | 
| 108 QWidget *pathsBox = new QWidget; | 108 QWidget *pathsBox = new QWidget; | 
| 109 tw->addTab(pathsBox, tr("System application locations")); | 109 m_tabs->addTab(pathsBox, tr("System application locations")); | 
| 110 | 110 | 
| 111 // QGroupBox *pathsBox = new QGroupBox(tr("System application locations")); | 111 // QGroupBox *pathsBox = new QGroupBox(tr("System application locations")); | 
| 112 // mainLayout->addWidget(pathsBox, 2, 0); | 112 // mainLayout->addWidget(pathsBox, 2, 0); | 
| 113 QGridLayout *pathsLayout = new QGridLayout; | 113 QGridLayout *pathsLayout = new QGridLayout; | 
| 114 pathsBox->setLayout(pathsLayout); | 114 pathsBox->setLayout(pathsLayout); | 
| 183 connect(bbox->addButton(tr("Restore defaults"), QDialogButtonBox::ResetRole), | 183 connect(bbox->addButton(tr("Restore defaults"), QDialogButtonBox::ResetRole), | 
| 184 SIGNAL(clicked()), this, SLOT(restoreDefaults())); | 184 SIGNAL(clicked()), this, SLOT(restoreDefaults())); | 
| 185 connect(bbox, SIGNAL(accepted()), this, SLOT(accept())); | 185 connect(bbox, SIGNAL(accepted()), this, SLOT(accept())); | 
| 186 mainLayout->addWidget(bbox, 3, 0); | 186 mainLayout->addWidget(bbox, 3, 0); | 
| 187 m_ok = bbox->button(QDialogButtonBox::Ok); | 187 m_ok = bbox->button(QDialogButtonBox::Ok); | 
| 188 } | |
| 189 | |
| 190 void | |
| 191 SettingsDialog::setCurrentTab(Tab t) | |
| 192 { | |
| 193 switch (t) { | |
| 194 case PersonalDetailsTab: m_tabs->setCurrentIndex(0); break; | |
| 195 case PresentationTab: m_tabs->setCurrentIndex(1); break; | |
| 196 case PathsTab: m_tabs->setCurrentIndex(2); break; | |
| 197 } | |
| 188 } | 198 } | 
| 189 | 199 | 
| 190 void | 200 void | 
| 191 SettingsDialog::hgPathBrowse() | 201 SettingsDialog::hgPathBrowse() | 
| 192 { | 202 { | 
