SVN_SILENT made messages (.desktop file)
[kdeadmin.git] / kpackage / kpkg.h
bloba90a7d0c2a16487c2e5e37af4ddbb91371ce614f
1 /*
2 ** Copyright (C) 2007 Toivo Pedaste <toivo@ucs.uwa.edu.au>
3 **
4 ** This is the main widget for kpackage
5 ** The whole widget is a DND drop zone where users can drop packages to
6 ** be 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 KPKG_H
31 #define KPKG_H
33 // KDE headers
34 #include <kurl.h>
35 #include <kxmlguiwindow.h>
36 #include <kpPty.h>
37 #include <ksharedconfig.h>
38 #include <QtGui/QDragEnterEvent>
39 #include <QtGui/QLabel>
40 #include <QtGui/QFrame>
41 #include <QtGui/QResizeEvent>
42 #include <QtGui/QDropEvent>
43 #include <QtGui/QCloseEvent>
45 class QLabel;
46 class Options;
47 class KRecentFilesAction;
48 class KConfigGroup;
49 class kpSettings;
50 class kpConfig;
52 //////////////////////////////////////////////////////////////////////////////
53 //////////////////////////////////////////////////////////////////////////////
55 class KPKG : public KXmlGuiWindow
57 Q_OBJECT
59 enum { Tback = 1,
60 Tforward = 2,
61 Tfileopen = 3,
62 Tftout = 4,
63 Tftin = 5,
64 Tfind = 6,
65 Tfindf = 7,
66 Treload = 8
69 public:
71 KPKG(const KSharedConfigPtr &_config);
72 // Constructor
74 void add_recent_file(const QString &newfile);
75 // keep list of files accessed
77 void add_recent_host(const QString &newhost);
79 void createSettings();
80 // Edit settings dialog
82 void writeSettings();
83 // write config settings
85 void saveProperties(KConfigGroup& config);
86 void readProperties(const KConfigGroup& config);
87 // save and read restart sstate
89 void disableMenu();
90 void enableMenu();
91 // enable/deisable menu elements
93 void disableNext();
94 void enableNext();
95 void disablePrevious();
96 void enablePrevious();
97 // Control next and previous commands
100 bool prop_restart;
101 // indicates a restart from saved state
103 Options *optiondialog;
104 // Options dialog
106 KSharedConfigPtr config ;
107 // Saved config information
109 kpSettings *conf;
110 kpConfig *kconf;
112 private:
114 void setupMenu();
115 // This sets up the menubar
117 QAction *pack_hopen;
118 QAction *pack_open;
119 QAction *pack_find;
120 QAction *pack_findf;
121 QAction *kpack_reload;
122 QAction *pack_prev;
123 QAction *pack_next;
124 QAction *pack_install;
125 QAction *pack_uninstall;
127 KConfigGroup *fgroup;
128 KConfigGroup *hgroup;
130 int toolID, selectID;
131 // refrences to toolbar and menu items
133 bool hide_toolbar;
134 // don't display toolbar
136 KRecentFilesAction *recent;
137 KRecentFilesAction *recentHosts;
139 public slots:
141 void openHost();
143 void openRecentHost(const KUrl& url);
145 void openRecent(const KUrl& url);
146 // opens file from list of recently opened ones
148 void setOptions();
149 // set options
151 void saveSettings();
152 // save config
154 void configureToolBars();
156 void updateConfiguration();
162 private slots:
163 void slotNewToolbarConfig();
165 protected:
166 void closeEvent ( QCloseEvent *e);
169 extern KPKG *kpkg;
171 //////////////////////////////////////////////////////////////////////////////
172 #endif