summaryrefslogtreecommitdiff
path: root/noncore/settings/packagemanager/mainwindow.h
Unidiff
Diffstat (limited to 'noncore/settings/packagemanager/mainwindow.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/packagemanager/mainwindow.h136
1 files changed, 136 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/mainwindow.h b/noncore/settings/packagemanager/mainwindow.h
new file mode 100644
index 0000000..49bb66c
--- a/dev/null
+++ b/noncore/settings/packagemanager/mainwindow.h
@@ -0,0 +1,136 @@
1/*
2                This file is part of the OPIE Project
3
4 =. Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5             .=l.
6           .>+-=
7 _;:,     .>    :=|. This file is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This file is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
29
30#ifndef MAINWINDOW_H
31#define MAINWINDOW_H
32
33#include <qlabel.h>
34#include <qlistview.h>
35#include <qmainwindow.h>
36#include <qpixmap.h>
37#include <qprogressbar.h>
38#include <qtoolbar.h>
39#include <qwidgetstack.h>
40
41#include <qpe/config.h>
42
43#include "opackagemanager.h"
44
45class QAction;
46class QLineEdit;
47
48class MainWindow :public QMainWindow
49{
50 Q_OBJECT
51
52public:
53 MainWindow( QWidget *parent = 0x0, const char *name = 0x0, WFlags fl = 0 );
54 static QString appName() { return QString::fromLatin1( "packagemanager" ); };
55
56protected:
57 void closeEvent( QCloseEvent *event );
58
59private:
60 Config m_config; // Configuration file
61
62 OPackageManager m_packman; // Package manager
63
64 // Toolbars
65 QToolBar m_menuBar; // Main toolbar containing menu
66 QToolBar m_toolBar; // Main toolbar
67 QToolBar m_findBar; // Find toolbar
68
69 QWidgetStack m_widgetStack; // Main widget stack which contains m_packageList & m_statusWidget
70 QListView m_packageList; // Main list view of all packages
71
72 QLineEdit *m_findEdit; // Line edit box used for find toolbar
73
74 // Status widget controls
75 QWidget m_statusWidget; // Widget to display status during long operations
76 QLabel m_statusText; // Text status message
77 QProgressBar m_statusBar; // Progress bar showing % completed
78
79 // Icon pixmaps
80 QPixmap m_iconUpdated; // Cached icon which shows when package can be updated
81 QPixmap m_iconInstalled; // Cached icon which shows when package is installed
82 QPixmap m_iconNull; // Cached icon which shows when package is not installed
83
84 // Menu/tool bar actions
85 QAction *m_actionShowNotInstalled; // Action to show pakages not currently installed
86 QAction *m_actionShowInstalled; // Action to show pakages currently installed
87 QAction *m_actionShowUpdated; // Action to show pakages currently installed with update available
88 QAction *m_actionFilter; // Action to filter packages
89 QAction *m_actionFindNext; // Action to find next match
90
91 // Cached filter settings
92 QString m_filterName; // Cached name filter value
93 QString m_filterServer; // Cached server name filter value
94 QString m_filterDest; // Cached destination name filter value
95 OPackageManager::Status m_filterStatus; // Cached status filter value
96 QString m_filterCategory; // Cached category filter value
97
98 void initPackageList();
99 void initStatusWidget();
100 void initUI();
101
102 void loadPackageList( OPackageList *packages = 0x0, bool clearList = true );
103 void searchForPackage( const QString &text );
104
105private slots:
106 void initPackageInfo();
107 void slotWidgetStackShow( QWidget *widget );
108
109 // Status widget slots
110 void slotInitStatusBar( int numSteps );
111 void slotStatusText( const QString &status );
112 void slotStatusBar( int currStep );
113
114 // Actions menu action slots
115 void slotUpdate();
116 void slotUpgrade();
117// void slotDownload();
118 void slotApply();
119 void slotCloseInstallDlg();
120 void slotConfigure();
121
122 // View menu action slots
123 void slotShowNotInstalled();
124 void slotShowInstalled();
125 void slotShowUpdated();
126 void slotFilterChange();
127 void slotFilter( bool isOn );
128
129 // Find action slots
130 void slotFindShowToolbar();
131 void slotFindHideToolbar();
132 void slotFindChanged( const QString &findText );
133 void slotFindNext();
134};
135
136#endif