diff options
author | Fritz Elfert <felfert@to.com> | 2001-03-12 10:46:02 +0000 |
---|---|---|
committer | Fritz Elfert <felfert@to.com> | 2001-03-12 10:46:02 +0000 |
commit | 656792e5a7a655c140aae178593896086cec25df (patch) | |
tree | 68e6bd2c527c771fcdcefaf44447ceaf557fe8c9 /kde2/kpsion/kpsionbackuplistview.h | |
parent | fd8c3ec28d9f721e15ee89de412ad565f94e79d3 (diff) | |
download | plptools-656792e5a7a655c140aae178593896086cec25df.tar.gz plptools-656792e5a7a655c140aae178593896086cec25df.tar.bz2 plptools-656792e5a7a655c140aae178593896086cec25df.zip |
Put some classes in separate files.
Started setup dialog
Use a QMap for Optionnames in config file. (prevents typos).
Diffstat (limited to 'kde2/kpsion/kpsionbackuplistview.h')
-rw-r--r-- | kde2/kpsion/kpsionbackuplistview.h | 127 |
1 files changed, 127 insertions, 0 deletions
diff --git a/kde2/kpsion/kpsionbackuplistview.h b/kde2/kpsion/kpsionbackuplistview.h new file mode 100644 index 0000000..f4c3fed --- /dev/null +++ b/kde2/kpsion/kpsionbackuplistview.h @@ -0,0 +1,127 @@ +/*-*-c++-*- + * $Id$ + * + * This file is part of plptools. + * + * Copyright (C) 1999-2001 Fritz Elfert <felfert@to.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * 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 + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +#ifndef _KPSIONBACKUPLISTVIEW_H_ +#define _KPSIONBACKUPLISTVIEW_H_ + +#include <rfsv.h> + +#include <klistview.h> +#include <ktar.h> + +#include <qcheckbox.h> +#include <qstringlist.h> +#include <qtextstream.h> + +class KPsionCheckListItem : public QObject, public QCheckListItem { + Q_OBJECT + +public: + KPsionCheckListItem(KPsionCheckListItem *parent, const QString &text, + Type tt) + : QCheckListItem(parent, text, tt) { init(true); } + KPsionCheckListItem(QCheckListItem *parent, const QString &text, Type tt) + : QCheckListItem(parent, text, tt) { init(false); } + KPsionCheckListItem(QListViewItem *parent, const QString &text, Type tt) + : QCheckListItem(parent, text, tt) { init(false); } + KPsionCheckListItem(QListView *parent, const QString &text, Type tt) + : QCheckListItem(parent, text, tt) { init(false); } + KPsionCheckListItem(QListViewItem *parent, const QString &text, + const QPixmap &p) + : QCheckListItem(parent, text, p) { init(false); } + KPsionCheckListItem(QListView *parent, const QString &text, + const QPixmap &p) + : QCheckListItem(parent, text, p) { init(false); } + + KPsionCheckListItem *firstChild() const; + KPsionCheckListItem *nextSibling() const; + + ~KPsionCheckListItem(); + + virtual QString key(int column, bool ascending) const; + void setMetaData(int bType, time_t bTime, QString tarName, int size, + u_int32_t tHi, u_int32_t tLo, u_int32_t attr); + + QString unixname(); + QString psionname(); + QString tarname(); + PlpDirent plpdirent(); + int backupType(); + int size(); + time_t when(); + bool isPathChecked(QString path); + +signals: + void rootToggled(void); + +protected: + virtual void stateChange(bool); + void propagateUp(bool); + void propagateDown(bool); + +private: + void init(bool); + class KPsionCheckListItemMetaData; + KPsionCheckListItemMetaData *meta; +}; + +class KPsionBackupListView : public KListView { + Q_OBJECT + +public: + enum backupTypes { + UNKNOWN = 0, + FULL = 1, + INCREMENTAL = 2, + }; + + KPsionBackupListView(QWidget *parent = 0, const char *name = 0); + KPsionCheckListItem *firstChild() const; + + void readBackups(QString uid); + PlpDir &getRestoreList(QString tarname); + QStringList getSelectedTars(); + QStringList getFormatDrives(); + bool autoSelect(QString drive); + +signals: + void itemsEnabled(bool); + +private slots: + void slotRootToggled(void); + +private: + void collectEntries(KPsionCheckListItem *i); + void listTree(KPsionCheckListItem *cli, const KTarEntry *te, + QTextIStream &idx, int level); + + QString uid; + QString backupDir; + PlpDir toRestore; +}; +#endif + +/* + * Local variables: + * c-basic-offset: 4 + * End: + */ |