[vlc-devel] [PATCH] Patch to add the option to disable the Winter Egg.

sovereign at codefaction.net sovereign at codefaction.net
Mon Jan 3 01:22:10 CET 2011


---------------------------- Original Message ----------------------------
Subject: [PATCH] Patch to add the option to disable the Winter Egg.
From:    "sovereign" <sovereign at codefaction.net>
Date:    Sun, January 2, 2011 2:07 pm
To:      sovereign at codefaction.net
--------------------------------------------------------------------------

From: Ernest E. Teem III <sovereign at codefaction.net>

---
 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                          |    2 +-
 src/libvlc-module.c                              |    7 +++++++
 5 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp
b/modules/gui/qt4/components/interface_widgets.cpp
index 084a89c..3a648d9 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_CHRISTMAS_TROLL_DAY )
+        if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY &&
var_InheritBool( p_intf, "qt-winter-egg" ) )
             pixmapUrl = QString( ":/logo/vlc128-christmas.png" );
         else
             pixmapUrl = QString( ":/logo/vlc128.png" );
diff --git a/modules/gui/qt4/dialogs/help.cpp
b/modules/gui/qt4/dialogs/help.cpp
index 76a631e..e25bf86 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_CHRISTMAS_TROLL_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY &&
var_InheritBool( p_intf, "qt-winter-egg" ) )
         ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-christmas.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 139ce17..81d37c6 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_CHRISTMAS_TROLL_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY &&
var_InheritBool( p_intf, "qt-winter-egg" ) )
         iconVLC =  QIcon( ":/logo/vlc128-christmas.png" );
     else
         iconVLC =  QIcon( ":/logo/vlc128.png" );
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index ecfb769..614fa01 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -479,7 +479,7 @@ static void *Thread( void *obj )

     /* Icon setting, Mac uses icon from .icns */
 #ifndef Q_WS_MAC
-    if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
+    if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY &&
var_InheritBool( p_intf, "qt-winter-egg" ) )
         app.setWindowIcon( QIcon(vlc_christmas_xpm) );
     else
         app.setWindowIcon( QIcon(vlc_xpm) );
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 6701889..0a4853d 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1228,6 +1228,11 @@ static const char *const ppsz_clock_descriptions[] =
     "When using the one instance only option, enqueue items to playlist " \
     "and keep playing current item.")

+#define WINTEREGG_TEXT N_( \
+    "Activate the QT Winter Egg")
+#define WINTEREGG_LONGTEXT N_( \
+    "Activate / Deactivate The QT Winter Egg. Humbug!")
+
 /*****************************************************************************
  * Playlist
  ****************************************************************************/
@@ -2119,6 +2124,8 @@ vlc_module_begin ()
               ONEINSTANCEWHENSTARTEDFROMFILE_LONGTEXT, true )
     add_bool( "playlist-enqueue", 0, PLAYLISTENQUEUE_TEXT,
               PLAYLISTENQUEUE_LONGTEXT, true )
+    add_bool( "qt-winter-egg", 1, WINTEREGG_TEXT,
+              WINTEREGG_LONGTEXT, true )
 #endif

 #if defined(WIN32)
-- 
1.6.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Patch-to-add-the-option-to-disable-the-Winter-Egg.patch
Type: text/x-patch
Size: 4213 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110102/c18225b1/attachment.bin>


More information about the vlc-devel mailing list