mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=10695
This commit is contained in:
parent
0f09057203
commit
0dbc713d19
|
@ -341,7 +341,7 @@ void CSimpleFrame::InitSimpleClient()
|
|||
// Project button
|
||||
wxWindow *w_statW = new wxWindow(this,-1,wxPoint(60 + 52*j,460),wxSize(52,52));
|
||||
wxToolTip *statToolTip = new wxToolTip(toolTipTxt);
|
||||
StatImageLoader *i_statW = new StatImageLoader(w_statW,project->master_url);
|
||||
StatImageLoader *i_statW = new StatImageLoader(w_statW,project->master_url,j);
|
||||
// resolve the proj image
|
||||
url_to_project_dir((char*)project->master_url.c_str() ,urlDirectory);
|
||||
dirProjectGraphic = (std::string)urlDirectory + "/" + projectIconName;
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#define _SIMPLEFRAME_H_
|
||||
|
||||
class CViewTabPage;
|
||||
class ImageLoader;
|
||||
|
||||
|
||||
// Define a new frame
|
||||
class CSimpleFrame : public CBOINCBaseFrame
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#ifndef _DLG_PREFERENCES_H_
|
||||
#define _DLG_PREFERENCES_H_
|
||||
|
||||
#include "sg_SkinClass.h"
|
||||
|
||||
|
@ -62,6 +64,5 @@ protected:
|
|||
|
||||
//[win]end your code
|
||||
};
|
||||
// end CDlgPreferences
|
||||
|
||||
//#endif
|
||||
#endif // end CDlgPreferences
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
#include "BOINCGUIApp.h"
|
||||
#include "sg_StatImageLoader.h"
|
||||
#include "BOINCBaseFrame.h"
|
||||
//#include "sg_BoincSimpleGUI.h"
|
||||
|
||||
|
||||
enum{
|
||||
WEBSITE_URL_MENU_ID = 34500,
|
||||
|
@ -17,11 +19,11 @@ BEGIN_EVENT_TABLE(StatImageLoader, wxWindow)
|
|||
EVT_MENU(WEBSITE_URL_MENU_ID_REMOVE_PROJECT,StatImageLoader::OnMenuLinkClicked)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
StatImageLoader::StatImageLoader(wxWindow* parent, std::string url) : wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
|
||||
StatImageLoader::StatImageLoader(wxWindow* parent, std::string url,int index) : wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
|
||||
{
|
||||
m_parent = parent;
|
||||
appSkin = SkinClass::Instance();
|
||||
m_prjUrl = url;
|
||||
m_ProjIconIndex = index;
|
||||
CreateMenu();
|
||||
}
|
||||
|
||||
|
@ -36,6 +38,8 @@ void StatImageLoader::CreateMenu()
|
|||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
wxASSERT(pDoc);
|
||||
|
||||
appSkin = SkinClass::Instance();
|
||||
|
||||
PROJECT* project = pDoc->state.lookup_project(m_prjUrl);
|
||||
int urlCount = project->gui_urls.size();
|
||||
|
||||
|
@ -80,7 +84,8 @@ void StatImageLoader::OnMenuLinkClicked(wxCommandEvent& event)
|
|||
int menuIDevt = event.GetId();
|
||||
|
||||
if(menuIDevt == WEBSITE_URL_MENU_ID_REMOVE_PROJECT){
|
||||
//call detach project function
|
||||
//call detach project function
|
||||
OnProjectDetach();
|
||||
}else{
|
||||
int menuId = menuIDevt - WEBSITE_URL_MENU_ID;
|
||||
PROJECT* project = pDoc->state.lookup_project(m_prjUrl);
|
||||
|
@ -94,6 +99,46 @@ void StatImageLoader::OnMenuLinkClicked(wxCommandEvent& event)
|
|||
}
|
||||
|
||||
}
|
||||
void StatImageLoader::OnProjectDetach() {
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("StatImageLoader::OnProjectDetach - Function Begin"));
|
||||
|
||||
wxInt32 iAnswer = 0;
|
||||
std::string strProjectName;
|
||||
wxString strMessage = wxEmptyString;
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
|
||||
//CSimpleFrame* pFrame = wxDynamicCast(GetParent()->GetParent(), CSimpleFrame);
|
||||
|
||||
wxASSERT(pDoc);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
// wxASSERT(pFrame);
|
||||
|
||||
if (!pDoc->IsUserAuthorized())
|
||||
return;
|
||||
|
||||
PROJECT* project = pDoc->project(m_ProjIconIndex);
|
||||
project->get_name(strProjectName);
|
||||
|
||||
strMessage.Printf(
|
||||
_("Are you sure you want to detach from project '%s'?"),
|
||||
strProjectName.c_str()
|
||||
);
|
||||
|
||||
iAnswer = ::wxMessageBox(
|
||||
strMessage,
|
||||
_("Detach from Project"),
|
||||
wxYES_NO | wxICON_QUESTION,
|
||||
this
|
||||
);
|
||||
|
||||
if (wxYES == iAnswer) {
|
||||
pDoc->ProjectDetach(m_ProjIconIndex);
|
||||
}
|
||||
//pFrame->FireRefreshView();
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("StatImageLoader::OnProjectDetach - Function End"));
|
||||
}
|
||||
|
||||
|
||||
void StatImageLoader::LoadImage(const wxImage& image)
|
||||
{
|
||||
|
|
|
@ -18,14 +18,16 @@ public:
|
|||
SkinClass *appSkin;
|
||||
std::string m_prjUrl;
|
||||
/// Constructors
|
||||
StatImageLoader(wxWindow* parent, std::string url);
|
||||
StatImageLoader(wxWindow* parent, std::string url,int index);
|
||||
void LoadImage(const wxImage& image);
|
||||
void CreateMenu();
|
||||
void OnMenuLinkClicked(wxCommandEvent& event);
|
||||
void OnProjectDetach();
|
||||
void PopUpMenu(wxMouseEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
private:
|
||||
//private memb
|
||||
int m_ProjIconIndex;
|
||||
wxWindow *m_parent;
|
||||
wxBitmap Bitmap;
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
|
|
@ -342,13 +342,13 @@ void CViewTabPage::OnWorkShowGraphics() {
|
|||
|
||||
if (wxYES == iAnswer) {
|
||||
int x = 3;
|
||||
/*pDoc->WorkShowGraphics(
|
||||
m_pListPane->GetFirstSelected(),
|
||||
pDoc->WorkShowGraphics(
|
||||
m_tabIndex,
|
||||
MODE_WINDOW,
|
||||
wxGetApp().m_strDefaultWindowStation,
|
||||
wxGetApp().m_strDefaultDesktop,
|
||||
wxGetApp().m_strDefaultDisplay
|
||||
);*/
|
||||
);
|
||||
}
|
||||
|
||||
//pFrame->FireRefreshView();
|
||||
|
|
Loading…
Reference in New Issue