From 6d7b419d42aa8a5df91836dee3c4b3b7a8849bf8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 4 Jul 2013 22:19:32 +0100 Subject: Use non-faulty DirPicker for config dialog too if required. --- src/wx/config_dialog.cc | 2 +- src/wx/config_dialog.h | 3 ++- src/wx/new_film_dialog.cc | 9 +++------ src/wx/new_film_dialog.h | 6 ++---- src/wx/wx_util.h | 15 +++++++++++++++ 5 files changed, 23 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 4daf581ba..a737818ec 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -109,7 +109,7 @@ ConfigDialog::make_misc_panel () table->AddSpacer (0); add_label_to_sizer (table, _misc_panel, _("Default directory for new films")); -#ifdef __WXMSW__ +#ifdef DVDOMATIC_USE_OWN_DIR_PICKER _default_directory = new DirPickerCtrl (_misc_panel); #else _default_directory = new wxDirPickerCtrl (_misc_panel, wxDD_DIR_MUST_EXIST); diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h index 526480912..a97788942 100644 --- a/src/wx/config_dialog.h +++ b/src/wx/config_dialog.h @@ -25,6 +25,7 @@ #include #include #include +#include "wx_util.h" class DirPickerCtrl; class wxNotebook; @@ -85,7 +86,7 @@ private: wxTextCtrl* _tms_user; wxTextCtrl* _tms_password; wxSpinCtrl* _num_local_encoding_threads; -#ifdef __WXMSW__ +#ifdef DVDOMATIC_USE_OWN_DIR_PICKER DirPickerCtrl* _default_directory; #else wxDirPickerCtrl* _default_directory; diff --git a/src/wx/new_film_dialog.cc b/src/wx/new_film_dialog.cc index 91caa4963..8beb13004 100644 --- a/src/wx/new_film_dialog.cc +++ b/src/wx/new_film_dialog.cc @@ -21,10 +21,10 @@ #include #include "lib/config.h" #include "new_film_dialog.h" -#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) +#include "wx_util.h" +#ifdef DVDOMATIC_USE_OWN_DIR_PICKER #include "dir_picker_ctrl.h" #endif -#include "wx_util.h" using namespace std; using namespace boost; @@ -47,10 +47,7 @@ NewFilmDialog::NewFilmDialog (wxWindow* parent) add_label_to_sizer (table, this, _("Create in folder")); - /* GTK 2.24.17 has a buggy GtkFileChooserButton and it was put in Ubuntu 13.04. - Use our own dir picker as this is the least bad option I can think of. - */ -#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) +#ifdef DVDOMATIC_USE_OWN_DIR_PICKER _folder = new DirPickerCtrl (this); #else _folder = new wxDirPickerCtrl (this, wxDD_DIR_MUST_EXIST); diff --git a/src/wx/new_film_dialog.h b/src/wx/new_film_dialog.h index 70bb7945b..220bba732 100644 --- a/src/wx/new_film_dialog.h +++ b/src/wx/new_film_dialog.h @@ -19,9 +19,7 @@ #include #include -#ifdef __WXGTK__ -#include -#endif +#include "wx_util.h" class DirPickerCtrl; @@ -35,7 +33,7 @@ public: private: wxTextCtrl* _name; -#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) +#ifdef DVDOMATIC_USE_OWN_DIR_PICKER DirPickerCtrl* _folder; #else wxDirPickerCtrl* _folder; diff --git a/src/wx/wx_util.h b/src/wx/wx_util.h index 00a625e1c..464aa1752 100644 --- a/src/wx/wx_util.h +++ b/src/wx/wx_util.h @@ -17,10 +17,16 @@ */ +#ifndef DVDOMATIC_WX_UTIL_H +#define DVDOMATIC_WX_UTIL_H + #include #include #include #include +#ifdef __WXGTK__ +#include +#endif class wxFilePickerCtrl; class wxSpinCtrl; @@ -69,3 +75,12 @@ extern void checked_set (wxTextCtrl* widget, std::string value); extern void checked_set (wxCheckBox* widget, bool value); extern void checked_set (wxRadioButton* widget, bool value); extern void checked_set (wxStaticText* widget, std::string value); + +/* GTK 2.24.17 has a buggy GtkFileChooserButton and it was put in Ubuntu 13.04. + Use our own dir picker as this is the least bad option I can think of. +*/ +#if defined(__WXMSW__) || (GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 24 && GTK_MICRO_VERSION == 17) +#define DVDOMATIC_USE_OWN_DIR_PICKER +#endif + +#endif -- cgit v1.2.3