Commits

Sam Izzo committed 58ac1b1

* Added setting to show history automatically when it changes (defaults to true)

Comments (0)

Files changed (3)

src/hgtabwidget.cpp

 #include <QClipboard>
 #include <QContextMenuEvent>
 #include <QApplication>
+#include <QSettings>
 
 #include <iostream>
 
 {
     m_historyWidget->parseIncrementalLog(hgLogList);
     if (m_historyWidget->haveNewItems()) {
-        showHistoryTab();
+        QSettings settings;
+        settings.beginGroup("Presentation");
+        if (settings.value("showHistoryAutomatically", true).toBool()) {
+            showHistoryTab();
+        }
     }
 }
 

src/settingsdialog.cpp

     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();
     settings.beginGroup("Presentation");
     settings.remove("showiconlabels");
     settings.remove("showhelpfultext");
+    settings.remove("showHistoryAutomatically");
     settings.remove("dateformat");
     settings.endGroup();
     settings.beginGroup("Locations");
     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
         settings.setValue("showhelpfultext", b);
         m_presentationChanged = true;
     }
+    settings.setValue("showHistoryAutomatically", m_showHistoryAutomatically->isChecked());
     int i;
 #ifdef NOT_IMPLEMENTED_YET
     i = m_workHistoryArrangement->currentIndex();

src/settingsdialog.h

     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;
     QComboBox *m_workHistoryArrangement;
 #endif
 
-    QCheckBox *m_multipleDiffInstances;
-
-    QPushButton *m_extensionBrowse;
     QPushButton *m_ok;
 
     bool m_presentationChanged;