X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fapp%2Fwindows%2Fappwindow.cpp;fp=src%2Fapp%2Fwindows%2Fappwindow.cpp;h=b89219e9d84390f5ab905c6b023e34dccce13c7c;hb=97d708fe2ef37ca3096398e3293b4d2ebc0f42c1;hp=0000000000000000000000000000000000000000;hpb=c07dab61760f81428091900e482e4a9d2b8c3234;p=photoenhancer diff --git a/src/app/windows/appwindow.cpp b/src/app/windows/appwindow.cpp new file mode 100644 index 0000000..b89219e --- /dev/null +++ b/src/app/windows/appwindow.cpp @@ -0,0 +1,112 @@ +#include "appwindow.h" +#include "workspace.h" +#include +#include +#include + + +AppWindow::AppWindow(QWidget *parent):QMainWindow(parent) +{ + mWorkspace=new Workspace(); + setCentralWidget(mWorkspace); + createActions(); + createMenus(); + createToolBars(); + createStatusBar(); + readSettings(); +} + + void AppWindow::newFile() + { + + } + + void AppWindow::open() + { + + } + + bool AppWindow::save() + { + + } + + bool AppWindow::saveAs() + { + + } + + void AppWindow::createActions() + { + newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this); + newAct->setShortcuts(QKeySequence::New); + newAct->setStatusTip(tr("Create a new file")); + connect(newAct, SIGNAL(triggered()), this, SLOT(newFile())); + + openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this); + openAct->setShortcuts(QKeySequence::Open); + openAct->setStatusTip(tr("Open an existing file")); + connect(openAct, SIGNAL(triggered()), this, SLOT(open())); + + saveAct = new QAction(QIcon(":/images/save.png"), tr("&Save"), this); + saveAct->setShortcuts(QKeySequence::Save); + saveAct->setStatusTip(tr("Save the document to disk")); + connect(saveAct, SIGNAL(triggered()), this, SLOT(save())); + + saveAsAct = new QAction(tr("Save &As..."), this); + saveAsAct->setShortcuts(QKeySequence::SaveAs); + saveAsAct->setStatusTip(tr("Save the document under a new name")); + connect(saveAsAct, SIGNAL(triggered()), this, SLOT(saveAs())); + + exitAct = new QAction(tr("E&xit"), this); + exitAct->setShortcuts(QKeySequence::Quit); + exitAct->setStatusTip(tr("Exit the application")); + connect(exitAct, SIGNAL(triggered()), this, SLOT(close())); + + + menuBar()->addSeparator(); + + } + + void AppWindow::createToolBars() + { + fileToolBar = addToolBar(tr("File")); + fileToolBar->addAction(newAct); + fileToolBar->addAction(openAct); + fileToolBar->addAction(saveAct); + + + } + + void AppWindow::createStatusBar() + { + statusBar()->showMessage(tr("Ready")); + } + + void AppWindow::readSettings() + { + + } + + void AppWindow::writeSettings() + { + + } + + bool AppWindow::maybeSave() + { + + return true; + } + + + void AppWindow::createMenus() + { + fileMenu = menuBar()->addMenu(tr("&File")); + fileMenu->addAction(newAct); + fileMenu->addAction(openAct); + fileMenu->addAction(saveAct); + fileMenu->addAction(saveAsAct); + fileMenu->addSeparator(); + fileMenu->addAction(exitAct); + }