]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/qt4.cpp
Qt: Minimalist style should have flat buttons for DVD and TT too.
[vlc] / modules / gui / qt4 / qt4.cpp
index 389f53facf5eb9dc0588d8204d2f4b6a54e9bae6..bfc0f88a096b49269d32780360e300ecf1ad006d 100644 (file)
@@ -149,9 +149,9 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
                                   "as lyrics, album arts...\n" \
                              " - minimal mode with limited controls" )
 
-#define QT_NORMAL_MODE_TEXT N_( "Classic look" )
-#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete look with information area" )
-#define QT_MINIMAL_MODE_TEXT N_( "Minimal look with no menus" )
+#define QT_NORMAL_MODE_TEXT N_( "Classic" )
+#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete (with information area)" )
+#define QT_MINIMAL_MODE_TEXT N_( "Minimal (without menu)" )
 
 #define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" )
 #define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" )
@@ -223,7 +223,7 @@ vlc_module_begin ()
                  UPDATER_DAYS_TEXT, false )
 #endif
     add_string( "qt-slider-colours",
-                "255;255;255;20;226;20;255;176;15;235;30;20",
+                "255;255;255;20;210;20;255;199;15;245;39;29",
                 NULL, SLIDERCOL_TEXT, SLIDERCOL_LONGTEXT, false )
 
     add_bool( "qt-privacy-ask", true, NULL, PRIVACY_TEXT, PRIVACY_TEXT,
@@ -278,6 +278,7 @@ static int Open( vlc_object_t *p_this )
         msg_Err( p_intf, "Could not connect to X server" );
         return VLC_EGENERIC;
     }
+    XCloseDisplay( p_display );
 #endif
 
     /* Allocations of p_sys */
@@ -286,9 +287,6 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_popup_menu = NULL;
     p_sys->p_mi = NULL;
     p_sys->p_playlist = pl_Hold( p_intf );
-#ifdef Q_WS_X11
-    p_sys->display = p_display;
-#endif
 
     /* */
     if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
@@ -335,9 +333,6 @@ static void Close( vlc_object_t *p_this )
     QVLCApp::triggerQuit();
 
     vlc_join (p_sys->thread, NULL);
-#ifdef Q_WS_X11
-    XCloseDisplay ((Display *)p_sys->display);
-#endif
     pl_Release (p_this);
     delete p_sys;
 }
@@ -355,23 +350,17 @@ static void *Thread( void *obj )
 
     Q_INIT_RESOURCE( vlc );
 
-#if !defined(WIN32) && !defined(__APPLE__)
-    /* KLUDGE:
-     * disables icon theme use because that makes Cleanlooks style bug
-     * because it asks gconf for some settings that timeout because of threads
-     * see commits 21610 21622 21654 for reference */
-
-    /* If you don't have a gconftool-2 binary, you should comment this line */
-    if( strcmp( qVersion(), "4.4.0" ) < 0 ) /* fixed in Qt 4.4.0 */
-        QApplication::setDesktopSettingsAware( false );
-#endif
-
     /* Start the QApplication here */
 #ifdef Q_WS_X11
-    QVLCApp app( (Display *)p_intf->p_sys->display, argc, argv );
-#else
-    QVLCApp app( argc, argv );
+    char *display = var_CreateGetNonEmptyString( p_intf, "x11-display" );
+    if( display )
+    {
+        argv[argc++] = const_cast<char *>("-display");
+        argv[argc++] = display;
+        argv[argc] = NULL;
+    }
 #endif
+    QVLCApp app( argc, argv );
     p_intf->p_sys->p_app = &app;
 
 
@@ -460,9 +449,12 @@ static void *Thread( void *obj )
     app.setQuitOnLastWindowClosed( false );
 
     /* Retrieve last known path used in file browsing */
-    char *psz_path = config_GetPsz( p_intf, "qt-filedialog-path" );
-    p_intf->p_sys->psz_filepath = EMPTY_STR( psz_path ) ? config_GetHomeDir()
-                                                        : psz_path;
+    {
+        char *psz_path = config_GetPsz( p_intf, "qt-filedialog-path" );
+        p_intf->p_sys->filepath =
+            EMPTY_STR(psz_path) ? config_GetHomeDir() : qfu(psz_path);
+        free( psz_path );
+    }
 
     /* Launch */
     app.exec();
@@ -501,10 +493,13 @@ static void *Thread( void *obj )
 
 
     /* Save the path */
-    config_PutPsz( p_intf, "qt-filedialog-path", p_intf->p_sys->psz_filepath );
-    free( psz_path );
+    config_PutPsz( p_intf, "qt-filedialog-path",
+                   qtu(p_intf->p_sys->filepath) );
 
     /* Delete the application automatically */
+#ifdef Q_WS_X11
+    free( display );
+#endif
     return NULL;
 }