MGR: Move Diagnostic Flags dialog from Tools menus to Advanced Menu, add keyboard shortcut control-shift-D to both Advanced View and Simple View.

This commit is contained in:
Charlie Fenton 2014-04-03 01:21:56 -07:00
parent 44463ddba8
commit 0432a8e3f6
6 changed files with 41 additions and 18 deletions

View File

@ -459,11 +459,6 @@ bool CAdvancedFrame::CreateMenu() {
_("Computing &preferences..."),
_("Configure computing preferences")
);
menuTools->Append(
ID_DIAGNOSTICLOGFLAGS,
_("Diagnostics..."),
_("Enable or disable diagnostics")
);
// Activity menu
wxMenu *menuActivity = new wxMenu;
@ -615,6 +610,11 @@ bool CAdvancedFrame::CreateMenu() {
_("Event Log...\tCtrl+Shift+E"),
_("Display diagnostic messages.")
);
menuAdvanced->Append(
ID_DIAGNOSTICLOGFLAGS,
_("Event Log Diagnostic Flags...\tCtrl+Shift+D"),
_("Enable or disable various diagnostic messages")
);
// Help menu

View File

@ -44,7 +44,7 @@ END_EVENT_TABLE()
/* Constructor */
CDlgDiagnosticLogFlags::CDlgDiagnosticLogFlags(wxWindow* parent) :
wxDialog( parent, ID_ANYDIALOG, _("BOINC Diagnostic Flags"), wxDefaultPosition,
wxDialog( parent, ID_ANYDIALOG, wxEmptyString, wxDefaultPosition,
wxSize( DLGDIAGNOSTICS_INITIAL_SIZE,DLGDIAGNOSTICS_INITIAL_SIZE ),
wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER
) {
@ -58,6 +58,14 @@ CDlgDiagnosticLogFlags::CDlgDiagnosticLogFlags(wxWindow* parent) :
wxASSERT(pSkinAdvanced);
wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));
wxString title;
title.Printf(
_("%s Diagnostic Log Flags"),
pSkinAdvanced->GetApplicationShortName().c_str()
);
SetTitle(title);
// Get cc_config.xml file flags
log_flags.init();
config.defaults();

View File

@ -36,6 +36,7 @@
#include "DlgEventLogListCtrl.h"
#include "DlgEventLog.h"
#include "AdvancedFrame.h"
#include "DlgDiagnosticLogFlags.h"
#include <wx/display.h>
#ifdef __WXMAC__
@ -76,6 +77,7 @@ BEGIN_EVENT_TABLE( CDlgEventLog, wxDialog )
EVT_BUTTON(ID_COPYSELECTED, CDlgEventLog::OnMessagesCopySelected)
EVT_BUTTON(ID_TASK_MESSAGES_FILTERBYPROJECT, CDlgEventLog::OnMessagesFilter)
EVT_BUTTON(ID_SIMPLE_HELP, CDlgEventLog::OnButtonHelp)
EVT_MENU(ID_SGDIAGNOSTICLOGFLAGS, CDlgEventLog::OnDiagnosticLogFlags)
EVT_SIZE(CDlgEventLog::OnSize)
EVT_MOVE(CDlgEventLog::OnMove)
EVT_CLOSE(CDlgEventLog::OnClose)
@ -257,6 +259,12 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt
OnRefresh();
// Register that we had the Event Log open immediately
SaveState();
m_Shortcuts[0].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'D', ID_SGDIAGNOSTICLOGFLAGS);
m_pAccelTable = new wxAcceleratorTable(1, m_Shortcuts);
SetAcceleratorTable(*m_pAccelTable);
return true;
}
@ -903,6 +911,16 @@ void CDlgEventLog::OnButtonHelp( wxCommandEvent& event ) {
}
void CDlgEventLog::OnDiagnosticLogFlags(wxCommandEvent& WXUNUSED(event)) {
wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnDiagnosticLogFlags - Function Begin"));
CDlgDiagnosticLogFlags dlg(this);
dlg.ShowModal();
wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::OnDiagnosticLogFlags - Function End"));
}
void CDlgEventLog::OnColResize( wxListEvent& ) {
// Register the new column widths immediately
SaveState();

View File

@ -118,6 +118,9 @@ public:
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP
void OnButtonHelp( wxCommandEvent& event );
/// EVT_MENU event handler for ID_SGDIAGNOSTICLOGFLAGS
void OnDiagnosticLogFlags( wxCommandEvent& event );
/// EVT_LIST_COL_END_DRAG event handler for ID_SIMPLE_MESSAGESVIEW
void OnColResize( wxListEvent& event );
@ -168,6 +171,9 @@ private:
bool m_bWasConnected;
bool m_bEventLogIsOpen;
wxAcceleratorEntry m_Shortcuts[1];
wxAcceleratorTable* m_pAccelTable;
bool SaveState();
bool RestoreState();

View File

@ -179,12 +179,6 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position
_("Configure display options and proxy settings")
);
menuTools->Append(
ID_SGDIAGNOSTICLOGFLAGS,
_("Diagnostics..."),
_("Enable or disable diagnostics")
);
// Help menu
wxMenu *menuHelp = new wxMenu;
@ -294,12 +288,9 @@ CSimpleFrame::CSimpleFrame(wxString title, wxIconBundle* icons, wxPoint position
#endif
m_Shortcuts[0].Set(wxACCEL_NORMAL, WXK_HELP, ID_HELPBOINCMANAGER);
#ifdef __WXMAC__
m_Shortcuts[1].Set(wxACCEL_CMD|wxACCEL_SHIFT, (int)'E', ID_EVENTLOG);
#else
m_Shortcuts[1].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'E', ID_EVENTLOG);
#endif
m_pAccelTable = new wxAcceleratorTable(2, m_Shortcuts);
m_Shortcuts[2].Set(wxACCEL_CTRL|wxACCEL_SHIFT, (int)'D', ID_SGDIAGNOSTICLOGFLAGS);
m_pAccelTable = new wxAcceleratorTable(3, m_Shortcuts);
SetAcceleratorTable(*m_pAccelTable);

View File

@ -135,7 +135,7 @@ protected:
wxMenuBar* m_pMenubar;
wxMenu* m_pSubmenuSkins;
wxAcceleratorEntry m_Shortcuts[2];
wxAcceleratorEntry m_Shortcuts[3];
wxAcceleratorTable* m_pAccelTable;
CSimpleGUIPanel* m_pBackgroundPanel;