From: Dirk H Bartley Date: Mon, 28 May 2007 00:52:41 +0000 (+0000) Subject: Add preference for longlist or short list when context sensitive list command is X-Git-Tag: Release-7.0.0~6223 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ed12195c68d9ff8641fdef52dfd314aca6285901;p=bacula%2Fbacula Add preference for longlist or short list when context sensitive list command is executed. Use this instead of doubling for list and long list. Used for now in joblist. Use consoleCommand when running command from user command input so that it displays blue. Add reload command from page selector console widget. Add list job totals from page selector joblist widget. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4922 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/COMMANDS b/bacula/src/qt-console/COMMANDS index f2ffca09db..f70f2e1408 100644 --- a/bacula/src/qt-console/COMMANDS +++ b/bacula/src/qt-console/COMMANDS @@ -1,4 +1,4 @@ -cancel [jobid= job= ujobid=] +cancel [job= ujobid=] To be done in the context of a status dir graphical window. Also in a "job resources window for job-name". @@ -9,24 +9,21 @@ delete pool= disable job and enable job Could be done in the context of a jobs resource window which is not yet created -estimate -Could be a dialog in the context of a jobs window. - list -many are done or are reproduced by having windows - -llist -same as list + list ujobid (list job with unique name) + list files job= + do this as a context option on page selector on joblist + list volumes job= + list nextvolume job= + list nextvol job= + list nextvol job= days=nnn prune files|jobs|volume client= volume= -Should add as a dialog box from both client and medialist +could add as a dialog box from both client and medialist release storage= Would need to explain what this does in bat with a dialog -reload -could be done in console or on director's page selector widget - run done @@ -86,10 +83,34 @@ DONE automount on/off Added buttons to the label dialog box to execute automount command +cancel jobid= + delete [volume= job jobid=] +estimate +Could be a dialog in the context of a jobs window. + +list + list jobid= (list jobid id) + list files jobid= + list jobmedia jobid= + list volumes jobid= + list jobtotals (from page selector on joblist widget) + The next few are accomplishable graphically with joblist class + list jobs + list job= (list all jobs with "job-name") + list jobname= (same as above) + list jobmedia + list jobmedia job= + The next few are accomplishable graphically with the medialist class + list volumes + list volumes pool= + list volume= + list pools + Accomplishable with the clients class graphically + list clients help -could be in the console window + context sensitive from page selector console label Done by kern before I started @@ -100,3 +121,6 @@ purge jobs client= (of all jobs) relabel done + +reload +could be done in console or on director's page selector widget diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 2a05252b75..71c4f8fcc4 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -7,6 +7,8 @@ As well as many more update slots scan see COMMANDS file +Create edit pool interface. + ========LOW priority items: Use settings object to size the restore window. Similar to the saving of the state of the main window. diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index f9f96a7cf4..e09239ed63 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -63,8 +63,10 @@ Console::Console(QStackedWidget *parent) m_contextActions.append(actionStatusDir); m_contextActions.append(actionConsoleHelp); m_contextActions.append(actionRequestMessages); + m_contextActions.append(actionConsoleReload); connect(actionStatusDir, SIGNAL(triggered()), this, SLOT(status_dir())); connect(actionConsoleHelp, SIGNAL(triggered()), this, SLOT(consoleHelp())); + connect(actionConsoleReload, SIGNAL(triggered()), this, SLOT(consoleReload())); connect(actionRequestMessages, SIGNAL(triggered()), this, SLOT(messages())); } @@ -829,3 +831,10 @@ void Console::consoleHelp() QString cmd("help"); consoleCommand(cmd); } + +/* Slot for responding to page selectors reload bacula-dir.conf */ +void Console::consoleReload() +{ + QString cmd("reload"); + consoleCommand(cmd); +} diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index 295ebfeabb..03361028ee 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -124,6 +124,7 @@ public slots: void set_font(void); void poll_messages(void); void consoleHelp(); + void consoleReload(); public: DIRRES *m_dir; /* so various pages can reference it */ diff --git a/bacula/src/qt-console/console/console.ui b/bacula/src/qt-console/console/console.ui index d4b9c4bc1a..c43facec2e 100644 --- a/bacula/src/qt-console/console/console.ui +++ b/bacula/src/qt-console/console/console.ui @@ -87,7 +87,7 @@ - ConsoleHelp + Console Help @@ -95,6 +95,11 @@ Request Messages + + + Reload bacula-dir.conf + + diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 698e763be1..0fdd0b57a7 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -305,7 +305,6 @@ void JobList::currentStackItem() { populateTable(); if (!m_populated) { - m_contextActions.append(actionRefreshJobList); m_populated=true; } } @@ -389,7 +388,6 @@ void JobList::createConnections() /* Add Actions */ mp_tableWidget->addAction(actionRefreshJobList); - mp_tableWidget->addAction(actionLongListJob); mp_tableWidget->addAction(actionListJobid); mp_tableWidget->addAction(actionListFilesOnJob); mp_tableWidget->addAction(actionListJobMedia); @@ -401,8 +399,6 @@ void JobList::createConnections() mp_tableWidget->addAction(actionShowLogForJob); /* Make Connections */ - connect(actionLongListJob, SIGNAL(triggered()), this, - SLOT(consoleLongListJob())); connect(actionListJobid, SIGNAL(triggered()), this, SLOT(consoleListJobid())); connect(actionListFilesOnJob, SIGNAL(triggered()), this, @@ -423,40 +419,50 @@ void JobList::createConnections() SLOT(showLogForJob())); connect(actionCancelJob, SIGNAL(triggered()), this, SLOT(consoleCancelJob())); + connect(actionListJobTotals, SIGNAL(triggered()), this, + SLOT(consoleListJobTotals())); + + m_contextActions.append(actionRefreshJobList); + m_contextActions.append(actionListJobTotals); } /* * Functions to respond to local context sensitive menu sending console commands * If I could figure out how to make these one function passing a string, Yaaaaaa */ -void JobList::consoleLongListJob() -{ - QString cmd("llist jobid="); - cmd += m_currentJob; - consoleCommand(cmd); -} void JobList::consoleListJobid() { QString cmd("list jobid="); cmd += m_currentJob; + if (mainWin->m_longList) { cmd.prepend("l"); } consoleCommand(cmd); } void JobList::consoleListFilesOnJob() { QString cmd("list files jobid="); cmd += m_currentJob; + if (mainWin->m_longList) { cmd.prepend("l"); } consoleCommand(cmd); } void JobList::consoleListJobMedia() { QString cmd("list jobmedia jobid="); cmd += m_currentJob; + if (mainWin->m_longList) { cmd.prepend("l"); } consoleCommand(cmd); } void JobList::consoleListVolumes() { QString cmd("list volumes jobid="); cmd += m_currentJob; + if (mainWin->m_longList) { cmd.prepend("l"); } + consoleCommand(cmd); +} +void JobList::consoleListJobTotals() +{ + QString cmd("list jobtotals"); + cmd += m_currentJob; + if (mainWin->m_longList) { cmd.prepend("l"); } consoleCommand(cmd); } void JobList::consoleDeleteJob() diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index 4a37a4be69..ed1e7bc7c8 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -54,11 +54,11 @@ public slots: void tableItemChanged(QTableWidgetItem *, QTableWidgetItem *); private slots: - void consoleLongListJob(); void consoleListJobid(); void consoleListFilesOnJob(); void consoleListJobMedia(); void consoleListVolumes(); + void consoleListJobTotals(); void consoleDeleteJob(); void consolePurgeFiles(); void preRestoreFromJob(); diff --git a/bacula/src/qt-console/joblist/joblist.ui b/bacula/src/qt-console/joblist/joblist.ui index 9dd5637e31..ef8e02eab0 100644 --- a/bacula/src/qt-console/joblist/joblist.ui +++ b/bacula/src/qt-console/joblist/joblist.ui @@ -365,14 +365,6 @@ ListVolumes - - - :images/unmark.png - - - LongListJob - - :images/unmark.png @@ -421,6 +413,14 @@ Cancel Currently Running Job + + + :images/unmark.png + + + List Job Totals in Console + + diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index 4ba65496d0..9380768d83 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -478,8 +478,7 @@ void MainWin::input_line() QString cmdStr = lineEdit->text(); /* Get the text */ lineEdit->clear(); /* clear the lineEdit box */ if (m_currentConsole->is_connected()) { - m_currentConsole->display_text(cmdStr + "\n"); - m_currentConsole->write_dir(cmdStr.toUtf8().data()); /* send to dir */ + m_currentConsole->consoleCommand(cmdStr); } else { set_status("Director not connected. Click on connect button."); } @@ -647,6 +646,8 @@ void MainWin::setPreferences() prefs.daysSpinBox->setValue(m_daysLimitVal); prefs.checkMessages->setCheckState(m_checkMessages ? Qt::Checked : Qt::Unchecked); prefs.checkMessagesSpin->setValue(m_checkMessagesInterval); + prefs.executeLongCheckBox->setCheckState(m_longList ? Qt::Checked : Qt::Unchecked); + prefs.exec(); } @@ -670,6 +671,7 @@ void prefsDialog::accept() mainWin->m_daysLimitVal = this->daysSpinBox->value(); mainWin->m_checkMessages = this->checkMessages->checkState() == Qt::Checked; mainWin->m_checkMessagesInterval = this->checkMessagesSpin->value(); + mainWin->m_longList = this->executeLongCheckBox->checkState() == Qt::Checked; QSettings settings("www.bacula.org", "bat"); settings.beginGroup("Debug"); settings.setValue("commDebug", mainWin->m_commDebug); @@ -688,6 +690,9 @@ void prefsDialog::accept() settings.setValue("checkMessages", mainWin->m_checkMessages); settings.setValue("checkMessagesInterval", mainWin->m_checkMessagesInterval); settings.endGroup(); + settings.beginGroup("Misc"); + settings.setValue("longList", mainWin->m_longList); + settings.endGroup(); foreach(Console *console, mainWin->m_consoleHash) { console->startTimer(); } @@ -720,4 +725,7 @@ void MainWin::readPreferences() m_checkMessages = settings.value("checkMessages", false).toBool(); m_checkMessagesInterval = settings.value("checkMessagesInterval", 28).toInt(); settings.endGroup(); + settings.beginGroup("Misc"); + m_longList = settings.value("longList", false).toBool(); + settings.endGroup(); } diff --git a/bacula/src/qt-console/mainwin.h b/bacula/src/qt-console/mainwin.h index a134210c5f..c5f59cc17f 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -82,6 +82,7 @@ public: int m_daysLimitVal; bool m_checkMessages; int m_checkMessagesInterval; + bool m_longList; public slots: void input_line(); diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index c7e7d1a1f1..108724fcec 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -69,6 +69,7 @@ public: void setCurrent(); void setContextMenuDockText(); void setTreeWidgetItemDockColor(); + void consoleCommand(QString &); public slots: /* closeEvent is a virtual function inherited from QWidget */ @@ -77,7 +78,6 @@ public slots: protected: void pgInitialize(); void pgInitialize(QTreeWidgetItem *); - void consoleCommand(QString &); virtual void treeWidgetName(QString &); virtual void changeEvent(QEvent *event); void setConsoleCurrent(); diff --git a/bacula/src/qt-console/prefs.ui b/bacula/src/qt-console/prefs.ui index 8d675c353d..b14febd5e8 100644 --- a/bacula/src/qt-console/prefs.ui +++ b/bacula/src/qt-console/prefs.ui @@ -81,7 +81,11 @@ - + + + 3600 + + @@ -170,6 +174,37 @@ + + + Misc + + + + + 30 + 50 + 201 + 81 + + + + Context Sensitive List Commands + + + + + 10 + 20 + 161 + 19 + + + + Execute Long List + + + + Debug