}
/*
- * Connect to Director.
+ * Connect to Director. This does not connect to the director, dircomm does.
+ * This creates the first and possibly 2nd dircomm instance
*/
void Console::connect_dir()
{
Pmsg0(000, "DirComm 0 Seems to have Connected\n");
beginNewCommand(0);
}
+ populateLists(true);
+ mainWin->set_status(_("Connected"));
- int ndc;
- if (newDirComm(ndc)) {
- if (mainWin->m_connDebug)
- Pmsg1(000, "DirComm %i Seems to have Connected\n", ndc);
- dircomm = m_dircommHash.value(ndc);
- job_list.clear();
- client_list.clear();
- fileset_list.clear();
- fileset_list.clear();
- messages_list.clear();
- pool_list.clear();
- storage_list.clear();
- type_list.clear();
- level_list.clear();
- dir_cmd(ndc, ".jobs", job_list);
- dir_cmd(ndc, ".clients", client_list);
- dir_cmd(ndc, ".filesets", fileset_list);
- dir_cmd(ndc, ".msgs", messages_list);
- dir_cmd(ndc, ".pools", pool_list);
- dir_cmd(ndc, ".storage", storage_list);
- dir_cmd(ndc, ".types", type_list);
- dir_cmd(ndc, ".levels", level_list);
-
- if (mainWin->m_connDebug) {
- QString dbgmsg = QString("jobs=%1 clients=%2 filesets=%3 msgs=%4 pools=%5 storage=%6 types=%7 levels=%8\n")
- .arg(job_list.count()).arg(client_list.count()).arg(fileset_list.count()).arg(messages_list.count())
- .arg(pool_list.count()).arg(storage_list.count()).arg(type_list.count()).arg(level_list.count());
- Pmsg1(000, "%s\n", dbgmsg.toUtf8().data());
- } else
- if (mainWin->m_connDebug)
- Pmsg0(000, "DirComm 1 Seems to Failed\n");
-
- mainWin->set_status(_("Connected"));
- startTimer(); /* start message timer */
+ startTimer(); /* start message timer */
+}
+
+/*
+ * A function created to separate out the population of the lists
+ * from the Console::connect_dir function
+ */
+void Console::populateLists(bool forcenew)
+{
+ int conn;
+ if (forcenew)
+ if (!newDirComm(conn)) {
+ Pmsg0(000, "newDirComm Seems to Failed to create a connection for populateLists\n");
+ return;
+ }
+ else
+ if(!availableDirComm(conn)) {
+ Pmsg0(000, "availableDirComm Seems to Failed to find a connection for populateLists\n");
+ return;
+ }
+ populateLists(conn);
+}
+
+void Console::populateLists(int conn)
+{
+ job_list.clear();
+ client_list.clear();
+ fileset_list.clear();
+ fileset_list.clear();
+ messages_list.clear();
+ pool_list.clear();
+ storage_list.clear();
+ type_list.clear();
+ level_list.clear();
+ dir_cmd(conn, ".jobs", job_list);
+ dir_cmd(conn, ".clients", client_list);
+ dir_cmd(conn, ".filesets", fileset_list);
+ dir_cmd(conn, ".msgs", messages_list);
+ dir_cmd(conn, ".pools", pool_list);
+ dir_cmd(conn, ".storage", storage_list);
+ dir_cmd(conn, ".types", type_list);
+ dir_cmd(conn, ".levels", level_list);
+
+ if (mainWin->m_connDebug) {
+ QString dbgmsg = QString("jobs=%1 clients=%2 filesets=%3 msgs=%4 pools=%5 storage=%6 types=%7 levels=%8\n")
+ .arg(job_list.count()).arg(client_list.count()).arg(fileset_list.count()).arg(messages_list.count())
+ .arg(pool_list.count()).arg(storage_list.count()).arg(type_list.count()).arg(level_list.count());
+ Pmsg1(000, "%s\n", dbgmsg.toUtf8().data());
}
}
bool get_job_defaults(int &conn, struct job_defaults &);
const QFont get_font();
void beginNewCommand(int conn);
+ void populateLists(bool forcenew);
private:
bool get_job_defaults(int &conn, struct job_defaults &, bool donotify);
void stopTimer();
bool is_connectedGui();
bool newDirComm(int &conn);
+ void populateLists(int conn);
public:
QStringList job_list;
</property>
<widget class="QWidget" name="centralwidget" >
<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" >
<widget class="QStackedWidget" name="stackedWidget" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<x>0</x>
<y>0</y>
<width>882</width>
- <height>28</height>
+ <height>22</height>
</rect>
</property>
<widget class="QMenu" name="menuEdit" >
<addaction name="actionPrint" />
<addaction name="actionSave" />
<addaction name="actionQuit" />
+ <addaction name="actionRepopLists" />
</widget>
<addaction name="menuFile" />
<addaction name="menuEdit" />
<enum>Qt::Horizontal</enum>
</property>
<attribute name="toolBarArea" >
- <number>4</number>
+ <enum>TopToolBarArea</enum>
+ </attribute>
+ <attribute name="toolBarBreak" >
+ <bool>false</bool>
</attribute>
<addaction name="actionConnect" />
<addaction name="actionStatusDir" />
</widget>
<widget class="QDockWidget" name="dockWidget" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</attribute>
<widget class="QWidget" name="dockWidgetContents" >
<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" >
<widget class="QTreeWidget" name="treeWidget" >
<property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>7</vsizetype>
+ <sizepolicy vsizetype="Expanding" hsizetype="Preferred" >
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
<property name="autoFillBackground" >
<bool>true</bool>
</property>
+ <column>
+ <property name="text" >
+ <string>1</string>
+ </property>
+ </column>
</widget>
</item>
</layout>
</attribute>
<widget class="QWidget" name="dockWidgetContents_2" >
<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" >
<layout class="QHBoxLayout" >
- <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="label" >
<property name="text" >
<string>Director Status Page</string>
</property>
</action>
+ <action name="actionRepopLists" >
+ <property name="icon" >
+ <iconset resource="main.qrc" >:/images/mark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Repop Lists</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="main.qrc" />
connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
connect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
+ connect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
}
void MainWin::disconnectSignals()
disconnect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
disconnect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
disconnect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
+ disconnect(actionRepopLists, SIGNAL(triggered()), this, SLOT(repopLists()));
}
/*
{
app->setOverrideCursor(QCursor(Qt::WaitCursor));
disconnectSignals();
+ disconnectConsoleSignals(m_currentConsole);
m_waitTreeItem = treeWidget->currentItem();
}
if (m_waitTreeItem != treeWidget->currentItem())
treeWidget->setCurrentItem(m_waitTreeItem);
connectSignals();
+ connectConsoleSignals();
}
void MainWin::connectConsoleSignals()
disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
}
+void MainWin::repopLists()
+{
+ m_currentConsole->populateLists(false);
+}
+
/*
* Reimplementation of QWidget closeEvent virtual function
*/
{
return m_currentConsole;
}
+
/* Quick function to return the tree item for the director */
QTreeWidgetItem *MainWin::currentTopItem()
{
void readPreferences();
void waitEnter();
void waitExit();
+ void repopLists();
protected:
void closeEvent(QCloseEvent *event);