all:
cd src && $(MAKE) all
+ cd standalone-src && $(MAKE) all
clean:
cd src && $(MAKE) clean
+ cd standalone-src && $(MAKE) clean
distclean:
cd src && $(MAKE) distclean
+ cd standalone-src && $(MAKE) clean
install:
cd src && $(MAKE) install
-build_supplements:
- cd src && $(MAKE) build_supplements
-install_supplements:
- cd src && $(MAKE) install_supplements
+ cd standalone-src && $(MAKE) install
# for dibs system...
all_dibs:
cd src && $(MAKE) all_dibs
+ cd standalone-src && $(MAKE) all
install_dibs:
cd src && $(MAKE) install_dibs
-install_supplements_dibs:
- cd src && $(MAKE) install_supplements_dibs
+ cd standalone-src && $(MAKE) install_dibs
# hotplug
obj-y += device_hotplug.o
+# qt5 error handler
+obj-y += qt5_error_report.o
+
# error handler
obj-y += error_handler.o
#include "skin/maruskin_client.h"
#endif
+#ifdef CONFIG_QT
+#include "qt5_error_report.h"
+#endif
+
#if defined(CONFIG_WIN32)
static LPTOP_LEVEL_EXCEPTION_FILTER prevExceptionFilter;
#elif defined(CONFIG_LINUX)
#ifdef CONFIG_QT
if (display_type == DT_MARU_QT_ONSCREEN ||
display_type == DT_MARU_QT_OFFSCREEN) {
- // TODO: new pop-up dialog is needed
+ start_qt5_msgbox(CRITICAL_ICON, message);
}
#endif
#ifdef CONFIG_JAVA_UI
--- /dev/null
+/*
+ * Qt Error Report
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye Won <jihye.won1@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "qt5_error_report.h"
+#include <glib.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include "debug_ch.h"
+#include "emul_state.h"
+
+#ifdef CONFIG_WIN32
+#include <process.h>
+#endif
+
+MULTI_DEBUG_CHANNEL(qemu, qt5_msgbox);
+
+static const char * const icon_types[] = {
+ "0", "1", "2", "3", "4"};
+
+char *get_app_path(void)
+{
+ const char *bin_dir = get_bin_path();
+ int bin_len = strlen(bin_dir);
+ const char *app_name = "qt5_msgbox";
+ int app_len = strlen(app_name);
+ int app_path_len = bin_len + app_len + 3;
+ char *tmp_path = (char *)g_malloc0(app_path_len);
+ strcpy(tmp_path, bin_dir);
+ strcat(tmp_path, app_name);
+ tmp_path[app_path_len - 1] = '\0';
+
+ INFO("qt5_msgbox path : %s\n", tmp_path);
+ return tmp_path;
+}
+
+void start_qt5_msgbox(qt5_msgbox_icon icon, const char *message)
+{
+ char *app_path = get_app_path();
+ const char *title = "Emulator";
+ const char *argv[] = {app_path, icon_types[icon], title, message, NULL};
+
+#ifdef CONFIG_WIN32
+ INFO("qt5_msgbox starts... \n");
+ if (spawnv(P_NOWAIT, app_path, argv) == -1)
+ ERR("qt5_msgbox can not be executed \n");
+#else
+ pid_t child_pid = fork();
+ if (child_pid == 0) {
+ INFO("qt5_msgbox starts... \n");
+ if(execvp(app_path, (char * const *) argv) == -1)
+ ERR("qt5_msgbox can not be executed \n");
+ exit(0);
+ } else if (child_pid == -1) {
+ ERR("qt5_msgbox can not be executed \n");
+ }
+#endif
+ g_free(app_path);
+}
--- /dev/null
+/*
+ * Qt Error Report
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye Won <jihye.won1@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef __ERROR_REPORT_H__
+#define __ERROR_REPORT_H__
+
+typedef enum {
+ NO_ICON = 0,
+ INFORMATION_ICON = 1,
+ WARNING_ICON = 2,
+ CRITICAL_ICON = 3,
+ QUESTION_ICON = 4
+} qt5_msgbox_icon;
+
+char *get_app_path(void);
+void start_qt5_msgbox(qt5_msgbox_icon icon, const char *message);
+
+#endif /* __ERROR_REPORT_H__ */
--- /dev/null
+ifeq ($(wildcard ../../config-host.mak),../../config-host.mak)
+include ../../config-host.mak
+
+CXX = g++
+EMUL_DIR=../emulator
+DIBS_COMMON_DIR=../common
+TARGET_EXE += qt5_msgbox$(EXESUF)
+
+# for building qt5_msgbox
+QT5_MSGBOX_OBJS = qt5_msgbox
+QT5_MSGBOX_CFLAGS = $(QT_CFLAGS)
+QT5_MSGBOX_LIBS = $(shell pkg-config --libs Qt5Core Qt5Widgets Qt5Gui)
+ifndef CONFIG_DARWIN
+QT5_MSGBOX_LIBS += -L/usr/lib/x86_64-linux-gnu/
+endif
+QT5_MSGBOX_LDFLAGS = $(QT5_MSGBOX_LIBS)
+QT5_MSGBOX_TARGET = qt5_msgbox$(EXESUF)
+
+$(QT5_MSGBOX_TARGET): qt5_msgbox.cpp
+ifdef CONFIG_WIN32
+ $(shell windres qt5_msgbox.rc -O coff -o qt5_msgbox.res)
+ $(CXX) -o $(QT5_MSGBOX_OBJS) qt5_msgbox.res $< $(QT5_MSGBOX_CFLAGS) $(QT5_MSGBOX_LDFLAGS)
+else
+ $(CXX) -o $(QT5_MSGBOX_OBJS) $< $(QT5_MSGBOX_CFLAGS) $(QT5_MSGBOX_LDFLAGS)
+endif
+
+all: $(TARGET_EXE)
+
+clean:
+ rm -f $(TARGET_EXE)
+
+install: all
+# change loading path of dynamic shared libraries on MAC OS X
+ifdef CONFIG_DARWIN
+ @LIB_LIST="QtWidgets QtGui QtCore"; \
+ for target in $(TARGET_DIRS); do \
+ case "$$target" in \
+ i386-softmmu) \
+ BIN_ARR=( qt5_msgbox ); \
+ for bin in $${BIN_ARR[@]}; do \
+ LIB_ARR=( $$(otool -L $$bin | awk '/\opt\/local\/Library/ { split($$1, lib, "/"); print lib[9]}') ); \
+ for lib in $${LIB_ARR[@]}; do \
+ [[ $$LIB_LIST =~ $$lib ]] && IS_LIB=true || IS_LIB=false; \
+ if [ "$$IS_LIB" == "true" ] ; then \
+ install_name_tool -change /opt/local/Library/Frameworks/$$lib.framework/Versions/5/$$lib @loader_path/$$lib $$bin ; \
+ echo "$$bin: the loading path of $$lib is changed."; \
+ else \
+ echo "$$bin: $$lib does not exist in the loading path."; \
+ fi; \
+ done \
+ done \
+ ;; \
+ arm-softmmu) \
+ ;; \
+ esac; \
+ done
+endif
+ cp -pP $(TARGET_EXE) $(EMUL_DIR)/bin
+
+####### for dibs system...
+install_dibs: all
+# change loading path of dynamic shared libraries on MAC OS X
+ifdef CONFIG_DARWIN
+ @LIB_LIST="QtWidgets QtGui QtCore"; \
+ for target in $(TARGET_DIRS); do \
+ case "$$target" in \
+ i386-softmmu) \
+ BIN_ARR=( qt5_msgbox ); \
+ for bin in $${BIN_ARR[@]}; do \
+ LIB_ARR=( $$(otool -L $$bin | awk '/\opt\/local\/Library/ { split($$1, lib, "/"); print lib[9]}') ); \
+ for lib in $${LIB_ARR[@]}; do \
+ [[ $$LIB_LIST =~ $$lib ]] && IS_LIB=true || IS_LIB=false; \
+ if [ "$$IS_LIB" == "true" ] ; then \
+ install_name_tool -change /opt/local/Library/Frameworks/$$lib.framework/Versions/5/$$lib @loader_path/$$lib $$bin ; \
+ echo "$$bin: the loading path of $$lib is changed."; \
+ else \
+ echo "$$bin: $$lib does not exist in the loading path."; \
+ fi; \
+ done \
+ done \
+ ;; \
+ arm-softmmu) \
+ ;; \
+ esac; \
+ done
+endif
+ cp -pP qt5_msgbox $(DIBS_COMMON_DIR)/bin
+
+endif
--- /dev/null
+/*
+ * Qt MessageBox
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Jihye Won <jihye.won1@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include <QtWidgets>
+#include <QMessageBox>
+#include <QMessageBox>
+#include <stdlib.h>
+#include "../../config-host.h"
+
+#define MAX_MESSAGE_LEN 2048
+
+QMessageBox::Icon getIconType(int icon)
+{
+ QMessageBox::Icon ret;
+ switch(icon){
+ case 0:
+ ret = QMessageBox::NoIcon;
+ break;
+ case 1:
+ ret = QMessageBox::Information;
+ break;
+ case 2:
+ ret = QMessageBox::Warning;
+ break;
+ case 3:
+ ret = QMessageBox::Critical;
+ break;
+ case 4:
+ ret = QMessageBox::Question;
+ break;
+ default:
+ ret = QMessageBox::NoIcon;
+ break;
+ }
+ return ret;
+}
+
+static void createMsgBox(int argc, char *argv[])
+{
+#ifdef CONFIG_WIN32
+ char *tmp_msg = (char *)malloc(MAX_MESSAGE_LEN);
+ int index = 3;
+ strcpy(tmp_msg, argv[index]);
+
+ while(argv[++index] != NULL) {
+ strcat(tmp_msg, " ");
+ strcat(tmp_msg, argv[index]);
+ }
+ strcpy(argv[3], tmp_msg);
+ free(tmp_msg);
+#endif
+
+ QMessageBox *msgBox = new QMessageBox(
+ getIconType(atoi(argv[1])), // icon
+ argv[2], // title
+ argv[3], // message
+ QMessageBox::Ok);
+ msgBox->setDefaultButton(QMessageBox::Ok);
+ msgBox->setWindowModality(Qt::ApplicationModal);
+ msgBox->show();
+}
+
+int main(int argc, char *argv[])
+{
+ //check arguments
+ if(argc < 4)
+ {
+ qCritical("qt5_dialog needs correct arguments");
+ return 1;
+ }
+ else if(argv[2] == NULL || argv[3] == NULL)
+ {
+ qCritical("qt5_dialog title or message is null");
+ return 1;
+ }
+ else
+ {
+ QApplication msgApp(argc, argv);
+ createMsgBox(argc, argv);
+ return msgApp.exec();
+ }
+}
--- /dev/null
+#include "../../config-host.h"
+
+#ifdef CONFIG_MARU
+ID_ICON ICON "../src/ui/resource/icons/emulator_icon.ico"
+#else
+ID_ICON ICON "../../pc-bios/qemu-nsis.ico"
+#endif