From 52dbfbf48b9cff986ea96530aa4dfc8ba061d34b Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Wed, 9 May 2007 01:31:32 +0000 Subject: [PATCH] Add warning dialogs before purging and befoe deleting volumes and jobs. Put todo in priority order. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4734 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/TODO | 64 ++++++++++--------- bacula/src/qt-console/joblist/joblist.cpp | 24 +++++++ bacula/src/qt-console/medialist/medialist.cpp | 24 +++++++ bacula/src/qt-console/restore/prerestore.cpp | 2 +- 4 files changed, 83 insertions(+), 31 deletions(-) diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index a97a604ae0..68a1a2e92f 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -1,28 +1,21 @@ dhb ==================================================== -See if there is a solution to images fun with designer other than: -%s/[\.\/]*:images/images/g -%s/images/..\/images/g - Color code termination code in joblist. Create class to display messages from a specific job. Want the ability to create an instance of that class from joblist. I also want a table to convert termination code into human readable text. -Allow for selecting multiple jobs to restore from in joblist. Right click -restore from job works, but not with multiple selected jobs. +move behavior of: + MainWin::setContextMenuDockText + MainWin::setTreeWidgetItemDockColor +to the pages class Test left pane of restore with 2 windows drives in one backup job. -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 -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 -the consequences of delete or purging are. +show purged flag in joblist. Don't have purge option show if already purged. Add context sensitive options for most commands status dir on page select director item @@ -31,17 +24,17 @@ As well as many more update slots scan see COMMANDS file -preempt all connections to console with -if (!is_connectedGui()) -or some other mechanism. Partially done. +Option in joblist like with restore from jobid but restore populating timestamp +of the selected job. -Create documentation for any other developers interested in creating -new classes to add more pages. Explain how to use the pages class -and about not populating until the tree widget is clicked etc... +Resolve issue of connection during restore selection. Could go with preempt of +connections. (Kern is to work on) -LOW priority items: +Purging not working from console or from context sensitive. (Kern) -User configuration dialog. Include options for debugging output to stdout. +========LOW priority items: +Allow for selecting multiple jobs to restore from in joblist. Right click +restore from job works, but not with multiple selected jobs. 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?? @@ -49,12 +42,9 @@ mounted so I am not presenting both mount and unmount to the user?? 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) -Get rid of "Warning: name layoutWidget is already used" when make uic's restore.ui - -move behavior of: - MainWin::setContextMenuDockText - MainWin::setTreeWidgetItemDockColor -to the pages class +See if there is a solution to images fun with designer other than: +%s/[\.\/]*:images/images/g +%s/images/..\/images/g Think about good ways to clean up the Console creation part of the loop creating pages. @@ -82,9 +72,6 @@ cancelled graphically. Add a status client window. Keep updating showing what file is being processed. -A Tree widget context sensitive menu option and class to jump from known job -to surf the filestructure on the job. - bRestore add code to get working. =========================================================== @@ -101,6 +88,24 @@ global one defined in the mainWin class (if I remember right). ============================================================ DONE: ============================================================ +preempt all connections to console with +if (!is_connectedGui()) +or some other mechanism. May find more as users start finding them. + +Create documentation for any other developers interested in creating +new classes to add more pages. Explain how to use the pages class +and about not populating until the tree widget is clicked etc... + +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 +the consequences of delete or purging are. + +A Tree widget context sensitive menu option and class to jump from known job +to surf the filestructure on the job. + This was future, but it is kind of done with restore from jobid + +Get rid of "Warning: name layoutWidget is already used" when make uic's restore.ui + 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. @@ -214,7 +219,6 @@ m_currentConsole is saved in each page subclass's m_console. This value is set by all but the console class calling Pages::pgInitialie() in it's constructor - In short, there is a lot of work to be done to make multiple simultaneous directors work. diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 1806f40b76..963c63ed17 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -333,12 +333,36 @@ void JobList::consoleListVolumes() } void JobList::consoleDeleteJob() { + if (QMessageBox::warning(this, tr("Bat"), + tr("Are you sure you want to delete?? !!!.\n" +"This delete command is used to delete a Job record and all associated catalog" +" records that were created. This command operates only on the Catalog" +" database and has no effect on the actual data written to a Volume. This" +" command can be dangerous and we strongly recommend that you do not use" +" it unless you know what you are doing. The Job and all its associated" +" records (File and JobMedia) will be deleted from the catalog." + "Press OK to proceed with delete operation.?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + QString cmd("delete job jobid="); cmd += m_currentJob; consoleCommand(cmd); } void JobList::consolePurgeFiles() { + if (QMessageBox::warning(this, tr("Bat"), + tr("Are you sure you want to purge ?? !!!.\n" +"The Purge command will delete associated Catalog database records from Jobs and" +" Volumes without considering the retention period. Purge works only on the" +" Catalog database and does not affect data written to Volumes. This command can" +" be dangerous because you can delete catalog records associated with current" +" backups of files, and we recommend that you do not use it unless you know what" +" you are doing.\n" + "Press OK to proceed with the purge operation?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + QString cmd("purge files jobid="); cmd += m_currentJob; consoleCommand(cmd); diff --git a/bacula/src/qt-console/medialist/medialist.cpp b/bacula/src/qt-console/medialist/medialist.cpp index ed6e25ec5f..0f6c54aaa9 100644 --- a/bacula/src/qt-console/medialist/medialist.cpp +++ b/bacula/src/qt-console/medialist/medialist.cpp @@ -258,6 +258,18 @@ void MediaList::currentStackItem() */ void MediaList::deleteVolume() { + if (QMessageBox::warning(this, tr("Bat"), + tr("Are you sure you want to delete?? !!!.\n" +"This delete command is used to delete a Volume record and all associated catalog" +" records that were created. This command operates only on the Catalog" +" database and has no effect on the actual data written to a Volume. This" +" command can be dangerous and we strongly recommend that you do not use" +" it unless you know what you are doing. All Jobs and all associated" +" records (File and JobMedia) will be deleted from the catalog." + "Press OK to proceed with delete operation.?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + QString cmd("delete volume="); cmd += m_currentVolumeName; consoleCommand(cmd); @@ -267,6 +279,18 @@ void MediaList::deleteVolume() */ void MediaList::purgeVolume() { + if (QMessageBox::warning(this, tr("Bat"), + tr("Are you sure you want to purge ?? !!!.\n" +"The Purge command will delete associated Catalog database records from Jobs and" +" Volumes without considering the retention period. Purge works only on the" +" Catalog database and does not affect data written to Volumes. This command can" +" be dangerous because you can delete catalog records associated with current" +" backups of files, and we recommend that you do not use it unless you know what" +" you are doing.\n" + "Press OK to proceed with the purge operation?"), + QMessageBox::Ok | QMessageBox::Cancel) + == QMessageBox::Cancel) { return; } + QString cmd("purge volume="); cmd += m_currentVolumeName; consoleCommand(cmd); diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index 490d81ea02..458201237a 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -241,7 +241,7 @@ void prerestorePage::jobdefsFromJob(QStringList &fieldlist, QString jobId) " From Job, Client, FileSet" " WHERE Job.FileSetId=FileSet.FileSetId AND Job.ClientId=Client.ClientId" " AND JobId=\'" + jobId + "\'"; - printf("query = %s\n", query.toUtf8().data()); + //printf("query = %s\n", query.toUtf8().data()); QStringList results; if (m_console->sql_cmd(query, results)) { QString field; -- 2.39.5