/*****************************************************************************
* 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
*
#include <QScrollArea>
#include <QUrl>
+#define I_DEVICE_TOOLTIP "Select the device or the VIDEO_TS directory"
+
/**************************************************************************
* Open Files and subtitles *
**************************************************************************/
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 );
FileOpenPanel::~FileOpenPanel()
{
+#if HAS_QT43
+ getSettings()->setValue( "file-dialog-state", dialogBox->saveState() );
+#endif
}
/* Show a fileBrowser to select a subtitle */
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';
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());
DiscOpenPanel::~DiscOpenPanel()
{
- delete psz_dvddiscpath;
- delete psz_vcddiscpath;
- delete psz_cddadiscpath;
+ free( psz_dvddiscpath );
+ free( psz_vcddiscpath );
+ free( psz_cddadiscpath );
}
void DiscOpenPanel::clear()
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 );
}