]> git.sesse.net Git - vlc/commitdiff
Handle blocking errors, fix layout for login
authorClément Stenac <zorglub@videolan.org>
Thu, 3 Aug 2006 15:27:19 +0000 (15:27 +0000)
committerClément Stenac <zorglub@videolan.org>
Thu, 3 Aug 2006 15:27:19 +0000 (15:27 +0000)
modules/gui/qt4/dialogs/interaction.cpp
modules/gui/qt4/dialogs/interaction.hpp
modules/gui/qt4/menus.cpp

index bac8714a9c88e071e724e8d45959e71116aaa1c0..a419affd30c1f1599d3a73a8bf0823f73fe6a748 100644 (file)
@@ -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;
index 6b42b99316556a88c2f06fcf160e6b58ac965755..7a0fef5e5463d472c0d325c3a8405154fadd2d7c 100644 (file)
@@ -43,6 +43,7 @@ public:
     void Update();
 
 private:
+    QWidget *panel;
     intf_thread_t *p_intf;
     interaction_dialog_t *p_dialog;
     Ui::LoginDialog *uiLogin;
index be689d1055e39c1fcaa324a4ba4c846099091aab..53d9d5cbf4ddd9f9a5cb6ae0dbf8189d0eac62fa 100644 (file)
@@ -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 );
 }