2 // Copyright Mikko Keinänen 2010
4 // This file is part of EmuFront.
7 // EmuFront is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // Foobar is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with Foobar. If not, see <http://www.gnu.org/licenses/>.
21 #include "mainwindow.h"
22 #include "dialogs/platformdialog.h"
23 #include "db/databasemanager.h"
25 MainWindow::MainWindow()
27 setWindowTitle("EmuFront");
33 //dbManager = new DatabaseManager;
36 void MainWindow::createActions()
38 configPlatformAction = new QAction(tr("&Platforms"), this);
39 configPlatformAction->setStatusTip(tr("Configure platforms"));
40 connect(configPlatformAction, SIGNAL(triggered()),
41 this, SLOT(configurePlatforms()));
43 exitAction = new QAction(tr("&Exit"), this);
44 exitAction->setShortcut(tr("Ctrl+Q"));
45 exitAction->setStatusTip(tr("Exit EmuFront"));
46 connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
49 void MainWindow::configurePlatforms()
53 platformDialog = new PlatformDialog(this);
55 platformDialog->show();
56 platformDialog->raise();
57 platformDialog->activateWindow();
60 void MainWindow::createMenus()
62 fileMenu = menuBar()->addMenu(tr("&File"));
63 fileMenu->addAction(exitAction);
65 configMenu = menuBar()->addMenu(tr("&Config"));
66 configMenu->addAction(configPlatformAction);
69 void MainWindow::createStatusBar()
71 messageLabel = new QLabel;
72 statusBar()->addWidget(messageLabel);
75 void MainWindow::readSettings()
79 void MainWindow::writeSettings()
83 void MainWindow::closeEvent(QCloseEvent *event)
90 bool MainWindow::okToContinue()