m_populated = false;
m_checkcurwidget = true;
m_closeable = false;
+ m_firstpopulation = true;
/* add context sensitive menu items specific to this classto the page
* selector tree. m_contextActions is QList of QActions */
m_contextActions.append(actionRefreshClients);
foreach (QString resultline, results) {
QStringList fieldlist = resultline.split("\t");
+ if (m_firstpopulation) {
+ m_firstpopulation = false;
+ settingsOpenStatus(fieldlist[0]);
+ }
+
TableItemFormatter item(*tableWidget, row);
/* Iterate through fields in the record */
*/
void Clients::statusClientWindow()
{
- QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- new ClientStat(m_currentlyselected, 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("Client Status %1").arg(m_currentlyselected)) {
+ found = true;
+ page->setCurrent();
+ }
+ }
+ }
+ if (!found) {
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ new ClientStat(m_currentlyselected, parentItem);
+ }
+}
+
+/*
+ * If first time, then check to see if there were status pages open the last time closed
+ * if so open
+ */
+void Clients::settingsOpenStatus(QString &client)
+{
+ QSettings settings(m_console->m_dir->name(), "bat");
+
+ settings.beginGroup("OpenOnExit");
+ QString toRead = "ClientStatus_" + client;
+ if (settings.value(toRead) == 1) {
+ Pmsg1(000, "Do open Client Status window for : %s\n", client.toUtf8().data());
+ new ClientStat(client, mainWin->getFromHash(this));
+ setCurrent();
+ mainWin->getFromHash(this)->setExpanded(true);
+ } else {
+ Pmsg1(000, "Do NOT open Client Status window for : %s\n", client.toUtf8().data());
+ }
+ settings.endGroup();
}
private:
void createContextMenu();
+ void settingsOpenStatus(QString& client);
QString m_currentlyselected;
bool m_populated;
+ bool m_firstpopulation;
bool m_checkcurwidget;
};
QStringList headerlist = (QStringList()
<< tr("Job Id") << tr("Job Name") << tr("Client") << tr("Job Starttime")
<< tr("Job Type") << tr("Job Level") << tr("Job Files")
- << tr("Job Bytes") << tr("Job Status") << tr("Purged") << tr("File Set"));
+ << tr("Job Bytes") << tr("Job Status") << tr("Purged") << tr("File Set")
+ << tr("Pool Name"));
m_jobIdIndex = headerlist.indexOf(tr("Job Id"));
m_purgedIndex = headerlist.indexOf(tr("Purged"));
QString resultline;
foreach (resultline, results) {
fieldlist = resultline.split("\t");
- if (fieldlist.size() < 12)
+ if (fieldlist.size() < 13)
continue; /* some fields missing, ignore row */
TableItemFormatter jobitem(*mp_tableWidget, row);
/* fileset */
jobitem.setTextFld(col++, fld.next());
+ /* pool name */
+ jobitem.setTextFld(col++, fld.next());
row++;
}
}
fileSetComboBox->addItems(m_console->fileset_list);
comboSel(fileSetComboBox, m_filesetName);
+ poolComboBox->addItem(tr("Any"));
+ poolComboBox->addItems(m_console->pool_list);
+
jobStatusComboFill(statusComboBox);
}
}
" Job.Starttime AS JobStart, Job.Type AS JobType,"
" Job.Level AS BackupLevel, Job.Jobfiles AS FileCount,"
" Job.JobBytes AS Bytes, Job.JobStatus AS Status,"
- " Job.PurgedFiles AS Purged, FileSet.FileSet"
+ " Job.PurgedFiles AS Purged, FileSet.FileSet,"
+ " Pool.Name AS Pool"
" FROM Job"
" JOIN Client ON (Client.ClientId=Job.ClientId)"
- " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId) ";
+ " LEFT OUTER JOIN FileSet ON (FileSet.FileSetId=Job.FileSetId) "
+ " LEFT OUTER JOIN pool ON Job.PoolId = Pool.PoolId ";
QStringList conditions;
if (m_mediaName != tr("Any")) {
query += " LEFT OUTER JOIN JobMedia ON (JobMedia.JobId=Job.JobId) "
jobStatusComboCond(conditions, statusComboBox, "Job.JobStatus");
boolComboCond(conditions, purgedComboBox, "Job.PurgedFiles");
comboCond(conditions, fileSetComboBox, "FileSet.FileSet");
+ comboCond(conditions, poolComboBox, "Pool.Name");
/* If Limit check box For limit by days is checked */
if (daysCheckBox->checkState() == Qt::Checked) {
<widget class="QFrame" name="frame" >
<property name="geometry" >
<rect>
- <x>30</x>
- <y>170</y>
- <width>533</width>
- <height>172</height>
+ <x>20</x>
+ <y>220</y>
+ <width>545</width>
+ <height>154</height>
</rect>
</property>
<property name="maximumSize" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
- <item row="0" column="4" >
- <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QVBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
+ </property>
<property name="leftMargin" >
- <number>0</number>
+ <number>3</number>
</property>
<property name="topMargin" >
- <number>0</number>
+ <number>3</number>
</property>
<property name="rightMargin" >
- <number>0</number>
+ <number>3</number>
</property>
<property name="bottomMargin" >
- <number>0</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
+ <number>3</number>
</property>
- <item row="1" column="1" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Ignored</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>16</width>
- <height>75</height>
- </size>
+ <item>
+ <layout class="QVBoxLayout" >
+ <property name="spacing" >
+ <number>6</number>
</property>
- </spacer>
- </item>
- <item row="1" column="0" >
- <layout class="QGridLayout" >
<property name="leftMargin" >
<number>3</number>
</property>
<property name="bottomMargin" >
<number>3</number>
</property>
- <property name="horizontalSpacing" >
- <number>3</number>
- </property>
- <property name="verticalSpacing" >
- <number>3</number>
- </property>
- <item row="0" column="0" >
- <widget class="QPushButton" name="refreshButton" >
+ <item>
+ <widget class="QCheckBox" name="limitCheckBox" >
<property name="text" >
- <string>Refresh</string>
- </property>
- <property name="icon" >
- <iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
+ <string>Record Limit</string>
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QPushButton" name="graphButton" >
- <property name="text" >
- <string>Graph</string>
+ <item>
+ <widget class="QSpinBox" name="limitSpinBox" >
+ <property name="minimum" >
+ <number>1</number>
</property>
- <property name="icon" >
- <iconset resource="../main.qrc" >:/images/applications-graphics.png</iconset>
+ <property name="maximum" >
+ <number>10000</number>
+ </property>
+ <property name="singleStep" >
+ <number>25</number>
</property>
</widget>
</item>
</layout>
</item>
- <item row="0" column="0" colspan="2" >
+ <item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="fileSetLabel" >
- <property name="maximumSize" >
- <size>
- <width>16777215</width>
- <height>20</height>
- </size>
- </property>
+ <widget class="QCheckBox" name="daysCheckBox" >
<property name="text" >
- <string>FileSet</string>
+ <string>Days Limit</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="fileSetComboBox" />
+ <widget class="QSpinBox" name="daysSpinBox" >
+ <property name="singleStep" >
+ <number>7</number>
+ </property>
+ </widget>
</item>
</layout>
</item>
</layout>
</item>
- <item row="0" column="3" >
+ <item row="0" column="1" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="statusLabel" >
+ <widget class="QLabel" name="clientsLabel" >
<property name="text" >
- <string>Status</string>
+ <string>Clients</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="statusComboBox" />
+ <widget class="QComboBox" name="clientComboBox" />
</item>
</layout>
</item>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="purgedLabel" >
+ <widget class="QLabel" name="volumeLabel" >
<property name="text" >
- <string>Purged</string>
+ <string>Volume</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="purgedComboBox" />
+ <widget class="QComboBox" name="volumeComboBox" />
</item>
</layout>
</item>
</layout>
</item>
- <item row="0" column="0" >
+ <item row="0" column="2" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
<number>3</number>
</property>
<item>
- <widget class="QCheckBox" name="limitCheckBox" >
+ <widget class="QLabel" name="jobLabel" >
<property name="text" >
- <string>Record Limit</string>
+ <string>Job</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="limitSpinBox" >
- <property name="minimum" >
- <number>1</number>
- </property>
- <property name="maximum" >
- <number>10000</number>
- </property>
- <property name="singleStep" >
- <number>25</number>
- </property>
- </widget>
+ <widget class="QComboBox" name="jobComboBox" />
</item>
</layout>
</item>
<number>3</number>
</property>
<item>
- <widget class="QCheckBox" name="daysCheckBox" >
+ <widget class="QLabel" name="levelLabel" >
<property name="text" >
- <string>Days Limit</string>
+ <string>Level</string>
</property>
</widget>
</item>
<item>
- <widget class="QSpinBox" name="daysSpinBox" >
- <property name="singleStep" >
- <number>7</number>
- </property>
- </widget>
+ <widget class="QComboBox" name="levelComboBox" />
</item>
</layout>
</item>
</layout>
</item>
- <item row="0" column="1" >
+ <item row="0" column="3" >
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="clientsLabel" >
+ <widget class="QLabel" name="statusLabel" >
<property name="text" >
- <string>Clients</string>
+ <string>Status</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="clientComboBox" />
+ <widget class="QComboBox" name="statusComboBox" />
</item>
</layout>
</item>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="volumeLabel" >
+ <widget class="QLabel" name="purgedLabel" >
<property name="text" >
- <string>Volume</string>
+ <string>Purged</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="volumeComboBox" />
+ <widget class="QComboBox" name="purgedComboBox" />
</item>
</layout>
</item>
</layout>
</item>
- <item row="0" column="2" >
+ <item row="0" column="4" >
<layout class="QVBoxLayout" >
- <property name="spacing" >
- <number>6</number>
- </property>
- <property name="leftMargin" >
- <number>3</number>
- </property>
- <property name="topMargin" >
- <number>3</number>
- </property>
- <property name="rightMargin" >
- <number>3</number>
- </property>
- <property name="bottomMargin" >
- <number>3</number>
- </property>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="jobLabel" >
+ <widget class="QLabel" name="fileSetLabel" >
<property name="text" >
- <string>Job</string>
+ <string>FileSet</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="jobComboBox" />
+ <widget class="QComboBox" name="fileSetComboBox" />
</item>
</layout>
</item>
<number>3</number>
</property>
<item>
- <widget class="QLabel" name="levelLabel" >
+ <widget class="QLabel" name="poolLabel" >
<property name="text" >
- <string>Level</string>
+ <string>Pool</string>
</property>
</widget>
</item>
<item>
- <widget class="QComboBox" name="levelComboBox" />
+ <widget class="QComboBox" name="poolComboBox" />
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="5" >
+ <layout class="QVBoxLayout" >
+ <item>
+ <layout class="QGridLayout" >
+ <property name="leftMargin" >
+ <number>3</number>
+ </property>
+ <property name="topMargin" >
+ <number>3</number>
+ </property>
+ <property name="rightMargin" >
+ <number>3</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>3</number>
+ </property>
+ <property name="horizontalSpacing" >
+ <number>3</number>
+ </property>
+ <property name="verticalSpacing" >
+ <number>3</number>
+ </property>
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="refreshButton" >
+ <property name="text" >
+ <string>Refresh</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QPushButton" name="graphButton" >
+ <property name="text" >
+ <string>Graph</string>
+ </property>
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/applications-graphics.png</iconset>
+ </property>
+ </widget>
</item>
</layout>
</item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</item>
</layout>
<x>0</x>
<y>0</y>
<width>882</width>
- <height>22</height>
+ <height>24</height>
</rect>
</property>
<widget class="QMenu" name="menuEdit" >
<addaction name="actionSave" />
<addaction name="actionQuit" />
<addaction name="actionRepopLists" />
+ <addaction name="actionReloadRepop" />
</widget>
<addaction name="menuFile" />
<addaction name="menuEdit" />
<string>Repop Lists</string>
</property>
</action>
+ <action name="actionReloadRepop" >
+ <property name="icon" >
+ <iconset resource="main.qrc" >:/images/mark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Reload and Repop</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="main.qrc" />
connect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
connect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
+ connect(actionReloadRepop, SIGNAL(triggered()), this, SLOT(reloadRepopLists()));
}
void MainWin::disconnectSignals()
disconnect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
disconnect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
disconnect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
+ disconnect(actionReloadRepop, SIGNAL(triggered()), this, SLOT(reloadRepopLists()));
}
/*
disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
}
+
+/*
+ * Two functions to respond to menu items to repop lists and execute reload and repopulate
+ * the lists for jobs, clients, filesets .. ..
+ */
void MainWin::repopLists()
{
m_currentConsole->populateLists(false);
}
+void MainWin::reloadRepopLists()
+{
+ QString cmd = "reload";
+ m_currentConsole->consoleCommand(cmd);
+ m_currentConsole->populateLists(false);
+}
/*
* Reimplementation of QWidget closeEvent virtual function
{
m_isClosing = true;
writeSettings();
+ /* Remove all groups from settings for OpenOnExit so that we can start some of the status windows */
+ foreach(Console *console, m_consoleHash){
+ QSettings settings(console->m_dir->name(), "bat");
+ settings.beginGroup("OpenOnExit");
+ settings.remove("");
+ settings.endGroup();
+ }
/* close all non console pages, this will call settings in destructors */
while (m_consoleHash.count() < m_pagehash.count()) {
foreach(Pages *page, m_pagehash) {
settings.setValue("winPos", pos());
settings.setValue("state", saveState());
settings.endGroup();
+
}
void MainWin::readSettings()
prefs.daysSpinBox->setValue(m_daysLimitVal);
prefs.checkMessages->setCheckState(m_checkMessages ? Qt::Checked : Qt::Unchecked);
prefs.checkMessagesSpin->setValue(m_checkMessagesInterval);
- prefs.refreshStatusDir->setCheckState(m_refreshStatusDir ? Qt::Checked : Qt::Unchecked);
- prefs.refreshStatusDirSpin->setValue(m_refreshStatusDirInterval);
prefs.executeLongCheckBox->setCheckState(m_longList ? Qt::Checked : Qt::Unchecked);
prefs.rtPopDirCheckBox->setCheckState(m_rtPopDirDebug ? Qt::Checked : Qt::Unchecked);
prefs.rtDirCurICCheckBox->setCheckState(m_rtDirCurICDebug ? Qt::Checked : Qt::Unchecked);
mainWin->m_daysLimitVal = this->daysSpinBox->value();
mainWin->m_checkMessages = this->checkMessages->checkState() == Qt::Checked;
mainWin->m_checkMessagesInterval = this->checkMessagesSpin->value();
- mainWin->m_refreshStatusDir = this->refreshStatusDir->checkState() == Qt::Checked;
- mainWin->m_refreshStatusDirInterval = this->refreshStatusDirSpin->value();
mainWin->m_longList = this->executeLongCheckBox->checkState() == Qt::Checked;
mainWin->m_rtPopDirDebug = this->rtPopDirCheckBox->checkState() == Qt::Checked;
settings.beginGroup("Timers");
settings.setValue("checkMessages", mainWin->m_checkMessages);
settings.setValue("checkMessagesInterval", mainWin->m_checkMessagesInterval);
- settings.setValue("refreshStatusDir", mainWin->m_refreshStatusDir);
- settings.setValue("refreshStatusDirInterval", mainWin->m_refreshStatusDirInterval);
settings.endGroup();
settings.beginGroup("Misc");
settings.setValue("longList", mainWin->m_longList);
settings.beginGroup("Timers");
m_checkMessages = settings.value("checkMessages", false).toBool();
m_checkMessagesInterval = settings.value("checkMessagesInterval", 28).toInt();
- m_refreshStatusDir = settings.value("refreshStatusDir", false).toBool();
- m_refreshStatusDirInterval = settings.value("refreshStatusDirInterval", 28).toInt();
settings.endGroup();
settings.beginGroup("Misc");
m_longList = settings.value("longList", false).toBool();
int m_daysLimitVal;
bool m_checkMessages;
int m_checkMessagesInterval;
- bool m_refreshStatusDir;
- int m_refreshStatusDirInterval;
bool m_longList;
bool m_rtPopDirDebug;
bool m_rtDirCurICDebug;
void waitEnter();
void waitExit();
void repopLists();
+ void reloadRepopLists();
void popLists();
protected:
<item row="1" column="0" >
<widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" >
- <number>3</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab" >
<attribute name="title" >
</property>
</widget>
</widget>
- <widget class="QGroupBox" name="groupBox_8" >
- <property name="geometry" >
- <rect>
- <x>60</x>
- <y>200</y>
- <width>180</width>
- <height>106</height>
- </rect>
- </property>
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>Status Dir</string>
- </property>
- <widget class="QLabel" name="checkLabel_2" >
- <property name="geometry" >
- <rect>
- <x>11</x>
- <y>81</y>
- <width>158</width>
- <height>16</height>
- </rect>
- </property>
- <property name="text" >
- <string>Refresh Status Dir Interval</string>
- </property>
- </widget>
- <widget class="QCheckBox" name="refreshStatusDir" >
- <property name="geometry" >
- <rect>
- <x>11</x>
- <y>25</y>
- <width>158</width>
- <height>20</height>
- </rect>
- </property>
- <property name="text" >
- <string>Refresh Status Dir</string>
- </property>
- </widget>
- <widget class="QSpinBox" name="refreshStatusDirSpin" >
- <property name="geometry" >
- <rect>
- <x>11</x>
- <y>51</y>
- <width>158</width>
- <height>24</height>
- </rect>
- </property>
- <property name="minimum" >
- <number>15</number>
- </property>
- <property name="maximum" >
- <number>3600</number>
- </property>
- </widget>
- </widget>
</widget>
<widget class="QWidget" name="tab_2" >
<attribute name="title" >
" INNER JOIN Job ON (Job.JobId=File.JobId)"
" WHERE File.PathId=" + QString("%1").arg(pathid) +
" AND Job.Jobid IN (" + m_checkedJobs + ")"
- " AND File.FilenameId!=" + QString("%1").arg(m_nullFileNameId) +
" GROUP BY File.FilenameId"
") t1, File "
" INNER JOIN Filename on (Filename.FilenameId=File.FilenameId)"
readSettings();
dockPage();
m_timer = new QTimer(this);
- QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
- m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
createConnections();
+ m_timer->start(1000);
setCurrent();
}
*/
void ClientStat::populateAll()
{
- populateHeader();
populateTerminated();
- populateRunning();
+ populateCurrentTab(tabWidget->currentIndex());
}
/*
*/
void ClientStat::timerTriggered()
{
- bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
- if (((isDocked() && iscurrent) || (!isDocked())) && mainWin->m_refreshStatusDir) {
- populateAll();
+ double value = timerDisplay->value();
+ value -= 1;
+ if (value == 0) {
+ value = spinBox->value();
+ bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+ if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+ populateAll();
+ }
}
+ timerDisplay->display(value);
+}
+
+
+void ClientStat::populateCurrentTab(int index)
+{
+ if (index == 0)
+ populateHeader();
+ if (index == 1)
+ populateRunning();
}
/*
void ClientStat::currentStackItem()
{
populateAll();
+ timerDisplay->display(spinBox->value());
+
if (!m_populated) {
m_populated=true;
}
*/
void ClientStat::createConnections()
{
- connect(actionRefresh, SIGNAL(triggered()), this,
- SLOT(populateAll()));
+ connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+ connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(populateCurrentTab(int)));
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
+ terminatedTable->setContextMenuPolicy(Qt::ActionsContextMenu);
+ terminatedTable->addAction(actionRefresh);
}
/*
QSettings settings(m_console->m_dir->name(), "bat");
settings.beginGroup(m_groupText);
settings.setValue(m_splitText, splitter->saveState());
+ settings.setValue("refreshInterval", spinBox->value());
+ settings.setValue("refreshCheck", checkBox->checkState());
+ settings.endGroup();
+
+ settings.beginGroup("OpenOnExit");
+ QString toWrite = "ClientStatus_" + m_client;
+ settings.setValue(toWrite, 1);
settings.endGroup();
}
QSettings settings(m_console->m_dir->name(), "bat");
settings.beginGroup(m_groupText);
splitter->restoreState(settings.value(m_splitText).toByteArray());
+ spinBox->setValue(settings.value("refreshInterval", 28).toInt());
+ checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
settings.endGroup();
+
+ timerDisplay->display(spinBox->value());
}
void populateTerminated();
void populateRunning();
void populateAll();
+ void populateCurrentTab(int);
private slots:
void timerTriggered();
<rect>
<x>0</x>
<y>0</y>
- <width>618</width>
- <height>630</height>
+ <width>557</width>
+ <height>350</height>
</rect>
</property>
<property name="windowTitle" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <widget class="QWidget" name="" >
- <layout class="QVBoxLayout" >
+ <widget class="QWidget" name="layoutWidget" >
+ <layout class="QHBoxLayout" >
<item>
- <widget class="QLabel" name="runningLabel_2" >
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text" >
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:13pt; font-weight:600;">Header</span></p></body></html></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
- </property>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Header</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditHeader" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
+ <horstretch>200</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="sizeIncrement" >
+ <size>
+ <width>1</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="focusPolicy" >
+ <enum>Qt::StrongFocus</enum>
+ </property>
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="statusTip" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="whatsThis" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="horizontalScrollBarPolicy" >
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="autoFormatting" >
+ <set>QTextEdit::AutoNone</set>
+ </property>
+ <property name="tabChangesFocus" >
+ <bool>false</bool>
+ </property>
+ <property name="documentTitle" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="lineWrapMode" >
+ <enum>QTextEdit::NoWrap</enum>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2" >
+ <attribute name="title" >
+ <string>Running</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditRunning" />
+ </item>
+ </layout>
+ </widget>
</widget>
</item>
<item>
- <widget class="QTextEdit" name="textEditHeader" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
- <horstretch>200</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
+ <widget class="QGroupBox" name="groupBox" >
<property name="minimumSize" >
<size>
- <width>0</width>
+ <width>141</width>
<height>0</height>
</size>
</property>
<property name="maximumSize" >
<size>
- <width>16777215</width>
+ <width>141</width>
<height>16777215</height>
</size>
</property>
- <property name="sizeIncrement" >
- <size>
- <width>1</width>
- <height>0</height>
- </size>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::StrongFocus</enum>
- </property>
- <property name="acceptDrops" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string comment="Joblog Window" />
- </property>
- <property name="statusTip" >
- <string comment="Joblog Window" />
- </property>
- <property name="whatsThis" >
- <string comment="Joblog Window" />
- </property>
- <property name="horizontalScrollBarPolicy" >
- <enum>Qt::ScrollBarAsNeeded</enum>
- </property>
- <property name="autoFormatting" >
- <set>QTextEdit::AutoNone</set>
- </property>
- <property name="tabChangesFocus" >
- <bool>false</bool>
- </property>
- <property name="documentTitle" >
- <string comment="Joblog Window" />
- </property>
- <property name="lineWrapMode" >
- <enum>QTextEdit::NoWrap</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="" >
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="runningLabel" >
- <property name="layoutDirection" >
- <enum>Qt::LeftToRight</enum>
- </property>
- <property name="text" >
- <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;">
-<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:13pt; font-weight:600;">Running</span></p></body></html></string>
- </property>
- <property name="alignment" >
- <set>Qt::AlignCenter</set>
- </property>
+ <property name="title" >
+ <string>Refresh Timer</string>
+ </property>
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>50</y>
+ <width>111</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="minimum" >
+ <number>5</number>
+ </property>
+ <property name="maximum" >
+ <number>999</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>101</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Do Refresh</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" name="timerDisplay" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>80</y>
+ <width>101</width>
+ <height>31</height>
+ </rect>
+ </property>
+ </widget>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QTextEdit" name="textEditRunning" />
- </item>
</layout>
</widget>
- <widget class="QWidget" name="" >
+ <widget class="QWidget" name="layoutWidget" >
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="terminatedLabel" >
thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/status.png")));
m_cursor = new QTextCursor(textEdit->document());
+ m_timer = new QTimer(this);
readSettings();
dockPage();
- m_timer = new QTimer(this);
- QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
- m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
+ m_timer->start(1000);
createConnections();
setCurrent();
*/
void DirStat::timerTriggered()
{
- bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
- if (((isDocked() && iscurrent) || (!isDocked())) && mainWin->m_refreshStatusDir) {
- populateAll();
+ double value = timerDisplay->value();
+ value -= 1;
+ if (value == 0) {
+ value = spinBox->value();
+ bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+ if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+ populateAll();
+ }
}
+ timerDisplay->display(value);
}
/*
void DirStat::currentStackItem()
{
populateAll();
+ timerDisplay->display(spinBox->value());
if (!m_populated) {
m_populated=true;
}
*/
void DirStat::createConnections()
{
- connect(actionRefresh, SIGNAL(triggered()), this,
- SLOT(populateAll()));
- connect(actionCancelRunning, SIGNAL(triggered()), this,
- SLOT(consoleCancelJob()));
- connect(actionDisableScheduledJob, SIGNAL(triggered()), this,
- SLOT(consoleDisableJob()));
+ connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+ connect(actionCancelRunning, SIGNAL(triggered()), this, SLOT(consoleCancelJob()));
+ connect(actionDisableScheduledJob, SIGNAL(triggered()), this, SLOT(consoleDisableJob()));
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
scheduledTable->setContextMenuPolicy(Qt::ActionsContextMenu);
scheduledTable->addAction(actionRefresh);
QSettings settings(m_console->m_dir->name(), "bat");
settings.beginGroup(m_groupText);
settings.setValue(m_splitText, splitter->saveState());
+ settings.setValue("refreshInterval", spinBox->value());
+ settings.setValue("refreshCheck", checkBox->checkState());
settings.endGroup();
}
QSettings settings(m_console->m_dir->name(), "bat");
settings.beginGroup(m_groupText);
splitter->restoreState(settings.value(m_splitText).toByteArray());
+ spinBox->setValue(settings.value("refreshInterval", 28).toInt());
+ checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
settings.endGroup();
+
+ timerDisplay->display(spinBox->value());
}
/*
<rect>
<x>0</x>
<y>0</y>
- <width>409</width>
- <height>326</height>
+ <width>514</width>
+ <height>425</height>
</rect>
</property>
<property name="windowTitle" >
<string>Form</string>
</property>
<layout class="QGridLayout" >
- <property name="leftMargin" >
- <number>9</number>
- </property>
- <property name="topMargin" >
- <number>9</number>
- </property>
- <property name="rightMargin" >
- <number>9</number>
- </property>
- <property name="bottomMargin" >
- <number>9</number>
- </property>
- <property name="horizontalSpacing" >
- <number>6</number>
- </property>
- <property name="verticalSpacing" >
- <number>6</number>
- </property>
<item row="0" column="0" >
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <widget class="QTextEdit" name="textEdit" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
- <horstretch>200</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize" >
- <size>
- <width>16777215</width>
- <height>100</height>
- </size>
- </property>
- <property name="sizeIncrement" >
- <size>
- <width>1</width>
- <height>0</height>
- </size>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::StrongFocus</enum>
- </property>
- <property name="acceptDrops" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string comment="Joblog Window" />
- </property>
- <property name="statusTip" >
- <string comment="Joblog Window" />
- </property>
- <property name="whatsThis" >
- <string comment="Joblog Window" />
- </property>
- <property name="horizontalScrollBarPolicy" >
- <enum>Qt::ScrollBarAsNeeded</enum>
- </property>
- <property name="autoFormatting" >
- <set>QTextEdit::AutoNone</set>
- </property>
- <property name="tabChangesFocus" >
- <bool>false</bool>
- </property>
- <property name="documentTitle" >
- <string comment="Joblog Window" />
- </property>
- <property name="lineWrapMode" >
- <enum>QTextEdit::NoWrap</enum>
- </property>
- <property name="readOnly" >
- <bool>true</bool>
- </property>
+ <widget class="QWidget" name="" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QTextEdit" name="textEdit" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="sizeIncrement" >
+ <size>
+ <width>1</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="focusPolicy" >
+ <enum>Qt::StrongFocus</enum>
+ </property>
+ <property name="acceptDrops" >
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="statusTip" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="whatsThis" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="horizontalScrollBarPolicy" >
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="autoFormatting" >
+ <set>QTextEdit::AutoNone</set>
+ </property>
+ <property name="tabChangesFocus" >
+ <bool>false</bool>
+ </property>
+ <property name="documentTitle" >
+ <string comment="Joblog Window" />
+ </property>
+ <property name="lineWrapMode" >
+ <enum>QTextEdit::NoWrap</enum>
+ </property>
+ <property name="readOnly" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize" >
+ <size>
+ <width>221</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="maximumSize" >
+ <size>
+ <width>221</width>
+ <height>100</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Refresh Timer</string>
+ </property>
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>60</y>
+ <width>111</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="minimum" >
+ <number>5</number>
+ </property>
+ <property name="maximum" >
+ <number>999</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>101</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Do Refresh</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" name="timerDisplay" >
+ <property name="geometry" >
+ <rect>
+ <x>110</x>
+ <y>20</y>
+ <width>101</width>
+ <height>31</height>
+ </rect>
+ </property>
+ </widget>
+ </widget>
+ </item>
+ </layout>
</widget>
<widget class="QWidget" name="dirstatlayoutWidget" >
<layout class="QVBoxLayout" >
#include <QTableWidgetItem>
#include "storstat.h"
#include "mount/mount.h"
+#include "label/label.h"
/*
.status storage=<storage-name> <keyword>
m_timer = new QTimer(this);
readSettings();
dockPage();
- QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
createConnections();
+ m_timer->start(1000);
setCurrent();
}
*/
void StorStat::timerTriggered()
{
- bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
- if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
- populateAll();
+ double value = timerDisplay->value();
+ value -= 1;
+ if (value == 0) {
+ value = spinBox->value();
+ bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this);
+ if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+ populateAll();
+ }
}
+ timerDisplay->display(value);
}
/*
void StorStat::currentStackItem()
{
populateAll();
+ timerDisplay->display(spinBox->value());
if (!m_populated) {
m_populated=true;
}
*/
void StorStat::createConnections()
{
- connect(actionRefresh, SIGNAL(triggered()), this,
- SLOT(populateAll()));
- connect(tabWidget, SIGNAL(currentChanged(int)), this,
- SLOT(populateCurrentTab(int)));
- connect(spinBox, SIGNAL(valueChanged(int)), this,
- SLOT(spinBoxValueChanged(int)));
+ connect(actionRefresh, SIGNAL(triggered()), this, SLOT(populateAll()));
+ connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(populateCurrentTab(int)));
connect(mountButton, SIGNAL(pressed()), this, SLOT(mountButtonPushed()));
connect(umountButton, SIGNAL(pressed()), this, SLOT(umountButtonPushed()));
+ connect(labelButton, SIGNAL(pressed()), this, SLOT(labelButtonPushed()));
+ connect(releaseButton, SIGNAL(pressed()), this, SLOT(releaseButtonPushed()));
terminatedTable->setContextMenuPolicy(Qt::ActionsContextMenu);
terminatedTable->addAction(actionRefresh);
+ connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
}
/*
settings.setValue("refreshInterval", spinBox->value());
settings.setValue("refreshCheck", checkBox->checkState());
settings.endGroup();
+
+ settings.beginGroup("OpenOnExit");
+ QString toWrite = "StorageStatus_" + m_storage;
+ settings.setValue(toWrite, 1);
+ settings.endGroup();
}
/*
checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
settings.endGroup();
- m_timer->start(spinBox->value()*1000);
+ timerDisplay->display(spinBox->value());
}
/*
populateRunning();
}
-/*
- * Set the timer when changed
- */
-void StorStat::spinBoxValueChanged(int newval)
-{
- m_timer->setInterval(newval*1000);
-}
-
/*
* execute mount in console
*/
QString cmd("umount storage=" + m_storage);
consoleCommand(cmd);
}
+
+/* Release a tape in the drive */
+void StorStat::releaseButtonPushed()
+{
+ QString cmd("release storage=");
+ cmd += m_storage;
+ consoleCommand(cmd);
+}
+
+/* Label Media populating current storage by default */
+void StorStat::labelButtonPushed()
+{
+ new labelPage(m_storage);
+}
private slots:
void timerTriggered();
- void spinBoxValueChanged(int);
void populateCurrentTab(int);
void mountButtonPushed();
void umountButtonPushed();
+ void releaseButtonPushed();
+ void labelButtonPushed();
private:
void createConnections();
<rect>
<x>0</x>
<y>0</y>
- <width>367</width>
- <height>310</height>
+ <width>694</width>
+ <height>393</height>
</rect>
</property>
<property name="windowTitle" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <widget class="QTabWidget" name="tabWidget" >
- <property name="currentIndex" >
- <number>0</number>
- </property>
- <widget class="QWidget" name="headerTab" >
- <attribute name="title" >
- <string>Header</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditHeader" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="waitReservationTab" >
- <attribute name="title" >
- <string>Waitreservation</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditWaitReservation" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="devicesTab" >
- <attribute name="title" >
- <string>Devices</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditDevices" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="volumesTab" >
- <attribute name="title" >
- <string>Volumes</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditVolumes" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="spoolingTab" >
- <attribute name="title" >
- <string>Spooling</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditSpooling" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="runningTab" >
- <attribute name="title" >
- <string>Running</string>
- </attribute>
- <layout class="QGridLayout" >
- <item row="0" column="0" >
- <widget class="QTextEdit" name="textEditRunning" />
- </item>
- </layout>
- </widget>
- <widget class="QWidget" name="tab" >
- <attribute name="title" >
- <string>Misc</string>
- </attribute>
- <widget class="QPushButton" name="mountButton" >
- <property name="geometry" >
- <rect>
- <x>170</x>
- <y>40</y>
- <width>80</width>
- <height>24</height>
- </rect>
- </property>
- <property name="text" >
- <string>Mount</string>
- </property>
- </widget>
- <widget class="QPushButton" name="umountButton" >
- <property name="geometry" >
- <rect>
- <x>170</x>
- <y>70</y>
- <width>80</width>
- <height>24</height>
- </rect>
- </property>
- <property name="text" >
- <string>UMount</string>
- </property>
- </widget>
- <widget class="QGroupBox" name="groupBox" >
- <property name="geometry" >
- <rect>
- <x>10</x>
- <y>10</y>
- <width>151</width>
- <height>91</height>
- </rect>
- </property>
- <property name="title" >
- <string>Refresh Timer Top</string>
- </property>
- <widget class="QSpinBox" name="spinBox" >
- <property name="geometry" >
- <rect>
- <x>20</x>
- <y>50</y>
- <width>111</width>
- <height>24</height>
- </rect>
- </property>
- <property name="minimum" >
- <number>5</number>
- </property>
- <property name="maximum" >
- <number>999</number>
+ <widget class="QWidget" name="layoutWidget" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QTabWidget" name="tabWidget" >
+ <property name="currentIndex" >
+ <number>6</number>
</property>
+ <widget class="QWidget" name="headerTab" >
+ <attribute name="title" >
+ <string>Header</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditHeader" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="waitReservationTab" >
+ <attribute name="title" >
+ <string>Waitreservation</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditWaitReservation" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="devicesTab" >
+ <attribute name="title" >
+ <string>Devices</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditDevices" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="volumesTab" >
+ <attribute name="title" >
+ <string>Volumes</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditVolumes" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="spoolingTab" >
+ <attribute name="title" >
+ <string>Spooling</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditSpooling" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="runningTab" >
+ <attribute name="title" >
+ <string>Running</string>
+ </attribute>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QTextEdit" name="textEditRunning" />
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab" >
+ <attribute name="title" >
+ <string>Misc</string>
+ </attribute>
+ <widget class="QWidget" name="" >
+ <property name="geometry" >
+ <rect>
+ <x>10</x>
+ <y>10</y>
+ <width>168</width>
+ <height>60</height>
+ </rect>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QPushButton" name="mountButton" >
+ <property name="text" >
+ <string>Mount</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QPushButton" name="umountButton" >
+ <property name="text" >
+ <string>UMount</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QPushButton" name="labelButton" >
+ <property name="text" >
+ <string>Label</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="releaseButton" >
+ <property name="text" >
+ <string>Release</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</widget>
- <widget class="QCheckBox" name="checkBox" >
- <property name="geometry" >
- <rect>
- <x>20</x>
- <y>20</y>
- <width>101</width>
- <height>20</height>
- </rect>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox" >
+ <property name="minimumSize" >
+ <size>
+ <width>141</width>
+ <height>0</height>
+ </size>
</property>
- <property name="text" >
- <string>Do Refresh</string>
+ <property name="maximumSize" >
+ <size>
+ <width>141</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="title" >
+ <string>Refresh Timer</string>
</property>
+ <widget class="QSpinBox" name="spinBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>50</y>
+ <width>111</width>
+ <height>24</height>
+ </rect>
+ </property>
+ <property name="minimum" >
+ <number>5</number>
+ </property>
+ <property name="maximum" >
+ <number>999</number>
+ </property>
+ </widget>
+ <widget class="QCheckBox" name="checkBox" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>20</y>
+ <width>101</width>
+ <height>20</height>
+ </rect>
+ </property>
+ <property name="text" >
+ <string>Do Refresh</string>
+ </property>
+ </widget>
+ <widget class="QLCDNumber" name="timerDisplay" >
+ <property name="geometry" >
+ <rect>
+ <x>20</x>
+ <y>80</y>
+ <width>101</width>
+ <height>31</height>
+ </rect>
+ </property>
+ </widget>
</widget>
- </widget>
- </widget>
+ </item>
+ </layout>
</widget>
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
/* 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();
+}
private:
void createContextMenu();
void mediaList(QTreeWidgetItem *parent, const QString &storageID);
+ void settingsOpenStatus(QString& storage);
QString m_currentStorage;
bool m_currentAutoChanger;
bool m_populated;
+ bool m_firstpopulation;
bool m_checkcurwidget;
void writeExpandedSettings();
QTreeWidgetItem *m_topItem;