You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #include "options.h"
-
- options::options( wxWindow* parent )
- :
- dialog_Options( parent )
- {
- configuration = new config(this);
- dirpicker_dbpath->SetPath(configuration->GetDbpath());
- checkbox_proxy->SetValue(configuration->IsUseproxy());
- textctrl_url->SetValue(configuration->GetProxyurl());
- spinctrl_port->SetValue(configuration->GetProxyport());
- updatefields();
- }
-
- options::~options()
- {
- delete configuration;
- }
-
- void options::OnCancel( wxCloseEvent& event )
- {
- dirpicker_dbpath->SetPath(configuration->GetDbpath());
- checkbox_proxy->SetValue(configuration->IsUseproxy());
- textctrl_url->SetValue(configuration->GetProxyurl());
- spinctrl_port->SetValue(configuration->GetProxyport());
- this->Hide();
- updatefields();
- }
-
- void options::OnCancel( wxCommandEvent& event )
- {
- dirpicker_dbpath->SetPath(configuration->GetDbpath());
- checkbox_proxy->SetValue(configuration->IsUseproxy());
- textctrl_url->SetValue(configuration->GetProxyurl());
- spinctrl_port->SetValue(configuration->GetProxyport());
- this->Hide();
- updatefields();
- }
-
- void options::OnOk( wxCommandEvent& event )
- {
- configuration->SetDbpath(dirpicker_dbpath->GetPath());
- configuration->SetUseproxy(checkbox_proxy->GetValue());
- configuration->SetProxyurl(textctrl_url->GetValue());
- configuration->SetProxyport(spinctrl_port->GetValue());
- configuration->save();
- this->Hide();
- }
-
- void options::OnToggleProxy( wxCommandEvent& event )
- {
- updatefields();
- }
-
- void options::updatefields()
- {
- if (!checkbox_proxy->GetValue())
- {
- textctrl_url->Disable();
- spinctrl_port->Disable();
- }
- else
- {
- textctrl_url->Enable();
- spinctrl_port->Enable();
- }
- }
|