[vlc-devel] commit: Qt: make the customize dialog a true Dialog. (Jean-Baptiste Kempf )
git version control
git at videolan.org
Mon Apr 20 11:04:22 CEST 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Apr 19 18:06:05 2009 +0200| [ee538255de348db7e6e3781081b368c35e029234] | committer: Jean-Baptiste Kempf
Qt: make the customize dialog a true Dialog.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee538255de348db7e6e3781081b368c35e029234
---
modules/gui/qt4/dialogs/toolbar.cpp | 7 +++----
modules/gui/qt4/dialogs/toolbar.hpp | 16 +++-------------
modules/gui/qt4/dialogs_provider.cpp | 4 ++--
3 files changed, 8 insertions(+), 19 deletions(-)
diff --git a/modules/gui/qt4/dialogs/toolbar.cpp b/modules/gui/qt4/dialogs/toolbar.cpp
index 1d2bb2f..90838c4 100644
--- a/modules/gui/qt4/dialogs/toolbar.cpp
+++ b/modules/gui/qt4/dialogs/toolbar.cpp
@@ -41,14 +41,13 @@
#include <QDialogButtonBox>
#include <QInputDialog>
-ToolbarEditDialog *ToolbarEditDialog::instance = NULL;
-
-ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
- : QVLCFrame( _p_intf )
+ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf)
+ : QVLCDialog( _w, _p_intf )
{
setWindowTitle( qtr( "Toolbars Editor" ) );
QGridLayout *mainLayout = new QGridLayout( this );
setMinimumWidth( 600 );
+ setAttribute( Qt::WA_DeleteOnClose );
/* main GroupBox */
QGroupBox *widgetBox = new QGroupBox( qtr( "Toolbar Elements") , this );
diff --git a/modules/gui/qt4/dialogs/toolbar.hpp b/modules/gui/qt4/dialogs/toolbar.hpp
index 2d29b6f..84dbeb3 100644
--- a/modules/gui/qt4/dialogs/toolbar.hpp
+++ b/modules/gui/qt4/dialogs/toolbar.hpp
@@ -58,26 +58,16 @@ private:
ToolbarEditDialog *parent;
};
-class ToolbarEditDialog : public QVLCFrame
+class ToolbarEditDialog : public QVLCDialog
{
Q_OBJECT;
public:
- static ToolbarEditDialog * getInstance( intf_thread_t *p_intf )
- {
- if( !instance)
- instance = new ToolbarEditDialog( p_intf );
- return instance;
- }
- static void killInstance()
- { delete instance; instance = NULL;}
+ ToolbarEditDialog( QWidget *, intf_thread_t * );
int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
bigBox->isChecked() * WIDGET_BIG +
!shinyBox->isChecked() * WIDGET_SHINY; }
-private:
- ToolbarEditDialog( intf_thread_t * );
virtual ~ToolbarEditDialog();
-
- static ToolbarEditDialog *instance;
+private:
QCheckBox *flatBox, *bigBox, *shinyBox;
QComboBox *positionCombo, *profileCombo;
diff --git a/modules/gui/qt4/dialogs_provider.cpp b/modules/gui/qt4/dialogs_provider.cpp
index ed1af0b..746873e 100644
--- a/modules/gui/qt4/dialogs_provider.cpp
+++ b/modules/gui/qt4/dialogs_provider.cpp
@@ -89,7 +89,6 @@ DialogsProvider::~DialogsProvider()
#ifdef UPDATE_CHECK
UpdateDialog::killInstance();
#endif
- ToolbarEditDialog::killInstance();
delete menusMapper;
delete menusUpdateMapper;
@@ -242,7 +241,8 @@ void DialogsProvider::podcastConfigureDialog()
void DialogsProvider::toolbarDialog()
{
- ToolbarEditDialog::getInstance( p_intf )->toggleVisible();
+ ToolbarEditDialog *toolbarEditor = new ToolbarEditDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
+ toolbarEditor->exec();
}
void DialogsProvider::pluginDialog()
More information about the vlc-devel
mailing list