Commit fe986989 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Open Dialog: Code cosmetic.

parent 78510eda
...@@ -58,25 +58,23 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -58,25 +58,23 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
ui.Tab->insertTab( OPEN_CAPTURE_TAB, captureOpenPanel, ui.Tab->insertTab( OPEN_CAPTURE_TAB, captureOpenPanel,
qtr( "Capture &Device" ) ); qtr( "Capture &Device" ) );
/* Hide the Slave input widgets */
ui.slaveLabel->hide();
ui.slaveText->hide();
ui.slaveBrowseButton->hide();
/* Hide the advancedPanel */ /* Hide the advancedPanel */
if(! config_GetInt( p_intf, "qt-adv-options") ) if(! config_GetInt( p_intf, "qt-adv-options") )
{
ui.advancedFrame->hide(); ui.advancedFrame->hide();
}
else else
{
ui.advancedCheckBox->setCheckState( Qt::Checked ); ui.advancedCheckBox->setCheckState( Qt::Checked );
}
ui.slaveLabel->hide();
ui.slaveText->hide();
ui.slaveBrowseButton->hide();
/* Buttons Creation */ /* Buttons Creation */
QSizePolicy buttonSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ); QSizePolicy buttonSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum );
buttonSizePolicy.setHorizontalStretch(0); buttonSizePolicy.setHorizontalStretch(0);
buttonSizePolicy.setVerticalStretch(0); buttonSizePolicy.setVerticalStretch(0);
/* Play Button */
playButton = new QToolButton( this ); playButton = new QToolButton( this );
playButton->setText( qtr( "&Play" ) ); playButton->setText( qtr( "&Play" ) );
playButton->setSizePolicy( buttonSizePolicy ); playButton->setSizePolicy( buttonSizePolicy );
...@@ -84,10 +82,12 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -84,10 +82,12 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
playButton->setPopupMode( QToolButton::MenuButtonPopup ); playButton->setPopupMode( QToolButton::MenuButtonPopup );
playButton->setToolButtonStyle( Qt::ToolButtonTextOnly ); playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
/* Cancel Button */
cancelButton = new QPushButton(); cancelButton = new QPushButton();
cancelButton->setText( qtr( "&Cancel" ) ); cancelButton->setText( qtr( "&Cancel" ) );
cancelButton->setSizePolicy( buttonSizePolicy ); cancelButton->setSizePolicy( buttonSizePolicy );
/* Menu for the Play button */
QMenu * openButtonMenu = new QMenu( "Open" ); QMenu * openButtonMenu = new QMenu( "Open" );
openButtonMenu->addAction( qtr("&Enqueue"), this, SLOT( enqueue() ), openButtonMenu->addAction( qtr("&Enqueue"), this, SLOT( enqueue() ),
QKeySequence( "Alt+E") ); QKeySequence( "Alt+E") );
...@@ -109,8 +109,7 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -109,8 +109,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( discOpenPanel, 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) );
CONNECT( fileOpenPanel, methodChanged( QString ), CONNECT( fileOpenPanel, methodChanged( QString ),
this, newMethod(QString) ); this, newMethod(QString) );
...@@ -134,7 +133,6 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal, ...@@ -134,7 +133,6 @@ OpenDialog::OpenDialog( QWidget *parent, intf_thread_t *_p_intf, bool modal,
/* At creation time, modify the default buttons */ /* At creation time, modify the default buttons */
if ( i_action_flag ) setMenuAction(); if ( i_action_flag ) setMenuAction();
/* Initialize caching */ /* Initialize caching */
storedMethod = ""; storedMethod = "";
newMethod("file-caching"); newMethod("file-caching");
...@@ -170,16 +168,15 @@ void OpenDialog::setMenuAction() ...@@ -170,16 +168,15 @@ void OpenDialog::setMenuAction()
} }
} }
void OpenDialog::showTab(int i_tab=0) void OpenDialog::showTab( int i_tab=0 )
{ {
this->show(); this->show();
ui.Tab->setCurrentIndex(i_tab); ui.Tab->setCurrentIndex( i_tab );
} }
void OpenDialog::signalCurrent() { void OpenDialog::signalCurrent() {
if (ui.Tab->currentWidget() != NULL) { if (ui.Tab->currentWidget() != NULL)
(dynamic_cast<OpenPanel*>(ui.Tab->currentWidget()))->updateMRL(); (dynamic_cast<OpenPanel *>( ui.Tab->currentWidget() ))->updateMRL();
}
} }
/*********** /***********
...@@ -191,8 +188,7 @@ void OpenDialog::cancel() ...@@ -191,8 +188,7 @@ void OpenDialog::cancel()
{ {
fileOpenPanel->clear(); fileOpenPanel->clear();
this->toggleVisible(); this->toggleVisible();
if( isModal() ) if( isModal() ) reject();
reject();
} }
/* If EnterKey is pressed */ /* If EnterKey is pressed */
......
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