X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fserver_dialog.cc;h=abad589891231e0de8e876039df6b03424e43855;hb=f644c272a6a6384f6bfc6ca16ada6208057402a8;hp=04da9ad7d1496516f729bce120960dc4fe67d3ca;hpb=d99ca0a95e61b53105f765497bc465a7420e7a47;p=dcpomatic.git diff --git a/src/wx/server_dialog.cc b/src/wx/server_dialog.cc index 04da9ad7d..abad58989 100644 --- a/src/wx/server_dialog.cc +++ b/src/wx/server_dialog.cc @@ -1,35 +1,34 @@ /* Copyright (C) 2012 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ -#include "lib/server.h" +#include "lib/encode_server.h" #include "server_dialog.h" #include "wx_util.h" using std::string; using boost::shared_ptr; +using boost::optional; ServerDialog::ServerDialog (wxWindow* parent) - : wxDialog (parent, wxID_ANY, _("Server")) + : TableDialog (parent, _("Server"), 2, 1, true) { - wxFlexGridSizer* table = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); - table->AddGrowableCol (1, 1); - wxClientDC dc (parent); /* XXX: bit of a mystery why we need such a long string here */ wxSize size = dc.GetTextExtent (wxT ("255.255.255.255.255.255.255.255")); @@ -38,21 +37,10 @@ ServerDialog::ServerDialog (wxWindow* parent) wxTextValidator validator (wxFILTER_INCLUDE_CHAR_LIST); wxArrayString list; - add_label_to_sizer (table, this, _("Host name or IP address"), true); - _host = new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size); - table->Add (_host, 1, wxEXPAND | wxALL); - - wxBoxSizer* overall_sizer = new wxBoxSizer (wxVERTICAL); - overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); + add (_("Host name or IP address"), true); + _host = add (new wxTextCtrl (this, wxID_ANY, wxT (""), wxDefaultPosition, size)); - wxSizer* buttons = CreateSeparatedButtonSizer (wxOK); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - SetSizer (overall_sizer); - overall_sizer->Layout (); - overall_sizer->SetSizeHints (this); + layout (); } void @@ -61,9 +49,8 @@ ServerDialog::set (string server) _host->SetValue (std_to_wx (server)); } -string +optional ServerDialog::get () const { return wx_to_std (_host->GetValue ()); } -