mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=6483
This commit is contained in:
parent
285052ce4a
commit
86ac72a514
|
@ -8678,6 +8678,14 @@ Bruce 28 June 2005
|
|||
sched/
|
||||
sched_locality.C
|
||||
|
||||
Rom 28 June 2005
|
||||
- Additional Dial-up work
|
||||
- Add space for description and hyperlink access to the
|
||||
DlgAccountManagerSignup dialog.
|
||||
|
||||
|
||||
|
||||
clientgui/
|
||||
BOINCGUI.pjd
|
||||
DlgOptions.cpp, .h
|
||||
DlgAccountManagerSignup.cpp, .h
|
||||
hyperlink.cpp, .h (Added)
|
||||
MainFrame.cpp
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -113,44 +113,48 @@ void CDlgAccountManagerSignup::CreateControls()
|
|||
itemStaticText4->Create( itemDialog1, ID_ACCTMANAGERTEXT, _("foo"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
|
||||
wxFlexGridSizer* itemFlexGridSizer5 = new wxFlexGridSizer(3, 2, 0, 0);
|
||||
itemBoxSizer3->Add(itemFlexGridSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
wxHyperLink* itemHyperLink5 = new wxHyperLink;
|
||||
itemHyperLink5->Create( itemDialog1, ID_ACCTMANAGERLINK, _T("http://boinc.berkeley.edu/"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer3->Add(itemHyperLink5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
|
||||
wxStaticText* itemStaticText6 = new wxStaticText;
|
||||
itemStaticText6->Create( itemDialog1, wxID_STATIC, _("URL:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemFlexGridSizer5->Add(itemStaticText6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(3, 2, 0, 0);
|
||||
itemBoxSizer3->Add(itemFlexGridSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
|
||||
|
||||
wxStaticText* itemStaticText7 = new wxStaticText;
|
||||
itemStaticText7->Create( itemDialog1, wxID_STATIC, _("URL:"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemFlexGridSizer6->Add(itemStaticText7, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
|
||||
m_AcctManagerURLCtrl = new wxTextCtrl;
|
||||
m_AcctManagerURLCtrl->Create( itemDialog1, ID_ACCTMANAGERURL, _T(""), wxDefaultPosition, wxSize(200, -1), 0 );
|
||||
itemFlexGridSizer5->Add(m_AcctManagerURLCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
itemFlexGridSizer6->Add(m_AcctManagerURLCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
wxStaticText* itemStaticText8 = new wxStaticText;
|
||||
itemStaticText8->Create( itemDialog1, wxID_STATIC, _("Username:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
|
||||
itemFlexGridSizer5->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
wxStaticText* itemStaticText9 = new wxStaticText;
|
||||
itemStaticText9->Create( itemDialog1, wxID_STATIC, _("Username:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
|
||||
itemFlexGridSizer6->Add(itemStaticText9, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
|
||||
m_AcctManagerUsernameCtrl = new wxTextCtrl;
|
||||
m_AcctManagerUsernameCtrl->Create( itemDialog1, ID_ACCTMANAGERUSERNAME, _T(""), wxDefaultPosition, wxSize(200, -1), 0 );
|
||||
itemFlexGridSizer5->Add(m_AcctManagerUsernameCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
itemFlexGridSizer6->Add(m_AcctManagerUsernameCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
wxStaticText* itemStaticText10 = new wxStaticText;
|
||||
itemStaticText10->Create( itemDialog1, wxID_STATIC, _("Password:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
|
||||
itemFlexGridSizer5->Add(itemStaticText10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
wxStaticText* itemStaticText11 = new wxStaticText;
|
||||
itemStaticText11->Create( itemDialog1, wxID_STATIC, _("Password:"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT );
|
||||
itemFlexGridSizer6->Add(itemStaticText11, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
|
||||
m_AcctManagerPasswordCtrl = new wxTextCtrl;
|
||||
m_AcctManagerPasswordCtrl->Create( itemDialog1, ID_ACCTMANAGERPASSWORD, _T(""), wxDefaultPosition, wxSize(200, -1), wxTE_PASSWORD );
|
||||
itemFlexGridSizer5->Add(m_AcctManagerPasswordCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
itemFlexGridSizer6->Add(m_AcctManagerPasswordCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
wxFlexGridSizer* itemFlexGridSizer12 = new wxFlexGridSizer(2, 1, 0, 0);
|
||||
itemFlexGridSizer2->Add(itemFlexGridSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP|wxALL, 5);
|
||||
|
||||
wxButton* itemButton13 = new wxButton;
|
||||
itemButton13->Create( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton13->SetDefault();
|
||||
itemFlexGridSizer12->Add(itemButton13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
wxFlexGridSizer* itemFlexGridSizer13 = new wxFlexGridSizer(2, 1, 0, 0);
|
||||
itemFlexGridSizer2->Add(itemFlexGridSizer13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_TOP|wxALL, 5);
|
||||
|
||||
wxButton* itemButton14 = new wxButton;
|
||||
itemButton14->Create( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemFlexGridSizer12->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
itemButton14->Create( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemButton14->SetDefault();
|
||||
itemFlexGridSizer13->Add(itemButton14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
wxButton* itemButton15 = new wxButton;
|
||||
itemButton15->Create( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemFlexGridSizer13->Add(itemButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
// Set validators
|
||||
m_AcctManagerURLCtrl->SetValidator( wxGenericValidator(& m_strAcctManagerURL) );
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
*/
|
||||
|
||||
////@begin includes
|
||||
#include "hyperlink.h"
|
||||
#include "wx/valgen.h"
|
||||
////@end includes
|
||||
|
||||
|
@ -51,6 +52,7 @@
|
|||
#define SYMBOL_CDLGACCOUNTMANAGERSIGNUP_SIZE wxSize(400, 300)
|
||||
#define SYMBOL_CDLGACCOUNTMANAGERSIGNUP_POSITION wxDefaultPosition
|
||||
#define ID_ACCTMANAGERTEXT 10028
|
||||
#define ID_ACCTMANAGERLINK 10029
|
||||
#define ID_ACCTMANAGERURL 10001
|
||||
#define ID_ACCTMANAGERUSERNAME 10002
|
||||
#define ID_ACCTMANAGERPASSWORD 10003
|
||||
|
|
|
@ -48,22 +48,33 @@ BEGIN_EVENT_TABLE(CDlgOptions, wxDialog)
|
|||
EVT_UPDATE_UI( ID_NOTEBOOK, CDlgOptions::OnNotebookUpdate )
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
EVT_RADIOBUTTON( ID_NETWORKAUTODETECT, CDlgOptions::OnNetworkautodetectSelected )
|
||||
EVT_RADIOBUTTON( ID_NETWORKAUTODETECT, CDlgOptions::OnNetworkAutoDetectSelected )
|
||||
EVT_UPDATE_UI( ID_NETWORKAUTODETECT, CDlgOptions::OnNetworkAutoDetectUpdate )
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
EVT_RADIOBUTTON( ID_NETWORKLAN, CDlgOptions::OnNetworklanSelected )
|
||||
EVT_RADIOBUTTON( ID_NETWORKLAN, CDlgOptions::OnNetworkLANSelected )
|
||||
EVT_UPDATE_UI( ID_NETWORKLAN, CDlgOptions::OnNetworkLANUpdate )
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
EVT_RADIOBUTTON( ID_NETWORKDIALUP, CDlgOptions::OnNetworkdialupSelected )
|
||||
EVT_RADIOBUTTON( ID_NETWORKDIALUP, CDlgOptions::OnNetworkDialupSelected )
|
||||
EVT_UPDATE_UI( ID_NETWORKDIALUP, CDlgOptions::OnNetworkDialupUpdate )
|
||||
#endif
|
||||
|
||||
EVT_CHECKBOX( ID_ENABLEHTTPPROXYCTRL, CDlgOptions::OnEnablehttpproxyctrlClick )
|
||||
EVT_UPDATE_UI( ID_ENABLEHTTPPROXYCTRL, CDlgOptions::OnEnablehttpproxyctrlUpdate )
|
||||
#if defined(__WXMSW__)
|
||||
EVT_BUTTON( ID_DIALUPSETDEFAULT, CDlgOptions::OnDialupSetDefaultClick )
|
||||
#endif
|
||||
|
||||
EVT_CHECKBOX( ID_ENABLESOCKSPROXYCTRL, CDlgOptions::OnEnablesocksproxyctrlClick )
|
||||
EVT_UPDATE_UI( ID_ENABLESOCKSPROXYCTRL, CDlgOptions::OnEnablesocksproxyctrlUpdate )
|
||||
#if defined(__WXMSW__)
|
||||
EVT_BUTTON( ID_DIALUPCLEARDEFAULT, CDlgOptions::OnDialupClearDefaultClick )
|
||||
#endif
|
||||
|
||||
EVT_CHECKBOX( ID_ENABLEHTTPPROXYCTRL, CDlgOptions::OnEnableHTTPProxyCtrlClick )
|
||||
EVT_UPDATE_UI( ID_ENABLEHTTPPROXYCTRL, CDlgOptions::OnEnableHTTPProxyCtrlUpdate )
|
||||
|
||||
EVT_CHECKBOX( ID_ENABLESOCKSPROXYCTRL, CDlgOptions::OnEnableSOCKSProxyCtrlClick )
|
||||
EVT_UPDATE_UI( ID_ENABLESOCKSPROXYCTRL, CDlgOptions::OnEnableSOCKSProxyCtrlUpdate )
|
||||
|
||||
////@end CDlgOptions event table entries
|
||||
|
||||
|
@ -149,7 +160,6 @@ bool CDlgOptions::Create(wxWindow* parent, wxWindowID id, const wxString& captio
|
|||
void CDlgOptions::CreateControls()
|
||||
{
|
||||
////@begin CDlgOptions content construction
|
||||
|
||||
CDlgOptions* itemDialog1 = this;
|
||||
|
||||
wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
|
||||
|
@ -198,17 +208,17 @@ void CDlgOptions::CreateControls()
|
|||
itemPanel11->SetSizer(itemBoxSizer12);
|
||||
|
||||
m_NetworkAutomaticDetectionCtrl = new wxRadioButton;
|
||||
m_NetworkAutomaticDetectionCtrl->Create( itemPanel11, ID_NETWORKAUTODETECT, _("Automatically detect network connection settings"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
||||
m_NetworkAutomaticDetectionCtrl->Create( itemPanel11, ID_NETWORKAUTODETECT, _("&Automatically detect network connection settings"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
|
||||
m_NetworkAutomaticDetectionCtrl->SetValue(TRUE);
|
||||
itemBoxSizer12->Add(m_NetworkAutomaticDetectionCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
||||
m_NetworkUseLANCtrl = new wxRadioButton;
|
||||
m_NetworkUseLANCtrl->Create( itemPanel11, ID_NETWORKLAN, _("Use my Local Area Network(LAN) connection"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NetworkUseLANCtrl->Create( itemPanel11, ID_NETWORKLAN, _("Use my &Local Area Network(LAN) connection"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NetworkUseLANCtrl->SetValue(FALSE);
|
||||
itemBoxSizer12->Add(m_NetworkUseLANCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
||||
m_NetworkUseDialupCtrl = new wxRadioButton;
|
||||
m_NetworkUseDialupCtrl->Create( itemPanel11, ID_NETWORKDIALUP, _("Use my Dial-up and Virtual Private Network connection"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NetworkUseDialupCtrl->Create( itemPanel11, ID_NETWORKDIALUP, _("Use my &Dial-up and Virtual Private Network connection"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_NetworkUseDialupCtrl->SetValue(FALSE);
|
||||
itemBoxSizer12->Add(m_NetworkUseDialupCtrl, 0, wxALIGN_LEFT|wxALL, 5);
|
||||
|
||||
|
@ -226,12 +236,12 @@ void CDlgOptions::CreateControls()
|
|||
wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL);
|
||||
itemFlexGridSizer17->Add(itemBoxSizer19, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
m_DialupSetDefaultCtrl = new wxButton;
|
||||
m_DialupSetDefaultCtrl->Create( itemPanel11, ID_DIALUPSETDEFAULT, _("Set Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_DialupSetDefaultCtrl->Create( itemPanel11, ID_DIALUPSETDEFAULT, _("&Set Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_DialupSetDefaultCtrl->SetDefault();
|
||||
itemBoxSizer19->Add(m_DialupSetDefaultCtrl, 0, wxGROW|wxALL, 5);
|
||||
|
||||
m_DialupClearDefaultCtrl = new wxButton;
|
||||
m_DialupClearDefaultCtrl->Create( itemPanel11, ID_DIALUPCLEARDEFAULT, _("Clear Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_DialupClearDefaultCtrl->Create( itemPanel11, ID_DIALUPCLEARDEFAULT, _("&Clear Default"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer19->Add(m_DialupClearDefaultCtrl, 0, wxGROW|wxALL, 5);
|
||||
|
||||
wxFlexGridSizer* itemFlexGridSizer22 = new wxFlexGridSizer(1, 2, 0, 0);
|
||||
|
@ -245,6 +255,9 @@ void CDlgOptions::CreateControls()
|
|||
m_DialupDefaultConnectionCtrl->Create( itemPanel11, ID_DIALUPDEFAULTCONNECTION, _T(""), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemFlexGridSizer22->Add(m_DialupDefaultConnectionCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL|wxADJUST_MINSIZE, 5);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
itemNotebook3->AddPage(itemPanel11, _("Connections"));
|
||||
#endif
|
||||
|
||||
|
@ -254,7 +267,7 @@ void CDlgOptions::CreateControls()
|
|||
itemPanel25->SetSizer(itemBoxSizer26);
|
||||
|
||||
m_EnableHTTPProxyCtrl = new wxCheckBox;
|
||||
m_EnableHTTPProxyCtrl->Create( itemPanel25, ID_ENABLEHTTPPROXYCTRL, _("Connect via HTTP proxy server"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_EnableHTTPProxyCtrl->Create( itemPanel25, ID_ENABLEHTTPPROXYCTRL, _("Connect via HTTP proxy server"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_EnableHTTPProxyCtrl->SetValue(FALSE);
|
||||
itemBoxSizer26->Add(m_EnableHTTPProxyCtrl, 0, wxGROW|wxALL, 5);
|
||||
|
||||
|
@ -310,7 +323,7 @@ void CDlgOptions::CreateControls()
|
|||
itemPanel41->SetSizer(itemBoxSizer42);
|
||||
|
||||
m_EnableSOCKSProxyCtrl = new wxCheckBox;
|
||||
m_EnableSOCKSProxyCtrl->Create( itemPanel41, ID_ENABLESOCKSPROXYCTRL, _("Connect via SOCKS proxy server"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
m_EnableSOCKSProxyCtrl->Create( itemPanel41, ID_ENABLESOCKSPROXYCTRL, _("Connect via SOCKS proxy server"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE );
|
||||
m_EnableSOCKSProxyCtrl->SetValue(FALSE);
|
||||
itemBoxSizer42->Add(m_EnableSOCKSProxyCtrl, 0, wxGROW|wxALL, 5);
|
||||
|
||||
|
@ -378,38 +391,174 @@ void CDlgOptions::CreateControls()
|
|||
itemButton59->Create( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||
itemBoxSizer57->Add(itemButton59, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
|
||||
|
||||
// Set validators
|
||||
#if defined(__WXMSW__)
|
||||
m_DialupDefaultConnectionCtrl->SetValidator( wxTextValidator(wxFILTER_NONE, & m_strDefaultDialupConnection) );
|
||||
#endif
|
||||
////@end CDlgOptions content construction
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNotebookPageChanged(wxNotebookEvent& event)
|
||||
{
|
||||
////@begin wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK in CDlgToolsOptions.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED event handler for ID_NOTEBOOK in CDlgToolsOptions.
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_NOTEBOOK
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNotebookUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
////@begin wxEVT_UPDATE_UI event handler for ID_NOTEBOOK in CDlgToolsOptions.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_UPDATE_UI event handler for ID_NOTEBOOK in CDlgToolsOptions.
|
||||
}
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKAUTODETECT
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkAutoDetectSelected( wxCommandEvent& event )
|
||||
{
|
||||
if (event.IsChecked()) {
|
||||
m_DialupConnectionsCtrl->Enable(false);
|
||||
m_DialupSetDefaultCtrl->Enable(false);
|
||||
m_DialupClearDefaultCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionCtrl->Enable(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_NETWORKAUTODETECT
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkAutoDetectUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
if (m_NetworkAutomaticDetectionCtrl->GetValue()) {
|
||||
m_DialupConnectionsCtrl->Enable(false);
|
||||
m_DialupSetDefaultCtrl->Enable(false);
|
||||
m_DialupClearDefaultCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionCtrl->Enable(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKLAN
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkLANSelected( wxCommandEvent& event )
|
||||
{
|
||||
if (event.IsChecked()) {
|
||||
m_DialupConnectionsCtrl->Enable(false);
|
||||
m_DialupSetDefaultCtrl->Enable(false);
|
||||
m_DialupClearDefaultCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionCtrl->Enable(false);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_NETWORKLAN
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkLANUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
if (m_NetworkUseLANCtrl->GetValue()) {
|
||||
m_DialupConnectionsCtrl->Enable(false);
|
||||
m_DialupSetDefaultCtrl->Enable(false);
|
||||
m_DialupClearDefaultCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(false);
|
||||
m_DialupDefaultConnectionCtrl->Enable(false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKDIALUP
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkDialupSelected( wxCommandEvent& event )
|
||||
{
|
||||
if (event.IsChecked()) {
|
||||
m_DialupConnectionsCtrl->Enable(true);
|
||||
m_DialupSetDefaultCtrl->Enable(true);
|
||||
m_DialupClearDefaultCtrl->Enable(true);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(true);
|
||||
m_DialupDefaultConnectionCtrl->Enable(true);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_NETWORKDIALUP
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkDialupUpdate( wxUpdateUIEvent& event )
|
||||
{
|
||||
if (m_NetworkUseDialupCtrl->GetValue()) {
|
||||
m_DialupConnectionsCtrl->Enable(true);
|
||||
m_DialupSetDefaultCtrl->Enable(true);
|
||||
m_DialupClearDefaultCtrl->Enable(true);
|
||||
m_DialupDefaultConnectionTextCtrl->Enable(true);
|
||||
m_DialupDefaultConnectionCtrl->Enable(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DIALUPSETDEFAULT
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnDialupSetDefaultClick( wxCommandEvent& event )
|
||||
{
|
||||
m_DialupDefaultConnectionCtrl->SetLabel(m_DialupConnectionsCtrl->GetStringSelection());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
/*!
|
||||
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DIALUPCLEARDEFAULT
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnDialupClearDefaultClick( wxCommandEvent& event )
|
||||
{
|
||||
m_DialupDefaultConnectionCtrl->SetLabel(wxEmptyString);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_ENABLEHTTPPROXYCTRL
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnEnablehttpproxyctrlClick(wxCommandEvent& event) {
|
||||
void CDlgOptions::OnEnableHTTPProxyCtrlClick(wxCommandEvent& event) {
|
||||
if (event.IsChecked()) {
|
||||
m_HTTPAddressCtrl->Enable(true);
|
||||
m_HTTPPortCtrl->Enable(true);
|
||||
|
@ -425,11 +574,12 @@ void CDlgOptions::OnEnablehttpproxyctrlClick(wxCommandEvent& event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_ENABLEHTTPPROXYCTRL
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnEnablehttpproxyctrlUpdate(wxUpdateUIEvent& event) {
|
||||
void CDlgOptions::OnEnableHTTPProxyCtrlUpdate(wxUpdateUIEvent& event) {
|
||||
if (m_bProxySectionConfigured) {
|
||||
m_EnableHTTPProxyCtrl->Enable(true);
|
||||
if (m_EnableHTTPProxyCtrl->IsChecked()) {
|
||||
|
@ -453,11 +603,12 @@ void CDlgOptions::OnEnablehttpproxyctrlUpdate(wxUpdateUIEvent& event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_ENABLESOCKSPROXYCTRL
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnEnablesocksproxyctrlClick(wxCommandEvent& event) {
|
||||
void CDlgOptions::OnEnableSOCKSProxyCtrlClick(wxCommandEvent& event) {
|
||||
if (event.IsChecked()) {
|
||||
m_SOCKSAddressCtrl->Enable(true);
|
||||
m_SOCKSPortCtrl->Enable(true);
|
||||
|
@ -472,11 +623,12 @@ void CDlgOptions::OnEnablesocksproxyctrlClick(wxCommandEvent& event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* wxEVT_UPDATE_UI event handler for ID_ENABLESOCKSPROXYCTRL
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnEnablesocksproxyctrlUpdate(wxUpdateUIEvent& event) {
|
||||
void CDlgOptions::OnEnableSOCKSProxyCtrlUpdate(wxUpdateUIEvent& event) {
|
||||
if (m_bProxySectionConfigured) {
|
||||
m_EnableSOCKSProxyCtrl->Enable(true);
|
||||
if (m_EnableSOCKSProxyCtrl->IsChecked()) {
|
||||
|
@ -500,6 +652,7 @@ void CDlgOptions::OnEnablesocksproxyctrlUpdate(wxUpdateUIEvent& event) {
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Should we show tooltips?
|
||||
*/
|
||||
|
@ -509,72 +662,29 @@ bool CDlgOptions::ShowToolTips()
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Get bitmap resources
|
||||
*/
|
||||
|
||||
wxBitmap CDlgOptions::GetBitmapResource(const wxString&) {
|
||||
wxBitmap CDlgOptions::GetBitmapResource(const wxString&)
|
||||
{
|
||||
// Bitmap retrieval
|
||||
////@begin CDlgOptions bitmap retrieval
|
||||
return wxNullBitmap;
|
||||
////@end CDlgOptions bitmap retrieval
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
* Get icon resources
|
||||
*/
|
||||
|
||||
wxIcon CDlgOptions::GetIconResource(const wxString&) {
|
||||
wxIcon CDlgOptions::GetIconResource(const wxString&)
|
||||
{
|
||||
// Icon retrieval
|
||||
////@begin CDlgOptions icon retrieval
|
||||
return wxNullIcon;
|
||||
////@end CDlgOptions icon retrieval
|
||||
}
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON
|
||||
*/
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
void CDlgOptions::OnNetworkautodetectSelected( wxCommandEvent& event )
|
||||
{
|
||||
////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON in CDlgOptions.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON in CDlgOptions.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON1
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworklanSelected( wxCommandEvent& event )
|
||||
{
|
||||
////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON1 in CDlgOptions.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON1 in CDlgOptions.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(__WXMSW__)
|
||||
|
||||
/*!
|
||||
* wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON2
|
||||
*/
|
||||
|
||||
void CDlgOptions::OnNetworkdialupSelected( wxCommandEvent& event )
|
||||
{
|
||||
////@begin wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON2 in CDlgOptions.
|
||||
// Before editing this code, remove the block markers.
|
||||
event.Skip();
|
||||
////@end wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_RADIOBUTTON2 in CDlgOptions.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
////@begin includes
|
||||
#include "wx/notebook.h"
|
||||
#include "wx/valtext.h"
|
||||
////@end includes
|
||||
|
||||
/*!
|
||||
|
@ -118,30 +119,49 @@ public:
|
|||
|
||||
#if defined(__WXMSW__)
|
||||
/// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKAUTODETECT
|
||||
void OnNetworkautodetectSelected( wxCommandEvent& event );
|
||||
void OnNetworkAutoDetectSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_NETWORKAUTODETECT
|
||||
void OnNetworkAutoDetectUpdate( wxUpdateUIEvent& event );
|
||||
|
||||
#endif
|
||||
#if defined(__WXMSW__)
|
||||
/// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKLAN
|
||||
void OnNetworklanSelected( wxCommandEvent& event );
|
||||
void OnNetworkLANSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_NETWORKLAN
|
||||
void OnNetworkLANUpdate( wxUpdateUIEvent& event );
|
||||
|
||||
#endif
|
||||
#if defined(__WXMSW__)
|
||||
/// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_NETWORKDIALUP
|
||||
void OnNetworkdialupSelected( wxCommandEvent& event );
|
||||
void OnNetworkDialupSelected( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_NETWORKDIALUP
|
||||
void OnNetworkDialupUpdate( wxUpdateUIEvent& event );
|
||||
|
||||
#endif
|
||||
#if defined(__WXMSW__)
|
||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DIALUPSETDEFAULT
|
||||
void OnDialupSetDefaultClick( wxCommandEvent& event );
|
||||
|
||||
#endif
|
||||
#if defined(__WXMSW__)
|
||||
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DIALUPCLEARDEFAULT
|
||||
void OnDialupClearDefaultClick( wxCommandEvent& event );
|
||||
|
||||
#endif
|
||||
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_ENABLEHTTPPROXYCTRL
|
||||
void OnEnablehttpproxyctrlClick( wxCommandEvent& event );
|
||||
void OnEnableHTTPProxyCtrlClick( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_ENABLEHTTPPROXYCTRL
|
||||
void OnEnablehttpproxyctrlUpdate( wxUpdateUIEvent& event );
|
||||
void OnEnableHTTPProxyCtrlUpdate( wxUpdateUIEvent& event );
|
||||
|
||||
/// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_ENABLESOCKSPROXYCTRL
|
||||
void OnEnablesocksproxyctrlClick( wxCommandEvent& event );
|
||||
void OnEnableSOCKSProxyCtrlClick( wxCommandEvent& event );
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_ENABLESOCKSPROXYCTRL
|
||||
void OnEnablesocksproxyctrlUpdate( wxUpdateUIEvent& event );
|
||||
void OnEnableSOCKSProxyCtrlUpdate( wxUpdateUIEvent& event );
|
||||
|
||||
////@end CDlgOptions event handler declarations
|
||||
|
||||
|
@ -150,6 +170,9 @@ public:
|
|||
bool GetProxySectionConfigured() const { return m_bProxySectionConfigured ; }
|
||||
void SetProxySectionConfigured(bool value) { m_bProxySectionConfigured = value ; }
|
||||
|
||||
wxString GetDefaultDialupConnection() const { return m_strDefaultDialupConnection ; }
|
||||
void SetDefaultDialupConnection(wxString value) { m_strDefaultDialupConnection = value ; }
|
||||
|
||||
/// Retrieves bitmap resources
|
||||
wxBitmap GetBitmapResource( const wxString& name );
|
||||
|
||||
|
@ -201,6 +224,7 @@ public:
|
|||
wxTextCtrl* m_SOCKSUsernameCtrl;
|
||||
wxTextCtrl* m_SOCKSPasswordCtrl;
|
||||
bool m_bProxySectionConfigured;
|
||||
wxString m_strDefaultDialupConnection;
|
||||
////@end CDlgOptions member variables
|
||||
};
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#endif
|
||||
|
||||
#include "stdwx.h"
|
||||
#include "hyperlink.h"
|
||||
#include "BOINCGUIApp.h"
|
||||
#include "MainFrame.h"
|
||||
#include "Events.h"
|
||||
|
@ -209,8 +210,10 @@ CMainFrame::CMainFrame(wxString strTitle) :
|
|||
SetStatusBarPane(0);
|
||||
|
||||
|
||||
#ifdef __WXMSW__
|
||||
m_pDialupManager = wxDialUpManager::Create();
|
||||
wxASSERT(m_pDialupManager->IsOk());
|
||||
#endif
|
||||
|
||||
m_pRefreshStateTimer = new wxTimer(this, ID_REFRESHSTATETIMER);
|
||||
wxASSERT(m_pRefreshStateTimer);
|
||||
|
@ -256,8 +259,9 @@ CMainFrame::~CMainFrame() {
|
|||
wxASSERT(m_pMenubar);
|
||||
wxASSERT(m_pNotebook);
|
||||
wxASSERT(m_pStatusbar);
|
||||
#ifdef __WXMSW__
|
||||
wxASSERT(m_pDialupManager);
|
||||
|
||||
#endif
|
||||
|
||||
SaveState();
|
||||
|
||||
|
@ -290,8 +294,10 @@ CMainFrame::~CMainFrame() {
|
|||
if (m_pMenubar)
|
||||
wxCHECK_RET(DeleteMenu(), _T("Failed to delete menu bar."));
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if (m_pDialupManager)
|
||||
delete m_pDialupManager;
|
||||
#endif
|
||||
|
||||
|
||||
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::~CMainFrame - Function End"));
|
||||
|
@ -1021,8 +1027,13 @@ void CMainFrame::OnToolsOptions(wxCommandEvent& WXUNUSED(event)) {
|
|||
wxASSERT(pDoc);
|
||||
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
|
||||
wxASSERT(pDlg);
|
||||
wxASSERT(m_pDialupManager);
|
||||
|
||||
#ifdef __WXMSW__
|
||||
wxASSERT(m_pDialupManager);
|
||||
#endif
|
||||
|
||||
|
||||
pDoc->GetProxyConfiguration();
|
||||
|
||||
// General Tab
|
||||
pDlg->m_LanguageSelectionCtrl->Append(wxGetApp().GetSupportedLanguages());
|
||||
|
@ -1035,28 +1046,38 @@ void CMainFrame::OnToolsOptions(wxCommandEvent& WXUNUSED(event)) {
|
|||
#endif
|
||||
|
||||
// Proxy Tabs
|
||||
bProxyInformationConfigured = (0 == pDoc->GetProxyConfiguration());
|
||||
if (bProxyInformationConfigured) {
|
||||
pDlg->m_bProxySectionConfigured = true;
|
||||
pDlg->m_EnableHTTPProxyCtrl->SetValue(pDoc->proxy_info.use_http_proxy);
|
||||
pDlg->m_HTTPAddressCtrl->SetValue(pDoc->proxy_info.http_server_name.c_str());
|
||||
pDlg->m_HTTPUsernameCtrl->SetValue(pDoc->proxy_info.http_user_name.c_str());
|
||||
pDlg->m_HTTPPasswordCtrl->SetValue(pDoc->proxy_info.http_user_passwd.c_str());
|
||||
pDlg->m_EnableHTTPProxyCtrl->SetValue(pDoc->proxy_info.use_http_proxy);
|
||||
pDlg->m_HTTPAddressCtrl->SetValue(pDoc->proxy_info.http_server_name.c_str());
|
||||
pDlg->m_HTTPUsernameCtrl->SetValue(pDoc->proxy_info.http_user_name.c_str());
|
||||
pDlg->m_HTTPPasswordCtrl->SetValue(pDoc->proxy_info.http_user_passwd.c_str());
|
||||
|
||||
strBuffer.Printf(wxT("%d"), pDoc->proxy_info.http_server_port);
|
||||
pDlg->m_HTTPPortCtrl->SetValue(strBuffer);
|
||||
strBuffer.Printf(wxT("%d"), pDoc->proxy_info.http_server_port);
|
||||
pDlg->m_HTTPPortCtrl->SetValue(strBuffer);
|
||||
|
||||
pDlg->m_EnableSOCKSProxyCtrl->SetValue(pDoc->proxy_info.use_socks_proxy);
|
||||
pDlg->m_SOCKSAddressCtrl->SetValue(pDoc->proxy_info.socks_server_name.c_str());
|
||||
pDlg->m_SOCKSUsernameCtrl->SetValue(pDoc->proxy_info.socks5_user_name.c_str());
|
||||
pDlg->m_SOCKSPasswordCtrl->SetValue(pDoc->proxy_info.socks5_user_passwd.c_str());
|
||||
pDlg->m_EnableSOCKSProxyCtrl->SetValue(pDoc->proxy_info.use_socks_proxy);
|
||||
pDlg->m_SOCKSAddressCtrl->SetValue(pDoc->proxy_info.socks_server_name.c_str());
|
||||
pDlg->m_SOCKSUsernameCtrl->SetValue(pDoc->proxy_info.socks5_user_name.c_str());
|
||||
pDlg->m_SOCKSPasswordCtrl->SetValue(pDoc->proxy_info.socks5_user_passwd.c_str());
|
||||
|
||||
strBuffer.Printf(wxT("%d"), pDoc->proxy_info.socks_server_port);
|
||||
pDlg->m_SOCKSPortCtrl->SetValue(strBuffer);
|
||||
}
|
||||
strBuffer.Printf(wxT("%d"), pDoc->proxy_info.socks_server_port);
|
||||
pDlg->m_SOCKSPortCtrl->SetValue(strBuffer);
|
||||
|
||||
iAnswer = pDlg->ShowModal();
|
||||
if (wxID_OK == iAnswer) {
|
||||
// General Tab
|
||||
if (m_iSelectedLanguage != pDlg->m_LanguageSelectionCtrl->GetSelection()) {
|
||||
ShowAlert(
|
||||
_("The BOINC Managers default language has been changed, in order for this change to take affect you must restart the manager."),
|
||||
_("Language Selection..."),
|
||||
wxICON_INFORMATION
|
||||
);
|
||||
}
|
||||
|
||||
m_iSelectedLanguage = pDlg->m_LanguageSelectionCtrl->GetSelection();
|
||||
|
||||
// Connections Tab
|
||||
|
||||
// Proxy Tabs
|
||||
pDoc->proxy_info.use_http_proxy = pDlg->m_EnableHTTPProxyCtrl->GetValue();
|
||||
pDoc->proxy_info.http_server_name = pDlg->m_HTTPAddressCtrl->GetValue().c_str();
|
||||
pDoc->proxy_info.http_user_name = pDlg->m_HTTPUsernameCtrl->GetValue().c_str();
|
||||
|
@ -1076,16 +1097,6 @@ void CMainFrame::OnToolsOptions(wxCommandEvent& WXUNUSED(event)) {
|
|||
pDoc->proxy_info.socks_server_port = iBuffer;
|
||||
|
||||
pDoc->SetProxyConfiguration();
|
||||
|
||||
if (m_iSelectedLanguage != pDlg->m_LanguageSelectionCtrl->GetSelection()) {
|
||||
ShowAlert(
|
||||
_("The BOINC Managers default language has been changed, in order for this change to take affect you must restart the manager."),
|
||||
_("Language Selection..."),
|
||||
wxICON_INFORMATION
|
||||
);
|
||||
}
|
||||
|
||||
m_iSelectedLanguage = pDlg->m_LanguageSelectionCtrl->GetSelection();
|
||||
}
|
||||
|
||||
if (pDlg)
|
||||
|
@ -1680,32 +1691,7 @@ void CMainFrame::ShowAlert( const wxString title, const wxString message, const
|
|||
|
||||
|
||||
void CMainFrame::ExecuteBrowserLink(const wxString &strLink) {
|
||||
wxString strMimeType = wxEmptyString;
|
||||
|
||||
if (strLink.StartsWith(wxT("http://")))
|
||||
strMimeType = wxT("text/html");
|
||||
else if (strLink.StartsWith(wxT("ftp://")))
|
||||
strMimeType = wxT("text/html");
|
||||
else if (strLink.StartsWith(wxT("mailto:")))
|
||||
strMimeType = wxT("message/rfc822");
|
||||
else
|
||||
return;
|
||||
|
||||
wxFileType* ft = wxTheMimeTypesManager->GetFileTypeFromMimeType(strMimeType);
|
||||
if (ft) {
|
||||
wxString cmd;
|
||||
if (ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(strLink))) {
|
||||
#ifdef __WXMAC__
|
||||
cmd.Replace(wxT("<"), wxEmptyString);
|
||||
cmd.Prepend(wxT("open "));
|
||||
#else
|
||||
cmd.Replace(wxT("file://"), wxEmptyString);
|
||||
#endif
|
||||
::wxExecute(cmd);
|
||||
}
|
||||
|
||||
delete ft;
|
||||
}
|
||||
wxHyperLink::ExecuteLink(strLink);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,212 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// File: hyperlink.cpp
|
||||
// Purpose: wxHyperLink control
|
||||
// Maintainer: Wyo
|
||||
// Created: 2003-04-07
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2004 wxCode
|
||||
// Licence: wxWindows
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// information
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// headers
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes <wx/wx.h>.
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
// for all others, include the necessary headers (this file is usually all you
|
||||
// need because it includes almost all 'standard' wxWidgets headers)
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/wx.h>
|
||||
#endif
|
||||
|
||||
// wxWidgets headers
|
||||
#include <wx/mimetype.h> // mimetype support
|
||||
|
||||
// hyperlink headers
|
||||
#include "hyperlink.h" // wxHyperLink control
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// resources
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//============================================================================
|
||||
// declarations
|
||||
//============================================================================
|
||||
|
||||
|
||||
//============================================================================
|
||||
// implementation
|
||||
//============================================================================
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// wxHyperLink
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS (wxHyperLink, wxStaticText)
|
||||
|
||||
BEGIN_EVENT_TABLE (wxHyperLink, wxStaticText)
|
||||
EVT_ENTER_WINDOW (wxHyperLink::OnWindowEnter)
|
||||
EVT_LEAVE_WINDOW (wxHyperLink::OnWindowLeave)
|
||||
EVT_LEFT_DCLICK (wxHyperLink::OnLinkActivate)
|
||||
EVT_LEFT_DOWN (wxHyperLink::OnLinkActivate)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
bool wxHyperLink::Create (wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label,
|
||||
const wxPoint &pos,
|
||||
const wxSize &size,
|
||||
long style,
|
||||
const wxString &name) {
|
||||
bool okay = FALSE;
|
||||
|
||||
// create static text
|
||||
okay = wxStaticText::Create (parent, id, label, pos, size, style, name);
|
||||
wxASSERT_MSG (okay, _("Failed to create wxStaticText, needed by wxHyperLink!"));
|
||||
|
||||
// initialize variables
|
||||
m_URL = wxEmptyString;
|
||||
m_Marked = false;
|
||||
m_Visited = false;
|
||||
m_MarkedColour = wxColour (_T("DARK GREY"));
|
||||
m_NormalColour = wxColour (_T("BLUE"));
|
||||
m_VisitedColour = wxColour (_T("PURPLE"));
|
||||
m_HoverCursor = wxCursor (wxCURSOR_HAND);
|
||||
|
||||
// set foreground colour
|
||||
SetForegroundColour (m_NormalColour);
|
||||
wxFont font = GetFont();
|
||||
font.SetUnderlined (true);
|
||||
SetFont (font);
|
||||
|
||||
// get background colour
|
||||
m_BackgroundColour = GetBackgroundColour ();
|
||||
|
||||
return okay;
|
||||
} // Create
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// event handlers
|
||||
|
||||
void wxHyperLink::OnWindowEnter (wxMouseEvent &WXUNUSED(event)) {
|
||||
SetCursor (m_HoverCursor);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void wxHyperLink::OnWindowLeave (wxMouseEvent &WXUNUSED(event)) {
|
||||
SetCursor (wxNullCursor);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void wxHyperLink::OnLinkActivate (wxMouseEvent &WXUNUSED(event)) {
|
||||
m_Visited = TRUE;
|
||||
SetForegroundColour (m_VisitedColour);
|
||||
SetBackgroundColour (m_BackgroundColour);
|
||||
Refresh();
|
||||
if (m_URL.IsEmpty()) {
|
||||
ExecuteLink (GetLabel());
|
||||
}else{
|
||||
ExecuteLink (m_URL);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// settings functions
|
||||
|
||||
wxCursor wxHyperLink::GetHoverCursor () {
|
||||
return m_HoverCursor;
|
||||
}
|
||||
|
||||
void wxHyperLink::SetHoverCursor (wxCursor cursor) {
|
||||
m_HoverCursor = cursor;
|
||||
}
|
||||
|
||||
wxColour wxHyperLink::GetMarkedColour () {
|
||||
return m_MarkedColour;
|
||||
}
|
||||
|
||||
void wxHyperLink::SetMarkedColour (wxColour colour) {
|
||||
m_MarkedColour = colour;
|
||||
}
|
||||
|
||||
wxColour wxHyperLink::GetNormalColour () {
|
||||
return m_NormalColour;
|
||||
}
|
||||
|
||||
void wxHyperLink::SetNormalColour (wxColour colour) {
|
||||
m_NormalColour = colour;
|
||||
if (!m_Visited) {
|
||||
SetForegroundColour (m_NormalColour);
|
||||
}else{
|
||||
SetForegroundColour (m_VisitedColour);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
wxColour wxHyperLink::GetVisitedColour () {
|
||||
return m_VisitedColour;
|
||||
}
|
||||
|
||||
void wxHyperLink::SetVisitedColour (wxColour colour) {
|
||||
m_VisitedColour = colour;
|
||||
if (!m_Visited) {
|
||||
SetForegroundColour (m_NormalColour);
|
||||
}else{
|
||||
SetForegroundColour (m_VisitedColour);
|
||||
}
|
||||
Refresh();
|
||||
}
|
||||
|
||||
wxString wxHyperLink::GetURL () {
|
||||
return m_URL;
|
||||
}
|
||||
|
||||
void wxHyperLink::SetURL (const wxString &url) {
|
||||
m_URL = url;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// private functions
|
||||
|
||||
void wxHyperLink::ExecuteLink (const wxString &strLink) {
|
||||
wxString strMimeType = wxEmptyString;
|
||||
|
||||
if (strLink.StartsWith(wxT("http://")))
|
||||
strMimeType = wxT("text/html");
|
||||
else if (strLink.StartsWith(wxT("ftp://")))
|
||||
strMimeType = wxT("text/html");
|
||||
else if (strLink.StartsWith(wxT("mailto:")))
|
||||
strMimeType = wxT("message/rfc822");
|
||||
else
|
||||
return;
|
||||
|
||||
wxFileType* ft = wxTheMimeTypesManager->GetFileTypeFromMimeType(strMimeType);
|
||||
if (ft) {
|
||||
wxString cmd;
|
||||
if (ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(strLink))) {
|
||||
#ifdef __WXMAC__
|
||||
cmd.Replace(wxT("<"), wxEmptyString);
|
||||
cmd.Prepend(wxT("open "));
|
||||
#else
|
||||
cmd.Replace(wxT("file://"), wxEmptyString);
|
||||
#endif
|
||||
::wxExecute(cmd);
|
||||
}
|
||||
|
||||
delete ft;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
//////////////////////////////////////////////////////////////////////////////
|
||||
// File: hyperlink.h
|
||||
// Purpose: wxHyperLink control
|
||||
// Maintainer: Wyo
|
||||
// Created: 2003-04-07
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2004 wxCode
|
||||
// Licence: wxWindows
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _MY_HYPERLINK_H_
|
||||
#define _MY_HYPERLINK_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "hyperlink.h"
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// information
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// headers
|
||||
//----------------------------------------------------------------------------
|
||||
//! wxWidgets headers
|
||||
|
||||
|
||||
//============================================================================
|
||||
// declarations
|
||||
//============================================================================
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//!
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//! wxHyperLink
|
||||
class wxHyperLink: public wxStaticText {
|
||||
|
||||
DECLARE_DYNAMIC_CLASS (wxHyperLink)
|
||||
|
||||
public:
|
||||
|
||||
//! default constructor
|
||||
wxHyperLink () {}
|
||||
|
||||
//! create constructor
|
||||
wxHyperLink (wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label = wxEmptyString,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = _T("HyperLink")) {
|
||||
Create (parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
// function create
|
||||
bool Create (wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString &label = wxEmptyString,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString &name = _T("HyperLink"));
|
||||
|
||||
// event handlers
|
||||
void OnWindowEnter (wxMouseEvent& event);
|
||||
void OnWindowLeave (wxMouseEvent& event);
|
||||
void OnLinkActivate (wxMouseEvent& event);
|
||||
|
||||
// get/set settings
|
||||
wxCursor GetHoverCursor ();
|
||||
void SetHoverCursor (wxCursor cursor);
|
||||
wxColour GetMarkedColour ();
|
||||
void SetMarkedColour (wxColour colour);
|
||||
wxColour GetNormalColour ();
|
||||
void SetNormalColour (wxColour colour);
|
||||
wxColour GetVisitedColour ();
|
||||
void SetVisitedColour (wxColour colour);
|
||||
wxString GetURL ();
|
||||
void SetURL (const wxString &url);
|
||||
|
||||
//! execute according to mimetype
|
||||
static void ExecuteLink (const wxString &link);
|
||||
|
||||
private:
|
||||
|
||||
//! hypertext variables
|
||||
wxString m_URL;
|
||||
bool m_Marked;
|
||||
bool m_Visited;
|
||||
|
||||
//! style settings
|
||||
wxCursor m_HoverCursor;
|
||||
wxColour m_MarkedColour;
|
||||
wxColour m_NormalColour;
|
||||
wxColour m_VisitedColour;
|
||||
wxColour m_BackgroundColour;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // _MY_HYPERLINK_H_
|
||||
|
|
@ -238,6 +238,9 @@
|
|||
CompileAs="2"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientgui\hyperlink.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientgui\LogBOINC.cpp">
|
||||
</File>
|
||||
|
@ -491,6 +494,9 @@
|
|||
<File
|
||||
RelativePath="..\lib\gui_rpc_client.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientgui\hyperlink.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\clientgui\LogBOINC.h">
|
||||
</File>
|
||||
|
|
Loading…
Reference in New Issue