Initial import of TelldusCenter
This commit is contained in:
parent
4735b596ff
commit
6e3c3828f1
6 changed files with 110 additions and 0 deletions
11
telldus-gui/TelldusCenter/TelldusCenter.pro
Normal file
11
telldus-gui/TelldusCenter/TelldusCenter.pro
Normal file
|
@ -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
|
BIN
telldus-gui/TelldusCenter/images/devices.png
Normal file
BIN
telldus-gui/TelldusCenter/images/devices.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
12
telldus-gui/TelldusCenter/main.cpp
Normal file
12
telldus-gui/TelldusCenter/main.cpp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include <QtGui/QApplication>
|
||||||
|
#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();
|
||||||
|
}
|
58
telldus-gui/TelldusCenter/mainwindow.cpp
Normal file
58
telldus-gui/TelldusCenter/mainwindow.cpp
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
#include "mainwindow.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QStackedWidget>
|
||||||
|
#include <QStatusBar>
|
||||||
|
#include <QToolBar>
|
||||||
|
|
||||||
|
|
||||||
|
#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() );
|
||||||
|
}
|
24
telldus-gui/TelldusCenter/mainwindow.h
Normal file
24
telldus-gui/TelldusCenter/mainwindow.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#ifndef MAINWINDOW_H
|
||||||
|
#define MAINWINDOW_H
|
||||||
|
|
||||||
|
#include <QtGui/QMainWindow>
|
||||||
|
|
||||||
|
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
|
5
telldus-gui/TelldusCenter/resource.qrc
Normal file
5
telldus-gui/TelldusCenter/resource.qrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/" >
|
||||||
|
<file>images/devices.png</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
Loading…
Add table
Add a link
Reference in a new issue