summaryrefslogtreecommitdiff
path: root/src/wx/server_dialog.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-17 21:47:08 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-17 21:47:08 +0100
commit2499c41097f8410cb3016e095a85d68979485a7b (patch)
tree331a23489d3be42ede2861311a797792ba663805 /src/wx/server_dialog.cc
parent89af81886eeee57861bc23984a0583bec76d536d (diff)
Various bits mostly related to colour conversions.
Diffstat (limited to 'src/wx/server_dialog.cc')
-rw-r--r--src/wx/server_dialog.cc33
1 files changed, 10 insertions, 23 deletions
diff --git a/src/wx/server_dialog.cc b/src/wx/server_dialog.cc
index a0f1f04ae..31b3ce5dc 100644
--- a/src/wx/server_dialog.cc
+++ b/src/wx/server_dialog.cc
@@ -23,15 +23,9 @@
using boost::shared_ptr;
-ServerDialog::ServerDialog (wxWindow* parent, shared_ptr<ServerDescription> server)
+ServerDialog::ServerDialog (wxWindow* parent)
: wxDialog (parent, wxID_ANY, _("Server"))
{
- if (server) {
- _server = server;
- } else {
- _server.reset (new ServerDescription (wx_to_std (N_("localhost")), 1));
- }
-
wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
table->AddGrowableCol (1, 1);
@@ -43,12 +37,7 @@ ServerDialog::ServerDialog (wxWindow* parent, shared_ptr<ServerDescription> serv
_threads = new wxSpinCtrl (this, wxID_ANY);
table->Add (_threads, 1, wxEXPAND);
- _host->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&ServerDialog::host_changed, this));
_threads->SetRange (0, 256);
- _threads->Bind (wxEVT_COMMAND_SPINCTRL_UPDATED, boost::bind (&ServerDialog::threads_changed, this));
-
- _host->SetValue (std_to_wx (_server->host_name ()));
- _threads->SetValue (_server->threads ());
wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6);
@@ -64,20 +53,18 @@ ServerDialog::ServerDialog (wxWindow* parent, shared_ptr<ServerDescription> serv
}
void
-ServerDialog::host_changed ()
-{
- _server->set_host_name (wx_to_std (_host->GetValue ()));
-}
-
-void
-ServerDialog::threads_changed ()
+ServerDialog::set (ServerDescription server)
{
- _server->set_threads (_threads->GetValue ());
+ _host->SetValue (std_to_wx (server.host_name ()));
+ _threads->SetValue (server.threads ());
}
-shared_ptr<ServerDescription>
-ServerDialog::server () const
+ServerDescription
+ServerDialog::get () const
{
- return _server;
+ ServerDescription server;
+ server.set_host_name (wx_to_std (_host->GetValue ()));
+ server.set_threads (_threads->GetValue ());
+ return server;
}