2 ** Copyright (C) 1999,2000 Toivo Pedaste <toivo@ucs.uwa.edu.au>
4 // This provides the installation options, plus the install and cancel
5 // buttons. When the install button is clicked, the current package
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
34 #include <QtGui/QLayout>
35 #include <QtGui/QPushButton>
36 #include <QtGui/QLabel>
37 #include <QtGui/QCheckBox>
39 #include <QtGui/QShowEvent>
40 #include <QtCore/QList>
41 #include <QtGui/QBoxLayout>
42 #include <QtGui/QCloseEvent>
47 #include "packageInfo.h"
48 #include "pkgInterface.h"
52 class QListWidgetItem
;
55 class pkgOptions
: public QDialog
59 explicit pkgOptions( pkgInterface
*pki
, QWidget
*parent
=0, const QString
&caption
=QString() );
62 bool setup(QList
<packageInfo
*> pl
);
63 bool setup(packageInfo
*p
);
64 void resetPackages(bool init
);
68 virtual QString
doPackages(int installFlags
, QList
<packageInfo
*> p
,
77 QListWidget
*packages
;
78 // List of packages that will be installed
81 // number of option buttons
90 QStringList checkedPackages
;
97 // This sets up the sub-widgets
98 void setupWidgets(QList
<param
*> &pars
);
101 virtual void pkginstallButtonClicked();
102 virtual void cancelButtonClicked();
103 void slotSearch(QListWidgetItem
*item
);
104 void keepToggle(bool);
107 void slotResult(QStringList
&rlist
, int ret
);
110 // This signal indicates that the widget has finished.
111 void finished(int refresh
);
114 // The layout managers
115 QBoxLayout
*layout
, *hlayout
, *vlayout
;
118 QPushButton
*installButton
;
119 KPushButton
*cancelButton
;
123 // install or uninstall
128 QList
<packageInfo
*> packList
;
129 QList
<packageInfo
*> packListChecked
;
133 void showEvent (QShowEvent
*);
134 void closeEvent (QCloseEvent
* e
);
139 ///////////////////////////////////////////////////////////////////////////
140 ///////////////////////////////////////////////////////////////////////////
141 class pkgOptionsI
: public pkgOptions
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
155 explicit pkgOptionsU(pkgInterface
*pkg
, QWidget
*parent
= 0);
156 QString
doPackages(int installFlags
, QList
<packageInfo
*> p
, bool &test
);
159 #endif // PKGOPTIONS_H