From e6bc9f8e3285159b32368547f6b3d78e122f558b Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Mon, 29 Jan 2007 11:05:56 +0000 Subject: [PATCH] Toggle connect/disconnect icon git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4073 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/Makefile | 5 +++-- bacula/src/qt-console/console/console.cpp | 6 ++++++ bacula/src/qt-console/main.ui | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bacula/src/qt-console/Makefile b/bacula/src/qt-console/Makefile index 0a9d204bc7..c42a72180c 100644 --- a/bacula/src/qt-console/Makefile +++ b/bacula/src/qt-console/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bat -# Generated by qmake (2.01a) (Qt 4.2.1) on: Mon Jan 29 10:12:52 2007 +# Generated by qmake (2.01a) (Qt 4.2.1) on: Mon Jan 29 12:01:29 2007 # Project: bat.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile bat.pro @@ -192,12 +192,13 @@ compiler_rcc_clean: qrc_main.cpp: main.qrc \ /usr/bin/rcc \ images/new.png \ + images/disconnected.png \ images/label.png \ images/server.png \ images/restore.png \ images/copy.png \ images/cut.png \ - images/connect.png \ + images/connected.png \ images/big-server.png \ images/save.png \ images/bat.png \ diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index ba6fa7d002..d8d7898ea0 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -47,6 +47,7 @@ Console::Console() m_at_prompt = false; m_textEdit = mainWin->textEdit; /* our console screen */ m_cursor = new QTextCursor(m_textEdit->document()); + mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); /* ***FIXME*** make this configurable */ font.setFamily("Courier"); @@ -111,8 +112,11 @@ void Console::connect() if (m_sock == NULL) { mainWin->set_status("Connection failed"); return; + } else { + mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/connected.png"))); } + jcr.dir_bsock = m_sock; if (!authenticate_director(&jcr, m_dir, cons)) { @@ -190,6 +194,7 @@ void Console::write_dir(const char *msg) bnet_send(m_sock); } else { mainWin->set_status(" Director not connected. Click on connect button."); + mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); } } @@ -213,6 +218,7 @@ void Console::read_dir(int fd) if (is_bnet_stop(m_sock)) { /* error or term request */ bnet_close(m_sock); m_sock = NULL; + mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); m_notifier->setEnabled(false); delete m_notifier; m_notifier = NULL; diff --git a/bacula/src/qt-console/main.ui b/bacula/src/qt-console/main.ui index bf78925309..121158edaf 100644 --- a/bacula/src/qt-console/main.ui +++ b/bacula/src/qt-console/main.ui @@ -362,7 +362,7 @@ - images/connect.png + images/disconnected.png Connect -- 2.39.5