void qMessageOutput(QtMsgType, const QMessageLogContext &, const QString &);
void loadMainFormFromXML(QFile *, UIInformation *);
void loadConFormFromXML(QFile *, UIInformation *);
-int getControlIndex();
-int getPriority(QFile *file);
QApplication *qt5App = NULL;
static MainWindow *mainwindow;
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"
+class ConFile {
+public:
+ QFile *formFile;
+ int priority;
+};
+
void qt5_gui_init(void)
{
QCoreApplication::setApplicationName("Tizen Emulator");
/* load controller forms */
QDir skinDir(uiInfo->skinPath + CON_FORM_SUBPATH);
QFileInfoList entries = skinDir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
- for (int i = 0; i < entries.size(); i++) {
- QFile conXMLFile(entries.at(i).filePath() + QDir::separator() + FORM_FILE_NAME);
- loadConFormFromXML(&conXMLFile, uiInfo);
+
+ if (entries.isEmpty() == false) {
+ /* sort by priority */
+ QList<ConFile *> conFileList;
+
+ for (int i = 0; i < entries.size(); i++) {
+ ConFile *conFile = new ConFile();
+
+ QString conPath = entries.at(i).filePath() + QDir::separator();
+ conFile->formFile = new QFile(conPath + FORM_FILE_NAME);
+ QSettings conInfo(conPath + SKIN_INFO_FILE_NAME, QSettings::IniFormat);
+ conFile->priority = conInfo.value("priority").toInt();
+
+ int j = 0;
+ for ( ; j < conFileList.size(); j++) {
+ if (conFileList.at(j)->priority > conFile->priority) {
+ break;
+ }
+ }
+ conFileList.insert(j, conFile);
+ }
+
+ /* loading */
+ for (int i = 0; i < conFileList.size(); i++) {
+ loadConFormFromXML(conFileList.at(i)->formFile, uiInfo);
+ delete conFileList.at(i)->formFile;
+ delete conFileList.at(i);
+ }
}
/* GUI */
mainwindow->show();
- mainwindow->openController(getControlIndex(), true);
+ mainwindow->openController(0, true);
mainwindow->startSwapper();
}
delete engine;
}
+#if 0
+#define CONTROL_PRIORITY_MAX 10
+
int getControlIndex()
{
int controlIndex = 0;
return priority;
}
+#endif