diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index bab1fe527c..55e68fbc45 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -15,12 +15,6 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -// XIdleTime: -// Copyright (C) 2011 Universidade Federal de Campina Grande -// Initial version: Magnus Henoch -// Contributors: Danny Kukawka, Eivind Magnus Hvidevold -// LGPL Version of xidletime: https://github.com/rodrigods/xidletime - // There is a reason that having a file called "cpp.h" that includes config.h // and some of the C++ header files is bad. That reason is because there are // #defines that alter the behiour of the standard C and C++ headers. In @@ -159,17 +153,6 @@ mach_port_t gEventHandle = NULL; #define _SC_PAGESIZE _SC_PAGE_SIZE #endif -#if HAVE_DPMS -#include -#include -#endif - -#if HAVE_XSS -#include -#include -#endif - - // The following is intended to be true both on Linux // and Debian GNU/kFreeBSD (see trac #521) // @@ -1586,7 +1569,7 @@ inline bool device_idle(time_t t, const char *device) { return stat(device, &sbuf) || (sbuf.st_atime < t); } -static const struct dir_dev { +static const struct dir_tty_dev { const char *dir; const char *dev; } tty_patterns[] = { @@ -1627,7 +1610,6 @@ vector get_tty_list() { } while (tty_patterns[i].dir != NULL); return tty_list; } - inline bool all_tty_idle(time_t t) { static vector tty_list; @@ -1638,7 +1620,67 @@ inline bool all_tty_idle(time_t t) { for (i=0; i= t) { + return false; + } + } + } + return true; +} + +static const struct dir_input_dev { + const char *dir; + const char *dev; +} input_patterns[] = { +#ifdef unix + { "/dev/input","event" }, + { "/dev/input","mouse" }, + { "/dev/input/mice","" }, +#endif + // add other ifdefs here as necessary. + { NULL, NULL }, +}; + +vector get_input_list() { + // Create a list of all terminal devices on the system. + char devname[1024]; + char fullname[1024]; + int done,i=0; + vector input_list; + + do { + DIRREF dev=dir_open(input_patterns[i].dir); + if (dev) { + do { + // get next file + done=dir_scan(devname,dev,1024); + // does it match our tty pattern? If so, add it to the tty list. + if (!done && (strstr(devname,input_patterns[i].dev) == devname)) { + // don't add anything starting with . + if (devname[0] != '.') { + sprintf(fullname,"%s/%s",input_patterns[i].dir,devname); + input_list.push_back(fullname); + } + } + } while (!done); + dir_close(dev); + } + i++; + } while (input_patterns[i].dir != NULL); + return input_list; +} + +inline bool all_input_idle(time_t t) { + static vector input_list; + struct stat sbuf; + unsigned int i; + + if (input_list.size()==0) input_list=get_input_list(); + for (i=0; i= t) { return false; } @@ -1865,91 +1907,6 @@ bool interrupts_idle(time_t t) { } return last_irq < t; } - -#if HAVE_XSS -// Ask the X server for user idle time (using XScreenSaver API) -// Return true if the idle time exceeds idle_threshold. -// -bool xss_idle(long idle_threshold) { - static XScreenSaverInfo* xssInfo = NULL; - static Display* disp = NULL; - static bool error = false; - // some X call failed - always return not idle - - if (error) return false; - - long idle_time = 0; - - if (disp == NULL) { - disp = XOpenDisplay(NULL); - // XOpenDisplay may return NULL if there is no running X - // or DISPLAY points to wrong/invalid display - // - if (disp == NULL) { - error = true; - return false; - } - int event_base_return, error_base_return; - xssInfo = XScreenSaverAllocInfo(); - if (!XScreenSaverQueryExtension( - disp, &event_base_return, &error_base_return - )){ - error = true; - return false; - } - } - - XScreenSaverQueryInfo(disp, DefaultRootWindow(disp), xssInfo); - idle_time = xssInfo->idle; - -#if HAVE_DPMS - // XIdleTime Detection - // See header for location and copywrites. - // - int dummy; - CARD16 standby, suspend, off; - CARD16 state; - BOOL onoff; - - if (DPMSQueryExtension(disp, &dummy, &dummy)) { - if (DPMSCapable(disp)) { - DPMSGetTimeouts(disp, &standby, &suspend, &off); - DPMSInfo(disp, &state, &onoff); - - if (onoff) { - switch (state) { - case DPMSModeStandby: - // this check is a littlebit paranoid, but be sure - if (idle_time < (unsigned) (standby * 1000)) { - idle_time += (standby * 1000); - } - break; - case DPMSModeSuspend: - if (idle_time < (unsigned) ((suspend + standby) * 1000)) { - idle_time += ((suspend + standby) * 1000); - } - break; - case DPMSModeOff: - if (idle_time < (unsigned) ((off + suspend + standby) * 1000)) { - idle_time += ((off + suspend + standby) * 1000); - } - break; - case DPMSModeOn: - default: - break; - } - } - } - } -#endif - - // convert from milliseconds to seconds - // - idle_time = idle_time / 1000; - - return idle_threshold < idle_time; -} -#endif // HAVE_XSS #endif // LINUX_LIKE_SYSTEM bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) { @@ -1976,16 +1933,14 @@ bool HOST_INFO::users_idle(bool check_all_logins, double idle_time_to_run) { } // Lets at least check the dev entries which should be correct for - // USB mice. The tty check will catch keyboards if they are entering - // data into a tty. - if (!device_idle(idle_time, "/dev/input/mice")) return false; - -#if HAVE_XSS - if (!xss_idle((long)(idle_time_to_run * 60))) { + // USB keyboards and mice. If the linux kernel doc is correct it should + // also work for bluetooth input devices as well. + // + // See: https://www.kernel.org/doc/Documentation/input/input.txt + // + if (!all_input_idle(idle_time)) { return false; } -#endif - #else // We should find out which of the following are actually relevant // on which systems (if any) diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index be0dae8212..705ad5c752 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -805,12 +805,12 @@ bool CAdvancedFrame::CreateNotebookPage( CBOINCBaseView* pwndNewNotebookPage) { pImageList = m_pNotebook->GetImageList(); if (!pImageList) { - pImageList = new wxImageList(16, 16, true, 0); + pImageList = new wxImageList(ADJUSTFORXDPI(16), ADJUSTFORYDPI(16), true, 0); wxASSERT(pImageList != NULL); m_pNotebook->SetImageList(pImageList); } - iImageIndex = pImageList->Add(wxBitmap(pwndNewNotebookPage->GetViewIcon())); + iImageIndex = pImageList->Add(GetScaledBitmapFromXPMData(pwndNewNotebookPage->GetViewIcon())); m_pNotebook->AddPage(pwndNewNotebookPage, pwndNewNotebookPage->GetViewDisplayName(), TRUE, iImageIndex); wxLogTrace(wxT("Function Start/End"), wxT("CAdvancedFrame::CreateNotebookPage - Function End")); diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 715d7a38a7..ba77f9e8fc 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -71,20 +71,25 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas int iImageIndex = 0; wxImageList* pImageList = m_Notebook->GetImageList(); if (!pImageList) { - pImageList = new wxImageList(16, 16, true, 0); + pImageList = new wxImageList(ADJUSTFORXDPI(16), ADJUSTFORYDPI(16), true, 0); wxASSERT(pImageList != NULL); m_Notebook->SetImageList(pImageList); } - iImageIndex = pImageList->Add(wxBitmap(proj_xpm)); + iImageIndex = pImageList->Add(GetScaledBitmapFromXPMData(proj_xpm)); m_Notebook->SetPageImage(0,iImageIndex); - iImageIndex = pImageList->Add(wxBitmap(xfer_xpm)); + iImageIndex = pImageList->Add(GetScaledBitmapFromXPMData(xfer_xpm)); m_Notebook->SetPageImage(1,iImageIndex); - iImageIndex = pImageList->Add(wxBitmap(usage_xpm)); + iImageIndex = pImageList->Add(GetScaledBitmapFromXPMData(usage_xpm)); m_Notebook->SetPageImage(2,iImageIndex); +#ifdef __WXMSW__ + wxSize size = wxSize(wxSystemSettings::GetMetric(wxSYS_SMALLICON_X), wxSystemSettings::GetMetric(wxSYS_SMALLICON_Y)); + iImageIndex = pImageList->Add(pSkinAdvanced->GetApplicationSnoozeIcon()->GetIcon(size, wxIconBundle::FALLBACK_NEAREST_LARGER)); +#else iImageIndex = pImageList->Add(pSkinAdvanced->GetApplicationSnoozeIcon()->GetIcon(wxSize(16,16))); +#endif m_Notebook->SetPageImage(3,iImageIndex); //setting warning bitmap @@ -121,8 +126,9 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas } #endif - this->Layout(); + Layout(); Fit(); + Centre(); } /* destructor */ diff --git a/clientgui/DlgEventLog.cpp b/clientgui/DlgEventLog.cpp index e0b1c8c26a..79feef7ba0 100644 --- a/clientgui/DlgEventLog.cpp +++ b/clientgui/DlgEventLog.cpp @@ -37,7 +37,6 @@ #include "DlgEventLog.h" #include "AdvancedFrame.h" #include "DlgDiagnosticLogFlags.h" -#include #ifdef __WXMAC__ #include @@ -176,8 +175,10 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt #ifdef __WXMSW__ // Get the current display space for the current window int iDisplay = wxNOT_FOUND; - if ( wxGetApp().GetFrame() != NULL ) iDisplay = wxDisplay::GetFromWindow(wxGetApp().GetFrame()); - if ( iDisplay == wxNOT_FOUND ) iDisplay = 0; + if ( wxGetApp().GetFrame() != NULL ) + iDisplay = wxDisplay::GetFromWindow(wxGetApp().GetFrame()); + if ( iDisplay == wxNOT_FOUND ) + iDisplay = 0; wxDisplay *display = new wxDisplay(iDisplay); wxRect rDisplay = display->GetClientArea(); @@ -202,7 +203,6 @@ bool CDlgEventLog::Create( wxWindow* parent, wxWindowID id, const wxString& capt delete display; #endif - #ifdef __WXMAC__ // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index 791922eb8c..42724c0567 100644 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -71,8 +71,6 @@ CDlgItemProperties::CDlgItemProperties(wxWindow* parent) : SetSizer( m_bSizer1 ); Layout(); - Centre( wxBOTH ); - m_current_row=0; int currentTabView = pFrame->GetCurrentViewPage(); @@ -106,59 +104,87 @@ bool CDlgItemProperties::SaveState() { pConfig->SetPath(m_strBaseConfigLocation); pConfig->Write(wxT("Width"), GetSize().GetWidth()); pConfig->Write(wxT("Height"), GetSize().GetHeight()); -#ifdef __WXMAC__ pConfig->Write(wxT("XPos"), GetPosition().x); pConfig->Write(wxT("YPos"), GetPosition().y); -#endif pConfig->Flush(); return true; } -/* restores former dialog size and (on Mac) position */ +/* restores former dialog size and position */ bool CDlgItemProperties::RestoreState() { - wxConfigBase* pConfig = wxConfigBase::Get(FALSE); - int iWidth, iHeight; + wxConfigBase* pConfig = wxConfigBase::Get(FALSE); + wxPoint oTempPoint; + wxSize oTempSize; wxASSERT(pConfig); if (!pConfig) return false; pConfig->SetPath(m_strBaseConfigLocation); - pConfig->Read(wxT("Width"), &iWidth, wxDefaultCoord); - pConfig->Read(wxT("Height"), &iHeight, wxDefaultCoord); + pConfig->Read(wxT("YPos"), &oTempPoint.y, wxDefaultCoord); + pConfig->Read(wxT("XPos"), &oTempPoint.x, wxDefaultCoord); + pConfig->Read(wxT("Width"), &oTempSize.x, wxDefaultCoord); + pConfig->Read(wxT("Height"), &oTempSize.y, wxDefaultCoord); // Guard against a rare situation where registry values are zero - if ((iWidth < 50) && (iWidth != wxDefaultCoord)) iWidth = wxDefaultCoord; - if ((iHeight < 50) && (iHeight != wxDefaultCoord)) iHeight = wxDefaultCoord; + if ((oTempSize.x < 50) && (oTempSize.x != wxDefaultCoord)) oTempSize.x = wxDefaultCoord; + if ((oTempSize.y < 50) && (oTempSize.y != wxDefaultCoord)) oTempSize.y = wxDefaultCoord; -#ifndef __WXMAC__ - // Set size to saved values or defaults if no saved values - SetSize(iWidth, iHeight); -#else - int iTop, iLeft; - - pConfig->Read(wxT("YPos"), &iTop, wxDefaultCoord); - pConfig->Read(wxT("XPos"), &iLeft, wxDefaultCoord); - // If either co-ordinate is less then 0 then set it equal to 0 to ensure // it displays on the screen. - if ((iLeft < 0) && (iLeft != wxDefaultCoord)) iLeft = 30; - if ((iTop < 0) && (iTop != wxDefaultCoord)) iTop = 30; + if ((oTempPoint.x < 0) && (oTempPoint.x != wxDefaultCoord)) oTempPoint.x = wxDefaultCoord; + if ((oTempPoint.y < 0) && (oTempPoint.y != wxDefaultCoord)) oTempPoint.y = wxDefaultCoord; // Set size and position to saved values or defaults if no saved values - SetSize(iLeft, iTop, iWidth, iHeight, wxSIZE_USE_EXISTING); + SetSize(oTempPoint.x, oTempPoint.y, oTempSize.x, oTempSize.y, wxSIZE_USE_EXISTING); // Now make sure window is on screen - GetScreenPosition(&iLeft, &iTop); - GetSize(&iWidth, &iHeight); + oTempPoint = GetScreenPosition(); + oTempSize = GetSize(); - if (!IsWindowOnScreen(iLeft, iTop, iWidth, iHeight)) { - iTop = iLeft = 30; - SetSize(iLeft, iTop, iWidth, iHeight, wxSIZE_USE_EXISTING); - } +#ifdef __WXMSW__ + // Get the current display space for the current window + int iDisplay = wxNOT_FOUND; + if ( wxGetApp().GetFrame() != NULL ) + iDisplay = wxDisplay::GetFromWindow(this); + if ( iDisplay == wxNOT_FOUND ) + iDisplay = 0; + wxDisplay *display = new wxDisplay(iDisplay); + wxRect rDisplay = display->GetClientArea(); + + // Check that the saved height and width is not larger than the displayable space. + // If it is, then reduce the size. + if ( oTempSize.GetWidth() > rDisplay.width ) oTempSize.SetWidth(rDisplay.width); + if ( oTempSize.GetHeight() > rDisplay.height ) oTempSize.SetHeight(rDisplay.height); + + // Check if part of the display was going to be off the screen, if so, center the + // display on that axis + if ( oTempPoint.x < rDisplay.x ) { + oTempPoint.x = rDisplay.x; + } else if ( oTempPoint.x + oTempSize.GetWidth() > rDisplay.x + rDisplay.width ) { + oTempPoint.x = rDisplay.x + rDisplay.width - oTempSize.GetWidth(); + } + + if ( oTempPoint.y < rDisplay.y ) { + oTempPoint.y = rDisplay.y; + } else if ( oTempPoint.y + oTempSize.GetHeight() > rDisplay.y + rDisplay.height ) { + oTempPoint.y = rDisplay.y + rDisplay.height - oTempSize.GetHeight(); + } + + delete display; #endif +#ifdef __WXMAC__ + // If the user has changed the arrangement of multiple + // displays, make sure the window title bar is still on-screen. + if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { + oTempPoint.y = oTempPoint.x = 30; + } +#endif // ! __WXMAC__ + + // Set size and position to saved values or defaults if no saved values + SetSize(oTempPoint.x, oTempPoint.y, oTempSize.x, oTempSize.y, wxSIZE_USE_EXISTING); return true; } diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 05a16be8aa..bb7b3c0d83 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -2672,3 +2672,19 @@ float GetYDPIScaling() { return YDPIScaleFactor; } #endif + +// TODO: Choose from multiple size images if provided, else resize the closest one +wxBitmap GetScaledBitmapFromXPMData(const char** XPMData) { +#ifdef __WXMSW__ + if ((GetXDPIScaling() > 1.05) || (GetYDPIScaling() > 1.05)) { + wxImage img = wxImage(XPMData); + img.Rescale((int) (img.GetWidth()*GetXDPIScaling()), + (int) (img.GetHeight()*GetYDPIScaling()), + wxIMAGE_QUALITY_BILINEAR + ); + wxBitmap *bm = new wxBitmap(img); + return *bm; + } +#endif + return wxBitmap(XPMData); +} diff --git a/clientgui/MainDocument.h b/clientgui/MainDocument.h index 2a85710ccb..028537d358 100644 --- a/clientgui/MainDocument.h +++ b/clientgui/MainDocument.h @@ -427,6 +427,8 @@ extern float GetYDPIScaling(); #define ADJUSTFORYDPI(y) y #endif +wxBitmap GetScaledBitmapFromXPMData(const char** XPMData); + #ifdef SANDBOX #define BOINC_MASTER_GROUP_NAME "boinc_master" #endif diff --git a/clientgui/Makefile.am b/clientgui/Makefile.am index 744d084cab..4c1f1f4d01 100644 --- a/clientgui/Makefile.am +++ b/clientgui/Makefile.am @@ -100,9 +100,9 @@ EXTRA_DIST = *.h \ ../lib/error_numbers.h \ locale -boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0` -boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) `pkg-config --cflags gtk+-2.0` -boincmgr_LDFLAGS = $(LIBBOINC) $(SQLITE3_LIBS) $(LIBNOTIFY_LIBS) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) `pkg-config --libs gtk+-2.0` -lnotify +boincmgr_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CPPFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) $(GTK_CLFAGS) +boincmgr_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS) $(SQLITE3_CPPFLAGS) $(LIBNOTIFY_CFLAGS) $(CLIENTGUIFLAGS) $(GTK_CFLAGS) +boincmgr_LDADD = $(LIBBOINC) $(SQLITE3_LIBS) $(LIBNOTIFY_LIBS) $(CLIENTGUILIBS) $(BOINC_EXTRA_LIBS) $(CLIENTLIBS) $(GTK_LIBS) win_config.h: $(top_srcdir)/config.h grep '#define.*BOINC.*VERSION' $^ > $@ diff --git a/clientgui/SkinManager.cpp b/clientgui/SkinManager.cpp index 43fa059ce2..badfcafc8f 100644 --- a/clientgui/SkinManager.cpp +++ b/clientgui/SkinManager.cpp @@ -29,6 +29,7 @@ #include "BOINCGUIApp.h" #include "BOINCBaseFrame.h" #include "SkinManager.h" +#include "MainDocument.h" #include "version.h" @@ -152,13 +153,25 @@ bool CSkinImage::SetDefaults(wxString strComponentName, const char** ppDefaultBi bool CSkinImage::Validate() { if (!m_bmpBitmap.Ok()) { if (!m_strDesiredBitmap.IsEmpty()) { - m_bmpBitmap = wxBitmap(wxImage(m_strDesiredBitmap, wxBITMAP_TYPE_ANY)); + wxImage img = wxImage(m_strDesiredBitmap, wxBITMAP_TYPE_ANY); + if (img.IsOk()) { +#ifdef __WXMSW__ +// TODO: Choose from multiple size images if provided, else resize the closest one + if ((GetXDPIScaling() > 1.05) || (GetYDPIScaling() > 1.05)) { + img.Rescale((int) (img.GetWidth()*GetXDPIScaling()), + (int) (img.GetHeight()*GetYDPIScaling()), + wxIMAGE_QUALITY_BILINEAR + ); + } +#endif + m_bmpBitmap = wxBitmap(img); + } } if (!m_bmpBitmap.Ok()) { if (show_error_msgs) { fprintf(stderr, "Skin Manager: Failed to load '%s' image. Using default.\n", (const char *)m_strComponentName.mb_str()); } - m_bmpBitmap = wxBitmap(m_ppDefaultBitmap); + m_bmpBitmap = GetScaledBitmapFromXPMData(m_ppDefaultBitmap); wxASSERT(m_bmpBitmap.Ok()); } } @@ -480,7 +493,19 @@ int CSkinAdvanced::Parse(MIOFILE& in) { wxString(strBuffer.c_str(), wxConvUTF8) ); if (boinc_file_exists(str.c_str())) { - m_bitmapApplicationLogo = wxBitmap(wxImage(str.c_str(), wxBITMAP_TYPE_ANY)); + wxImage img = wxImage(str.c_str(), wxBITMAP_TYPE_ANY); + if (img.IsOk()) { +#ifdef __WXMSW__ +// TODO: Choose from multiple size images if provided, else resize the closest one + if ((GetXDPIScaling() > 1.05) || (GetYDPIScaling() > 1.05)) { + img.Rescale((int) (img.GetWidth()*GetXDPIScaling()), + (int) (img.GetHeight()*GetYDPIScaling()), + wxIMAGE_QUALITY_BILINEAR + ); + } +#endif + m_bitmapApplicationLogo = wxBitmap(img); + } } } continue; diff --git a/clientgui/sg_BoincSimpleFrame.cpp b/clientgui/sg_BoincSimpleFrame.cpp index 9fceeaedbb..9e744a781f 100755 --- a/clientgui/sg_BoincSimpleFrame.cpp +++ b/clientgui/sg_BoincSimpleFrame.cpp @@ -828,12 +828,12 @@ CSimpleGUIPanel::CSimpleGUIPanel(wxWindow* parent) : m_projPanel = new CSimpleProjectPanel(this); // Box Sizer - mainSizer = new wxBoxSizer(wxVERTICAL); - mainSizer->AddSpacer(68); + mainSizer = new wxBoxSizer(wxVERTICAL); + mainSizer->AddSpacer(ADJUSTFORYDPI(68)); mainSizer->Add(m_taskPanel, 1, wxLEFT | wxRIGHT | wxEXPAND | wxALIGN_CENTER, SIDEMARGINS); - mainSizer->AddSpacer(8); + mainSizer->AddSpacer(ADJUSTFORYDPI(8)); mainSizer->Add(m_projPanel, 0, wxLEFT | wxRIGHT | wxEXPAND | wxALIGN_CENTER, SIDEMARGINS); - mainSizer->AddSpacer(8); + mainSizer->AddSpacer(ADJUSTFORYDPI(8)); wxBoxSizer* buttonsSizer; buttonsSizer = new wxBoxSizer( wxHORIZONTAL ); @@ -864,7 +864,7 @@ CSimpleGUIPanel::CSimpleGUIPanel(wxWindow* parent) : m_HelpButton->SetToolTip(helpTip); mainSizer->Add( buttonsSizer, 0, wxLEFT | wxRIGHT | wxEXPAND, 2 * SIDEMARGINS ); - mainSizer->AddSpacer(10); + mainSizer->AddSpacer(ADJUSTFORYDPI(10)); SetSizer(mainSizer); Layout(); diff --git a/clientgui/sg_DlgMessages.cpp b/clientgui/sg_DlgMessages.cpp index 01a748a6e2..2f18cc3e30 100644 --- a/clientgui/sg_DlgMessages.cpp +++ b/clientgui/sg_DlgMessages.cpp @@ -125,7 +125,7 @@ void CPanelMessages::CreateControls() wxPoint(20, 20), wxDefaultSize, 0 ); m_FetchingNoticesText->SetBackgroundColour(*wxWHITE); - itemFlexGridSizer2->Add(m_FetchingNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, 5); + itemFlexGridSizer2->Add(m_FetchingNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, ADJUSTFORXDPI(5)); m_NoNoticesText = new wxStaticText( this, wxID_ANY, @@ -133,24 +133,24 @@ void CPanelMessages::CreateControls() wxPoint(20, 20), wxDefaultSize, 0 ); m_NoNoticesText->SetBackgroundColour(*wxWHITE); - itemFlexGridSizer2->Add(m_NoNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, 5); + itemFlexGridSizer2->Add(m_NoNoticesText, 0, wxEXPAND | wxLEFT | wxRIGHT, ADJUSTFORXDPI(5)); m_pHtmlListPane = new CNoticeListCtrl(itemDialog1); wxASSERT(m_pHtmlListPane); - itemFlexGridSizer2->Add(m_pHtmlListPane, 0, wxGROW|wxALL, 5); + itemFlexGridSizer2->Add(m_pHtmlListPane, 0, wxGROW|wxALL, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); wxButton* itemButton44 = new wxButton(itemDialog1, wxID_OK, _("Close"), wxDefaultPosition, wxDefaultSize); - itemBoxSizer4->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer4->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); #ifdef __WXMAC__ // Don't let Close button overlap window's grow icon - itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 12); + itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(12)); #else - itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemFlexGridSizer2->Add(itemBoxSizer4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); #endif itemDialog1->SetSizer(itemFlexGridSizer2); diff --git a/clientgui/sg_DlgPreferences.cpp b/clientgui/sg_DlgPreferences.cpp index 2be84be7a1..4f37649878 100644 --- a/clientgui/sg_DlgPreferences.cpp +++ b/clientgui/sg_DlgPreferences.cpp @@ -263,7 +263,7 @@ void CPanelPreferences::CreateControls() itemDialog1->SetSizer(itemBoxSizer2); wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(1, 0, 0); - itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxGROW|wxALL, 5); + itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxGROW|wxALL, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText4 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("This dialog controls preferences for this computer only."), wxDefaultPosition, wxDefaultSize, 0 ); @@ -280,7 +280,7 @@ void CPanelPreferences::CreateControls() // itemStaticText6->SetFont(wxFont(MEDIUM_FONT, wxSWISS, wxNORMAL, wxBOLD, false, _T("Arial"))); itemFlexGridSizer3->Add(itemStaticText6, 0, wxALL, 0); - itemFlexGridSizer3->AddSpacer(10); + itemFlexGridSizer3->AddSpacer(ADJUSTFORYDPI(10)); CTransparentStaticText* itemStaticText7 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("For additional settings, select Computing Preferences in the Advanced View."), wxDefaultPosition, wxDefaultSize, 0 ); @@ -289,14 +289,14 @@ void CPanelPreferences::CreateControls() CTransparentStaticLine* itemStaticLine8 = new CTransparentStaticLine( itemDialog1, wxID_ANY, wxDefaultPosition, wxSize(300, 1), wxLI_HORIZONTAL|wxNO_BORDER ); itemStaticLine8->SetLineColor(pSkinSimple->GetStaticLineColor()); - itemBoxSizer2->Add(itemStaticLine8, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, 20); + itemBoxSizer2->Add(itemStaticLine8, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT, ADJUSTFORXDPI(20)); wxFlexGridSizer* itemFlexGridSizer9 = new wxFlexGridSizer(1, 1, 0, 0); itemFlexGridSizer9->AddGrowableCol(0); - itemBoxSizer2->Add(itemFlexGridSizer9, 0, wxGROW|wxALL, 5); + itemBoxSizer2->Add(itemFlexGridSizer9, 0, wxGROW|wxALL, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer11 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer2->Add(itemBoxSizer11, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT, 20); + itemBoxSizer2->Add(itemBoxSizer11, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT, ADJUSTFORXDPI(20)); wxFlexGridSizer* itemFlexGridSizer15 = new wxFlexGridSizer(7, 2, 0, 0); itemFlexGridSizer15->AddGrowableRow(0); @@ -313,7 +313,7 @@ void CPanelPreferences::CreateControls() CTransparentStaticText* itemStaticText16 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Do work only between:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText16->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText16->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText16, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -321,21 +321,21 @@ void CPanelPreferences::CreateControls() wxString* m_WorkBetweenBeginCtrlStrings = NULL; m_WorkBetweenBeginCtrl = new wxComboBox( itemDialog1, ID_WORKBETWEENBEGIN, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_WorkBetweenBeginCtrlStrings, wxCB_READONLY ); m_WorkBetweenBeginCtrl->Enable(false); - itemBoxSizer17->Add(m_WorkBetweenBeginCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer17->Add(m_WorkBetweenBeginCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText19 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("and"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText19->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); - itemBoxSizer17->Add(itemStaticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer17->Add(itemStaticText19, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxString* m_WorkBetweenEndCtrlStrings = NULL; m_WorkBetweenEndCtrl = new wxComboBox( itemDialog1, ID_WORKBETWEENEND, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_WorkBetweenEndCtrlStrings, wxCB_READONLY ); m_WorkBetweenEndCtrl->Enable(false); - itemBoxSizer17->Add(m_WorkBetweenEndCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); + itemBoxSizer17->Add(m_WorkBetweenEndCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText21 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Connect to internet only between:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText21->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText21->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText21, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText21, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer22 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer22, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -343,21 +343,21 @@ void CPanelPreferences::CreateControls() wxString* m_ConnectBetweenBeginCtrlStrings = NULL; m_ConnectBetweenBeginCtrl = new wxComboBox( itemDialog1, ID_CONNECTBETWEENBEGIN, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_ConnectBetweenBeginCtrlStrings, wxCB_READONLY ); m_ConnectBetweenBeginCtrl->Enable(false); - itemBoxSizer22->Add(m_ConnectBetweenBeginCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer22->Add(m_ConnectBetweenBeginCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText24 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("and"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText24->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); - itemBoxSizer22->Add(itemStaticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer22->Add(itemStaticText24, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxString* m_ConnectBetweenEndCtrlStrings = NULL; m_ConnectBetweenEndCtrl = new wxComboBox( itemDialog1, ID_CONNECTBETWEENEND, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_ConnectBetweenEndCtrlStrings, wxCB_READONLY ); m_ConnectBetweenEndCtrl->Enable(false); - itemBoxSizer22->Add(m_ConnectBetweenEndCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); + itemBoxSizer22->Add(m_ConnectBetweenEndCtrl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText26 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Use no more than:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText26->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText26->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText26, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText26, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer27, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -365,16 +365,16 @@ void CPanelPreferences::CreateControls() wxString* m_MaxDiskUsageCtrlStrings = NULL; m_MaxDiskUsageCtrl = new wxComboBox( itemDialog1, ID_MAXDISKUSAGE, _T(""), wxDefaultPosition, wxSize(-1, -1), 0, m_MaxDiskUsageCtrlStrings, wxCB_READONLY ); m_MaxDiskUsageCtrl->Enable(false); - itemBoxSizer27->Add(m_MaxDiskUsageCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer27->Add(m_MaxDiskUsageCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText29 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("of disk space"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText29->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); - itemBoxSizer27->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer27->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText30 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Use no more than:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText30->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText30->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText30, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer31, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -382,16 +382,16 @@ void CPanelPreferences::CreateControls() wxString* m_MaxCPUUsageCtrlStrings = NULL; m_MaxCPUUsageCtrl = new wxComboBox( itemDialog1, ID_MAXCPUUSAGE, _T(""), wxDefaultPosition, wxDefaultSize, 0, m_MaxCPUUsageCtrlStrings, wxCB_READONLY ); m_MaxCPUUsageCtrl->Enable(false); - itemBoxSizer31->Add(m_MaxCPUUsageCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer31->Add(m_MaxCPUUsageCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText33 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("of the processor"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText33->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); - itemBoxSizer31->Add(itemStaticText33, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer31->Add(itemStaticText33, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText37 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Do work while on battery?"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText37->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText37->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText37, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText37, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer38 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer38, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -399,12 +399,12 @@ void CPanelPreferences::CreateControls() m_WorkWhileOnBatteryCtrl = new wxCheckBox( itemDialog1, ID_WORKWHILEONBATTERY, _T(""), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE ); m_WorkWhileOnBatteryCtrl->SetValue(false); m_WorkWhileOnBatteryCtrl->Enable(false); - itemBoxSizer38->Add(m_WorkWhileOnBatteryCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer38->Add(m_WorkWhileOnBatteryCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText40 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("Do work after idle for:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT ); itemStaticText40->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); itemStaticText40->Wrap(250); - itemFlexGridSizer15->Add(itemStaticText40, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemFlexGridSizer15->Add(itemStaticText40, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer41 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer15->Add(itemBoxSizer41, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 0); @@ -412,26 +412,26 @@ void CPanelPreferences::CreateControls() wxString* m_WorkWhenIdleCtrlStrings = NULL; m_WorkWhenIdleCtrl = new wxComboBox( itemDialog1, ID_WORKWHENIDLE, _T(""), wxDefaultPosition, wxSize(-1, -1), 0, m_WorkWhenIdleCtrlStrings, wxCB_READONLY ); m_WorkWhenIdleCtrl->Enable(false); - itemBoxSizer41->Add(m_WorkWhenIdleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + itemBoxSizer41->Add(m_WorkWhenIdleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, ADJUSTFORXDPI(5)); CTransparentStaticText* itemStaticText43 = new CTransparentStaticText( itemDialog1, wxID_ANY, _("minutes"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticText43->SetFont(wxFont(SMALL_FONT, wxSWISS, wxNORMAL, wxNORMAL, false, _T("Arial"))); - itemBoxSizer41->Add(itemStaticText43, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5); + itemBoxSizer41->Add(itemStaticText43, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, ADJUSTFORXDPI(5)); wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer2->Add(itemBoxSizer44, 0, wxALIGN_RIGHT|wxALL, 5); + itemBoxSizer2->Add(itemBoxSizer44, 0, wxALIGN_RIGHT|wxALL, ADJUSTFORXDPI(5)); wxButton* itemButton44 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer44->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer44->Add(itemButton44, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); m_btnClear = new wxButton( this, ID_SGPREFERENCESCLEAR, _("Clear"), wxDefaultPosition, wxDefaultSize, 0 ); m_btnClear->SetToolTip( _("Clear all local preferences listed above and close the dialog") ); - itemBoxSizer44->Add(m_btnClear, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer44->Add(m_btnClear, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); wxButton* itemButton45 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemBoxSizer44->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer44->Add(itemButton45, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); #ifndef __WXMSW__ @@ -445,7 +445,7 @@ void CPanelPreferences::CreateControls() #else wxContextHelpButton* itemButton46 = new wxContextHelpButton(this); #endif - itemBoxSizer44->Add(itemButton46, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer44->Add(itemButton46, 0, wxALIGN_CENTER_VERTICAL|wxALL, ADJUSTFORXDPI(5)); #endif // Set validators diff --git a/clientgui/sg_PanelBase.h b/clientgui/sg_PanelBase.h index c5087eacf1..db1ae6bf57 100644 --- a/clientgui/sg_PanelBase.h +++ b/clientgui/sg_PanelBase.h @@ -20,6 +20,7 @@ #include "sg_CustomControls.h" #include "sg_BoincSimpleFrame.h" +#include "MainDocument.h" /////////////////////////////////////////////////////////////////////////// @@ -34,7 +35,7 @@ #define LARGE_FONT 16 #endif -#define SIDEMARGINS 30 +#define SIDEMARGINS ADJUSTFORXDPI(30) /////////////////////////////////////////////////////////////////////////////// diff --git a/clientgui/sg_ProjectPanel.cpp b/clientgui/sg_ProjectPanel.cpp index 581c05d76c..51b3cb0995 100644 --- a/clientgui/sg_ProjectPanel.cpp +++ b/clientgui/sg_ProjectPanel.cpp @@ -55,8 +55,6 @@ static wxString tempArray[] = {_T("String1"), _T("String2"), _T("String3"), _T(" static wxBitmap bmArray[3]; #endif -#define SIDEMARGINS 30 - CSimpleProjectPanel::CSimpleProjectPanel() { } @@ -87,10 +85,10 @@ CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) : wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); - bSizer1->AddSpacer(5); + bSizer1->AddSpacer(ADJUSTFORYDPI(5)); m_myProjectsLabel = new CTransparentStaticText( this, wxID_ANY, _("Projects:"), wxDefaultPosition, wxDefaultSize, 0 ); m_myProjectsLabel->Wrap( -1 ); - bSizer2->Add( m_myProjectsLabel, 0, wxRIGHT, 5 ); + bSizer2->Add( m_myProjectsLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) ); bSizer2->AddStretchSpacer(); int addProjectWidth, synchronizeWidth, y; @@ -102,10 +100,10 @@ CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) : ); bSizer2->Add( m_TaskAddProjectButton, 0, wxRIGHT | wxEXPAND | wxALIGN_RIGHT, SIDEMARGINS ); - bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, 10 ); + bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, ADJUSTFORXDPI(10) ); #ifndef __WXMAC__ - bSizer1->AddSpacer(5); + bSizer1->AddSpacer(ADJUSTFORYDPI(5)); #endif #if TESTBIGICONPOPUP @@ -128,7 +126,7 @@ CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) : bSizer1->Add( m_ProjectSelectionCtrl, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); #ifndef __WXMAC__ - bSizer1->AddSpacer(8); + bSizer1->AddSpacer(ADJUSTFORYDPI(8)); #endif // Make sure m_TotalCreditValue string is large enough @@ -139,7 +137,7 @@ CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) : bSizer1->Add( m_TotalCreditValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(5); + bSizer1->AddSpacer(ADJUSTFORYDPI(5)); wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxHORIZONTAL ); @@ -153,7 +151,7 @@ CSimpleProjectPanel::CSimpleProjectPanel( wxWindow* parent ) : bSizer1->Add( bSizer3, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(10); + bSizer1->AddSpacer(ADJUSTFORYDPI(10)); this->SetSizer( bSizer1 ); this->Layout(); @@ -532,11 +530,29 @@ wxBitmap* CSimpleProjectPanel::GetProjectSpecificBitmap(char* project_url) { // Only update it if project specific is found if(boinc_resolve_filename(GetProjectIconLoc(project_url).c_str(), defaultIcnPath, sizeof(defaultIcnPath)) == 0) { - wxBitmap* projectBM = new wxBitmap(); + wxBitmap* projectBM; wxString strIconPath = wxString(defaultIcnPath,wxConvUTF8); if (wxFile::Exists(strIconPath)) { - if ( projectBM->LoadFile(strIconPath, wxBITMAP_TYPE_ANY) ) { - return projectBM; +#ifdef __WXMSW__ + if ((GetXDPIScaling() > 1.05) || (GetYDPIScaling() > 1.05)) { + wxImage img = wxImage(strIconPath, wxBITMAP_TYPE_ANY); + if (img.IsOk()) { + img.Rescale((int) (img.GetWidth()*GetXDPIScaling()), + (int) (img.GetHeight()*GetYDPIScaling()), + wxIMAGE_QUALITY_BILINEAR + ); + projectBM = new wxBitmap(img); + if (projectBM->IsOk()) { + return projectBM; + } + } + } else +#endif + { + projectBM = new wxBitmap(); + if ( projectBM->LoadFile(strIconPath, wxBITMAP_TYPE_ANY) ) { + return projectBM; + } } } } diff --git a/clientgui/sg_TaskPanel.cpp b/clientgui/sg_TaskPanel.cpp index 98b931abc7..7f288febdf 100644 --- a/clientgui/sg_TaskPanel.cpp +++ b/clientgui/sg_TaskPanel.cpp @@ -28,8 +28,8 @@ #define SORTTASKLIST 1 /* TRUE to sort task selection control alphabetically */ -#define SLIDESHOWWIDTH 290 -#define SLIDESHOWHEIGHT 126 +#define SLIDESHOWWIDTH ADJUSTFORXDPI(290) +#define SLIDESHOWHEIGHT ADJUSTFORYDPI(126) #define SLIDESHOWBORDER 1 #define HIDEDEFAULTSLIDE 1 #define TESTALLDESCRIPTIONS 0 @@ -355,19 +355,21 @@ numSlides = 0; ratio = 1.0; xRatio = (double)SLIDESHOWWIDTH / (double)m_SlideBitmap.GetWidth(); yRatio = (double)SLIDESHOWHEIGHT / (double)m_SlideBitmap.GetHeight(); - if ( xRatio < ratio ) { - ratio = xRatio; - } + ratio = xRatio; if ( yRatio < ratio ) { ratio = yRatio; } - if ( ratio < 1.0 ) { + if ( (ratio < 0.95) || (ratio > 1.05) ) { wxImage img = m_SlideBitmap.ConvertToImage(); - img.Rescale((int) (m_SlideBitmap.GetWidth()*ratio), (int) (m_SlideBitmap.GetHeight()*ratio)); + img.Rescale((int) (m_SlideBitmap.GetWidth()*ratio), + (int) (m_SlideBitmap.GetHeight()*ratio), + (ratio > 1.0) ? wxIMAGE_QUALITY_BILINEAR : wxIMAGE_QUALITY_BOX_AVERAGE + ); wxBitmap *bm = new wxBitmap(img); m_SlideBitmap = *bm; delete bm; } + Refresh(); } } @@ -408,10 +410,10 @@ numSlides = 0; if(m_SlideBitmap.Ok()) { - dc.DrawBitmap(m_SlideBitmap, - (w - m_SlideBitmap.GetWidth())/2, - (h - m_SlideBitmap.GetHeight())/2 - ); + dc.DrawBitmap(m_SlideBitmap, + (w - m_SlideBitmap.GetWidth())/2, + (h - m_SlideBitmap.GetHeight())/2 + ); } } @@ -477,7 +479,7 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : m_myTasksLabel = new CTransparentStaticText( this, wxID_ANY, _("Tasks:"), wxDefaultPosition, wxDefaultSize, 0 ); m_myTasksLabel->Wrap( -1 ); - bSizer2->Add( m_myTasksLabel, 0, wxRIGHT, 5 ); + bSizer2->Add( m_myTasksLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) ); m_TaskSelectionCtrl = new CBOINCBitmapComboBox( this, ID_SGTASKSELECTOR, wxT(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); // TODO: Might want better wording for Task Selection Combo Box tooltip @@ -485,16 +487,16 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : m_TaskSelectionCtrl->SetToolTip(str); bSizer2->Add( m_TaskSelectionCtrl, 1, wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, 10 ); + bSizer1->Add( bSizer2, 0, wxEXPAND | wxTOP | wxLEFT, ADJUSTFORXDPI(10) ); - bSizer1->AddSpacer(5); + bSizer1->AddSpacer(ADJUSTFORYDPI(5)); wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxHORIZONTAL ); m_TaskProjectLabel = new CTransparentStaticText( this, wxID_ANY, _("From:"), wxDefaultPosition, wxDefaultSize, 0 ); m_TaskProjectLabel->Wrap( -1 ); - bSizer3->Add( m_TaskProjectLabel, 0, wxRIGHT, 5 ); + bSizer3->Add( m_TaskProjectLabel, 0, wxRIGHT, ADJUSTFORXDPI(5) ); m_TaskProjectName = new CTransparentStaticText( this, wxID_ANY, wxT("SETI@home"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE ); m_TaskProjectName->Wrap( -1 ); @@ -512,7 +514,7 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : bSizer1->Add( m_TaskApplicationName, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); #endif // SELECTBYRESULTNAME - bSizer1->AddSpacer(10); + bSizer1->AddSpacer(ADJUSTFORYDPI(10)); m_SlideShowArea = new CSlideShowPanel(this); m_SlideShowArea->SetMinSize(wxSize(SLIDESHOWWIDTH+(2*SLIDESHOWBORDER), SLIDESHOWHEIGHT+(2*SLIDESHOWBORDER))); @@ -520,19 +522,19 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : bSizer1->Add( m_SlideShowArea, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(10); + bSizer1->AddSpacer(ADJUSTFORYDPI(10)); m_ElapsedTimeValue = new CTransparentStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE ); m_ElapsedTimeValue->Wrap( -1 ); bSizer1->Add( m_ElapsedTimeValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(7); + bSizer1->AddSpacer(ADJUSTFORYDPI(7)); m_TimeRemainingValue = new CTransparentStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE ); m_TimeRemainingValue->Wrap( -1 ); bSizer1->Add( m_TimeRemainingValue, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(7); + bSizer1->AddSpacer(ADJUSTFORYDPI(7)); wxBoxSizer* bSizer4; bSizer4 = new wxBoxSizer( wxHORIZONTAL ); @@ -545,9 +547,9 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : m_ipctDoneX1000 = 100000; m_ProgressBar->SetValue( 100 ); GetTextExtent(wxT("0"), &w, &h); - m_ProgressBar->SetMinSize(wxSize(245, h)); + m_ProgressBar->SetMinSize(wxSize(ADJUSTFORXDPI(245), h)); m_ProgressBar->SetToolTip(_("This task's progress")); - bSizer4->Add( m_ProgressBar, 0, wxRIGHT, 5 ); + bSizer4->Add( m_ProgressBar, 0, wxRIGHT, ADJUSTFORXDPI(5) ); m_ProgressValueText = new CTransparentStaticText( this, wxID_ANY, wxT("100.000%"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT | wxST_NO_AUTORESIZE ); m_ProgressValueText->Wrap( -1 ); @@ -555,20 +557,20 @@ CSimpleTaskPanel::CSimpleTaskPanel( wxWindow* parent ) : bSizer1->Add( bSizer4, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(7); + bSizer1->AddSpacer(ADJUSTFORYDPI(7)); // TODO: Can we determine the longest status string and initialize with it? m_StatusValueText = new CTransparentStaticText( this, wxID_ANY, m_sNoProjectsString, wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE ); m_StatusValueText->Wrap( -1 ); bSizer1->Add( m_StatusValueText, 0, wxLEFT | wxRIGHT | wxEXPAND, SIDEMARGINS ); - bSizer1->AddSpacer(7); + bSizer1->AddSpacer(ADJUSTFORYDPI(7)); m_TaskCommandsButton = new CSimpleTaskPopupButton( this, ID_TASKSCOMMANDBUTTON, _("Task Commands"), wxDefaultPosition, wxDefaultSize, 0 ); m_TaskCommandsButton->SetToolTip(_("Pop up a menu of commands to apply to this task")); bSizer1->Add( m_TaskCommandsButton, 0, wxLEFT | wxRIGHT | wxEXPAND | wxALIGN_CENTER_HORIZONTAL, SIDEMARGINS ); - bSizer1->AddSpacer(10); + bSizer1->AddSpacer(ADJUSTFORYDPI(10)); this->SetSizer( bSizer1 ); this->Layout(); diff --git a/clientgui/stdwx.h b/clientgui/stdwx.h index 82eee92285..2c0bb5a04a 100644 --- a/clientgui/stdwx.h +++ b/clientgui/stdwx.h @@ -122,6 +122,7 @@ #include #include #include +#include #ifdef _WIN32 diff --git a/configure.ac b/configure.ac index 50a301e0f8..f6a4814f87 100644 --- a/configure.ac +++ b/configure.ac @@ -115,18 +115,6 @@ AC_ARG_ENABLE(install-headers, [enable_install_headers=${enableval}], [enable_install_headers=yes]) -AC_ARG_ENABLE(xss, - AS_HELP_STRING([--disable-xss], - [disable building the boinc client with the Xss library]), - [enable_xss=${enableval}], - [ - if test $isWIN32 != "yes" ; then - enable_xss=yes - else - enable_xss=no - fi - ]) - AC_ARG_ENABLE(boinczip, AS_HELP_STRING([--enable-boinczip], [enable building the boinc zip library]), @@ -624,15 +612,6 @@ fi AM_CONDITIONAL(BUILD_GRAPHICS_API, [ test "$have_glut" = yes -a "$have_jpeg" = 1]) -dnl check for X screen saver lib -if test "$enable_xss" == yes; then - AC_CHECK_LIB([Xss], [XScreenSaverAllocInfo], [have_Xss="yes"], [have_Xss="no"]) - AC_CHECK_HEADER([X11/extensions/scrnsaver.h], [have_Xss="yes"], [have_Xss="no"]) - if test "$have_Xss" == no; then - AC_MSG_WARN([libxss missing, disabling X ScreenSaver user idle detection]) - fi -fi - dnl -------------------------------------------------------------------------------- dnl put double-inclusion protection into config.h AH_TOP([ @@ -1029,16 +1008,14 @@ fi dnl ---------- libNotify -------------------------------------------------- if test "${enable_manager}" = yes ; then - pkg_config_args=libnotify - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - - LIBNOTIFY_CFLAGS=`$PKG_CONFIG libnotify --cflags` - LIBNOTIFY_LIBS=`$PKG_CONFIG libnotify --libs` - - AC_SUBST(LIBNOTIFY_CFLAGS) - AC_SUBST(LIBNOTIFY_LIBS) + PKG_CHECK_MODULES(LIBNOTIFY, [libnotify]) fi - + +dnl ---------- GTK2 ------------------------------------------------------- +if test "${enable_manager}" = yes ; then + PKG_CHECK_MODULES(GTK, [gtk+-2.0]) +fi + dnl ---------- Sqlite3 ---------------------------------------------------- if test "${enable_manager}" = yes ; then AM_PATH_SQLITE3 @@ -1204,19 +1181,6 @@ if test "${ac_cv_func_res_init}" != "yes" ; then fi LIBS=$svlibs -if (test "$enable_xss" == yes) && (test "$have_Xss" == yes); then - SAH_CHECK_LIB([Xext],[DPMSQueryExtension],[ - AC_DEFINE([HAVE_DPMS],[1],[Define to 1 if you have xcb-dpms library]) - CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) - SAH_CHECK_LIB([Xss],[XScreenSaverAllocInfo],[ - AC_DEFINE([HAVE_XSS],[1],[Define to 1 if you have xss library]) - CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) - SAH_CHECK_LIB([X11],[XOpenDisplay],[ - AC_DEFINE([HAVE_X11],[1],[Define to 1 if you have X11 library]) - CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) - echo DEBUG: CLIENTLIBS=${CLIENTLIBS} >&5 -fi - SAH_CHECK_LIB([resolv],[res_query],[ AC_DEFINE([HAVE_RESOLV],[1],[Define to 1 if you have the resolv library]) CLIENTLIBS="${sah_lib_last} ${CLIENTLIBS}"]) @@ -1258,7 +1222,7 @@ AC_ARG_ENABLE(wx-debug, ], [enable_wx_debug="no"]) -CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS} ${GTK_LIBS}" +CLIENTGUILIBS="${WX_LIBS} ${SQLITE3_LIBS}" if test "${enable_client_release}" = "yes" ; then if test "x${WX_LIBS_STATIC}" = "x" ; then diff --git a/doc/versions.inc b/doc/versions.inc index 4c98ab2f1e..1575213f1d 100644 --- a/doc/versions.inc +++ b/doc/versions.inc @@ -259,6 +259,14 @@ $l70ubuntux64 = array( "type"=>"sea", ); +$a74dev = array( + "num"=>"7.4.14", + "status"=>"Development Version", + "file"=>"boinc_7.4.14.apk", + "date"=>"11 Aug 2014", + "type"=>"apk", +); + $a73 = array( "num"=>"7.3.7", "status"=>"Recommended Version", @@ -301,9 +309,9 @@ $mac = array( "dbname" => "x86_64-apple-darwin", "versions"=>array( $m74dev, - $m72, + $m72, $m70, - $m74cdev, + $m74cdev, $m72c, $m70c, ) @@ -358,6 +366,7 @@ $androidarm = array( "description"=>"Android version 2.3 and later
We recommend that, rather than downloading BOINC from here,
you get it from the Google Play Store or the Amazon app store (for Kindle Fire)", "dbname" => "arm-android-linux-gnu", "versions"=>array( + $a74dev, $a73, ) ); @@ -367,6 +376,7 @@ $androidmips = array( "description"=>"Android version 2.3 and later
We recommend that, rather than downloading BOINC from here,
you get it from the Google Play Store or the Amazon app store (for Kindle Fire)", "dbname" => "mips-android-linux-gnu", "versions"=>array( + $a74dev, $a73, ) ); @@ -376,6 +386,7 @@ $androidx86 = array( "description"=>"Android version 2.3 and later
We recommend that, rather than downloading BOINC from here,
you get it from the Google Play Store or the Amazon app store (for Kindle Fire)", "dbname" => "x86-android-linux-gnu", "versions"=>array( + $a74dev, $a73, ) ); diff --git a/html/inc/forum_email.inc b/html/inc/forum_email.inc index 5a6f7a50dc..d1d445f694 100644 --- a/html/inc/forum_email.inc +++ b/html/inc/forum_email.inc @@ -20,8 +20,6 @@ require_once("../inc/util.inc"); require_once("../inc/email.inc"); require_once("../project/project.inc"); -define('MASTER_URL', $master_url); - // send an email to admins: // - project forums: everyone in POST_REPORT_EMAILS // - team message board: team founder and admins @@ -76,7 +74,7 @@ $explanation The content of your post: $post->content -For assistance with ".PROJECT." go to ".MASTER_URL; +For assistance with ".PROJECT." go to ".$master_url; $success = send_email($user, $subject, $body); pm_send($user, $user, $subject, $body, false); @@ -109,7 +107,7 @@ function send_thread_moderation_email( has been $action_name by moderator $moderator->name (ID $moderator->id). $explanation -For assistance with ".PROJECT." go to ".MASTER_URL; +For assistance with ".PROJECT." go to ".$master_url; $subject = "THREAD $action REPORT: $thread->title"; $success = mail_report_list($forum, $subject, $body); @@ -157,7 +155,7 @@ $message Contents of the post: $post->content -For assistance with ".PROJECT." go to ".MASTER_URL; +For assistance with ".PROJECT." go to ".$master_url; $success = mail_report_list($forum, $subject, $body, true); diff --git a/html/inc/text_transform.inc b/html/inc/text_transform.inc index c349148497..8268dfb457 100644 --- a/html/inc/text_transform.inc +++ b/html/inc/text_transform.inc @@ -111,7 +111,9 @@ function replace_pre($text, $export) { return preg_replace_callback( "@\[pre\](.*?)\[/pre\]@is", function ($matches) { - return "
".remove_br(substr($matches[0], 5, -6))."
"; + $x = remove_br(substr($matches[0], 5, -6)); + $x = htmlspecialchars($x); + return "
$x
"; }, $text ); @@ -119,7 +121,9 @@ function replace_pre($text, $export) { return preg_replace_callback( "@\[pre\](.*?)\[/pre\]@is", function ($matches) { - return "
".remove_br(substr($matches[0], 5, -6))."
"; + $x = remove_br(substr($matches[0], 5, -6)); + $x = htmlspecialchars($x); + return "
$x
"; }, $text ); @@ -242,16 +246,24 @@ function remove_br($text){ } // Make links open in new windows. +// function externalize_links($text) { // TODO: Convert this to PCRE - $i=0;$linkpos=true; - while (true){ //Find a link - $linkpos=strpos($text,""; if ($preview == tra("Preview")) { $options = new output_options; + if (is_admin($logged_in_user)) { + $options->htmlitems = false; + } echo "

".tra("Preview")."

\n"; echo "
" .output_transform($content, $options) diff --git a/lib/Makefile.am b/lib/Makefile.am index 31dfe1bf9e..2e096f4760 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -22,7 +22,7 @@ libfcgi_sources = \ coproc.cpp \ filesys.cpp \ hostinfo.cpp \ - md5.c \ + md5.cpp \ md5_file.cpp \ mfile.cpp \ miofile.cpp \ @@ -47,7 +47,7 @@ generic_sources = \ gui_rpc_client_ops.cpp \ gui_rpc_client_print.cpp \ hostinfo.cpp \ - md5.c \ + md5.cpp \ md5_file.cpp \ mem_usage.cpp \ mfile.cpp \ diff --git a/lib/Makefile.mingw b/lib/Makefile.mingw index 6ddf11a51e..0ce05c64bd 100644 --- a/lib/Makefile.mingw +++ b/lib/Makefile.mingw @@ -205,10 +205,6 @@ wrapper.o: $(BOINC_SRC)/samples/wrapper/wrapper.cpp %.o: $(BOINC_SRC)/samples/wrapper/%.c $(CC) -c $< -o $@ $(CPPFLAGS) $(CFLAGS) -# C-mode file -md5.o: $(BOINC_SRC)/lib/md5.c - $(CXX) -c $(BOINC_SRC)/lib/md5.c -o md5.o $(CPPFLAGS) $(CXXFLAGS) - # for boinc_zip. Don't change the order! zip: mkdir -p $@ diff --git a/lib/md5.c b/lib/md5.cpp similarity index 100% rename from lib/md5.c rename to lib/md5.cpp diff --git a/locale/ca/BOINC-Setup.mo b/locale/ca/BOINC-Setup.mo index 85cde9889f..ba86fb529c 100644 Binary files a/locale/ca/BOINC-Setup.mo and b/locale/ca/BOINC-Setup.mo differ diff --git a/locale/da/BOINC-Manager.mo b/locale/da/BOINC-Manager.mo index 82452b88d1..046f62539c 100644 Binary files a/locale/da/BOINC-Manager.mo and b/locale/da/BOINC-Manager.mo differ diff --git a/locale/da/BOINC-Setup.mo b/locale/da/BOINC-Setup.mo index a001ec45b3..49ab73e234 100644 Binary files a/locale/da/BOINC-Setup.mo and b/locale/da/BOINC-Setup.mo differ diff --git a/locale/da/BOINC-Web.mo b/locale/da/BOINC-Web.mo index 62930f59ce..d5dd5408a2 100644 Binary files a/locale/da/BOINC-Web.mo and b/locale/da/BOINC-Web.mo differ diff --git a/locale/it_IT/BOINC-Manager.mo b/locale/it_IT/BOINC-Manager.mo index 65d26f88da..a2e5567f35 100644 Binary files a/locale/it_IT/BOINC-Manager.mo and b/locale/it_IT/BOINC-Manager.mo differ diff --git a/locale/it_IT/BOINC-Setup.mo b/locale/it_IT/BOINC-Setup.mo index c4b2c115da..04ca325622 100644 Binary files a/locale/it_IT/BOINC-Setup.mo and b/locale/it_IT/BOINC-Setup.mo differ diff --git a/locale/it_IT/BOINC-Web.mo b/locale/it_IT/BOINC-Web.mo index 512f70109a..e6dd6644cb 100644 Binary files a/locale/it_IT/BOINC-Web.mo and b/locale/it_IT/BOINC-Web.mo differ diff --git a/locale/ko/BOINC-Manager.mo b/locale/ko/BOINC-Manager.mo index 489ef48ee1..6d47e564cc 100644 Binary files a/locale/ko/BOINC-Manager.mo and b/locale/ko/BOINC-Manager.mo differ diff --git a/locale/ko/BOINC-Web.mo b/locale/ko/BOINC-Web.mo index 351991d7cb..8d4d0f8ba0 100644 Binary files a/locale/ko/BOINC-Web.mo and b/locale/ko/BOINC-Web.mo differ diff --git a/locale/lv/BOINC-Manager.mo b/locale/lv/BOINC-Manager.mo index 9ed9c879c8..a12cc352b3 100644 Binary files a/locale/lv/BOINC-Manager.mo and b/locale/lv/BOINC-Manager.mo differ diff --git a/locale/ms/BOINC-Client.mo b/locale/ms/BOINC-Client.mo new file mode 100644 index 0000000000..00cc48218c Binary files /dev/null and b/locale/ms/BOINC-Client.mo differ diff --git a/locale/ms/BOINC-Manager.mo b/locale/ms/BOINC-Manager.mo new file mode 100644 index 0000000000..c1217e7a55 Binary files /dev/null and b/locale/ms/BOINC-Manager.mo differ diff --git a/locale/ms/BOINC-Setup.mo b/locale/ms/BOINC-Setup.mo new file mode 100644 index 0000000000..6b90fe4719 Binary files /dev/null and b/locale/ms/BOINC-Setup.mo differ diff --git a/locale/ms/BOINC-Web.mo b/locale/ms/BOINC-Web.mo new file mode 100644 index 0000000000..032b02f30a Binary files /dev/null and b/locale/ms/BOINC-Web.mo differ diff --git a/locale/nl/BOINC-Manager.mo b/locale/nl/BOINC-Manager.mo index 9aa35bf7c2..9b8758dd49 100644 Binary files a/locale/nl/BOINC-Manager.mo and b/locale/nl/BOINC-Manager.mo differ diff --git a/locale/nl/BOINC-Setup.mo b/locale/nl/BOINC-Setup.mo index 086dbe7102..5a8905df6d 100644 Binary files a/locale/nl/BOINC-Setup.mo and b/locale/nl/BOINC-Setup.mo differ diff --git a/locale/nl/BOINC-Web.mo b/locale/nl/BOINC-Web.mo index e33c72b3c8..035968dda8 100644 Binary files a/locale/nl/BOINC-Web.mo and b/locale/nl/BOINC-Web.mo differ diff --git a/locale/ru/BOINC-Manager.mo b/locale/ru/BOINC-Manager.mo index e0323996f0..7bece9d664 100644 Binary files a/locale/ru/BOINC-Manager.mo and b/locale/ru/BOINC-Manager.mo differ diff --git a/locale/ru/BOINC-Setup.mo b/locale/ru/BOINC-Setup.mo index c5695a5f3f..139281ef68 100644 Binary files a/locale/ru/BOINC-Setup.mo and b/locale/ru/BOINC-Setup.mo differ diff --git a/locale/ru/BOINC-Web.mo b/locale/ru/BOINC-Web.mo index 68f9eee41a..352a17cdce 100644 Binary files a/locale/ru/BOINC-Web.mo and b/locale/ru/BOINC-Web.mo differ diff --git a/locale/sk/BOINC-Manager.mo b/locale/sk/BOINC-Manager.mo index ae9bfa0938..8836a9de03 100644 Binary files a/locale/sk/BOINC-Manager.mo and b/locale/sk/BOINC-Manager.mo differ diff --git a/locale/sk/BOINC-Setup.mo b/locale/sk/BOINC-Setup.mo index 6a8a58235c..267a4f8eb7 100644 Binary files a/locale/sk/BOINC-Setup.mo and b/locale/sk/BOINC-Setup.mo differ diff --git a/locale/sk/BOINC-Web.mo b/locale/sk/BOINC-Web.mo index 7dee1459e7..1d5e04409f 100644 Binary files a/locale/sk/BOINC-Web.mo and b/locale/sk/BOINC-Web.mo differ diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index 16ff8ca99d..dced027280 100755 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -111,7 +111,7 @@ DD3E14F70A774397007E0084 /* hostinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BB607C5AEEE0043025C /* hostinfo.cpp */; }; DD3E14FD0A774397007E0084 /* Mac_GUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DDA9D3BB09189A8C0060E7A7 /* Mac_GUI.cpp */; }; DD3E14FE0A774397007E0084 /* MainDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD81C41607C5D13E0098A04D /* MainDocument.cpp */; }; - DD3E14FF0A774397007E0084 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DD3E14FF0A774397007E0084 /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DD3E15000A774397007E0084 /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DD3E15010A774397007E0084 /* mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD207C5B1150043025C /* mfile.cpp */; }; DD3E15020A774397007E0084 /* miofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD507C5B1150043025C /* miofile.cpp */; }; @@ -151,7 +151,7 @@ DD407A5307D2FB7C00163EF5 /* diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BA207C5AE5A0043025C /* diagnostics.cpp */; }; DD407A5507D2FB8400163EF5 /* filesys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5EAD475031AEFF8018E201A /* filesys.cpp */; }; DD407A5807D2FB8D00163EF5 /* hostinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BB607C5AEEE0043025C /* hostinfo.cpp */; }; - DD407A5B07D2FBA000163EF5 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DD407A5B07D2FBA000163EF5 /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DD407A5D07D2FBA300163EF5 /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DD407A5F07D2FBAE00163EF5 /* mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD207C5B1150043025C /* mfile.cpp */; }; DD407A6207D2FBB300163EF5 /* miofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD507C5B1150043025C /* miofile.cpp */; }; @@ -295,7 +295,7 @@ DD8917A50F3B207E00DE5B1C /* filesys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5EAD475031AEFF8018E201A /* filesys.cpp */; }; DD8917A70F3B208500DE5B1C /* gui_rpc_client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD81C5CC07C5D7D90098A04D /* gui_rpc_client.cpp */; }; DD8917AB0F3B209500DE5B1C /* hostinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BB607C5AEEE0043025C /* hostinfo.cpp */; }; - DD8917AE0F3B20B100DE5B1C /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DD8917AE0F3B20B100DE5B1C /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DD8917B00F3B20B500DE5B1C /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DD8917B80F3B20C600DE5B1C /* mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD207C5B1150043025C /* mfile.cpp */; }; DD8917BA0F3B20CC00DE5B1C /* miofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD507C5B1150043025C /* miofile.cpp */; }; @@ -429,7 +429,7 @@ DDD74DC607CF492C0065AC9D /* diagnostics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BA207C5AE5A0043025C /* diagnostics.cpp */; }; DDD74DC707CF492D0065AC9D /* filesys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5EAD475031AEFF8018E201A /* filesys.cpp */; }; DDD74DC807CF492E0065AC9D /* hostinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BB607C5AEEE0043025C /* hostinfo.cpp */; }; - DDD74DCB07CF49310065AC9D /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DDD74DCB07CF49310065AC9D /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DDD74DCC07CF49320065AC9D /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DDD74DCD07CF49330065AC9D /* mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD207C5B1150043025C /* mfile.cpp */; }; DDD74DCE07CF49390065AC9D /* miofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD507C5B1150043025C /* miofile.cpp */; }; @@ -488,13 +488,13 @@ DDFA61860CB3489E0037B88C /* str_util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD7BF7D70B8E7A9800A009F7 /* str_util.cpp */; }; DDFA61890CB348A90037B88C /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5EAD479031AF001018E201A /* util.cpp */; }; DDFA618C0CB348C50037B88C /* hostinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BB607C5AEEE0043025C /* hostinfo.cpp */; }; - DDFA618F0CB348E80037B88C /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DDFA618F0CB348E80037B88C /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DDFA61900CB348E90037B88C /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DDFA61920CB349020037B88C /* proxy_info.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BEF07C5B1770043025C /* proxy_info.cpp */; }; DDFA61940CB349160037B88C /* prefs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BE407C5B1670043025C /* prefs.cpp */; }; DDFD5F0F0818F2EE002B23D4 /* gui_rpc_client.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD81C5CC07C5D7D90098A04D /* gui_rpc_client.cpp */; }; DDFD5F270818F329002B23D4 /* filesys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5EAD475031AEFF8018E201A /* filesys.cpp */; }; - DDFD5F280818F33C002B23D4 /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.c */; }; + DDFD5F280818F33C002B23D4 /* md5.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159562029EB02001F5651B /* md5.cpp */; }; DDFD5F290818F346002B23D4 /* md5_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F5159564029EB02001F5651B /* md5_file.cpp */; }; DDFD5F2A0818F34F002B23D4 /* mfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD207C5B1150043025C /* mfile.cpp */; }; DDFD5F2B0818F359002B23D4 /* miofile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DD344BD507C5B1150043025C /* miofile.cpp */; }; @@ -1175,7 +1175,7 @@ DDFE854A0B60CFD0009B43D9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = ../../../../../System/Library/Frameworks/AppKit.framework; sourceTree = SOURCE_ROOT; }; DDFF2AD30A53D4AE002BC19D /* setprojectgrp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = setprojectgrp; sourceTree = BUILT_PRODUCTS_DIR; }; DDFF2AE80A53D599002BC19D /* setprojectgrp.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = setprojectgrp.cpp; sourceTree = ""; }; - F5159562029EB02001F5651B /* md5.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = md5.c; path = ../lib/md5.c; sourceTree = SOURCE_ROOT; }; + F5159562029EB02001F5651B /* md5.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = md5.cpp; path = ../lib/md5.cpp; sourceTree = SOURCE_ROOT; }; F5159563029EB02001F5651B /* md5.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = md5.h; path = ../lib/md5.h; sourceTree = SOURCE_ROOT; }; F5159564029EB02001F5651B /* md5_file.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = md5_file.cpp; sourceTree = ""; }; F5159565029EB02001F5651B /* md5_file.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = md5_file.h; path = ../lib/md5_file.h; sourceTree = SOURCE_ROOT; }; @@ -1806,7 +1806,7 @@ DD344BB607C5AEEE0043025C /* hostinfo.cpp */, DD344BB707C5AEEE0043025C /* hostinfo.h */, DDA6BCED0BD4546D008F7921 /* mac */, - F5159562029EB02001F5651B /* md5.c */, + F5159562029EB02001F5651B /* md5.cpp */, F5159563029EB02001F5651B /* md5.h */, F5159564029EB02001F5651B /* md5_file.cpp */, F5159565029EB02001F5651B /* md5_file.h */, @@ -2828,7 +2828,7 @@ DD3E14F70A774397007E0084 /* hostinfo.cpp in Sources */, DD3E14FD0A774397007E0084 /* Mac_GUI.cpp in Sources */, DD3E14FE0A774397007E0084 /* MainDocument.cpp in Sources */, - DD3E14FF0A774397007E0084 /* md5.c in Sources */, + DD3E14FF0A774397007E0084 /* md5.cpp in Sources */, DD3E15000A774397007E0084 /* md5_file.cpp in Sources */, DD3E15010A774397007E0084 /* mfile.cpp in Sources */, DD3E15020A774397007E0084 /* miofile.cpp in Sources */, @@ -2927,7 +2927,7 @@ DD52C81208B5D44E008D9AA4 /* gui_rpc_client_ops.cpp in Sources */, DD52C81308B5D44F008D9AA4 /* gui_rpc_client_print.cpp in Sources */, DD407A5807D2FB8D00163EF5 /* hostinfo.cpp in Sources */, - DD407A5B07D2FBA000163EF5 /* md5.c in Sources */, + DD407A5B07D2FBA000163EF5 /* md5.cpp in Sources */, DD407A5D07D2FBA300163EF5 /* md5_file.cpp in Sources */, DD407ABB07D2FC7D00163EF5 /* mem_usage.cpp in Sources */, DD407A5F07D2FBAE00163EF5 /* mfile.cpp in Sources */, @@ -3075,7 +3075,7 @@ DD8917A50F3B207E00DE5B1C /* filesys.cpp in Sources */, DD8917A70F3B208500DE5B1C /* gui_rpc_client.cpp in Sources */, DD8917AB0F3B209500DE5B1C /* hostinfo.cpp in Sources */, - DD8917AE0F3B20B100DE5B1C /* md5.c in Sources */, + DD8917AE0F3B20B100DE5B1C /* md5.cpp in Sources */, DD8917B00F3B20B500DE5B1C /* md5_file.cpp in Sources */, DD8917B80F3B20C600DE5B1C /* mfile.cpp in Sources */, DD8917BA0F3B20CC00DE5B1C /* miofile.cpp in Sources */, @@ -3115,7 +3115,7 @@ DD73E3B608A07FC600656EB1 /* gui_rpc_client_ops.cpp in Sources */, DDFD5F270818F329002B23D4 /* filesys.cpp in Sources */, DD73E3A708A07CA600656EB1 /* hostinfo.cpp in Sources */, - DDFD5F280818F33C002B23D4 /* md5.c in Sources */, + DDFD5F280818F33C002B23D4 /* md5.cpp in Sources */, DDFD5F290818F346002B23D4 /* md5_file.cpp in Sources */, DDFD5F2A0818F34F002B23D4 /* mfile.cpp in Sources */, DDFD5F2B0818F359002B23D4 /* miofile.cpp in Sources */, @@ -3240,7 +3240,7 @@ DD73E36E08A0720500656EB1 /* gui_rpc_server_ops.cpp in Sources */, DDD74DC807CF492E0065AC9D /* hostinfo.cpp in Sources */, DD33C70408B5BEDE00768630 /* http_curl.cpp in Sources */, - DDD74DCB07CF49310065AC9D /* md5.c in Sources */, + DDD74DCB07CF49310065AC9D /* md5.cpp in Sources */, DDD74DCC07CF49320065AC9D /* md5_file.cpp in Sources */, DDD74DCD07CF49330065AC9D /* mfile.cpp in Sources */, DDD74DCE07CF49390065AC9D /* miofile.cpp in Sources */, @@ -3315,7 +3315,7 @@ DDFA61860CB3489E0037B88C /* str_util.cpp in Sources */, DDFA61890CB348A90037B88C /* util.cpp in Sources */, DDFA618C0CB348C50037B88C /* hostinfo.cpp in Sources */, - DDFA618F0CB348E80037B88C /* md5.c in Sources */, + DDFA618F0CB348E80037B88C /* md5.cpp in Sources */, DDFA61900CB348E90037B88C /* md5_file.cpp in Sources */, DDFA61920CB349020037B88C /* proxy_info.cpp in Sources */, DDFA61940CB349160037B88C /* prefs.cpp in Sources */, diff --git a/py/Boinc/tools.py b/py/Boinc/tools.py index fa06c1d5ec..3600e245c9 100644 --- a/py/Boinc/tools.py +++ b/py/Boinc/tools.py @@ -35,14 +35,14 @@ def make_uuid(): def md5_file(path): """ Return a 16-digit MD5 hex digest of a file's contents - Read the file in chunks + Read the file in chunks """ chunk = 8096 try: checksum = md5() - except NameError: + except TypeError: checksum = md5.new() fp = open(path, 'r') @@ -78,6 +78,9 @@ def get_output_file_path(filename): """ config = configxml.default_config() fanout = long(config.config.uldl_dir_fanout) - s = md5.new(filename).hexdigest()[1:8] + try: + s = md5(filename).hexdigest()[1:8] + except TypeError: + s = md5.new(filename).hexdigest()[1:8] x = long(s, 16) - return "%s/%x/%s" % (config.config.upload_dir, x % fanout, filename) + return "%s/%x/%s" % (config.config.upload_dir, x % fanout, filename) diff --git a/win_build/boinc_os_ss.vcxproj b/win_build/boinc_os_ss.vcxproj index 7531d3900f..3060b886e3 100644 --- a/win_build/boinc_os_ss.vcxproj +++ b/win_build/boinc_os_ss.vcxproj @@ -363,7 +363,7 @@ - + diff --git a/win_build/boincmgr.vcxproj b/win_build/boincmgr.vcxproj index 101e39014e..5457be75c7 100644 --- a/win_build/boincmgr.vcxproj +++ b/win_build/boincmgr.vcxproj @@ -321,10 +321,7 @@ - - CompileAsCpp - CompileAsCpp - + diff --git a/win_build/installerv2/BOINC.ism b/win_build/installerv2/BOINC.ism index 25b3d23328..ea75ba3ac0 100644 --- a/win_build/installerv2/BOINC.ism +++ b/win_build/installerv2/BOINC.ism @@ -924,6 +924,7 @@ Target ExtendedType ISComments + CAAnnounceUpgrade1NewBinary6AnnounceUpgrade CACleanupOldBinaries1NewBinary6CleanupOldBinaries CACreateAcctMgrLoginFile1NewBinary6CreateAcctMgrLoginFile CACreateBOINCAccounts1NewBinary6CreateBOINCAccounts @@ -4051,6 +4052,7 @@ Click Advanced to customize.01427879980 AllocateRegistrySpaceNOT Installed1563AllocateRegistrySpace AppSearch400AppSearch BindImage4300BindImage + CAAnnounceUpgradeVersionNT And REMOVE <> "ALL"1001 CACleanupOldBinariesREMOVE <> "ALL"796 CACreateAcctMgrLoginFileNOT Installed6605 CACreateBOINCAccountsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11546 @@ -4069,7 +4071,7 @@ Click Advanced to customize.01427879980 CAGrantBOINCProjectsVirtualBoxRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11561 CAGrantBOINCUsersRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11557 CARestorePermissionBOINCDataVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 16611 - CARestoreSetupStateVersionNT And REMOVE = "ALL"1001 + CARestoreSetupStateVersionNT And REMOVE = "ALL"1002 CARevokeBOINCAdminsRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11555 CARevokeBOINCMasterRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11548 CARevokeBOINCProjectRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11551 @@ -4542,6 +4544,7 @@ VwBlAGIAAQBXAEUAQgB4ADgANgA= IS_PROGMSG_XML_UPDATE_FILE##IDS_PROGMSG_XML_UPDATE_FILE## InstallChoiceAR LAUNCHPROGRAM1 + MSIRESTARTMANAGERCONTROLDisable Manufacturer##COMPANY_NAME## MsiHiddenPropertiesBOINC_MASTER_PASSWORD;BOINC_PROJECT_PASSWORD MsiLoggingvoicewarmup diff --git a/win_build/installerv2/BOINC_vbox.ism b/win_build/installerv2/BOINC_vbox.ism index 1e441c2e19..c8598d52d1 100644 --- a/win_build/installerv2/BOINC_vbox.ism +++ b/win_build/installerv2/BOINC_vbox.ism @@ -924,6 +924,7 @@ Target ExtendedType ISComments + CAAnnounceUpgrade1NewBinary6AnnounceUpgrade CACleanupOldBinaries1NewBinary6CleanupOldBinaries CACreateAcctMgrLoginFile1NewBinary6CreateAcctMgrLoginFile CACreateBOINCAccounts1NewBinary6CreateBOINCAccounts @@ -4052,6 +4053,7 @@ Click Advanced to customize.01427879980 AllocateRegistrySpaceNOT Installed1562AllocateRegistrySpace AppSearch400AppSearch BindImage4300BindImage + CAAnnounceUpgradeVersionNT And REMOVE <> "ALL"1001 CACleanupOldBinariesREMOVE <> "ALL"796 CACreateAcctMgrLoginFileNOT Installed6605 CACreateBOINCAccountsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11546 @@ -4070,7 +4072,7 @@ Click Advanced to customize.01427879980 CAGrantBOINCProjectsVirtualBoxRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11560 CAGrantBOINCUsersRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11556 CARestorePermissionBOINCDataVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 16611 - CARestoreSetupStateVersionNT And REMOVE = "ALL"1001 + CARestoreSetupStateVersionNT And REMOVE = "ALL"1002 CARevokeBOINCAdminsRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11554 CARevokeBOINCMasterRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11548 CARevokeBOINCProjectRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11550 @@ -4543,6 +4545,7 @@ VwBlAGIAAQBXAEUAQgB4ADgANgA= IS_PROGMSG_XML_UPDATE_FILE##IDS_PROGMSG_XML_UPDATE_FILE## InstallChoiceAR LAUNCHPROGRAM1 + MSIRESTARTMANAGERCONTROLDisable Manufacturer##COMPANY_NAME## MsiHiddenPropertiesBOINC_MASTER_PASSWORD;BOINC_PROJECT_PASSWORD MsiLoggingvoicewarmup diff --git a/win_build/installerv2/BOINCx64.ism b/win_build/installerv2/BOINCx64.ism index 1a65e27b78..ba952e5731 100644 --- a/win_build/installerv2/BOINCx64.ism +++ b/win_build/installerv2/BOINCx64.ism @@ -924,6 +924,7 @@ Target ExtendedType ISComments + CAAnnounceUpgrade1NewBinary6AnnounceUpgrade CACleanupOldBinaries1NewBinary6CleanupOldBinaries CACreateAcctMgrLoginFile1NewBinary6CreateAcctMgrLoginFile CACreateBOINCAccounts1NewBinary6CreateBOINCAccounts @@ -4050,6 +4051,7 @@ Click Advanced to customize.01427879980 AllocateRegistrySpaceNOT Installed1562AllocateRegistrySpace AppSearch400AppSearch BindImage4300BindImage + CAAnnounceUpgradeVersionNT And REMOVE <> "ALL"1001 CACleanupOldBinariesREMOVE <> "ALL"796 CACreateAcctMgrLoginFileNOT Installed6605 CACreateBOINCAccountsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11546 @@ -4068,7 +4070,7 @@ Click Advanced to customize.01427879980 CAGrantBOINCProjectsVirtualBoxRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11560 CAGrantBOINCUsersRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11556 CARestorePermissionBOINCDataVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 16612 - CARestoreSetupStateVersionNT And REMOVE = "ALL"1001 + CARestoreSetupStateVersionNT And REMOVE = "ALL"1002 CARevokeBOINCAdminsRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11554 CARevokeBOINCMasterRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11548 CARevokeBOINCProjectRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11550 @@ -4541,6 +4543,7 @@ VwBlAGIAAQBXAEUAQgB4ADYANAA= IS_PROGMSG_XML_UPDATE_FILE##IDS_PROGMSG_XML_UPDATE_FILE## InstallChoiceAR LAUNCHPROGRAM1 + MSIRESTARTMANAGERCONTROLDisable Manufacturer##COMPANY_NAME## MsiHiddenPropertiesBOINC_MASTER_PASSWORD;BOINC_PROJECT_PASSWORD MsiLoggingvoicewarmup diff --git a/win_build/installerv2/BOINCx64_vbox.ism b/win_build/installerv2/BOINCx64_vbox.ism index f8ad5740e8..421fb81f17 100644 --- a/win_build/installerv2/BOINCx64_vbox.ism +++ b/win_build/installerv2/BOINCx64_vbox.ism @@ -924,6 +924,7 @@ Target ExtendedType ISComments + CAAnnounceUpgrade1NewBinary6AnnounceUpgrade CACleanupOldBinaries1NewBinary6CleanupOldBinaries CACreateAcctMgrLoginFile1NewBinary6CreateAcctMgrLoginFile CACreateBOINCAccounts1NewBinary6CreateBOINCAccounts @@ -4051,6 +4052,7 @@ Click Advanced to customize.01427879980 AllocateRegistrySpaceNOT Installed1562AllocateRegistrySpace AppSearch400AppSearch BindImage4300BindImage + CAAnnounceUpgradeVersionNT And REMOVE <> "ALL"1001 CACleanupOldBinariesREMOVE <> "ALL"796 CACreateAcctMgrLoginFileNOT Installed6605 CACreateBOINCAccountsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11546 @@ -4069,7 +4071,7 @@ Click Advanced to customize.01427879980 CAGrantBOINCProjectsVirtualBoxRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11560 CAGrantBOINCUsersRightsVersionNT And REMOVE <> "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11556 CARestorePermissionBOINCDataVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 16612 - CARestoreSetupStateVersionNT And REMOVE = "ALL"1001 + CARestoreSetupStateVersionNT And REMOVE = "ALL"1002 CARevokeBOINCAdminsRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11554 CARevokeBOINCMasterRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11548 CARevokeBOINCProjectRightsVersionNT And REMOVE = "ALL" AND ENABLEPROTECTEDAPPLICATIONEXECUTION3 = 11550 @@ -4542,6 +4544,7 @@ VwBlAGIAAQBXAEUAQgB4ADYANAA= IS_PROGMSG_XML_UPDATE_FILE##IDS_PROGMSG_XML_UPDATE_FILE## InstallChoiceAR LAUNCHPROGRAM1 + MSIRESTARTMANAGERCONTROLDisable Manufacturer##COMPANY_NAME## MsiHiddenPropertiesBOINC_MASTER_PASSWORD;BOINC_PROJECT_PASSWORD MsiLoggingvoicewarmup diff --git a/win_build/installerv2/redist/Windows/Win32/boinccas.dll b/win_build/installerv2/redist/Windows/Win32/boinccas.dll index 22e2e208e6..d5e9e2a0ba 100644 Binary files a/win_build/installerv2/redist/Windows/Win32/boinccas.dll and b/win_build/installerv2/redist/Windows/Win32/boinccas.dll differ diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.cpp new file mode 100644 index 0000000000..044c027375 --- /dev/null +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.cpp @@ -0,0 +1,84 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +#include "stdafx.h" +#include "boinccas.h" +#include "CAAnnounceUpgrade.h" + +#define CUSTOMACTION_NAME _T("CAAnnounceUpgrade") +#define CUSTOMACTION_PROGRESSTITLE _T("Announce the new BOINC version to all components.") + + +///////////////////////////////////////////////////////////////////// +// +// Function: +// +// Description: +// +///////////////////////////////////////////////////////////////////// +CAAnnounceUpgrade::CAAnnounceUpgrade(MSIHANDLE hMSIHandle) : + BOINCCABase(hMSIHandle, CUSTOMACTION_NAME, CUSTOMACTION_PROGRESSTITLE) +{} + + +///////////////////////////////////////////////////////////////////// +// +// Function: +// +// Description: +// +///////////////////////////////////////////////////////////////////// +CAAnnounceUpgrade::~CAAnnounceUpgrade() +{ + BOINCCABase::~BOINCCABase(); +} + + +///////////////////////////////////////////////////////////////////// +// +// Function: +// +// Description: +// +///////////////////////////////////////////////////////////////////// +UINT CAAnnounceUpgrade::OnExecution() +{ + return SetUpgradeParameters(); +} + + +///////////////////////////////////////////////////////////////////// +// +// Function: AnnounceUpgrade +// +// Description: +// +///////////////////////////////////////////////////////////////////// +UINT __stdcall AnnounceUpgrade(MSIHANDLE hInstall) +{ + UINT uiReturnValue = 0; + + CAAnnounceUpgrade* pCA = new CAAnnounceUpgrade(hInstall); + uiReturnValue = pCA->Execute(); + delete pCA; + + return uiReturnValue; +} + diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.h b/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.h new file mode 100644 index 0000000000..6eac233add --- /dev/null +++ b/win_build/installerv2/redist/Windows/src/boinccas/CAAnnounceUpgrade.h @@ -0,0 +1,36 @@ +// Berkeley Open Infrastructure for Network Computing +// http://boinc.berkeley.edu +// Copyright (C) 2005 University of California +// +// This is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; +// either version 2.1 of the License, or (at your option) any later version. +// +// This software is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// To view the GNU Lesser General Public License visit +// http://www.gnu.org/copyleft/lesser.html +// or write to the Free Software Foundation, Inc., +// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +// + +#ifndef _CAANNOUNCEUPGRADE_H_ +#define _CAANNOUNCEUPGRADE_H_ + + +class CAAnnounceUpgrade : public BOINCCABase +{ +public: + + CAAnnounceUpgrade(MSIHANDLE hMSIHandle); + ~CAAnnounceUpgrade(); + virtual UINT OnExecution(); +}; + + +#endif + diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCAccounts.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCAccounts.cpp index b2daa50739..0a07fcd30a 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCAccounts.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCAccounts.cpp @@ -75,6 +75,20 @@ UINT CADeleteBOINCAccounts::OnExecution() if ( uiReturnValue ) return uiReturnValue; + if (IsUpgrading()) + { + LogMessage( + INSTALLMESSAGE_INFO, + NULL, + NULL, + NULL, + NULL, + _T("Upgrade detected, no need to delete accounts") + ); + return ERROR_SUCCESS; + } + + // Delete 'boinc_master' account // nasReturnValue = NetUserDel( diff --git a/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCGroups.cpp b/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCGroups.cpp index 97a6c9d361..af651110ef 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCGroups.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/CADeleteBOINCGroups.cpp @@ -64,6 +64,21 @@ UINT CADeleteBOINCGroups::OnExecution() { NET_API_STATUS nasReturnValue; + + if (IsUpgrading()) + { + LogMessage( + INSTALLMESSAGE_INFO, + NULL, + NULL, + NULL, + NULL, + _T("Upgrade detected, no need to delete groups") + ); + return ERROR_SUCCESS; + } + + // Delete the 'boinc_admins' // nasReturnValue = NetLocalGroupDel( diff --git a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.cpp b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.cpp index 3554eda522..4669145abc 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.cpp +++ b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.cpp @@ -126,6 +126,66 @@ UINT BOINCCABase::Execute() } +static BOOL IsVersionNewer(const tstring v1, const tstring v2) { + int v1_maj=0, v1_min=0, v1_rel=0; + int v2_maj=0, v2_min=0, v2_rel=0; + + _stscanf(v1.c_str(), _T("%d.%d.%d"), &v1_maj, &v1_min, &v1_rel); + _stscanf(v2.c_str(), _T("%d.%d.%d"), &v2_maj, &v2_min, &v2_rel); + + if (v1_maj > v2_maj) return TRUE; + if (v1_maj < v2_maj) return FALSE; + if (v1_min > v2_min) return TRUE; + if (v1_min < v2_min) return FALSE; + if (v1_rel > v2_rel) return TRUE; + return FALSE; +} + + +///////////////////////////////////////////////////////////////////// +// +// Function: SetUpgradeParameters +// +// Description: +// +///////////////////////////////////////////////////////////////////// +UINT BOINCCABase::SetUpgradeParameters() +{ + tstring strCurrentProductVersion; + UINT uiReturnValue = 0; + + uiReturnValue = GetProperty( _T("ProductVersion"), strCurrentProductVersion ); + if ( uiReturnValue ) return uiReturnValue; + + uiReturnValue = SetRegistryValue( _T("UpgradingTo"), strCurrentProductVersion ); + if ( uiReturnValue ) return uiReturnValue; + + return ERROR_SUCCESS; +} + +///////////////////////////////////////////////////////////////////// +// +// Function: IsUpgrading +// +// Description: +// +///////////////////////////////////////////////////////////////////// +BOOL BOINCCABase::IsUpgrading() +{ + tstring strCurrentProductVersion; + tstring strRegistryProductVersion; + UINT uiReturnValue = 0; + + uiReturnValue = GetProperty( _T("ProductVersion"), strCurrentProductVersion ); + if ( uiReturnValue ) return FALSE; + + uiReturnValue = GetRegistryValue( _T("UpgradingTo"), strRegistryProductVersion ); + if ( uiReturnValue ) return FALSE; + + return IsVersionNewer(strRegistryProductVersion, strCurrentProductVersion); +} + + ///////////////////////////////////////////////////////////////////// // // Function: OnInitialize diff --git a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.def b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.def index bd3add9e46..541595489a 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.def +++ b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.def @@ -49,3 +49,4 @@ EXPORTS RevokeBOINCUsersRights DeleteBOINCGroups DeleteBOINCAccounts + AnnounceUpgrade \ No newline at end of file diff --git a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.h b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.h index 9462bc87be..af0cc95c0b 100644 --- a/win_build/installerv2/redist/Windows/src/boinccas/boinccas.h +++ b/win_build/installerv2/redist/Windows/src/boinccas/boinccas.h @@ -48,6 +48,9 @@ public: // Called when we are being executed from the InstallUISequence virtual UINT OnExecution(); + // + UINT SetUpgradeParameters(); + BOOL IsUpgrading(); // Registry Property Management UINT GetRegistryValue( diff --git a/win_build/installerv2/redist/Windows/x64/boinccas.dll b/win_build/installerv2/redist/Windows/x64/boinccas.dll index 1e4e16eb45..c43d6a1577 100644 Binary files a/win_build/installerv2/redist/Windows/x64/boinccas.dll and b/win_build/installerv2/redist/Windows/x64/boinccas.dll differ diff --git a/win_build/libboinc.vcxproj b/win_build/libboinc.vcxproj index 1fcbf33bc2..6fd3b4ce34 100644 --- a/win_build/libboinc.vcxproj +++ b/win_build/libboinc.vcxproj @@ -265,7 +265,7 @@ - + diff --git a/win_build/libboinc_staticcrt.vcxproj b/win_build/libboinc_staticcrt.vcxproj index 08bdfe0232..aacb3e7158 100644 --- a/win_build/libboinc_staticcrt.vcxproj +++ b/win_build/libboinc_staticcrt.vcxproj @@ -220,7 +220,7 @@ CompileAsCpp - +