SVN_SILENT made messages (.desktop file)
[kdeadmin.git] / kpackage / pkgOptions.h
blobd648149081d5182f64247767d48947f63e3e0e3e
1 /*
2 ** Copyright (C) 1999,2000 Toivo Pedaste <toivo@ucs.uwa.edu.au>
3 **
4 // This provides the installation options, plus the install and cancel
5 // buttons. When the install button is clicked, the current package
6 // is installed.
7 */
9 /*
10 ** This program is free software; you can redistribute it and/or modify
11 ** it under the terms of the GNU General Public License as published by
12 ** the Free Software Foundation; either version 2 of the License, or
13 ** (at your option) any later version.
15 ** This program is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ** GNU General Public License for more details.
20 ** You should have received a copy of the GNU General Public License
21 ** along with this program in a file called COPYING; if not, write to
22 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
23 ** MA 02110-1301, USA.
27 ** Bug reports and questions can be sent to kde-devel@kde.org
30 #ifndef PKGOPTIONS_H
31 #define PKGOPTIONS_H
33 // Qt headers
34 #include <QtGui/QLayout>
35 #include <QtGui/QPushButton>
36 #include <QtGui/QLabel>
37 #include <QtGui/QCheckBox>
38 //Added by qt3to4:
39 #include <QtGui/QShowEvent>
40 #include <QtCore/QList>
41 #include <QtGui/QBoxLayout>
42 #include <QtGui/QCloseEvent>
44 #include <kdialog.h>
46 // kpackage headers
47 #include "packageInfo.h"
48 #include "pkgInterface.h"
49 #include "kpTerm.h"
51 class QListWidget;
52 class QListWidgetItem;
53 class KPushButton;
55 class pkgOptions : public QDialog
57 Q_OBJECT
58 public:
59 explicit pkgOptions( pkgInterface *pki, QWidget *parent=0, const QString &caption=QString() );
60 ~pkgOptions();
62 bool setup(QList<packageInfo *> pl);
63 bool setup(packageInfo *p);
64 void resetPackages(bool init);
66 void reset();
68 virtual QString doPackages(int installFlags, QList<packageInfo *> p,
69 bool &test) = 0;
71 QCheckBox **Boxes;
72 // options buttons
74 QCheckBox *Keep;
75 // keep window
77 QListWidget *packages;
78 // List of packages that will be installed
80 int bnumber;
81 // number of option buttons
83 QLabel *title;
84 // Widget title
86 kpTerm *term;
88 pkgInterface *pkgInt;
90 QStringList checkedPackages;
92 bool modified;
93 bool test;
94 bool running;
96 protected:
97 // This sets up the sub-widgets
98 void setupWidgets(QList<param *> &pars);
100 private slots:
101 virtual void pkginstallButtonClicked();
102 virtual void cancelButtonClicked();
103 void slotSearch(QListWidgetItem *item);
104 void keepToggle(bool);
106 public slots:
107 void slotResult(QStringList &rlist, int ret);
109 signals:
110 // This signal indicates that the widget has finished.
111 void finished(int refresh);
113 protected:
114 // The layout managers
115 QBoxLayout *layout, *hlayout, *vlayout;
117 // Sub widgets
118 QPushButton *installButton;
119 KPushButton *cancelButton;
121 QString insType;
122 bool installer;
123 // install or uninstall
125 bool keep;
126 // keep the window
128 QList<packageInfo *> packList;
129 QList<packageInfo *> packListChecked;
131 void getKeep();
133 void showEvent (QShowEvent *);
134 void closeEvent (QCloseEvent * e );
136 void terminate();
139 ///////////////////////////////////////////////////////////////////////////
140 ///////////////////////////////////////////////////////////////////////////
141 class pkgOptionsI: public pkgOptions
143 Q_OBJECT
144 public:
145 explicit pkgOptionsI(pkgInterface *pkg, QWidget *parent = 0);
146 QString doPackages(int installFlags, QList<packageInfo *> p, bool &test);
149 ///////////////////////////////////////////////////////////////////////////
150 ///////////////////////////////////////////////////////////////////////////
151 class pkgOptionsU: public pkgOptions
153 Q_OBJECT
154 public:
155 explicit pkgOptionsU(pkgInterface *pkg, QWidget *parent = 0);
156 QString doPackages(int installFlags, QList<packageInfo *> p, bool &test);
159 #endif // PKGOPTIONS_H