From 73a3747bc1b33200207768b101bf56083416d756 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Thu, 8 Jul 2010 21:53:27 +0000 Subject: Theme Editor: Built a ui for the timer panel, not functional yet git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27353 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/gui/editorwindow.cpp | 13 ++ utils/themeeditor/gui/editorwindow.h | 3 + utils/themeeditor/gui/editorwindow.ui | 9 ++ utils/themeeditor/gui/skintimer.cpp | 58 +++++++++ utils/themeeditor/gui/skintimer.h | 58 +++++++++ utils/themeeditor/gui/skintimer.ui | 232 +++++++++++++++++++++++++++++++++ 6 files changed, 373 insertions(+) create mode 100644 utils/themeeditor/gui/skintimer.cpp create mode 100644 utils/themeeditor/gui/skintimer.h create mode 100644 utils/themeeditor/gui/skintimer.ui (limited to 'utils/themeeditor/gui') diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp index 169dc3f..b81e41a 100644 --- a/utils/themeeditor/gui/editorwindow.cpp +++ b/utils/themeeditor/gui/editorwindow.cpp @@ -167,8 +167,19 @@ void EditorWindow::setupUI() deviceDock->setObjectName("deviceDock"); deviceDock->setWidget(deviceConfig); deviceDock->setFloating(true); + deviceDock->move(QPoint(x() + width() / 2, y() + height() / 2)); deviceDock->hide(); + /* Positioning the timer panel */ + timerDock = new QDockWidget(tr("Timer"), this); + timer = new SkinTimer(deviceConfig, timerDock); + + timerDock->setObjectName("timerDock"); + timerDock->setWidget(timer); + timerDock->setFloating(true); + timerDock->move(QPoint(x() + width() / 2, y() + height() / 2)); + timerDock->hide(); + shiftTab(-1); } @@ -183,6 +194,8 @@ void EditorWindow::setupMenus() this, SLOT(showPanel())); QObject::connect(ui->actionDevice_Configuration, SIGNAL(triggered()), deviceDock, SLOT(show())); + QObject::connect(ui->actionTimer, SIGNAL(triggered()), + timerDock, SLOT(show())); /* Connecting the document management actions */ QObject::connect(ui->actionNew_Document, SIGNAL(triggered()), diff --git a/utils/themeeditor/gui/editorwindow.h b/utils/themeeditor/gui/editorwindow.h index c2ae177..6b09b79 100644 --- a/utils/themeeditor/gui/editorwindow.h +++ b/utils/themeeditor/gui/editorwindow.h @@ -34,6 +34,7 @@ #include "preferencesdialog.h" #include "skinviewer.h" #include "devicestate.h" +#include "skintimer.h" class ProjectModel; class TabContent; @@ -99,6 +100,8 @@ private: SkinViewer* viewer; DeviceState* deviceConfig; QDockWidget* deviceDock; + SkinTimer* timer; + QDockWidget* timerDock; }; #endif // EDITORWINDOW_H diff --git a/utils/themeeditor/gui/editorwindow.ui b/utils/themeeditor/gui/editorwindow.ui index 707e246..5ef3261 100644 --- a/utils/themeeditor/gui/editorwindow.ui +++ b/utils/themeeditor/gui/editorwindow.ui @@ -69,6 +69,7 @@ + @@ -365,6 +366,14 @@ Ctrl+F + + + T&imer + + + Ctrl+T + + projectTree diff --git a/utils/themeeditor/gui/skintimer.cpp b/utils/themeeditor/gui/skintimer.cpp new file mode 100644 index 0000000..f228a2f --- /dev/null +++ b/utils/themeeditor/gui/skintimer.cpp @@ -0,0 +1,58 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 Robert Bieber + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "skintimer.h" +#include "ui_skintimer.h" + +const int SkinTimer::millisPerTick = 10; + +SkinTimer::SkinTimer(DeviceState* device, QWidget *parent) : + QWidget(parent), + ui(new Ui::SkinTimer), + device(device) +{ + ui->setupUi(this); +} + +SkinTimer::~SkinTimer() +{ + delete ui; +} + +void SkinTimer::start() +{ + +} + +void SkinTimer::stop() +{ + +} + +void SkinTimer::tick() +{ + +} + +void SkinTimer::stateChange() +{ + +} diff --git a/utils/themeeditor/gui/skintimer.h b/utils/themeeditor/gui/skintimer.h new file mode 100644 index 0000000..b6c8061 --- /dev/null +++ b/utils/themeeditor/gui/skintimer.h @@ -0,0 +1,58 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2010 Robert Bieber + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef SKINTIMER_H +#define SKINTIMER_H + +#include +#include + +#include "devicestate.h" + +namespace Ui { + class SkinTimer; +} + +class SkinTimer : public QWidget { + Q_OBJECT +public: + static const int millisPerTick; + + SkinTimer(DeviceState* device, QWidget *parent = 0); + ~SkinTimer(); + +private slots: + void start(); + void stop(); + void tick(); + void stateChange(); + +private: + void setupUI(); + + Ui::SkinTimer *ui; + DeviceState* device; + + QTimer timer; + unsigned long int elapsedTime; +}; + +#endif // SKINTIMER_H diff --git a/utils/themeeditor/gui/skintimer.ui b/utils/themeeditor/gui/skintimer.ui new file mode 100644 index 0000000..a9f5fea --- /dev/null +++ b/utils/themeeditor/gui/skintimer.ui @@ -0,0 +1,232 @@ + + + SkinTimer + + + + 0 + 0 + 238 + 204 + + + + Form + + + + :/resources/windowicon.png:/resources/windowicon.png + + + + + + + + Speed + + + speedBox + + + + + + + x + + + 1 + + + 0.100000000000000 + + + 3.000000000000000 + + + 0.200000000000000 + + + 1.000000000000000 + + + + + + + Duration + + + spinBox + + + + + + + s + + + 1 + + + 1000 + + + 20 + + + + + + + + + 0 + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Start + + + + + + + false + + + Stop + + + + + + + + + + + + + + + :/resources/resources/play.png:/resources/resources/play.png + + + + 30 + 30 + + + + true + + + true + + + true + + + + + + + + + + + :/resources/resources/pause.png:/resources/resources/pause.png + + + + 30 + 30 + + + + true + + + false + + + true + + + + + + + + + + + :/resources/resources/rwnd.png:/resources/resources/rwnd.png + + + + 30 + 30 + + + + true + + + true + + + + + + + + + + + :/resources/resources/ffwd.png:/resources/resources/ffwd.png + + + + 30 + 30 + + + + true + + + true + + + + + + + + + + + + -- cgit v1.1