+ setWindowTitle( qtr("Open" ) );
+ resize( 410, 300);
+
+ /* Tab definition and creation */
+ 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 );
+
+ /* Insert the tabs */
+ 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 */
+ if(! config_GetInt( p_intf, "qt-adv-options") )
+ {
+ ui.advancedFrame->hide();
+ }
+ else
+ {
+ ui.advancedCheckBox->setCheckState( Qt::Checked );
+ }
+
+ ui.slaveLabel->hide();
+ ui.slaveText->hide();
+ ui.slaveBrowseButton->hide();
+
+ /* Buttons Creation */
+ QSizePolicy buttonSizePolicy( static_cast<QSizePolicy::Policy>(7),
+ static_cast<QSizePolicy::Policy>(1) );
+ buttonSizePolicy.setHorizontalStretch(0);
+ buttonSizePolicy.setVerticalStretch(0);
+
+ playButton = new QToolButton( this );
+ playButton->setText( qtr( "&Play" ) );
+ playButton->setSizePolicy( buttonSizePolicy );
+ playButton->setMinimumSize( QSize(90, 0) );
+ playButton->setPopupMode( QToolButton::MenuButtonPopup );
+ playButton->setToolButtonStyle( Qt::ToolButtonTextOnly );
+
+ cancelButton = new QPushButton();
+ cancelButton->setText( qtr( "&Cancel" ) );
+ cancelButton->setSizePolicy( buttonSizePolicy );
+
+ QMenu * openButtonMenu = new QMenu( "Open" );
+ openButtonMenu->addAction( qtr("&Enqueue"), this, SLOT( enqueue() ),
+ QKeySequence( "Alt+E") );
+ openButtonMenu->addAction( qtr("&Play"), this, SLOT( play() ),
+ QKeySequence( "Alt+P" ) );
+ openButtonMenu->addAction( qtr("&Stream"), this, SLOT( stream() ) ,
+ QKeySequence( "Alt+S" ) );
+ openButtonMenu->addAction( qtr("&Convert"), this, SLOT( transcode( ) ) ,
+ QKeySequence( "Alt+C" ) );
+
+ playButton->setMenu( openButtonMenu );
+
+ ui.buttonsBox->addButton( playButton, QDialogButtonBox::AcceptRole );
+ ui.buttonsBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
+
+ /* Force MRL update on tab change */
+ CONNECT( ui.Tab, currentChanged(int), this, signalCurrent());
+
+ CONNECT( fileOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
+ CONNECT( netOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
+ CONNECT( discOpenPanel, mrlUpdated( QString ), this, updateMRL(QString) );
+ CONNECT( captureOpenPanel, mrlUpdated( QString ), this,
+ updateMRL(QString) );
+
+ CONNECT( fileOpenPanel, methodChanged( QString ),
+ this, newMethod(QString) );
+ CONNECT( netOpenPanel, methodChanged( QString ),
+ this, newMethod(QString) );
+ CONNECT( discOpenPanel, methodChanged( QString ),
+ this, newMethod(QString) );
+ CONNECT( captureOpenPanel, methodChanged( QString ),
+ this, newMethod(QString) );
+
+ /* Advanced frame Connects */
+ CONNECT( ui.slaveText, textChanged(QString), this, updateMRL());
+ CONNECT( ui.cacheSpinBox, valueChanged(int), this, updateMRL());
+ CONNECT( ui.startTimeSpinBox, valueChanged(int), this, updateMRL());
+ BUTTONACT( ui.advancedCheckBox , toggleAdvancedPanel() );
+
+ /* Buttons action */
+ BUTTONACT( playButton, play());
+ BUTTONACT( cancelButton, cancel());
+
+ /* At creation time, modify the default buttons */
+ if ( i_action_flag ) setMenuAction();
+
+
+ /* Initialize caching */
+ storedMethod = "";
+ newMethod("file-caching");
+
+ mainHeight = advHeight = 0;