]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/messages.hpp
Qt: use __MIN when applicable
[vlc] / modules / gui / qt4 / dialogs / messages.hpp
index 61f7dee352f7725049c1afe08625baa5fb5c0f7e..3b9f66cd754df8e2d5bc315b3f40a17195ed3d57 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _MESSAGES_DIALOG_H_
-#define _MESSAGES_DIALOG_H_
+#ifndef QVLC_MESSAGES_DIALOG_H_
+#define QVLC_MESSAGES_DIALOG_H_ 1
 
 #include "util/qvlcframe.hpp"
+#include "util/singleton.hpp"
+#include "ui/messages_panel.h"
 
+class QTabWidget;
 class QPushButton;
 class QSpinBox;
 class QGridLayout;
@@ -33,44 +36,36 @@ class QLabel;
 class QTextEdit;
 class QTreeWidget;
 class QTreeWidgetItem;
+class QLineEdit;
+class MsgEvent;
 
-class MessagesDialog : public QVLCFrame
+class MessagesDialog : public QVLCFrame, public Singleton<MessagesDialog>
 {
-    Q_OBJECT;
-public:
-    static MessagesDialog * getInstance( intf_thread_t *p_intf )
-    {
-        if( !instance)
-            instance = new MessagesDialog( p_intf );
-        return instance;
-    }
-    static void killInstance()
-    {
-        if( instance ) delete instance;
-        instance = NULL;
-    }
-
-    virtual ~MessagesDialog(){ writeSettings( "messages" ); };
-
+    Q_OBJECT
 private:
     MessagesDialog( intf_thread_t * );
-    static MessagesDialog *instance;
-    QSpinBox *verbosityBox;
-    QLabel *verbosityLabel;
-    QTextEdit *messages;
-    QTreeWidget *modulesTree;
-    QPushButton *clearButton;
-    QPushButton *saveLogButton;
+    virtual ~MessagesDialog();
+
+    Ui::messagesPanelWidget ui;
+    msg_subscription_t *sub;
+    msg_cb_data_t *cbData;
+    static void sinkMessage( msg_cb_data_t *, msg_item_t *, unsigned );
+    void customEvent( QEvent * );
+    void sinkMessage( MsgEvent * );
 
 private slots:
-    void updateTab( int );
-    void updateLog();
-    void close();
-    void clear();
     bool save();
-private:
+    void updateConfig();
+    void changeVerbosity( int );
+    void clear();
     void updateTree();
+    void tabChanged( int );
+
+private:
     void buildTree( QTreeWidgetItem *, vlc_object_t * );
+
+    friend class    Singleton<MessagesDialog>;
+    QPushButton *updateButton;
 };
 
 #endif