static UIInformation *uiInfo;
#define CONTROL_PRIORITY_MAX 10
+#define SKIN_PROPERTIES_FILE_NAME ".skin.properties"
+#define SKIN_INFO_FILE_NAME "info.ini"
#define FORM_FILE_NAME "layout.qml"
#define CON_FORM_SUBPATH "controller"
-void qt5_skin_init(void)
+void qt5_gui_init(void)
{
+ QCoreApplication::setApplicationName("Tizen Emulator");
+
qDebug() << "* Qt version :" << QT_VERSION_STR;
qDebug() << "* working path :" << QDir::currentPath();
qDebug() << "* binary path :" << QCoreApplication::applicationDirPath();
uiInfo->resolution.setHeight(get_emul_resolution_height());
uiInfo->basePort = get_emul_vm_base_port();
+ uiInfo->vmDataPath = get_emul_vm_data_path();
+ if (uiInfo->vmDataPath.endsWith(QDir::separator()) == false) {
+ uiInfo->vmDataPath += QDir::separator();
+ }
+
uiInfo->skinPath = QDir(get_emul_skin_path()).canonicalPath();
if (uiInfo->skinPath.endsWith(QDir::separator()) == false) {
uiInfo->skinPath += QDir::separator();
}
- QSettings skinInfo(uiInfo->skinPath + "info.ini", QSettings::IniFormat);
+ /* read skin information */
+ QSettings skinInfo(uiInfo->skinPath + SKIN_INFO_FILE_NAME,
+ QSettings::IniFormat);
QString skinName = skinInfo.value("skin.name").toString();
if (skinName.isEmpty() == true) {
skinName = "Undefined";
}
uiInfo->skinName = skinName;
- uiInfo->uiState.mainFormScale = 50;
+ /* read MRU information */
+ QSettings mruInfo(uiInfo->vmDataPath + SKIN_PROPERTIES_FILE_NAME,
+ QSettings::IniFormat);
+ int scale = mruInfo.value("window.scale").toInt();
+ qDebug("previous scale value is %d", scale);
+
+ if (scale <= 0) {
+ scale = 50;
+ }
+ uiInfo->uiState.mainFormScale = scale;
/* XML */
// TODO: convert QML to XML
/* GUI */
qDebug("start!");
+
mainwindow = new MainWindow(uiInfo);
-// mainwindow->move(100, 100); // TODO: MRU
+
+ /* position */
+ int xx = mruInfo.value("window.x").toInt();
+ int yy = mruInfo.value("window.y").toInt();
+ qDebug("previous position value is (%d, %d)", xx, yy);
+
+ if (xx == 0 && yy == 0) {
+ xx = yy = uiInfo->basePort % 100;
+ }
+ mainwindow->move(xx, yy);
+
mainwindow->show();
mainwindow->openController(getControlIndex(), true);
void qt5_prepare(void)
{
- qt5_skin_init();
+ qt5_gui_init();
}
void qt5_update_internal(void *data, int width, int height)