[vlc-devel] [PATCH] Patch to give users the ability to disable the Christmas icon
sovereign at codefaction.net
sovereign at codefaction.net
Sun Jan 2 22:56:53 CET 2011
>From 6eacf15dae61e0190ae0ff7197234f3eb07415f6 Mon Sep 17 00:00:00 2001
From: Ernest E. Teem III <sovereign at codefaction.net>
Date: Sat, 2 Jan 2010 11:40:14 -0500
Subject: [PATCH] Patch to give users the ability to disable the Christmas
icon
---
modules/gui/qt4/components/interface_widgets.cpp | 15 +++++++++++----
modules/gui/qt4/components/simple_preferences.cpp | 1 +
modules/gui/qt4/dialogs/help.cpp | 13 ++++++++++---
modules/gui/qt4/main_interface.cpp | 17 +++++++++++++----
modules/gui/qt4/qt4.cpp | 20
+++++++++++++++-----
modules/gui/qt4/ui/sprefs_interface.ui | 12 ++++++++++--
6 files changed, 60 insertions(+), 18 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp
b/modules/gui/qt4/components/interface_widgets.cpp
index 084a89c..3090c1b 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -212,10 +212,17 @@ void BackgroundWidget::updateArt( const QString& url )
}
else
{ /* Xmas joke */
- if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
- pixmapUrl = QString( ":/logo/vlc128-christmas.png" );
- else
- pixmapUrl = QString( ":/logo/vlc128.png" );
+ if ( ! var_InheritBool( p_intf, "qt-rm-christmas-joke" ))
+ {
+ if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
+ pixmapUrl = QString( ":/logo/vlc128-christmas.png" );
+ else
+ pixmapUrl = QString( ":/logo/vlc128.png" );
+ }
+ else
+ {
+ pixmapUrl = QString( ":/logo/vlc128.png" );
+ }
}
update();
}
diff --git a/modules/gui/qt4/components/simple_preferences.cpp
b/modules/gui/qt4/components/simple_preferences.cpp
index d79fedc..0659bfa 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -595,6 +595,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf,
QWidget *_parent,
ui.resizingBox->setEnabled( ui.embedVideo->isChecked() );
CONFIG_BOOL( "qt-fs-controller", fsController );
+ CONFIG_BOOL( "qt-rm-christmas-joke", rmChristmasJoke );
CONFIG_BOOL( "qt-system-tray", systrayBox );
CONFIG_BOOL( "qt-notification", sysPop );
CONNECT( ui.systrayBox, toggled( bool ), ui.sysPop,
setEnabled( bool ) );
diff --git a/modules/gui/qt4/dialogs/help.cpp
b/modules/gui/qt4/dialogs/help.cpp
index 76a631e..d564336 100644
--- a/modules/gui/qt4/dialogs/help.cpp
+++ b/modules/gui/qt4/dialogs/help.cpp
@@ -102,10 +102,17 @@ 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 )
- ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
+ if ( ! var_InheritBool( p_intf, "qt-rm-christmas-joke" ))
+ {
+ if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
+ ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-christmas.png" ) );
+ else
+ ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
+ }
else
- ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
+ {
+ ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
+ }
/* Main Introduction */
ui.infoLabel->setText(
diff --git a/modules/gui/qt4/main_interface.cpp
b/modules/gui/qt4/main_interface.cpp
index 139ce17..96de0fc 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -942,10 +942,19 @@ void MainInterface::showBuffering( float f_cache )
void MainInterface::createSystray()
{
QIcon iconVLC;
- if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
- iconVLC = QIcon( ":/logo/vlc128-christmas.png" );
- else
- iconVLC = QIcon( ":/logo/vlc128.png" );
+
+ if ( ! var_InheritBool( p_intf, "qt-rm-christmas-joke" ))
+ {
+ if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
+ iconVLC = QIcon( ":/logo/vlc128-christmas.png" );
+ else
+ iconVLC = QIcon( ":/logo/vlc128.png" );
+ }
+ else
+ {
+ iconVLC = QIcon( ":logo/vlc128.png" );
+ }
+
sysTray = new QSystemTrayIcon( iconVLC, this );
sysTray->setToolTip( qtr( "VLC media player" ));
diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp
index ecfb769..dda972c 100644
--- a/modules/gui/qt4/qt4.cpp
+++ b/modules/gui/qt4/qt4.cpp
@@ -82,6 +82,8 @@ static void ShowDialog ( intf_thread_t *, int, int,
intf_dialog_args_t * );
#define MINIMIZED_LONGTEXT N_( "VLC will start with just an icon in " \
"your taskbar" )
+#define RMJOKE_TEXT N_( "VLC Will Remove The Santa Hat Icon")
+
#define KEEPSIZE_TEXT N_( "Resize interface to the native video size" )
#define KEEPSIZE_LONGTEXT N_( "You have two choices:\n" \
" - The interface will resize to the native video size\n" \
@@ -215,7 +217,8 @@ vlc_module_begin ()
TITLE_LONGTEXT, false )
add_bool( "qt-fs-controller", true, QT_FULLSCREEN_TEXT,
QT_FULLSCREEN_TEXT, false )
-
+ add_bool( "qt-rm-christmas-joke", false, RMJOKE_TEXT,
+ RMJOKE_TEXT, true )
add_bool( "qt-volume-complete", false, COMPLETEVOL_TEXT,
COMPLETEVOL_LONGTEXT, true )
add_bool( "qt-autosave-volume", false, SAVEVOL_TEXT,
@@ -479,10 +482,17 @@ static void *Thread( void *obj )
/* Icon setting, Mac uses icon from .icns */
#ifndef Q_WS_MAC
- if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
- app.setWindowIcon( QIcon(vlc_christmas_xpm) );
- else
- app.setWindowIcon( QIcon(vlc_xpm) );
+ if ( ! var_InheritBool( p_intf, "qt-rm-christmas-joke" ) )
+ {
+ if( QDate::currentDate().dayOfYear() >= QT_CHRISTMAS_TROLL_DAY )
+ app.setWindowIcon( QIcon(vlc_christmas_xpm) );
+ else
+ app.setWindowIcon( QIcon(vlc_xpm) );
+ }
+ else
+ {
+ app.setWindowIcon( QIcon(vlc_xpm) );
+ }
#endif
/* Initialize timers and the Dialog Provider */
diff --git a/modules/gui/qt4/ui/sprefs_interface.ui
b/modules/gui/qt4/ui/sprefs_interface.ui
index d608325..f43b54e 100644
--- a/modules/gui/qt4/ui/sprefs_interface.ui
+++ b/modules/gui/qt4/ui/sprefs_interface.ui
@@ -415,13 +415,20 @@
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0" colspan="2">
+ <item row="0" column="0">
<widget class="QCheckBox" name="fsController">
<property name="text">
- <string>Show controls in full screen mode</string>
+ <string>Show controls in full screen</string>
</property>
</widget>
</item>
+ <item row="0" column="1">
+ <widget class="QCheckBox" name="rmChristmasJoke">
+ <property name="text">
+ <string>Use Humbug Mode</string>
+ </property>
+ </widget>
+ </item>
<item row="1" column="0">
<widget class="QCheckBox" name="minimalviewBox">
<property name="text">
@@ -627,6 +634,7 @@
<tabstop>qt4</tabstop>
<tabstop>skins</tabstop>
<tabstop>fsController</tabstop>
+ <tabstop>rmChristmasJoke</tabstop>
<tabstop>minimalviewBox</tabstop>
<tabstop>pauseMinimizedBox</tabstop>
<tabstop>embedVideo</tabstop>
--
1.6.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Patch-to-give-users-the-ability-to-disable-the-Chris.patch
Type: text/x-patch
Size: 7570 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20110102/3eb37a37/attachment.bin>
More information about the vlc-devel
mailing list