Commit d5a52a3a authored by Ernest E. Teem III's avatar Ernest E. Teem III Committed by Jean-Baptiste Kempf

Qt: option for enabling / disabling changes to its icon

Modified by Jean-Baptiste Kempf, to fit option style
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 8acffd0c
...@@ -212,7 +212,7 @@ void BackgroundWidget::updateArt( const QString& url ) ...@@ -212,7 +212,7 @@ void BackgroundWidget::updateArt( const QString& url )
} }
else else
{ /* Xmas joke */ { /* 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" ); pixmapUrl = QString( ":/logo/vlc128-xmas.png" );
else else
pixmapUrl = QString( ":/logo/vlc128.png" ); pixmapUrl = QString( ":/logo/vlc128.png" );
......
...@@ -102,7 +102,7 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf) ...@@ -102,7 +102,7 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
ui.introduction->setText( ui.introduction->setText(
qtr( "VLC media player" ) + qfu( " " VERSION_MESSAGE ) ); 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" ) ); ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128-xmas.png" ) );
else else
ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) ); ui.iconVLC->setPixmap( QPixmap( ":/logo/vlc128.png" ) );
......
...@@ -942,7 +942,7 @@ void MainInterface::showBuffering( float f_cache ) ...@@ -942,7 +942,7 @@ void MainInterface::showBuffering( float f_cache )
void MainInterface::createSystray() void MainInterface::createSystray()
{ {
QIcon iconVLC; 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" ); iconVLC = QIcon( ":/logo/vlc128-xmas.png" );
else else
iconVLC = QIcon( ":/logo/vlc128.png" ); iconVLC = QIcon( ":/logo/vlc128.png" );
......
...@@ -183,6 +183,10 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); ...@@ -183,6 +183,10 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define QT_PAUSE_MINIMIZED_LONGTEXT N_( \ #define QT_PAUSE_MINIMIZED_LONGTEXT N_( \
"With this option enabled, the playback will be automatically paused when minimizing the window." ) "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 () vlc_module_begin ()
set_shortname( "Qt" ) set_shortname( "Qt" )
...@@ -274,6 +278,8 @@ vlc_module_begin () ...@@ -274,6 +278,8 @@ vlc_module_begin ()
add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */ add_obsolete_bool( "qt-blingbling" ) /* Suppressed since 1.0.0 */
add_obsolete_integer( "qt-display-mode" ) /* Suppressed since 1.1.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 #ifdef WIN32
cannot_unload_broken_library() cannot_unload_broken_library()
#endif #endif
...@@ -479,7 +485,7 @@ static void *Thread( void *obj ) ...@@ -479,7 +485,7 @@ static void *Thread( void *obj )
/* Icon setting, Mac uses icon from .icns */ /* Icon setting, Mac uses icon from .icns */
#ifndef Q_WS_MAC #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) ); app.setWindowIcon( QIcon(vlc_xmas_xpm) );
else else
app.setWindowIcon( QIcon(vlc_xpm) ); app.setWindowIcon( QIcon(vlc_xpm) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment