Ticket #61: boincmgr_61.patch

File boincmgr_61.patch, 6.8 KB (added by Der Meister, 17 years ago)

Patch implementing this feature request.

  • ../clientgui/DlgOptions.cpp

     
    8989    m_ReminderFrequencyCtrl = NULL;
    9090    m_DialupStaticBoxCtrl = NULL;
    9191#if defined(__WXMSW__)
     92        m_UseBalloonsCtrl = NULL;
    9293    m_DialupConnectionsCtrl = NULL;
    9394    m_DialupSetDefaultCtrl = NULL;
    9495    m_DialupClearDefaultCtrl = NULL;
     
    148149    wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL);
    149150    itemPanel4->SetSizer(itemBoxSizer5);
    150151
     152#if defined (__WXMSW__)
     153    wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(3, 2, 0, 0);
     154#else
    151155    wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(2, 2, 0, 0);
     156#endif // __WXMSW__
    152157    itemBoxSizer5->Add(itemFlexGridSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
    153158    wxStaticText* itemStaticText7 = new wxStaticText;
    154159    itemStaticText7->Create( itemPanel4, wxID_STATIC, _("Language Selection:"), wxDefaultPosition, wxDefaultSize, 0 );
     
    177182        m_ReminderFrequencyCtrl->SetToolTip(_("How often, in minutes, should the manager remind you of possible connection events."));
    178183    itemFlexGridSizer6->Add(m_ReminderFrequencyCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
    179184
     185#if defined (__WXMSW__)
     186        m_UseBalloonsCtrl = new wxCheckBox;
     187        m_UseBalloonsCtrl->Create( itemPanel4, ID_USEBALLOONS, _("Use balloon tooltips"));
     188        if (ShowToolTips())
     189                m_UseBalloonsCtrl->SetToolTip(_("Uncheck this item if the BOINC Manager should not use balloon tooltips for the systray icon."));
     190        itemFlexGridSizer6->Add(m_UseBalloonsCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
     191#endif // __WXMSW__
     192
    180193    itemNotebook3->AddPage(itemPanel4, _("General"));
    181194
    182195#if defined(__WXMSW__)
  • ../clientgui/DlgOptions.h

     
    5454#define ID_GENERAL 10002
    5555#define ID_LANGUAGESELECTION 10004
    5656#define ID_REMINDERFREQUENCY 10018
     57#define ID_USEBALLOONS 10031
    5758#define ID_CONNECTONS 10019
    5859#define ID_NETWORKAUTODETECT 10020
    5960#define ID_NETWORKLAN 10021
     
    155156////@begin CDlgOptions member variables
    156157    wxComboBox* m_LanguageSelectionCtrl;
    157158    wxSlider* m_ReminderFrequencyCtrl;
     159        wxCheckBox* m_UseBalloonsCtrl;
    158160    wxStaticBoxSizer* m_DialupStaticBoxCtrl;
    159161    wxListBox* m_DialupConnectionsCtrl;
    160162    wxButton* m_DialupSetDefaultCtrl;
  • ../clientgui/AdvancedFrame.cpp

     
    15511551    dlg.m_ReminderFrequencyCtrl->SetValue(m_iReminderFrequency);
    15521552
    15531553#ifdef __WXMSW__
     1554        dlg.m_UseBalloonsCtrl->SetValue(m_bUseBalloons);
     1555
    15541556    // Connection Tab
    15551557    if (m_pDialupManager) {
    15561558        m_pDialupManager->GetISPNames(astrDialupConnections);
     
    16241626        m_iReminderFrequency = dlg.m_ReminderFrequencyCtrl->GetValue();
    16251627
    16261628#ifdef __WXMSW__
     1629                m_bUseBalloons = dlg.m_UseBalloonsCtrl->GetValue();
     1630
    16271631        // Connection Tab
    16281632        m_strNetworkDialupConnectionName = dlg.GetDefaultDialupConnection();
    16291633#endif
  • ../clientgui/BOINCBaseFrame.cpp

     
    202202        CTaskBarIcon* pTaskbar = wxGetApp().GetTaskBarIcon();
    203203        wxASSERT(pTaskbar);
    204204
    205         if ((IsShown() && !event.m_notification_only) || (IsShown() && !pTaskbar->IsBalloonsSupported())) {
     205        if ((IsShown() && !event.m_notification_only) || (IsShown() && !pTaskbar->IsBalloonsSupported()) || (IsShown() && !m_bUseBalloons)) {
    206206            if (!event.m_notification_only) {
    207207                int retval = 0;
    208208
     
    215215                    event.ProcessResponse(retval);
    216216                }
    217217            }
    218         } else {
     218        } else if (m_bUseBalloons) {
    219219            // If the main window is hidden or minimzed use the system tray ballon
    220220            //   to notify the user instead.  This keeps dialogs from interfering
    221221            //   with people typing email messages or any other activity where they
     
    532532
    533533    pConfig->Write(wxT("Language"), m_iSelectedLanguage);
    534534    pConfig->Write(wxT("ReminderFrequency"), m_iReminderFrequency);
     535        pConfig->Write(wxT("UseBalloons"), m_bUseBalloons);
    535536    pConfig->Write(wxT("DisplayExitWarning"), wxGetApp().GetDisplayExitWarning());
    536537
    537538    pConfig->Write(wxT("NetworkDialupConnectionName"), m_strNetworkDialupConnectionName);
     
    591592
    592593    pConfig->Read(wxT("Language"), &m_iSelectedLanguage, 0L);
    593594    pConfig->Read(wxT("ReminderFrequency"), &m_iReminderFrequency, 60L);
     595        pConfig->Read(wxT("UseBalloons"), &m_bUseBalloons, true);
    594596    pConfig->Read(wxT("DisplayExitWarning"), &iDisplayExitWarning, 1L);
    595597    wxGetApp().SetDisplayExitWarning(iDisplayExitWarning);
    596598
  • ../clientgui/BOINCBaseFrame.h

     
    6363    virtual void        OnExit( wxCommandEvent& event );
    6464   
    6565    int                 GetReminderFrequency() { return m_iReminderFrequency; }
     66        bool                GetUseBalloons() { return m_bUseBalloons; }
    6667    wxString            GetDialupConnectionName() { return m_strNetworkDialupConnectionName; }
    6768
    6869    void                FireInitialize();
     
    102103
    103104    int                 m_iSelectedLanguage;
    104105    int                 m_iReminderFrequency;
     106        bool                            m_bUseBalloons;
    105107
    106108    wxString            m_strNetworkDialupConnectionName;
    107109
  • ../clientgui/BOINCTaskBar.cpp

     
    303291
    304292
    305293void CTaskBarIcon::OnMouseMove(wxTaskBarIconEvent& WXUNUSED(event)) {
     294        if (!wxGetApp().GetFrame()->GetUseBalloons())
     295                return;
     296
    306297    wxTimeSpan ts(wxDateTime::Now() - m_dtLastHoverDetected);
    307298    if (ts.GetSeconds() >= 10) {
    308299        m_dtLastHoverDetected = wxDateTime::Now();
     
    448439
    449440void CTaskBarIcon::ResetTaskBar() {
    450441#ifdef __WXMSW___
    451     SetBalloon(m_iconTaskBarNormal, wxT(""), wxT(""));
     442        if (wxGetApp().GetFrame()->GetUseBalloons())
     443                SetBalloon(m_iconTaskBarNormal, wxT(""), wxT(""));
     444        else
     445            SetIcon(m_iconTaskBarNormal, wxT(""));
    452446#else
    453447    SetIcon(m_iconTaskBarNormal, wxT(""));
    454448#endif