2 // Copyright 2010 Mikko Keinänen
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");
35 void MainWindow::createActions()
37 configPlatformAction = new QAction(tr("&Platforms"), this);
38 configPlatformAction->setStatusTip(tr("Configure platforms"));
39 connect(configPlatformAction, SIGNAL(triggered()),
40 this, SLOT(configurePlatforms()));
42 exitAction = new QAction(tr("&Exit"), this);
43 exitAction->setShortcut(tr("Ctrl+Q"));
44 exitAction->setStatusTip(tr("Exit EmuFront"));
45 connect(exitAction, SIGNAL(triggered()), this, SLOT(close()));
48 void MainWindow::configurePlatforms()
52 platformDialog = new PlatformDialog(this);
54 platformDialog->show();
55 platformDialog->raise();
56 platformDialog->activateWindow();
59 void MainWindow::createMenus()
61 fileMenu = menuBar()->addMenu(tr("&File"));
62 fileMenu->addAction(exitAction);
64 configMenu = menuBar()->addMenu(tr("&Config"));
65 configMenu->addAction(configPlatformAction);
68 void MainWindow::createStatusBar()
70 messageLabel = new QLabel;
71 statusBar()->addWidget(messageLabel);
74 void MainWindow::readSettings()
78 void MainWindow::writeSettings()
82 void MainWindow::closeEvent(QCloseEvent *event)
89 bool MainWindow::okToContinue()