]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/qt4.cpp
Qt: fallback on the high-resolution icons instead of the xpm
[vlc] / modules / gui / qt4 / qt4.cpp
index d3a5880525f1f9653e6c6206e8bb9ec60ddedd45..2492dd579ee3b62bec32a6cca5449178d06a960d 100644 (file)
 #include "input_manager.hpp"    /* THEMIM destruction */
 #include "dialogs_provider.hpp" /* THEDP creation */
 #include "main_interface.hpp"   /* MainInterface creation */
+#include "extensions_manager.hpp" /* Extensions manager */
 #include "dialogs/help.hpp"     /* Launch Update */
 #include "recents.hpp"          /* Recents Item destruction */
 #include "util/qvlcapp.hpp"     /* QVLCApplication definition */
 #include "components/playlist/playlist_model.hpp" /* for ~PLModel() */
-#include <vlc_aout_intf.h>
 
 #ifdef Q_WS_X11
  #include <vlc_xlib.h>
 #endif
 
-#include "../../../share/icons/32x32/vlc.xpm"
-#include "../../../share/icons/32x32/vlc-xmas.xpm"
 #include <vlc_plugin.h>
 #include <vlc_vout_window.h>
 
-#ifdef WIN32 /* For static builds */
+#ifdef _WIN32 /* For static builds */
  #include <QtPlugin>
  Q_IMPORT_PLUGIN(qjpeg)
  Q_IMPORT_PLUGIN(qtaccessiblewidgets)
@@ -100,10 +98,6 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
     "Show a notification popup with the artist and track name when " \
     "the current playlist item changes, when VLC is minimized or hidden." )
 
-#define ADVANCED_OPTIONS_TEXT N_( "Advanced options" )
-#define ADVANCED_OPTIONS_LONGTEXT N_( "Show all the advanced options " \
-                                      "in the dialogs." )
-
 #define OPACITY_TEXT N_( "Windows opacity between 0.1 and 1" )
 #define OPACITY_LONGTEXT N_( "Sets the windows opacity between 0.1 and 1 " \
                              "for main interface, playlist and extended panel."\
@@ -181,6 +175,8 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define ICONCHANGE_LONGTEXT N_( \
     "This option allows the interface to change its icon on various occasions.")
 
+#define VOLUME_MAX_TEXT N_( "Maximum Volume displayed" )
+
 static const int i_notification_list[] =
     { NOTIFICATION_NEVER, NOTIFICATION_MINIMIZED, NOTIFICATION_ALWAYS };
 
@@ -201,13 +197,7 @@ vlc_module_begin ()
     add_bool( "qt-minimal-view", false, QT_MINIMAL_MODE_TEXT,
               QT_MINIMAL_MODE_TEXT, false );
 
-    add_bool( "qt-system-tray",
-#ifdef HAVE_MAEMO
-            false,
-#else
-            true,
-#endif
-            SYSTRAY_TEXT, SYSTRAY_LONGTEXT, false)
+    add_bool( "qt-system-tray", true, SYSTRAY_TEXT, SYSTRAY_LONGTEXT, false)
 
     add_integer( "qt-notification", NOTIFICATION_MINIMIZED,
                  NOTIFICATION_TEXT,
@@ -243,7 +233,7 @@ vlc_module_begin ()
               UPDATER_DAYS_TEXT, UPDATER_DAYS_TEXT, false )
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
     add_bool( "qt-disable-volume-keys"             /* name */,
               true                                 /* default value */,
               QT_DISABLE_VOLUME_KEYS_TEXT          /* text */,
@@ -280,6 +270,8 @@ vlc_module_begin ()
 
     add_bool( "qt-icon-change", true, ICONCHANGE_TEXT, ICONCHANGE_LONGTEXT, true )
 
+    add_integer_with_range( "qt-max-volume", 125, 60, 300, VOLUME_MAX_TEXT, VOLUME_MAX_TEXT, true)
+
     add_obsolete_bool( "qt-blingbling" )      /* Suppressed since 1.0.0 */
     add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
 
@@ -300,7 +292,7 @@ vlc_module_begin ()
         set_capability( "vout window xid", 0 )
         set_callbacks( WindowOpen, WindowClose )
 #endif
-#if defined (Q_WS_WIN) || (defined (Q_WS_QPA) && defined (WIN32)) \
+#if defined (Q_WS_WIN) || (defined (Q_WS_QPA) && defined (_WIN32)) \
  || defined (Q_WS_PM)  || (defined (Q_WS_QPA) && defined (__OS2__))
     add_submodule ()
         set_capability( "vout window hwnd", 0 )
@@ -425,8 +417,11 @@ static void Close( vlc_object_t *p_this )
 
     if( !p_sys->b_isDialogProvider )
     {
-        var_Destroy (pl_Get(p_this), "window");
-        var_Destroy (pl_Get(p_this), "qt4-iface");
+        playlist_t *pl = pl_Get(p_this);
+
+        var_Destroy (pl, "window");
+        var_Destroy (pl, "qt4-iface");
+        playlist_Deactivate (pl); /* release window provider if needed */
     }
 
     /* And quit */
@@ -462,7 +457,7 @@ static void *Thread( void *obj )
 
     /* All the settings are in the .conf/.ini style */
     p_intf->p_sys->mainSettings = new QSettings(
-#ifdef WIN32
+#ifdef _WIN32
             QSettings::IniFormat,
 #else
             QSettings::NativeFormat,
@@ -472,9 +467,9 @@ static void *Thread( void *obj )
     /* Icon setting, Mac uses icon from .icns */
 #ifndef Q_WS_MAC
     if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
-        app.setWindowIcon( QIcon(vlc_xmas_xpm) );
+        app.setWindowIcon( QIcon::fromTheme( "vlc-xmas", QIcon( ":/logo/vlc128-xmas.png" ) ) );
     else
-        app.setWindowIcon( QIcon(vlc_xpm) );
+        app.setWindowIcon( QIcon::fromTheme( "vlc", QIcon( ":/logo/vlc256.png" ) ) );
 #endif
 
     /* Initialize timers and the Dialog Provider */
@@ -567,6 +562,9 @@ static void *Thread( void *obj )
         delete p_mi;
     }
 
+    /* */
+    ExtensionsManager::killInstance();
+
     /* Destroy all remaining windows,
        because some are connected to some slots
        in the MainInputManager
@@ -655,7 +653,7 @@ static int WindowOpen( vout_window_t *p_wnd, const vout_window_cfg_t *cfg )
     switch( cfg->type )
     {
         case VOUT_WINDOW_TYPE_XID:
-            p_wnd->handle.xid = wid;
+            p_wnd->handle.xid = (uintptr_t)wid;
             p_wnd->display.x11 = NULL;
             break;
         case VOUT_WINDOW_TYPE_HWND: