From: Dirk H Bartley Date: Tue, 21 Jul 2009 23:22:34 +0000 (+0000) Subject: This is committing most of the patch received from Eric. X-Git-Tag: Release-5.0.0~482 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e56c4e4610c8448a1f46984939b6260848e66b79;p=bacula%2Fbacula This is committing most of the patch received from Eric. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9080 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/clients/clients.cpp b/bacula/src/qt-console/clients/clients.cpp index df56522fb2..2c39953d24 100644 --- a/bacula/src/qt-console/clients/clients.cpp +++ b/bacula/src/qt-console/clients/clients.cpp @@ -60,7 +60,6 @@ Clients::Clients() * selector tree. m_contextActions is QList of QActions */ m_contextActions.append(actionRefreshClients); createContextMenu(); - dockPage(); } Clients::~Clients() @@ -191,6 +190,7 @@ void Clients::PgSeltreeWidgetClicked() if(!m_populated) { populateTable(); } + dockPage(); } /* diff --git a/bacula/src/qt-console/clients/clients.ui b/bacula/src/qt-console/clients/clients.ui index c62149b84e..b6fd03a59f 100644 --- a/bacula/src/qt-console/clients/clients.ui +++ b/bacula/src/qt-console/clients/clients.ui @@ -71,7 +71,7 @@ :/images/status.png:/images/status.png - Status Client Window + Status Client diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 4285dec111..4201d61ce2 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -40,9 +40,10 @@ #include "select.h" #include "run/run.h" -Console::Console(QStackedWidget *parent) +Console::Console(QTabWidget *parent) { QFont font; + m_name = tr("Console"); m_messages_pending = false; m_parent = parent; m_closeable = false; @@ -723,7 +724,7 @@ void Console::consoleReload() * This may be rendered not needed if the multiple connections feature gets working */ bool Console::hasFocus() { - if (mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this)) + if (mainWin->tabWidget->currentIndex() == mainWin->tabWidget->indexOf(this)) return true; else return false; diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index ab07401b24..d408bba0a8 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -70,7 +70,7 @@ class Console : public Pages, public Ui::ConsoleForm friend class DirComm; public: - Console(QStackedWidget *parent); + Console(QTabWidget *parent); ~Console(); int read(int conn); char *msg(int conn); diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index eb21157854..da3948ad14 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -57,7 +57,6 @@ FileSet::FileSet() /* add context sensitive menu items specific to this classto the page * selector tree. m_contextActions is QList of QActions */ m_contextActions.append(actionRefreshFileSet); - dockPage(); } FileSet::~FileSet() @@ -184,6 +183,7 @@ void FileSet::PgSeltreeWidgetClicked() populateTable(); createContextMenu(); } + dockPage(); } /* diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 2650789048..27cc840859 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -73,7 +73,6 @@ JobList::JobList(const QString &mediaName, const QString &clientName, limitSpinBox->setValue(mainWin->m_recordLimitVal); daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked); daysSpinBox->setValue(mainWin->m_daysLimitVal); - dockPage(); QGridLayout *gridLayout = new QGridLayout(this); gridLayout->setSpacing(6); @@ -349,6 +348,7 @@ void JobList::PgSeltreeWidgetClicked() if (!m_populated) { populateTable(); } + dockPage(); } /* @@ -405,8 +405,6 @@ void JobList::createConnections() /* setContextMenuPolicy is required */ mp_tableWidget->setContextMenuPolicy(Qt::ActionsContextMenu); - connect(actionListJobid, SIGNAL(triggered()), this, - SLOT(consoleListJobid())); connect(actionListFilesOnJob, SIGNAL(triggered()), this, SLOT(consoleListFilesOnJob())); connect(actionListJobMedia, SIGNAL(triggered()), this, @@ -436,13 +434,6 @@ void JobList::createConnections() * 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::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="); @@ -643,7 +634,6 @@ void JobList::selectionChanged() /* Add Actions */ mp_tableWidget->addAction(actionRefreshJobList); if (m_selectedJobsCount == 1) { - mp_tableWidget->addAction(actionListJobid); mp_tableWidget->addAction(actionListFilesOnJob); mp_tableWidget->addAction(actionListJobMedia); mp_tableWidget->addAction(actionListVolumes); diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index 9492a1cbe4..58bd2c15be 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -56,7 +56,6 @@ public slots: void selectionChanged(); private slots: - void consoleListJobid(); void consoleListFilesOnJob(); void consoleListJobMedia(); void consoleListVolumes(); diff --git a/bacula/src/qt-console/joblist/joblist.ui b/bacula/src/qt-console/joblist/joblist.ui index 4f86c64bbe..99adbadab0 100644 --- a/bacula/src/qt-console/joblist/joblist.ui +++ b/bacula/src/qt-console/joblist/joblist.ui @@ -1,19 +1,20 @@ - + + JobListForm - - + + 0 0 - 739 - 790 + 696 + 456 - + Form - - + + 60 10 @@ -22,78 +23,60 @@ - - + + - 20 - 220 - 573 - 149 + 50 + 190 + 541 + 171 - + 900 172 - + QFrame::StyledPanel - + QFrame::Raised - - - - + + + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Record Limit - - + + 1 - + 10000 - + 25 @@ -101,32 +84,23 @@ - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Days Limit - - + + 7 @@ -135,365 +109,247 @@ - - - + + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Clients - + - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Volume - + - - - + + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Job - + - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Level - + - - - + + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Status - + - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Purged - + - - - - 3 - - - 3 - - - 3 - - + + + 3 - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + FileSet - + - - + + 6 - - 3 - - - 3 - - - 3 - - + 3 - - + + Pool - + - - + + - - - 3 - - - 3 - - - 3 - - - 3 - - + + 3 - + 3 - - - + + + Refresh - - :/images/view-refresh.png + + + :/images/view-refresh.png:/images/view-refresh.png - - - + + + Graph - - :/images/applications-graphics.png + + + :/images/applications-graphics.png:/images/applications-graphics.png - - + + Filter Copy Jobs - - + + Filter Migration Jobs @@ -502,108 +358,111 @@ - - - :/images/view-refresh.png + + + + :/images/view-refresh.png:/images/view-refresh.png - + Refresh Job List - + Requery the director for the list of jobs. - - - :/images/utilities-terminal.png - - - ListJobid - - - - - :/images/utilities-terminal.png + + + + :/images/utilities-terminal.png:/images/utilities-terminal.png - + List Files On Job - - - :/images/utilities-terminal.png + + + + :/images/utilities-terminal.png:/images/utilities-terminal.png - + ListJobMedia - - - :/images/utilities-terminal.png + + + + :/images/utilities-terminal.png:/images/utilities-terminal.png - + ListVolumes - - - :/images/weather-severe-alert.png + + + + :/images/weather-severe-alert.png:/images/weather-severe-alert.png - + DeleteJob - - - :/images/weather-severe-alert.png + + + + :/images/weather-severe-alert.png:/images/weather-severe-alert.png - + PurgeFiles - - - :/images/restore.png + + + + :/images/restore.png:/images/restore.png - + Restore From Job - - - :/images/restore.png + + + + :/images/restore.png:/images/restore.png - + Restore From Time - - - :/images/joblog.png + + + + :/images/joblog.png:/images/joblog.png - + Show Log for Job - - - :/images/unmark.png + + + + :/images/unmark.png:/images/unmark.png - + Cancel Currently Running Job - - - :/images/utilities-terminal.png + + + + :/images/utilities-terminal.png:/images/utilities-terminal.png - + List Job Totals in Console - + diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp index 47b688b4b1..5e9390c15a 100644 --- a/bacula/src/qt-console/jobs/jobs.cpp +++ b/bacula/src/qt-console/jobs/jobs.cpp @@ -56,7 +56,6 @@ Jobs::Jobs() * selector tree. m_contextActions is QList of QActions */ m_contextActions.append(actionRefreshJobs); createContextMenu(); - dockPage(); } Jobs::~Jobs() @@ -136,6 +135,7 @@ void Jobs::populateTable() } } mainWin->waitExit(); + dockPage(); } /* diff --git a/bacula/src/qt-console/main.ui b/bacula/src/qt-console/main.ui index d602e87088..05eae9847a 100644 --- a/bacula/src/qt-console/main.ui +++ b/bacula/src/qt-console/main.ui @@ -35,28 +35,7 @@ 6 - - - - 1 - 0 - - - - - 1 - 0 - - - - Qt::StrongFocus - - - - - - - + -1 @@ -230,6 +209,9 @@ true + + true + 1 diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index cddfb23001..43b70d54d6 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -80,7 +80,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent) treeWidget->setColumnCount(1); treeWidget->setHeaderLabel( tr("Select Page") ); treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu); - + // tabWidget->setTabsClosable(true); /* wait for QT 4.5 */ createPages(); resetFocus(); /* lineEdit->setFocus() */ @@ -126,7 +126,7 @@ void MainWin::createPages() foreach_res(dir, R_DIRECTOR) { /* Create console tree stacked widget item */ - m_currentConsole = new Console(stackedWidget); + m_currentConsole = new Console(tabWidget); m_currentConsole->setDirRes(dir); m_currentConsole->readSettings(); @@ -179,7 +179,7 @@ void MainWin::createPages() new DirStat(); treeWidget->expandItem(topItem); - stackedWidget->setCurrentWidget(m_currentConsole); + tabWidget->setCurrentWidget(m_currentConsole); } UnlockRes(); } @@ -250,7 +250,7 @@ void MainWin::connectSignals() connect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help())); connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int))); connect(treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int))); + connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int))); connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows())); connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked())); connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked())); @@ -277,7 +277,7 @@ void MainWin::disconnectSignals() disconnect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help())); disconnect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int))); disconnect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - disconnect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int))); + disconnect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int))); disconnect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows())); disconnect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked())); disconnect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked())); @@ -427,10 +427,10 @@ void MainWin::treeItemClicked(QTreeWidgetItem *item, int /*column*/) /* Is this a page that has been inserted into the hash */ if (getFromHash(item)) { Pages* page = getFromHash(item); - int stackindex=stackedWidget->indexOf(page); + int stackindex=tabWidget->indexOf(page); if (stackindex >= 0) { - stackedWidget->setCurrentWidget(page); + tabWidget->setCurrentWidget(page); } /* run the virtual function in case this class overrides it */ page->PgSeltreeWidgetClicked(); @@ -511,12 +511,12 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre dirItem->setBackground(0, magentaBrush); } /* set the value for the currently active console */ - int stackindex = stackedWidget->indexOf(nextPage); + int stackindex = tabWidget->indexOf(nextPage); /* Is this page currently on the stack or is it undocked */ if (stackindex >= 0) { /* put this page on the top of the stack */ - stackedWidget->setCurrentIndex(stackindex); + tabWidget->setCurrentIndex(stackindex); } else { /* it is undocked, raise it to the front */ nextPage->raise(); @@ -655,7 +655,7 @@ void MainWin::set_status(const char *buf) */ void MainWin::undockWindowButton() { - Pages* page = (Pages*)stackedWidget->currentWidget(); + Pages* page = (Pages*)tabWidget->currentWidget(); page->togglePageDocking(); } @@ -683,7 +683,7 @@ void MainWin::toggleDockContextWindow() void MainWin::stackItemChanged(int) { if (m_isClosing) return; /* if closing the application, do nothing here */ - Pages* page = (Pages*)stackedWidget->currentWidget(); + Pages* page = (Pages*)tabWidget->currentWidget(); /* run the virtual function in case this class overrides it */ page->currentStackItem(); } diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index f43b35b0c4..f48d287ad8 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -61,7 +61,6 @@ MediaList::MediaList() /* add context sensitive menu items specific to this classto the page * selector tree. m_contextActions is QList of QActions */ m_contextActions.append(actionRefreshMediaList); - dockPage(); } MediaList::~MediaList() @@ -290,6 +289,7 @@ void MediaList::PgSeltreeWidgetClicked() populateTree(); createContextMenu(); } + dockPage(); } /* diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index d9027b8581..1b99dbb13c 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -59,19 +59,24 @@ bool isWin32Path(QString &fullPath) void Pages::dockPage() { + if (isDocked()) { + return; + } + /* These two lines are for making sure if it is being changed from a window * that it has the proper window flag and parent. */ setWindowFlags(Qt::Widget); /* This was being done already */ - m_parent->addWidget(this); + m_parent->addTab(this, m_name); /* Set docked flag */ m_docked = true; - mainWin->stackedWidget->setCurrentWidget(this); + mainWin->tabWidget->setCurrentWidget(this); /* lets set the page selectors action for docking or undocking */ setContextMenuDockText(); + } /* @@ -82,8 +87,12 @@ void Pages::dockPage() void Pages::undockPage() { + if (!isDocked()) { + return; + } + /* Change from a stacked widget to a normal window */ - m_parent->removeWidget(this); + m_parent->removeTab(m_parent->indexOf(this)); setWindowFlags(Qt::Window); show(); /* Clear docked flag */ @@ -197,10 +206,11 @@ void Pages::pgInitialize(const QString &name) void Pages::pgInitialize(const QString &tname, QTreeWidgetItem *parentTreeWidgetItem) { + m_docked = false; if (tname.size()) { m_name = tname; } - m_parent = mainWin->stackedWidget; + m_parent = mainWin->tabWidget; m_console = mainWin->currentConsole(); if (!parentTreeWidgetItem) { diff --git a/bacula/src/qt-console/pages.h b/bacula/src/qt-console/pages.h index 4aec85e6ec..654dd2ad95 100644 --- a/bacula/src/qt-console/pages.h +++ b/bacula/src/qt-console/pages.h @@ -60,7 +60,7 @@ public: void togglePageDocking(); bool isDocked(); bool isCloseable(); - QStackedWidget *m_parent; + QTabWidget *m_parent; QList m_contextActions; virtual void PgSeltreeWidgetClicked(); virtual void currentStackItem(); diff --git a/bacula/src/qt-console/status/clientstat.cpp b/bacula/src/qt-console/status/clientstat.cpp index 9260c785d6..ccba961177 100644 --- a/bacula/src/qt-console/status/clientstat.cpp +++ b/bacula/src/qt-console/status/clientstat.cpp @@ -99,7 +99,7 @@ void ClientStat::timerTriggered() value -= 1; if (value == 0) { value = spinBox->value(); - bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this); + bool iscurrent = mainWin->tabWidget->currentIndex() == mainWin->tabWidget->indexOf(this); if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) { populateAll(); } diff --git a/bacula/src/qt-console/status/clientstat.ui b/bacula/src/qt-console/status/clientstat.ui index f425965f3c..483f567cb9 100644 --- a/bacula/src/qt-console/status/clientstat.ui +++ b/bacula/src/qt-console/status/clientstat.ui @@ -25,6 +25,16 @@ 0 + + + Running + + + + + + + Header @@ -93,16 +103,6 @@ - - - Running - - - - - - - diff --git a/bacula/src/qt-console/status/dirstat.cpp b/bacula/src/qt-console/status/dirstat.cpp index 400eb23bdc..54913d40fc 100644 --- a/bacula/src/qt-console/status/dirstat.cpp +++ b/bacula/src/qt-console/status/dirstat.cpp @@ -51,11 +51,12 @@ DirStat::DirStat() m_timer = new QTimer(this); readSettings(); - dockPage(); m_timer->start(1000); createConnections(); setCurrent(); + + dockPage(); } void DirStat::getFont() @@ -101,7 +102,7 @@ void DirStat::timerTriggered() value -= 1; if (value == 0) { value = spinBox->value(); - bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this); + bool iscurrent = mainWin->tabWidget->currentIndex() == mainWin->tabWidget->indexOf(this); if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) { populateAll(); } diff --git a/bacula/src/qt-console/status/storstat.cpp b/bacula/src/qt-console/status/storstat.cpp index 4925778a0f..0d2f7bb497 100644 --- a/bacula/src/qt-console/status/storstat.cpp +++ b/bacula/src/qt-console/status/storstat.cpp @@ -67,11 +67,12 @@ StorStat::StorStat(QString &storage, QTreeWidgetItem *parentTreeWidgetItem) m_timer = new QTimer(this); readSettings(); - dockPage(); createConnections(); m_timer->start(1000); setCurrent(); + + dockPage(); } void StorStat::getFont() @@ -115,7 +116,7 @@ void StorStat::timerTriggered() value -= 1; if (value == 0) { value = spinBox->value(); - bool iscurrent = mainWin->stackedWidget->currentIndex() == mainWin->stackedWidget->indexOf(this); + bool iscurrent = mainWin->tabWidget->currentIndex() == mainWin->tabWidget->indexOf(this); if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) { populateAll(); } diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 089b64817d..7141787c79 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -60,7 +60,6 @@ Storage::Storage() /* add context sensitive menu items specific to this classto the page * selector tree. m_contextActions is QList of QActions */ m_contextActions.append(actionRefreshStorage); - dockPage(); } Storage::~Storage() @@ -234,6 +233,7 @@ void Storage::PgSeltreeWidgetClicked() populateTree(); createContextMenu(); } + dockPage(); } /*