From: Francois Cartegnie Date: Sun, 7 Jun 2009 12:46:15 +0000 (+0200) Subject: UI: simple prefs menu UI fixes and enhancement X-Git-Tag: 1.1.0-ff~5528 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=814c0649f8a4c4e7f8084bdd1f2843a5f14382d6;p=vlc UI: simple prefs menu UI fixes and enhancement UI: new resources for prefs menu Signed-off-by: Jean-Baptiste Kempf --- diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index 0536932a0d..2b2163d2f1 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -199,6 +199,29 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) } } +/******************************************************* + * Simple widgets + *******************************************************/ +InterfacePreviewWidget::InterfacePreviewWidget + ( QWidget *parent ) : QLabel( parent, 0 ) +{ + setGeometry( 0, 0, 128, 100 ); + setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed ); +} + +void InterfacePreviewWidget::setPreview( int comboid ) +{ + /* Need to move resources references as soon as qt4.cpp + local defines has been moved somewhere else + */ + char * pixmaps[] = { ":/prefsmenu/sample_classic", + ":/prefsmenu/sample_complete", + ":/prefsmenu/sample_minimal" }; + setPixmap( QPixmap( pixmaps[ comboid ] ) ); +} + + + /************************************************************************** * String-based controls *************************************************************************/ diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index 3a0f5e1163..b42bc0ae51 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -53,6 +53,23 @@ class QGridLayout; class QDialogButtonBox; class QVBoxLayout; +/******************************************************* + * Simple widgets + *******************************************************/ + +class InterfacePreviewWidget : public QLabel +{ + Q_OBJECT +public: + InterfacePreviewWidget( QWidget * ); +public slots: + void setPreview( int ); +}; + +/******************************************************* + * Variable controls + *******************************************************/ + class ConfigControl : public QObject { Q_OBJECT diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp index 4a3b369b16..7da97f68cf 100644 --- a/modules/gui/qt4/components/simple_preferences.cpp +++ b/modules/gui/qt4/components/simple_preferences.cpp @@ -473,10 +473,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, CONFIG_GENERIC( "language", StringList, ui.languageLabel, language ); BUTTONACT( ui.assoButton, assoDialog() ); #else - ui.language->hide(); - ui.languageLabel->hide(); - ui.assoName->hide(); - ui.assoButton->hide(); + ui.languageBox->hide(); + ui.assoBox->hide(); #endif /* interface */ @@ -485,14 +483,27 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, { if( strstr( psz_intf, "skin" ) ) ui.skins->setChecked( true ); - else if( strstr( psz_intf, "qt" ) ) - ui.qt4->setChecked( true ); + } else { + /* defaults to qt */ + ui.qt4->setChecked( true ); } free( psz_intf ); optionWidgets.append( ui.skins ); optionWidgets.append( ui.qt4 ); + ui.skins_zone->setEnabled( ui.skins->isChecked() ); + CONNECT( ui.skins, toggled( bool ), ui.skins_zone, setEnabled( bool ) ); + + ui.native_zone->setEnabled( ui.qt4->isChecked() ); + CONNECT( ui.qt4, toggled( bool ), ui.native_zone, setEnabled( bool ) ); + + InterfacePreviewWidget *preview = new InterfacePreviewWidget( this ); + ( (QGridLayout *) ui.LooknfeelBox->layout() )-> + addWidget( preview, 1, 0, 1, 2 ); + CONNECT( ui.displayModeBox, currentIndexChanged( int ), + preview, setPreview( int ) ); + CONFIG_GENERIC( "qt-display-mode", IntegerList, ui.displayLabel, displayModeBox ); CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo ); @@ -510,17 +521,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, CONFIG_GENERIC( "qt-updates-notif", Bool, NULL, updatesBox ); CONFIG_GENERIC_NO_BOOL( "qt-updates-days", Integer, NULL, updatesDays ); + ui.updatenotifier_zone->setEnabled( ui.updatesBox->isChecked() ); CONNECT( ui.updatesBox, toggled( bool ), - ui.updatesDays, setEnabled( bool ) ); + ui.updatenotifier_zone, setEnabled( bool ) ); #else ui.updatesBox->hide(); - ui.updatesDays->hide(); + ui.updatenotifier_zone->hide(); #endif /* ONE INSTANCE options */ #if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__) CONFIG_GENERIC( "one-instance", Bool, NULL, OneInterfaceMode ); CONFIG_GENERIC( "playlist-enqueue", Bool, NULL, EnqueueOneInterfaceMode ); + ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() ); + CONNECT( ui.OneInterfaceMode, toggled( bool ), + ui.EnqueueOneInterfaceMode, setEnabled( bool ) ); #else ui.OneInterfaceBox->hide(); #endif @@ -613,6 +628,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, #undef CONFIG_GENERIC } + void SPrefsPanel::updateAudioOptions( int number) { QString value = qobject_cast(optionWidgets[audioOutCoB]) diff --git a/modules/gui/qt4/pixmaps/sample_classic.png b/modules/gui/qt4/pixmaps/sample_classic.png new file mode 100644 index 0000000000..e5dab5c060 Binary files /dev/null and b/modules/gui/qt4/pixmaps/sample_classic.png differ diff --git a/modules/gui/qt4/pixmaps/sample_complete.png b/modules/gui/qt4/pixmaps/sample_complete.png new file mode 100644 index 0000000000..285e7f8107 Binary files /dev/null and b/modules/gui/qt4/pixmaps/sample_complete.png differ diff --git a/modules/gui/qt4/pixmaps/sample_minimal.png b/modules/gui/qt4/pixmaps/sample_minimal.png new file mode 100644 index 0000000000..ffbe44cf6e Binary files /dev/null and b/modules/gui/qt4/pixmaps/sample_minimal.png differ diff --git a/modules/gui/qt4/qt4.cpp b/modules/gui/qt4/qt4.cpp index e3507754cc..bfc0f88a09 100644 --- a/modules/gui/qt4/qt4.cpp +++ b/modules/gui/qt4/qt4.cpp @@ -149,9 +149,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); "as lyrics, album arts...\n" \ " - minimal mode with limited controls" ) -#define QT_NORMAL_MODE_TEXT N_( "Classic look" ) -#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete look with information area" ) -#define QT_MINIMAL_MODE_TEXT N_( "Minimal look with no menus" ) +#define QT_NORMAL_MODE_TEXT N_( "Classic" ) +#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete (with information area)" ) +#define QT_MINIMAL_MODE_TEXT N_( "Minimal (without menu)" ) #define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" ) #define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" ) diff --git a/modules/gui/qt4/ui/sprefs_interface.ui b/modules/gui/qt4/ui/sprefs_interface.ui index 11e73b4bfb..bff4665649 100644 --- a/modules/gui/qt4/ui/sprefs_interface.ui +++ b/modules/gui/qt4/ui/sprefs_interface.ui @@ -7,7 +7,7 @@ 0 0 732 - 604 + 657 @@ -20,16 +20,6 @@ Form - - - - Language - - - - - - @@ -43,13 +33,6 @@ - - - - File associations: - - - @@ -57,23 +40,10 @@ - - - - - 0 - 0 - - - - Association Setup - - - - + Privacy / Network Interaction @@ -82,7 +52,7 @@ - Album art download policy + Album art download policy: @@ -93,16 +63,6 @@ - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - days - - - @@ -118,7 +78,7 @@ - Filter + Filter: Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter @@ -146,22 +106,51 @@ + + + + + + + every + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + days + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + - + - Interface Type + Look and feel - - - - Native - - - @@ -187,51 +176,14 @@ - - - - - 0 - 0 - - - - Display mode - - - - - - - - 0 - 0 - - - - - - - - Embed video in interface - - - - - - - Show a controller in fullscreen - - - - + - Skins + Use custom skin - + @@ -265,31 +217,170 @@ - - - - Skin file - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - fileSkin + + + + Qt::Horizontal - - + + + + true + - + 0 0 + + + + + Skin resource file: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + fileSkin + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + Choose... + + + + + + + + + + Use native style + + + true + - - + + + + + + + + 0 + 0 + + + + + + + + Show controls in full screen mode + + + + + + + + 0 + 0 + + + + Qt::LeftToRight + + + Display mode: + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Show systray icon + + + + + + + Resize interface to video size + + + + + + + Embed video in interface + + + + + + + + + + + + + Language + + + + + + Menus language: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + + File associations + + + + 0 @@ -297,30 +388,22 @@ - Browse... + Set up associations... - - + + Qt::Horizontal - - - - - - Systray icon - - - - - - - Resize interface to video size + + + 40 + 20 + - + @@ -328,14 +411,10 @@ - language qt4 - displayModeBox OneInterfaceMode - assoButton artFetcher updatesBox - updatesDays diff --git a/modules/gui/qt4/vlc.qrc b/modules/gui/qt4/vlc.qrc index 18ff87893a..ec4309cfb3 100644 --- a/modules/gui/qt4/vlc.qrc +++ b/modules/gui/qt4/vlc.qrc @@ -92,4 +92,9 @@ pixmaps/lock.png pixmaps/playlist/remove.png + + pixmaps/sample_classic.png + pixmaps/sample_complete.png + pixmaps/sample_minimal.png +