*** empty log message ***

svn path=/trunk/boinc/; revision=11713
This commit is contained in:
Rom Walton 2006-12-21 17:05:58 +00:00
parent 19785132bc
commit 931efa9e6c
10 changed files with 144 additions and 66 deletions

View File

@ -13597,3 +13597,27 @@ David 21 Dec 2006
stats_sites.inc
lib/
util.C
Rom 21 Dec 2006
- MGR: Simplify snooze so that it only applies to CPU usage.
- MGR: Remember message dialog size and list view column widths
for all platforms.
- MGR: Fix an annoying bug when the advanced gui suspended all
tasks and then you tried to resume from the simple gui.
Restore didn't work when the task_mode_perm was equal to
never and their was no timeout.
We should probably move this logic down into the CC.
- LIB: Don't display foreground window information unless the
user has agreed to allow it to happen via the registry.
Their was concern about privacy issues with window titles.
clientgui/
BOINCTaskBar.cpp
MainDocument.cpp, .h
sg_DlgMessages.cpp
lib/
diagnostics_win.C

View File

@ -138,6 +138,7 @@ int AUTO_UPDATE::validate_and_link(PROJECT* proj) {
return retval;
}
gstate.auto_update = *this;
return 0;
}
void AUTO_UPDATE::install() {

View File

@ -198,7 +198,7 @@ void CTaskBarIcon::OnOpen(wxCommandEvent& WXUNUSED(event)) {
void CTaskBarIcon::OnOpenWebsite(wxCommandEvent& WXUNUSED(event)) {
ResetTaskBar();
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnOpenWebsite - Function Begin"));
CMainDocument* pDoc = wxGetApp().GetDocument();
CBOINCBaseFrame* pFrame = wxGetApp().GetFrame();
@ -210,11 +210,13 @@ void CTaskBarIcon::OnOpenWebsite(wxCommandEvent& WXUNUSED(event)) {
wxASSERT(pFrame);
wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame));
ResetTaskBar();
pDoc->rpc.acct_mgr_info(ami);
url = wxString(ami.acct_mgr_url.c_str(), wxConvUTF8);
pFrame->ExecuteBrowserLink(url);
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnOpenWebsite - Function End"));
}
@ -230,16 +232,10 @@ void CTaskBarIcon::OnSuspendResume(wxCommandEvent& WXUNUSED(event)) {
ResetTaskBar();
pDoc->GetCoreClientStatus(status);
if ((status.task_mode_perm != status.task_mode) || (status.network_mode_perm != status.network_mode)) {
if (status.task_mode_perm != status.task_mode) {
pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0);
}
if (status.network_mode_perm != status.network_mode) {
pDoc->SetNetworkRunMode(RUN_MODE_RESTORE, 0);
}
if (status.task_mode_perm != status.task_mode) {
pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0);
} else {
pDoc->SetActivityRunMode(RUN_MODE_NEVER, 3600);
pDoc->SetNetworkRunMode(RUN_MODE_NEVER, 3600);
}
wxLogTrace(wxT("Function Start/End"), wxT("CTaskBarIcon::OnSuspendResume - Function End"));
@ -636,7 +632,7 @@ void CTaskBarIcon::AdjustMenuItems(wxMenu* pMenu) {
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
pDoc->GetCoreClientStatus(status);
if ((RUN_MODE_NEVER == status.task_mode) && (RUN_MODE_NEVER == status.network_mode)) {
if (RUN_MODE_NEVER == status.task_mode) {
pMenu->Check(ID_TB_SUSPEND, true);
} else {
pMenu->Check(ID_TB_SUSPEND, false);

View File

@ -448,12 +448,12 @@ int CMainDocument::FrameShutdownDetected() {
}
int CMainDocument::GetCoreClientStatus(CC_STATUS& ccs) {
int CMainDocument::GetCoreClientStatus(CC_STATUS& ccs, bool bForce) {
int iRetVal = 0;
if (IsConnected()) {
wxTimeSpan ts(wxDateTime::Now() - m_dtCachedCCStatusTimestamp);
if (ts.GetSeconds() > 0) {
if ((ts.GetSeconds() > 0) || bForce) {
m_dtCachedCCStatusTimestamp = wxDateTime::Now();
iRetVal = rpc.get_cc_status(ccs);
@ -479,12 +479,17 @@ int CMainDocument::GetCoreClientStatus(CC_STATUS& ccs) {
int CMainDocument::SetActivityRunMode(int iMode, int iTimeout) {
int iRetVal = 0;
int iRetVal = 0;
CC_STATUS ccs;
if (IsConnected()) {
iRetVal = rpc.set_run_mode(iMode, iTimeout);
if (0 == iRetVal) {
status.task_mode = iMode;
if (RUN_MODE_RESTORE == iMode) {
GetCoreClientStatus(ccs, true);
} else {
status.task_mode = iMode;
}
}
}
@ -493,12 +498,17 @@ int CMainDocument::SetActivityRunMode(int iMode, int iTimeout) {
int CMainDocument::SetNetworkRunMode(int iMode, int iTimeout) {
int iRetVal = 0;
int iRetVal = 0;
CC_STATUS ccs;
if (IsConnected()) {
iRetVal = rpc.set_network_mode(iMode, iTimeout);
if (0 == iRetVal) {
status.network_mode = iMode;
if (RUN_MODE_RESTORE == iMode) {
GetCoreClientStatus(ccs, true);
} else {
status.network_mode = iMode;
}
}
}

View File

@ -115,7 +115,7 @@ public:
bool IsConnected();
bool IsReconnecting();
int GetCoreClientStatus(CC_STATUS&);
int GetCoreClientStatus(CC_STATUS&, bool bForce = false);
int SetActivityRunMode(int iMode, int iTimeout);
int SetNetworkRunMode(int iMode, int iTimeout);

View File

@ -390,7 +390,9 @@ bool CPanelMessages::OnSaveState(wxConfigBase* pConfig) {
// Which fields are we interested in?
liColumnInfo.SetMask(
wxLIST_MASK_WIDTH
wxLIST_MASK_TEXT |
wxLIST_MASK_WIDTH |
wxLIST_MASK_FORMAT
);
// Cycle through the columns recording anything interesting
@ -427,7 +429,9 @@ bool CPanelMessages::OnRestoreState(wxConfigBase* pConfig) {
// Which fields are we interested in?
liColumnInfo.SetMask(
wxLIST_MASK_WIDTH
wxLIST_MASK_TEXT |
wxLIST_MASK_WIDTH |
wxLIST_MASK_FORMAT
);
// Cycle through the columns recording anything interesting
@ -761,10 +765,8 @@ bool CDlgMessages::SaveState() {
//
pConfig->SetPath(strBaseConfigLocation);
#ifdef __WXMAC__
// Reterieve and store the latest window dimensions.
SaveWindowDimensions();
#endif
// Save the list ctrl state
m_pBackgroundPanel->OnSaveState(pConfig);
@ -813,9 +815,8 @@ bool CDlgMessages::RestoreState() {
//
pConfig->SetPath(strBaseConfigLocation);
#ifdef __WXMAC__
// Restore the windows properties
RestoreWindowDimensions();
#endif
// Restore the list ctrl state
m_pBackgroundPanel->OnRestoreState(pConfig);

View File

@ -368,11 +368,11 @@ void CProjectsComponent::OnSuspend(wxCommandEvent& /*event*/) {
wxLogTrace(wxT("Function Start/End"), wxT("CProjectsComponent::OnSuspend - Function Begin"));
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
pDoc->SetActivityRunMode(RUN_MODE_NEVER, 3600);
pDoc->SetNetworkRunMode(RUN_MODE_NEVER, 3600);
btnPause->Show(false);
btnResume->Show(true);
@ -385,19 +385,16 @@ void CProjectsComponent::OnResume(wxCommandEvent& /*event*/) {
wxLogTrace(wxT("Function Start/End"), wxT("CProjectsComponent::OnResume - Function Begin"));
CMainDocument* pDoc = wxGetApp().GetDocument();
CC_STATUS status;
CC_STATUS ccs;
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
pDoc->GetCoreClientStatus(status);
if ((status.task_mode_perm != status.task_mode) || (status.network_mode_perm != status.network_mode)) {
if (status.task_mode_perm != status.task_mode) {
pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0);
}
if (status.network_mode_perm != status.network_mode) {
pDoc->SetNetworkRunMode(RUN_MODE_RESTORE, 0);
}
pDoc->GetCoreClientStatus(ccs);
if ((RUN_MODE_NEVER == ccs.task_mode) && (0 >= ccs.task_mode_delay)) {
pDoc->SetActivityRunMode(RUN_MODE_AUTO, 0);
} else {
pDoc->SetActivityRunMode(RUN_MODE_RESTORE, 0);
}
btnResume->Show(false);
@ -455,7 +452,7 @@ void CProjectsComponent::UpdateInterface()
// Show resume or pause as appropriate
CC_STATUS status;
pDoc->GetCoreClientStatus(status);
if ((RUN_MODE_NEVER == status.task_mode) && (RUN_MODE_NEVER == status.network_mode)) {
if (RUN_MODE_NEVER == status.task_mode) {
btnPause->Show(false);
btnResume->Show(true);
} else {

View File

@ -1450,34 +1450,56 @@ int diagnostics_unhandled_exception_dump_banner() {
// Capture the foreground window details for future use.
//
int diagnostics_capture_foreground_window(PBOINC_WINDOWCAPTURE window_info) {
DWORD dwType;
DWORD dwSize;
DWORD dwCaptureForegroundWindow;
window_info->hwnd = GetForegroundWindow();
window_info->window_thread_id = GetWindowThreadProcessId(
window_info->hwnd,
&window_info->window_process_id
// Check the registry to see if we are aloud to capture the foreground
// window data. Many people were concerned about privacy issues.
//
// We'll turn it off by default, but keep it around just in case we need
// it.
//
dwCaptureForegroundWindow = 0;
dwType = REG_DWORD;
dwSize = sizeof(dwCaptureForegroundWindow);
diagnostics_get_registry_value(
"CaptureForegroundWindow",
&dwType,
&dwSize,
(LPBYTE)&dwCaptureForegroundWindow
);
// Only query the window text from windows in a different process space.
// All threads that might have windows are suspended in this process
// space and attempting to get the window text will deadlock the exception
// handler.
if (window_info->window_process_id != GetCurrentProcessId()) {
GetWindowText(
window_info->hwnd,
window_info->window_name,
sizeof(window_info->window_name)
);
GetClassName(
window_info->hwnd,
window_info->window_class,
sizeof(window_info->window_class)
);
} else {
strcpy(window_info->window_name, "");
strcpy(window_info->window_class, "");
}
if (dwCaptureForegroundWindow) {
window_info->hwnd = GetForegroundWindow();
window_info->window_thread_id = GetWindowThreadProcessId(
window_info->hwnd,
&window_info->window_process_id
);
// Only query the window text from windows in a different process space.
// All threads that might have windows are suspended in this process
// space and attempting to get the window text will deadlock the exception
// handler.
if (window_info->window_process_id != GetCurrentProcessId()) {
GetWindowText(
window_info->hwnd,
window_info->window_name,
sizeof(window_info->window_name)
);
GetClassName(
window_info->hwnd,
window_info->window_class,
sizeof(window_info->window_class)
);
} else {
strcpy(window_info->window_name, "");
strcpy(window_info->window_class, "");
}
}
return 0;
}

View File

@ -7,7 +7,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc", "boinc_cli_curl_200
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc_dll", "boinc_dll_2003.vcproj", "{B06280CB-82A4-46DE-8956-602643078BDF}"
ProjectSection(ProjectDependencies) = postProject
{E8F6BD7E-461A-4733-B7D8-37B09A099ED8} = {E8F6BD7E-461A-4733-B7D8-37B09A099ED8}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "boinc_ss", "boinc_ss_2003.vcproj", "{4A2C5963-6A8D-4CA1-A312-C3D749B2EA81}"
@ -37,8 +36,6 @@ Global
Release = Release
Release (SimpleGUI) = Release (SimpleGUI)
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{C04F0FCC-BB5D-4627-8656-6173B28BD69E}.Debug.ActiveCfg = Debug|Win32
{C04F0FCC-BB5D-4627-8656-6173B28BD69E}.Debug.Build.0 = Debug|Win32

View File

@ -22,11 +22,12 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../lib"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="3"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
@ -89,9 +90,10 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../lib"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
RuntimeLibrary="2"
UsePrecompiledHeader="3"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
@ -158,11 +160,12 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../lib"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_ATL_ATTRIBUTES"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="3"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"
@ -337,6 +340,33 @@
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
<File
RelativePath="..\lib\win_util.C">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
CompileAs="2"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
CompileAs="2"/>
</FileConfiguration>
<FileConfiguration
Name="Debug (SimpleGUI)|Win32">
<Tool
Name="VCCLCompilerTool"
CompileAs="2"/>
</FileConfiguration>
<FileConfiguration
Name="Release (SimpleGUI)|Win32">
<Tool
Name="VCCLCompilerTool"
CompileAs="2"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header Files"