Commit e9735ab2 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4: Please help...

Adds an help menu with help and about.
Dialogs are still empty.
parent 3501cab9
...@@ -43,6 +43,7 @@ TOMOC = main_interface \ ...@@ -43,6 +43,7 @@ TOMOC = main_interface \
dialogs/extended \ dialogs/extended \
dialogs/interaction \ dialogs/interaction \
dialogs/sout \ dialogs/sout \
dialogs/help \
dialogs/open \ dialogs/open \
components/extended_panels \ components/extended_panels \
components/infopanels \ components/infopanels \
...@@ -71,6 +72,7 @@ nodist_SOURCES_qt4 = \ ...@@ -71,6 +72,7 @@ nodist_SOURCES_qt4 = \
dialogs/prefs_dialog.moc.cpp \ dialogs/prefs_dialog.moc.cpp \
dialogs/interaction.moc.cpp \ dialogs/interaction.moc.cpp \
dialogs/sout.moc.cpp \ dialogs/sout.moc.cpp \
dialogs/help.moc.cpp \
dialogs/open.moc.cpp \ dialogs/open.moc.cpp \
components/extended_panels.moc.cpp \ components/extended_panels.moc.cpp \
components/infopanels.moc.cpp \ components/infopanels.moc.cpp \
...@@ -119,6 +121,7 @@ SOURCES_qt4 = qt4.cpp \ ...@@ -119,6 +121,7 @@ SOURCES_qt4 = qt4.cpp \
dialogs/errors.cpp \ dialogs/errors.cpp \
dialogs/interaction.cpp \ dialogs/interaction.cpp \
dialogs/sout.cpp \ dialogs/sout.cpp \
dialogs/help.cpp \
dialogs/open.cpp \ dialogs/open.cpp \
components/extended_panels.cpp \ components/extended_panels.cpp \
components/infopanels.cpp \ components/infopanels.cpp \
...@@ -149,6 +152,7 @@ EXTRA_DIST += \ ...@@ -149,6 +152,7 @@ EXTRA_DIST += \
dialogs/prefs_dialog.hpp \ dialogs/prefs_dialog.hpp \
dialogs/interaction.hpp \ dialogs/interaction.hpp \
dialogs/sout.hpp \ dialogs/sout.hpp \
dialogs/help.hpp \
dialogs/open.hpp \ dialogs/open.hpp \
components/extended_panels.hpp \ components/extended_panels.hpp \
components/infopanels.hpp \ components/infopanels.hpp \
......
/*****************************************************************************
* 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();
}
/*****************************************************************************
* 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
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "dialogs/extended.hpp" #include "dialogs/extended.hpp"
#include "dialogs/sout.hpp" #include "dialogs/sout.hpp"
#include "dialogs/open.hpp" #include "dialogs/open.hpp"
#include "dialogs/help.hpp"
DialogsProvider* DialogsProvider::instance = NULL; DialogsProvider* DialogsProvider::instance = NULL;
...@@ -116,9 +117,9 @@ void DialogsProvider::PLAppendDialog() ...@@ -116,9 +117,9 @@ void DialogsProvider::PLAppendDialog()
void DialogsProvider::MLAppendDialog() 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 ) void DialogsProvider::doInteraction( intf_dialog_args_t *p_arg )
...@@ -183,6 +184,16 @@ void DialogsProvider::messagesDialog() ...@@ -183,6 +184,16 @@ void DialogsProvider::messagesDialog()
MessagesDialog::getInstance( p_intf )->toggleVisible(); 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 ) void DialogsProvider::menuAction( QObject *data )
{ {
QVLCMenu::DoAction( p_intf, data ); QVLCMenu::DoAction( p_intf, data );
......
...@@ -96,6 +96,8 @@ public slots: ...@@ -96,6 +96,8 @@ public slots:
void openMLDirectory(); void openMLDirectory();
void quit(); void quit();
void switchToSkins(); void switchToSkins();
void helpDialog();
void aboutDialog();
}; };
#endif #endif
...@@ -135,7 +135,7 @@ void QVLCMenu::createMenuBar( MainInterface *mi, intf_thread_t *p_intf, ...@@ -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( AudioMenu( p_intf, NULL ), qtr("Audio"), 2 );
BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 ); BAR_DADD( NavigMenu( p_intf, NULL ), qtr("Navigation"), 3 );
// BAR_ADD( HelpMenu(), qtr("Help" ) ); BAR_ADD( HelpMenu(), qtr("Help" ) );
} }
QMenu *QVLCMenu::FileMenu() QMenu *QVLCMenu::FileMenu()
{ {
...@@ -326,6 +326,16 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf ) ...@@ -326,6 +326,16 @@ QMenu *QVLCMenu::SDMenu( intf_thread_t *p_intf )
return menu; 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 * Popup menus
*****************************************************************************/ *****************************************************************************/
......
...@@ -70,6 +70,7 @@ public: ...@@ -70,6 +70,7 @@ public:
static QMenu *VideoMenu( intf_thread_t * , QMenu * ); static QMenu *VideoMenu( intf_thread_t * , QMenu * );
static QMenu *AudioMenu( intf_thread_t * , QMenu * ); static QMenu *AudioMenu( intf_thread_t * , QMenu * );
static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * ); static QMenu *InterfacesMenu( intf_thread_t *p_intf, QMenu * );
static QMenu *HelpMenu();
/* Popups */ /* Popups */
static void AudioPopupMenu( intf_thread_t * ); static void AudioPopupMenu( intf_thread_t * );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment