X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fopen_panels.cpp;h=488d3f34275d68436fde9e773f2cad7c75037cea;hb=552b5247eea6d1c0c93407c49ce64a39af751e43;hp=100e52950fcad58ac7083b629bc2d09b331e4ec5;hpb=763302ecde9c0edb1170d4b1efac860a484728cc;p=vlc diff --git a/modules/gui/qt4/components/open_panels.cpp b/modules/gui/qt4/components/open_panels.cpp index 100e52950f..488d3f3427 100644 --- a/modules/gui/qt4/components/open_panels.cpp +++ b/modules/gui/qt4/components/open_panels.cpp @@ -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 #include +#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 */ @@ -183,7 +190,7 @@ void FileOpenPanel::accept() void FileOpenBox::accept() { - OpenDialog::getInstance( NULL, NULL )->play(); + OpenDialog::getInstance( NULL, NULL, true )->selectSlots(); } /* Function called by Open Dialog when clicked on cancel */ @@ -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 ); }