]> git.sesse.net Git - vlc/commitdiff
Qt: option for enabling / disabling changes to its icon
authorErnest E. Teem III <sovereign@codefaction.net>
Thu, 6 Jan 2011 14:32:21 +0000 (15:32 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 6 Jan 2011 14:33:17 +0000 (15:33 +0100)
Modified by Jean-Baptiste Kempf, to fit option style

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/dialogs/help.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/qt4.cpp

index 1a8deb52de24f171408dc388afa3e57d76d8d3a4..2f346c39a454972f83e4aeb9522b6cd8999c09b8 100644 (file)
@@ -212,7 +212,7 @@ void BackgroundWidget::updateArt( const QString& url )
     }
     else
     {   /* Xmas joke */
-        if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY )
+        if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
             pixmapUrl = QString( ":/logo/vlc128-xmas.png" );
         else
             pixmapUrl = QString( ":/logo/vlc128.png" );
index 1c95350e2eb4485391f12b7e061c06370dcf0e9e..229601ede8f94c7c48d0468283e5d1a99169b07b 100644 (file)
@@ -102,7 +102,7 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
     ui.introduction->setText(
             qtr( "VLC media player" ) + qfu( " " VERSION_MESSAGE ) );
 
-    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
         ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-xmas.png" ) );
     else
         ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
index 2931d4f5e8d071bf4bd96e9ce83c512de06ee4d7..52015b3c2322f52024b1865bf17ee09e041d4023 100644 (file)
@@ -942,7 +942,7 @@ void MainInterface::showBuffering( float f_cache )
 void MainInterface::createSystray()
 {
     QIcon iconVLC;
-    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
         iconVLC =  QIcon( ":/logo/vlc128-xmas.png" );
     else
         iconVLC =  QIcon( ":/logo/vlc128.png" );
index 30c1f1e31afb1da89b14b379b7d394dc561a63b2..9caadf7d23b6c87b68f79153635e26108935c095 100644 (file)
@@ -183,6 +183,10 @@ static void ShowDialog   ( intf_thread_t *, int, int, intf_dialog_args_t * );
 #define QT_PAUSE_MINIMIZED_LONGTEXT N_( \
     "With this option enabled, the playback will be automatically paused when minimizing the window." )
 
+#define ICONCHANGE_TEXT N_( "Allow automatic icon changes")
+#define ICONCHANGE_LONGTEXT N_( \
+    "This option allows the interface to change its icon on various occasions.")
+
 /**********************************************************************/
 vlc_module_begin ()
     set_shortname( "Qt" )
@@ -274,6 +278,8 @@ vlc_module_begin ()
     add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
     add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.0 */
 
+    add_bool( "qt-icon-change", true, ICONCHANGE_TEXT, ICONCHANGE_LONGTEXT, true )
+
 #ifdef WIN32
     cannot_unload_broken_library()
 #endif
@@ -479,7 +485,7 @@ static void *Thread( void *obj )
 
     /* Icon setting, Mac uses icon from .icns */
 #ifndef Q_WS_MAC
-    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
         app.setWindowIcon( QIcon(vlc_xmas_xpm) );
     else
         app.setWindowIcon( QIcon(vlc_xpm) );