From 0b99cfa6550c1828294aaca9b64eb7517f1e729f Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Thu, 16 Jun 2011 16:36:14 +0200 Subject: CMakeLists, main class and build/run scripts --- src/fbsplash.cpp | 28 ++++++++++++++++++++++++++++ src/fbsplash.h | 34 ++++++++++++++++++++++++++++++++++ src/main.cpp | 13 +++++++++++++ 3 files changed, 75 insertions(+) create mode 100644 src/fbsplash.cpp create mode 100644 src/fbsplash.h create mode 100644 src/main.cpp (limited to 'src') diff --git a/src/fbsplash.cpp b/src/fbsplash.cpp new file mode 100644 index 0000000..c2f52bb --- /dev/null +++ b/src/fbsplash.cpp @@ -0,0 +1,28 @@ +#include "fbsplash.h" + +fbsplash::fbsplash(){ + + qDebug() << "*fbsplash init*"; + + createQuitAction(); + setupTheme(); + + setAttribute(Qt::WA_QuitOnClose, true); + setWindowFlags(Qt::FramelessWindowHint); + showFullScreen(); +} +//----------------------------------------------------------------------------- +void fbsplash::setupTheme(){ + // TODO configurable per cmdline + // for now, black as base background color + QPalette pal; + pal.setColor(QPalette::Base, Qt::black); + this->setPalette(pal); +} +//----------------------------------------------------------------------------- +void fbsplash::createQuitAction(){ + _quit = new QAction(tr("&quit"), this); + _quit->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_X)); + this->addAction(_quit); + connect(_quit, SIGNAL(triggered()), this, SLOT(close())); +} \ No newline at end of file diff --git a/src/fbsplash.h b/src/fbsplash.h new file mode 100644 index 0000000..f081906 --- /dev/null +++ b/src/fbsplash.h @@ -0,0 +1,34 @@ + /* + * Copyright (c) 2010,2011 - OpenSLX Project + * + * This program/file is free software distributed under the GPL version 2. + * See http://openslx.org/COPYING + * + * If you have any feedback please consult http://openslx.org/feedback and + * send your feedback to feedback@openslx.org + * + * General information about OpenSLX can be found under http://openslx.org + * + */ + +#ifndef FBSPLASH_H +#define FBSPLASH_H + +#include + +class fbsplash: public QMainWindow{ + Q_OBJECT + +public: + fbsplash(); + +private: + void setupTheme(); + // ** TESTING STUFF ** + void createQuitAction(); + QAction* _quit; + // ** TESTING STUFF ** + +}; + +#endif // FBSPLASH_H \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..16c2daf --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,13 @@ +#include +#include "fbsplash.h" + +int main(int argc, char *argv[]) { + + QApplication app(argc, argv, QApplication::GuiServer); + app.setOrganizationName("OpenSLX"); + app.setApplicationName("fbsplash"); + + fbsplash bs; + bs.show(); + app.exec(); +} \ No newline at end of file -- cgit v1.2.3-55-g7522