using boost::optional;
using boost::shared_ptr;
using boost::function;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
static
bool
_config_connection = Config::instance()->Changed.connect (bind (&Page::config_changed_wrapper, this));
}
+
+wxWindow*
+Page::CreateWindow (wxWindow* parent)
+{
+ return create_window (parent);
+}
+
+
wxWindow*
Page::create_window (wxWindow* parent)
{
}
-StockPage::StockPage (Kind kind, wxSize panel_size, int border)
- : wxStockPreferencesPage (kind)
- , Page (panel_size, border)
-{
-
-}
-
-wxWindow*
-StockPage::CreateWindow (wxWindow* parent)
-{
- return create_window (parent);
-}
-
-StandardPage::StandardPage (wxSize panel_size, int border)
+GeneralPage::GeneralPage (wxSize panel_size, int border)
: Page (panel_size, border)
{
}
-wxWindow*
-StandardPage::CreateWindow (wxWindow* parent)
-{
- return create_window (parent);
-}
-GeneralPage::GeneralPage (wxSize panel_size, int border)
- : StockPage (Kind_General, panel_size, border)
+wxString
+GeneralPage::GetName () const
{
-
+ return _("General");
}
+
void
GeneralPage::add_language_controls (wxGridBagSizer* table, int& r)
{
, _get (get)
, _nag_alter (nag_alter)
{
- wxFont subheading_font (*wxNORMAL_FONT);
- subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
-
_sizer = new wxBoxSizer (wxVERTICAL);
- {
- wxStaticText* m = new StaticText (this, title);
- m->SetFont (subheading_font);
- _sizer->Add (m, 0, wxALL, border);
- }
-
wxBoxSizer* certificates_sizer = new wxBoxSizer (wxHORIZONTAL);
- _sizer->Add (certificates_sizer, 0, wxLEFT | wxRIGHT, border);
+ _sizer->Add (certificates_sizer, 0, wxALL, border);
_certificates = new wxListCtrl (this, wxID_ANY, wxDefaultPosition, wxSize (440, 150), wxLC_REPORT | wxLC_SINGLE_SEL);
sizer->Add (m, 0, wxALL, _border);
}
+ wxSizer* buttons = new wxBoxSizer (wxVERTICAL);
+
wxButton* export_decryption_certificate = new Button (_panel, _("Export KDM decryption certificate..."));
- sizer->Add (export_decryption_certificate, 0, wxLEFT, _border);
+ buttons->Add (export_decryption_certificate, 0, wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
wxButton* export_settings = new Button (_panel, _("Export all KDM decryption settings..."));
- sizer->Add (export_settings, 0, wxLEFT, _border);
+ buttons->Add (export_settings, 0, wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
wxButton* import_settings = new Button (_panel, _("Import all KDM decryption settings..."));
- sizer->Add (import_settings, 0, wxLEFT, _border);
+ buttons->Add (import_settings, 0, wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP);
wxButton* decryption_advanced = new Button (_panel, _("Advanced..."));
- sizer->Add (decryption_advanced, 0, wxALL, _border);
+ buttons->Add (decryption_advanced, 0);
+
+ sizer->Add (buttons, 0, wxLEFT, _border);
export_decryption_certificate->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_certificate, this));
export_settings->Bind (wxEVT_BUTTON, bind (&KeysPage::export_decryption_chain_and_key, this));
}
wxButton* signing_advanced = new Button (_panel, _("Advanced..."));
- sizer->Add (signing_advanced, 0, wxLEFT, _border);
+ sizer->Add (signing_advanced, 0, wxLEFT | wxBOTTOM, _border);
signing_advanced->Bind (wxEVT_BUTTON, bind (&KeysPage::signing_advanced, this));
}
RtAudio audio (DCPOMATIC_RTAUDIO_API);
for (unsigned int i = 0; i < audio.getDeviceCount(); ++i) {
- RtAudio::DeviceInfo dev = audio.getDeviceInfo (i);
- if (dev.probed && dev.outputChannels > 0) {
- _sound_output->Append (std_to_wx (dev.name));
+ try {
+ RtAudio::DeviceInfo dev = audio.getDeviceInfo (i);
+ if (dev.probed && dev.outputChannels > 0) {
+ _sound_output->Append (std_to_wx (dev.name));
+ }
+#ifdef DCPOMATIC_USE_RTERROR
+ } catch (RtError&) {
+#else
+ } catch (RtAudioError&) {
+#endif
+ /* Something went wrong so let's just ignore that device */
}
}
{
RtAudio audio (DCPOMATIC_RTAUDIO_API);
optional<string> const so = get_sound_output();
- if (!so || *so == audio.getDeviceInfo(audio.getDefaultOutputDevice()).name) {
+ string default_device;
+ try {
+ default_device = audio.getDeviceInfo(audio.getDefaultOutputDevice()).name;
+ } catch (RtAudioError&) {
+ /* Never mind */
+ }
+ if (!so || *so == default_device) {
Config::instance()->unset_sound_output ();
} else {
Config::instance()->set_sound_output (*so);
LocationsPage::LocationsPage (wxSize panel_size, int border)
- : StandardPage (panel_size, border)
+ : Page (panel_size, border)
{
}
void
LocationsPage::setup ()
{
-
int r = 0;
wxGridBagSizer* table = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);