[vlc-commits] commit: Qt: option for enabling / disabling changes to its icon (Ernest E. Teem III )

git at videolan.org git at videolan.org
Thu Jan 6 15:34:50 CET 2011


vlc | branch: master | Ernest E. Teem III <sovereign at codefaction.net> | Thu Jan  6 15:32:21 2011 +0100| [d5a52a3a3c1c276871acc236534e6ca6c4c02b5f] | committer: Jean-Baptiste Kempf 

Qt: option for enabling / disabling changes to its icon

Modified by Jean-Baptiste Kempf, to fit option style

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d5a52a3a3c1c276871acc236534e6ca6c4c02b5f
---

 modules/gui/qt4/components/interface_widgets.cpp |    2 +-
 modules/gui/qt4/dialogs/help.cpp                 |    2 +-
 modules/gui/qt4/main_interface.cpp               |    2 +-
 modules/gui/qt4/qt4.cpp                          |    8 +++++++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 1a8deb5..2f346c3 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -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" );
diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
index 1c95350..229601e 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -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" ) );
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index 2931d4f..52015b3 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -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" );
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index 30c1f1e..9caadf7 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -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) );



More information about the vlc-commits mailing list