Commit 90d369f6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: plugins dialog as a toggle one.

Close #2900
(cherry picked from commit e957d5d4)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 0c5b60da
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <QLineEdit> #include <QLineEdit>
#include <QLabel> #include <QLabel>
PluginDialog *PluginDialog::instance = NULL;
PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf ) PluginDialog::PluginDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
{ {
setAttribute( Qt::WA_DeleteOnClose ); setAttribute( Qt::WA_DeleteOnClose );
......
...@@ -34,11 +34,23 @@ class PluginDialog : public QVLCFrame ...@@ -34,11 +34,23 @@ class PluginDialog : public QVLCFrame
{ {
Q_OBJECT; Q_OBJECT;
public: 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: private:
void FillTree(); PluginDialog( intf_thread_t * );
virtual ~PluginDialog(); virtual ~PluginDialog();
static PluginDialog *instance;
void FillTree();
QTreeWidget *treePlugins; QTreeWidget *treePlugins;
SearchLineEdit *edit; SearchLineEdit *edit;
private slots: private slots:
......
...@@ -251,8 +251,7 @@ void DialogsProvider::toolbarDialog() ...@@ -251,8 +251,7 @@ void DialogsProvider::toolbarDialog()
void DialogsProvider::pluginDialog() void DialogsProvider::pluginDialog()
{ {
PluginDialog *diag = new PluginDialog( p_intf ); PluginDialog::getInstance( p_intf )->toggleVisible();
diag->show();
} }
/* Generic open file */ /* Generic open file */
......
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