]> git.sur5r.net Git - bacula/bacula/commitdiff
Implement close button in bat tabs
authorKern Sibbald <kern@sibbald.com>
Sun, 7 Nov 2010 16:55:03 +0000 (17:55 +0100)
committerKern Sibbald <kern@sibbald.com>
Thu, 11 Nov 2010 07:56:32 +0000 (08:56 +0100)
bacula/src/qt-console/mainwin.cpp

index 8b74f6e07f2d5564af40e1a4e4e459109379701e..5b1593a53711283ea502378bf5b767ac2a8fef25 100644 (file)
@@ -80,7 +80,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    treeWidget->setColumnCount(1);
    treeWidget->setHeaderLabel( tr("Select Page") );
    treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
-   // tabWidget->setTabsClosable(true);  /* wait for QT 4.5 */
+   tabWidget->setTabsClosable(true);  /* wait for QT 4.5 */
    createPages();
 
    resetFocus(); /* lineEdit->setFocus() */
@@ -265,6 +265,7 @@ void MainWin::connectSignals()
    connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
    connect(treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
    connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int)));
+   connect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closePage()));
    connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
    connect(actionLabel, SIGNAL(triggered()), this,  SLOT(labelButtonClicked()));
    connect(actionRun, SIGNAL(triggered()), this,  SLOT(runButtonClicked()));
@@ -292,6 +293,7 @@ void MainWin::disconnectSignals()
    disconnect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(treeItemClicked(QTreeWidgetItem *, int)));
    disconnect(treeWidget, SIGNAL( currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
    disconnect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int)));
+   disconnect(tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(closePage()));
    disconnect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
    disconnect(actionLabel, SIGNAL(triggered()), this,  SLOT(labelButtonClicked()));
    disconnect(actionRun, SIGNAL(triggered()), this,  SLOT(runButtonClicked()));