Fix resizing/redraw problems on Windows.
[dcpomatic.git] / src / wx / server_dialog.cc
index 0ae34b1fcac3888ddc2d4da2feda6ce71d052139..7a9cf95c7a98eeb2f13aa929c0907bc0a634ad08 100644 (file)
 #include "server_dialog.h"
 #include "wx_util.h"
 
-ServerDialog::ServerDialog (wxWindow* parent, Server* server)
-       : wxDialog (parent, wxID_ANY, wxString (_("Server")))
+ServerDialog::ServerDialog (wxWindow* parent, ServerDescription* server)
+       : wxDialog (parent, wxID_ANY, _("Server"))
 {
        if (server) {
                _server = server;
        } else {
-               _server = new Server ("localhost", 1);
+               _server = new ServerDescription (wx_to_std (N_("localhost")), 1);
        }
                
        wxFlexGridSizer* table = new wxFlexGridSizer (2, 4, 4);
        table->AddGrowableCol (1, 1);
 
-       add_label_to_sizer (table, this, "Host name or IP address");
+       add_label_to_sizer (table, this, _("Host name or IP address"));
        _host = new wxTextCtrl (this, wxID_ANY);
        table->Add (_host, 1, wxEXPAND);
 
-       add_label_to_sizer (table, this, "Threads to use");
+       add_label_to_sizer (table, this, _("Threads to use"));
        _threads = new wxSpinCtrl (this, wxID_ANY);
        table->Add (_threads, 1, wxEXPAND);
 
@@ -49,7 +49,7 @@ ServerDialog::ServerDialog (wxWindow* parent, Server* server)
        _threads->SetValue (_server->threads ());
 
        wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL);
-       overall_sizer->Add (table, 1, wxEXPAND);
+       overall_sizer->Add (table, 1, wxEXPAND | wxALL, 6);
 
        wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
        if (buttons) {
@@ -73,7 +73,7 @@ ServerDialog::threads_changed (wxCommandEvent &)
        _server->set_threads (_threads->GetValue ());
 }
 
-Server *
+ServerDescription *
 ServerDialog::server () const
 {
        return _server;