]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/fileset/fileset.cpp
Tweak FileSet
[bacula/bacula] / bacula / src / qt-console / fileset / fileset.cpp
index deb2743daca3e46954befa780adc7b22d4e47147..ded84d15d64fda8c7b8e9f0fd93163c72c8c9cb6 100644 (file)
@@ -50,10 +50,12 @@ FileSet::FileSet()
    m_populated = false;
    m_checkcurwidget = true;
    m_closeable = false;
+   readSettings();
 }
 
 FileSet::~FileSet()
 {
+   writeSettings();
 }
 
 /*
@@ -81,8 +83,6 @@ void FileSet::populateTree()
 
    mp_treeWidget->setColumnCount(headerlist.count());
    mp_treeWidget->setHeaderLabels(headerlist);
-   /* This could be a log item */
-   //printf("In FileSet::populateTree()\n");
 
    foreach(QString filesetName, m_console->fileset_list) {
       filesetItem = new QTreeWidgetItem(topItem);
@@ -99,8 +99,9 @@ void FileSet::populateTree()
       query += " ORDER BY FileSet";
 
       QStringList results;
-      /* This could be a log item */
-      //printf("FileSet query cmd : %s\n",query.toUtf8().data());
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "FileSet query cmd : %s\n",query.toUtf8().data());
+      }
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount == 1){
@@ -125,7 +126,7 @@ void FileSet::populateTree()
       }
    }
    /* Resize the columns */
-   for(int cnter=1; cnter<headerlist.size(); cnter++) {
+   for (int cnter=1; cnter<headerlist.size(); cnter++) {
       mp_treeWidget->resizeColumnToContents(cnter);
    }
 
@@ -209,7 +210,7 @@ void FileSet::currentStackItem()
    if(!m_populated) {
       populateTree();
       /* add context sensitive menu items specific to this classto the page
-       * selector tree. m_m_contextActions is QList of QActions, so this is 
+       * selector tree. m_contextActions is QList of QActions, so this is 
        * only done once with the first population. */
       m_contextActions.append(actionRefreshFileSet);
       /* Create the context menu for the fileset tree */
@@ -217,3 +218,25 @@ void FileSet::currentStackItem()
       m_populated=true;
    }
 }
+
+/*
+ * Save user settings associated with this page
+ */
+void FileSet::writeSettings()
+{
+   QSettings settings(m_console->m_dir->name(), "bat");
+   settings.beginGroup("FileSet");
+   settings.setValue("geometry", saveGeometry());
+   settings.endGroup();
+}
+
+/*
+ * Read and restore user settings associated with this page
+ */
+void FileSet::readSettings()
+{ 
+   QSettings settings(m_console->m_dir->name(), "bat");
+   settings.beginGroup("FileSet");
+   restoreGeometry(settings.value("geometry").toByteArray());
+   settings.endGroup();
+}