From 07e4b18ad003571d0d6608ae757387af48f81dbb Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Mon, 14 May 2007 20:43:09 +0000 Subject: [PATCH] Get text in the console that the user puts there to show up blue. This is to allow easy differentiating between text the director puts there and the text the user puts there. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4786 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/TODO | 16 ++++++++-------- bacula/src/qt-console/console/console.cpp | 6 ++++++ bacula/src/qt-console/console/console.h | 1 + bacula/src/qt-console/pages.cpp | 12 +++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 16d4678ff0..554a8c7579 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -1,14 +1,9 @@ dhb ==================================================== -Get status codes in dropdown for joblist select. - Need to figure out the functionality and inteligence that the last restore window should have and give it to it. Right now it shows drop downs with no options. -See if it would be possible to have user provided console text show up in a -color - Test left pane of restore with 2 windows drives in one backup job. User preferences. With log to stdout options. @@ -30,9 +25,6 @@ connections. (Kern is to work on) Purging not working from console or from context sensitive. (Kern) ========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?? @@ -85,6 +77,14 @@ global one defined in the mainWin class (if I remember right). ============================================================ DONE: ============================================================ +Allow for selecting multiple jobs to restore from in joblist. Right click +restore from job works, but not with multiple selected jobs. + +See if it would be possible to have user provided console text show up in a +color + +Get status codes in dropdown for joblist select. + Create class to display messages from a specific job. Want the ability to create an instance of that class from joblist. diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 94d4cffc96..c228cc3908 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -413,6 +413,12 @@ void Console::display_text(const char *buf) m_cursor->insertText(buf); } +void Console::display_html(const QString buf) +{ + m_cursor->movePosition(QTextCursor::End); + m_cursor->insertHtml(buf); +} + /* Position cursor to end of screen */ void Console::update_cursor() { diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index f49767a4a1..8e3b4218eb 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -73,6 +73,7 @@ public: void display_text(const char *buf); void display_text(const QString buf); void display_textf(const char *fmt, ...); + void display_html(const QString buf); void update_cursor(void); void write_dir(const char *buf); bool dir_cmd(const char *cmd, QStringList &results); diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index 1e57794d39..59c7ca8e22 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -209,16 +209,10 @@ void Pages::consoleCommand(QString &command) return; /* Bring this directors console to the front of the stack */ setConsoleCurrent(); -#ifdef xxdebugcode - m_console->display_text("Context sensitive command :\n\n"); - m_console->display_text("**** "); -#endif - m_console->display_text(command); + QString displayhtml(""); + displayhtml += command + "\n"; + m_console->display_html(displayhtml); m_console->display_text("\n"); -#ifdef xxdebugcode - m_console->display_text(" ****\n"); - m_console->display_text("Director Response :\n\n"); -#endif m_console->write_dir(command.toUtf8().data()); m_console->displayToPrompt(); } -- 2.39.5