Commit 295364c7 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - try to remember latest open disc path.

parent 817979aa
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright (C) 2006-2007 the VideoLAN team * Copyright (C) 2006-2007 the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques * Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux * Copyright (C) 2007 Savoir-faire Linux
*
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
...@@ -69,6 +70,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -69,6 +70,7 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
{ {
psz_filepath = p_intf->p_libvlc->psz_homedir; psz_filepath = p_intf->p_libvlc->psz_homedir;
} }
// Make this QFileDialog a child of tempWidget from the ui. // Make this QFileDialog a child of tempWidget from the ui.
dialogBox = new FileOpenBox( ui.tempWidget, NULL, dialogBox = new FileOpenBox( ui.tempWidget, NULL,
qfu( psz_filepath ), fileTypes ); qfu( psz_filepath ), fileTypes );
...@@ -178,6 +180,15 @@ void FileOpenPanel::updateMRL() ...@@ -178,6 +180,15 @@ void FileOpenPanel::updateMRL()
mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) ); mrl.append( " :freetype-rel-fontsize=" + QString().setNum( size ) );
} }
emit mrlUpdated( mrl );
emit methodChanged( "file-caching" );
}
/* Function called by Open Dialog when clicke on Play/Enqueue */
void FileOpenPanel::accept()
{
//FIXME set the completer
const char *psz_filepath = config_GetPsz( p_intf, "qt-filedialog-path" ); const char *psz_filepath = config_GetPsz( p_intf, "qt-filedialog-path" );
if( ( NULL == psz_filepath ) if( ( NULL == psz_filepath )
|| strcmp( psz_filepath, qtu( dialogBox->directory().absolutePath() )) ) || strcmp( psz_filepath, qtu( dialogBox->directory().absolutePath() )) )
...@@ -188,15 +199,6 @@ void FileOpenPanel::updateMRL() ...@@ -188,15 +199,6 @@ void FileOpenPanel::updateMRL()
} }
delete psz_filepath; delete psz_filepath;
emit mrlUpdated( mrl );
emit methodChanged( "file-caching" );
}
/* Function called by Open Dialog when clicke on Play/Enqueue */
void FileOpenPanel::accept()
{
//FIXME set the completer
} }
void FileOpenBox::accept() void FileOpenBox::accept()
...@@ -227,6 +229,8 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -227,6 +229,8 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
{ {
ui.setupUi( this ); ui.setupUi( this );
char *psz_discpath = config_GetPsz( p_intf, "qt-discdialog-path" );
#if WIN32 /* Disc drives probing for Windows */ #if WIN32 /* Disc drives probing for Windows */
char szDrives[512]; char szDrives[512];
szDrives[0] = '\0'; szDrives[0] = '\0';
...@@ -244,8 +248,16 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -244,8 +248,16 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
} }
SetErrorMode(oldMode); SetErrorMode(oldMode);
} }
int index = ui.deviceCombo->findText( qfu( psz_discpath ) )
if( index != -1 ) ui.deviceCombo->setCurrentIndex( index );
#endif /* Disc Probing under Windows */ #endif /* Disc Probing under Windows */
ui.deviceCombo->setEditText( qfu( psz_discpath ) );
delete psz_discpath;
/* CONNECTs */ /* CONNECTs */
BUTTONACT( ui.dvdRadioButton, updateButtons() ); BUTTONACT( ui.dvdRadioButton, updateButtons() );
BUTTONACT( ui.vcdRadioButton, updateButtons() ); BUTTONACT( ui.vcdRadioButton, updateButtons() );
...@@ -359,6 +371,13 @@ void DiscOpenPanel::browseDevice() ...@@ -359,6 +371,13 @@ void DiscOpenPanel::browseDevice()
updateMRL(); updateMRL();
} }
void DiscOpenPanel::accept()
{
/* set dialog box current directory as last known path */
config_PutPsz( p_intf, "qt-discdialog-path",
qtu( ui.deviceCombo->currentText() ) );
}
/************************************************************************** /**************************************************************************
* Open Network streams and URL pages * * Open Network streams and URL pages *
**************************************************************************/ **************************************************************************/
......
...@@ -134,6 +134,7 @@ public: ...@@ -134,6 +134,7 @@ public:
DiscOpenPanel( QWidget *, intf_thread_t * ); DiscOpenPanel( QWidget *, intf_thread_t * );
virtual ~DiscOpenPanel(); virtual ~DiscOpenPanel();
virtual void clear() ; virtual void clear() ;
virtual void accept() ;
private: private:
Ui::OpenDisk ui; Ui::OpenDisk ui;
public slots: public slots:
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -69,7 +70,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * ); ...@@ -69,7 +70,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define TITLE_LONGTEXT N_("Show the name of the song or video in the " \ #define TITLE_LONGTEXT N_("Show the name of the song or video in the " \
"controler window title") "controler window title")
#define FILEDIALOG_PATH_TEXT N_("Path to use in file dialog") #define FILEDIALOG_PATH_TEXT N_("Path to use in openfile dialog")
#define DISCDIALOG_PATH_TEXT N_("Path to device to use in open disc dialog")
#define NOTIFICATION_TEXT N_("Show notification popup on track change") #define NOTIFICATION_TEXT N_("Show notification popup on track change")
#define NOTIFICATION_LONGTEXT N_( \ #define NOTIFICATION_LONGTEXT N_( \
...@@ -124,6 +127,10 @@ vlc_module_begin(); ...@@ -124,6 +127,10 @@ vlc_module_begin();
FILEDIALOG_PATH_TEXT, VLC_TRUE); FILEDIALOG_PATH_TEXT, VLC_TRUE);
change_autosave(); change_autosave();
change_internal(); change_internal();
add_string( "qt-discdialog-path", NULL, NULL, DISCDIALOG_PATH_TEXT,
DISCDIALOG_PATH_TEXT, VLC_TRUE);
change_autosave();
change_internal();
add_bool( "qt-notification", VLC_TRUE, NULL, NOTIFICATION_TEXT, add_bool( "qt-notification", VLC_TRUE, NULL, NOTIFICATION_TEXT,
NOTIFICATION_LONGTEXT, VLC_FALSE ); NOTIFICATION_LONGTEXT, VLC_FALSE );
...@@ -145,7 +152,6 @@ vlc_module_begin(); ...@@ -145,7 +152,6 @@ vlc_module_begin();
set_callbacks( OpenDialogs, Close ); set_callbacks( OpenDialogs, Close );
vlc_module_end(); vlc_module_end();
/***************************************************************************** /*****************************************************************************
* Module callbacks * Module callbacks
*****************************************************************************/ *****************************************************************************/
......
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