changeset 634:58ac1b197666

* Added setting to show history automatically when it changes (defaults to true)
author Sam Izzo <sam@humbug.net>
date Mon, 27 Aug 2012 01:45:26 +1000
parents db62a0cb3037
children 6e479f33ea93
files src/hgtabwidget.cpp src/settingsdialog.cpp src/settingsdialog.h
diffstat 3 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/hgtabwidget.cpp	Mon Aug 27 01:26:57 2012 +1000
+++ b/src/hgtabwidget.cpp	Mon Aug 27 01:45:26 2012 +1000
@@ -23,6 +23,7 @@
 #include <QClipboard>
 #include <QContextMenuEvent>
 #include <QApplication>
+#include <QSettings>
 
 #include <iostream>
 
@@ -281,7 +282,11 @@
 {
     m_historyWidget->parseIncrementalLog(hgLogList);
     if (m_historyWidget->haveNewItems()) {
-        showHistoryTab();
+        QSettings settings;
+        settings.beginGroup("Presentation");
+        if (settings.value("showHistoryAutomatically", true).toBool()) {
+            showHistoryTab();
+        }
     }
 }
 
--- a/src/settingsdialog.cpp	Mon Aug 27 01:26:57 2012 +1000
+++ b/src/settingsdialog.cpp	Mon Aug 27 01:45:26 2012 +1000
@@ -87,6 +87,9 @@
     m_showExtraText = new QCheckBox(tr("Show long descriptions for file status headings"));
     lookLayout->addWidget(m_showExtraText, row++, 0, 1, 2);
     
+    m_showHistoryAutomatically = new QCheckBox(tr("Switch to history tab  automatically when history changes"));
+    lookLayout->addWidget(m_showHistoryAutomatically, row++, 0, 1, 2);
+
 #ifdef NOT_IMPLEMENTED_YET
     lookLayout->addWidget(new QLabel(tr("Place the work and history views")), row, 0);
     m_workHistoryArrangement = new QComboBox();
@@ -417,6 +420,7 @@
     settings.beginGroup("Presentation");
     settings.remove("showiconlabels");
     settings.remove("showhelpfultext");
+    settings.remove("showHistoryAutomatically");
     settings.remove("dateformat");
     settings.endGroup();
     settings.beginGroup("Locations");
@@ -444,6 +448,7 @@
     settings.beginGroup("Presentation");
     m_showIconLabels->setChecked(settings.value("showiconlabels", true).toBool());
     m_showExtraText->setChecked(settings.value("showhelpfultext", true).toBool());
+    m_showHistoryAutomatically->setChecked(settings.value("showHistoryAutomatically", true).toBool());
 #ifdef NOT_IMPLEMENTED_YET
     m_workHistoryArrangement->setCurrentIndex(settings.value("workhistoryarrangement", 0).toInt());
 #endif
@@ -485,6 +490,7 @@
         settings.setValue("showhelpfultext", b);
         m_presentationChanged = true;
     }
+    settings.setValue("showHistoryAutomatically", m_showHistoryAutomatically->isChecked());
     int i;
 #ifdef NOT_IMPLEMENTED_YET
     i = m_workHistoryArrangement->currentIndex();
--- a/src/settingsdialog.h	Mon Aug 27 01:26:57 2012 +1000
+++ b/src/settingsdialog.h	Mon Aug 27 01:45:26 2012 +1000
@@ -72,11 +72,15 @@
     QLineEdit *m_mergePathLabel;
     QLineEdit *m_sshPathLabel;
 
+    QPushButton *m_extensionBrowse;
+
+    QCheckBox *m_multipleDiffInstances;
     QCheckBox *m_useExtension;
     QLineEdit *m_extensionPathLabel;
 
     QCheckBox *m_showIconLabels;
     QCheckBox *m_showExtraText;
+    QCheckBox *m_showHistoryAutomatically;
     QComboBox *m_dateFormat;
 
     QDateEdit *m_dateFrom;
@@ -85,9 +89,6 @@
     QComboBox *m_workHistoryArrangement;
 #endif
 
-    QCheckBox *m_multipleDiffInstances;
-
-    QPushButton *m_extensionBrowse;
     QPushButton *m_ok;
 
     bool m_presentationChanged;