From 0a964849377b3b1fe6ded4fdd96bd2f7a4a647bf Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sat, 19 May 2007 02:56:12 +0000 Subject: [PATCH] Fix filesest was offset by 1. Weird, I had changed it earlier the other direction. Fix of c:/ and d:/ in same restore showing up correctly in left pane. Fix of RunCmdPage::cancelButtonPushed, add "." to get the m_at_main_prompt set true again after window cancelled. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4830 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/TODO | 17 +++++++++++++---- bacula/src/qt-console/fileset/fileset.cpp | 6 +++--- bacula/src/qt-console/restore/prerestore.cpp | 2 +- bacula/src/qt-console/restore/restore.cpp | 10 ++++++---- bacula/src/qt-console/run/runcmd.cpp | 2 ++ 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 08a3153857..af88907e4a 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -1,14 +1,16 @@ dhb ==================================================== -Prevent the ablility of a user to close the original joblist page. - Further testing of restore with .mod -Test left pane of restore with 2 windows drives in one backup job. - User preferences. With log to stdout options. Have settings for defaults of limits on joblist +Add fileset to joblist. + +joblist cancel a running job. + +Set default for replace in run restore job to "always"?????? + Add context sensitive options for most commands status dir on page select director item All items with jobid= that I thought could work from joblist are done. @@ -19,6 +21,8 @@ see COMMANDS file Option in joblist like with restore from jobid but restore populating timestamp of the selected job. +Get the 5 second bring to bottom of console to stop + Resolve issue of connection during restore selection. Could go with preempt of connections. (Kern is to work on) @@ -66,6 +70,8 @@ processed. bRestore add code to get working. +May be in brestore, find a file by name, find a directory by name + =========================================================== NOT SURE =========================================================== @@ -80,6 +86,9 @@ global one defined in the mainWin class (if I remember right). ============================================================ DONE: ============================================================ +Test left pane of restore with 2 windows drives in one backup job. + Yup, id didn't work, now it does. + Purging not working from console or from context sensitive. This was a confusion with the restore command. Now resolved. diff --git a/bacula/src/qt-console/fileset/fileset.cpp b/bacula/src/qt-console/fileset/fileset.cpp index b8f8aaba53..deb2743dac 100644 --- a/bacula/src/qt-console/fileset/fileset.cpp +++ b/bacula/src/qt-console/fileset/fileset.cpp @@ -114,10 +114,10 @@ void FileSet::populateTree() /* Iterate through fields in the record */ foreach (field, fieldlist) { field = field.trimmed(); /* strip leading & trailing spaces */ - filesetItem->setData(index+1, Qt::UserRole, 1); + filesetItem->setData(index, Qt::UserRole, 1); /* Put media fields under the pool tree item */ - filesetItem->setData(index+1, Qt::UserRole, 1); - filesetItem->setText(index+1, field); + filesetItem->setData(index, Qt::UserRole, 1); + filesetItem->setText(index, field); index++; } } diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index 9ff37cf9b0..7a6829261f 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -239,7 +239,7 @@ int 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; diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 67c2562732..0f5e75dbe6 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -159,7 +159,8 @@ void restorePage::addDirectory(QString &newdirr) QString newdir = newdirr; QString fullpath = m_cwd + newdirr; QRegExp regex("^/[a-z]:/$"); - bool ok=true; + bool ok = true; + bool windrive = false; //printf("In addDirectory cwd \"%s\" newdir \"%s\"\n", m_cwd.toUtf8().data(), //newdir.toUtf8().data()); @@ -176,14 +177,15 @@ void restorePage::addDirectory(QString &newdirr) if (regex.indexIn(fullpath,0) == 0) { /* this is a windows drive */ - //printf("Need to do windows c:/\n"); + //printf("Need to do windows \"letter\":/\n"); fullpath.replace(0,1,""); + windrive = true; } /* is it already existent ?? */ if (!m_dirPaths.contains(fullpath)) { QTreeWidgetItem *item = NULL; - if (m_dirPaths.empty()) { + if (windrive) { /* this is the base widget */ item = new QTreeWidgetItem(directoryWidget); item->setText(0, fullpath.toUtf8().data()); @@ -195,7 +197,7 @@ void restorePage::addDirectory(QString &newdirr) item->setText(0, newdir.toUtf8().data()); directoryWidget->expandItem(parent); } else { - ok=false; + ok = false; //printf("In else of if parent cwd \"%s\" newdir \"%s\"\n", //m_cwd.toUtf8().data() ,newdir.toUtf8().data()); } diff --git a/bacula/src/qt-console/run/runcmd.cpp b/bacula/src/qt-console/run/runcmd.cpp index 25346ea719..f83de90820 100644 --- a/bacula/src/qt-console/run/runcmd.cpp +++ b/bacula/src/qt-console/run/runcmd.cpp @@ -166,6 +166,8 @@ void runCmdPage::okButtonPushed() void runCmdPage::cancelButtonPushed() { + m_console->displayToPrompt(); + m_console->write_dir("."); m_console->displayToPrompt(); mainWin->set_status(" Canceled"); this->hide(); -- 2.39.5