]> git.sesse.net Git - vlc/commitdiff
Some general clean up
authorClément Stenac <zorglub@videolan.org>
Thu, 8 Jun 2006 18:36:09 +0000 (18:36 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 8 Jun 2006 18:36:09 +0000 (18:36 +0000)
modules/gui/qt4/Modules.am
modules/gui/qt4/dialogs/prefs_dialog.cpp
modules/gui/qt4/dialogs/streaminfo.cpp
modules/gui/qt4/dialogs/streaminfo.hpp
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/input_manager.cpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/main_interface.hpp
modules/gui/qt4/qt4.cpp
modules/gui/qt4/ui/main_interface.ui [new file with mode: 0644]
modules/gui/qt4/util/input_slider.cpp

index 735e237a74fe74b726086edc95f336077ab5a5b0..3013cab4426e96c96ebbd950939a583a3d56bfe8 100644 (file)
@@ -11,7 +11,7 @@
 
 AUTOMAKE_OPTIONS = subdir-objects
 
-TOUI = ui/input_stats
+TOUI = ui/input_stats ui/main_interface
 UIH = $(TOUI:%=%.h)
 
 TOMOC = main_interface \
index 6c31548dd458c27d441d30ecde0730537e82a037..9e5054b7b8770904c380b61b348d097b3125c2c5 100644 (file)
@@ -69,12 +69,12 @@ PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
 
      setAll();
 
-     QObject::connect( adv_chk, SIGNAL( toggled(bool) ), this,
-                       SLOT( setAdvanced( bool ) ) );
+     connect( adv_chk, SIGNAL( toggled(bool) ),
+              this, SLOT( setAdvanced( bool ) ) );
      setLayout( main_layout );
 
-     QObject::connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
-     QObject::connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
+     connect( small, SIGNAL( clicked() ), this, SLOT( setSmall()) );
+     connect( all, SIGNAL( clicked() ), this, SLOT( setAll()) );
 }
 
 void PrefsDialog::setAdvanced( bool advanced )
@@ -92,10 +92,9 @@ void PrefsDialog::setAll()
     if( !advanced_tree )
     {
          advanced_tree = new PrefsTree( p_intf, this );
-         QObject::connect( advanced_tree,
-                           SIGNAL( currentItemChanged( QTreeWidgetItem *,
-                                   QTreeWidgetItem *) ), this,
-                           SLOT( changePanel( QTreeWidgetItem * ) ) );
+         connect( advanced_tree,
+          SIGNAL( currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *) ),
+          this, SLOT( changePanel( QTreeWidgetItem * ) ) );
     }
     advanced_tree->show();
     setAdvanced( adv_chk->isChecked() );
index 8543d12ba68afabfde284cb0deab55e9e48df9b8..3146b5a5b1888bf43601bb7f0ffd888ab1bc02aa 100644 (file)
 #include "components/infopanels.hpp"
 #include "qt4.hpp"
 
-
 StreamInfoDialog *StreamInfoDialog::instance = NULL;
 
-StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) : QVLCFrame( p_intf )
-{
-     setWindowTitle( _("Stream information" ) );
-//     InputStatsPanel *ISP = new InputStatsPanel( this, p_intf );
-
-     fprintf( stderr, "CONNECTING\n");
-
-
-     fprintf( stderr, "Done\n");
-}
-
-void StreamInfoDialog::init()
+StreamInfoDialog::StreamInfoDialog( intf_thread_t *_p_intf ) :
+                                QVLCFrame( p_intf )
 {
-    QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
-                     SIGNAL( timeout() ), this, SLOT(update() ) );
+    setWindowTitle( _("Stream information" ) );
+    InputStatsPanel *ISP = new InputStatsPanel( this, p_intf );
+    connect( DialogsProvider::getInstance(NULL)->fixed_timer,
+             SIGNAL( timeout() ), this, SLOT(update() ) );
 }
 
 void StreamInfoDialog::update()
index 6c1c72a49b73e0861864cd640c0e46db52ed3768..3073798a67d295b70743e01c63075631786b21dd 100644 (file)
@@ -32,22 +32,16 @@ public:
     static StreamInfoDialog * getInstance( intf_thread_t *p_intf )
     {
         if( !instance)
-       {
-           instance = new StreamInfoDialog( p_intf );
-           instance->init();
-       }
+            instance = new StreamInfoDialog( p_intf );
         return instance;
     }
     virtual ~StreamInfoDialog();
 private:
     StreamInfoDialog( intf_thread_t * );
-    void init();
-
     intf_thread_t *p_intf;
     static StreamInfoDialog *instance;
 public slots:
     void update();
 };
 
-
 #endif
index 543d8b229196c609e1bfec40374ddca07c879486..33d2103ee1ddb178d1f3396ba196bb13075271ba 100644 (file)
@@ -41,8 +41,6 @@ public:
         return instance;
     }
     virtual ~DialogsProvider();
-
-    void init();
     QTimer *idle_timer;
     QTimer *fixed_timer;
 protected:
index 1ff6f17460b3391300a04e76ff809bce32cb9be8..4d8dc1e31192e574b06f0d11065e8414333f4b5c 100644 (file)
@@ -30,8 +30,8 @@ InputManager::InputManager( QObject *parent, intf_thread_t *_p_intf) :
 {
     p_input = NULL;
     /* Subscribe to updates */
-    QObject::connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
-                      SIGNAL( timeout() ), this, SLOT( update() ) );
+    connect( DialogsProvider::getInstance( p_intf )->fixed_timer,
+             SIGNAL( timeout() ), this, SLOT( update() ) );
 }
 
 InputManager::~InputManager()
index afd8c838208d78cbc4c601600b2cec44a198bed8..e4eb476d460848f765a402749fb19cf5735bca15 100644 (file)
@@ -37,28 +37,22 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
     p_input = NULL;
     main_input_manager = new InputManager( this, p_intf );
 
-    QPushButton *button = new QPushButton( "prefs", this );
+//    QPushButton *button = new QPushButton( "prefs", this );
+//    connect( button, SIGNAL( clicked() ),
+//             DialogsProvider::getInstance(p_intf), SLOT( prefsDialog() ) );
 
-    QObject::connect( button, SIGNAL( clicked() ),
-              DialogsProvider::getInstance(p_intf), SLOT( prefsDialog() ) );
-
-}
-
-void MainInterface::init()
-{
     /* Get timer updates */
-    QObject::connect( DialogsProvider::getInstance(NULL)->fixed_timer,
-                      SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
+    connect( DialogsProvider::getInstance(NULL)->fixed_timer,
+             SIGNAL( timeout() ), this, SLOT(updateOnTimer() ) );
     /* Tell input manager about the input changes */
-    QObject::connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
-                   main_input_manager, SLOT( setInput( input_thread_t * ) ) );
+    connect( this, SIGNAL( inputChanged( input_thread_t * ) ),
+             main_input_manager, SLOT( setInput( input_thread_t * ) ) );
 
     /* Connect the slider and the input manager (both ways) */
-    QObject::connect( main_input_manager, SIGNAL(positionUpdated(
-                      float, int, int ) ), slider, SLOT( setPosition( float,int,
-                      int ) ) );
-    QObject::connect( slider, SIGNAL( sliderDragged( float ) ),
-                      main_input_manager, SLOT( sliderUpdate( float ) ) );
+    connect( main_input_manager, SIGNAL(positionUpdated( float, int, int ) ),
+             slider, SLOT( setPosition( float,int, int ) ) );
+    connect( slider, SIGNAL( sliderDragged( float ) ),
+             main_input_manager, SLOT( sliderUpdate( float ) ) );
 
     /* Connect the display and the input manager */
 }
index 82c84a8fb2c599870906f1c06eefdce71e51a70b..2f9e5bb285513697d84f867abaf118b70509273c 100644 (file)
@@ -36,7 +36,6 @@ class MainInterface : public QVLCFrame
 public:
     MainInterface( intf_thread_t *);
     virtual ~MainInterface();
-    void init();
 protected:
     void closeEvent( QCloseEvent *);
 private:
index 7e288d990ffda219d7146bc0d4b88a736a4aba7e..17eb195133eb1d4e69e96caa079f138ce86739e2 100644 (file)
@@ -124,7 +124,6 @@ static void Init( intf_thread_t *p_intf )
     {
         MainInterface *p_mi = new MainInterface( p_intf );
         p_intf->p_sys->p_mi = p_mi;
-        p_mi->init();
         p_mi->show();
     }
 
diff --git a/modules/gui/qt4/ui/main_interface.ui b/modules/gui/qt4/ui/main_interface.ui
new file mode 100644 (file)
index 0000000..820e498
--- /dev/null
@@ -0,0 +1,117 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>MainInterfaceUI</class>
+ <widget class="QWidget" name="MainInterfaceUI" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>560</width>
+    <height>300</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item>
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QFrame" name="sliderFrame" />
+     </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QFrame" name="volumeFrame" />
+     </item>
+    </layout>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QPushButton" name="prevButton" >
+       <property name="text" >
+        <string>Prev</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="playButton_2" >
+       <property name="text" >
+        <string>Play</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="stopButton" >
+       <property name="text" >
+        <string>Stop</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="nextButton" >
+       <property name="text" >
+        <string>Next</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="playlistButton" >
+       <property name="text" >
+        <string>Playlist</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>
index a474381105dddbbab627190eec1f770854bfb264..019ce0e00d2f679d76d6922519220e6832a42daa 100644 (file)
@@ -37,22 +37,21 @@ InputSlider::InputSlider( Qt::Orientation q,QWidget *_parent ) :
     setSingleStep( 2 );
     setPageStep( 1000 );
     setTracking( true );
-    QObject::connect( this, SIGNAL( valueChanged(int) ), this,
-                      SLOT( userDrag( int ) ) );
+    connect( this, SIGNAL( valueChanged(int) ), this, SLOT( userDrag( int ) ) );
 }
 
 void InputSlider::setPosition( float pos, int a, int b )
 {
     if( pos == 0.0 )
     {
-       setEnabled( false );
+        setEnabled( false );
     }
     else
     {
-       setEnabled( true );
-       mymove = true;
-       setValue( (int)(pos * 1000.0 ) );
-       mymove = false;
+        setEnabled( true );
+        mymove = true;
+        setValue( (int)(pos * 1000.0 ) );
+        mymove = false;
     }
 }