Commit 933b2755 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open cleaning and comments.

parent a8add18e
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include "dialogs_provider.hpp" #include "dialogs_provider.hpp"
#include "components/preferences_widgets.hpp" #include "components/preferences_widgets.hpp"
#include <QFileDialog> #include <QFileDialog>
#include <QDialogButtonBox> #include <QDialogButtonBox>
#include <QLineEdit> #include <QLineEdit>
...@@ -96,7 +95,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -96,7 +95,6 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
#if HAS_QT43 #if HAS_QT43
lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0]; lineFileEdit = dialogBox->findChildren<QLineEdit*>()[0];
#else #else
// FIXME
lineFileEdit = dialogBox->findChildren<QLineEdit*>()[1]; lineFileEdit = dialogBox->findChildren<QLineEdit*>()[1];
#endif #endif
/* Make a list of QLabel inside the QFileDialog to access the good ones */ /* Make a list of QLabel inside the QFileDialog to access the good ones */
...@@ -135,23 +133,14 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -135,23 +133,14 @@ FileOpenPanel::FileOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
BUTTONACT( ui.subCheckBox, toggleSubtitleFrame()); BUTTONACT( ui.subCheckBox, toggleSubtitleFrame());
CONNECT( lineFileEdit, textChanged( QString ), this, updateMRL() ); CONNECT( lineFileEdit, textChanged( QString ), this, updateMRL() );
CONNECT( ui.subInput, textChanged( QString ), this, updateMRL() ); CONNECT( ui.subInput, textChanged( QString ), this, updateMRL() );
CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, CONNECT( ui.alignSubComboBox, currentIndexChanged( int ), this, updateMRL() );
updateMRL() ); CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this, updateMRL() );
CONNECT( ui.sizeSubComboBox, currentIndexChanged( int ), this,
updateMRL() );
}
FileOpenPanel::~FileOpenPanel()
{}
QStringList FileOpenPanel::browse( QString help )
{
return THEDP->showSimpleOpen( help );
} }
FileOpenPanel::~FileOpenPanel(){}
/* Show a fileBrowser to select a subtitle */
void FileOpenPanel::browseFileSub() void FileOpenPanel::browseFileSub()
{ {
// FIXME Handle selection of more than one subtitles file // FIXME Handle selection of more than one subtitles file
...@@ -163,6 +152,7 @@ void FileOpenPanel::browseFileSub() ...@@ -163,6 +152,7 @@ void FileOpenPanel::browseFileSub()
updateMRL(); updateMRL();
} }
/* Update the current MRL */
void FileOpenPanel::updateMRL() void FileOpenPanel::updateMRL()
{ {
QString mrl = ""; QString mrl = "";
...@@ -187,7 +177,7 @@ void FileOpenPanel::updateMRL() ...@@ -187,7 +177,7 @@ void FileOpenPanel::updateMRL()
/* Function called by Open Dialog when clicke on Play/Enqueue */ /* Function called by Open Dialog when clicke on Play/Enqueue */
void FileOpenPanel::accept() void FileOpenPanel::accept()
{ {
//FIXME set the completer //TODO 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() )) )
...@@ -197,7 +187,6 @@ void FileOpenPanel::accept() ...@@ -197,7 +187,6 @@ void FileOpenPanel::accept()
qtu( dialogBox->directory().absolutePath() ) ); qtu( dialogBox->directory().absolutePath() ) );
} }
delete psz_filepath; delete psz_filepath;
} }
void FileOpenBox::accept() void FileOpenBox::accept()
...@@ -255,7 +244,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -255,7 +244,7 @@ DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
} }
SetErrorMode(oldMode); SetErrorMode(oldMode);
} }
#else /* Disc Probing under Windows */ #else /* Use a Completer under Linux */
QCompleter *discCompleter = new QCompleter( this ); QCompleter *discCompleter = new QCompleter( this );
discCompleter->setModel( new QDirModel( discCompleter ) ); discCompleter->setModel( new QDirModel( discCompleter ) );
ui.deviceCombo->setCompleter( discCompleter ); ui.deviceCombo->setCompleter( discCompleter );
...@@ -303,6 +292,7 @@ void DiscOpenPanel::clear() ...@@ -303,6 +292,7 @@ void DiscOpenPanel::clear()
ui.deviceCombo->setEditText( qfu( psz_name ) ); } ui.deviceCombo->setEditText( qfu( psz_name ) ); }
#endif #endif
/* update the buttons according the type of device */
void DiscOpenPanel::updateButtons() void DiscOpenPanel::updateButtons()
{ {
if ( ui.dvdRadioButton->isChecked() ) if ( ui.dvdRadioButton->isChecked() )
...@@ -345,6 +335,7 @@ void DiscOpenPanel::updateButtons() ...@@ -345,6 +335,7 @@ void DiscOpenPanel::updateButtons()
updateMRL(); updateMRL();
} }
/* Update the current MRL */
void DiscOpenPanel::updateMRL() void DiscOpenPanel::updateMRL()
{ {
QString mrl = ""; QString mrl = "";
...@@ -422,7 +413,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -422,7 +413,7 @@ NetOpenPanel::NetOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
CONNECT( ui.protocolCombo, currentIndexChanged( int ), CONNECT( ui.protocolCombo, currentIndexChanged( int ),
this, updateProtocol( int ) ); this, updateProtocol( int ) );
CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() ); CONNECT( ui.portSpin, valueChanged( int ), this, updateMRL() );
CONNECT( ui.addressText, textChanged( QString ), this, updateAddress()); CONNECT( ui.addressText, textChanged( QString ), this, updateMRL());
CONNECT( ui.timeShift, clicked(), this, updateMRL()); CONNECT( ui.timeShift, clicked(), this, updateMRL());
CONNECT( ui.ipv6, clicked(), this, updateMRL()); CONNECT( ui.ipv6, clicked(), this, updateMRL());
...@@ -441,6 +432,7 @@ NetOpenPanel::~NetOpenPanel() ...@@ -441,6 +432,7 @@ NetOpenPanel::~NetOpenPanel()
void NetOpenPanel::clear() void NetOpenPanel::clear()
{} {}
/* update the widgets according the type of protocol */
void NetOpenPanel::updateProtocol( int idx ) { void NetOpenPanel::updateProtocol( int idx ) {
QString addr = ui.addressText->text(); QString addr = ui.addressText->text();
QString proto = ui.protocolCombo->itemData( idx ).toString(); QString proto = ui.protocolCombo->itemData( idx ).toString();
...@@ -459,10 +451,6 @@ void NetOpenPanel::updateProtocol( int idx ) { ...@@ -459,10 +451,6 @@ void NetOpenPanel::updateProtocol( int idx ) {
updateMRL(); updateMRL();
} }
void NetOpenPanel::updateAddress() {
updateMRL();
}
void NetOpenPanel::updateMRL() { void NetOpenPanel::updateMRL() {
QString mrl = ""; QString mrl = "";
QString addr = ui.addressText->text(); QString addr = ui.addressText->text();
......
...@@ -123,8 +123,7 @@ private: ...@@ -123,8 +123,7 @@ private:
public slots: public slots:
virtual void updateMRL(); virtual void updateMRL();
private slots: private slots:
void updateProtocol(int); void updateProtocol( int );
void updateAddress();
}; };
class DiscOpenPanel: public OpenPanel class DiscOpenPanel: public OpenPanel
......
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