2
* KFontInst - KDE Font Installer
4
* Copyright 2003-2007 Craig Drummond <craig@kde.org>
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; see the file COPYING. If not, write to
20
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
* Boston, MA 02110-1301, USA.
24
#ifndef __JOB_RUNNER_H__
25
#define __JOB_RUNNER_H__
28
#include <KDE/KDialog>
29
#include "FontInstInterface.h"
45
class CJobRunner : public KDialog
51
struct Item : public KUrl
61
Item(const KUrl &u=KUrl(), const QString &n=QString());
62
Item(const QString &file, const QString &family, quint32 style, bool system);
63
QString displayName() const { return name.isEmpty() ? prettyUrl() : name; }
65
fileName; // Only required so that we can sort an ItemList so that afm/pfms follow after pfa/pfbs
68
bool operator<(const Item &o) const;
71
typedef QList<Item> ItemList;
84
explicit CJobRunner(QWidget *parent, int xid=0);
87
static FontInstInterface * dbus();
88
static void startDbusService();
90
static KUrl encode(const QString &family, quint32 style, bool system);
92
static void getAssociatedUrls(const KUrl &url, KUrl::List &list, bool afmAndPfm, QWidget *widget);
93
int exec(ECommand cmd, const ItemList &urls, bool destIsSystem);
102
void checkInterface();
103
void dbusServiceOwnerChanged(const QString &name, const QString &from, const QString &to);
104
void dbusStatus(int pid, int status);
105
void slotButtonClicked(int button);
109
void closeEvent(QCloseEvent *e);
110
void setPage(int page, const QString &msg=QString());
111
QString fileName(const KUrl &url);
112
QString errorString(int value) const;
118
ItemList::ConstIterator itsIt,
121
bool itsDestIsSystem;
122
QLabel *itsStatusLabel,
125
QProgressBar *itsProgress;
129
KTempDir *itsTempDir;
130
QString itsCurrentFile;
131
CActionLabel *itsActionLabel;
132
QStackedWidget *itsStack;
135
QCheckBox *itsDontShowFinishedMsg;