]> git.sesse.net Git - vlc/commitdiff
Fix a bunch of bugs
authorClément Stenac <zorglub@videolan.org>
Thu, 20 Jul 2006 15:25:02 +0000 (15:25 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 20 Jul 2006 15:25:02 +0000 (15:25 +0000)
modules/gui/qt4/components/preferences.cpp
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/main_interface.cpp
modules/gui/qt4/util/directslider.hpp
modules/gui/qt4/util/qvlcframe.hpp

index 4c438d5e9ea57967dedefe53201d3590c5725c61..62105accc5432f9c4cd6c727d1aabaa753324830 100644 (file)
@@ -63,9 +63,16 @@ PrefsTree::PrefsTree( intf_thread_t *_p_intf, QWidget *_parent ) :
     setIconSize( QSize( ITEM_HEIGHT,ITEM_HEIGHT ) );
     setAlternatingRowColors( true );
 
+#ifndef WIN32
+    // Fixme - A bit UGLY
     QFont f = font();
-    f.setPointSize( f.pointSize() + 1 );
+    int pSize = f.pointSize();
+    if( pSize > 0 )
+        f.setPointSize( pSize + 1 );
+    else
+        f.setPixelSize( f.pixelSize() + 1 );
     setFont( f );
+#endif
 
 #define BI( a,b) QIcon a##_icon = QIcon( QPixmap( b##_xpm ))
     BI( audio, audio );
index 6fe6c5199ea76ee7dc530f13a617a719921c2850..dfaaaeab617412dc7603f80cae384f1d73bc4dcc 100644 (file)
@@ -46,7 +46,7 @@ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf ) :
             SLOT(menuAction( QObject *)) );
 
     menusUpdateMapper = new QSignalMapper();
-    connect( menusMapper, SIGNAL( mapped(QObject *) ), this,
+    connect( menusUpdateMapper, SIGNAL( mapped(QObject *) ), this,
             SLOT(menuUpdateAction( QObject *)) );
 }
 
@@ -132,6 +132,12 @@ void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
     }
 }
 
+void DialogsProvider::quit()
+{
+    p_intf->b_die = VLC_TRUE;
+    QApplication::quit();
+}
+
 void DialogsProvider::streaminfoDialog()
 {
     StreamInfoDialog::getInstance( p_intf, true )->toggleVisible();
@@ -164,6 +170,11 @@ void DialogsProvider::menuUpdateAction( QObject *data )
 void DialogsProvider::simpleOpenDialog()
 {
 }
+void DialogsProvider::bookmarksDialog()
+{
+}
+
+
 
 void DialogsProvider::popupMenu( int i_dialog )
 {
index b7c90c279da443775104ca5533f35f8794118c85..45e20648ee1f049499f443ed73d9806663ce1003 100644 (file)
@@ -65,6 +65,7 @@ private:
 
 public slots:
     void playlistDialog();
+    void bookmarksDialog();
     void streaminfoDialog();
     void prefsDialog();
     void messagesDialog();
@@ -76,6 +77,7 @@ public slots:
     void menuAction( QObject *);
     void menuUpdateAction( QObject *);
     void streamingDialog();
+    void quit();
 };
 
 
index 763cc2dea60e9a22946f9dc8b8dc6255d9af6917..804ec3aef1417207d4c4b8f10c1fb880b7741d93 100644 (file)
@@ -62,8 +62,8 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
 
     QVLCMenu::createMenuBar( menuBar(), p_intf );
 
-    timeLabel = new QLabel( this );
-    nameLabel = new QLabel( this );
+    timeLabel = new QLabel( 0 );
+    nameLabel = new QLabel( 0 );
     statusBar()->addWidget( nameLabel, 4 );
     statusBar()->addPermanentWidget( timeLabel, 1 );
 
@@ -122,12 +122,12 @@ MainInterface::MainInterface( intf_thread_t *_p_intf ) : QVLCMW( _p_intf )
              THEMIM->getIM(),SLOT( sliderUpdate( float ) ) );
 
     /* Actions */
-    connect( ui.playButton, SLOT( clicked() ), this, SLOT( play() ) );
-    connect( ui.stopButton, SLOT( clicked() ), this, SLOT( stop() ) );
-    connect( ui.nextButton, SLOT( clicked() ), this, SLOT( next() ) );
-    connect( ui.prevButton, SLOT( clicked() ), this, SLOT( prev() ) );
+    connect( ui.playButton, SIGNAL( clicked() ), this, SLOT( play() ) );
+    connect( ui.stopButton, SIGNAL( clicked() ), this, SLOT( stop() ) );
+    connect( ui.nextButton, SIGNAL( clicked() ), this, SLOT( next() ) );
+    connect( ui.prevButton, SIGNAL( clicked() ), this, SLOT( prev() ) );
 
-    connect( ui.playlistButton, SLOT(clicked()),
+    connect( ui.playlistButton, SIGNAL(clicked()),
              THEDP, SLOT( playlistDialog() ) );
 
     var_Create( p_intf, "interaction", VLC_VAR_ADDRESS );
index e2c5d3e50da13c1f6f4dbdbab8453fce37de2017..3ce49050dc8d8edb6cbb8fac262185065615c6d5 100644 (file)
 
 #include <QSlider>
 #include <QMouseEvent>
+#include <QLayout>
 
 class DirectSlider : public QSlider
 {
 public:
-    DirectSlider( QWidget *_parent ) : QSlider( _parent ) {};
-    DirectSlider( Qt::Orientation q,QWidget *_parent ) : QSlider( q,_parent )
+DirectSlider( QWidget *_parent ) : QSlider( _parent ) {};
+DirectSlider( Qt::Orientation q,QWidget *_parent ) : QSlider( q,_parent )
     {};
     virtual ~DirectSlider()   {};
 
@@ -39,8 +40,14 @@ public:
     {
         if(event->button() == Qt::LeftButton)
         {
+#ifdef WIN32
+            int width = qobject_cast<QWidget*>(parent())->sizeHint().width() -
+                     2 * qobject_cast<QWidget*>(parent())->layout()->margin();
+#else
+            int width = width();
+#endif
             int pos = (int)(minimum() + 
-                          (double)(event->x())/width()*(maximum()-minimum()) );
+                          (double)(event->x())/width*(maximum()-minimum()) );
             setSliderPosition( pos );
             QSlider::mousePressEvent(event);
         }
index 85ad2a2e97f956ba4bc77c92f706fa744f6358da..49e9fb4012504a7f2527406a33706906b24c57c0 100644 (file)
@@ -36,6 +36,7 @@ public:
     static void fixStyle( QWidget *w)
     {
          QStyle *style = qApp->style();
+#if 0
         // Plastique is too dark.
         /// theming ? getting KDE data ? ?
         if( qobject_cast<QPlastiqueStyle *>(style) )
@@ -49,6 +50,7 @@ public:
             plt.setColor( QPalette::Inactive, QPalette::Window, vlg );
             w->setPalette( plt );
         }
+#endif
     }
 
     QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )