diff src/settingsdialog.cpp @ 466:46ef2f03273c

Split out preferences into three separate tabs
author Chris Cannam
date Mon, 04 Jul 2011 14:12:10 +0100
parents b57d50114d8d
children 2d57b81671de
line wrap: on
line diff
--- a/src/settingsdialog.cpp	Mon Jul 04 14:03:31 2011 +0100
+++ b/src/settingsdialog.cpp	Mon Jul 04 14:12:10 2011 +0100
@@ -26,6 +26,7 @@
 #include <QDir>
 #include <QFileDialog>
 #include <QMessageBox>
+#include <QTabWidget>
 
 QString
 SettingsDialog::m_installPath;
@@ -40,10 +41,16 @@
     QGridLayout *mainLayout = new QGridLayout;
     setLayout(mainLayout);
 
+    QTabWidget *tw = new QTabWidget;
+    mainLayout->addWidget(tw, 0, 0);
 
 
-    QGroupBox *meBox = new QGroupBox(tr("User details"));
-    mainLayout->addWidget(meBox, 0, 0);
+//    QGroupBox *meBox = new QGroupBox(tr("User details"));
+//    mainLayout->addWidget(meBox, 0, 0);
+
+    QWidget *meBox = new QWidget;
+    tw->addTab(meBox, tr("User details"));
+
     QGridLayout *meLayout = new QGridLayout;
     meBox->setLayout(meLayout);
 
@@ -59,10 +66,15 @@
     m_emailEdit = new QLineEdit();
     meLayout->addWidget(m_emailEdit, row++, 1);
 
+    meLayout->setRowStretch(row, 20);
 
 
-    QGroupBox *lookBox = new QGroupBox(tr("Presentation"));
-    mainLayout->addWidget(lookBox, 1, 0);
+//    QGroupBox *lookBox = new QGroupBox(tr("Presentation"));
+//    mainLayout->addWidget(lookBox, 1, 0);
+    
+    QWidget *lookBox = new QWidget;
+    tw->addTab(lookBox, tr("Presentation"));
+
     QGridLayout *lookLayout = new QGridLayout;
     lookBox->setLayout(lookLayout);
 
@@ -89,10 +101,15 @@
     m_dateFormat->addItem(tr("Dates, for example \"2010-06-23\""));
     lookLayout->addWidget(m_dateFormat, row++, 1, Qt::AlignLeft);
     lookLayout->setColumnStretch(1, 20);
+
+    lookLayout->setRowStretch(row, 20);
     
 
-    QGroupBox *pathsBox = new QGroupBox(tr("System application locations"));
-    mainLayout->addWidget(pathsBox, 2, 0);
+    QWidget *pathsBox = new QWidget;
+    tw->addTab(pathsBox, tr("System application locations"));
+
+//    QGroupBox *pathsBox = new QGroupBox(tr("System application locations"));
+//    mainLayout->addWidget(pathsBox, 2, 0);
     QGridLayout *pathsLayout = new QGridLayout;
     pathsBox->setLayout(pathsLayout);
 
@@ -156,6 +173,8 @@
     m_useExtension = new QCheckBox(tr("Use EasyHg Mercurial extension"));
     pathsLayout->addWidget(m_useExtension, row++, 2);
 
+    pathsLayout->setRowStretch(row, 20);
+
 
     reset(); // loads current defaults from settings
 
@@ -422,6 +441,7 @@
     settings.beginGroup("Presentation");
     settings.remove("showiconlabels");
     settings.remove("showhelpfultext");
+    settings.remove("dateformat");
     settings.endGroup();
     settings.beginGroup("Locations");
     settings.remove("hgbinary");