Commit 814c0649 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

UI: simple prefs menu UI fixes and enhancement

UI: new resources for prefs menu
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 4271ab26
...@@ -199,6 +199,29 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) ...@@ -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 * String-based controls
*************************************************************************/ *************************************************************************/
......
...@@ -53,6 +53,23 @@ class QGridLayout; ...@@ -53,6 +53,23 @@ class QGridLayout;
class QDialogButtonBox; class QDialogButtonBox;
class QVBoxLayout; class QVBoxLayout;
/*******************************************************
* Simple widgets
*******************************************************/
class InterfacePreviewWidget : public QLabel
{
Q_OBJECT
public:
InterfacePreviewWidget( QWidget * );
public slots:
void setPreview( int );
};
/*******************************************************
* Variable controls
*******************************************************/
class ConfigControl : public QObject class ConfigControl : public QObject
{ {
Q_OBJECT Q_OBJECT
......
...@@ -473,10 +473,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -473,10 +473,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC( "language", StringList, ui.languageLabel, language ); CONFIG_GENERIC( "language", StringList, ui.languageLabel, language );
BUTTONACT( ui.assoButton, assoDialog() ); BUTTONACT( ui.assoButton, assoDialog() );
#else #else
ui.language->hide(); ui.languageBox->hide();
ui.languageLabel->hide(); ui.assoBox->hide();
ui.assoName->hide();
ui.assoButton->hide();
#endif #endif
/* interface */ /* interface */
...@@ -485,7 +483,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -485,7 +483,8 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
{ {
if( strstr( psz_intf, "skin" ) ) if( strstr( psz_intf, "skin" ) )
ui.skins->setChecked( true ); ui.skins->setChecked( true );
else if( strstr( psz_intf, "qt" ) ) } else {
/* defaults to qt */
ui.qt4->setChecked( true ); ui.qt4->setChecked( true );
} }
free( psz_intf ); free( psz_intf );
...@@ -493,6 +492,18 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -493,6 +492,18 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
optionWidgets.append( ui.skins ); optionWidgets.append( ui.skins );
optionWidgets.append( ui.qt4 ); 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, CONFIG_GENERIC( "qt-display-mode", IntegerList, ui.displayLabel,
displayModeBox ); displayModeBox );
CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo ); CONFIG_GENERIC( "embedded-video", Bool, NULL, embedVideo );
...@@ -510,17 +521,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -510,17 +521,21 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONFIG_GENERIC( "qt-updates-notif", Bool, NULL, updatesBox ); CONFIG_GENERIC( "qt-updates-notif", Bool, NULL, updatesBox );
CONFIG_GENERIC_NO_BOOL( "qt-updates-days", Integer, NULL, CONFIG_GENERIC_NO_BOOL( "qt-updates-days", Integer, NULL,
updatesDays ); updatesDays );
ui.updatenotifier_zone->setEnabled( ui.updatesBox->isChecked() );
CONNECT( ui.updatesBox, toggled( bool ), CONNECT( ui.updatesBox, toggled( bool ),
ui.updatesDays, setEnabled( bool ) ); ui.updatenotifier_zone, setEnabled( bool ) );
#else #else
ui.updatesBox->hide(); ui.updatesBox->hide();
ui.updatesDays->hide(); ui.updatenotifier_zone->hide();
#endif #endif
/* ONE INSTANCE options */ /* ONE INSTANCE options */
#if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__) #if defined( WIN32 ) || defined( HAVE_DBUS ) || defined(__APPLE__)
CONFIG_GENERIC( "one-instance", Bool, NULL, OneInterfaceMode ); CONFIG_GENERIC( "one-instance", Bool, NULL, OneInterfaceMode );
CONFIG_GENERIC( "playlist-enqueue", Bool, NULL, CONFIG_GENERIC( "playlist-enqueue", Bool, NULL,
EnqueueOneInterfaceMode ); EnqueueOneInterfaceMode );
ui.EnqueueOneInterfaceMode->setEnabled( ui.OneInterfaceMode->isChecked() );
CONNECT( ui.OneInterfaceMode, toggled( bool ),
ui.EnqueueOneInterfaceMode, setEnabled( bool ) );
#else #else
ui.OneInterfaceBox->hide(); ui.OneInterfaceBox->hide();
#endif #endif
...@@ -613,6 +628,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -613,6 +628,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
#undef CONFIG_GENERIC #undef CONFIG_GENERIC
} }
void SPrefsPanel::updateAudioOptions( int number) void SPrefsPanel::updateAudioOptions( int number)
{ {
QString value = qobject_cast<QComboBox *>(optionWidgets[audioOutCoB]) QString value = qobject_cast<QComboBox *>(optionWidgets[audioOutCoB])
......
...@@ -149,9 +149,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); ...@@ -149,9 +149,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
"as lyrics, album arts...\n" \ "as lyrics, album arts...\n" \
" - minimal mode with limited controls" ) " - minimal mode with limited controls" )
#define QT_NORMAL_MODE_TEXT N_( "Classic look" ) #define QT_NORMAL_MODE_TEXT N_( "Classic" )
#define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete look with information area" ) #define QT_ALWAYS_VIDEO_MODE_TEXT N_( "Complete (with information area)" )
#define QT_MINIMAL_MODE_TEXT N_( "Minimal look with no menus" ) #define QT_MINIMAL_MODE_TEXT N_( "Minimal (without menu)" )
#define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" ) #define QT_FULLSCREEN_TEXT N_( "Show a controller in fullscreen mode" )
#define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" ) #define QT_NATIVEOPEN_TEXT N_( "Embed the file browser in open dialog" )
......
This diff is collapsed.
...@@ -92,4 +92,9 @@ ...@@ -92,4 +92,9 @@
<file alias="lock">pixmaps/lock.png</file> <file alias="lock">pixmaps/lock.png</file>
<file alias="playlist_remove" >pixmaps/playlist/remove.png</file> <file alias="playlist_remove" >pixmaps/playlist/remove.png</file>
</qresource> </qresource>
<qresource prefix="/prefsmenu" >
<file alias="sample_classic" >pixmaps/sample_classic.png</file>
<file alias="sample_complete" >pixmaps/sample_complete.png</file>
<file alias="sample_minimal" >pixmaps/sample_minimal.png</file>
</qresource>
</RCC> </RCC>
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