Commit c17969a0 authored by Clément Stenac's avatar Clément Stenac

Handle blocking errors, fix layout for login

parent 669d2f81
......@@ -35,13 +35,18 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
uiLogin = NULL;
uiProgress = NULL;
uiInput = NULL;
panel = NULL;
if( p_dialog->i_flags & DIALOG_BLOCKING_ERROR )
{
i_ret = QMessageBox::critical( this, qfu( p_dialog->psz_title ),
qfu( p_dialog->psz_description ),
QMessageBox::Ok, 0, 0 );
}
else if( p_dialog->i_flags & DIALOG_NONBLOCKING_ERROR )
{
// Create instance of the errors dialog
// QApplication::style()->standardPixmap(QStyle::SP_MessageBoxCritical)
}
else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
{
......@@ -57,13 +62,14 @@ InteractionDialog::InteractionDialog( intf_thread_t *_p_intf,
}
else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL )
{
panel = new QWidget( 0 );
uiLogin = new Ui::LoginDialog;
uiLogin->setupUi( this );
uiLogin->setupUi( panel );
uiLogin->description->setText( qfu(p_dialog->psz_description) );
layout->addWidget( panel );
}
else if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
}
else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
{
......@@ -103,6 +109,7 @@ void InteractionDialog::Update()
InteractionDialog::~InteractionDialog()
{
if( panel ) delete panel;
if( uiInput ) delete uiInput;
if( uiProgress) delete uiProgress;
if( uiLogin ) delete uiLogin;
......
......@@ -43,6 +43,7 @@ public:
void Update();
private:
QWidget *panel;
intf_thread_t *p_intf;
interaction_dialog_t *p_dialog;
Ui::LoginDialog *uiLogin;
......
......@@ -459,8 +459,6 @@ QMenu * QVLCMenu::Populate( intf_thread_t *p_intf, QMenu *current,
* Private methods.
*****************************************************************************/
#define FREE(x) if(x) { free(x);x=NULL;}
static bool IsMenuEmpty( const char *psz_var, vlc_object_t *p_object,
bool b_root = TRUE )
{
......@@ -548,7 +546,7 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
}
else
CreateChoicesMenu( menu, psz_var, p_object, true );
FREE( text.psz_string );
FREENULL( text.psz_string );
return;
}
......@@ -569,7 +567,7 @@ void QVLCMenu::CreateItem( QMenu *menu, const char *psz_var,
p_object->i_object_id, val, i_type, val.b_bool );
break;
}
FREE( text.psz_string );
FREENULL( text.psz_string );
}
......
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