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

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

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