]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/open_panels.cpp
Missing item to translate.
[vlc] / modules / gui / qt4 / components / open_panels.cpp
index 5270983a9ccc1636c1b20e1098bd32e2b550a4a5..488d3f34275d68436fde9e773f2cad7c75037cea 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * open.cpp : Panels for the open dialogs
  ****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
  * Copyright (C) 2007 Société des arts technologiques
  * Copyright (C) 2007 Savoir-faire Linux
  *
@@ -45,6 +45,8 @@
 #include <QScrollArea>
 #include <QUrl>
 
+#define I_DEVICE_TOOLTIP N_("Select the device or the VIDEO_TS directory")
+
 /**************************************************************************
  * Open Files and subtitles                                               *
  **************************************************************************/
@@ -74,8 +76,10 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
     dialogBox->setFileMode( QFileDialog::ExistingFiles );
     dialogBox->setAcceptMode( QFileDialog::AcceptOpen );
-    dialogBox->setViewMode( config_GetInt( p_intf, "qt-open-detail" ) ?
-            QFileDialog::Detail : QFileDialog::List );
+#if HAS_QT43
+    dialogBox->restoreState(
+            getSettings()->value( "file-dialog-state" ).toByteArray() );
+#endif
 
     /* We don't want to see a grip in the middle of the window, do we? */
     dialogBox->setSizeGripEnabled( false );
@@ -138,6 +142,9 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
 FileOpenPanel::~FileOpenPanel()
 {
+#if HAS_QT43
+    getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
+#endif
 }
 
 /* Show a fileBrowser to select a subtitle */
@@ -219,6 +226,9 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     b_firstvcd = true;
     b_firstcdda = true;
 
+    ui.browseDiscButton->setToolTip( I_DEVICE_TOOLTIP );
+    ui.deviceCombo->setToolTip( I_DEVICE_TOOLTIP );
+
 #if WIN32 /* Disc drives probing for Windows */
     char szDrives[512];
     szDrives[0] = '\0';
@@ -248,7 +258,8 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
     BUTTONACT( ui.audioCDRadioButton, updateButtons() );
     BUTTONACT( ui.dvdsimple, updateButtons() );
     BUTTONACT( ui.browseDiscButton, browseDevice() );
-    BUTTONACT( ui.ejectButton, eject() );
+    BUTTON_SET_ACT_I( ui.ejectButton, "", eject, qtr( "Eject the disc" ),
+            eject() );
 
     CONNECT( ui.deviceCombo, editTextChanged( QString ), this, updateMRL());
     CONNECT( ui.titleSpin, valueChanged( int ), this, updateMRL());
@@ -262,9 +273,9 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
 
 DiscOpenPanel::~DiscOpenPanel()
 {
-    delete psz_dvddiscpath;
-    delete psz_vcddiscpath;
-    delete psz_cddadiscpath;
+    free( psz_dvddiscpath );
+    free( psz_vcddiscpath );
+    free( psz_cddadiscpath );
 }
 
 void DiscOpenPanel::clear()
@@ -389,7 +400,7 @@ void DiscOpenPanel::updateMRL()
 void DiscOpenPanel::browseDevice()
 {
     QString dir = QFileDialog::getExistingDirectory( 0,
-            qtr("Open a device or a VIDEO_TS directory") );
+            qtr( I_DEVICE_TOOLTIP ) );
     if (!dir.isEmpty()) {
         ui.deviceCombo->setEditText( dir );
     }