Fixes, two signals received in mainwindow
[meego-garage:garage-netbook-ui.git] / appview.h
1 #ifndef APPVIEW_H
2 #define APPVIEW_H
3
4 #include <QFrame>
5 #include <Qt/QtGui>
6 #include <QSharedPointer>
7
8 #include <QPackageKit>
9 #include "actiondialog.h"
10
11 namespace Ui {
12     class MainWindow;
13 }
14
15 namespace MeeGoGarage {
16
17 class Application;
18
19 class AppView : public QWidget
20 {
21 Q_OBJECT
22
23 public:
24
25     typedef enum {
26         /// No action runnig
27         NoAction,
28         /// Resolve running
29         ResolveAction,
30         /// Installing package
31         InstallAction,
32         /// Removing package
33         RemoveAction,
34         /// Updatig package
35         UpdateAction,
36
37         /// Error resolving, nothing else can be done
38         ErrorResolve
39     } AppAction;
40
41     explicit AppView(QWidget *parent = 0);
42     void load (Ui::MainWindow *ui, Application *app);
43
44 signals:
45
46 public slots:
47     void onAppActionBtnClicked(void);
48     void errorCodeHandler(PackageKit::Client::ErrorType, const QString&);
49     void progressChangedHandler(PackageKit::Transaction::ProgressInfo);
50     void updateStatus(void);
51     void onPackageResolved(void);
52     void unload(void);
53
54 private:
55
56     void resolvePackage(void);
57
58     Application *m_app;
59     Ui::MainWindow *m_ui;
60     QSharedPointer<ActionDialog> m_actionDialog;
61     AppAction m_appAction;
62
63 };
64
65 } // namespace MeeGoGarage
66
67 #endif // APPVIEW_H