<x>0</x>
<y>0</y>
<width>882</width>
- <height>24</height>
+ <height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuEdit" >
<addaction name="actionBrowse" />
<addaction name="actionJobPlot" />
<addaction name="actionUndock" />
+ <addaction name="actionBack" />
</widget>
<widget class="QDockWidget" name="dockWidget" >
<property name="sizePolicy" >
<string>Reload and Repop</string>
</property>
</action>
+ <action name="actionBack" >
+ <property name="icon" >
+ <iconset resource="main.qrc" >:/images/go-jump.png</iconset>
+ </property>
+ <property name="text" >
+ <string>back</string>
+ </property>
+ <property name="toolTip" >
+ <string>Previous Page</string>
+ </property>
+ <property name="statusTip" >
+ <string>Previous Page</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="main.qrc" />
m_isClosing = false;
m_waitState = false;
m_doConnect = false;
+ m_treeStackTrap = false;
m_dtformat = "yyyy-MM-dd HH:mm:ss";
mainWin = this;
setupUi(this); /* Setup UI defined by main.ui (designer) */
connect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
connect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help()));
connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
- connect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
+ connect(treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int)));
connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
connect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
connect(actionReloadRepop, SIGNAL(triggered()), this, SLOT(reloadRepopLists()));
+ connect(actionBack, SIGNAL(triggered()), this, SLOT(goToPreviousPage()));
}
void MainWin::disconnectSignals()
disconnect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
disconnect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
disconnect(actionReloadRepop, SIGNAL(triggered()), this, SLOT(reloadRepopLists()));
+ disconnect(actionBack, SIGNAL(triggered()), this, SLOT(goToPreviousPage()));
}
/*
/* this condition prevents a segfault. The first time there is no previousitem*/
if (previousitem) {
+ if (m_treeStackTrap == false) { /* keep track of previous items for going Back */
+ m_treeWidgetStack.append(previousitem);
+ }
/* knowing the treeWidgetItem, get the page from the hash */
previousPage = getFromHash(previousitem);
previousConsole = m_consoleHash.value(previousitem);
else
actionMessages->setIcon(QIcon(QString::fromUtf8(":/images/mail-message-new.png")));
}
+
+void MainWin::goToPreviousPage()
+{
+ m_treeStackTrap = true;
+ bool done = false;
+ while (!done) {
+ /* If stack list is emtpty, then done */
+ if (m_treeWidgetStack.isEmpty()) {
+ done = true;
+ } else {
+ QTreeWidgetItem* testItem = m_treeWidgetStack.takeLast();
+ QTreeWidgetItemIterator it(treeWidget);
+ /* lets avoid a segfault by setting an item current that no longer exists */
+ while (*it) {
+ if (*it == testItem) {
+ if (testItem != treeWidget->currentItem()) {
+ treeWidget->setCurrentItem(testItem);
+ done = true;
+ }
+ break;
+ }
+ ++it;
+ }
+ }
+ }
+ m_treeStackTrap = false;
+}