/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2009 Free Software Foundation Europe e.V.
+ Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
- modify it under the terms of version two of the GNU General Public
+ modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
- You should have received a copy of the GNU General Public License
+ You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
Switzerland, email:ftf@fsfeurope.org.
*/
/*
- * Version $Id: dirstat.cpp 5880 2007-11-09 01:20:40Z bartleyd2 $
*
* Dirk Bartley, March 2007
*/
#include <QTableWidgetItem>
#include "dirstat.h"
+static bool working = false; /* prevent timer recursion */
+
/*
* Constructor for the class
*/
{
setupUi(this);
m_name = tr("Director Status");
- m_closeable = true;
pgInitialize();
QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/status.png")));
createConnections();
setCurrent();
-
- dockPage();
}
void DirStat::getFont()
{
double value = timerDisplay->value();
value -= 1;
- if (value == 0) {
+ if (value <= 0 && !working) {
+ working = true;
value = spinBox->value();
bool iscurrent = mainWin->tabWidget->currentIndex() == mainWin->tabWidget->indexOf(this);
- if (((isDocked() && iscurrent) || (!isDocked())) && (checkBox->checkState() == Qt::Checked)) {
+ if (((isDocked() && iscurrent) || ((!isDocked()) && isOnceDocked())) && (checkBox->checkState() == Qt::Checked)) {
populateAll();
}
+ working = false;
}
timerDisplay->display(value);
}
p_tableitem->setBackground(Qt::green);
else
p_tableitem->setBackground(Qt::red);
- }
+ }
terminatedTable->setItem(results.size() - row - 1, column, p_tableitem);
column += 1;
}
scheduledTable->setColumnCount(headerlist.size());
scheduledTable->setHorizontalHeaderLabels(headerlist);
+ scheduledTable->setSelectionBehavior(QAbstractItemView::SelectRows);
+ scheduledTable->setSelectionMode(QAbstractItemView::SingleSelection);
if (m_console->dir_cmd(command, results)) {
int row = 0;
field = field.trimmed(); /* strip leading & trailing spaces */
p_tableitem = new QTableWidgetItem(field, 1);
p_tableitem->setForeground(blackBrush);
- p_tableitem->setFlags(0);
scheduledTable->setItem(row, column, p_tableitem);
column += 1;
}
runningTable->setColumnCount(headerlist.size());
runningTable->setHorizontalHeaderLabels(headerlist);
+ runningTable->setSelectionBehavior(QAbstractItemView::SelectRows);
if (m_console->dir_cmd(command, results)) {
int row = 0;
field = field.trimmed(); /* strip leading & trailing spaces */
p_tableitem = new QTableWidgetItem(field, 1);
p_tableitem->setForeground(blackBrush);
- p_tableitem->setFlags(Qt::ItemIsSelectable);
runningTable->setItem(row, column, p_tableitem);
column += 1;
}
populateAll();
m_populated=true;
}
+ if (!isOnceDocked()) {
+ dockPage();
+ }
}
/*
m_splitText = "splitterSizes_0";
QSettings settings(m_console->m_dir->name(), "bat");
settings.beginGroup(m_groupText);
- splitter->restoreState(settings.value(m_splitText).toByteArray());
+ if (settings.contains(m_splitText)) { splitter->restoreState(settings.value(m_splitText).toByteArray()); }
spinBox->setValue(settings.value("refreshInterval", 28).toInt());
checkBox->setCheckState((Qt::CheckState)settings.value("refreshCheck", Qt::Checked).toInt());
settings.endGroup();