]> git.sesse.net Git - vlc/commitdiff
Qt4: Please help...
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 29 Nov 2006 20:17:08 +0000 (20:17 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 29 Nov 2006 20:17:08 +0000 (20:17 +0000)
Adds an help menu with help and about.
Dialogs are still empty.

modules/gui/qt4/Modules.am
modules/gui/qt4/dialogs/help.cpp [new file with mode: 0644]
modules/gui/qt4/dialogs/help.hpp [new file with mode: 0644]
modules/gui/qt4/dialogs_provider.cpp
modules/gui/qt4/dialogs_provider.hpp
modules/gui/qt4/menus.cpp
modules/gui/qt4/menus.hpp

index b037d0bae056de7b9fec7dc7d33660d687fe5369..ae88d4b9a760fdce07f3acbd16de681a6db6c79b 100644 (file)
@@ -43,6 +43,7 @@ TOMOC = main_interface \
        dialogs/extended \
        dialogs/interaction \
        dialogs/sout \
+       dialogs/help \
     dialogs/open \
        components/extended_panels \
        components/infopanels \
@@ -71,6 +72,7 @@ nodist_SOURCES_qt4 = \
                dialogs/prefs_dialog.moc.cpp \
                dialogs/interaction.moc.cpp \
                dialogs/sout.moc.cpp \
+               dialogs/help.moc.cpp \
                dialogs/open.moc.cpp \
                components/extended_panels.moc.cpp \
                components/infopanels.moc.cpp \
@@ -119,6 +121,7 @@ SOURCES_qt4 =       qt4.cpp \
                dialogs/errors.cpp \
                dialogs/interaction.cpp \
                dialogs/sout.cpp \
+               dialogs/help.cpp \
                dialogs/open.cpp \
                components/extended_panels.cpp \
                components/infopanels.cpp \
@@ -149,6 +152,7 @@ EXTRA_DIST += \
        dialogs/prefs_dialog.hpp \
        dialogs/interaction.hpp \
        dialogs/sout.hpp \
+       dialogs/help.hpp \
        dialogs/open.hpp \
        components/extended_panels.hpp \
        components/infopanels.hpp \
diff --git a/modules/gui/qt4/dialogs/help.cpp b/modules/gui/qt4/dialogs/help.cpp
new file mode 100644 (file)
index 0000000..a23db37
--- /dev/null
@@ -0,0 +1,70 @@
+/*****************************************************************************
+ * Help.cpp : Help and About dialogs
+ ****************************************************************************
+ * Copyright (C) 2006 the VideoLAN team
+ * $Id: Messages.cpp 16024 2006-07-13 13:51:05Z xtophe $
+ *
+ * Authors: Jean-Baptiste Kempf <jb (at) 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "dialogs/help.hpp"
+
+#include "dialogs_provider.hpp"
+#include "util/qvlcframe.hpp"
+#include "qt4.hpp"
+
+HelpDialog *HelpDialog::instance = NULL;
+
+HelpDialog::HelpDialog( intf_thread_t *_p_intf) :  QVLCFrame( _p_intf )
+{
+    setWindowTitle( qtr( "Help" ) );
+    resize(600, 400);
+
+    QGridLayout *layout = new QGridLayout(this);
+    QPushButton *closeButton = new QPushButton(qtr("&Close"));
+
+    BUTTONACT( closeButton, close() );
+}
+
+HelpDialog::~HelpDialog()
+{
+}
+void HelpDialog::close()
+{
+    this->toggleVisible();
+}
+
+AboutDialog *AboutDialog::instance = NULL;
+
+AboutDialog::AboutDialog( intf_thread_t *_p_intf) :  QVLCFrame( _p_intf )
+{
+    setWindowTitle( qtr( "About" ) );
+    resize(600, 400);
+
+    QGridLayout *layout = new QGridLayout(this);
+    QPushButton *closeButton = new QPushButton(qtr("&Close"));
+
+    BUTTONACT( closeButton, close() );
+}
+
+AboutDialog::~AboutDialog()
+{
+}
+void AboutDialog::close()
+{
+    this->toggleVisible();
+}
diff --git a/modules/gui/qt4/dialogs/help.hpp b/modules/gui/qt4/dialogs/help.hpp
new file mode 100644 (file)
index 0000000..2f6afad
--- /dev/null
@@ -0,0 +1,67 @@
+/*****************************************************************************
+ * Help.hpp : Help and About dialogs
+ ****************************************************************************
+ * Copyright (C) 2006 the VideoLAN team
+ * $Id: Messages.hpp 16024 2006-07-13 13:51:05Z xtophe $
+ *
+ * Authors: Jean-Baptiste Kempf <jb (at) 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/
+
+#ifndef _HELP_DIALOG_H_
+#define _HELP_DIALOG_H_
+
+#include "util/qvlcframe.hpp"
+
+class HelpDialog : public QVLCFrame
+{
+    Q_OBJECT;
+public:
+    static HelpDialog * getInstance( intf_thread_t *p_intf )
+    {
+        if( !instance)
+            instance = new HelpDialog( p_intf);
+        return instance;
+    }
+    virtual ~HelpDialog();
+
+private:
+    HelpDialog( intf_thread_t *);
+    static HelpDialog *instance;
+public slots:
+    void close();
+};
+
+
+class AboutDialog : public QVLCFrame
+{
+    Q_OBJECT;
+public:
+    static AboutDialog * getInstance( intf_thread_t *p_intf )
+    {
+        if( !instance)
+            instance = new AboutDialog( p_intf);
+        return instance;
+    }
+    virtual ~AboutDialog();
+
+private:
+    AboutDialog( intf_thread_t *);
+    static AboutDialog *instance;
+public slots:
+    void close();
+};
+
+#endif
index 89e2a20c663e3f52c9c7e3941635e3079cec3ccb..e241315f4630498150c093bb822cf4775ab1b6d2 100644 (file)
@@ -38,6 +38,7 @@
 #include "dialogs/extended.hpp"
 #include "dialogs/sout.hpp"
 #include "dialogs/open.hpp"
+#include "dialogs/help.hpp"
 
 DialogsProvider* DialogsProvider::instance = NULL;
 
@@ -116,9 +117,9 @@ void DialogsProvider::PLAppendDialog()
 void DialogsProvider::MLAppendDialog()
 {
 }
-void DialogsProvider::openDialog( int i_dialog )
+void DialogsProvider::openDialog( int i_tab )
 {
-    OpenDialog::getInstance( p_intf )->toggleVisible();
+    OpenDialog::getInstance( p_intf )->showTab( i_tab );
 }
 
 void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
@@ -183,6 +184,16 @@ void DialogsProvider::messagesDialog()
     MessagesDialog::getInstance( p_intf )->toggleVisible();
 }
 
+void DialogsProvider::helpDialog()
+{
+    HelpDialog::getInstance( p_intf )->toggleVisible();
+}
+
+void DialogsProvider::aboutDialog()
+{
+    AboutDialog::getInstance( p_intf )->toggleVisible();
+}
+
 void DialogsProvider::menuAction( QObject *data )
 {
     QVLCMenu::DoAction( p_intf, data );
index 2aef00bec0fe000f1f5840bbee4300503928750f..f92906c88a71f955eb43496748ad32513e8dd20b 100644 (file)
@@ -96,6 +96,8 @@ public slots:
     void openMLDirectory();
     void quit();
     void switchToSkins();
+    void helpDialog();
+    void aboutDialog();
 };
 
 #endif
index 50ce7c2bd6f1824d6cf39efe68f085b3afa604b5..404c4926500d4f34a459e2410396e37ab264b3e7 100644 (file)
@@ -135,7 +135,7 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf,
     BAR_DADD( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
     BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
 
-    //    BAR_ADD( HelpMenu(), qtr("Help" ) );
+    BAR_ADD( HelpMenu(), qtr("Help" ) );
 }
 QMenu *QVLCMenu::FileMenu()
 {
@@ -326,6 +326,16 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
     return menu;
 }
 
+QMenu *QVLCMenu::HelpMenu()
+{
+    QMenu *menu = new QMenu();
+    DP_SADD( qtr("Help") , "", "", helpDialog() );
+                menu->addSeparator();
+    DP_SADD( qtr("About VLC media player..."), "", "", aboutDialog() );
+    return menu;
+}
+
+
 /*****************************************************************************
  * Popup menus
  *****************************************************************************/
index 69e03130b8c7287ad5471828cb537abb44dacde8..7109bd404f272f0d90f3d0d9bf8e69391cf64de9 100644 (file)
@@ -70,6 +70,7 @@ public:
     static QMenu *VideoMenu( intf_thread_t * , QMenu * );
     static QMenu *AudioMenu( intf_thread_t * , QMenu * );
     static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
+    static QMenu *HelpMenu();
 
     /* Popups */
     static void AudioPopupMenu( intf_thread_t * );