]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/storage/storage.cpp
After tables or trees are created, size the columns.
[bacula/bacula] / bacula / src / qt-console / storage / storage.cpp
index 8efd845d785cfe9fcdcee5207bbc4312d2dce5e1..f3a46edf462eefc7bcdc8e9e1e7123a88c75bdbd 100644 (file)
 Storage::Storage()
 {
    setupUi(this);
+   m_name = "Storage";
    pgInitialize();
 
    /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_storage.h */
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
+   setTitle();
 }
 
 Storage::~Storage()
@@ -120,6 +122,10 @@ void Storage::populateTree()
          }
       }
    }
+   /* Resize the columns */
+   for(int cnter=1; cnter<headerlist.size(); cnter++) {
+      mp_treeWidget->resizeColumnToContents(cnter);
+   }
 }
 
 /*
@@ -187,7 +193,7 @@ void Storage::createContextMenu()
 void Storage::consoleStatusStorage()
 {
    QString cmd("status storage=");
-   cmd += m_currentlyselected += "\n";
+   cmd += m_currentlyselected;
    consoleCommand(cmd);
 //   m_console->write_dir(cmd.toUtf8().data());
 //   m_console->displayToPrompt();
@@ -211,12 +217,3 @@ void Storage::currentStackItem()
       m_populated=true;
    }
 }
-
-/*
- * Virtual Function to return the name for the medialist tree widget
- */
-void Storage::treeWidgetName(QString &name)
-{
-   name = "Storage";
-}
-