Use non-faulty DirPicker for config dialog too if required.
authorCarl Hetherington <cth@carlh.net>
Thu, 4 Jul 2013 21:19:32 +0000 (22:19 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 4 Jul 2013 21:19:32 +0000 (22:19 +0100)
src/wx/config_dialog.cc
src/wx/config_dialog.h
src/wx/new_film_dialog.cc
src/wx/new_film_dialog.h
src/wx/wx_util.h

index 4daf581ba410191b71773b3655cb2c6d1bed96d7..a737818ec782f87dd5fc23551af1f510b3427e93 100644 (file)
@@ -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);
index 526480912abade4c92ef56030b65f07bf928cd59..a97788942654fdf6e560750094775f86c1efbda0 100644 (file)
@@ -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;
index 91caa4963c268e3c3727b5af5c456ebec254b6f3..8beb13004d441460a28d0598e1581444accf8e1b 100644 (file)
 #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);
index 70bb7945b1db915fbdc133c1a5ce9ed9af34570a..220bba732ef1858c499583e944979cac4619f92c 100644 (file)
@@ -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;
index 00a625e1c90c5e0dd733cd32b9bbd3683dff9eea..464aa17523709865c2d86102db701340e7e62746 100644 (file)
 
 */
 
+#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