当前位置: 首页>>代码示例>>C++>>正文


C++ CBOINCBaseFrame::SetSelectedLanguage方法代码示例

本文整理汇总了C++中CBOINCBaseFrame::SetSelectedLanguage方法的典型用法代码示例。如果您正苦于以下问题:C++ CBOINCBaseFrame::SetSelectedLanguage方法的具体用法?C++ CBOINCBaseFrame::SetSelectedLanguage怎么用?C++ CBOINCBaseFrame::SetSelectedLanguage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBOINCBaseFrame的用法示例。


在下文中一共展示了CBOINCBaseFrame::SetSelectedLanguage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SaveSettings

bool CDlgOptions::SaveSettings() {
    CMainDocument*      pDoc = wxGetApp().GetDocument();
    CBOINCBaseFrame*    pFrame = wxGetApp().GetFrame();
    CSkinAdvanced*      pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced();
    long                lBuffer = 0;
    wxString            strBuffer = wxEmptyString;


    wxASSERT(pDoc);
    wxASSERT(pFrame);
    wxASSERT(pSkinAdvanced);
    wxASSERT(wxDynamicCast(pDoc, CMainDocument));
    wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame));
    wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced));


    // General Tab
    if (pFrame->GetSelectedLanguage() != m_LanguageSelectionCtrl->GetSelection()) {
        wxString strDialogTitle;
        wxString strDialogMessage;

        // %s is the application name
        //    i.e. 'BOINC Manager', 'GridRepublic Manager'
        strDialogTitle.Printf(
            _("%s - Language Selection"),
            pSkinAdvanced->GetApplicationName().c_str()
        );

        // %s is the application name
        //    i.e. 'BOINC Manager', 'GridRepublic Manager'
        strDialogMessage.Printf(
            _("The %s's default language has been changed, in order for this change to take affect you must restart the %s."),
            pSkinAdvanced->GetApplicationName().c_str(),
            pSkinAdvanced->GetApplicationName().c_str()
        );

        pFrame->ShowAlert(
            strDialogTitle,
            strDialogMessage,
            wxOK | wxICON_INFORMATION
        );
    }

    pFrame->SetSelectedLanguage(m_LanguageSelectionCtrl->GetSelection());

    switch(m_ReminderFrequencyCtrl->GetSelection()) {
        case 0:
            pFrame->SetReminderFrequency(1);
            break;
        case 1:
            pFrame->SetReminderFrequency(60);
            break;
        case 2:
            pFrame->SetReminderFrequency(360);
            break;
        case 3:
            pFrame->SetReminderFrequency(1440);
            break;
        case 4:
            pFrame->SetReminderFrequency(10080);
            break;
        case 5:
            pFrame->SetReminderFrequency(0);
            break;
    }

    wxGetApp().SetBOINCMGRDisplayExitMessage(m_EnableBOINCManagerExitMessageCtrl->GetValue());
#ifdef __WXMSW__
    wxGetApp().SetBOINCMGRDisableAutoStart(!m_EnableBOINCManagerAutoStartCtrl->GetValue());

    // Connection Tab
    pFrame->SetDialupConnectionName(GetDefaultDialupConnection());
#endif

    // Proxy Tabs
    if (m_bRetrievedProxyConfiguration) {
        pDoc->proxy_info.use_http_proxy = m_EnableHTTPProxyCtrl->GetValue();
        pDoc->proxy_info.http_server_name = (const char*)m_HTTPAddressCtrl->GetValue().mb_str();
        pDoc->proxy_info.http_user_name = (const char*)m_HTTPUsernameCtrl->GetValue().mb_str();
        pDoc->proxy_info.http_user_passwd = (const char*)m_HTTPPasswordCtrl->GetValue().mb_str();
		if(pDoc->proxy_info.use_http_proxy) {
			pDoc->proxy_info.noproxy_hosts = (const char*)m_HTTPNoProxiesCtrl->GetValue().mb_str();
		}
        strBuffer = m_HTTPPortCtrl->GetValue();
        strBuffer.ToLong((long*)&lBuffer);
        pDoc->proxy_info.http_server_port = lBuffer;

        pDoc->proxy_info.use_socks_proxy = m_EnableSOCKSProxyCtrl->GetValue();
        pDoc->proxy_info.socks_server_name = (const char*)m_SOCKSAddressCtrl->GetValue().mb_str();
        pDoc->proxy_info.socks5_user_name = (const char*)m_SOCKSUsernameCtrl->GetValue().mb_str();
        pDoc->proxy_info.socks5_user_passwd = (const char*)m_SOCKSPasswordCtrl->GetValue().mb_str();
		if(pDoc->proxy_info.use_socks_proxy) {
			pDoc->proxy_info.noproxy_hosts = (const char*)m_SOCKSNoProxiesCtrl->GetValue().mb_str();
		}
        strBuffer = m_SOCKSPortCtrl->GetValue();
        strBuffer.ToLong((long*)&lBuffer);
        pDoc->proxy_info.socks_server_port = lBuffer;

        pDoc->SetProxyConfiguration();
    }
//.........这里部分代码省略.........
开发者ID:FpgaAtHome,项目名称:seti_fpga,代码行数:101,代码来源:DlgOptions.cpp


注:本文中的CBOINCBaseFrame::SetSelectedLanguage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。