[vlc-devel] commit: Qt: plugins dialog as a toggle one. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Thu Jul 2 00:57:52 CEST 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jul 2 00:57:15 2009 +0200| [e957d5d4b4021555b4f6d3fa64499f0e6ecd77aa] | committer: Jean-Baptiste Kempf
Qt: plugins dialog as a toggle one.
Close #2900
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e957d5d4b4021555b4f6d3fa64499f0e6ecd77aa
---
modules/gui/qt4/dialogs/plugins.cpp | 2 ++
modules/gui/qt4/dialogs/plugins.hpp | 16 ++++++++++++++--
modules/gui/qt4/dialogs_provider.cpp | 3 +--
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt4/dialogs/plugins.cpp b/modules/gui/qt4/dialogs/plugins.cpp
index e8fa2df..722ea0f 100644
--- a/modules/gui/qt4/dialogs/plugins.cpp
+++ b/modules/gui/qt4/dialogs/plugins.cpp
@@ -38,6 +38,8 @@
#include <QLineEdit>
#include <QLabel>
+PluginDialog *PluginDialog::instance = NULL;
+
PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{
setAttribute( Qt::WA_DeleteOnClose );
diff --git a/modules/gui/qt4/dialogs/plugins.hpp b/modules/gui/qt4/dialogs/plugins.hpp
index 798f01f..1a243a8 100644
--- a/modules/gui/qt4/dialogs/plugins.hpp
+++ b/modules/gui/qt4/dialogs/plugins.hpp
@@ -34,11 +34,23 @@ class PluginDialog : public QVLCFrame
{
Q_OBJECT;
public:
- PluginDialog( intf_thread_t * );
+ static PluginDialog * getInstance( intf_thread_t *p_intf )
+ {
+ if( !instance)
+ instance = new PluginDialog( p_intf );
+ return instance;
+ }
+ static void killInstance()
+ {
+ delete instance;
+ instance = NULL;
+ }
private:
- void FillTree();
+ PluginDialog( intf_thread_t * );
virtual ~PluginDialog();
+ static PluginDialog *instance;
+ void FillTree();
QTreeWidget *treePlugins;
SearchLineEdit *edit;
private slots:
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index dad8834..9a954e9 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -259,8 +259,7 @@ void DialogsProvider::toolbarDialog()
void DialogsProvider::pluginDialog()
{
- PluginDialog *diag = new PluginDialog( p_intf );
- diag->show();
+ PluginDialog::getInstance( p_intf )->toggleVisible();
}
/* Generic open file */
More information about the vlc-devel
mailing list