HMI_DEBUG(APP_ID, "EventHandler::activateWindow()");
mp_wm->activateWindow(role, area);
#endif
- fprintf(stdout, "EventHandler::activateWindow() role %s, area %s\n",
+ fprintf(stderr, "EventHandler::activateWindow() role %s, area %s\n",
role, area);
}
}
#endif
int display_status = getDisplayStatus();
- fprintf(stdout, "EventHandler::deactivateWindow(), "
+ fprintf(stderr, "EventHandler::deactivateWindow(), "
"display_status %d\n", display_status);
}
void EventHandler::onScreenReply(const QString &ons_title, const QString &btn_name)
{
-#if 0
- HMI_DEBUG(APP_ID, "ons_title=%s btn_name=%s", ons_title.toStdString().c_str(), btn_name.toStdString().c_str());
+ fprintf(stderr, "ons_title=%s btn_name=%s\n", ons_title.toStdString().c_str(), btn_name.toStdString().c_str());
emit this->hideOnScreen();
+#if 0
struct json_object* j_param = json_object_new_object();
json_object_object_add(j_param, _onscreen_title, json_object_new_string(ons_title.toStdString().c_str()));
json_object_object_add(j_param, _button_name, json_object_new_string(btn_name.toStdString().c_str()));
mp_hs->replyShowWindow(m_dsp.first.toStdString().c_str(), j_param);
#endif
- fprintf(stdout, "EventHandler::onScreenReply with ons_title %s, btn_name %s\n",
+ fprintf(stderr, "EventHandler::onScreenReply with ons_title %s, btn_name %s\n",
ons_title.toStdString().c_str(), btn_name.toStdString().c_str());
}
id: root
flags: Qt.FramelessWindowHint
visible: true
- x: 0
- y: 218
+ x: 0 // note, these are not set here
+ y: 218 // note, these are not set here
width: 1080
height: 1488
color: '#00000000'
ons.btn1Name = onscreenModel.buttonName(0)
ons.btn2Name = onscreenModel.buttonName(1)
ons.btn3Name = onscreenModel.buttonName(2)
+
+ console.log("dsp_title = " + ons.dsp_title + ", dsp_contents = " + ons.dsp_contents)
+ if (ons.btnNum > 0) {
+ console.log("Got ons.btNum > 0 " + ons.btnNum)
+ } else {
+ console.log("ons.btNum is " + ons.btnNum)
+ }
ons_timer.running = ons.btnNum > 0 ? false : true
ons.dsp_sts = "show"
}
console.log(qsTr('onscreenapp >>> setModel status: ' + data));
onscreenModel.setModel(data)
}
+
+ function clearOnScreenModel() {
+ onscreenModel.clearModel()
+ }
}
void OnScreenModel::setModel(QVariant data)
{
- HMI_DEBUG(_modelName, "setModel start!");
+ fprintf(stderr, "OnScreenModel::setModel: setModel start!\n");
+
clearModel();
struct json_object *j_title = nullptr, *j_type = nullptr, *j_contents = nullptr, *j_buttons = nullptr;
struct json_object *j_param = json_tokener_parse(data.toString().toStdString().c_str());
+
+ fprintf(stderr, "OnScreenModel::setModel receiving end: %s\n", data.toString().toStdString().c_str());
+
if(json_object_object_get_ex(j_param, _title, &j_title)) {
m_title = json_object_get_string(j_title);
}
else {
- HMI_DEBUG(_modelName, "title input is null");
+ fprintf(stderr, "OnScreenModel::setModel: title input is null\n");
}
if(json_object_object_get_ex(j_param, _type, &j_type)) {
m_type = json_object_get_string(j_type);
}
else {
- HMI_DEBUG(_modelName, "type input is null");
+ fprintf(stderr, "OnScreenModel::setModel: type input is null\n");
}
if(json_object_object_get_ex(j_param, _contents, &j_contents)) {
m_contents = json_object_get_string(j_contents);
}
else {
- HMI_DEBUG(_modelName, "contents input is null");
+ fprintf(stderr, "OnScreenModel::setModel: contents input is null\n");
}
if(json_object_object_get_ex(j_param, _buttons, &j_buttons)) {
if(json_object_get_type(j_buttons) != json_type_array) {
- HMI_DEBUG(_modelName, "buttons josn type isn't array!");
+ fprintf(stderr, "OnScreenModel::setModel buttons josn type isn't array!\n");
}
else {
m_buttons.clear();
}
}
else {
- HMI_DEBUG("OnScreenModel", "buttons input is null");
+ fprintf(stderr, "OnScreenModel::setModel: buttons input is null\n");
}
- HMI_DEBUG(_modelName, "setModel end!titile=%s,type=%s,contents=%s,btnNum=%d",
+
+ fprintf(stderr, "OnScreenModel::setModel setModel end!titile=%s,type=%s,contents=%s,btnNum=%d\n",
m_title.toStdString().c_str(), m_type.toStdString().c_str(), m_contents.toStdString().c_str(), m_buttons.size());
}
Q_INVOKABLE int buttonNum(void) const {return m_buttons.size();}
Q_INVOKABLE QString buttonName(int index) const;
Q_INVOKABLE void setModel(QVariant data);
+ Q_INVOKABLE void clearModel(void);
private:
- void clearModel(void);
-
QString m_title;
QString m_type;
QString m_contents;