m_populated = false;
m_checkcurwidget = true;
m_closeable = false;
+ readSettings();
}
FileSet::~FileSet()
{
+ writeSettings();
}
/*
{
QTreeWidgetItem *filesetItem, *topItem;
+ if (!m_console->preventInUseConnect())
+ return;
- Dmsg0(000, "Populate fileset tree called.\n");
m_checkcurwidget = false;
mp_treeWidget->clear();
m_checkcurwidget = true;
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);
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){
/* Iterate through fields in the record */
foreach (field, fieldlist) {
field = field.trimmed(); /* strip leading & trailing spaces */
- filesetItem->setData(index+1, Qt::UserRole, 1);
+ filesetItem->setData(index, Qt::UserRole, 1);
/* Put media fields under the pool tree item */
- filesetItem->setData(index+1, Qt::UserRole, 1);
- filesetItem->setText(index+1, field);
+ filesetItem->setData(index, Qt::UserRole, 1);
+ filesetItem->setText(index, field);
index++;
}
}
}
}
/* Resize the columns */
- for(int cnter=1; cnter<headerlist.size(); cnter++) {
+ for (int cnter=1; cnter<headerlist.size(); cnter++) {
mp_treeWidget->resizeColumnToContents(cnter);
}
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 */
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();
+}