Commit b248dab2 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 : SimplePrefs: various fixes, remove some widgets, uniformity, cleaning...

Qt4 : SimplePrefs: various fixes, remove some widgets, uniformity, cleaning and hiding for Win32/others for some options.

parent 70955271
...@@ -70,7 +70,6 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) : ...@@ -70,7 +70,6 @@ SPrefsCatList::SPrefsCatList( intf_thread_t *_p_intf, QWidget *_parent ) :
ADD_CATEGORY( SPrefsAudio, qtr("Audio"), audio_50x50_xpm ); ADD_CATEGORY( SPrefsAudio, qtr("Audio"), audio_50x50_xpm );
ADD_CATEGORY( SPrefsInputAndCodecs, qtr("Input and Codecs"), ADD_CATEGORY( SPrefsInputAndCodecs, qtr("Input and Codecs"),
input_and_codecs_50x50_xpm ); input_and_codecs_50x50_xpm );
// ADD_CATEGORY( SPrefsPlaylist, qtr("Playlist"), playlist_50x50_xpm );
ADD_CATEGORY( SPrefsInterface, qtr("Interface"), interface_50x50_xpm ); ADD_CATEGORY( SPrefsInterface, qtr("Interface"), interface_50x50_xpm );
ADD_CATEGORY( SPrefsSubtitles, qtr("Subtitles"), subtitles_50x50_xpm ); ADD_CATEGORY( SPrefsSubtitles, qtr("Subtitles"), subtitles_50x50_xpm );
ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"), hotkeys_50x50_xpm ); ADD_CATEGORY( SPrefsHotkeys, qtr("Hotkeys"), hotkeys_50x50_xpm );
...@@ -96,34 +95,38 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -96,34 +95,38 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
controls.append( control ); \ controls.append( control ); \
} }
#define START_SPREFS_CAT( name ) \ #define START_SPREFS_CAT( name , label ) \
case SPrefs ## name: \ case SPrefs ## name: \
{ \ { \
Ui::SPrefs ## name ui; \ Ui::SPrefs ## name ui; \
ui.setupUi( panel ); ui.setupUi( panel ); \
panel_label->setText( qtr( label ) );
#define END_SPREFS_CAT \ #define END_SPREFS_CAT \
break; \ break; \
} }
QVBoxLayout *panel_layout = new QVBoxLayout(); QVBoxLayout *panel_layout = new QVBoxLayout();
QString head;
QWidget *panel = new QWidget(); QWidget *panel = new QWidget();
// Title Label
QLabel *panel_label = new QLabel; // Title Label
QFont labelFont = QApplication::font( static_cast<QWidget*>(0) ); QLabel *panel_label = new QLabel;
labelFont.setPointSize( labelFont.pointSize() + 4 ); QFont labelFont = QApplication::font( static_cast<QWidget*>(0) );
labelFont.setBold( true ); labelFont.setPointSize( labelFont.pointSize() + 4 );
panel_label->setFont( labelFont ); labelFont.setBold( true );
panel_label->setFont( labelFont );
// Title <hr>
QFrame *title_line = new QFrame; // Title <hr>
title_line->setFrameShape(QFrame::HLine); QFrame *title_line = new QFrame;
title_line->setFrameShadow(QFrame::Sunken); title_line->setFrameShape(QFrame::HLine);
title_line->setFrameShadow(QFrame::Sunken);
switch( number ) switch( number )
{ {
START_SPREFS_CAT( Video ); START_SPREFS_CAT( Video , "General video settings" );
#ifndef WIN32
ui.directXBox->setVisible( false );
#endif
CONFIG_GENERIC( "video", Bool, NULL, enableVideo ); CONFIG_GENERIC( "video", Bool, NULL, enableVideo );
CONFIG_GENERIC( "fullscreen", Bool, NULL, fullscreen ); CONFIG_GENERIC( "fullscreen", Bool, NULL, fullscreen );
...@@ -143,27 +146,33 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -143,27 +146,33 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
END_SPREFS_CAT; END_SPREFS_CAT;
START_SPREFS_CAT( Audio ); START_SPREFS_CAT( Audio, "General audio settings" );
#ifndef WIN32
ui.DirectXLabel->setVisible( false );
ui.DirectXDevice->setVisible( false );
#endif
#ifdef WIN32
ui.OSSBrowse->hide();
ui.OSSDevice->hide();
ui.OSSLabel->hide();
ui.alsaDevice->hide();
ui.alsaLabel->hide();
#endif
CONFIG_GENERIC( "audio", Bool, NULL, enableAudio ); CONFIG_GENERIC( "audio", Bool, NULL, enableAudio );
END_SPREFS_CAT; END_SPREFS_CAT;
START_SPREFS_CAT( InputAndCodecs ); START_SPREFS_CAT( InputAndCodecs, "Input & Codecs settings" );
END_SPREFS_CAT; END_SPREFS_CAT;
/* START_SPREFS_CAT( Playlist ); START_SPREFS_CAT( Interface, "Interfaces settings" );
END_SPREFS_CAT;*/
START_SPREFS_CAT( Interface );
CONFIG_GENERIC( "language", StringList, NULL, language ); CONFIG_GENERIC( "language", StringList, NULL, language );
END_SPREFS_CAT; END_SPREFS_CAT;
START_SPREFS_CAT( Subtitles ); START_SPREFS_CAT( Subtitles, "Subtitles & OSD settings" );
CONFIG_GENERIC( "subsdec-encoding", StringList, NULL, encoding ); CONFIG_GENERIC( "subsdec-encoding", StringList, NULL, encoding );
CONFIG_GENERIC( "sub-language", String, NULL, preferredLanguage ); CONFIG_GENERIC( "sub-language", String, NULL, preferredLanguage );
...@@ -175,15 +184,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent, ...@@ -175,15 +184,16 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
END_SPREFS_CAT; END_SPREFS_CAT;
START_SPREFS_CAT( Hotkeys ); START_SPREFS_CAT( Hotkeys, "Configure Hotkeys" );
END_SPREFS_CAT; END_SPREFS_CAT;
} }
panel_layout->addWidget(panel_label);
panel_layout->addWidget(title_line);
panel_layout->addWidget( panel );
this->setLayout(panel_layout); panel_layout->addWidget(panel_label);
panel_layout->addWidget(title_line);
panel_layout->addWidget( panel );
panel_layout->addStretch( 2 );
this->setLayout(panel_layout);
} }
void SPrefsPanel::apply() void SPrefsPanel::apply()
......
...@@ -35,15 +35,15 @@ ...@@ -35,15 +35,15 @@
#include <QPushButton> #include <QPushButton>
#include <QCheckBox> #include <QCheckBox>
#include <QScrollArea> #include <QScrollArea>
#include <QLabel>
PrefsDialog *PrefsDialog::instance = NULL; PrefsDialog *PrefsDialog::instance = NULL;
PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
QGridLayout *main_layout = new QGridLayout(this); QGridLayout *main_layout = new QGridLayout(this);
setWindowTitle( qtr( "Preferences" ) ); setWindowTitle( qtr( "Preferences" ) );
resize( 800, 450 ); resize( 800, 600 );
setMaximumHeight (450); setMaximumHeight (600);
tree_panel = new QWidget(0); tree_panel = new QWidget(0);
tree_panel_l = new QHBoxLayout; tree_panel_l = new QHBoxLayout;
......
<ui version="4.0" > <ui version="4.0" >
<author>Jean-Baptiste Kempf</author> <author>Jean-Baptiste Kempf</author>
<class>SPrefsHotkeys</class> <class>SPrefsHotkeys</class>
<widget class="QWidget" name="SPrefsVideo" > <widget class="QWidget" name="SPrefsHotkeys" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>426</width> <width>421</width>
<height>474</height> <height>511</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
...@@ -45,6 +45,20 @@ ...@@ -45,6 +45,20 @@
</item> </item>
<item row="1" column="0" colspan="2" > <item row="1" column="0" colspan="2" >
<widget class="QTreeWidget" name="shortcutsTree" > <widget class="QTreeWidget" name="shortcutsTree" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>3</vsizetype>
<horstretch>4</horstretch>
<verstretch>4</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<size>
<width>350</width>
<height>350</height>
</size>
</property>
<property name="columnCount" > <property name="columnCount" >
<number>2</number> <number>2</number>
</property> </property>
...@@ -58,7 +72,7 @@ ...@@ -58,7 +72,7 @@
<string>Shortcut</string> <string>Shortcut</string>
</property> </property>
</column> </column>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="label" > <widget class="QLabel" name="label" >
......
<ui version="4.0" > <ui version="4.0" >
<author>Jean-Baptiste Kempf</author> <author>Jean-Baptiste Kempf</author>
<class>SPrefsInputAndCodecs</class> <class>SPrefsInputAndCodecs</class>
<widget class="QWidget" name="Spref_input" > <widget class="QWidget" name="SprefsInputAndCodecs" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>439</width> <width>422</width>
<height>552</height> <height>437</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
...@@ -32,15 +32,15 @@ ...@@ -32,15 +32,15 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="2" column="2" > <item row="0" column="0" >
<widget class="QPushButton" name="CDDevice" > <widget class="QLabel" name="label" >
<property name="text" > <property name="text" >
<string>Browse</string> <string>Disk Device</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" > <item row="0" column="1" >
<widget class="QLineEdit" name="CDDevice" /> <widget class="QLineEdit" name="DVDDevice" />
</item> </item>
<item row="0" column="2" > <item row="0" column="2" >
<widget class="QPushButton" name="DVDBrowse" > <widget class="QPushButton" name="DVDBrowse" >
...@@ -49,40 +49,6 @@ ...@@ -49,40 +49,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="2" >
<widget class="QPushButton" name="VCDBrowse" >
<property name="text" >
<string>Browse</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>Audio CD Device</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>VCD Device</string>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="DVDDevice" />
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>DVD Device</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="VCDDevice" />
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
...@@ -98,6 +64,13 @@ ...@@ -98,6 +64,13 @@
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="2" column="0" colspan="2" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Default Network caching in ms</string>
</property>
</widget>
</item>
<item row="1" column="0" > <item row="1" column="0" >
<widget class="QLabel" name="label_7" > <widget class="QLabel" name="label_7" >
<property name="text" > <property name="text" >
...@@ -105,14 +78,23 @@ ...@@ -105,14 +78,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0" > <item row="2" column="2" >
<widget class="QLabel" name="label_4" > <widget class="QSpinBox" name="networkCache" >
<property name="text" > <property name="alignment" >
<string>UDP Default Port</string> <set>Qt::AlignRight</set>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="value" >
<number>300</number>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="1" > <item row="1" column="1" colspan="2" >
<widget class="QLineEdit" name="lineEdit" />
</item>
<item row="0" column="1" colspan="2" >
<widget class="QSpinBox" name="UDPPort" > <widget class="QSpinBox" name="UDPPort" >
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight</set> <set>Qt::AlignRight</set>
...@@ -128,8 +110,12 @@ ...@@ -128,8 +110,12 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="1" > <item row="0" column="0" >
<widget class="QLineEdit" name="lineEdit" /> <widget class="QLabel" name="label_4" >
<property name="text" >
<string>UDP Default Port</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>
...@@ -225,81 +211,6 @@ ...@@ -225,81 +211,6 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="groupBox_5" >
<property name="title" >
<string>Caching</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="2" column="1" >
<widget class="QSpinBox" name="localCache" >
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="value" >
<number>300</number>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QSpinBox" name="DiscCache" >
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="value" >
<number>300</number>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QSpinBox" name="networkCache" >
<property name="alignment" >
<set>Qt::AlignRight</set>
</property>
<property name="maximum" >
<number>10000</number>
</property>
<property name="value" >
<number>300</number>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>Default Network caching in ms</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_8" >
<property name="text" >
<string>Default Disc caching in ms</string>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_9" >
<property name="text" >
<string>Default local caching in ms</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<resources/> <resources/>
......
...@@ -6,21 +6,31 @@ ...@@ -6,21 +6,31 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>426</width> <width>400</width>
<height>429</height> <height>443</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QVBoxLayout" >
<property name="margin" > <property name="margin" >
<number>9</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item row="2" column="0" > <item>
<widget class="QCheckBox" name="enableVideo" >
<property name="text" >
<string>Enable video</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="displayBox" > <widget class="QGroupBox" name="displayBox" >
<property name="title" > <property name="title" >
<string>Display</string> <string>Display</string>
...@@ -95,7 +105,7 @@ ...@@ -95,7 +105,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="3" column="0" > <item>
<widget class="QGroupBox" name="directXBox" > <widget class="QGroupBox" name="directXBox" >
<property name="title" > <property name="title" >
<string>DirectX</string> <string>DirectX</string>
...@@ -127,7 +137,7 @@ ...@@ -127,7 +137,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="4" column="0" > <item>
<widget class="QGroupBox" name="groupBox" > <widget class="QGroupBox" name="groupBox" >
<property name="title" > <property name="title" >
<string>Video snapshots</string> <string>Video snapshots</string>
...@@ -190,35 +200,8 @@ ...@@ -190,35 +200,8 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="0" >
<widget class="QCheckBox" name="enableVideo" >
<property name="text" >
<string>Enable video</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>7</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<includes/>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>
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