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

Qt: make the customize dialog a true Dialog.

parent 20b1d363
...@@ -41,14 +41,13 @@ ...@@ -41,14 +41,13 @@
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QInputDialog> #include <QInputDialog>
ToolbarEditDialog *ToolbarEditDialog::instance = NULL; ToolbarEditDialog::ToolbarEditDialog( QWidget *_w, intf_thread_t *_p_intf)
: QVLCDialog( _w, _p_intf )
ToolbarEditDialog::ToolbarEditDialog( intf_thread_t *_p_intf)
: QVLCFrame( _p_intf )
{ {
setWindowTitle( qtr( "Toolbars Editor" ) ); setWindowTitle( qtr( "Toolbars Editor" ) );
QGridLayout *mainLayout = new QGridLayout( this ); QGridLayout *mainLayout = new QGridLayout( this );
setMinimumWidth( 600 ); setMinimumWidth( 600 );
setAttribute( Qt::WA_DeleteOnClose );
/* main GroupBox */ /* main GroupBox */
QGroupBox *widgetBox = new QGroupBox( qtr( "Toolbar Elements") , this ); QGroupBox *widgetBox = new QGroupBox( qtr( "Toolbar Elements") , this );
......
...@@ -58,26 +58,16 @@ private: ...@@ -58,26 +58,16 @@ private:
ToolbarEditDialog *parent; ToolbarEditDialog *parent;
}; };
class ToolbarEditDialog : public QVLCFrame class ToolbarEditDialog : public QVLCDialog
{ {
Q_OBJECT; Q_OBJECT;
public: public:
static ToolbarEditDialog * getInstance( intf_thread_t *p_intf ) ToolbarEditDialog( QWidget *, intf_thread_t * );
{
if( !instance)
instance = new ToolbarEditDialog( p_intf );
return instance;
}
static void killInstance()
{ delete instance; instance = NULL;}
int getOptions() { return flatBox->isChecked() * WIDGET_FLAT + int getOptions() { return flatBox->isChecked() * WIDGET_FLAT +
bigBox->isChecked() * WIDGET_BIG + bigBox->isChecked() * WIDGET_BIG +
!shinyBox->isChecked() * WIDGET_SHINY; } !shinyBox->isChecked() * WIDGET_SHINY; }
private:
ToolbarEditDialog( intf_thread_t * );
virtual ~ToolbarEditDialog(); virtual ~ToolbarEditDialog();
private:
static ToolbarEditDialog *instance;
QCheckBox *flatBox, *bigBox, *shinyBox; QCheckBox *flatBox, *bigBox, *shinyBox;
QComboBox *positionCombo, *profileCombo; QComboBox *positionCombo, *profileCombo;
......
...@@ -89,7 +89,6 @@ DialogsProvider::~DialogsProvider() ...@@ -89,7 +89,6 @@ DialogsProvider::~DialogsProvider()
#ifdef UPDATE_CHECK #ifdef UPDATE_CHECK
UpdateDialog::killInstance(); UpdateDialog::killInstance();
#endif #endif
ToolbarEditDialog::killInstance();
delete menusMapper; delete menusMapper;
delete menusUpdateMapper; delete menusUpdateMapper;
...@@ -242,7 +241,8 @@ void DialogsProvider::podcastConfigureDialog() ...@@ -242,7 +241,8 @@ void DialogsProvider::podcastConfigureDialog()
void DialogsProvider::toolbarDialog() 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() void DialogsProvider::pluginDialog()
......
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