]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open.hpp
Qt4 - Rename dialog/prefs_dialog to dialog/preferences: files in dialog/ are already...
[vlc] / modules / gui / qt4 / components / open.hpp
index 2de569ed89819924f157ac389239187d7e070920..83ed6e9035a0c89b87012a4c7a099878a8c39394 100644 (file)
@@ -1,10 +1,11 @@
 /*****************************************************************************
  * open.hpp : Panels for the open dialogs
  ****************************************************************************
- * Copyright (C) 2000-2005 the VideoLAN team
- * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
+ * Copyright (C) 2006 the VideoLAN team
+ * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
+ *          Jean-Baptiste Kempf <jb@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <vlc/vlc.h>
 #include <QWidget>
 #include <QString>
-#include "ui/file_open.h"
+#include <QFileDialog>
+#include "ui/open_file.h"
+#include "ui/open_disk.h"
+#include "ui/open_net.h"
+#include "ui/open_capture.h"
+
+class QLineEdit;
 
 class OpenPanel: public QWidget
 {
@@ -37,14 +44,26 @@ public:
     {
         p_intf = _p_intf;
     }
-    virtual ~OpenPanel();
-    virtual QString getUpdatedMRL() = 0;
-private:
+    virtual ~OpenPanel() {};
+    virtual void clear() = 0;
+protected:
     intf_thread_t *p_intf;
 public slots:
-    virtual void sendUpdate() = 0;
+    virtual void updateMRL() = 0;
 signals:
-    virtual void dataUpdated( QString, QString ) = 0;
+    void mrlUpdated(QString);
+    void methodChanged( QString method );
+};
+
+class FileOpenBox: public QFileDialog
+{
+    Q_OBJECT;
+public:
+    FileOpenBox( QWidget *parent, const QString &caption,
+        const QString &directory, const QString &filter ):
+        QFileDialog( parent, caption, directory, filter ) {}
+public slots:
+    void accept();
 };
 
 class FileOpenPanel: public OpenPanel
@@ -53,14 +72,62 @@ class FileOpenPanel: public OpenPanel
 public:
     FileOpenPanel( QWidget *, intf_thread_t * );
     virtual ~FileOpenPanel();
-    virtual QString getUpdatedMRL();
+    virtual void clear() ;
+    virtual void accept() ;
 private:
-    Ui::FileOpen ui;
+    Ui::OpenFile ui;
+    QStringList browse( QString );
+    FileOpenBox *dialogBox;
+    QLineEdit *lineFileEdit;
 public slots:
-    virtual void sendUpdate() ;
-signals:
-    virtual void dataUpdated( QString, QString ) ;
+    virtual void updateMRL();
+private slots:
+    void browseFile();
+    void browseFileSub();
+    void toggleSubtitleFrame();
+};
+
+class NetOpenPanel: public OpenPanel
+{
+    Q_OBJECT;
+public:
+    NetOpenPanel( QWidget *, intf_thread_t * );
+    virtual ~NetOpenPanel();
+    virtual void clear() ;
+private:
+    Ui::OpenNetwork ui;
+public slots:
+    virtual void updateMRL();
+private slots:
+    void updateProtocol(int);
+    void updateAddress();
+};
 
+class DiskOpenPanel: public OpenPanel
+{
+    Q_OBJECT;
+public:
+    DiskOpenPanel( QWidget *, intf_thread_t * );
+    virtual ~DiskOpenPanel();
+    virtual void clear() ;
+private:
+    Ui::OpenDisk ui;
+public slots:
+    virtual void updateMRL() ;
+};
+
+
+class CaptureOpenPanel: public OpenPanel
+{
+    Q_OBJECT;
+public:
+    CaptureOpenPanel( QWidget *, intf_thread_t * );
+    virtual ~CaptureOpenPanel();
+    virtual void clear() ;
+private:
+    Ui::OpenCapture ui;
+public slots:
+    virtual void updateMRL();
 };
 
 #endif