summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/mainwin.cpp
authorandyq <andyq>2002-10-25 09:50:52 (UTC)
committer andyq <andyq>2002-10-25 09:50:52 (UTC)
commit2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1 (patch) (unidiff)
tree4322eef1f6306763b3bc0332b6e57c05a24341d9 /noncore/settings/aqpkg/mainwin.cpp
parent4a2f6dd634aa277bca3818f090d691844e219f64 (diff)
downloadopie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.zip
opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.gz
opie-2f2c23d398b6a47bd06aaf329a55bb455cf5ddd1.tar.bz2
Modified so that you can click on a package in the documents view and
the Local IPKGS view is shown and the selected package checked
Diffstat (limited to 'noncore/settings/aqpkg/mainwin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/mainwin.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/noncore/settings/aqpkg/mainwin.cpp b/noncore/settings/aqpkg/mainwin.cpp
index 206d11c..9f19dfa 100644
--- a/noncore/settings/aqpkg/mainwin.cpp
+++ b/noncore/settings/aqpkg/mainwin.cpp
@@ -3,84 +3,93 @@
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#include <qmessagebox.h>
21 21
22#include "mainwin.h" 22#include "mainwin.h"
23#include "datamgr.h" 23#include "datamgr.h"
24#include "networkpkgmgr.h" 24#include "networkpkgmgr.h"
25#include "settingsimpl.h" 25#include "settingsimpl.h"
26#include "helpwindow.h" 26#include "helpwindow.h"
27#include "utils.h"
27#include "global.h" 28#include "global.h"
28 29
29MainWindow :: MainWindow( QWidget *p, char *name ) 30MainWindow :: MainWindow( QWidget *p, char *name )
30 :QMainWindow( p, name ) 31 :QMainWindow( p, name )
31{ 32{
32#ifdef QWS 33#ifdef QWS
33 showMaximized(); 34 showMaximized();
34#endif 35#endif
35 36
36 setCaption( "AQPkg - Package Manager" ); 37 setCaption( "AQPkg - Package Manager" );
37 38
38 // Create our menu 39 // Create our menu
39 QPopupMenu *help = new QPopupMenu( this ); 40 QPopupMenu *help = new QPopupMenu( this );
40 help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H ); 41 help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H );
41 help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A ); 42 help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A );
42 43
43 QPopupMenu *settings = new QPopupMenu( this ); 44 QPopupMenu *settings = new QPopupMenu( this );
44 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); 45 settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S );
45 46
46 // Create the main menu 47 // Create the main menu
47 QMenuBar *menu = menuBar(); //new QMenuBar( this ); 48 QMenuBar *menu = menuBar(); //new QMenuBar( this );
48 menu->insertItem( "&Settings", settings ); 49 menu->insertItem( "&Settings", settings );
49 menu->insertItem( "&Help", help ); 50 menu->insertItem( "&Help", help );
50 51
51 mgr = new DataManager(); 52 mgr = new DataManager();
52 mgr->loadServers(); 53 mgr->loadServers();
53 54
54 stack = new QWidgetStack( this ); 55 stack = new QWidgetStack( this );
55 56
56 networkPkgWindow = new NetworkPackageManager( mgr, stack ); 57 networkPkgWindow = new NetworkPackageManager( mgr, stack );
57 stack->addWidget( networkPkgWindow, 1 ); 58 stack->addWidget( networkPkgWindow, 1 );
58 59
59 setCentralWidget( stack ); 60 setCentralWidget( stack );
60 stack->raiseWidget( networkPkgWindow ); 61 stack->raiseWidget( networkPkgWindow );
61} 62}
62 63
63MainWindow :: ~MainWindow() 64MainWindow :: ~MainWindow()
64{ 65{
65 delete networkPkgWindow; 66 delete networkPkgWindow;
66} 67}
67 68
69void MainWindow :: setDocument( const QString &doc )
70{
71 // Remove path from package
72 QString package = Utils::getPackageNameFromIpkFilename( doc );
73 cout << "Selecting package " << package << endl;
74 networkPkgWindow->selectLocalPackage( package );
75}
76
68void MainWindow :: displaySettings() 77void MainWindow :: displaySettings()
69{ 78{
70 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); 79 SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true );
71 if ( dlg->showDlg( 0 ) ) 80 if ( dlg->showDlg( 0 ) )
72 networkPkgWindow->updateData(); 81 networkPkgWindow->updateData();
73 delete dlg; 82 delete dlg;
74} 83}
75 84
76void MainWindow :: displayHelp() 85void MainWindow :: displayHelp()
77{ 86{
78 HelpWindow *dlg = new HelpWindow( this ); 87 HelpWindow *dlg = new HelpWindow( this );
79 dlg->exec(); 88 dlg->exec();
80 delete dlg; 89 delete dlg;
81} 90}
82 91
83void MainWindow :: displayAbout() 92void MainWindow :: displayAbout()
84{ 93{
85 QMessageBox::about( this, "About AQPkg", VERSION_TEXT ); 94 QMessageBox::about( this, "About AQPkg", VERSION_TEXT );
86} 95}