diff --git a/checkin_notes b/checkin_notes index 6a22af13a0..d225040870 100755 --- a/checkin_notes +++ b/checkin_notes @@ -11246,3 +11246,10 @@ Davaid April 1 2004 gui_rpc_client.C,h gui_test.C makefile.gui_test (new) + +Rom April 1 2004 + - Checkin UI for disabling/enabling network activity from the GUI + + client/win/ + boinc_gui.rc, .h + wingui_mainwindow.cpp, .h diff --git a/client/win/boinc_gui.h b/client/win/boinc_gui.h index 12ce3b526f..e0c888cf68 100644 --- a/client/win/boinc_gui.h +++ b/client/win/boinc_gui.h @@ -95,6 +95,7 @@ #define ID_MESSAGE_COPY_TO_CLIP 40043 #define ID_FILE_RUN_BENCHMARKS 40044 #define ID_TRANSFERS_RETRYNOW 40045 +#define ID_FILE_TOGGLE_NETWORK_ACCESS 40051 #define ID_FILE_RUN_REQUEST_ALWAYS 40100 #define ID_FILE_RUN_REQUEST_AUTO 40101 #define ID_FILE_RUN_REQUEST_NEVER 40102 @@ -104,7 +105,7 @@ #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 140 -#define _APS_NEXT_COMMAND_VALUE 40051 +#define _APS_NEXT_COMMAND_VALUE 40052 #define _APS_NEXT_CONTROL_VALUE 1035 #define _APS_NEXT_SYMED_VALUE 101 #endif diff --git a/client/win/boinc_gui.rc b/client/win/boinc_gui.rc index 41e3f660cc..a1310a82b0 100644 --- a/client/win/boinc_gui.rc +++ b/client/win/boinc_gui.rc @@ -29,7 +29,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 1 TEXTINCLUDE BEGIN - "resource.h\0" + "boinc_gui.h\0" END 2 TEXTINCLUDE @@ -198,6 +198,10 @@ BEGIN MENUITEM "Run based on &preferences", ID_FILE_RUN_REQUEST_AUTO MENUITEM "&Suspend", ID_FILE_RUN_REQUEST_NEVER MENUITEM SEPARATOR + MENUITEM "&Disable BOINC Network Access", + ID_FILE_TOGGLE_NETWORK_ACCESS + , CHECKED + MENUITEM SEPARATOR MENUITEM "Run &Benchmarks", ID_FILE_RUN_BENCHMARKS MENUITEM SEPARATOR MENUITEM "&Hide", ID_FILE_HIDE @@ -302,12 +306,12 @@ BEGIN BEGIN VALUE "CompanyName", "Space Sciences Laboratory" VALUE "FileDescription", "boinc_gui" - VALUE "FileVersion", "2, 28, 0, 0\0" + VALUE "FileVersion", "2, 28, 0, 0" VALUE "InternalName", "boinc_gui" VALUE "LegalCopyright", "Copyright © 2004 University of California" VALUE "OriginalFilename", "boinc_gui.exe" VALUE "ProductName", "BOINC Core Client" - VALUE "ProductVersion", "2, 28, 0, 0\0" + VALUE "ProductVersion", "2, 28, 0, 0" END END BLOCK "VarFileInfo" diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index 8a862478c2..8bf4e051c1 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -21,6 +21,7 @@ #include "wingui_mainwindow.h" #include "diagnostics.h" +#include ".\wingui_mainwindow.h" CMyApp g_myApp; CMainWindow* g_myWnd = NULL; @@ -171,6 +172,7 @@ BEGIN_MESSAGE_MAP(CMainWindow, CWnd) ON_COMMAND(ID_FILE_RUN_REQUEST_ALWAYS, OnCommandRunRequestAlways) ON_COMMAND(ID_FILE_RUN_REQUEST_AUTO, OnCommandRunRequestAuto) ON_COMMAND(ID_FILE_RUN_REQUEST_NEVER, OnCommandRunRequestNever) + ON_COMMAND(ID_FILE_TOGGLE_NETWORK_ACCESS, OnFileDisableNetworkAccess) ON_COMMAND(ID_FILE_RUN_BENCHMARKS, OnCommandRunBenchmarks) ON_COMMAND(ID_FILE_HIDE, OnCommandHide) ON_COMMAND(ID_FILE_EXIT, OnCommandExit) @@ -1514,6 +1516,26 @@ void CMainWindow::OnCommandRunRequestNever() UpdateRunRequestFileMenu(); } +void CMainWindow::OnFileDisableNetworkAccess() +{ + CMenu* pMenu; + UINT uiState; + + // Get the File menu + pMenu = GetMenu()->GetSubMenu( 0 ); + + uiState = pMenu->GetMenuState( ID_FILE_TOGGLE_NETWORK_ACCESS, MF_BYCOMMAND ); + ASSERT(uiState != 0xFFFFFFFF); + + if ( MF_CHECKED & uiState ) { + pMenu->CheckMenuItem( ID_FILE_TOGGLE_NETWORK_ACCESS, MF_UNCHECKED | MF_BYCOMMAND ); + gstate.user_network_request = USER_RUN_REQUEST_ALWAYS; + } else { + pMenu->CheckMenuItem( ID_FILE_TOGGLE_NETWORK_ACCESS, MF_CHECKED | MF_BYCOMMAND ); + gstate.user_network_request = USER_RUN_REQUEST_NEVER; + } +} + void CMainWindow::OnCommandRunBenchmarks() { gstate.start_cpu_benchmarks(); @@ -2269,3 +2291,4 @@ void guiOnBenchmarksEnd() { g_myWnd->OnBenchmarksEnd(); } + diff --git a/client/win/wingui_mainwindow.h b/client/win/wingui_mainwindow.h index 2f05b557e5..f5f4254b66 100755 --- a/client/win/wingui_mainwindow.h +++ b/client/win/wingui_mainwindow.h @@ -164,6 +164,7 @@ protected: afx_msg void OnCommandTransfersRetryNow(); afx_msg void OnCommandFileClearInactive(); afx_msg void OnCommandFileClearMessages(); + afx_msg void OnFileDisableNetworkAccess(); afx_msg void OnCommandRunBenchmarks(); afx_msg void OnCommandConnectionHangupIfDialed(); afx_msg void OnCommandConnectionConfirmBeforeConnecting();