From 4da470b42ef7f5a400ad966da46d3ba3c3c52682 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Sat, 1 May 2004 10:06:55 +0000 Subject: [PATCH] - wxbMainFrame : If the connection drops unexpectedly, it should say it lost the connection to the Director and then wait for you to either manually exit or (when it becomes possible) reconnect. - wxbMainFrame : corrected segmentation faults when exiting (to be verified) - wxbMainFrame : the user can quit however the state is git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1334 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/wx-console/CHANGELOG | 8 ++++++++ bacula/src/wx-console/TODO | 11 +++++------ bacula/src/wx-console/console_thread.cpp | 3 +++ bacula/src/wx-console/wxbmainframe.cpp | 12 +++++++++++- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index c7e4eca3f6..6f706d5b45 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,3 +1,11 @@ +31-04-2004 : + - wxbMainFrame : If the connection drops unexpectedly, it should say + it lost the connection to the Director and then wait for you to + either manually exit or (when it becomes possible) reconnect. + - wxbMainFrame : corrected segmentation faults when exiting + (to be verified) + - wxbMainFrame : the user can quit however the state is + 30-04-2004 : - wxbRestorePanel : Added "Cancel" button to cancel restore at all state of restore process. diff --git a/bacula/src/wx-console/TODO b/bacula/src/wx-console/TODO index 22d419336b..90ce28fc1b 100644 --- a/bacula/src/wx-console/TODO +++ b/bacula/src/wx-console/TODO @@ -3,24 +3,23 @@ FEATURES wxbRestorePanel : Reconsider start button's labels. -wxbRestorePanel : Add titles to configuration panel +wxbRestorePanel : Add titles to configuration panels wxbRestorePanel : When cancelling, check for commands results general : Show nice messages boxes when errors occurs. -general : Allow the user to quit however the state is (kill thread if necessary) - -general : correct segmentation faults when exiting - [postponed to July:] -wxbRestorePanel : Add a way to cancel restore when building tree (needs director modifications) +wxbRestorePanel : Add a way to cancel restore when building tree + (needs director modifications) wxbMainFrame : set focus to type control when clicking on console global : create a general class which keeps clients, jobs, filesets, pools... list. +wxbConfigPanel : Create a dialog for selecting dates and paths. + wxbMainFrame : use more often status text wxbRestorePanel : Ask Kern for a dot command which gives restore diff --git a/bacula/src/wx-console/console_thread.cpp b/bacula/src/wx-console/console_thread.cpp index 6db894be02..c7ecc338fe 100644 --- a/bacula/src/wx-console/console_thread.cpp +++ b/bacula/src/wx-console/console_thread.cpp @@ -193,5 +193,8 @@ void console_thread::Delete() { bnet_sig(UA_sock, BNET_TERMINATE); /* send EOF */ bnet_close(UA_sock); UA_sock = NULL; + csprint(NULL, CS_END); + csprint(NULL, CS_DISCONNECTED); + csprint(NULL, CS_TERMINATED); } } diff --git a/bacula/src/wx-console/wxbmainframe.cpp b/bacula/src/wx-console/wxbmainframe.cpp index 4a6623495d..4399a3a5e9 100644 --- a/bacula/src/wx-console/wxbmainframe.cpp +++ b/bacula/src/wx-console/wxbmainframe.cpp @@ -308,7 +308,11 @@ void wxbMainFrame::Unregister(wxbDataParser* dp) { void wxbMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - // TRUE is to force the frame to close + Print("Quitting.\n", CS_DEBUG); + if (ct != NULL) { + ct->Delete(); + ct = NULL; + } Close(TRUE); } @@ -352,6 +356,11 @@ void wxbMainFrame::Print(wxString str, int status) SetStatusText("Console thread terminated."); ct = NULL; DisablePanels(); + int answer = wxMessageBox("Connection to the director lost. Quit program?", "Connection lost", + wxYES_NO | wxICON_EXCLAMATION, this); + if (answer == wxYES) { + Close(true); + } return; } @@ -513,6 +522,7 @@ void wxbMainFrame::DisablePanels(void* except) { /* Enable or disable console typing */ void wxbMainFrame::EnableConsole(bool enable) { typeCtrl->Enable(enable); + sendButton->Enable(enable); if (enable) { typeCtrl->SetFocus(); } -- 2.39.5