/*
Bacula® - The Network Backup Solution
- Copyright (C) 2007-2007 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.
*/
/*
- * Version $Id$
*
* Helper functions for tree widget formatting
*
pix = ":images/96p.png";
}
setPixmap(index, QPixmap(pix), val);
- setSortValue(index, (int) value);
+ //setSortValue(index, (int) value);
+ //setBackground(index, Qt::green);
}
/* By default, the setPixmap implementation with tooltip don't implement
* the tooltip stuff
*/
void ItemFormatterBase::setPixmap(int index, const QPixmap &pix,
- const QString &tip)
+ const QString & /* tip */)
{
setPixmap(index, pix);
}
void ItemFormatterBase::setInChanger(int index, const QString &InChanger)
{
- setPixmap(index,
- QPixmap(":images/inflag"+InChanger+".png"));
- setSortValue(index, InChanger.toInt() );
+ setPixmap(index, QPixmap(":images/inflag"+InChanger+".png"));
+ //setSortValue(index, InChanger.toInt() );
+}
+
+void ItemFormatterBase::setFileType(int index, const QString &type)
+{
+ setPixmap(index, QPixmap(":images/"+type+".png"));
+ //setSortValue(index, InChanger.toInt() );
}
void ItemFormatterBase::setTextFld(int index, const QString &fld, bool center)
}
}
+void ItemFormatterBase::setDateFld(int index, utime_t fld, bool center)
+{
+ char buf[200];
+ bstrutime(buf, sizeof(buf), fld);
+ setText(index, QString(buf).trimmed());
+ if (center) {
+ setTextAlignment(index, Qt::AlignCenter);
+ }
+}
+
void ItemFormatterBase::setRightFld(int index, const QString &fld)
{
setText(index, fld.trimmed());
case BYTES_CONVERSION_SI:
msg = convertBytesSI(qfld);
break;
+ default:
+ msg = " ";
+ break;
}
setNumericFld(index, msg, qfld);
char suffix = 's';
if (dfld) {
for (int pos = 0 ; sufs[pos] ; ++pos) {
- if (dfld % divs[pos] == 0) {
- dfld /= divs[pos];
- suffix = sufs[pos];
- break;
- }
+ if (dfld % divs[pos] == 0) {
+ dfld /= divs[pos];
+ suffix = sufs[pos];
+ break;
+ }
}
}
QString msg;
dfld = fld.trimmed().toLongLong();
msg = "";
for (int pos = 0 ; sufs[pos] ; ++pos) {
- if (dfld / divs[pos] != 0) {
- msg += QString(" %1%2").arg(dfld / divs[pos]).arg(sufs[pos]);
- dfld %= divs[pos];
- }
+ if (dfld / divs[pos] != 0) {
+ msg += QString(" %1%2").arg(dfld / divs[pos]).arg(sufs[pos]);
+ dfld %= divs[pos];
+ }
}
if (dfld)
- msg += QString(" %1s").arg(dfld);
+ msg += QString(" %1s").arg(dfld);
}
setNumericFld(index, msg, fld.trimmed().toLongLong());
{
return parent->item(row, col);
}
-