Commit 905e5d8a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Dialog. Use #defines for tab naming to avoid miscomprehensions. Cosmectics.

parent d998d106
...@@ -216,7 +216,7 @@ void FileOpenPanel::toggleSubtitleFrame() ...@@ -216,7 +216,7 @@ void FileOpenPanel::toggleSubtitleFrame()
/************************************************************************** /**************************************************************************
* Disk open * Disk open
**************************************************************************/ **************************************************************************/
DiskOpenPanel::DiskOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : DiscOpenPanel::DiscOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
OpenPanel( _parent, _p_intf ) OpenPanel( _parent, _p_intf )
{ {
ui.setupUi( this ); ui.setupUi( this );
...@@ -230,16 +230,16 @@ DiskOpenPanel::DiskOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) : ...@@ -230,16 +230,16 @@ DiskOpenPanel::DiskOpenPanel( QWidget *_parent, intf_thread_t *_p_intf ) :
CONNECT( ui.chapterSpin, valueChanged(int), this, updateMRL()); CONNECT( ui.chapterSpin, valueChanged(int), this, updateMRL());
} }
DiskOpenPanel::~DiskOpenPanel() DiscOpenPanel::~DiscOpenPanel()
{} {}
void DiskOpenPanel::clear() void DiscOpenPanel::clear()
{ {
ui.titleSpin->setValue(0); ui.titleSpin->setValue(0);
ui.chapterSpin->setValue(0); ui.chapterSpin->setValue(0);
} }
void DiskOpenPanel::updateMRL() void DiscOpenPanel::updateMRL()
{ {
QString mrl = ""; QString mrl = "";
/* DVD */ /* DVD */
......
...@@ -103,12 +103,12 @@ private slots: ...@@ -103,12 +103,12 @@ private slots:
void updateAddress(); void updateAddress();
}; };
class DiskOpenPanel: public OpenPanel class DiscOpenPanel: public OpenPanel
{ {
Q_OBJECT; Q_OBJECT;
public: public:
DiskOpenPanel( QWidget *, intf_thread_t * ); DiscOpenPanel( QWidget *, intf_thread_t * );
virtual ~DiskOpenPanel(); virtual ~DiscOpenPanel();
virtual void clear() ; virtual void clear() ;
private: private:
Ui::OpenDisk ui; Ui::OpenDisk ui;
......
...@@ -48,30 +48,32 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -48,30 +48,32 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
resize( 500, 300); resize( 500, 300);
/* Tab definition and creation */ /* Tab definition and creation */
fileOpenPanel = new FileOpenPanel( ui.Tab , p_intf ); fileOpenPanel = new FileOpenPanel( ui.Tab, p_intf );
diskOpenPanel = new DiskOpenPanel( ui.Tab , p_intf ); discOpenPanel = new DiscOpenPanel( ui.Tab, p_intf );
netOpenPanel = new NetOpenPanel( ui.Tab , p_intf ); netOpenPanel = new NetOpenPanel( ui.Tab, p_intf );
captureOpenPanel = new CaptureOpenPanel( ui.Tab, p_intf ); captureOpenPanel = new CaptureOpenPanel( ui.Tab, p_intf );
ui.Tab->addTab( fileOpenPanel, qtr( "&File" ) ); ui.Tab->insertTab( OPEN_FILE_TAB, fileOpenPanel, qtr( "&File" ) );
ui.Tab->addTab( diskOpenPanel, qtr( "&Disc" ) ); ui.Tab->insertTab( OPEN_DISC_TAB, discOpenPanel, qtr( "&Disc" ) );
ui.Tab->addTab( netOpenPanel, qtr( "&Network" ) ); ui.Tab->insertTab( OPEN_NETWORK_TAB, netOpenPanel, qtr( "&Network" ) );
ui.Tab->addTab( captureOpenPanel, qtr( "Capture &Device" ) ); ui.Tab->insertTab( OPEN_CAPTURE_TAB, captureOpenPanel,
qtr( "Capture &Device" ) );
/* Hide the advancedPanel */ /* Hide the advancedPanel */
ui.advancedFrame->hide(); ui.advancedFrame->hide();
/* Buttons Creation */ /* Buttons Creation */
QSizePolicy buttonSizePolicy(static_cast<QSizePolicy::Policy>(7), static_cast<QSizePolicy::Policy>(1)); QSizePolicy buttonSizePolicy( static_cast<QSizePolicy::Policy>(7),
static_cast<QSizePolicy::Policy>(1) );
buttonSizePolicy.setHorizontalStretch(0); buttonSizePolicy.setHorizontalStretch(0);
buttonSizePolicy.setVerticalStretch(0); buttonSizePolicy.setVerticalStretch(0);
playButton = new QToolButton(); playButton = new QToolButton();
playButton->setText( qtr( "&Play" ) ); playButton->setText( qtr( "&Play" ) );
playButton->setSizePolicy( buttonSizePolicy ); playButton->setSizePolicy( buttonSizePolicy );
playButton->setMinimumSize(QSize(90, 0)); playButton->setMinimumSize( QSize(90, 0) );
playButton->setPopupMode(QToolButton::MenuButtonPopup); playButton->setPopupMode( QToolButton::MenuButtonPopup );
playButton->setToolButtonStyle(Qt::ToolButtonTextOnly); playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
cancelButton = new QToolButton(); cancelButton = new QToolButton();
cancelButton->setText( qtr( "&Cancel" ) ); cancelButton->setText( qtr( "&Cancel" ) );
...@@ -96,7 +98,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -96,7 +98,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
CONNECT( fileOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) ); CONNECT( fileOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
CONNECT( netOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) ); CONNECT( netOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
CONNECT( diskOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) ); CONNECT( discOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
CONNECT( captureOpenPanel, mrlUpdated( QString ), this, CONNECT( captureOpenPanel, mrlUpdated( QString ), this,
updateMRL(QString) ); updateMRL(QString) );
...@@ -104,7 +106,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -104,7 +106,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
this, newMethod(QString) ); this, newMethod(QString) );
CONNECT( netOpenPanel, methodChanged( QString ), CONNECT( netOpenPanel, methodChanged( QString ),
this, newMethod(QString) ); this, newMethod(QString) );
CONNECT( diskOpenPanel, methodChanged( QString ), CONNECT( discOpenPanel, methodChanged( QString ),
this, newMethod(QString) ); this, newMethod(QString) );
CONNECT( ui.slaveText, textChanged(QString), this, updateMRL()); CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
......
...@@ -72,7 +72,7 @@ private: ...@@ -72,7 +72,7 @@ private:
Ui::Open ui; Ui::Open ui;
FileOpenPanel *fileOpenPanel; FileOpenPanel *fileOpenPanel;
NetOpenPanel *netOpenPanel; NetOpenPanel *netOpenPanel;
DiskOpenPanel *diskOpenPanel; DiscOpenPanel *discOpenPanel;
CaptureOpenPanel *captureOpenPanel; CaptureOpenPanel *captureOpenPanel;
QString storedMethod; QString storedMethod;
......
...@@ -177,23 +177,23 @@ void DialogsProvider::bookmarksDialog() ...@@ -177,23 +177,23 @@ void DialogsProvider::bookmarksDialog()
void DialogsProvider::openDialog() void DialogsProvider::openDialog()
{ {
openDialog( 0 ); openDialog( OPEN_FILE_TAB );
} }
void DialogsProvider::openFileDialog() void DialogsProvider::openFileDialog()
{ {
openDialog( 0 ); openDialog( OPEN_FILE_TAB );
} }
void DialogsProvider::openDiscDialog() void DialogsProvider::openDiscDialog()
{ {
openDialog( 1 ); openDialog( OPEN_DISC_TAB );
} }
void DialogsProvider::openNetDialog() void DialogsProvider::openNetDialog()
{ {
openDialog( 2 ); openDialog( OPEN_NETWORK_TAB );
} }
void DialogsProvider::openCaptureDialog() void DialogsProvider::openCaptureDialog()
{ {
openDialog( 3 ); openDialog( OPEN_CAPTURE_TAB );
} }
void DialogsProvider::openDialog( int i_tab ) void DialogsProvider::openDialog( int i_tab )
{ {
......
...@@ -68,6 +68,10 @@ ...@@ -68,6 +68,10 @@
string += _("All Files"); \ string += _("All Files"); \
string += " (*.*)"; string += " (*.*)";
#define OPEN_FILE_TAB 0x0
#define OPEN_DISC_TAB 0x1
#define OPEN_NETWORK_TAB 0x2
#define OPEN_CAPTURE_TAB 0x3
class QEvent; class QEvent;
class QSignalMapper; class QSignalMapper;
......
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