From: Bocklage, Jens Date: Thu, 2 Jun 2016 12:29:22 +0000 (+0200) Subject: First version X-Git-Tag: v0.1.0~2 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=staging%2FHomeScreen.git;a=commitdiff_plain;h=ff25a2a06428ffb0d6d8aeddb5faaa301b4201fe First version v0.0.1 06/01/2016 - initial version - first implementation of home screen - fix HMI layout (will be configurable in the future) - dBus as IPC (may change in the future) - no interaction with application manager so far - multi-lanuage support - day/night mode support - initial status bar implementation (interface will be enhanced in the future) - initial control bar implementation - MPLv2.0 license - input device simulator for developer build (not functional right now) - system settings simulator for developer build (day/night mode switch functional right now) - using QSettings for local app setting storage (may change in the future) - first popup implementation (single popup support for now; multiple popup not defined; interface will change) - only one instance of the app allowed --- diff --git a/.gitignore b/.gitignore index 658ee1a..051f2d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +# manually added: +.DS_Store # Created by https://www.gitignore.io/api/linux,qt,c,c++ diff --git a/HomeScreen.pro b/HomeScreen.pro new file mode 100644 index 0000000..3a80fab --- /dev/null +++ b/HomeScreen.pro @@ -0,0 +1,162 @@ +# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +#TODO: compile switches for ARM/x86 architecture + +QT += core gui dbus + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = HomeScreen +TEMPLATE = app + + +SOURCES += \ + src/main.cpp \ + src/mainwindow.cpp \ + src/inputdevicesimulator.cpp \ + src/systemsettingssimulator.cpp \ + $$OUT_PWD/daynightmode_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/popup_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/popup_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/inputevent_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/inputevent_proxy.cpp \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.cpp \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.cpp \ #generated dbus proxy + src/settingswidget.cpp \ + src/popupwidget.cpp \ + src/inputeventdistributor.cpp \ + src/controlbarwidget.cpp \ + src/statusbarwidget.cpp + +HEADERS += \ + include/daynightmode.h \ + include/inputevent.h \ + include/popup.h \ + src/mainwindow.h \ + src/inputdevicesimulator.h \ + src/systemsettingssimulator.h \ + $$OUT_PWD/daynightmode_adapter.h \ #generated dbus adapter + $$OUT_PWD/daynightmode_proxy.h \ #generated dbus proxy + $$OUT_PWD/popup_adapter.h \ #generated dbus adapter + $$OUT_PWD/popup_proxy.h \ #generated dbus proxy + $$OUT_PWD/inputevent_adapter.h \ #generated dbus adapter + $$OUT_PWD/inputevent_proxy.h \ #generated dbus proxy + $$OUT_PWD/statusbar_adapter.h \ #generated dbus adapter + $$OUT_PWD/statusbar_proxy.h \ #generated dbus proxy + src/settingswidget.h \ + src/popupwidget.h \ + src/inputeventdistributor.h \ + src/controlbarwidget.h \ + src/statusbarwidget.h + +FORMS += \ + resources/mainwindow.ui \ + resources/inputdevicesimulator.ui \ + resources/systemsettingssimulator.ui \ + resources/settingswidget.ui \ + resources/popupwidget.ui \ + resources/controlbarwidget.ui \ + resources/statusbarwidget.ui + +TRANSLATIONS = \ + resources/translations/homescreen_en_US.ts \ + resources/translations/homescreen_de_DE.ts \ + resources/translations/homescreen_ja_JP.ts + +OTHER_FILES += \ + dbus-introspections/daynightmode.xml \ + dbus-introspections/inputevent.xml \ + dbus-introspections/popup.xml \ + dbus-introspections/statusbar.xml + +RESOURCES += \ + resources/homescreen.qrc + +# remove generated files +QMAKE_CLEAN += -r \ + $$OUT_PWD/HomeScreen \ + $$OUT_PWD/Makefile \ + $$OUT_PWD/daynightmode_adapter.h \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_adapter.moc \ + $$OUT_PWD/daynightmode_proxy.h \ + $$OUT_PWD/daynightmode_proxy.cpp \ + $$OUT_PWD/daynightmode_proxy.moc \ + $$OUT_PWD/popup_adapter.h \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_adapter.moc \ + $$OUT_PWD/popup_proxy.h \ + $$OUT_PWD/popup_proxy.cpp \ + $$OUT_PWD/popup_proxy.moc \ + $$OUT_PWD/inputevent_adapter.h \ + $$OUT_PWD/inputevent_adapter.cpp \ + $$OUT_PWD/inputevent_adapter.moc \ + $$OUT_PWD/inputevent_proxy.h \ + $$OUT_PWD/inputevent_proxy.cpp \ + $$OUT_PWD/inputevent_proxy.moc \ + $$OUT_PWD/statusbar_adapter.h \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_adapter.moc \ + $$OUT_PWD/statusbar_proxy.h \ + $$OUT_PWD/statusbar_proxy.cpp \ + $$OUT_PWD/statusbar_proxy.moc + +# Create custom targets for generating dbus proxy and adapter +# for daynightmode +daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp +unix:daynightmodegenerateadapter.commands = "qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/dbus-introspections/daynightmode.xml; moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc" +daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp +unix:daynightmodegenerateproxy.commands = "qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/dbus-introspections/daynightmode.xml; moc $$OUT_PWD/daynightmode_proxy.h -o $$OUT_PWD/daynightmode_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/daynightmode_adapter.cpp \ + $$OUT_PWD/daynightmode_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + daynightmodegenerateadapter \ + daynightmodegenerateproxy +# for popup +popupgenerateadapter.target = $$OUT_PWD/popup_adapter.cpp +unix:popupgenerateadapter.commands = "qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/dbus-introspections/popup.xml; moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc" +popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp +unix:popupgenerateproxy.commands = "qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/dbus-introspections/popup.xml; moc $$OUT_PWD/popup_proxy.h -o $$OUT_PWD/popup_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/popup_adapter.cpp \ + $$OUT_PWD/popup_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + popupgenerateadapter \ + popupgenerateproxy +# for inputevent +inputeventgenerateadapter.target = $$OUT_PWD/inputevent_adapter.cpp +unix:inputeventgenerateadapter.commands = "qdbusxml2cpp -m -a inputevent_adapter $$_PRO_FILE_PWD_/dbus-introspections/inputevent.xml; moc $$OUT_PWD/inputevent_adapter.h -o $$OUT_PWD/inputevent_adapter.moc" +inputeventgenerateproxy.target = $$OUT_PWD/inputevent_proxy.cpp +unix:inputeventgenerateproxy.commands = "qdbusxml2cpp -m -p inputevent_proxy $$_PRO_FILE_PWD_/dbus-introspections/inputevent.xml; moc $$OUT_PWD/inputevent_proxy.h -o $$OUT_PWD/inputevent_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/inputevent_adapter.cpp \ + $$OUT_PWD/inputevent_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + inputeventgenerateadapter \ + inputeventgenerateproxy +# for statusbar +statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp +unix:statusbargenerateadapter.commands = "qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/dbus-introspections/statusbar.xml; moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc" +statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp +unix:statusbargenerateproxy.commands = "qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/dbus-introspections/statusbar.xml; moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc" +PRE_TARGETDEPS += \ + $$OUT_PWD/statusbar_adapter.cpp \ + $$OUT_PWD/statusbar_proxy.cpp +QMAKE_EXTRA_TARGETS += \ + statusbargenerateadapter \ + statusbargenerateproxy + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..31c692a --- /dev/null +++ b/LICENSE @@ -0,0 +1,54 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + You must give any other recipients of the Work or Derivative Works a copy of this License; and + You must cause any modified files to carry prominent notices stating that You changed the files; and + You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md new file mode 100644 index 0000000..b3845aa --- /dev/null +++ b/README.md @@ -0,0 +1,48 @@ +AGL Home Screen reference implementation + + +AGL repo for source code: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/staging/HomeScreen +AGL repo for bitbake recipe: +https://gerrit.automotivelinux.org/gerrit/#/admin/projects/AGL/meta-agl-demo +[...]/recipes-hmi/homescreen + + + +v0.0.1 +06/01/2016 + +#new features +- initial version +- first implementation of home screen +- fix HMI layout (will be configurable in the future) +- dBus as IPC (may change in the future) +- no interaction with application manager so far +- multi-lanuage support +- day/night mode support +- initial status bar implementation (interface will be enhanced in the future) +- initial control bar implementation +- MPLv2.0 license +- input device simulator for developer build (not functional right now) +- system settings simulator for developer build (day/night mode switch functional right now) +- using QSettings for local app setting storage (may change in the future) +- first popup implementation (single popup support for now; multiple popup not defined; interface will change) +- only one instance of the app allowed + +#TODOs +- many settings have to be read from the system somewhere during app startup. This is not available right now +- interaction with application manager +- interaction with wayland compositor +- define and implement input device event handler +- replace my HMI design with the official AGL design (graphics/icons...) +- implement example HMI layouts +- rename dBus objects (internal/external) +- fix font issues on target +- more documentation ;) +- add animations +- much more... + +Thanks to Umar Irshad for his free iconset available here: +https://dribbble.com/shots/1569128-Freebie-48-Bubbles-Iconset + + diff --git a/dbus-introspections/daynightmode.xml b/dbus-introspections/daynightmode.xml new file mode 100644 index 0000000..b88f0ca --- /dev/null +++ b/dbus-introspections/daynightmode.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + diff --git a/dbus-introspections/inputevent.xml b/dbus-introspections/inputevent.xml new file mode 100644 index 0000000..4d8dfc5 --- /dev/null +++ b/dbus-introspections/inputevent.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/dbus-introspections/popup.xml b/dbus-introspections/popup.xml new file mode 100644 index 0000000..0ec8db3 --- /dev/null +++ b/dbus-introspections/popup.xml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/dbus-introspections/statusbar.xml b/dbus-introspections/statusbar.xml new file mode 100644 index 0000000..fcfe939 --- /dev/null +++ b/dbus-introspections/statusbar.xml @@ -0,0 +1,22 @@ + + + + + + + + + + diff --git a/include/daynightmode.h b/include/daynightmode.h new file mode 100644 index 0000000..bf16f29 --- /dev/null +++ b/include/daynightmode.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DAYNIGHTMODE_H +#define DAYNIGHTMODE_H + +namespace SystemDayNight { + typedef enum DayNightMode + { + DAYNIGHTMODE_UNDEFINED, + DAYNIGHTMODE_DAY, + DAYNIGHTMODE_NIGHT + } eDayNightMode; +} + +#endif // DAYNIGHTMODE_H diff --git a/include/inputevent.h b/include/inputevent.h new file mode 100644 index 0000000..730ac57 --- /dev/null +++ b/include/inputevent.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INPUTEVENT_H +#define INPUTEVENT_H + +namespace SystemInputEvent +{ + typedef enum InputEventType + { + INPUTEVENTTYPE_UNDEFINED, + INPUTEVENTTYPE_KEY_PRESSED + } eInputEventType; + + typedef enum InputEventZone + { + INPUTEVENTZONE_UNDEFINED, + INPUTEVENTZONE_1, + INPUTEVENTZONE_2 + } eInputEventZone; +} + +#endif // INPUTEVENT_H diff --git a/include/popup.h b/include/popup.h new file mode 100644 index 0000000..1b92333 --- /dev/null +++ b/include/popup.h @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POPUP_H +#define POPUP_H + +namespace SystemPopup { + typedef enum PopupType + { + POPUPTYPE_UNDEFINED, + POPUPTYPE_INFO, + POPUPTYPE_WARNING, + POPUPTYPE_ERROR + } ePopupType; +} + +#endif // POPUP_H + diff --git a/resources/controlbarwidget.ui b/resources/controlbarwidget.ui new file mode 100644 index 0000000..bcbe95c --- /dev/null +++ b/resources/controlbarwidget.ui @@ -0,0 +1,94 @@ + + + ControlBarWidget + + + + 0 + 0 + 800 + 60 + + + + Form + + + + + 0 + 0 + 800 + 60 + + + + background-image: url(:/images/backgrounds/bg_green_day.png); + + + + + 10 + 10 + 40 + 40 + + + + Qt::NoFocus + + + background-image: url(:/images/transparency.png); +border-image: url(:/images/transparency.png); + + + + + + + :/icons/home_day.png:/icons/home_day.png + + + + 40 + 40 + + + + + + + 380 + 10 + 40 + 40 + + + + Qt::NoFocus + + + background-image: url(:/images/transparency.png); +border-image: url(:/images/transparency.png); + + + + + + + :/icons/settings_day.png:/icons/settings_day.png + + + + 40 + 40 + + + + + + + + + + diff --git a/resources/homescreen.qrc b/resources/homescreen.qrc new file mode 100644 index 0000000..0a8ee15 --- /dev/null +++ b/resources/homescreen.qrc @@ -0,0 +1,18 @@ + + + images/transparency.png + images/backgrounds/bg_stripes_day.png + images/backgrounds/bg_stripes_night.png + images/backgrounds/bg_blue_day.png + images/backgrounds/bg_blue_night.png + images/backgrounds/bg_green_day.png + images/backgrounds/bg_green_night.png + images/icons/White/01.Home.png + images/icons/Black/01.Home.png + images/icons/White/45.Settings.png + images/icons/Black/45.Settings.png + translations/homescreen_de_DE.qm + translations/homescreen_en_US.qm + translations/homescreen_ja_JP.qm + + diff --git a/resources/images/backgrounds/bg_blue_day.png b/resources/images/backgrounds/bg_blue_day.png new file mode 100755 index 0000000..1cbe79a Binary files /dev/null and b/resources/images/backgrounds/bg_blue_day.png differ diff --git a/resources/images/backgrounds/bg_blue_night.png b/resources/images/backgrounds/bg_blue_night.png new file mode 100755 index 0000000..bd3f1e9 Binary files /dev/null and b/resources/images/backgrounds/bg_blue_night.png differ diff --git a/resources/images/backgrounds/bg_green_day.png b/resources/images/backgrounds/bg_green_day.png new file mode 100755 index 0000000..9549399 Binary files /dev/null and b/resources/images/backgrounds/bg_green_day.png differ diff --git a/resources/images/backgrounds/bg_green_night.png b/resources/images/backgrounds/bg_green_night.png new file mode 100755 index 0000000..0377283 Binary files /dev/null and b/resources/images/backgrounds/bg_green_night.png differ diff --git a/resources/images/backgrounds/bg_stripes_day.png b/resources/images/backgrounds/bg_stripes_day.png new file mode 100755 index 0000000..a9978bb Binary files /dev/null and b/resources/images/backgrounds/bg_stripes_day.png differ diff --git a/resources/images/backgrounds/bg_stripes_night.png b/resources/images/backgrounds/bg_stripes_night.png new file mode 100755 index 0000000..1ba1c39 Binary files /dev/null and b/resources/images/backgrounds/bg_stripes_night.png differ diff --git a/resources/images/icons/Black/01.Home.png b/resources/images/icons/Black/01.Home.png new file mode 100644 index 0000000..08323c8 Binary files /dev/null and b/resources/images/icons/Black/01.Home.png differ diff --git a/resources/images/icons/Black/02.Shop.png b/resources/images/icons/Black/02.Shop.png new file mode 100644 index 0000000..c50ae45 Binary files /dev/null and b/resources/images/icons/Black/02.Shop.png differ diff --git a/resources/images/icons/Black/03.Office.png b/resources/images/icons/Black/03.Office.png new file mode 100644 index 0000000..6e74c74 Binary files /dev/null and b/resources/images/icons/Black/03.Office.png differ diff --git a/resources/images/icons/Black/04.Bank.png b/resources/images/icons/Black/04.Bank.png new file mode 100644 index 0000000..07a724d Binary files /dev/null and b/resources/images/icons/Black/04.Bank.png differ diff --git a/resources/images/icons/Black/05.Tag.png b/resources/images/icons/Black/05.Tag.png new file mode 100644 index 0000000..5d09027 Binary files /dev/null and b/resources/images/icons/Black/05.Tag.png differ diff --git a/resources/images/icons/Black/06.Tags.png b/resources/images/icons/Black/06.Tags.png new file mode 100644 index 0000000..6d85dde Binary files /dev/null and b/resources/images/icons/Black/06.Tags.png differ diff --git a/resources/images/icons/Black/07.Wallet.png b/resources/images/icons/Black/07.Wallet.png new file mode 100644 index 0000000..7c3be7f Binary files /dev/null and b/resources/images/icons/Black/07.Wallet.png differ diff --git a/resources/images/icons/Black/08.Credit-Card.png b/resources/images/icons/Black/08.Credit-Card.png new file mode 100644 index 0000000..690fb65 Binary files /dev/null and b/resources/images/icons/Black/08.Credit-Card.png differ diff --git a/resources/images/icons/Black/09.Handbag.png b/resources/images/icons/Black/09.Handbag.png new file mode 100644 index 0000000..d12348d Binary files /dev/null and b/resources/images/icons/Black/09.Handbag.png differ diff --git a/resources/images/icons/Black/10.Folder.png b/resources/images/icons/Black/10.Folder.png new file mode 100644 index 0000000..eeb9a05 Binary files /dev/null and b/resources/images/icons/Black/10.Folder.png differ diff --git a/resources/images/icons/Black/11.Notebook.png b/resources/images/icons/Black/11.Notebook.png new file mode 100644 index 0000000..eb8bd67 Binary files /dev/null and b/resources/images/icons/Black/11.Notebook.png differ diff --git a/resources/images/icons/Black/12.File.png b/resources/images/icons/Black/12.File.png new file mode 100644 index 0000000..6e2bd02 Binary files /dev/null and b/resources/images/icons/Black/12.File.png differ diff --git a/resources/images/icons/Black/13.Clipboard.png b/resources/images/icons/Black/13.Clipboard.png new file mode 100644 index 0000000..d1c6816 Binary files /dev/null and b/resources/images/icons/Black/13.Clipboard.png differ diff --git a/resources/images/icons/Black/14.News.png b/resources/images/icons/Black/14.News.png new file mode 100644 index 0000000..f5689c8 Binary files /dev/null and b/resources/images/icons/Black/14.News.png differ diff --git a/resources/images/icons/Black/15.Pencil.png b/resources/images/icons/Black/15.Pencil.png new file mode 100644 index 0000000..d9cbca9 Binary files /dev/null and b/resources/images/icons/Black/15.Pencil.png differ diff --git a/resources/images/icons/Black/16.Pen.png b/resources/images/icons/Black/16.Pen.png new file mode 100644 index 0000000..ce6e2e2 Binary files /dev/null and b/resources/images/icons/Black/16.Pen.png differ diff --git a/resources/images/icons/Black/17.Brush.png b/resources/images/icons/Black/17.Brush.png new file mode 100644 index 0000000..ca9b131 Binary files /dev/null and b/resources/images/icons/Black/17.Brush.png differ diff --git a/resources/images/icons/Black/18.Pictures-Day.png b/resources/images/icons/Black/18.Pictures-Day.png new file mode 100644 index 0000000..75cee68 Binary files /dev/null and b/resources/images/icons/Black/18.Pictures-Day.png differ diff --git a/resources/images/icons/Black/19.Pictures-Night.png b/resources/images/icons/Black/19.Pictures-Night.png new file mode 100644 index 0000000..532e5b3 Binary files /dev/null and b/resources/images/icons/Black/19.Pictures-Night.png differ diff --git a/resources/images/icons/Black/20.Photos.png b/resources/images/icons/Black/20.Photos.png new file mode 100644 index 0000000..c9f5fce Binary files /dev/null and b/resources/images/icons/Black/20.Photos.png differ diff --git a/resources/images/icons/Black/21.Music.png b/resources/images/icons/Black/21.Music.png new file mode 100644 index 0000000..4cab482 Binary files /dev/null and b/resources/images/icons/Black/21.Music.png differ diff --git a/resources/images/icons/Black/22.Music-Playlist.png b/resources/images/icons/Black/22.Music-Playlist.png new file mode 100644 index 0000000..9b7a05d Binary files /dev/null and b/resources/images/icons/Black/22.Music-Playlist.png differ diff --git a/resources/images/icons/Black/23.Videos.png b/resources/images/icons/Black/23.Videos.png new file mode 100644 index 0000000..04b6575 Binary files /dev/null and b/resources/images/icons/Black/23.Videos.png differ diff --git a/resources/images/icons/Black/24.TV.png b/resources/images/icons/Black/24.TV.png new file mode 100644 index 0000000..188bf42 Binary files /dev/null and b/resources/images/icons/Black/24.TV.png differ diff --git a/resources/images/icons/Black/25.Camera-Front.png b/resources/images/icons/Black/25.Camera-Front.png new file mode 100644 index 0000000..0b32a56 Binary files /dev/null and b/resources/images/icons/Black/25.Camera-Front.png differ diff --git a/resources/images/icons/Black/26.Camera-Back.png b/resources/images/icons/Black/26.Camera-Back.png new file mode 100644 index 0000000..b6e6935 Binary files /dev/null and b/resources/images/icons/Black/26.Camera-Back.png differ diff --git a/resources/images/icons/Black/27.Phone.png b/resources/images/icons/Black/27.Phone.png new file mode 100644 index 0000000..afd67de Binary files /dev/null and b/resources/images/icons/Black/27.Phone.png differ diff --git a/resources/images/icons/Black/28.Tablet.png b/resources/images/icons/Black/28.Tablet.png new file mode 100644 index 0000000..6806fba Binary files /dev/null and b/resources/images/icons/Black/28.Tablet.png differ diff --git a/resources/images/icons/Black/29.Mac.png b/resources/images/icons/Black/29.Mac.png new file mode 100644 index 0000000..35125f1 Binary files /dev/null and b/resources/images/icons/Black/29.Mac.png differ diff --git a/resources/images/icons/Black/30.User.png b/resources/images/icons/Black/30.User.png new file mode 100644 index 0000000..ca34e59 Binary files /dev/null and b/resources/images/icons/Black/30.User.png differ diff --git a/resources/images/icons/Black/31.ID-Horizontal.png b/resources/images/icons/Black/31.ID-Horizontal.png new file mode 100644 index 0000000..ac20dc8 Binary files /dev/null and b/resources/images/icons/Black/31.ID-Horizontal.png differ diff --git a/resources/images/icons/Black/32.ID-Vertical.png b/resources/images/icons/Black/32.ID-Vertical.png new file mode 100644 index 0000000..88c9787 Binary files /dev/null and b/resources/images/icons/Black/32.ID-Vertical.png differ diff --git a/resources/images/icons/Black/33.Thumbs-Up.png b/resources/images/icons/Black/33.Thumbs-Up.png new file mode 100644 index 0000000..06e5c0d Binary files /dev/null and b/resources/images/icons/Black/33.Thumbs-Up.png differ diff --git a/resources/images/icons/Black/34.Thumbs-Down.png b/resources/images/icons/Black/34.Thumbs-Down.png new file mode 100644 index 0000000..c37a621 Binary files /dev/null and b/resources/images/icons/Black/34.Thumbs-Down.png differ diff --git a/resources/images/icons/Black/35.Alarm-Clock.png b/resources/images/icons/Black/35.Alarm-Clock.png new file mode 100644 index 0000000..12de647 Binary files /dev/null and b/resources/images/icons/Black/35.Alarm-Clock.png differ diff --git a/resources/images/icons/Black/36.Watch.png b/resources/images/icons/Black/36.Watch.png new file mode 100644 index 0000000..dec17c4 Binary files /dev/null and b/resources/images/icons/Black/36.Watch.png differ diff --git a/resources/images/icons/Black/37.Stopwatch.png b/resources/images/icons/Black/37.Stopwatch.png new file mode 100644 index 0000000..0671df9 Binary files /dev/null and b/resources/images/icons/Black/37.Stopwatch.png differ diff --git a/resources/images/icons/Black/38.Location-Pin.png b/resources/images/icons/Black/38.Location-Pin.png new file mode 100644 index 0000000..d8ea41f Binary files /dev/null and b/resources/images/icons/Black/38.Location-Pin.png differ diff --git a/resources/images/icons/Black/39.Heart.png b/resources/images/icons/Black/39.Heart.png new file mode 100644 index 0000000..f25ac7e Binary files /dev/null and b/resources/images/icons/Black/39.Heart.png differ diff --git a/resources/images/icons/Black/40.Cloud.png b/resources/images/icons/Black/40.Cloud.png new file mode 100644 index 0000000..5772739 Binary files /dev/null and b/resources/images/icons/Black/40.Cloud.png differ diff --git a/resources/images/icons/Black/41.Trophy.png b/resources/images/icons/Black/41.Trophy.png new file mode 100644 index 0000000..c78fb34 Binary files /dev/null and b/resources/images/icons/Black/41.Trophy.png differ diff --git a/resources/images/icons/Black/42.Badge.png b/resources/images/icons/Black/42.Badge.png new file mode 100644 index 0000000..dfbc6ed Binary files /dev/null and b/resources/images/icons/Black/42.Badge.png differ diff --git a/resources/images/icons/Black/43.Bell.png b/resources/images/icons/Black/43.Bell.png new file mode 100644 index 0000000..1ddcb40 Binary files /dev/null and b/resources/images/icons/Black/43.Bell.png differ diff --git a/resources/images/icons/Black/44.Share.png b/resources/images/icons/Black/44.Share.png new file mode 100644 index 0000000..08b710f Binary files /dev/null and b/resources/images/icons/Black/44.Share.png differ diff --git a/resources/images/icons/Black/45.Settings.png b/resources/images/icons/Black/45.Settings.png new file mode 100644 index 0000000..2487c4f Binary files /dev/null and b/resources/images/icons/Black/45.Settings.png differ diff --git a/resources/images/icons/Black/46.Calender.png b/resources/images/icons/Black/46.Calender.png new file mode 100644 index 0000000..255cd76 Binary files /dev/null and b/resources/images/icons/Black/46.Calender.png differ diff --git a/resources/images/icons/Black/47.Explore.png b/resources/images/icons/Black/47.Explore.png new file mode 100644 index 0000000..202f710 Binary files /dev/null and b/resources/images/icons/Black/47.Explore.png differ diff --git a/resources/images/icons/Black/48.Dashboard.png b/resources/images/icons/Black/48.Dashboard.png new file mode 100644 index 0000000..3deb0a0 Binary files /dev/null and b/resources/images/icons/Black/48.Dashboard.png differ diff --git a/resources/images/icons/White/01.Home.png b/resources/images/icons/White/01.Home.png new file mode 100644 index 0000000..0aca105 Binary files /dev/null and b/resources/images/icons/White/01.Home.png differ diff --git a/resources/images/icons/White/02.Shop.png b/resources/images/icons/White/02.Shop.png new file mode 100644 index 0000000..21a33e3 Binary files /dev/null and b/resources/images/icons/White/02.Shop.png differ diff --git a/resources/images/icons/White/03.Office.png b/resources/images/icons/White/03.Office.png new file mode 100644 index 0000000..105b516 Binary files /dev/null and b/resources/images/icons/White/03.Office.png differ diff --git a/resources/images/icons/White/04.Bank.png b/resources/images/icons/White/04.Bank.png new file mode 100644 index 0000000..22d1bce Binary files /dev/null and b/resources/images/icons/White/04.Bank.png differ diff --git a/resources/images/icons/White/05.Tag.png b/resources/images/icons/White/05.Tag.png new file mode 100644 index 0000000..a5d7e10 Binary files /dev/null and b/resources/images/icons/White/05.Tag.png differ diff --git a/resources/images/icons/White/06.Tags.png b/resources/images/icons/White/06.Tags.png new file mode 100644 index 0000000..d2dc4ff Binary files /dev/null and b/resources/images/icons/White/06.Tags.png differ diff --git a/resources/images/icons/White/07.Wallet.png b/resources/images/icons/White/07.Wallet.png new file mode 100644 index 0000000..b713ae0 Binary files /dev/null and b/resources/images/icons/White/07.Wallet.png differ diff --git a/resources/images/icons/White/08.Credit-Card.png b/resources/images/icons/White/08.Credit-Card.png new file mode 100644 index 0000000..bb1499f Binary files /dev/null and b/resources/images/icons/White/08.Credit-Card.png differ diff --git a/resources/images/icons/White/09.Handbag.png b/resources/images/icons/White/09.Handbag.png new file mode 100644 index 0000000..4ff1b39 Binary files /dev/null and b/resources/images/icons/White/09.Handbag.png differ diff --git a/resources/images/icons/White/10.Folder.png b/resources/images/icons/White/10.Folder.png new file mode 100644 index 0000000..aa238d5 Binary files /dev/null and b/resources/images/icons/White/10.Folder.png differ diff --git a/resources/images/icons/White/11.Notebook.png b/resources/images/icons/White/11.Notebook.png new file mode 100644 index 0000000..f306b7f Binary files /dev/null and b/resources/images/icons/White/11.Notebook.png differ diff --git a/resources/images/icons/White/12.File.png b/resources/images/icons/White/12.File.png new file mode 100644 index 0000000..711af78 Binary files /dev/null and b/resources/images/icons/White/12.File.png differ diff --git a/resources/images/icons/White/13.Clipboard.png b/resources/images/icons/White/13.Clipboard.png new file mode 100644 index 0000000..83c6af5 Binary files /dev/null and b/resources/images/icons/White/13.Clipboard.png differ diff --git a/resources/images/icons/White/14.News.png b/resources/images/icons/White/14.News.png new file mode 100644 index 0000000..0e884c2 Binary files /dev/null and b/resources/images/icons/White/14.News.png differ diff --git a/resources/images/icons/White/15.Pencil.png b/resources/images/icons/White/15.Pencil.png new file mode 100644 index 0000000..b260f5b Binary files /dev/null and b/resources/images/icons/White/15.Pencil.png differ diff --git a/resources/images/icons/White/16.Pen.png b/resources/images/icons/White/16.Pen.png new file mode 100644 index 0000000..0447477 Binary files /dev/null and b/resources/images/icons/White/16.Pen.png differ diff --git a/resources/images/icons/White/17.Brush.png b/resources/images/icons/White/17.Brush.png new file mode 100644 index 0000000..222c1c2 Binary files /dev/null and b/resources/images/icons/White/17.Brush.png differ diff --git a/resources/images/icons/White/18.Pictures-Day.png b/resources/images/icons/White/18.Pictures-Day.png new file mode 100644 index 0000000..fabf402 Binary files /dev/null and b/resources/images/icons/White/18.Pictures-Day.png differ diff --git a/resources/images/icons/White/19.Pictures-Night.png b/resources/images/icons/White/19.Pictures-Night.png new file mode 100644 index 0000000..32850a8 Binary files /dev/null and b/resources/images/icons/White/19.Pictures-Night.png differ diff --git a/resources/images/icons/White/20.Photos.png b/resources/images/icons/White/20.Photos.png new file mode 100644 index 0000000..7799b55 Binary files /dev/null and b/resources/images/icons/White/20.Photos.png differ diff --git a/resources/images/icons/White/21.Music.png b/resources/images/icons/White/21.Music.png new file mode 100644 index 0000000..7ddeead Binary files /dev/null and b/resources/images/icons/White/21.Music.png differ diff --git a/resources/images/icons/White/22.Music-Playlist.png b/resources/images/icons/White/22.Music-Playlist.png new file mode 100644 index 0000000..3bde110 Binary files /dev/null and b/resources/images/icons/White/22.Music-Playlist.png differ diff --git a/resources/images/icons/White/23.Videos.png b/resources/images/icons/White/23.Videos.png new file mode 100644 index 0000000..e508572 Binary files /dev/null and b/resources/images/icons/White/23.Videos.png differ diff --git a/resources/images/icons/White/24.TV.png b/resources/images/icons/White/24.TV.png new file mode 100644 index 0000000..6677e66 Binary files /dev/null and b/resources/images/icons/White/24.TV.png differ diff --git a/resources/images/icons/White/25.Camera-Front.png b/resources/images/icons/White/25.Camera-Front.png new file mode 100644 index 0000000..4df0878 Binary files /dev/null and b/resources/images/icons/White/25.Camera-Front.png differ diff --git a/resources/images/icons/White/26.Camera-Back.png b/resources/images/icons/White/26.Camera-Back.png new file mode 100644 index 0000000..dbf46d7 Binary files /dev/null and b/resources/images/icons/White/26.Camera-Back.png differ diff --git a/resources/images/icons/White/27.Phone.png b/resources/images/icons/White/27.Phone.png new file mode 100644 index 0000000..8590412 Binary files /dev/null and b/resources/images/icons/White/27.Phone.png differ diff --git a/resources/images/icons/White/28.Tablet.png b/resources/images/icons/White/28.Tablet.png new file mode 100644 index 0000000..f29fb36 Binary files /dev/null and b/resources/images/icons/White/28.Tablet.png differ diff --git a/resources/images/icons/White/29.Mac.png b/resources/images/icons/White/29.Mac.png new file mode 100644 index 0000000..1916a6e Binary files /dev/null and b/resources/images/icons/White/29.Mac.png differ diff --git a/resources/images/icons/White/30.User.png b/resources/images/icons/White/30.User.png new file mode 100644 index 0000000..9e4a17f Binary files /dev/null and b/resources/images/icons/White/30.User.png differ diff --git a/resources/images/icons/White/31.ID-Horizontal.png b/resources/images/icons/White/31.ID-Horizontal.png new file mode 100644 index 0000000..36b5593 Binary files /dev/null and b/resources/images/icons/White/31.ID-Horizontal.png differ diff --git a/resources/images/icons/White/32.ID-Vertical.png b/resources/images/icons/White/32.ID-Vertical.png new file mode 100644 index 0000000..7a9dcea Binary files /dev/null and b/resources/images/icons/White/32.ID-Vertical.png differ diff --git a/resources/images/icons/White/33.Thumbs-Up.png b/resources/images/icons/White/33.Thumbs-Up.png new file mode 100644 index 0000000..8e7a559 Binary files /dev/null and b/resources/images/icons/White/33.Thumbs-Up.png differ diff --git a/resources/images/icons/White/34.Thumbs-Down.png b/resources/images/icons/White/34.Thumbs-Down.png new file mode 100644 index 0000000..a41d54a Binary files /dev/null and b/resources/images/icons/White/34.Thumbs-Down.png differ diff --git a/resources/images/icons/White/35.Alarm-Clock.png b/resources/images/icons/White/35.Alarm-Clock.png new file mode 100644 index 0000000..1459802 Binary files /dev/null and b/resources/images/icons/White/35.Alarm-Clock.png differ diff --git a/resources/images/icons/White/36.Watch.png b/resources/images/icons/White/36.Watch.png new file mode 100644 index 0000000..bf8bcfa Binary files /dev/null and b/resources/images/icons/White/36.Watch.png differ diff --git a/resources/images/icons/White/37.Stopwatch.png b/resources/images/icons/White/37.Stopwatch.png new file mode 100644 index 0000000..b94c702 Binary files /dev/null and b/resources/images/icons/White/37.Stopwatch.png differ diff --git a/resources/images/icons/White/38.Location-Pin.png b/resources/images/icons/White/38.Location-Pin.png new file mode 100644 index 0000000..b9817a3 Binary files /dev/null and b/resources/images/icons/White/38.Location-Pin.png differ diff --git a/resources/images/icons/White/39.Heart.png b/resources/images/icons/White/39.Heart.png new file mode 100644 index 0000000..512a9d5 Binary files /dev/null and b/resources/images/icons/White/39.Heart.png differ diff --git a/resources/images/icons/White/40.Cloud.png b/resources/images/icons/White/40.Cloud.png new file mode 100644 index 0000000..bcfecf0 Binary files /dev/null and b/resources/images/icons/White/40.Cloud.png differ diff --git a/resources/images/icons/White/41.Trophy.png b/resources/images/icons/White/41.Trophy.png new file mode 100644 index 0000000..2f3fb3a Binary files /dev/null and b/resources/images/icons/White/41.Trophy.png differ diff --git a/resources/images/icons/White/42.Badge.png b/resources/images/icons/White/42.Badge.png new file mode 100644 index 0000000..2140235 Binary files /dev/null and b/resources/images/icons/White/42.Badge.png differ diff --git a/resources/images/icons/White/43.Bell.png b/resources/images/icons/White/43.Bell.png new file mode 100644 index 0000000..cad88a2 Binary files /dev/null and b/resources/images/icons/White/43.Bell.png differ diff --git a/resources/images/icons/White/44.Share.png b/resources/images/icons/White/44.Share.png new file mode 100644 index 0000000..4b7bd14 Binary files /dev/null and b/resources/images/icons/White/44.Share.png differ diff --git a/resources/images/icons/White/45.Settings.png b/resources/images/icons/White/45.Settings.png new file mode 100644 index 0000000..7a2b809 Binary files /dev/null and b/resources/images/icons/White/45.Settings.png differ diff --git a/resources/images/icons/White/46.Calender.png b/resources/images/icons/White/46.Calender.png new file mode 100644 index 0000000..737bf0d Binary files /dev/null and b/resources/images/icons/White/46.Calender.png differ diff --git a/resources/images/icons/White/47.Explore.png b/resources/images/icons/White/47.Explore.png new file mode 100644 index 0000000..83ac058 Binary files /dev/null and b/resources/images/icons/White/47.Explore.png differ diff --git a/resources/images/icons/White/48.Dashboard.png b/resources/images/icons/White/48.Dashboard.png new file mode 100644 index 0000000..3f9cef5 Binary files /dev/null and b/resources/images/icons/White/48.Dashboard.png differ diff --git a/resources/images/transparency.png b/resources/images/transparency.png new file mode 100644 index 0000000..989d3c5 Binary files /dev/null and b/resources/images/transparency.png differ diff --git a/resources/inputdevicesimulator.ui b/resources/inputdevicesimulator.ui new file mode 100644 index 0000000..eb8d006 --- /dev/null +++ b/resources/inputdevicesimulator.ui @@ -0,0 +1,163 @@ + + + InputDeviceSimulator + + + + 0 + 0 + 300 + 600 + + + + + 300 + 600 + + + + + 300 + 600 + + + + Qt::NoFocus + + + Input Device Simulator + + + + false + + + + 110 + 60 + 71 + 71 + + + + Qt::NoFocus + + + Up + + + + + false + + + + 30 + 140 + 71 + 71 + + + + Qt::NoFocus + + + Left + + + + + false + + + + 190 + 140 + 71 + 71 + + + + Qt::NoFocus + + + Right + + + + + false + + + + 110 + 220 + 71 + 71 + + + + Qt::NoFocus + + + Down + + + + + false + + + + 110 + 140 + 71 + 71 + + + + Qt::NoFocus + + + OK + + + + + + 60 + 0 + 181 + 51 + + + + under development +not functional right now + + + + + false + + + + 30 + 220 + 71 + 71 + + + + Qt::NoFocus + + + Cancel/ +Back? + + + + + + diff --git a/resources/mainwindow.ui b/resources/mainwindow.ui new file mode 100644 index 0000000..69c5a08 --- /dev/null +++ b/resources/mainwindow.ui @@ -0,0 +1,187 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + Qt::NoFocus + + + + + + + + + + + + 0 + 60 + 800 + 480 + + + + Qt::NoFocus + + + background-image: url(:/images/backgrounds/bg_blue_day.png) + + + + + + -40 + 320 + 200 + 200 + + + + border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch; + + + + + + + 40 + 40 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 230 + 40 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 430 + 40 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 620 + 40 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 620 + 250 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 440 + 250 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 40 + 250 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + 240 + 250 + 150 + 150 + + + + Qt::NoFocus + + + App 1 (dummy entry!) + + + + + + + + + diff --git a/resources/popupwidget.ui b/resources/popupwidget.ui new file mode 100644 index 0000000..ac43e09 --- /dev/null +++ b/resources/popupwidget.ui @@ -0,0 +1,91 @@ + + + PopupWidget + + + Qt::WindowModal + + + + 0 + 0 + 800 + 600 + + + + Form + + + + + 200 + 200 + 400 + 200 + + + + QWidget { +border: 1px solid #D3D3D3; +border-radius: 8px; +background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); +color: #333; +padding: 0px; +} +QWidget:on { +background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); +} + + + + + + 150 + 130 + 100 + 50 + + + + + 16777211 + 16777215 + + + + Qt::NoFocus + + + OK + + + + + + 10 + 10 + 380 + 100 + + + + background-color: rgba(109, 109, 109, 0); +background-image: url(:/images/transparency.png); +border-image: url(:/images/transparency.png); + + + + + + Qt::AlignCenter + + + true + + + + + + + diff --git a/resources/settingswidget.ui b/resources/settingswidget.ui new file mode 100644 index 0000000..2f33087 --- /dev/null +++ b/resources/settingswidget.ui @@ -0,0 +1,102 @@ + + + SettingsWidget + + + + 0 + 0 + 800 + 480 + + + + Form + + + + + 0 + 0 + 800 + 480 + + + + background-image: url(:/images/backgrounds/bg_blue_day.png); + + + + + + + 390 + 20 + 400 + 60 + + + + + 22 + + + + Qt::NoFocus + + + QComboBox { +border: 1px solid #D3D3D3; +border-radius: 8px; +background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); +color: #333; +padding: 0px; +} +QComboBox:on { +background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); +} +QComboBox::drop-down { +border: 0px solid; +border-radius: 0px; +} +QComboBox::down-arrow:on { +} + + + + + + + 20 + 20 + 300 + 60 + + + + + 22 + + + + Language + + + + + + -40 + 320 + 200 + 200 + + + + border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch; + + + + + + + diff --git a/resources/statusbarwidget.ui b/resources/statusbarwidget.ui new file mode 100644 index 0000000..1a9ff41 --- /dev/null +++ b/resources/statusbarwidget.ui @@ -0,0 +1,203 @@ + + + StatusBarWidget + + + + 0 + 0 + 800 + 60 + + + + + + + + + + + + 0 + 0 + 800 + 60 + + + + background-image: url(:/images/backgrounds/bg_stripes_day.png); + + + + + 20 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 130 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 240 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 350 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 460 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 570 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + 680 + 10 + 100 + 40 + + + + + 12 + 75 + true + + + + color: rgb(238, 238, 238); +background-image: url(:/images/transparency.png); + + + Qt::AlignCenter + + + + + + + diff --git a/resources/systemsettingssimulator.ui b/resources/systemsettingssimulator.ui new file mode 100644 index 0000000..c4f72cc --- /dev/null +++ b/resources/systemsettingssimulator.ui @@ -0,0 +1,83 @@ + + + SystemSettingsSimulator + + + + 0 + 0 + 400 + 300 + + + + System Settings + + + + + 290 + 260 + 99 + 27 + + + + Qt::NoFocus + + + Exit + + + + + + 20 + 20 + 161 + 91 + + + + Day/Night Mode + + + + + 10 + 50 + 117 + 22 + + + + Qt::NoFocus + + + Night Mode + + + + + + 10 + 30 + 117 + 22 + + + + Qt::NoFocus + + + Day Mode + + + true + + + + + + + diff --git a/resources/translations/homescreen_de_DE.qm b/resources/translations/homescreen_de_DE.qm new file mode 100644 index 0000000..3a9c77f Binary files /dev/null and b/resources/translations/homescreen_de_DE.qm differ diff --git a/resources/translations/homescreen_de_DE.ts b/resources/translations/homescreen_de_DE.ts new file mode 100644 index 0000000..19af3d1 --- /dev/null +++ b/resources/translations/homescreen_de_DE.ts @@ -0,0 +1,90 @@ + + + + + InputDeviceSimulator + + + Input Device Simulator + + + + + Up + + + + + Left + + + + + Right + + + + + Down + + + + + OK + + + + + MainWindow + + Exit + Beenden + + + + 00:00 + + + + + SettingsWidget + + + Form + + + + + Language + Sprache + + + + SystemSettingsSimulator + + + System Settings + + + + + Exit + Beenden + + + + Day/Night Mode + + + + + Night Mode + + + + + Day Mode + + + + diff --git a/resources/translations/homescreen_en_US.qm b/resources/translations/homescreen_en_US.qm new file mode 100644 index 0000000..c77ee40 Binary files /dev/null and b/resources/translations/homescreen_en_US.qm differ diff --git a/resources/translations/homescreen_en_US.ts b/resources/translations/homescreen_en_US.ts new file mode 100644 index 0000000..ca6d32e --- /dev/null +++ b/resources/translations/homescreen_en_US.ts @@ -0,0 +1,90 @@ + + + + + InputDeviceSimulator + + + Input Device Simulator + + + + + Up + + + + + Left + + + + + Right + + + + + Down + + + + + OK + + + + + MainWindow + + Exit + Exit + + + + 00:00 + + + + + SettingsWidget + + + Form + + + + + Language + Language + + + + SystemSettingsSimulator + + + System Settings + + + + + Exit + Exit + + + + Day/Night Mode + + + + + Night Mode + + + + + Day Mode + + + + diff --git a/resources/translations/homescreen_ja_JP.qm b/resources/translations/homescreen_ja_JP.qm new file mode 100644 index 0000000..8d336bc Binary files /dev/null and b/resources/translations/homescreen_ja_JP.qm differ diff --git a/resources/translations/homescreen_ja_JP.ts b/resources/translations/homescreen_ja_JP.ts new file mode 100644 index 0000000..5a43233 --- /dev/null +++ b/resources/translations/homescreen_ja_JP.ts @@ -0,0 +1,86 @@ + + + + + InputDeviceSimulator + + + Input Device Simulator + 入力デバイスシミュレータ + + + + Up + アップ + + + + Left + 左 + + + + Right + 右 + + + + Down + ダウン + + + + OK + OK + + + + MainWindow + + + 00:00 + + + + + SettingsWidget + + + Form + + + + + Language + 言語 + + + + SystemSettingsSimulator + + + System Settings + システム設定 + + + + Exit + 出口 + + + + Day/Night Mode + 昼/夜モード + + + + Night Mode + ナイトモード + + + + Day Mode + デイモード + + + diff --git a/src/controlbarwidget.cpp b/src/controlbarwidget.cpp new file mode 100644 index 0000000..4627a7b --- /dev/null +++ b/src/controlbarwidget.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "controlbarwidget.h" +#include "ui_controlbarwidget.h" + +ControlBarWidget::ControlBarWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::ControlBarWidget), + mp_settingsWidget(0), + mp_dBusDayNightMode_SettingsWidget(0), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_daynightmodeAdaptor(0) +{ + // publish dbus day night mode interface + mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/ControlBarWidget", this); + dbus.registerService("org.agl.mainwindow"); + + mp_ui->setupUi(this); +} + +ControlBarWidget::~ControlBarWidget() +{ + delete mp_daynightmodeAdaptor; + if (0 != mp_settingsWidget) + { + delete mp_settingsWidget; + } + if (0 == mp_dBusDayNightMode_SettingsWidget) + { + delete mp_dBusDayNightMode_SettingsWidget; + } + delete mp_ui; +} + +void ControlBarWidget::setDayNightMode(int mode) +{ + QIcon icon; + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_green_day.png)")); + + icon.addFile(QStringLiteral(":/icons/home_day.png"), QSize(), QIcon::Normal, QIcon::Off); + mp_ui->pushButton_Home->setIcon(icon); + icon.addFile(QStringLiteral(":/icons/settings_day.png"), QSize(), QIcon::Normal, QIcon::Off); + mp_ui->pushButton_Settings->setIcon(icon); + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_green_night.png)")); + + icon.addFile(QStringLiteral(":/icons/home_night.png"), QSize(), QIcon::Normal, QIcon::Off); + mp_ui->pushButton_Home->setIcon(icon); + icon.addFile(QStringLiteral(":/icons/settings_night.png"), QSize(), QIcon::Normal, QIcon::Off); + mp_ui->pushButton_Settings->setIcon(icon); + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } + + // settings widget if present + if (0 != mp_dBusDayNightMode_SettingsWidget) + { + mp_dBusDayNightMode_SettingsWidget->setDayNightMode(m_dayNightMode); + } +} + +void ControlBarWidget::on_pushButton_Settings_clicked() +{ + if (0 == mp_settingsWidget) + { + mp_settingsWidget = new SettingsWidget((QWidget*)parent()); + } + + mp_settingsWidget->move(0, 60); + mp_settingsWidget->show(); + + if (0 == mp_dBusDayNightMode_SettingsWidget) + { + // connect to the dBus interface provided by the settings widget + mp_dBusDayNightMode_SettingsWidget = new org::agl::daynightmode("org.agl.mainwindow", + "/SettingsWidget", + QDBusConnection::sessionBus(), + 0); + mp_dBusDayNightMode_SettingsWidget->setDayNightMode(m_dayNightMode); + } +} + +void ControlBarWidget::on_pushButton_Home_clicked() +{ + if (0 != mp_settingsWidget) + { + mp_settingsWidget->hide(); + } +} diff --git a/src/controlbarwidget.h b/src/controlbarwidget.h new file mode 100644 index 0000000..9d4fa7f --- /dev/null +++ b/src/controlbarwidget.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef CONTROLBARWIDGET_H +#define CONTROLBARWIDGET_H + +#include +#include "include/daynightmode.h" +#include "daynightmode_adapter.h" +#include "daynightmode_proxy.h" +#include "settingswidget.h" + +namespace Ui { +class ControlBarWidget; +} + +class ControlBarWidget : public QWidget +{ + Q_OBJECT + +public: + explicit ControlBarWidget(QWidget *parent = 0); + ~ControlBarWidget(); + +// from daynightmode_adapter.h +public Q_SLOTS: + void setDayNightMode(int mode); + inline int getDayNightMode() + { + return (int)m_dayNightMode; + } + +private slots: + void on_pushButton_Settings_clicked(); + + void on_pushButton_Home_clicked(); + +private: + Ui::ControlBarWidget *mp_ui; + SettingsWidget *mp_settingsWidget; + org::agl::daynightmode *mp_dBusDayNightMode_SettingsWidget; + + SystemDayNight::eDayNightMode m_dayNightMode; + DaynightmodeAdaptor *mp_daynightmodeAdaptor; +}; + +#endif // CONTROLBARWIDGET_H diff --git a/src/inputdevicesimulator.cpp b/src/inputdevicesimulator.cpp new file mode 100644 index 0000000..fcadbc6 --- /dev/null +++ b/src/inputdevicesimulator.cpp @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "inputdevicesimulator.h" +#include "ui_inputdevicesimulator.h" +#include + + +InputDeviceSimulator::InputDeviceSimulator(QWidget *parent) : + QDialog(parent), + mp_ui(new Ui::InputDeviceSimulator), + mp_dBusInputevent(0) +{ + mp_ui->setupUi(this); + + // connect to the dBus interface provided by the input device distributor + mp_dBusInputevent = new org::agl::inputevent("org.agl.main", + "/InputEventDistributor", + QDBusConnection::sessionBus(), + 0); + + QSettings settings; + this->restoreGeometry(settings.value("inputdevicesimulator/geometry").toByteArray()); +} + +InputDeviceSimulator::~InputDeviceSimulator() +{ + QSettings settings; + settings.setValue("inputdevicesimulator/geometry", saveGeometry()); + + if (0 == mp_dBusInputevent) + { + delete mp_dBusInputevent; + } + + delete mp_ui; +} + +void InputDeviceSimulator::on_pushButtonRight_clicked() +{ + qDebug("right"); + mp_dBusInputevent->keyEvent(SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED, SystemInputEvent::INPUTEVENTZONE_1, Qt::Key_Right); +} diff --git a/src/inputdevicesimulator.h b/src/inputdevicesimulator.h new file mode 100644 index 0000000..e22beee --- /dev/null +++ b/src/inputdevicesimulator.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INPUTDEVICESIMULATOR_H +#define INPUTDEVICESIMULATOR_H + +#include +#include "include/inputevent.h" +#include "inputevent_proxy.h" + +namespace Ui { +class InputDeviceSimulator; +} + +class InputDeviceSimulator : public QDialog +{ + Q_OBJECT + +public: + explicit InputDeviceSimulator(QWidget *parent = 0); + ~InputDeviceSimulator(); + +private slots: + void on_pushButtonRight_clicked(); + +private: + Ui::InputDeviceSimulator *mp_ui; + org::agl::inputevent *mp_dBusInputevent; +}; + +#endif // INPUTDEVICESIMULATOR_H diff --git a/src/inputeventdistributor.cpp b/src/inputeventdistributor.cpp new file mode 100644 index 0000000..911b90f --- /dev/null +++ b/src/inputeventdistributor.cpp @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "inputeventdistributor.h" +#include + +InputEventDistributor::InputEventDistributor(QObject *parent) : + QObject(parent), + mp_inputEventAdaptor(0) +{ + // publish dbus popup interface + mp_inputEventAdaptor = new InputeventAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/InputEventDistributor", this); + dbus.registerService("org.agl.main"); +} + +InputEventDistributor::~InputEventDistributor() +{ + delete mp_inputEventAdaptor; +} + +void InputEventDistributor::keyEvent(int type, int zone, int key) +{ + qDebug("InputEventDistributor::keyEvent type 0x%x, key 0x%x", type, key); + + //QEvent *event; + switch (type) + { + case SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED: + + break; + default: + qDebug("InputEventDistributor::keyEvent: Type 0x%x undefined", type); + } + +} diff --git a/src/inputeventdistributor.h b/src/inputeventdistributor.h new file mode 100644 index 0000000..fe8ed89 --- /dev/null +++ b/src/inputeventdistributor.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef INPUTEVENTDISTRIBUTOR_H +#define INPUTEVENTDISTRIBUTOR_H + +#include +#include "include/inputevent.h" +#include "inputevent_adapter.h" + + +class InputEventDistributor : public QObject +{ + Q_OBJECT +public: + explicit InputEventDistributor(QObject *parent = 0); + ~InputEventDistributor(); + +signals: + +public slots: +public Q_SLOTS: // METHODS + void keyEvent(int type, int zone, int key); +private: + InputeventAdaptor *mp_inputEventAdaptor; +}; + +#endif // INPUTEVENTDISTRIBUTOR_H diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..fac6e2f --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mainwindow.h" +#include "include/daynightmode.h" +#include +#include +#include +#include "inputeventdistributor.h" + +#ifdef __i386__ +#include "inputdevicesimulator.h" +#include "systemsettingssimulator.h" +#endif + + +int main(int argc, char *argv[]) +{ + // allow only one instance of this application + QSharedMemory appInstance; + appInstance.setKey("AGLHomeScreenApp"); + if (!appInstance.create(1)) + { + qDebug("Only one instance of the Home Screen App allowed!"); + exit(-1); + } + + QApplication a(argc, argv); + + // used for application settings (QSettings) + QCoreApplication::setOrganizationDomain("LinuxFoundation"); + QCoreApplication::setOrganizationName("AutomotiveGradeLinux"); + QCoreApplication::setApplicationName("HomeScreen"); + QCoreApplication::setApplicationVersion("0.0.1"); + + MainWindow w; + w.move(0, 0); + w.show(); + + InputEventDistributor *mp_inputEventDistributor; + mp_inputEventDistributor = new InputEventDistributor(); + + + // start input and system settings simulator on developer PCs +#ifdef __arm__ + qDebug("Running on ARM architecture"); +#endif +#ifdef __i386__ + InputDeviceSimulator inputdevicesimulator(&w); + inputdevicesimulator.show(); + SystemSettingsSimulator systemsettingssimulator; + systemsettingssimulator.show(); + qDebug("Running on x86 architecture"); +#endif + + return a.exec(); +} diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp new file mode 100644 index 0000000..40189b3 --- /dev/null +++ b/src/mainwindow.cpp @@ -0,0 +1,149 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + mp_ui(new Ui::MainWindow), + mp_statusBarWidget(0), + mp_dBusDayNightMode_StatusBarWidget(0), + mp_controlBarWidget(0), + mp_dBusDayNightMode_ControlBarWidget(0), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_daynightmodeAdaptor(0), + mp_popupAdaptor(0), + mp_dBusPopup(0), + mp_popupWidget(0) +{ + // dbus setup + QDBusConnection dbus = QDBusConnection::sessionBus(); + + // publish dbus day night mode interface + mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); + // publish dbus popup interface + mp_popupAdaptor = new PopupAdaptor((QObject*)this); + + dbus.registerObject("/MainWindow", this); + dbus.registerService("org.agl.mainwindow"); + + // no window decoration + setWindowFlags(Qt::FramelessWindowHint); + mp_ui->setupUi(this); + + mp_statusBarWidget = new StatusBarWidget(this); + mp_statusBarWidget->raise(); + // apply layout + mp_statusBarWidget->setGeometry(0, 0, 800, 60); + // connect to the dBus interface provided by the status bar widget + mp_dBusDayNightMode_StatusBarWidget = new org::agl::daynightmode("org.agl.mainwindow", + "/StatusBarWidget", + QDBusConnection::sessionBus(), + 0); + + mp_controlBarWidget = new ControlBarWidget(this); + mp_controlBarWidget->raise(); + // apply layout + mp_controlBarWidget->setGeometry(0, 540, 800, 60); + // connect to the dBus interface provided by the control bar widget + mp_dBusDayNightMode_ControlBarWidget = new org::agl::daynightmode("org.agl.mainwindow", + "/ControlBarWidget", + QDBusConnection::sessionBus(), + 0); +} + +MainWindow::~MainWindow() +{ + delete mp_dBusDayNightMode_ControlBarWidget; + delete mp_dBusDayNightMode_StatusBarWidget; + + if (0 == mp_dBusPopup) + { + delete mp_dBusPopup; + } + if (0 != mp_popupWidget) + { + delete mp_popupWidget; + } + + + + delete mp_popupAdaptor; + delete mp_daynightmodeAdaptor; + delete mp_statusBarWidget; + delete mp_ui; +} + +void MainWindow::setDayNightMode(int mode) +{ + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_blue_day.png)")); + // home icon + mp_ui->widget_Home_Icon->setStyleSheet(QString("border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;")); + + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_blue_night.png)")); + // home icon + mp_ui->widget_Home_Icon->setStyleSheet(QString("border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;")); + + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } + + mp_dBusDayNightMode_StatusBarWidget->setDayNightMode(m_dayNightMode); + mp_dBusDayNightMode_ControlBarWidget->setDayNightMode(m_dayNightMode); +} + +void MainWindow::showPopup(int type, const QString &text) +{ + if (0 == mp_popupWidget) + { + qDebug("0 == mp_popupWidget"); + mp_popupWidget = new PopupWidget(this); + } + + mp_popupWidget->move(0, 0); + mp_popupWidget->show(); + + if (0 == mp_dBusPopup) + { + qDebug("0 == mp_dBusPopup"); + // connect to the dBus interface provided by the popup widget + mp_dBusPopup = new org::agl::popup("org.agl.mainwindow", + "/PopupWidget", + QDBusConnection::sessionBus(), + 0); + } + mp_dBusPopup->showPopup(type, text); +} + +void MainWindow::changeEvent(QEvent* event) +{ + if (QEvent::LanguageChange == event->type()) + { + mp_ui->retranslateUi(this); + } + + QMainWindow::changeEvent(event); +} + diff --git a/src/mainwindow.h b/src/mainwindow.h new file mode 100644 index 0000000..a87d88d --- /dev/null +++ b/src/mainwindow.h @@ -0,0 +1,79 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include "include/daynightmode.h" +#include "daynightmode_adapter.h" +#include "daynightmode_proxy.h" +#include "popupwidget.h" +#include "include/popup.h" +#include "popup_adapter.h" +#include "popup_proxy.h" + +#include "statusbarwidget.h" +#include "controlbarwidget.h" + +namespace Ui { +class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +// from daynightmode_adapter.h +public Q_SLOTS: + void setDayNightMode(int mode); + inline int getDayNightMode() + { + return (int)m_dayNightMode; + } + +// from popup_adapter.h +public Q_SLOTS: // METHODS + void showPopup(int type, const QString &text); + +protected: + // called when the translator loaded a new language set + void changeEvent(QEvent* event); + +private: + Ui::MainWindow *mp_ui; + + StatusBarWidget *mp_statusBarWidget; + org::agl::daynightmode *mp_dBusDayNightMode_StatusBarWidget; + ControlBarWidget *mp_controlBarWidget; + org::agl::daynightmode *mp_dBusDayNightMode_ControlBarWidget; + + // dbus daynightmode + SystemDayNight::eDayNightMode m_dayNightMode; + DaynightmodeAdaptor *mp_daynightmodeAdaptor; + + // dbus popup + PopupAdaptor *mp_popupAdaptor; + org::agl::popup *mp_dBusPopup; + + PopupWidget *mp_popupWidget; +}; + +#endif // MAINWINDOW_H diff --git a/src/popupwidget.cpp b/src/popupwidget.cpp new file mode 100644 index 0000000..54573ad --- /dev/null +++ b/src/popupwidget.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "popupwidget.h" +#include "ui_popupwidget.h" + +PopupWidget::PopupWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::PopupWidget), + mp_popupAdaptor(0) +{ + mp_ui->setupUi(this); + + // publish dbus popup interface + mp_popupAdaptor = new PopupAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/PopupWidget", this); + dbus.registerService("org.agl.mainwindow"); +} + +PopupWidget::~PopupWidget() +{ + delete mp_popupAdaptor; + delete mp_ui; +} + +void PopupWidget::showPopup(int type, const QString &text) +{ + qDebug("PopupWidget::showPopup: type %d, text %s", type, text.toStdString().c_str()); + mp_ui->label_Text->setText(text); +} + +void PopupWidget::on_pushButton_OK_clicked() +{ + this->close(); +} diff --git a/src/popupwidget.h b/src/popupwidget.h new file mode 100644 index 0000000..201cbc3 --- /dev/null +++ b/src/popupwidget.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef POPUPWIDGET_H +#define POPUPWIDGET_H + +#include +#include "include/popup.h" +#include "popup_adapter.h" + +namespace Ui { +class PopupWidget; +} + +class PopupWidget : public QWidget +{ + Q_OBJECT + +public: + explicit PopupWidget(QWidget *parent = 0); + ~PopupWidget(); + +// from popup_adapter.h +public Q_SLOTS: // METHODS + void showPopup(int type, const QString &text); + +private slots: + void on_pushButton_OK_clicked(); + +private: + Ui::PopupWidget *mp_ui; + + PopupAdaptor *mp_popupAdaptor; +}; + +#endif // POPUPWIDGET_H diff --git a/src/settingswidget.cpp b/src/settingswidget.cpp new file mode 100644 index 0000000..24085e8 --- /dev/null +++ b/src/settingswidget.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "settingswidget.h" +#include "ui_settingswidget.h" +#include "include/daynightmode.h" +#include + +SettingsWidget::SettingsWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::SettingsWidget), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_daynightmodeAdaptor(0), + mp_translator(0) +{ + // publish dbus day night mode interface + mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/SettingsWidget", this); + dbus.registerService("org.agl.mainwindow"); + + // multi-language support + mp_translator = new QTranslator(); + mp_translator->load("homescreen_en_US.qm", ":/translations"); // TODO: read from system + QApplication::instance()->installTranslator(mp_translator); + + mp_ui->setupUi(this); + + mp_ui->comboBoxLanguage->addItem(QString("English"), QVariant("homescreen_en_US.qm")); // TODO: make this configurable? + mp_ui->comboBoxLanguage->addItem(QString("Deutsch"), QVariant("homescreen_de_DE.qm")); + mp_ui->comboBoxLanguage->addItem(QString("日本語"), QVariant("homescreen_ja_JP.qm")); + + QSettings settings; + mp_ui->comboBoxLanguage->setCurrentIndex(settings.value("systemsettings/language", 0).toInt()); +} + +SettingsWidget::~SettingsWidget() +{ + delete mp_translator; + delete mp_daynightmodeAdaptor; + + QSettings settings; + settings.setValue("systemsettings/language", mp_ui->comboBoxLanguage->currentIndex()); + delete mp_ui; +} + +void SettingsWidget::setDayNightMode(int mode) +{ + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_blue_day.png);")); + mp_ui->comboBoxLanguage->setStyleSheet(QString("QComboBox { \ + border: 1px solid #D3D3D3; \ + border-radius: 8px; \ + background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(242, 242, 249, 255), stop:1 rgba(255, 255, 255, 255)); \ + color: #333; \ + padding: 0px; \ + } \ + QComboBox:on { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); \ + } \ + QComboBox::drop-down { \ + border: 0px solid; \ + border-radius: 0px; \ + } \ + QComboBox::down-arrow:on { \ + }")); + // settings icon + mp_ui->widget_Settings_Icon->setStyleSheet(QString("border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch;")); + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget_Background->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_blue_night.png);")); + mp_ui->comboBoxLanguage->setStyleSheet(QString("QComboBox { \ + border: 1px solid #D3D3D3; \ + border-radius: 8px; \ + background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(147, 147, 151, 255), stop:1 rgba(255, 255, 255, 255)); \ + color: #333; \ + padding: 0px; \ + } \ + QComboBox:on { \ + background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); \ + } \ + QComboBox::drop-down { \ + border: 0px solid; \ + border-radius: 0px; \ + } \ + QComboBox::down-arrow:on { \ + }")); + // settings icon + mp_ui->widget_Settings_Icon->setStyleSheet(QString("border-image: url(:/icons/settings_night.png) 0 0 0 0 stretch stretch;")); + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } +} + +void SettingsWidget::changeEvent(QEvent* event) +{ + if (QEvent::LanguageChange == event->type()) + { + mp_ui->retranslateUi(this); + } + + QWidget::changeEvent(event); +} + +void SettingsWidget::on_comboBoxLanguage_currentIndexChanged(const QString &) +{ + if (0 != mp_translator) + mp_translator->load(mp_ui->comboBoxLanguage->currentData().toString(), ":/translations"); +} diff --git a/src/settingswidget.h b/src/settingswidget.h new file mode 100644 index 0000000..f49da8d --- /dev/null +++ b/src/settingswidget.h @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SETTINGSWIDGET_H +#define SETTINGSWIDGET_H + +#include +#include +#include "include/daynightmode.h" +#include "daynightmode_adapter.h" + +namespace Ui { +class SettingsWidget; +} + +class SettingsWidget : public QWidget +{ + Q_OBJECT + +public: + explicit SettingsWidget(QWidget *parent = 0); + ~SettingsWidget(); + +// from daynightmode_adapter.h +public Q_SLOTS: + void setDayNightMode(int mode); + inline int getDayNightMode() + { + return (int)m_dayNightMode; + } + +protected: + // called when the translator loaded a new language set + void changeEvent(QEvent* event); + +private slots: + void on_comboBoxLanguage_currentIndexChanged(const QString &); + +private: + Ui::SettingsWidget *mp_ui; + + SystemDayNight::eDayNightMode m_dayNightMode; + DaynightmodeAdaptor *mp_daynightmodeAdaptor; + + QTranslator *mp_translator; +}; + +#endif // SETTINGSWIDGET_H diff --git a/src/statusbarwidget.cpp b/src/statusbarwidget.cpp new file mode 100644 index 0000000..775a9ec --- /dev/null +++ b/src/statusbarwidget.cpp @@ -0,0 +1,118 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "statusbarwidget.h" +#include "ui_statusbarwidget.h" + +StatusBarWidget::StatusBarWidget(QWidget *parent) : + QWidget(parent), + mp_ui(new Ui::StatusBarWidget), + m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system + mp_daynightmodeAdaptor(0), + mp_statusbarAdaptor(0), + m_secondsTimerId(-1) +{ + // publish dbus day night mode interface + mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this); + // publish statusbar interface + mp_statusbarAdaptor = new StatusbarAdaptor((QObject*)this); + + QDBusConnection dbus = QDBusConnection::sessionBus(); + dbus.registerObject("/StatusBarWidget", this); + dbus.registerService("org.agl.mainwindow"); + + mp_ui->setupUi(this); + + // callback every second + m_secondsTimerId = startTimer(1000); +} + +StatusBarWidget::~StatusBarWidget() +{ + delete mp_statusbarAdaptor; + delete mp_daynightmodeAdaptor; + delete mp_ui; +} + +void StatusBarWidget::setDayNightMode(int mode) +{ + switch (mode) + { + case SystemDayNight::DAYNIGHTMODE_DAY: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY; + mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_day.png)")); + mp_ui->label_1->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_4_Time->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_6->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + mp_ui->label_7->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);")); + break; + case SystemDayNight::DAYNIGHTMODE_NIGHT: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT; + mp_ui->widget->setStyleSheet(QString("background-image: url(:/images/backgrounds/bg_stripes_night.png)")); + mp_ui->label_1->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_4_Time->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_6->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + mp_ui->label_7->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);")); + break; + default: + m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED; + } +} + +void StatusBarWidget::setStatus(int index, const QString &text) +{ + switch (index) + { + case 1: + mp_ui->label_1->setText(text); + break; + case 2: + mp_ui->label_2->setText(text); + break; + case 3: + mp_ui->label_3->setText(text); + break; + case 4: + qDebug("reserved for the time status"); + break; + case 5: + mp_ui->label_5->setText(text); + break; + case 6: + mp_ui->label_6->setText(text); + break; + case 7: + mp_ui->label_7->setText(text); + break; + default: + break; + } +} + +void StatusBarWidget::timerEvent(QTimerEvent *e) +{ + if (e->timerId() == m_secondsTimerId) + { + mp_ui->label_4_Time->setText(QDateTime::currentDateTime().toString("hh:mm")); + } +} + diff --git a/src/statusbarwidget.h b/src/statusbarwidget.h new file mode 100644 index 0000000..2547d34 --- /dev/null +++ b/src/statusbarwidget.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef STATUSBARWIDGET_H +#define STATUSBARWIDGET_H + +#include +#include "include/daynightmode.h" +#include "daynightmode_adapter.h" +#include "statusbar_adapter.h" + +namespace Ui { +class StatusBarWidget; +} + +class StatusBarWidget : public QWidget +{ + Q_OBJECT + +public: + explicit StatusBarWidget(QWidget *parent = 0); + ~StatusBarWidget(); + +// from daynightmode_adapter.h +public Q_SLOTS: + void setDayNightMode(int mode); + inline int getDayNightMode() + { + return (int)m_dayNightMode; + } + +// from statusbar_adapter.h +public Q_SLOTS: // METHODS + void setStatus(int index, const QString &text); + +protected: + void timerEvent(QTimerEvent *e); + +private: + Ui::StatusBarWidget *mp_ui; + + SystemDayNight::eDayNightMode m_dayNightMode; + DaynightmodeAdaptor *mp_daynightmodeAdaptor; + StatusbarAdaptor *mp_statusbarAdaptor; + + int m_secondsTimerId; +}; + +#endif // STATUSBARWIDGET_H diff --git a/src/systemsettingssimulator.cpp b/src/systemsettingssimulator.cpp new file mode 100644 index 0000000..b1ed6b3 --- /dev/null +++ b/src/systemsettingssimulator.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "systemsettingssimulator.h" +#include "ui_systemsettingssimulator.h" +#include "include/daynightmode.h" +#include + +SystemSettingsSimulator::SystemSettingsSimulator(QWidget *parent) : + QDialog(parent), + mp_ui(new Ui::SystemSettingsSimulator), + mp_dBusDayNightMode(0) +{ + mp_ui->setupUi(this); + + // connect to the dBus interface provided by the main window + mp_dBusDayNightMode = new org::agl::daynightmode("org.agl.mainwindow", + "/MainWindow", + QDBusConnection::sessionBus(), + 0); + + QSettings settings; + this->restoreGeometry(settings.value("systemsettingssimulator/geometry").toByteArray()); + mp_ui->radioButton_DayMode->setChecked(settings.value("systemsettingssimulator/daymode", true).toBool()); // if nothing is stored, use "true" + mp_ui->radioButton_NightMode->setChecked(settings.value("systemsettingssimulator/nightmode", false).toBool()); // if nothing is stored, use "false" +} + +SystemSettingsSimulator::~SystemSettingsSimulator() +{ + QSettings settings; + settings.setValue("systemsettingssimulator/geometry", saveGeometry()); + settings.setValue("systemsettingssimulator/daymode", mp_ui->radioButton_DayMode->isChecked()); + settings.setValue("systemsettingssimulator/nightmode", mp_ui->radioButton_NightMode->isChecked()); + + if (0 == mp_dBusDayNightMode) + { + delete mp_dBusDayNightMode; + } + delete mp_ui; +} + +void SystemSettingsSimulator::on_pushButton_Exit_clicked() +{ + QApplication::exit(); +} + +void SystemSettingsSimulator::on_radioButton_DayMode_toggled(bool checked) +{ + if (checked) + { + mp_dBusDayNightMode->setDayNightMode(SystemDayNight::DAYNIGHTMODE_DAY); + } +} + +void SystemSettingsSimulator::on_radioButton_NightMode_toggled(bool checked) +{ + if (checked) + { + mp_dBusDayNightMode->setDayNightMode(SystemDayNight::DAYNIGHTMODE_NIGHT); + } +} diff --git a/src/systemsettingssimulator.h b/src/systemsettingssimulator.h new file mode 100644 index 0000000..cba7a14 --- /dev/null +++ b/src/systemsettingssimulator.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SYSTEMSETTINGSSIMULATOR_H +#define SYSTEMSETTINGSSIMULATOR_H + +#include +#include "include/daynightmode.h" +#include "daynightmode_proxy.h" + +namespace Ui { +class SystemSettingsSimulator; +} + +class SystemSettingsSimulator : public QDialog +{ + Q_OBJECT + +public: + explicit SystemSettingsSimulator(QWidget *parent = 0); + ~SystemSettingsSimulator(); + +private slots: + void on_pushButton_Exit_clicked(); + void on_radioButton_DayMode_toggled(bool checked); + + void on_radioButton_NightMode_toggled(bool checked); + +private: + Ui::SystemSettingsSimulator *mp_ui; + org::agl::daynightmode *mp_dBusDayNightMode; +}; + +#endif // SYSTEMSETTINGSSIMULATOR_H