m_timer = new QTimer(this);
QWidget::connect(m_timer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
m_timer->start(mainWin->m_refreshStatusDirInterval*1000);
+
+ createConnections();
}
void DirStat::getFont()
*/
void DirStat::createConnections()
{
+ connect(actionRefresh, SIGNAL(triggered()), this,
+ SLOT(populateAll()));
+ connect(actionCancelRunning, SIGNAL(triggered()), this,
+ SLOT(consoleCancelJob()));
+ connect(actionDisableScheduledJob, SIGNAL(triggered()), this,
+ SLOT(consoleDisableJob()));
+
+ scheduledTable->setContextMenuPolicy(Qt::ActionsContextMenu);
+ scheduledTable->addAction(actionRefresh);
+ scheduledTable->addAction(actionDisableScheduledJob);
+ terminatedTable->setContextMenuPolicy(Qt::ActionsContextMenu);
+ terminatedTable->addAction(actionRefresh);
+ runningTable->setContextMenuPolicy(Qt::ActionsContextMenu);
+ runningTable->addAction(actionRefresh);
+ runningTable->addAction(actionCancelRunning);
}
/*
splitter->restoreState(settings.value(m_splitText).toByteArray());
settings.endGroup();
}
+
+/*
+ * Cancel a running job
+ */
+void DirStat::consoleCancelJob()
+{
+ int currentrow = runningTable->currentRow();
+ QTableWidgetItem *item = runningTable->item(currentrow, 0);
+ if (item) {
+ QString text = item->text();
+ QString cmd("cancel jobid=");
+ cmd += text;
+ consoleCommand(cmd);
+ }
+}
+
+/*
+ * Disable a scheduled Job
+ */
+void DirStat::consoleDisableJob()
+{
+ int currentrow = scheduledTable->currentRow();
+ QTableWidgetItem *item = scheduledTable->item(currentrow, 4);
+ if (item) {
+ QString text = item->text();
+ QString cmd("disable job=\"");
+ cmd += text + '"';
+ consoleCommand(cmd);
+ }
+}
+
<string>Form</string>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
+ <property name="leftMargin" >
<number>9</number>
</property>
- <property name="spacing" >
+ <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" >
</property>
<widget class="QTextEdit" name="textEdit" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>200</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<bool>true</bool>
</property>
</widget>
- <widget class="QWidget" name="" >
+ <widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QLabel" name="scheduledLabel" >
<property name="layoutDirection" >
</widget>
<widget class="QWidget" name="layoutWidget_2" >
<layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QLabel" name="runningLabel" >
<property name="layoutDirection" >
</widget>
<widget class="QWidget" name="layoutWidget" >
<layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QLabel" name="terminatedLabel" >
<property name="layoutDirection" >
</widget>
</item>
</layout>
+ <action name="actionRefresh" >
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Refresh</string>
+ </property>
+ </action>
+ <action name="actionCancelRunning" >
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/utilities-terminal.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Cancel Running Job</string>
+ </property>
+ </action>
+ <action name="actionDisableScheduledJob" >
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/utilities-terminal.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Disable Scheduled Job</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../main.qrc" />