Support for color schemes v0.1.1
authorBocklage, Jens <Jens_Bocklage@mentor.com>
Wed, 6 Jul 2016 17:35:45 +0000 (19:35 +0200)
committerBocklage, Jens <Jens_Bocklage@mentor.com>
Wed, 6 Jul 2016 17:35:45 +0000 (19:35 +0200)
- 3 demo color schemes included

Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
41 files changed:
HomeScreen.pro
HomeScreen/HomeScreen.pro
HomeScreen/README.md
HomeScreen/resources/colorschemes/README [new file with mode: 0644]
HomeScreen/resources/colorschemes/default/0.ini [new file with mode: 0644]
HomeScreen/resources/colorschemes/default/1.ini [new file with mode: 0644]
HomeScreen/resources/colorschemes/demo1/0.ini [new file with mode: 0644]
HomeScreen/resources/colorschemes/demo1/1.ini [new file with mode: 0644]
HomeScreen/resources/colorschemes/demo2/0.ini [new file with mode: 0644]
HomeScreen/resources/colorschemes/demo2/1.ini [new file with mode: 0644]
HomeScreen/resources/controlbarwidget.ui
HomeScreen/resources/settingswidget.ui
HomeScreen/resources/statusbarwidget.ui
HomeScreen/resources/translations/homescreen_de_DE.qm
HomeScreen/resources/translations/homescreen_de_DE.ts
HomeScreen/resources/translations/homescreen_en_US.qm
HomeScreen/resources/translations/homescreen_en_US.ts
HomeScreen/resources/translations/homescreen_ja_JP.qm
HomeScreen/resources/translations/homescreen_ja_JP.ts
HomeScreen/src/controlbarwidget.cpp
HomeScreen/src/controlbarwidget.h
HomeScreen/src/main.cpp
HomeScreen/src/mainwindow.cpp
HomeScreen/src/mainwindow.h
HomeScreen/src/popupwidget.cpp
HomeScreen/src/popupwidget.h
HomeScreen/src/settingswidget.cpp
HomeScreen/src/settingswidget.h
HomeScreen/src/statusbarwidget.cpp
HomeScreen/src/statusbarwidget.h
HomeScreenSimulator/HomeScreenSimulator.pro
HomeScreenSimulator/README.md
HomeScreenSimulator/src/main.cpp
README.md
SampleAppTimeDate/README.md
SampleAppTimeDate/SampleAppTimeDate.pro
SampleAppTimeDate/src/main.cpp
interfaces/LICENSE [new file with mode: 0644]
interfaces/README.md [new file with mode: 0644]
interfaces/daynightmode.h
interfaces/interfaces.pro [new file with mode: 0644]

index 00d5a7f..6498293 100644 (file)
@@ -1,6 +1,28 @@
+# 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.
+
 TEMPLATE = subdirs
 
-SUBDIRS = HomeScreen \
+SUBDIRS = interfaces \
+        HomeScreen \
        HomeScreenSimulator \
        SampleAppTimeDate
 
+HomeScreen.depends = interfaces
+HomeScreenSimulator.depends = interfaces
+SampleAppTimeDate.depends = interfaces
+
+# remove generated files
+QMAKE_CLEAN += -r \
+    $$OUT_PWD/Makefile
index a3ebdba..bfe0491 100644 (file)
@@ -12,8 +12,6 @@
 # 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
@@ -29,13 +27,6 @@ SOURCES += \
     src/popupwidget.cpp \
     src/controlbarwidget.cpp \
     src/statusbarwidget.cpp
-GENERATED_SOURCES += \
-    $$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/statusbar_adapter.cpp \        #generated dbus adapter
-    $$OUT_PWD/statusbar_proxy.cpp             #generated dbus proxy
 
 HEADERS  += \
     ../interfaces/daynightmode.h \
@@ -45,12 +36,17 @@ HEADERS  += \
     src/popupwidget.h \
     src/controlbarwidget.h \
     src/statusbarwidget.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/statusbar_adapter.h \      #generated dbus adapter
-    $$OUT_PWD/statusbar_proxy.h           #generated dbus proxy
+    $$OUT_PWD/../interfaces/daynightmode_adapter.h \      #generated dbus adapter
+    $$OUT_PWD/../interfaces/daynightmode_proxy.h \        #generated dbus proxy
+    $$OUT_PWD/../interfaces/popup_adapter.h \             #generated dbus adapter
+    $$OUT_PWD/../interfaces/popup_proxy.h \               #generated dbus proxy
+    $$OUT_PWD/../interfaces/statusbar_adapter.h \         #generated dbus adapter
+    $$OUT_PWD/../interfaces/statusbar_proxy.h             #generated dbus proxy
+
+INCLUDEPATH += $$OUT_PWD/../interfaces
+
+LIBS += -L$$OUT_PWD/../interfaces -linterfaces
+
 
 FORMS    += \
     resources/mainwindow.ui \
@@ -65,74 +61,18 @@ TRANSLATIONS = \
     resources/translations/homescreen_ja_JP.ts
 
 OTHER_FILES += \
-    ../interfaces/daynightmode.xml \
-    ../interfaces/inputevent.xml \
-    ../interfaces/popup.xml \
-    ../interfaces/statusbar.xml \
     README.md
 
 RESOURCES += \
     resources/homescreen.qrc
 
+copydata.commands = $(COPY_DIR) $$PWD/resources/colorschemes $$OUT_PWD
+HomeScreen.depends = $(HomeScreen) copydata
+export(HomeScreen.depends)
+export(copydata.commands)
+QMAKE_EXTRA_TARGETS += HomeScreen copydata
+
 # 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/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
-# OE_QMAKE_PATH_EXTERNAL_HOST_BINS is only defined in the yocto environment
-isEmpty(OE_QMAKE_PATH_EXTERNAL_HOST_BINS){
-  OE_QMAKE_PATH_EXTERNAL_HOST_BINS = "/"
-}
-# for daynightmode
-daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp
-unix:daynightmodegenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc"
-daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp
-unix:daynightmodegenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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 = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc"
-popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp
-unix:popupgenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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 statusbar
-statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp
-unix:statusbargenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc"
-statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp
-unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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
-
+    $$OUT_PWD/Makefile
index b896bfa..dca6057 100644 (file)
@@ -1,9 +1,23 @@
 AGL Home Screen reference implementation
 
 
+Build with QtCreator 3.0.1
+
 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-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.1.1
+07/06/2016
+
+#changes
+- reworked D-Bus day/night mode handling
+
+#new features
+- color schemes implemented
+-- 3 color schemes as example added
 
 v0.1.0
 06/24/2016
diff --git a/HomeScreen/resources/colorschemes/README b/HomeScreen/resources/colorschemes/README
new file mode 100644 (file)
index 0000000..13984a8
--- /dev/null
@@ -0,0 +1,3 @@
+0.ini for daymode settings
+1.ini for nightmode settings
+
diff --git a/HomeScreen/resources/colorschemes/default/0.ini b/HomeScreen/resources/colorschemes/default/0.ini
new file mode 100644 (file)
index 0000000..569aa74
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_day.png
+pushButton_Settings=:/icons/settings_day.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_day.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Home_Icon="border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(109, 109, 109, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup="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);         }"
+
+[SettingsWidget]
+comboBoxLanguage="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 { }"
+comboBoxColorScheme="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 { }"
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(238, 238, 238); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_day.png)
diff --git a/HomeScreen/resources/colorschemes/default/1.ini b/HomeScreen/resources/colorschemes/default/1.ini
new file mode 100644 (file)
index 0000000..ec6d421
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_night.png
+pushButton_Settings=:/icons/settings_night.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_night.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Home_Icon="border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(109, 109, 109, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup="QWidget {         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;         }          QWidget:on {         background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE);         }"
+
+[SettingsWidget]
+comboBoxLanguage="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 { }"
+comboBoxColorScheme="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 { }"
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_night.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(177, 177, 177); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_night.png)
diff --git a/HomeScreen/resources/colorschemes/demo1/0.ini b/HomeScreen/resources/colorschemes/demo1/0.ini
new file mode 100644 (file)
index 0000000..6b7fa03
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_day.png
+pushButton_Settings=:/icons/settings_day.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_day.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Home_Icon="border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(255, 109, 109, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup="QWidget {         border: 1px solid #D3D3D3;         border-radius: 8px;         background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 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);         }"
+
+[SettingsWidget]
+comboBoxLanguage="QComboBox { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 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 { }"
+comboBoxColorScheme="QComboBox { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(255, 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 { }"
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(255, 238, 238); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(255, 238, 238); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(255, 238, 238); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(255, 238, 238); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(255, 238, 238); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_day.png)
diff --git a/HomeScreen/resources/colorschemes/demo1/1.ini b/HomeScreen/resources/colorschemes/demo1/1.ini
new file mode 100644 (file)
index 0000000..df2788f
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_night.png
+pushButton_Settings=:/icons/settings_night.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_night.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Home_Icon="border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(0, 109, 109, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup="QWidget {         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;         }          QWidget:on {         background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE);         }"
+
+[SettingsWidget]
+comboBoxLanguage="QComboBox { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 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 { }"
+comboBoxColorScheme="QComboBox { border: 1px solid #D3D3D3; border-radius: 8px; background: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 rgba(0, 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 { }"
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_night.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(0, 177, 177); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(0, 177, 177); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(0, 177, 177); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(0, 177, 177); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(0, 177, 177); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_night.png)
diff --git a/HomeScreen/resources/colorschemes/demo2/0.ini b/HomeScreen/resources/colorschemes/demo2/0.ini
new file mode 100644 (file)
index 0000000..4796703
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_day.png
+pushButton_Settings=:/icons/settings_day.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_day.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Home_Icon="border-image: url(:/icons/home_day.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(109, 255, 0, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup=""
+
+[SettingsWidget]
+comboBoxLanguage=""
+comboBoxColorScheme=""
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_day.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_day.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(238, 255, 0); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(238, 255, 0); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(238, 255, 0); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(238, 255, 0); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(238, 255, 0); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_day.png)
diff --git a/HomeScreen/resources/colorschemes/demo2/1.ini b/HomeScreen/resources/colorschemes/demo2/1.ini
new file mode 100644 (file)
index 0000000..3415c55
--- /dev/null
@@ -0,0 +1,31 @@
+[ControlBarWidget]
+pushButton_Home=:/icons/home_night.png
+pushButton_Settings=:/icons/settings_night.png
+widget_Background=background-image: url(:/images/backgrounds/bg_green_night.png)
+
+[MainWindow]
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Home_Icon="border-image: url(:/icons/home_night.png) 0 0 0 0 stretch stretch;"
+
+[PopupWidget]
+label_Text="background-color: rgba(0, 109, 255, 0);         background-image: url(:/images/transparency.png);         border-image: url(:/images/transparency.png);"
+widget_Popup=""
+
+[SettingsWidget]
+comboBoxLanguage=""
+comboBoxColorScheme=""
+widget_Background="background-image: url(:/images/backgrounds/bg_blue_night.png);"
+widget_Settings_Icon="border-image: url(:/icons/settings_night.png) 0 0 0 0 stretch stretch;"
+
+[StatusBarWidget]
+label_1="color: rgb(177, 177, 255); background-image: url(:/images/transparency.png);"
+label_1_icon="background-image: url(:/images/transparency.png);"
+label_2="color: rgb(177, 177, 255); background-image: url(:/images/transparency.png);"
+label_2_icon="background-image: url(:/images/transparency.png);"
+label_3="color: rgb(177, 177, 255); background-image: url(:/images/transparency.png);"
+label_3_icon="background-image: url(:/images/transparency.png);"
+label_4="color: rgb(177, 177, 255); background-image: url(:/images/transparency.png);"
+label_4_icon="background-image: url(:/images/transparency.png);"
+label_5="color: rgb(177, 177, 255); background-image: url(:/images/transparency.png);"
+label_5_icon="background-image: url(:/images/transparency.png);"
+widget=background-image: url(:/images/backgrounds/bg_stripes_night.png)
index 9696a49..a20f0b6 100644 (file)
@@ -22,9 +22,6 @@
      <height>60</height>
     </rect>
    </property>
-   <property name="styleSheet">
-    <string notr="true">background-image: url(:/images/backgrounds/bg_green_day.png);</string>
-   </property>
    <widget class="QPushButton" name="pushButton_Home">
     <property name="geometry">
      <rect>
index 2ec5076..7b899f0 100644 (file)
@@ -77,24 +77,85 @@ QComboBox::down-arrow:on {
 </string>
     </property>
    </widget>
-  </widget>
-  <widget class="QLabel" name="labelLanguage">
-   <property name="geometry">
-    <rect>
-     <x>20</x>
-     <y>20</y>
-     <width>300</width>
-     <height>60</height>
-    </rect>
-   </property>
-   <property name="font">
-    <font>
-     <pointsize>22</pointsize>
-    </font>
-   </property>
-   <property name="text">
-    <string>Language</string>
-   </property>
+   <widget class="QLabel" name="labelColorScheme">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>120</y>
+      <width>300</width>
+      <height>60</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>22</pointsize>
+     </font>
+    </property>
+    <property name="text">
+     <string>Color Scheme</string>
+    </property>
+   </widget>
+   <widget class="QLabel" name="labelLanguage">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>20</y>
+      <width>300</width>
+      <height>60</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>22</pointsize>
+     </font>
+    </property>
+    <property name="text">
+     <string>Language</string>
+    </property>
+   </widget>
+   <widget class="QComboBox" name="comboBoxColorScheme">
+    <property name="geometry">
+     <rect>
+      <x>660</x>
+      <y>120</y>
+      <width>400</width>
+      <height>60</height>
+     </rect>
+    </property>
+    <property name="font">
+     <font>
+      <pointsize>22</pointsize>
+     </font>
+    </property>
+    <property name="focusPolicy">
+     <enum>Qt::NoFocus</enum>
+    </property>
+    <property name="styleSheet">
+     <string notr="true">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 {
+}
+</string>
+    </property>
+   </widget>
+   <zorder>comboBoxLanguage</zorder>
+   <zorder>widget_Settings_Icon</zorder>
+   <zorder>labelLanguage</zorder>
+   <zorder>labelColorScheme</zorder>
+   <zorder>labelLanguage</zorder>
+   <zorder>comboBoxColorScheme</zorder>
   </widget>
  </widget>
  <resources/>
index d0747ab..2fcd9c0 100644 (file)
@@ -22,9 +22,6 @@
      <height>60</height>
     </rect>
    </property>
-   <property name="styleSheet">
-    <string notr="true">background-image: url(:/images/backgrounds/bg_stripes_day.png);</string>
-   </property>
    <widget class="QLabel" name="label_1">
     <property name="geometry">
      <rect>
       <bold>true</bold>
      </font>
     </property>
-    <property name="styleSheet">
-     <string notr="true">color: rgb(238, 238, 238);
-background-image: url(:/images/transparency.png);</string>
-    </property>
     <property name="alignment">
      <set>Qt::AlignCenter</set>
     </property>
@@ -65,10 +58,6 @@ background-image: url(:/images/transparency.png);</string>
       <bold>true</bold>
      </font>
     </property>
-    <property name="styleSheet">
-     <string notr="true">color: rgb(238, 238, 238);
-background-image: url(:/images/transparency.png);</string>
-    </property>
     <property name="alignment">
      <set>Qt::AlignCenter</set>
     </property>
@@ -89,10 +78,6 @@ background-image: url(:/images/transparency.png);</string>
       <bold>true</bold>
      </font>
     </property>
-    <property name="styleSheet">
-     <string notr="true">color: rgb(238, 238, 238);
-background-image: url(:/images/transparency.png);</string>
-    </property>
     <property name="alignment">
      <set>Qt::AlignCenter</set>
     </property>
@@ -113,10 +98,6 @@ background-image: url(:/images/transparency.png);</string>
       <bold>true</bold>
      </font>
     </property>
-    <property name="styleSheet">
-     <string notr="true">color: rgb(238, 238, 238);
-background-image: url(:/images/transparency.png);</string>
-    </property>
     <property name="alignment">
      <set>Qt::AlignCenter</set>
     </property>
@@ -137,14 +118,75 @@ background-image: url(:/images/transparency.png);</string>
       <bold>true</bold>
      </font>
     </property>
-    <property name="styleSheet">
-     <string notr="true">color: rgb(238, 238, 238);
-background-image: url(:/images/transparency.png);</string>
-    </property>
     <property name="alignment">
      <set>Qt::AlignCenter</set>
     </property>
    </widget>
+   <widget class="QLabel" name="label_1_icon">
+    <property name="geometry">
+     <rect>
+      <x>20</x>
+      <y>10</y>
+      <width>40</width>
+      <height>40</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_2_icon">
+    <property name="geometry">
+     <rect>
+      <x>230</x>
+      <y>10</y>
+      <width>40</width>
+      <height>40</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_3_icon">
+    <property name="geometry">
+     <rect>
+      <x>440</x>
+      <y>10</y>
+      <width>40</width>
+      <height>40</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_4_icon">
+    <property name="geometry">
+     <rect>
+      <x>650</x>
+      <y>10</y>
+      <width>40</width>
+      <height>40</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
+   <widget class="QLabel" name="label_5_icon">
+    <property name="geometry">
+     <rect>
+      <x>860</x>
+      <y>10</y>
+      <width>40</width>
+      <height>40</height>
+     </rect>
+    </property>
+    <property name="text">
+     <string/>
+    </property>
+   </widget>
   </widget>
  </widget>
  <resources/>
index bf2aa8c..856fc20 100644 (file)
Binary files a/HomeScreen/resources/translations/homescreen_de_DE.qm and b/HomeScreen/resources/translations/homescreen_de_DE.qm differ
index d512aaf..4c43d67 100644 (file)
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../settingswidget.ui" line="96"/>
+        <location filename="../settingswidget.ui" line="95"/>
+        <source>Color Scheme</source>
+        <translation type="unfinished">Farbschema</translation>
+    </message>
+    <message>
+        <location filename="../settingswidget.ui" line="113"/>
         <source>Language</source>
         <translation type="unfinished">Sprache</translation>
     </message>
index ce75d11..2556083 100644 (file)
Binary files a/HomeScreen/resources/translations/homescreen_en_US.qm and b/HomeScreen/resources/translations/homescreen_en_US.qm differ
index 07199a4..a7cb09e 100644 (file)
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../settingswidget.ui" line="96"/>
+        <location filename="../settingswidget.ui" line="95"/>
+        <source>Color Scheme</source>
+        <translation type="unfinished">Color Scheme</translation>
+    </message>
+    <message>
+        <location filename="../settingswidget.ui" line="113"/>
         <source>Language</source>
         <translation>Language</translation>
     </message>
index 8e662d8..497951a 100644 (file)
Binary files a/HomeScreen/resources/translations/homescreen_ja_JP.qm and b/HomeScreen/resources/translations/homescreen_ja_JP.qm differ
index cb943e4..3dd76b1 100644 (file)
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../settingswidget.ui" line="96"/>
+        <location filename="../settingswidget.ui" line="95"/>
+        <source>Color Scheme</source>
+        <translation type="unfinished">配色</translation>
+    </message>
+    <message>
+        <location filename="../settingswidget.ui" line="113"/>
         <source>Language</source>
         <translation>言語</translation>
     </message>
index e01fe26..dee0207 100644 (file)
 
 #include "controlbarwidget.h"
 #include "ui_controlbarwidget.h"
+#include "../interfaces/daynightmode.h"
+#include <QSettings>
 
 ControlBarWidget::ControlBarWidget(QWidget *parent) :
     QWidget(parent),
-    mp_ui(new Ui::ControlBarWidget),
-    mp_settingsWidget(0),
-    m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
-    mp_dayNightModeProxy(0)
+    mp_ui(new Ui::ControlBarWidget)
 {
-    // this has to be adopted to the system setup
-    mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
-                                                      "/",
-                                                      QDBusConnection::sessionBus(),
-                                                      0);
-    QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
-
     mp_ui->setupUi(this);
 }
 
 ControlBarWidget::~ControlBarWidget()
 {
-    delete mp_dayNightModeProxy;
-    if (0 != mp_settingsWidget)
-    {
-        delete mp_settingsWidget;
-    }
     delete mp_ui;
 }
 
-void ControlBarWidget::dayNightModeSlot(int mode)
+void ControlBarWidget::updateColorScheme()
 {
-    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)"));
+    QSettings settings;
+    QSettings settings_cs(QApplication::applicationDirPath() +
+                          "/colorschemes/" +
+                          settings.value("systemsettings/colorscheme", "default").toString() +
+                          "/" +
+                          QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+                          ".ini",
+                          QSettings::IniFormat);
 
-        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)"));
+    QIcon icon;
+    mp_ui->widget_Background->setStyleSheet(settings_cs.value(QString("ControlBarWidget/widget_Background")).toString());
 
-        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;
-    }
+    icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Home")).toString(), QSize(), QIcon::Normal, QIcon::Off);
+    mp_ui->pushButton_Home->setIcon(icon);
+    icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Settings")).toString(), QSize(), QIcon::Normal, QIcon::Off);
+    mp_ui->pushButton_Settings->setIcon(icon);
 }
 
 void ControlBarWidget::on_pushButton_Settings_clicked()
 {
-    if (0 == mp_settingsWidget)
-    {
-        mp_settingsWidget = new SettingsWidget((QWidget*)parent());
-    }
-
-    mp_settingsWidget->move(0, 60);
-    mp_settingsWidget->show();
+    emit settingsButtonPressed();
 }
 
 void ControlBarWidget::on_pushButton_Home_clicked()
 {
-    if (0 != mp_settingsWidget)
-    {
-        mp_settingsWidget->hide();
-    }
+    emit homeButtonPressed();
 }
index 618fa35..0ab382b 100644 (file)
@@ -18,9 +18,6 @@
 #define CONTROLBARWIDGET_H
 
 #include <QWidget>
-#include "../interfaces/daynightmode.h"
-#include "daynightmode_proxy.h"
-#include "settingswidget.h"
 
 namespace Ui {
 class ControlBarWidget;
@@ -33,24 +30,18 @@ class ControlBarWidget : public QWidget
 public:
     explicit ControlBarWidget(QWidget *parent = 0);
     ~ControlBarWidget();
-
-// day/night mode
-public Q_SLOTS:
-    void dayNightModeSlot(int mode);
+public slots:
+    void updateColorScheme();
+signals:
+    void settingsButtonPressed();
+    void homeButtonPressed();
 
 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;
-
-    // D-Bus day/night
-    SystemDayNight::eDayNightMode m_dayNightMode;
-    org::agl::daynightmode *mp_dayNightModeProxy;
 };
 
 #endif // CONTROLBARWIDGET_H
index 9108c35..be8b534 100644 (file)
@@ -36,8 +36,9 @@ int main(int argc, char *argv[])
     QCoreApplication::setOrganizationDomain("LinuxFoundation");
     QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
     QCoreApplication::setApplicationName("HomeScreen");
-    QCoreApplication::setApplicationVersion("0.1.0");
+    QCoreApplication::setApplicationVersion("0.1.1");
 
+    // maybe trigger the wayland compositor to position the surface correctly
     MainWindow w;
     w.move(0, 0);
     w.show();
index e2b55a9..bf7735c 100644 (file)
 
 #include "mainwindow.h"
 #include "ui_mainwindow.h"
+#include "../interfaces/daynightmode.h"
 
 MainWindow::MainWindow(QWidget *parent) :
     QMainWindow(parent),
     mp_ui(new Ui::MainWindow),
     mp_statusBarWidget(0),
     mp_controlBarWidget(0),
-    m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
-    mp_dayNightModeProxy(0),
-    mp_popupWidget(0)
+    mp_settingsWidget(0),
+    mp_popupWidget(0),
+    mp_dayNightModeProxy(0)
 {
     // this has to be adopted to the system setup
     mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
@@ -53,43 +54,74 @@ MainWindow::MainWindow(QWidget *parent) :
     // apply layout
     mp_controlBarWidget->move(0, 1920-60);
 
+    mp_settingsWidget = new SettingsWidget(this);
+    mp_settingsWidget->raise();
+    // apply layout
+    mp_settingsWidget->move(0, 60);
+    mp_settingsWidget->hide();
+
     mp_popupWidget = new PopupWidget(this);
     mp_controlBarWidget->raise();
     // apply layout
     mp_popupWidget->move(0, 0);
 
+    QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), this, SLOT(updateColorScheme()));
+    QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_statusBarWidget, SLOT(updateColorScheme()));
+    QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_controlBarWidget, SLOT(updateColorScheme()));
+    QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_settingsWidget, SLOT(updateColorScheme()));
+    QObject::connect(mp_settingsWidget, SIGNAL(colorSchemeChanged()), mp_popupWidget, SLOT(updateColorScheme()));
+
+    QObject::connect(mp_controlBarWidget, SIGNAL(settingsButtonPressed()), mp_settingsWidget, SLOT(show()));
+    QObject::connect(mp_controlBarWidget, SIGNAL(homeButtonPressed()), mp_settingsWidget, SLOT(hide()));
+
+    // apply color scheme
+    updateColorScheme();
+    mp_statusBarWidget->updateColorScheme();
+    mp_controlBarWidget->updateColorScheme();
+    mp_settingsWidget->updateColorScheme();
+    mp_popupWidget->updateColorScheme();
+
     setWindowIcon(QIcon(":/icons/home_day.png"));
 }
 
 MainWindow::~MainWindow()
 {
-    delete mp_popupWidget;
     delete mp_dayNightModeProxy;
+    delete mp_popupWidget;
+    delete mp_settingsWidget;
+    delete mp_controlBarWidget;
     delete mp_statusBarWidget;
     delete mp_ui;
 }
 
 void MainWindow::dayNightModeSlot(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;
-    }
+    QSettings settings;
+    settings.setValue("systemsettings/daynightmode", mode);
+    // make sure that everything is written to the settings file before continuing
+    settings.sync();
+
+    updateColorScheme();
+
+    mp_statusBarWidget->updateColorScheme();
+    mp_controlBarWidget->updateColorScheme();
+    mp_settingsWidget->updateColorScheme();
+    mp_popupWidget->updateColorScheme();
+}
+
+void MainWindow::updateColorScheme()
+{
+    QSettings settings;
+    QSettings settings_cs(QApplication::applicationDirPath() +
+                          "/colorschemes/" +
+                          settings.value("systemsettings/colorscheme", "default").toString() +
+                          "/" +
+                          QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+                          ".ini",
+                          QSettings::IniFormat);
+
+    mp_ui->widget_Background->setStyleSheet(settings_cs.value("MainWindow/widget_Background").toString());
+    mp_ui->widget_Home_Icon->setStyleSheet(settings_cs.value("MainWindow/widget_Home_Icon").toString());
 }
 
 void MainWindow::changeEvent(QEvent* event)
@@ -101,4 +133,3 @@ void MainWindow::changeEvent(QEvent* event)
 
     QMainWindow::changeEvent(event);
 }
-
index af725fd..d984c3e 100644 (file)
 #define MAINWINDOW_H
 
 #include <QMainWindow>
-#include "../interfaces/daynightmode.h"
 #include "daynightmode_proxy.h"
 
-#include "popupwidget.h"
-
 #include "statusbarwidget.h"
 #include "controlbarwidget.h"
+#include "settingswidget.h"
+#include "popupwidget.h"
+
 
 namespace Ui {
 class MainWindow;
@@ -42,6 +42,9 @@ public:
 public Q_SLOTS:
     void dayNightModeSlot(int mode);
 
+public slots:
+    void updateColorScheme();
+
 protected:
     // called when the translator loaded a new language set
     void changeEvent(QEvent* event);
@@ -53,11 +56,10 @@ private:
     org::agl::daynightmode *mp_dBusDayNightMode_StatusBarWidget;
     ControlBarWidget *mp_controlBarWidget;
     org::agl::daynightmode *mp_dBusDayNightMode_ControlBarWidget;
+    SettingsWidget *mp_settingsWidget;
+    PopupWidget *mp_popupWidget;
 
-    SystemDayNight::eDayNightMode m_dayNightMode;
     org::agl::daynightmode *mp_dayNightModeProxy;
-
-    PopupWidget *mp_popupWidget;
 };
 
 #endif // MAINWINDOW_H
index 81ffdf7..4a89771 100644 (file)
 
 #include "popupwidget.h"
 #include "ui_popupwidget.h"
+#include "../interfaces/daynightmode.h"
 
 PopupWidget::PopupWidget(QWidget *parent) :
     QWidget(parent),
     mp_ui(new Ui::PopupWidget),
-    m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
-    mp_dayNightModeProxy(0),
     mp_popupAdaptor(0)
 {
-    // this has to be adopted to the system setup
-    mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
-                                                      "/",
-                                                      QDBusConnection::sessionBus(),
-                                                      0);
-    QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
-
     // publish dbus popup interface
     mp_popupAdaptor = new PopupAdaptor((QObject*)this);
     QDBusConnection dbus = QDBusConnection::sessionBus();
@@ -43,57 +35,29 @@ PopupWidget::PopupWidget(QWidget *parent) :
 
 PopupWidget::~PopupWidget()
 {
-    delete mp_dayNightModeProxy;
     delete mp_popupAdaptor;
     delete mp_ui;
 }
 
-void PopupWidget::dayNightModeSlot(int mode)
+void PopupWidget::updateColorScheme()
 {
-    switch (mode)
-    {
-    case SystemDayNight::DAYNIGHTMODE_DAY:
-        m_dayNightMode = SystemDayNight::DAYNIGHTMODE_DAY;
-        mp_ui->widget_Popup->setStyleSheet(QString("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); \
-                                                   }"));
-        mp_ui->label_Text->setStyleSheet(QString("background-color: rgba(109, 109, 109, 0); \
-                                                 background-image: url(:/images/transparency.png); \
-                                                 border-image: url(:/images/transparency.png);"));
-        break;
-    case SystemDayNight::DAYNIGHTMODE_NIGHT:
-        m_dayNightMode = SystemDayNight::DAYNIGHTMODE_NIGHT;
-        mp_ui->widget_Popup->setStyleSheet(QString("QWidget { \
-                                                   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; \
-                                                   }  \
-                                                   QWidget:on { \
-                                                   background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #D5D5D5, stop: 1 #EEEEEE); \
-                                                   }"));
-        mp_ui->label_Text->setStyleSheet(QString("background-color: rgba(109, 109, 109, 0); \
-                                                 background-image: url(:/images/transparency.png); \
-                                                 border-image: url(:/images/transparency.png);"));
-        break;
-    default:
-        m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED;
-    }
+    QSettings settings;
+    QSettings settings_cs(QApplication::applicationDirPath() +
+                          "/colorschemes/" +
+                          settings.value("systemsettings/colorscheme", "default").toString() +
+                          "/" +
+                          QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+                          ".ini",
+                          QSettings::IniFormat);
+
+    mp_ui->widget_Popup->setStyleSheet(settings_cs.value(QString("PopupWidget/widget_Popup")).toString());
+    mp_ui->label_Text->setStyleSheet(settings_cs.value(QString("PopupWidget/label_Text")).toString());
 }
 
-void PopupWidget::showPopup(int type, const QString &text)
+void PopupWidget::showPopup(int /*type*/, const QString &text)
 {
     this->show();
     this->raise();
-    qDebug("PopupWidget::showPopup: type %d, text %s", type, text.toStdString().c_str());
     mp_ui->label_Text->setText(text);
 }
 
index a876576..a54a602 100644 (file)
@@ -20,9 +20,6 @@
 #include <QWidget>
 #include "../interfaces/popup.h"
 #include "popup_adapter.h"
-#include "../interfaces/daynightmode.h"
-#include "daynightmode_proxy.h"
-
 
 namespace Ui {
 class PopupWidget;
@@ -35,14 +32,12 @@ class PopupWidget : public QWidget
 public:
     explicit PopupWidget(QWidget *parent = 0);
     ~PopupWidget();
-
-// day/night mode
-public Q_SLOTS:
-    void dayNightModeSlot(int mode);
+public slots:
+    void updateColorScheme();
 
     // from popup_adapter.h
 public Q_SLOTS: // METHODS
-    void showPopup(int type, const QString &text);
+    void showPopup(int /*type*/, const QString &text);
 
 private slots:
     void on_pushButton_OK_clicked();
@@ -50,8 +45,6 @@ private slots:
 private:
     Ui::PopupWidget *mp_ui;
 
-    SystemDayNight::eDayNightMode m_dayNightMode;
-    org::agl::daynightmode *mp_dayNightModeProxy;
     PopupAdaptor *mp_popupAdaptor;
 };
 
index 039b99f..9c6f190 100644 (file)
 #include "settingswidget.h"
 #include "ui_settingswidget.h"
 #include <QSettings>
+#include "../interfaces/daynightmode.h"
 
 SettingsWidget::SettingsWidget(QWidget *parent) :
     QWidget(parent),
     mp_ui(new Ui::SettingsWidget),
-    m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
-    mp_dayNightModeProxy(0),
     mp_translator(0)
 {
-    // this has to be adopted to the system setup
-    mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
-                                                      "/",
-                                                      QDBusConnection::sessionBus(),
-                                                      0);
-    QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
+    // no window decoration
+    setWindowFlags(Qt::FramelessWindowHint);
 
     // multi-language support
     mp_translator = new QTranslator();
@@ -39,75 +34,40 @@ SettingsWidget::SettingsWidget(QWidget *parent) :
 
     mp_ui->setupUi(this);
 
-    mp_ui->comboBoxLanguage->addItem(QString("English"), QVariant("homescreen_en_US.qm")); // TODO: make this configurable?
+    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"));
 
+    mp_ui->comboBoxColorScheme->addItem(QString("Default"), QVariant("default")); // TODO: make this configurable
+    mp_ui->comboBoxColorScheme->addItem(QString("Demo 1"), QVariant("demo1"));
+    mp_ui->comboBoxColorScheme->addItem(QString("Demo 2"), QVariant("demo2"));
+
     QSettings settings;
     mp_ui->comboBoxLanguage->setCurrentIndex(settings.value("systemsettings/language", 0).toInt());
+    mp_ui->comboBoxColorScheme->setCurrentIndex(settings.value("systemsettings/colorschemeindex", 0).toInt());
 }
 
 SettingsWidget::~SettingsWidget()
 {
     delete mp_translator;
-    delete mp_dayNightModeProxy;
-
-    QSettings settings;
-    settings.setValue("systemsettings/language", mp_ui->comboBoxLanguage->currentIndex());
     delete mp_ui;
 }
 
-void SettingsWidget::dayNightModeSlot(int mode)
+void SettingsWidget::updateColorScheme()
 {
-    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;
-    }
+    QSettings settings;
+    QSettings settings_cs(QApplication::applicationDirPath() +
+                          "/colorschemes/" +
+                          settings.value("systemsettings/colorscheme", "default").toString() +
+                          "/" +
+                          QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+                          ".ini",
+                          QSettings::IniFormat);
+
+    mp_ui->widget_Background->setStyleSheet(settings_cs.value("SettingsWidget/widget_Background").toString());
+    mp_ui->comboBoxLanguage->setStyleSheet(settings_cs.value("SettingsWidget/comboBoxLanguage").toString());
+    mp_ui->comboBoxColorScheme->setStyleSheet(settings_cs.value("SettingsWidget/comboBoxColorScheme").toString());
+    mp_ui->widget_Settings_Icon->setStyleSheet(settings_cs.value("SettingsWidget/widget_Settings_Icon").toString());
 }
 
 void SettingsWidget::changeEvent(QEvent* event)
@@ -124,4 +84,18 @@ void SettingsWidget::on_comboBoxLanguage_currentIndexChanged(const QString &)
 {
     if (0 != mp_translator)
         mp_translator->load(mp_ui->comboBoxLanguage->currentData().toString(), ":/translations");
+
+    QSettings settings;
+    settings.setValue("systemsettings/language", mp_ui->comboBoxLanguage->currentIndex());
+}
+
+void SettingsWidget::on_comboBoxColorScheme_currentIndexChanged(const QString &)
+{
+    QSettings settings;
+    settings.setValue("systemsettings/colorscheme", mp_ui->comboBoxColorScheme->currentData().toString());
+    settings.setValue("systemsettings/colorschemeindex", mp_ui->comboBoxColorScheme->currentIndex());
+    // make sure that everything is written to the settings file before continuing
+    settings.sync();
+
+    emit colorSchemeChanged();
 }
index 15b24bd..e0b3fef 100644 (file)
@@ -19,9 +19,6 @@
 
 #include <QWidget>
 #include <QTranslator>
-#include "../interfaces/daynightmode.h"
-#include "daynightmode_proxy.h"
-
 
 namespace Ui {
 class SettingsWidget;
@@ -34,10 +31,8 @@ class SettingsWidget : public QWidget
 public:
     explicit SettingsWidget(QWidget *parent = 0);
     ~SettingsWidget();
-
-// day/night mode
-public Q_SLOTS:
-    void dayNightModeSlot(int mode);
+public slots:
+    void updateColorScheme();
 
 protected:
     // called when the translator loaded a new language set
@@ -45,13 +40,13 @@ protected:
 
 private slots:
     void on_comboBoxLanguage_currentIndexChanged(const QString &);
+    void on_comboBoxColorScheme_currentIndexChanged(const QString &);
+
+signals:
+    void colorSchemeChanged(void);
 
 private:
     Ui::SettingsWidget *mp_ui;
-
-    SystemDayNight::eDayNightMode m_dayNightMode;
-    org::agl::daynightmode *mp_dayNightModeProxy;
-
     QTranslator *mp_translator;
 };
 
index af144c5..442c3e7 100644 (file)
 
 #include "statusbarwidget.h"
 #include "ui_statusbarwidget.h"
+#include "../interfaces/daynightmode.h"
 
 StatusBarWidget::StatusBarWidget(QWidget *parent) :
     QWidget(parent),
     mp_ui(new Ui::StatusBarWidget),
-    m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
-    mp_dayNightModeProxy(0),
     mp_statusbarAdaptor(0),
     mp_statusbarIconURIs(new QMap<int, QString>)
 {
-    // this has to be adopted to the system setup
-    mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
-                                                      "/",
-                                                      QDBusConnection::sessionBus(),
-                                                      0);
-    QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
-
     // publish statusbar interface
     mp_statusbarAdaptor = new StatusbarAdaptor((QObject*)this);
 
-  QDBusConnection dbus = QDBusConnection::sessionBus();
+    QDBusConnection dbus = QDBusConnection::sessionBus();
     dbus.registerObject("/StatusBar", this);
     dbus.registerService("org.agl.homescreen");
 
@@ -45,35 +37,37 @@ StatusBarWidget::StatusBarWidget(QWidget *parent) :
 StatusBarWidget::~StatusBarWidget()
 {
     delete mp_statusbarAdaptor;
-    delete mp_dayNightModeProxy;
     delete mp_ui;
 }
 
-void StatusBarWidget::dayNightModeSlot(int mode)
+void StatusBarWidget::updateColorScheme()
 {
-    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(") + mp_statusbarIconURIs->value(1) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(2) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(3) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_4->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(4) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(5) + QString("); background-repeat: no-repeat;"));
-        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(") + mp_statusbarIconURIs->value(1) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(2) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(3) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_4->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(4) + QString("); background-repeat: no-repeat;"));
-        mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(5) + QString("); background-repeat: no-repeat;"));
-        break;
-    default:
-        m_dayNightMode = SystemDayNight::DAYNIGHTMODE_UNDEFINED;
-    }
+    QSettings settings;
+    QSettings settings_cs(QApplication::applicationDirPath() +
+                          "/colorschemes/" +
+                          settings.value("systemsettings/colorscheme", "default").toString() +
+                          "/" +
+                          QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
+                          ".ini",
+                          QSettings::IniFormat);
+
+    mp_ui->widget->setStyleSheet(settings_cs.value(QString("StatusBarWidget/widget")).toString());
+    mp_ui->label_1->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_1")).toString());
+    mp_ui->label_2->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_2")).toString());
+    mp_ui->label_3->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_3")).toString());
+    mp_ui->label_4->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_4")).toString());
+    mp_ui->label_5->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_5")).toString());
+
+    mp_ui->label_1_icon->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_1_icon")).toString()
+                                       + QString(" border-image: url(") + mp_statusbarIconURIs->value(1) + QString(") 0 0 0 0 stretch stretch;"));
+    mp_ui->label_2_icon->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_2_icon")).toString()
+                                       + QString(" border-image: url(") + mp_statusbarIconURIs->value(2) + QString(") 0 0 0 0 stretch stretch;"));
+    mp_ui->label_3_icon->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_3_icon")).toString()
+                                       + QString(" border-image: url(") + mp_statusbarIconURIs->value(3) + QString(") 0 0 0 0 stretch stretch;"));
+    mp_ui->label_4_icon->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_4_icon")).toString()
+                                       + QString(" border-image: url(") + mp_statusbarIconURIs->value(4) + QString(") 0 0 0 0 stretch stretch;"));
+    mp_ui->label_5_icon->setStyleSheet(settings_cs.value(QString("StatusBarWidget/label_5_icon")).toString()
+                                       + QString(" border-image: url(") + mp_statusbarIconURIs->value(5) + QString(") 0 0 0 0 stretch stretch;"));
 }
 
 QList<int> StatusBarWidget::getAvailablePlaceholders()
@@ -127,55 +121,7 @@ void StatusBarWidget::setStatusIcon(int placeholderIndex, const QString &iconURI
 {
     mp_statusbarIconURIs->insert(placeholderIndex, iconURI);
 
-    switch (m_dayNightMode)
-    {
-    case SystemDayNight::DAYNIGHTMODE_DAY:
-        switch (placeholderIndex)
-        {
-        case 1:
-            mp_ui->label_1->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 2:
-            mp_ui->label_2->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 3:
-            mp_ui->label_3->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 4:
-            mp_ui->label_4->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 5:
-            mp_ui->label_5->setStyleSheet(QString("color: rgb(238, 238, 238); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        default:
-            break;
-        }
-        break;
-    case SystemDayNight::DAYNIGHTMODE_NIGHT:
-        switch (placeholderIndex)
-        {
-        case 1:
-            mp_ui->label_1->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 2:
-            mp_ui->label_2->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 3:
-            mp_ui->label_3->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 4:
-            mp_ui->label_4->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        case 5:
-            mp_ui->label_5->setStyleSheet(QString("color: rgb(177, 177, 177); background-image: url(") + mp_statusbarIconURIs->value(placeholderIndex) + QString("); background-repeat: no-repeat;"));
-            break;
-        default:
-            break;
-        }
-        break;
-    default:
-        break;
-    }
+    updateColorScheme();
 }
 
 void StatusBarWidget::setStatusText(int placeholderIndex, const QString &text)
@@ -201,5 +147,3 @@ void StatusBarWidget::setStatusText(int placeholderIndex, const QString &text)
         break;
     }
 }
-
-
index e17f13e..29c236d 100644 (file)
@@ -18,9 +18,6 @@
 #define STATUSBARWIDGET_H
 
 #include <QWidget>
-#include "../interfaces/daynightmode.h"
-#include "daynightmode_proxy.h"
-
 #include "statusbar_adapter.h"
 
 namespace Ui {
@@ -34,10 +31,8 @@ class StatusBarWidget : public QWidget
 public:
     explicit StatusBarWidget(QWidget *parent = 0);
     ~StatusBarWidget();
-
-// day/night mode
-public Q_SLOTS:
-    void dayNightModeSlot(int mode);
+public slots:
+    void updateColorScheme();
 
 // from statusbar_adapter.h
 public Q_SLOTS: // METHODS
@@ -50,8 +45,6 @@ public Q_SLOTS: // METHODS
 private:
     Ui::StatusBarWidget *mp_ui;
 
-    SystemDayNight::eDayNightMode m_dayNightMode;
-    org::agl::daynightmode *mp_dayNightModeProxy;
     StatusbarAdaptor *mp_statusbarAdaptor;
 
     QMap<int, QString> *mp_statusbarIconURIs;
index ae57a86..04aff3c 100644 (file)
@@ -23,101 +23,31 @@ TEMPLATE = app
 SOURCES += \
     src/main.cpp \
     src/mainwindow.cpp
-GENERATED_SOURCES += \
-    $$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/statusbar_adapter.cpp \        #generated dbus adapter
-    $$OUT_PWD/statusbar_proxy.cpp              #generated dbus proxy
 
 HEADERS  += \
     ../interfaces/daynightmode.h \
     ../interfaces/popup.h \
     src/mainwindow.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/statusbar_adapter.h \      #generated dbus adapter
-    $$OUT_PWD/statusbar_proxy.h            #generated dbus proxy
+    $$OUT_PWD/../interfaces/daynightmode_adapter.h \      #generated dbus adapter
+    $$OUT_PWD/../interfaces/daynightmode_proxy.h \        #generated dbus proxy
+    $$OUT_PWD/../interfaces/popup_adapter.h \             #generated dbus adapter
+    $$OUT_PWD/../interfaces/popup_proxy.h \               #generated dbus proxy
+    $$OUT_PWD/../interfaces/statusbar_adapter.h \         #generated dbus adapter
+    $$OUT_PWD/../interfaces/statusbar_proxy.h             #generated dbus proxy
+
+INCLUDEPATH += $$OUT_PWD/../interfaces
+
+LIBS += -L$$OUT_PWD/../interfaces -linterfaces
 
 FORMS    += \
     resources/mainwindow.ui
 
 OTHER_FILES += \
-    interfaces/daynightmode.xml \
-    interfaces/popup.xml \
-    interfaces/statusbar.xml \
     README.md
 
 RESOURCES +=
 
 # 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
-# OE_QMAKE_PATH_EXTERNAL_HOST_BINS is only defined in the yocto environment
-isEmpty(OE_QMAKE_PATH_EXTERNAL_HOST_BINS){
-  OE_QMAKE_PATH_EXTERNAL_HOST_BINS = "/"
-}
-# for daynightmode
-daynightmodegenerateadapter.target = $$OUT_PWD/daynightmode_adapter.cpp
-unix:daynightmodegenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a daynightmode_adapter $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/daynightmode_adapter.h -o $$OUT_PWD/daynightmode_adapter.moc"
-daynightmodegenerateproxy.target = $$OUT_PWD/daynightmode_proxy.cpp
-unix:daynightmodegenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p daynightmode_proxy $$_PRO_FILE_PWD_/../interfaces/daynightmode.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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 = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a popup_adapter $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/popup_adapter.h -o $$OUT_PWD/popup_adapter.moc"
-popupgenerateproxy.target = $$OUT_PWD/popup_proxy.cpp
-unix:popupgenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p popup_proxy $$_PRO_FILE_PWD_/../interfaces/popup.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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 statusbar
-statusbargenerateadapter.target = $$OUT_PWD/statusbar_adapter.cpp
-unix:statusbargenerateadapter.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -a statusbar_adapter $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_adapter.h -o $$OUT_PWD/statusbar_adapter.moc"
-statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp
-unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)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
-
+    $$OUT_PWD/HomeScreenSimulator \
+    $$OUT_PWD/Makefile
index 55152cd..30dbfe8 100644 (file)
@@ -1,9 +1,19 @@
 AGL Home Screen Simulator for development
 
 
+Build with QtCreator 3.0.1
+
 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-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.1.1
+07/06/2015
+
+#changes
+- D-Bus interface calsses now linkes as static lib
 
 v0.1.0
 06/24/2016
index 9c5a108..921c4eb 100644 (file)
@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
     QCoreApplication::setOrganizationDomain("LinuxFoundation");
     QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
     QCoreApplication::setApplicationName("HomeScreenSimulator");
-    QCoreApplication::setApplicationVersion("0.1.0");
+    QCoreApplication::setApplicationVersion("0.1.1");
 
     MainWindow w;
     w.show();
index 253ffa2..1cf76a1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,9 +2,13 @@ This project contains:
 
 HomeScreen: AGL Home Screen reference implementation
 HomeScreenSimulator: AGL Home Screen Simulator for development
+interfaces: library with the D-Bus interfaces
 SampleAppTimeDate: AGL Sample Application for Home Screen Statusbar
 
 
 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-demo-hmi/HomeScreen/HomeScreen_?.bb
+
index 5016865..65459c7 100644 (file)
@@ -1,9 +1,19 @@
 AGL Sample Application for Home Screen Statusbar
 This application simply shows the current time in the home screen status bar
 
+Build with QtCreator 3.0.1
+
 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-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.1.1
+07/06/2015
+
+#changes
+- D-Bus interface calsses now linkes as static lib
 
 v0.1.0
 06/24/2016
index 0fc8086..1ae61dd 100644 (file)
@@ -1,8 +1,16 @@
-#-------------------------------------------------
+# Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
 #
-# Project created by QtCreator 2016-06-21T13:46:39
+# 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.
 
 QT       += core dbus
 QT       -= gui
@@ -16,30 +24,19 @@ TEMPLATE = app
 
 SOURCES += src/main.cpp \
     src/timedateprovider.cpp
-GENERATED_SOURCES += \
-    $$OUT_PWD/statusbar_proxy.cpp             #generated dbus proxy
 
 HEADERS += \
-    $$OUT_PWD/statusbar_proxy.h \           #generated dbus proxy
+    $$OUT_PWD/../interfaces/statusbar_proxy.h \          #generated dbus proxy
     src/timedateprovider.h
 
+INCLUDEPATH +=  $$OUT_PWD/../interfaces
+
+LIBS += -L$$OUT_PWD/../interfaces -linterfaces
+
 OTHER_FILES += \
-    ../interfaces/statusbar.xml \
     README.md
 
 # remove generated files
 QMAKE_CLEAN += -r \
-    $$OUT_PWD/HomeScreen \
-    $$OUT_PWD/Makefile \
-    $$OUT_PWD/statusbar_proxy.h \
-    $$OUT_PWD/statusbar_proxy.cpp \
-    $$OUT_PWD/statusbar_proxy.moc
-
-# Create custom targets for generating dbus proxy
-# for statusbar
-statusbargenerateproxy.target = $$OUT_PWD/statusbar_proxy.cpp
-unix:statusbargenerateproxy.commands = "$(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)qdbusxml2cpp -m -p statusbar_proxy $$_PRO_FILE_PWD_/../interfaces/statusbar.xml; $(OE_QMAKE_PATH_EXTERNAL_HOST_BINS)moc $$OUT_PWD/statusbar_proxy.h -o $$OUT_PWD/statusbar_proxy.moc"
-PRE_TARGETDEPS += \
-    $$OUT_PWD/statusbar_proxy.cpp
-QMAKE_EXTRA_TARGETS += \
-    statusbargenerateproxy
+    $$OUT_PWD/SampleAppTimeDate \
+    $$OUT_PWD/Makefile
index d432cba..cc10b81 100644 (file)
@@ -5,6 +5,12 @@ int main(int argc, char *argv[])
 {
     QCoreApplication a(argc, argv);
 
+    // used for application settings (QSettings)
+    QCoreApplication::setOrganizationDomain("LinuxFoundation");
+    QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
+    QCoreApplication::setApplicationName("SampleAppTimeDate");
+    QCoreApplication::setApplicationVersion("0.1.1");
+
     TimeDateProvider *tdp = new TimeDateProvider();
     tdp->start();
 
diff --git a/interfaces/LICENSE b/interfaces/LICENSE
new file mode 100644 (file)
index 0000000..31c692a
--- /dev/null
@@ -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/interfaces/README.md b/interfaces/README.md
new file mode 100644 (file)
index 0000000..0d11315
--- /dev/null
@@ -0,0 +1,17 @@
+AGL Home Screen reference implementation
+This lib provides the needed D-Bus interfaces
+
+Build with QtCreator 3.0.1
+
+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-demo-hmi/HomeScreen/HomeScreen_?.bb
+
+v0.1.1
+07/06/2016
+
+#new features
+- initial version
+
index bf16f29..4081212 100644 (file)
@@ -20,9 +20,9 @@
 namespace SystemDayNight {
     typedef enum DayNightMode
     {
-        DAYNIGHTMODE_UNDEFINED,
-        DAYNIGHTMODE_DAY,
-        DAYNIGHTMODE_NIGHT
+        DAYNIGHTMODE_UNDEFINED = -1,
+        DAYNIGHTMODE_DAY = 0,
+        DAYNIGHTMODE_NIGHT = 1
     } eDayNightMode;
 }
 
diff --git a/interfaces/interfaces.pro b/interfaces/interfaces.pro
new file mode 100644 (file)
index 0000000..c2b8cc0
--- /dev/null
@@ -0,0 +1,59 @@
+# 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.
+
+QT += core gui dbus
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TEMPLATE = lib
+CONFIG += staticlib
+TARGET = interfaces
+
+XMLSOURCES = \
+    daynightmode.xml \
+    popup.xml \
+    statusbar.xml
+
+gen_adapter_cpp.input = XMLSOURCES
+gen_adapter_cpp.commands = \
+    qdbusxml2cpp -m -a ${QMAKE_FILE_IN_BASE}_adapter ${QMAKE_FILE_IN}; \
+    moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adapter.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_adapter.moc
+gen_adapter_cpp.output = ${QMAKE_FILE_IN_BASE}_adapter.cpp
+gen_adapter_cpp.variable_out = SOURCES
+gen_adapter_cpp.clean = ${QMAKE_FILE_IN_BASE}_adapter.cpp
+
+gen_proxy_cpp.input = XMLSOURCES
+gen_proxy_cpp.commands = \
+    qdbusxml2cpp -m -p ${QMAKE_FILE_IN_BASE}_proxy ${QMAKE_FILE_IN}; \
+    moc $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.h -o $$OUT_PWD/${QMAKE_FILE_IN_BASE}_proxy.moc
+gen_proxy_cpp.output = ${QMAKE_FILE_IN_BASE}_proxy.cpp
+gen_proxy_cpp.variable_out = SOURCES
+gen_proxy_cpp.clean = ${QMAKE_FILE_IN_BASE}_proxy.cpp
+
+gen_adapter_h.input = XMLSOURCES
+gen_adapter_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN}
+gen_adapter_h.depends = ${QMAKE_FILE_IN_BASE}_adapter.cpp
+en_adapter_h.output = ${QMAKE_FILE_IN_BASE}_adapter.h
+gen_adapter_h.clean = ${QMAKE_FILE_IN_BASE}_adapter.h
+
+gen_proxy_h.input = XMLSOURCES
+gen_proxy_h.commands = @echo Fake making the header for ${QMAKE_FILE_IN}
+gen_proxy_h.depends = ${QMAKE_FILE_IN_BASE}_proxy.cpp
+gen_proxy_h.output = ${QMAKE_FILE_IN_BASE}_proxy.h
+gen_proxy_h.clean = ${QMAKE_FILE_IN_BASE}_proxy.h
+
+QMAKE_EXTRA_COMPILERS += gen_adapter_cpp gen_proxy_cpp gen_adapter_h gen_proxy_h
+
+# remove generated files
+QMAKE_CLEAN += -r \
+    $$OUT_PWD/*