diff --git a/telldus-gui/TelldusCenter/TelldusCenter.pro b/telldus-gui/TelldusCenter/TelldusCenter.pro new file mode 100644 index 00000000..c0eccfef --- /dev/null +++ b/telldus-gui/TelldusCenter/TelldusCenter.pro @@ -0,0 +1,11 @@ +# ------------------------------------------------- +# Project created by QtCreator 2008-12-11T11:01:36 +# ------------------------------------------------- +TARGET = TelldusCenter +TEMPLATE = app +SOURCES += main.cpp \ + mainwindow.cpp +HEADERS += mainwindow.h +FORMS += +RESOURCES += resource.qrc +LIBS += -lTelldusGui -L../TelldusGui diff --git a/telldus-gui/TelldusCenter/images/devices.png b/telldus-gui/TelldusCenter/images/devices.png new file mode 100644 index 00000000..438efaf1 Binary files /dev/null and b/telldus-gui/TelldusCenter/images/devices.png differ diff --git a/telldus-gui/TelldusCenter/main.cpp b/telldus-gui/TelldusCenter/main.cpp new file mode 100644 index 00000000..c5515038 --- /dev/null +++ b/telldus-gui/TelldusCenter/main.cpp @@ -0,0 +1,12 @@ +#include +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + Q_INIT_RESOURCE( resource ); + + QApplication a(argc, argv); + MainWindow *w = new MainWindow(); + w->show(); + return a.exec(); +} diff --git a/telldus-gui/TelldusCenter/mainwindow.cpp b/telldus-gui/TelldusCenter/mainwindow.cpp new file mode 100644 index 00000000..b9e6a995 --- /dev/null +++ b/telldus-gui/TelldusCenter/mainwindow.cpp @@ -0,0 +1,58 @@ +#include "mainwindow.h" + +#include +#include +#include +#include +#include + + +#include "../TelldusGui/TelldusGui_global.h" + +MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags) + : QMainWindow(parent, flags) + , m_pagesBar(0) +{ + setAttribute(Qt::WA_DeleteOnClose, true); + statusBar()->setSizeGripEnabled(true); + setupMenu(); + setupToolBar(); + + //QStackedWidget *centralWidget = new QStackedWidget(this); + QWidget *centralWidget = tdDeviceWidget(this); + setCentralWidget(centralWidget); + + setWindowTitle( tr("Telldus Center") ); +} + +MainWindow::~MainWindow() +{ + +} + +void MainWindow::setupMenu() +{ + menuBar()->clear(); + + // File + QMenu *fileMenu = menuBar()->addMenu(tr("&File")); + // Help + QMenu *helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addSeparator(); + helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt())); + helpMenu->addAction(tr("About &TelldusCenter"), this, SLOT(slotAboutApplication())); +} + +void MainWindow::setupToolBar() +{ + setUnifiedTitleAndToolBarOnMac(true); + m_pagesBar = addToolBar(tr("Pages")); + + QActionGroup *ag = new QActionGroup(this); + + QAction *actionDevices = new QAction( QIcon(":/images/devices.png"), tr("Devices"), this ); + actionDevices->setCheckable( true ); + actionDevices->setChecked( true ); + ag->addAction(actionDevices); + m_pagesBar->addActions( ag->actions() ); +} diff --git a/telldus-gui/TelldusCenter/mainwindow.h b/telldus-gui/TelldusCenter/mainwindow.h new file mode 100644 index 00000000..544422c9 --- /dev/null +++ b/telldus-gui/TelldusCenter/mainwindow.h @@ -0,0 +1,24 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +class QToolBar; + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0); + ~MainWindow(); + +private: + void setupMenu(); + void setupToolBar(); + +private: + QToolBar *m_pagesBar; +}; + +#endif // MAINWINDOW_H diff --git a/telldus-gui/TelldusCenter/resource.qrc b/telldus-gui/TelldusCenter/resource.qrc new file mode 100644 index 00000000..e4c7cec9 --- /dev/null +++ b/telldus-gui/TelldusCenter/resource.qrc @@ -0,0 +1,5 @@ + + + images/devices.png + +