author | andyq <andyq> | 2002-10-16 18:59:07 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-16 18:59:07 (UTC) |
commit | 5d3fda975262b1bf406415c3f27ffd71af126304 (patch) (unidiff) | |
tree | bd42d40d99ca1bea8bff37faafacbd3dcd20b9b8 | |
parent | 0feff4043ce813c63e501d6bbd3114e7fcfd8ce6 (diff) | |
download | opie-5d3fda975262b1bf406415c3f27ffd71af126304.zip opie-5d3fda975262b1bf406415c3f27ffd71af126304.tar.gz opie-5d3fda975262b1bf406415c3f27ffd71af126304.tar.bz2 |
Now displays an about box (only the version is shown)
-rw-r--r-- | noncore/settings/aqpkg/mainwin.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp index 5de4dc9..206d11c 100644 --- a/noncore/settings/aqpkg/mainwin.cpp +++ b/noncore/settings/aqpkg/mainwin.cpp | |||
@@ -1,85 +1,86 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | mainwin.cpp - description | 2 | mainwin.cpp - description |
3 | ------------------- | 3 | ------------------- |
4 | begin : Mon Aug 26 13:32:30 BST 2002 | 4 | begin : Mon Aug 26 13:32:30 BST 2002 |
5 | copyright : (C) 2002 by Andy Qua | 5 | copyright : (C) 2002 by Andy Qua |
6 | email : andy.qua@blueyonder.co.uk | 6 | email : andy.qua@blueyonder.co.uk |
7 | ***************************************************************************/ | 7 | ***************************************************************************/ |
8 | 8 | ||
9 | /*************************************************************************** | 9 | /*************************************************************************** |
10 | * * | 10 | * * |
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * |
15 | * * | 15 | * * |
16 | ***************************************************************************/ | 16 | ***************************************************************************/ |
17 | 17 | ||
18 | #include <qmenubar.h> | 18 | #include <qmenubar.h> |
19 | #include <qpopupmenu.h> | 19 | #include <qpopupmenu.h> |
20 | #include <qmessagebox.h> | ||
20 | 21 | ||
21 | #include "mainwin.h" | 22 | #include "mainwin.h" |
22 | #include "datamgr.h" | 23 | #include "datamgr.h" |
23 | #include "networkpkgmgr.h" | 24 | #include "networkpkgmgr.h" |
24 | #include "settingsimpl.h" | 25 | #include "settingsimpl.h" |
25 | #include "helpwindow.h" | 26 | #include "helpwindow.h" |
26 | #include "global.h" | 27 | #include "global.h" |
27 | 28 | ||
28 | MainWindow :: MainWindow( QWidget *p, char *name ) | 29 | MainWindow :: MainWindow( QWidget *p, char *name ) |
29 | :QMainWindow( p, name ) | 30 | :QMainWindow( p, name ) |
30 | { | 31 | { |
31 | #ifdef QWS | 32 | #ifdef QWS |
32 | showMaximized(); | 33 | showMaximized(); |
33 | #endif | 34 | #endif |
34 | 35 | ||
35 | setCaption( "AQPkg - Package Manager" ); | 36 | setCaption( "AQPkg - Package Manager" ); |
36 | 37 | ||
37 | // Create our menu | 38 | // Create our menu |
38 | QPopupMenu *help = new QPopupMenu( this ); | 39 | QPopupMenu *help = new QPopupMenu( this ); |
39 | help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H ); | 40 | help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H ); |
40 | help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A ); | 41 | help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A ); |
41 | 42 | ||
42 | QPopupMenu *settings = new QPopupMenu( this ); | 43 | QPopupMenu *settings = new QPopupMenu( this ); |
43 | settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); | 44 | settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); |
44 | 45 | ||
45 | // Create the main menu | 46 | // Create the main menu |
46 | QMenuBar *menu = menuBar(); //new QMenuBar( this ); | 47 | QMenuBar *menu = menuBar(); //new QMenuBar( this ); |
47 | menu->insertItem( "&Settings", settings ); | 48 | menu->insertItem( "&Settings", settings ); |
48 | menu->insertItem( "&Help", help ); | 49 | menu->insertItem( "&Help", help ); |
49 | 50 | ||
50 | mgr = new DataManager(); | 51 | mgr = new DataManager(); |
51 | mgr->loadServers(); | 52 | mgr->loadServers(); |
52 | 53 | ||
53 | stack = new QWidgetStack( this ); | 54 | stack = new QWidgetStack( this ); |
54 | 55 | ||
55 | networkPkgWindow = new NetworkPackageManager( mgr, stack ); | 56 | networkPkgWindow = new NetworkPackageManager( mgr, stack ); |
56 | stack->addWidget( networkPkgWindow, 1 ); | 57 | stack->addWidget( networkPkgWindow, 1 ); |
57 | 58 | ||
58 | setCentralWidget( stack ); | 59 | setCentralWidget( stack ); |
59 | stack->raiseWidget( networkPkgWindow ); | 60 | stack->raiseWidget( networkPkgWindow ); |
60 | } | 61 | } |
61 | 62 | ||
62 | MainWindow :: ~MainWindow() | 63 | MainWindow :: ~MainWindow() |
63 | { | 64 | { |
64 | delete networkPkgWindow; | 65 | delete networkPkgWindow; |
65 | } | 66 | } |
66 | 67 | ||
67 | void MainWindow :: displaySettings() | 68 | void MainWindow :: displaySettings() |
68 | { | 69 | { |
69 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); | 70 | SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); |
70 | if ( dlg->showDlg( 0 ) ) | 71 | if ( dlg->showDlg( 0 ) ) |
71 | networkPkgWindow->updateData(); | 72 | networkPkgWindow->updateData(); |
72 | delete dlg; | 73 | delete dlg; |
73 | } | 74 | } |
74 | 75 | ||
75 | void MainWindow :: displayHelp() | 76 | void MainWindow :: displayHelp() |
76 | { | 77 | { |
77 | HelpWindow *dlg = new HelpWindow( this ); | 78 | HelpWindow *dlg = new HelpWindow( this ); |
78 | dlg->exec(); | 79 | dlg->exec(); |
79 | delete dlg; | 80 | delete dlg; |
80 | } | 81 | } |
81 | 82 | ||
82 | void MainWindow :: displayAbout() | 83 | void MainWindow :: displayAbout() |
83 | { | 84 | { |
84 | 85 | QMessageBox::about( this, "About AQPkg", VERSION_TEXT ); | |
85 | } | 86 | } |