[vlc-devel] [PATCH] This patch gives VLC users the option of enabling / disabling changes to its icon
sovereign at codefaction.net
sovereign at codefaction.net
Mon Jan 3 19:20:33 CET 2011
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 1a8deb5..aa5d22b 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-winter-joke" ) )
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..0394836 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-winter-joke" ) )
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..c4ddd2b 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-winter-joke" ) )
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..a8fd56f 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_XMAS_JOKE_DAY )
+ if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY &&
var_InheritBool( p_intf, "qt-winter-joke" ) )
app.setWindowIcon( QIcon(vlc_xmas_xpm) );
else
app.setWindowIcon( QIcon(vlc_xpm) );
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 6701889..70e0a24 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 WINTERJOKE_TEXT N_( \
+ "Allow VLC To Change Its ICON")
+#define WINTERJOKE_LONGTEXT N_( \
+ "This option allows VLC to change its icon during various occassions.")
+
/*****************************************************************************
* 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-joke", 1, WINTERJOKE_TEXT,
+ WINTERJOKE_LONGTEXT, true )
#endif
#if defined(WIN32)
--
1.6.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-This-patch-gives-VLC-users-the-option-of-enabling-di.patch
Type: text/x-patch
Size: 4206 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110103/eeb4629e/attachment.bin>
More information about the vlc-devel
mailing list