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 @@
#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 );
......
......@@ -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;
......
......@@ -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()
......
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