]> git.sur5r.net Git - bacula/bacula/commitdiff
Add context menu to page selection
authorKern Sibbald <kern@sibbald.com>
Tue, 27 Mar 2007 19:57:32 +0000 (19:57 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 27 Mar 2007 19:57:32 +0000 (19:57 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4438 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/mainwin.cpp

index 0c8ceee551efbc9a4a50f7c39a60cdfdf318c903..3400c83760217a0b7c214ada0650961d6fcba087 100644 (file)
@@ -46,6 +46,8 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    treeWidget->clear();
    treeWidget->setColumnCount(1);
    treeWidget->setHeaderLabel("Select Page");
+   treeWidget->addAction(actionPullWindowOut);
+   treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
 
    m_pages = 0;
    createPages();
@@ -119,7 +121,7 @@ void MainWin::createPages()
 }
 
 /* Create a root Tree Widget */
-QTreeWidgetItem *MainWin::createTopPage(char *name )
+QTreeWidgetItem *MainWin::createTopPage(char *name)
 {
    QTreeWidgetItem *item = new QTreeWidgetItem(treeWidget);
    item->setText(0, name);
@@ -228,10 +230,12 @@ void MainWin::readSettings()
 
 void MainWin::treeItemClicked(QTreeWidgetItem *item, int column)
 {
-   column+=0;
+   (void)column;
+
    /* Use tree item's Qt::UserRole to get treeindex */
    int treeindex = item->data(column, Qt::UserRole).toInt();
-   int stackindex=stackedWidget->indexOf( m_bstacklist[treeindex] );
+   int stackindex=stackedWidget->indexOf(m_bstacklist[treeindex]);
+
    if( stackindex >= 0 ){
       stackedWidget->setCurrentIndex(stackindex);
    }