Commit b79ee345 authored by Edward Wang's avatar Edward Wang Committed by Jean-Baptiste Kempf

Qt4: Enable closable tabs in sout dialog

Modified-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent bc05fa41
...@@ -60,20 +60,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& ...@@ -60,20 +60,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
"when you change the above settings,\n" "when you change the above settings,\n"
"but you can change it manually." ) ) ; "but you can change it manually." ) ) ;
#if 0
/* This needs Qt4.5 to be cool */
ui.destTab->setTabsClosable( true ); ui.destTab->setTabsClosable( true );
QTabBar* tb = ui.destTab->findChild<QTabBar*>();
if( tb != NULL ) tb->tabButton(0, QTabBar::RightSide)->hide();
CONNECT( ui.destTab, tabCloseRequested( int ), this, closeTab( int ) ); CONNECT( ui.destTab, tabCloseRequested( int ), this, closeTab( int ) );
#else
closeTabButton = new QToolButton( this );
ui.destTab->setCornerWidget( closeTabButton );
closeTabButton->hide();
closeTabButton->setAutoRaise( true );
closeTabButton->setIcon( QIcon( ":/toolbar/clear" ) );
closeTabButton->setToolTip( qtr("Clear") );
BUTTONACT( closeTabButton, closeTab() );
#endif
CONNECT( ui.destTab, currentChanged( int ), this, tabChanged( int ) );
ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add" ) ); ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add" ) );
ui.destBox->addItem( qtr( "File" ) ); ui.destBox->addItem( qtr( "File" ) );
...@@ -106,17 +96,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& ...@@ -106,17 +96,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#undef CB #undef CB
} }
void SoutDialog::tabChanged( int i ) void SoutDialog::closeTab( int i )
{
closeTabButton->setVisible( (i != 0) );
}
void SoutDialog::closeTab()
{ {
int i = ui.destTab->currentIndex();
if( i == 0 ) return; if( i == 0 ) return;
QWidget *temp = ui.destTab->currentWidget(); QWidget* temp = ui.destTab->widget( i );
ui.destTab->removeTab( i ); ui.destTab->removeTab( i );
delete temp; delete temp;
updateMRL(); updateMRL();
......
...@@ -125,7 +125,6 @@ private: ...@@ -125,7 +125,6 @@ private:
QString mrl; QString mrl;
QPushButton *okButton; QPushButton *okButton;
QToolButton *closeTabButton;
intf_thread_t* p_intf; intf_thread_t* p_intf;
...@@ -135,8 +134,7 @@ public slots: ...@@ -135,8 +134,7 @@ public slots:
private slots: private slots:
void ok(); void ok();
void cancel(); void cancel();
void closeTab(); void closeTab( int );
void tabChanged( int );
void addDest(); void addDest();
}; };
......
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