Commit c17969a0 authored by zorglub's avatar zorglub

Handle blocking errors, fix layout for login

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