/* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */
m_populated = false;
+ m_firstpopulation = true;
m_checkcurwidget = true;
m_closeable = false;
m_currentStorage = "";
foreach (QString resultline, results) {
fieldlist = resultline.split("\t");
storageName = fieldlist.takeFirst();
+ if (m_firstpopulation) {
+ m_firstpopulation = false;
+ settingsOpenStatus(storageName);
+ }
TreeItemFormatter storageItem(*m_topItem, 1);
storageItem.setTextFld(0, storageName);
if(settings.contains(storageName))
*/
void Storage::statusStorageWindow()
{
- QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- new StorStat(m_currentStorage, parentItem);
+ /* if one exists, then just set it current */
+ bool found = false;
+ foreach(Pages *page, mainWin->m_pagehash) {
+ if (mainWin->currentConsole() == page->console()) {
+ if (page->name() == tr("Storage Status %1").arg(m_currentStorage)) {
+ found = true;
+ page->setCurrent();
+ }
+ }
+ }
+ if (!found) {
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ new StorStat(m_currentStorage, parentItem);
+ }
}
/*
}
settings.endGroup();
}
+
+/*
+ * If first time, then check to see if there were status pages open the last time closed
+ * if so open
+ */
+void Storage::settingsOpenStatus(QString &storage)
+{
+ QSettings settings(m_console->m_dir->name(), "bat");
+
+ settings.beginGroup("OpenOnExit");
+ QString toRead = "StorageStatus_" + storage;
+ if (settings.value(toRead) == 1) {
+ Pmsg1(000, "Do open Storage Status window for : %s\n", storage.toUtf8().data());
+ new StorStat(storage, mainWin->getFromHash(this));
+ setCurrent();
+ mainWin->getFromHash(this)->setExpanded(true);
+ } else {
+ Pmsg1(000, "Do NOT open Storage Status window for : %s\n", storage.toUtf8().data());
+ }
+ settings.endGroup();
+}