From: Dirk H Bartley Date: Thu, 31 May 2007 01:24:28 +0000 (+0000) Subject: Read and write settings for the splitter in restore. X-Git-Tag: Release-7.0.0~6200 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4c934c8c039c5dcdaada25291b94823268204ee7;p=bacula%2Fbacula Read and write settings for the splitter in restore. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4945 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 16d57c796e..5b46eb5935 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -1,49 +1,13 @@ dhb ==================================================== -Add context sensitive options for most commands -see COMMANDS file +can "schedule" be a member of job_defs and populated?? ========LOW priority items: -Use settings object to size the restore window. Similar to the saving of the -state of the main window. - Human readable in joblist for purged, joblevel and job type. Possibly a stack of past screens so that when you open a window from another, closing would bring the previous one back. -Is there a way to query the director/database for whether a storage is currently -mounted so I am not presenting both mount and unmount to the user?? - - Yes, but it requires being able to directly connect to the SD (at least - for the moment). - - -Is there a way to identify a slot as having a cleaning tape??? -(Kern says more work needs to be done in bacula with autochangers) - - Yes, there is a cleaning prefix for Volume labels defined in - the DIR (not currently available to bat). Typically it is CLNxxx - and by looking at the database, you can see these cleaning - volumes. - -See if there is a solution to images fun with designer other than: -%s/[\.\/]*:images/images/g -%s/images/..\/images/g - - Images that are in the binary are referenced with :/images/... - This is a Qt convention. If the image is in a file, it - can be referenced directly, but for the most part, I prefer - images in the binary (not lost, not accidently deleted, no - installation problems, ... - -Think about good ways to clean up the Console creation part of the -loop creating pages. - - I don't think it is bad as it is. There is, however, a construct - called a Factory that could more or less automate this in one - big for loop. - ======================================================== This release or next: @@ -74,6 +38,17 @@ bRestore add code to get working. May be in brestore, find a file by name, find a directory by name +Is there a way to query the director/database for whether a storage is currently +mounted so I am not presenting both mount and unmount to the user?? + Yes, but it requires being able to directly connect to the SD (at least + for the moment). + +Is there a way to identify a slot as having a cleaning tape??? +(Kern says more work needs to be done in bacula with autochangers) + Yes, there is a cleaning prefix for Volume labels defined in + the DIR (not currently available to bat). Typically it is CLNxxx + and by looking at the database, you can see these cleaning + volumes. =========================================================== NOT SURE =========================================================== @@ -92,8 +67,34 @@ Create edit pool interface. This is done from config file ============================================================ +CALLING GOOD: +============================================================ +See if there is a solution to images fun with designer other than: +%s/[\.\/]*:images/images/g +%s/images/..\/images/g + Images that are in the binary are referenced with :/images/... + This is a Qt convention. If the image is in a file, it + can be referenced directly, but for the most part, I prefer + images in the binary (not lost, not accidently deleted, no + installation problems, ... + Utilizing designer to select the main.qrc resource file seems to do the + job. Designer then puts the : in front of images and work. + +Think about good ways to clean up the Console creation part of the +loop creating pages. + I don't think it is bad as it is. There is, however, a construct + called a Factory that could more or less automate this in one + big for loop. + Probably not neccesary for the time being. +============================================================ DONE: ============================================================ +Use settings object to size the restore window. Similar to the saving of the +state of the main window. + +Add context sensitive options for most commands +see COMMANDS file + A window showing a list of jobs and defaults. Defaults can be gotten in manner similar to what the first restore window does. diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 57bec3c6e0..d55ca4dac2 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -76,12 +76,18 @@ restorePage::restorePage() get_cwd(); + readSettings(); fillDirectory(); dockPage(); setCurrent(); this->show(); } +restorePage::~restorePage() +{ + writeSettings(); +} + /* * Fill the fileWidget box with the contents of the current directory */ @@ -422,3 +428,25 @@ char *restorePage::get_cwd() m_console->discardToPrompt(); return m_cwd.toUtf8().data(); } + +/* + * Save user settings associated with this page + */ +void restorePage::writeSettings() +{ + QSettings settings(m_console->m_dir->name(), "bat"); + settings.beginGroup("RestorePage"); + settings.setValue("splitterSizes", splitter->saveState()); + settings.endGroup(); +} + +/* + * Read and restore user settings associated with this page + */ +void restorePage::readSettings() +{ + QSettings settings(m_console->m_dir->name(), "bat"); + settings.beginGroup("RestorePage"); + splitter->restoreState(settings.value("splitterSizes").toByteArray()); + settings.endGroup(); +} diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index debbc99368..0078f3c00b 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -86,6 +86,7 @@ class restorePage : public Pages, public Ui::restoreForm public: restorePage(); + ~restorePage(); void fillDirectory(); char *get_cwd(); bool cwd(const char *); @@ -101,6 +102,8 @@ private slots: void addDirectory(QString &); private: + void writeSettings(); + void readSettings(); QString m_cwd; QHash m_dirPaths; QHash m_dirTreeItems;