Qt4- SImple Prefs: Subtitles and TextTitles.
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 25 Feb 2007 21:59:56 +0000 (21:59 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 25 Feb 2007 21:59:56 +0000 (21:59 +0000)
modules/gui/qt4/components/simple_preferences.cpp
modules/gui/qt4/dialogs/prefs_dialog.cpp
modules/gui/qt4/dialogs/prefs_dialog.hpp
modules/gui/qt4/ui/sprefs_subtitles.ui

index 320d1f0..96bbbde 100644 (file)
@@ -100,12 +100,25 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
         case SPrefs ## name:        \
         {                           \
             Ui::SPrefs ## name ui;  \
-            ui.setupUi( this );
+            ui.setupUi( panel );
 
 #define END_SPREFS_CAT      \
             break;          \
         }
-
+    QVBoxLayout *panel_layout = new QVBoxLayout();
+    QString head;
+    QWidget *panel = new QWidget();
+// Title Label
+        QLabel *panel_label = new QLabel;
+        QFont labelFont = QApplication::font( static_cast<QWidget*>(0) );
+        labelFont.setPointSize( labelFont.pointSize() + 4 );
+        labelFont.setBold( true );
+        panel_label->setFont( labelFont );
+    
+        // Title <hr>
+        QFrame *title_line = new QFrame;
+        title_line->setFrameShape(QFrame::HLine);
+        title_line->setFrameShadow(QFrame::Sunken);
 
     switch( number )
     {
@@ -165,6 +178,12 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
         START_SPREFS_CAT( Hotkeys );
         END_SPREFS_CAT;
         }
+  panel_layout->addWidget(panel_label);
+       panel_layout->addWidget(title_line);
+       panel_layout->addWidget( panel );
+
+       this->setLayout(panel_layout);
+
 }
 
 void SPrefsPanel::apply()
index 054e107..ce6ce20 100644 (file)
@@ -52,7 +52,6 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
      main_panel_l = new QHBoxLayout;
      main_panel->setLayout( main_panel_l );
 
-
      // Choice for types
      types = new QGroupBox( "Show settings" );
      QHBoxLayout *types_l = new QHBoxLayout(0);
@@ -62,20 +61,6 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
      types->setLayout(types_l);
      small->setChecked( true );
 
-     // Title Label
-     QLabel *panel_label = new QLabel;
-     QFont labelFont = QApplication::font( static_cast<QWidget*>(0) );
-     labelFont.setPointSize( labelFont.pointSize() + 4 ); 
-     labelFont.setBold( true );
-     panel_label->setFont( labelFont );
-
-     // Title <hr>
-     QFrame *title_line = new QFrame;
-     title_line->setFrameShape(QFrame::HLine);
-     title_line->setFrameShadow(QFrame::Sunken);
-
-     QScrollArea *scrollArea = new QScrollArea;
-
      advanced_tree = NULL;
      simple_tree = NULL;
      simple_panel = NULL;
@@ -84,9 +69,7 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
      main_layout->addWidget( tree_panel, 0, 0, 3, 1 );
      main_layout->addWidget( types, 3, 0, 1, 1 );
 
-     main_layout->addWidget( panel_label, 0, 1, 1, 1 );
-     main_layout->addWidget( title_line, 1, 1, 1, 1 );
-     main_layout->addWidget( main_panel, 2, 1, 2, 1 );
+     main_layout->addWidget( main_panel, 0, 1, 4, 1 );
 
      main_layout->setColumnMinimumWidth( 0, 200 );
      main_layout->setColumnStretch( 0, 1 );
@@ -186,6 +169,7 @@ void PrefsDialog::changeSimplePanel( QListWidgetItem *item )
     }
     main_panel_l->addWidget( simple_panel );
     simple_panel->show();
+//    panel_label->setText(qtr("Test"));
 }
 
 void PrefsDialog::changePanel( QTreeWidgetItem *item )
index cc67f0a..35a234f 100644 (file)
@@ -41,6 +41,7 @@ class QWidget;
 class QCheckBox;
 class QListWidget;
 class QListWidgetItem;
+class QLabel;
 
 class PrefsDialog : public QVLCFrame
 {
@@ -74,6 +75,8 @@ private:
 
     QGridLayout *main_layout;
 
+//    QLabel *panel_label;
+
     static PrefsDialog *instance;
 private slots:
      void changePanel( QTreeWidgetItem *);
index aea9da1..12703b4 100644 (file)
@@ -1,28 +1,88 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>SPrefsSubtitles</class>
  <widget class="QWidget" name="SPrefsSubtitles" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>548</width>
-    <height>306</height>
+    <width>427</width>
+    <height>359</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <string>Form</string>
   </property>
-  <layout class="QGridLayout" >
+  <layout class="QVBoxLayout" >
    <property name="margin" >
     <number>9</number>
    </property>
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="2" column="0" colspan="2" >
+   <item>
+    <widget class="QGroupBox" name="groupBox_3" >
+     <property name="title" >
+      <string>On Scrren Display</string>
+     </property>
+     <layout class="QVBoxLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item>
+       <widget class="QCheckBox" name="checkBox" >
+        <property name="text" >
+         <string>Enable OSD</string>
+        </property>
+        <property name="checked" >
+         <bool>true</bool>
+        </property>
+        <property name="tristate" >
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox_2" >
+     <property name="title" >
+      <string>Subtitles languages</string>
+     </property>
+     <layout class="QGridLayout" >
+      <property name="margin" >
+       <number>9</number>
+      </property>
+      <property name="spacing" >
+       <number>6</number>
+      </property>
+      <item row="0" column="0" >
+       <widget class="QLabel" name="label" >
+        <property name="text" >
+         <string>Subtitles preferred language</string>
+        </property>
+       </widget>
+      </item>
+      <item row="1" column="1" >
+       <widget class="QComboBox" name="encoding" />
+      </item>
+      <item row="0" column="1" >
+       <widget class="QLineEdit" name="preferredLanguage" />
+      </item>
+      <item row="1" column="0" >
+       <widget class="QLabel" name="label_2" >
+        <property name="text" >
+         <string>Default Encoding</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
     <widget class="QGroupBox" name="groupBox" >
      <property name="title" >
       <string>Display Settings</string>
      </layout>
     </widget>
    </item>
-   <item row="1" column="1" >
-    <widget class="QComboBox" name="encoding" />
-   </item>
-   <item row="1" column="0" >
-    <widget class="QLabel" name="label_2" >
-     <property name="text" >
-      <string>Default Encoding</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" >
-    <widget class="QLabel" name="label" >
-     <property name="text" >
-      <string>Subtitles preferred language</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1" >
-    <widget class="QLineEdit" name="preferredLanguage" />
-   </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
  <resources/>
  <connections/>
 </ui>