summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-04 22:19:32 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-04 22:19:32 +0100
commit6d7b419d42aa8a5df91836dee3c4b3b7a8849bf8 (patch)
treec4b83b1332dea9df19a73ef79241a0f811d37b90 /src
parent78c78cdb5c4c6c62ba98fa54c9ba54812149ef7b (diff)
Use non-faulty DirPicker for config dialog too if required.
Diffstat (limited to 'src')
-rw-r--r--src/wx/config_dialog.cc2
-rw-r--r--src/wx/config_dialog.h3
-rw-r--r--src/wx/new_film_dialog.cc9
-rw-r--r--src/wx/new_film_dialog.h6
-rw-r--r--src/wx/wx_util.h15
5 files changed, 23 insertions, 12 deletions
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 <wx/spinctrl.h>
#include <wx/listctrl.h>
#include <wx/filepicker.h>
+#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 <wx/stdpaths.h>
#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 <wx/wx.h>
#include <wx/filepicker.h>
-#ifdef __WXGTK__
-#include <gtk/gtk.h>
-#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 <wx/wx.h>
#include <wx/gbsizer.h>
#include <boost/function.hpp>
#include <boost/thread.hpp>
+#ifdef __WXGTK__
+#include <gtk/gtk.h>
+#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