static UIInformation *uiInfo;
#define SKIN_PROPERTIES_FILE_NAME ".skin.properties"
+#define SKIN_PROPERTY_WINDOW_X "window.x"
+#define SKIN_PROPERTY_WINDOW_Y "window.y"
+#define SKIN_PROPERTY_WINDOW_SCALE "window.scale"
+#define SKIN_PROPERTY_CONTROLLER_INDEX "controller.index"
+
#define SKIN_INFO_FILE_NAME "info.ini"
#define FORM_FILE_NAME "layout.qml"
#define CON_FORM_SUBPATH "controller"
/* read MRU information */
QSettings mruInfo(uiInfo->vmDataPath + SKIN_PROPERTIES_FILE_NAME,
QSettings::IniFormat);
- int scale = mruInfo.value("window.scale").toInt();
+ int scale = mruInfo.value(SKIN_PROPERTY_WINDOW_SCALE).toInt();
qDebug("previous scale value is %d", scale);
if (scale <= 0) {
mainwindow = new MainWindow(uiInfo);
/* position */
- int xx = mruInfo.value("window.x").toInt();
- int yy = mruInfo.value("window.y").toInt();
+ int xx = mruInfo.value(SKIN_PROPERTY_WINDOW_X).toInt();
+ int yy = mruInfo.value(SKIN_PROPERTY_WINDOW_Y).toInt();
qDebug("previous position value is (%d, %d)", xx, yy);
if (xx == 0 && yy == 0) {
mainwindow->show();
- mainwindow->openController(0, true);
+ int conIndex = mruInfo.value(SKIN_PROPERTY_CONTROLLER_INDEX).toInt();
+ if (conIndex >= 0 && conIndex < uiInfo->conFormList.count()) {
+ mainwindow->openController(conIndex, true);
+ }
mainwindow->startSwapper();
}
/* write MRU information */
QSettings mruInfo(uiInfo->vmDataPath + SKIN_PROPERTIES_FILE_NAME,
QSettings::IniFormat);
- mruInfo.setValue("window.x", mainwindow->pos().x());
- mruInfo.setValue("window.y", mainwindow->pos().y());
- mruInfo.setValue("window.scale", uiInfo->uiState.mainFormScale);
+ mruInfo.setValue(SKIN_PROPERTY_WINDOW_X, mainwindow->pos().x());
+ mruInfo.setValue(SKIN_PROPERTY_WINDOW_Y, mainwindow->pos().y());
+ mruInfo.setValue(SKIN_PROPERTY_WINDOW_SCALE, uiInfo->uiState.mainFormScale);
+ mruInfo.setValue(SKIN_PROPERTY_CONTROLLER_INDEX, uiInfo->uiState.conState.conFormIndex);
mainwindow->terminateSwapper();
KeyListType *keyListType = NULL;
HardwareKeyType *hwKeyType = NULL;
- ControllerForm *conForm = new ControllerForm(fileInfo.dir().dirName());
+ QString conName = QQmlProperty::read(object, "name").toString();
+ ControllerForm *conForm = new ControllerForm(
+ conName.isEmpty() ? fileInfo.dir().dirName() : conName);
+
conForm->conImg[ControllerForm::normal].load(fileInfo.absolutePath()
+ QDir::separator() + formType->mainImageName());
conForm->conImg[ControllerForm::pressed].load(fileInfo.absolutePath()