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&
"when you change the above settings,\n"
"but you can change it manually." ) ) ;
#if 0
/* This needs Qt4.5 to be cool */
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 ) );
#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.destBox->addItem( qtr( "File" ) );
......@@ -106,17 +96,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
#undef CB
}
void SoutDialog::tabChanged( int i )
{
closeTabButton->setVisible( (i != 0) );
}
void SoutDialog::closeTab()
void SoutDialog::closeTab( int i )
{
int i = ui.destTab->currentIndex();
if( i == 0 ) return;
QWidget *temp = ui.destTab->currentWidget();
QWidget* temp = ui.destTab->widget( i );
ui.destTab->removeTab( i );
delete temp;
updateMRL();
......
......@@ -125,7 +125,6 @@ private:
QString mrl;
QPushButton *okButton;
QToolButton *closeTabButton;
intf_thread_t* p_intf;
......@@ -135,8 +134,7 @@ public slots:
private slots:
void ok();
void cancel();
void closeTab();
void tabChanged( int );
void closeTab( int );
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