MGR: Fixes to new Simple GUI for Linux, enable / disable Show Graphics

svn path=/trunk/boinc/; revision=23535
This commit is contained in:
Charlie Fenton 2011-05-13 10:08:27 +00:00
parent a2135d4cfb
commit 25ac4ea160
4 changed files with 37 additions and 14 deletions

View File

@ -762,7 +762,7 @@ Charlie 15 Feb 2011
Mac Installer: Fix the code which deletes installer receipts to use
the current package name (which changed when I eliminated the
Mac installer wrapper application around the installer package.)
This is needed to allow isntalling an older version to replace a
This is needed to allow installing an older version to replace a
newer one under OS 10.4.x.
mac_installer/
@ -1994,7 +1994,7 @@ Charlie 30 Mar 2011
ATI / AMD GPUs, and NVIDIA's platform reports only NVIDIA GPUs.
The NVIDIA vendor may be reported as "NVIDIA" or"NVIDIA Corporation"
Note: The client currently always says "No usable GPUs found" because
David has not yet completed implementing the changes befgun on 24 Mar.
David has not yet completed implementing the changes begun on 24 Mar.
client/
coproc_detect.cpp
@ -2940,8 +2940,10 @@ Charlie 12 May 2011
Charlie 13 May 2011
- MGR: Fixes to new Simple GUI for Linux.
- MGR: Fix logic to enable / disable Show Graphics in new Simple GUI.
clientgui/
sg_PanelBase.cpp, .h
sg_ProjectPanel.cpp, .h
sg_TaskCommandPopup.cpp, .h
sg_TaskPanel.cpp, .h

View File

@ -69,7 +69,7 @@ void CSimplePanelBase::MakeBGBitMap() {
// Workaround for CSimpleGUIPanel not reliably getting
// Paint or EraseBackground events under Linux
#if (defined(__WXMSW_) || defined(__WXMAC__))
#if (!(defined(__WXMSW_) || defined(__WXMAC__)))
backgroundPanel->SetBackgroundBitmap();
#endif

View File

@ -85,13 +85,16 @@ void CSimpleTaskPopupButton::OnTasksCommandButton(wxMouseEvent& /*event*/) {
CMainDocument* pDoc = wxGetApp().GetDocument();
bool enableShowGraphics = true;
bool enableAbort = true;
CC_STATUS status;
wxString strMachineName;
wxASSERT(pDoc);
TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData();
if (selData == NULL) return;
RESULT* result = pDoc->state.lookup_result(selData->project_url, selData->result_name);
RESULT* result = lookup_result(selData->project_url, selData->result_name);
if (!result) return;
if (result->suspended_via_gui) {
@ -104,7 +107,17 @@ void CSimpleTaskPopupButton::OnTasksCommandButton(wxMouseEvent& /*event*/) {
m_SuspendResumeMenuItem->SetHelp(_("Suspend work for this task."));
}
// Disable Show Graphics button if any selected task can't display graphics
pDoc->GetCoreClientStatus(status);
if (status.task_suspend_reason & ~(SUSPEND_REASON_CPU_THROTTLE)) {
enableShowGraphics = false;
}
pDoc->GetConnectedComputerName(strMachineName);
if (!pDoc->IsComputerNameLocal(strMachineName)) {
enableShowGraphics = false;
}
// Disable Show Graphics button if selected task can't display graphics
if (((!result->supports_graphics) || pDoc->GetState()->executing_as_daemon)
&& !strlen(result->graphics_exec_path)
) {
@ -191,7 +204,7 @@ void CSimpleTaskPopupButton::OnTaskShowGraphics(wxCommandEvent& WXUNUSED(event))
TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData();
if (selData == NULL) return;
RESULT* result = pDoc->state.lookup_result(selData->project_url, selData->result_name);
RESULT* result = lookup_result(selData->project_url, selData->result_name);
if (result) {
pDoc->WorkShowGraphics(result);
}
@ -229,7 +242,7 @@ void CSimpleTaskPopupButton::OnTaskAbort(wxCommandEvent& WXUNUSED(event)) {
TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData();
if (selData == NULL) return;
RESULT* result = pDoc->state.lookup_result(selData->project_url, selData->result_name);
RESULT* result = lookup_result(selData->project_url, selData->result_name);
if (result) {
#if SELECTBYRESULTNAME
wxString name = wxString(selData->result_name, wxConvUTF8, strlen(selData->result_name));
@ -257,18 +270,25 @@ void CSimpleTaskPopupButton::OnTaskAbort(wxCommandEvent& WXUNUSED(event)) {
void CSimpleTaskPopupButton::OnTaskShowProperties(wxCommandEvent& WXUNUSED(event)) {
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData();
if (selData == NULL) return;
RESULT* result = pDoc->state.lookup_result(selData->project_url, selData->result_name);
RESULT* result = lookup_result(selData->project_url, selData->result_name);
if (result) {
CDlgItemProperties dlg(this);
dlg.renderInfos(result);
dlg.ShowModal();
}
}
// CMainDocument::state.lookup_result() does not yield current scheduler_state;
// we must use CMainDocument::result() for that.
RESULT* CSimpleTaskPopupButton::lookup_result(char* url, char* name) {
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
return pDoc->result(wxString(name, wxConvUTF8), wxString(url, wxConvUTF8));
}

View File

@ -44,7 +44,8 @@ class CSimpleTaskPopupButton : public wxButton
void OnTaskSuspendResume(wxCommandEvent& event);
void OnTaskAbort(wxCommandEvent& event);
void OnTaskShowProperties(wxCommandEvent& event);
RESULT* lookup_result(char* url, char* name);
protected:
wxMenu* m_TaskCommandPopUpMenu;
wxMenuItem* m_ShowGraphicsMenuItem;