From: Dirk H Bartley Date: Mon, 7 May 2007 00:06:33 +0000 (+0000) Subject: Added color scheme to medialist status column. Edited TODO and README X-Git-Tag: Release-7.0.0~6414 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=003b6cd6add99fb9d459df881729e9962d7f258b;p=bacula%2Fbacula Added color scheme to medialist status column. Edited TODO and README git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4717 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/README b/bacula/src/qt-console/README index 4b5371e7b9..c1e02cd44e 100644 --- a/bacula/src/qt-console/README +++ b/bacula/src/qt-console/README @@ -22,59 +22,17 @@ Makefile, and there after, you simply use "make". In fact, providing you edit bat.pro, doing a "make" will automatically call qmake to rebuild the Makefile. -Development status as of 27 Feb 07. +From the base bacula directory, make Makefiles will generate bat.pro from +bat.pro.in, so only edit bat.pro.in. It will also overwrite the qt-consoles +bat.conf file. "make install" will write /etc/bacula/bat.conf. bat.conf can +include as many director stanza's as you would like in bat.conf. You may use +this directories bat.conf.example as a template for director stanza's. -Items implemented: -- Reads a basic bat.conf (same as documented for the gnome-console - except that the Font part is unimplemented). -- Basic main window structure -- About dialog -- Quit menu item -- Will automatically connnect to the first Director in the - conf file. Doesn't know about multiple Directors. -- The Director name will appear in the Selection tree followed - by Console and Restore. -- Clicking on Console brings forward the console display screen - (default at startup). -- Clicking on -- Clicking on bRestore brings up a brestore page that is not active. -- The command line is implemented. -- The status line (below the command line) is implemented. -- Selection of Font is implemented. -- The Font and the window size are saved on exit and restored on - execution of bat. -- The Status menu bar icon is implemented. +Development status as of 05/06/07 Items not implemented: -- None of the menu items except About, Select Font, and Quit. - Nothing on the brestore page -- The Label menu bar item, prints on the shell window what you entered. -- The Run menu bar item, prints on the console window what you entered. -- The Restore menu bar item, brings up dialog, then when OK is - clicked, it goes on to the next dialog, which is meant to be - a tree view, but for the moment does nothing ... It is a bit - ugly. Cancelling it should get you back to the normal command prompt. -Not working: -- The left selection window and the right window (where the console - is) are dockable windows so should be movable once they are properly - clicked. Well, they sort of move, but then get stuck. I haven't figured - out what is going on, so for the current time, I am implemeting most - stuff through dialogs. - -Design/implementation considerations: -- We need to have multiple Directors -- Each Director should have its own console -- The Console class needs to be a list or be attached to the - currently active Director. -- Need icons in front of the Director. -- The console page should be in a DockWidget so it can be removed - from the main window. It is currently in a dock window, but it - does not remove properly -- more research needed. -- Need to figure out a good implementation of adding pages and even - having plugins that load as pages. Currently the page mechanism - is a bit kludged. - Design decisions: - If possible all code for a particular component will be kept in and appropriate subdirectory. @@ -88,14 +46,70 @@ Design decisions: in main.ui. Major projects: -- Implement a restore page that does a directory tree restore selection - much like wx-console does. - Implement other restore interfaces such as brestore ... - Implement a database browser -- Implement graphical commands that allow updating most aspects of - the database (i.e. commands for label, update Volume, ...) - Implement a resource (conf file) browser - Implement a reports page -- e.g. something similar to bweb - Implement Qt plugins to add new functionality to bat - Implement a GUI configuration file editor (something like JBacula). ... + +Partially Done: +=========================== +- Implement graphical commands that allow updating most aspects of + the database (i.e. commands for label, update Volume, ...) + still need to be able to edit a pool object + +- None of the menu items except About, Select Font, and Quit. + Print and save don't do anything, does save need to?? +Done: +============================ +Design/implementation considerations: +- Need icons in front of the Director. +- The console page should be in a DockWidget so it can be removed + from the main window. It is currently in a dock window, but it + does not remove properly -- more research needed. +- Need to figure out a good implementation of adding pages and even + having plugins that load as pages. Currently the page mechanism + is a bit kludged. + +- We need to have multiple Directors +- Each Director should have its own console +- The Console class needs to be a list or be attached to the + currently active Director. +- Will automatically connnect to the first Director in the + conf file. Doesn't know about multiple Directors. + +- The Label menu bar item, prints on the shell window what you entered. +- The Run menu bar item, prints on the console window what you entered. +- The Restore menu bar item, brings up dialog, then when OK is + clicked, it goes on to the next dialog, which is meant to be + a tree view, but for the moment does nothing ... It is a bit + ugly. Cancelling it should get you back to the normal command prompt. + +- Implement a restore page that does a directory tree restore selection + much like wx-console does. + +Not working: +- The left selection window and the right window (where the console + is) are dockable windows so should be movable once they are properly + clicked. Well, they sort of move, but then get stuck. I haven't figured + out what is going on, so for the current time, I am implemeting most + stuff through dialogs. + +Items implemented: +- Reads a basic bat.conf (same as documented for the gnome-console + except that the Font part is unimplemented). +- Basic main window structure +- About dialog +- Quit menu item +- The Director name will appear in the Selection tree followed + by Console and Restore. +- Clicking on Console brings forward the console display screen + (default at startup). +- The command line is implemented. +- The status line (below the command line) is implemented. +- Selection of Font is implemented. +- The Font and the window size are saved on exit and restored on + execution of bat. +- The Status menu bar icon is implemented. diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 6d11dc8f0b..674a94dac9 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -2,19 +2,15 @@ dhb ==================================================== Test left pane of restore with 2 windows drives in one backup job. -Color code Media Red->Error Append->green Full/Used->Yellow - Resolve issue of connection during restore selection. Could go with preempt of connections. User preferences. With log to stdout options. Have settings for defaults of limits on joblist -Test restore and get anything not working, working. -Add inteligence to prerestore. - partially done. - -Update README describe bat.conf.example to bat.conf +Create the ability to start a restore from joblist. Right click, select +"restore from Jobid=xx" create an instance of restore defaulting in the jobid +or a list of selected jobs. Add numerous are you sure dialog boxes. Like are you sure you want to delete/purge that volume. Show a little of the documentation about what @@ -94,10 +90,16 @@ thing to make it happen: the "dir" is a member of Console director/console to use. Currently they always use the single global one defined in the mainWin class (if I remember right). - ============================================================ DONE: ============================================================ +Update README describe bat.conf.example to bat.conf + +Test restore and get anything not working, working. +Add inteligence to prerestore. + +Color code Media Red->Error Append->green Full/Used->Yellow + Get restore into stack. Should the jobs dialog be turned into a page as well?? Possilbe: Turn run and label into docked pages. (remove button bar buttons??) diff --git a/bacula/src/qt-console/mediaedit/mediaedit.cpp b/bacula/src/qt-console/mediaedit/mediaedit.cpp index ecd9b6df51..a8a099f2a2 100644 --- a/bacula/src/qt-console/mediaedit/mediaedit.cpp +++ b/bacula/src/qt-console/mediaedit/mediaedit.cpp @@ -55,7 +55,7 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId) poolCombo->addItems(console->pool_list); /* The media's Status */ - QStringList statusList = (QStringList() << "Full" << "Append" << "Error" << "Purged" << "Recycled"); + QStringList statusList = (QStringList() << "Full" << "Used" << "Append" << "Error" << "Purged" << "Recycled"); statusCombo->addItems(statusList); /* Set up the query for the default values */ diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index 44fc75e24b..ed6e25ec5f 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -71,6 +71,7 @@ void MediaList::populateTree() << "Volume Name" << "Id" << "Status" << "Enabled" << "Bytes" << "Files" << "Jobs" << "Retention" << "Media Type" << "Slot" << "Last Written"); + int statusIndex = headerlist.indexOf("Status"); m_checkcurwidget = false; mp_treeWidget->clear(); @@ -122,6 +123,9 @@ void MediaList::populateTree() mediatreeitem->setData(index, Qt::UserRole, 2); mediatreeitem->setData(index, Qt::UserRole, 2); mediatreeitem->setText(index, field); + if (index == statusIndex) { + setStatusColor(mediatreeitem, field, index); + } } index++; } /* foreach field */ @@ -134,6 +138,17 @@ void MediaList::populateTree() } } +void MediaList::setStatusColor(QTreeWidgetItem *item, QString &field, int &index) +{ + if (field == "Append" ) { + item->setBackground(index, Qt::green); + } else if (field == "Error") { + item->setBackground(index, Qt::red); + } else if ((field == "Used") || ("Full")){ + item->setBackground(index, Qt::yellow); + } +} + /* * Called from the signal of the context sensitive menu! */ diff --git a/bacula/src/qt-console/medialist/medialist.h b/bacula/src/qt-console/medialist/medialist.h index 35f575821d..d1c780d62c 100644 --- a/bacula/src/qt-console/medialist/medialist.h +++ b/bacula/src/qt-console/medialist/medialist.h @@ -61,6 +61,7 @@ private slots: private: void createContextMenu(); + void setStatusColor(QTreeWidgetItem *, QString &, int &); QString m_currentVolumeName; QString m_currentVolumeId; bool m_populated; diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index 4828794dcf..80cfc2ef88 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -42,7 +42,7 @@ prerestorePage::prerestorePage() { m_dtformat = "yyyy-MM-dd HH:MM:ss"; - m_name = "Pre-Restore"; + m_name = "Restore"; setupUi(this); pgInitialize(); m_console->notify(false); @@ -155,7 +155,6 @@ void prerestorePage::recentChanged(int state) void prerestorePage::jobsRadioClicked(bool checked) { if (checked) { - printf("In prerestorePage::jobsRadioClicked checked\n"); jobCombo->setEnabled(true); // filesetCombo->setEnabled(true); clientCombo->setEnabled(true); @@ -167,7 +166,6 @@ void prerestorePage::jobsRadioClicked(bool checked) } jobIdEdit->setEnabled(false); } else { - printf("In prerestorePage::jobsRadioClicked UNchecked\n"); jobCombo->setEnabled(false); // filesetCombo->setEnabled(false); clientCombo->setEnabled(false);