/*************************************************************************** mainwin.cpp - description ------------------- begin : Mon Aug 26 13:32:30 BST 2002 copyright : (C) 2002 by Andy Qua email : andy.qua@blueyonder.co.uk ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include #include #include "mainwin.h" #include "datamgr.h" #include "networkpkgmgr.h" #include "settingsimpl.h" #include "helpwindow.h" #include "global.h" MainWindow :: MainWindow( QWidget *p, char *name ) : QMainWindow( p, name ) { #ifdef QWS showMaximized(); #endif setCaption( "AQPkg - Package Manager" ); // Create our menu QPopupMenu *help = new QPopupMenu( this ); help->insertItem( "&General", this, SLOT(displayHelp()), Qt::CTRL+Qt::Key_H ); help->insertItem( "&About", this, SLOT(displayAbout()), Qt::CTRL+Qt::Key_A ); QPopupMenu *settings = new QPopupMenu( this ); settings->insertItem( "&Settings", this, SLOT(displaySettings()), Qt::CTRL+Qt::Key_S ); // Create the main menu QMenuBar *menu = menuBar(); //new QMenuBar( this ); menu->insertItem( "&Settings", settings ); menu->insertItem( "&Help", help ); mgr = new DataManager(); mgr->loadServers(); stack = new QWidgetStack( this ); networkPkgWindow = new NetworkPackageManager( mgr, stack ); stack->addWidget( networkPkgWindow, 1 ); setCentralWidget( stack ); stack->raiseWidget( networkPkgWindow ); } MainWindow :: ~MainWindow() { delete networkPkgWindow; } void MainWindow :: displaySettings() { SettingsImpl *dlg = new SettingsImpl( mgr, this, "Settings", true ); if ( dlg->showDlg( 0 ) ) networkPkgWindow->updateData(); delete dlg; } void MainWindow :: displayHelp() { HelpWindow *dlg = new HelpWindow( this ); dlg->exec(); delete dlg; } void MainWindow :: displayAbout() { }