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__
27 #include <KDE/KIO/Job>
28 #include "ActionDialog.h"
29 #include "../config-fontinst.h"
38 class CJobRunner
: public CActionDialog
44 struct Item
: public KUrl
53 Item(const KUrl
&u
=KUrl(), const QString
&n
=QString());
54 QString
displayName() const { return name
.isEmpty() ? prettyUrl() : name
; }
56 fileName
; // Only required so that we can sort an ItemList so that afm/pfms follow after pfa/pfbs
59 bool operator<(const Item
&o
) const;
62 typedef QList
<Item
> ItemList
;
75 explicit CJobRunner(QWidget
*parent
, int xid
=0);
78 bool getAdminPasswd(QWidget
*parent
);
79 #if !(defined USE_POLICYKIT && USE_POLICYKIT==1)
80 const QString
& adminPasswd() const { return itsPasswd
; }
82 static void getAssociatedUrls(const KUrl
&url
, KUrl::List
&list
, bool afmAndPfm
, QWidget
*widget
);
83 int exec(ECommand cmd
, const ItemList
&urls
, const KUrl
&dest
);
88 void jobResult(KJob
*job
);
89 void cfgResult(KJob
*job
);
90 void slotButtonClicked(int button
);
94 void setMetaData(KIO::Job
*job
) const;
95 KUrl
modifyUrl(const KUrl
&orig
) const;
101 ItemList::ConstIterator itsIt
,
104 QLabel
*itsStatusLabel
;
105 QProgressBar
*itsProgress
;
109 #if !(defined USE_POLICYKIT && USE_POLICYKIT==1)