From 93bad07a0869470d91919f2b622f98945ede2146 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Fri, 30 Mar 2007 01:00:22 +0000 Subject: [PATCH] dhb Simplify MainWin::undockWindowButton. Make the columns in medialist resemble the columns in list media at a console command. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4456 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/mainwin.cpp | 10 ++-------- bacula/src/qt-console/medialist/medialist.cpp | 13 ++++++++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index aa23377287..f210cf5eb4 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -347,12 +347,6 @@ void MainWin::undockWindow() void MainWin::undockWindowButton() { - int curindex = stackedWidget->currentIndex(); - - foreach (Pages* pagesItem, m_pageshash){ - if (curindex == stackedWidget->indexOf(pagesItem)) { - pagesItem->togglePageDocking(); - break; - } - } + Pages* page = (Pages*)stackedWidget->currentWidget(); + page->togglePageDocking(); } diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 452d90f81f..51d368b801 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -68,7 +68,7 @@ void MediaList::populateTree() QTreeWidgetItem *mediatreeitem, *pooltreeitem, *topItem; m_treeWidget->clear(); - m_treeWidget->setColumnCount(3); + m_treeWidget->setColumnCount(9); topItem = new QTreeWidgetItem(m_treeWidget); topItem->setText(0, "Pools"); topItem->setData(0, Qt::UserRole, 0); @@ -83,15 +83,22 @@ void MediaList::populateTree() /* Start with a list of pools */ m_poollist->clear(); m_headerlist->clear(); + //m_headerlist->append("Media Id"); m_headerlist->append("Volume Name"); m_headerlist->append("Media Id"); - m_headerlist->append("Type"); + m_headerlist->append("Volume Status"); + m_headerlist->append("Enabled"); + m_headerlist->append("Volume Bytes"); + m_headerlist->append("Volume Files"); + m_headerlist->append("Volume Retention"); + m_headerlist->append("Media Type"); + m_headerlist->append("Last Written"); m_treeWidget->setHeaderLabels(*m_headerlist); QString currentpool(""); QString resultline; QStringList results; - const char* m_cmd = ".sql \"select p.name, m.volumename, m.mediaid, m.mediatype from media m, pool p ORDER BY p.name\""; + QString m_cmd(".sql \"select p.name, m.volumename, m.mediaid, m.volstatus, m.enabled, m.volbytes, m.volfiles, m.volretention, m.mediatype, m.lastwritten FROM media m, pool p ORDER BY p.name\""); if ( m_console->dir_cmd(m_cmd,results)){ int recordcounter=0; foreach( resultline, results ){ -- 2.39.5