From: GiWoong Kim Date: Thu, 23 Jul 2015 08:27:22 +0000 (+0900) Subject: ui: string extraction X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~286^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d410eb94a606d82f3041e0017288d1ab71f54112;p=sdk%2Femulator%2Fqemu.git ui: string extraction add headers file for XML schema keywords, property keywords and menu dialog texts. Change-Id: I493e42a12ffd13e5bc40b70c2d22e9855b51f544 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/display/propertykeyword.h b/tizen/src/display/propertykeyword.h new file mode 100644 index 0000000000..8763e40a80 --- /dev/null +++ b/tizen/src/display/propertykeyword.h @@ -0,0 +1,41 @@ +/* + * Qt UI + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim + * Sangho Park + * + * 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 PROPERTYKEYWORD_H +#define PROPERTYKEYWORD_H + +#define SKIN_PROPERTY_NAME "skin.name" +#define SKIN_PROPERTY_WINDOW_X "window.x" +#define SKIN_PROPERTY_WINDOW_Y "window.y" +#define SKIN_PROPERTY_WINDOW_SCALE "window.scale" +#define SKIN_PROPERTY_WINDOW_TOPMOST "window.ontop" +#define SKIN_PROPERTY_CONTROLLER_INDEX "controller.index" +#define SKIN_PROPERTY_CONTROLLER_DOCK "controller.dock" + +#endif // PROPERTYKEYWORD_H diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index cee73116b4..249fcecd56 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -31,6 +31,7 @@ #include #include "qt5_supplement.h" +#include "propertykeyword.h" #include "mainwindow.h" #include "layout/hardwarekey.h" #include "xmllayoutparser.h" @@ -64,13 +65,6 @@ static MainWindow *mainwindow; static UIInformation *uiInfo; #define GUI_PROPERTIES_FILE_NAME "gui.property" -#define SKIN_PROPERTY_WINDOW_X "window.x" -#define SKIN_PROPERTY_WINDOW_Y "window.y" -#define SKIN_PROPERTY_WINDOW_SCALE "window.scale" -#define SKIN_PROPERTY_WINDOW_TOPMOST "window.ontop" -#define SKIN_PROPERTY_CONTROLLER_INDEX "controller.index" -#define SKIN_PROPERTY_CONTROLLER_DOCK "controller.dock" - #define SKIN_INFO_FILE_NAME "info.ini" #define FORM_FILE_NAME "layout.xml" #define CON_FORM_SUBPATH "controller" @@ -138,7 +132,7 @@ void qt5_gui_init(void) /* read skin information */ QSettings skinInfo(uiInfo->skinPath + SKIN_INFO_FILE_NAME, QSettings::IniFormat); - QString skinName = skinInfo.value("skin.name").toString(); + QString skinName = skinInfo.value(SKIN_PROPERTY_NAME).toString(); if (skinName.isEmpty() == true) { skinName = "Undefined"; } diff --git a/tizen/src/display/xmllayoutkeyword.h b/tizen/src/display/xmllayoutkeyword.h new file mode 100644 index 0000000000..4392ad81cc --- /dev/null +++ b/tizen/src/display/xmllayoutkeyword.h @@ -0,0 +1,83 @@ +/* + * Qt UI + * + * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim + * Sangho Park + * + * 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 XMLLAYOUTKEYWORD_H +#define XMLLAYOUTKEYWORD_H + +#define NAME_ATTR_KEYWORD "name" +#define PROP_ATTR_KEYWORD "property" +#define DEFAULT_ATTR_KEYWORD "default" +#define COLOR_RED_ATTR_KEYWORD "R" +#define COLOR_GREEN_ATTR_KEYWORD "G" +#define COLOR_BLUE_ATTR_KEYWORD "B" +#define REGION_LEFT_ATTR_KEYWORD "left" +#define REGION_TOP_ATTR_KEYWORD "top" +#define REGION_WIDTH_ATTR_KEYWORD "width" +#define REGION_HEIGHT_ATTR_KEYWORD "height" + +#define EMULATOR_UI_KEYWORD "EmulatorUI" +#define CONTROLLER_UI_KEYWORD "ControllerUI" +#define LAYOUTVER_KEYWORD "layoutVersion" +#define COLOR_KEYWORD "color" +#define REGION_KEYWORD "region" +#define ANGLE_KEYWORD "angle" +#define DISPLAY_KEYWORD "display" +#define NORMAL_IMG_KEYWORD "normalImage" +#define PRESSED_IMG_KEYWORD "pressedImage" +#define MASK_IMG_KEYWORD "maskImage" +#define ROTARY_IMG_KEYWORD "rotaryImage" +#define KEYLIST_KEYWORD "keyList" +#define KEY_KEYWORD "key" +#define KEYCODE_KEYWORD "keycode" +#define TOOLTIP_KEYWORD "tooltip" +#define SHORTCUT_KEYWORD "shortcut" +#define HOVER_KEYWORD "hover" +#define FACTORLIST_KEYWORD "factorList" +#define FACTOR_KEYWORD "factor" +#define FORM_KEYWORD "form" +#define FORMLIST_KEYWORD "formList" +#define SHORTCUT_KEYWORD "shortcut" +#define MENULIST_KEYWORD "menuList" + +#define SEPARATOR_MENU_KEYWORD "separator" +#define ADVANCED_MENU_KEYWORD "advancedItem" +#define INFO_MENU_KEYWORD "infoItem" +#define ONTOP_MENU_KEYWORD "onTopItem" +#define SWITCH_MENU_KEYWORD "switchItem" +#define SCALE_MENU_KEYWORD "scaleItem" +#define CONTROLLER_MENU_KEYWORD "controllerItem" +#define HOSTKBD_MENU_KEYWORD "hostKeyboardItem" +#define SHELL_MENU_KEYWORD "shellItem" +#define ECP_MENU_KEYWORD "controlPanelItem" +#define SCREENSHOT_MENU_KEYWORD "screenShotItem" +#define ABOUT_MENU_KEYWORD "aboutItem" +#define FORCECLOSE_MENU_KEYWORD "forceCloseItem" +#define CLOSE_MENU_KEYWORD "closeItem" + +#endif // XMLLAYOUTKEYWORD_H diff --git a/tizen/src/display/xmllayoutparser.cpp b/tizen/src/display/xmllayoutparser.cpp index 542e22884c..0ce779efea 100644 --- a/tizen/src/display/xmllayoutparser.cpp +++ b/tizen/src/display/xmllayoutparser.cpp @@ -28,28 +28,10 @@ */ #include "xmllayoutparser.h" +#include "xmllayoutkeyword.h" #include "skinpainter.h" #include "controller/generalpurposecon.h" -#define NAME_ATTR_KEYWORD "name" -#define PROP_ATTR_KEYWORD "property" -#define DEFAULT_ATTR_KEYWORD "default" - -#define LAYOUTVER_KEYWORD "layoutVersion" -#define COLOR_KEYWORD "color" -#define REGION_KEYWORD "region" -#define DISPLAY_KEYWORD "display" -#define NORMAL_IMG_KEYWORD "normalImage" -#define PRESSED_IMG_KEYWORD "pressedImage" -#define MASK_IMG_KEYWORD "maskImage" -#define ROTARY_IMG_KEYWORD "rotaryImage" -#define KEYLIST_KEYWORD "keyList" -#define HOVER_KEYWORD "hover" -#define FORM_KEYWORD "form" -#define FORMLIST_KEYWORD "formList" -#define SHORTCUT_KEYWORD "shortcut" -#define MENULIST_KEYWORD "menuList" - /* Qt Qlayout has a minimum size */ #define QT_LAYOUT_MINIMUM (73) @@ -67,16 +49,16 @@ QColor XmlLayoutParser::parseColor(QXmlStreamReader &xml) xml.tokenType() == QXmlStreamReader::StartElement) { QXmlStreamAttributes attributes = xml.attributes(); - if (attributes.hasAttribute("R")) { - red = attributes.value("R").toString().toInt(); + if (attributes.hasAttribute(COLOR_RED_ATTR_KEYWORD)) { + red = attributes.value(COLOR_RED_ATTR_KEYWORD).toString().toInt(); qDebug() << red; } - if (attributes.hasAttribute("G")) { - green = attributes.value("G").toString().toInt(); + if (attributes.hasAttribute(COLOR_GREEN_ATTR_KEYWORD)) { + green = attributes.value(COLOR_GREEN_ATTR_KEYWORD).toString().toInt(); qDebug() << green; } - if (attributes.hasAttribute("B")) { - blue = attributes.value("B").toString().toUInt(); + if (attributes.hasAttribute(COLOR_BLUE_ATTR_KEYWORD)) { + blue = attributes.value(COLOR_BLUE_ATTR_KEYWORD).toString().toUInt(); qDebug() << blue; } } @@ -116,17 +98,17 @@ QRect XmlLayoutParser::parseRegion(QXmlStreamReader &xml) xml.tokenType() == QXmlStreamReader::StartElement) { QXmlStreamAttributes attributes = xml.attributes(); - if (attributes.hasAttribute("left")) { - left = attributes.value("left").toString().toInt(); + if (attributes.hasAttribute(REGION_LEFT_ATTR_KEYWORD)) { + left = attributes.value(REGION_LEFT_ATTR_KEYWORD).toString().toInt(); } - if (attributes.hasAttribute("top")) { - top = attributes.value("top").toString().toInt(); + if (attributes.hasAttribute(REGION_TOP_ATTR_KEYWORD)) { + top = attributes.value(REGION_TOP_ATTR_KEYWORD).toString().toInt(); } - if (attributes.hasAttribute("width")) { - width = attributes.value("width").toString().toUInt(); + if (attributes.hasAttribute(REGION_WIDTH_ATTR_KEYWORD)) { + width = attributes.value(REGION_WIDTH_ATTR_KEYWORD).toString().toUInt(); } - if (attributes.hasAttribute("height")) { - height = attributes.value("height").toString().toUInt(); + if (attributes.hasAttribute(REGION_HEIGHT_ATTR_KEYWORD)) { + height = attributes.value(REGION_HEIGHT_ATTR_KEYWORD).toString().toUInt(); } } @@ -153,7 +135,7 @@ DisplayType *XmlLayoutParser::parseDisplay(QXmlStreamReader &xml) qDebug("- rect : (%d,%d %dx%d)", displayRect.x(), displayRect.y(), displayRect.width(), displayRect.height()); - } else if (xml.name() == "angle") { + } else if (xml.name() == ANGLE_KEYWORD) { /* angle */ angle = xml.readElementText().toInt(); } else if (xml.name() == MASK_IMG_KEYWORD) { @@ -188,20 +170,20 @@ HardwareKey *XmlLayoutParser::parseKey(QXmlStreamReader &xml) QXmlStreamReader::TokenType token = xml.readNext(); - while (xml.atEnd() == false && (xml.name() == "key" && + while (xml.atEnd() == false && (xml.name() == KEY_KEYWORD && token == QXmlStreamReader::EndElement) == false) /* ~ */ { if (token == QXmlStreamReader::StartElement) { if (xml.name() == REGION_KEYWORD) { /* region */ keyRegion = parseRegion(xml); - } else if (xml.name() == "keycode") { + } else if (xml.name() == KEYCODE_KEYWORD) { /* keycode */ keycode = xml.readElementText().toInt(); - } else if (xml.name() == "tooltip") { + } else if (xml.name() == TOOLTIP_KEYWORD) { /* tooltip */ keyTooptip = xml.readElementText(); - } else if (xml.name() == "shortcut") { + } else if (xml.name() == SHORTCUT_KEYWORD) { /* shortcut */ keySequence = xml.readElementText(); } @@ -223,7 +205,7 @@ int XmlLayoutParser::parseKeyList( token == QXmlStreamReader::EndElement) == false) /* ~ */ { if (token == QXmlStreamReader::StartElement) { - if (xml.name() == "key") { + if (xml.name() == KEY_KEYWORD) { hwKey = parseKey(xml); if (hwKey != NULL) { list.append(hwKey); @@ -349,7 +331,7 @@ int XmlLayoutParser::parseFactorList( token == QXmlStreamReader::EndElement) == false) /* ~ */ { if (token == QXmlStreamReader::StartElement) { - if (xml.name() == "factor") { + if (xml.name() == FACTOR_KEYWORD) { QString value = xml.attributes().value(NAME_ATTR_KEYWORD).toString(); map.insert(xml.readElementText().toInt(), value); } @@ -410,7 +392,7 @@ ScaleMenuItem *XmlLayoutParser::parseScaleMenuItem(QXmlStreamReader &xml) if (token == QXmlStreamReader::StartElement) { if (xml.name() == SHORTCUT_KEYWORD) { parseShortcut(xml, item->getShortcutMap()); - } else if (xml.name() == "factorList") { + } else if (xml.name() == FACTORLIST_KEYWORD) { int defaultFactor = 0; int cnt = parseFactorList(xml, item->getFactorMap(), &defaultFactor); qDebug("- scale factorList : %d", cnt); @@ -462,72 +444,72 @@ int XmlLayoutParser::parseMenuList( token == QXmlStreamReader::EndElement) == false) /* ~ */ { if (token == QXmlStreamReader::StartElement) { - if (xml.name() == "separator") { + if (xml.name() == SEPARATOR_MENU_KEYWORD) { item = new MenuItem(MenuItemType::separator, NULL); if (item != NULL) { list.append(item); } - } else if (xml.name() == "advancedItem") { + } else if (xml.name() == ADVANCED_MENU_KEYWORD) { item = (MenuItem *)parseAdvancedMenuItem(xml); if (item != NULL) { list.append(item); } - } else if (xml.name() == "infoItem") { + } else if (xml.name() == INFO_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::infoItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "onTopItem") { + } else if (xml.name() == ONTOP_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::onTopItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "switchItem") { + } else if (xml.name() == SWITCH_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::switchItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "scaleItem") { + } else if (xml.name() == SCALE_MENU_KEYWORD) { item = (MenuItem *)parseScaleMenuItem(xml); if (item != NULL) { list.append(item); } - } else if (xml.name() == "controllerItem") { + } else if (xml.name() == CONTROLLER_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::controllerItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "hostKeyboardItem") { + } else if (xml.name() == HOSTKBD_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::hostKeyboardItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "shellItem") { + } else if (xml.name() == SHELL_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::shellItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "controlPanelItem") { + } else if (xml.name() == ECP_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::controlPanelItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "screenShotItem") { + } else if (xml.name() == SCREENSHOT_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::screenShotItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "aboutItem") { + } else if (xml.name() == ABOUT_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::aboutItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "forceCloseItem") { + } else if (xml.name() == FORCECLOSE_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::forceCloseItem); if (item != NULL) { list.append(item); } - } else if (xml.name() == "closeItem") { + } else if (xml.name() == CLOSE_MENU_KEYWORD) { item = parseGeneralMenuItem(xml, MenuItemType::closeItem); if (item != NULL) { list.append(item); @@ -555,7 +537,7 @@ QString XmlLayoutParser::parseEmulatorUI(QXmlStreamReader &xml) } if (token == QXmlStreamReader::StartElement) { - if (xml.name() == "EmulatorUI") { + if (xml.name() == EMULATOR_UI_KEYWORD) { continue; } @@ -644,7 +626,7 @@ QString XmlLayoutParser::parseControllerUI(QXmlStreamReader &xml) } if (token == QXmlStreamReader::StartElement) { - if (xml.name() == "ControllerUI") { + if (xml.name() == CONTROLLER_UI_KEYWORD) { continue; } diff --git a/tizen/src/ui/input/keyboardshortcut.cpp b/tizen/src/ui/input/keyboardshortcut.cpp index e14d050cb0..872a84266a 100644 --- a/tizen/src/ui/input/keyboardshortcut.cpp +++ b/tizen/src/ui/input/keyboardshortcut.cpp @@ -29,6 +29,7 @@ */ #include "keyboardshortcut.h" +#include "resource/maru_strings.h" #include "mainwindow.h" KeyboardShortcut::KeyboardShortcut(QWidget *parent) : QWidget(parent) diff --git a/tizen/src/ui/menu/aboutdialog.cpp b/tizen/src/ui/menu/aboutdialog.cpp index 09a67833fc..0599197c9e 100644 --- a/tizen/src/ui/menu/aboutdialog.cpp +++ b/tizen/src/ui/menu/aboutdialog.cpp @@ -28,6 +28,7 @@ */ #include "aboutdialog.h" +#include "resource/maru_strings.h" #include "build_info.h" #define SDK_NAME "Tizen SDK" @@ -38,7 +39,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowStaysOnTopHint) { - setWindowTitle("About Emulator"); + setWindowTitle(ABOUT_TITLE); QVBoxLayout *baseLayout = new QVBoxLayout(this); baseLayout->setMargin(0); @@ -81,10 +82,10 @@ AboutDialog::AboutDialog(QWidget *parent) : */ QString aboutText = QString(SDK_NAME) + "

" - + "Version : " + version + "
" + + ABOUT_VERSION_TEXT + " : " + version + "
" /* + "Snapshot : " + SnapshotName + "
" */ - + "Build Date : " + QString(build_date) + "


" - + "Visit " + URL_TIZEN_ORG; + + ABOUT_BUILD_DATE_TEXT + " : " + QString(build_date) + "


" + + ABOUT_VISIT_TEXT + " " + URL_TIZEN_ORG; QLabel *textLabel = new QLabel(this); textLabel->setStyleSheet("background-color: white"); diff --git a/tizen/src/ui/menu/contextmenu.cpp b/tizen/src/ui/menu/contextmenu.cpp index 5c50772139..9b1f6e297c 100644 --- a/tizen/src/ui/menu/contextmenu.cpp +++ b/tizen/src/ui/menu/contextmenu.cpp @@ -29,6 +29,7 @@ */ #include "contextmenu.h" +#include "resource/maru_strings.h" #include "emulator_common.h" #include "mainwindow.h" #include "uiutil.h" diff --git a/tizen/src/ui/menu/detailedinfodialog.cpp b/tizen/src/ui/menu/detailedinfodialog.cpp index 8c0a535a42..8e707c126b 100644 --- a/tizen/src/ui/menu/detailedinfodialog.cpp +++ b/tizen/src/ui/menu/detailedinfodialog.cpp @@ -28,6 +28,7 @@ */ #include "detailedinfodialog.h" +#include "resource/maru_strings.h" #include "mainwindow.h" extern int _qemu_argc; @@ -56,8 +57,8 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) : tabWidget = new QTabWidget(this); QWidget *vmInfo = new QWidget; QWidget *shortcutInfo = new QWidget; - tabWidget->addTab(vmInfo, tr("VM Info")); - tabWidget->addTab(shortcutInfo, tr("Shortcut Info")); + tabWidget->addTab(vmInfo, tr(DETAILED_INFO_VMTAB_TITLE)); + tabWidget->addTab(shortcutInfo, tr(DETAILED_INFO_SHORTCUTTAB_TITLE)); connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotSetMaximumSize(int))); /* VM information table */ @@ -68,7 +69,7 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) : vmInfoTable->verticalHeader()->hide(); QStringList header; - header << "Feature" << "Value"; + header << DETAILED_INFO_VMTAB_HEADER1 << DETAILED_INFO_VMTAB_HEADER2; vmInfoTable->setHorizontalHeaderLabels(header); /* shortcut info table */ @@ -79,41 +80,49 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) : shortcutInfoTable->verticalHeader()->hide(); header.clear(); - header << "Function" << "Key sequence"; + header << DETAILED_INFO_SHORTCUTTAB_HEADER1 << DETAILED_INFO_SHORTCUTTAB_HEADER2; shortcutInfoTable->setHorizontalHeaderLabels(header); /* table items */ int index = 0; - setDataTable(vmInfoTable, "VM Name", win->uiInfo->vmName, index++); - setDataTable(vmInfoTable, "Skin Name", win->uiInfo->skinName, index++); - setDataTable(vmInfoTable, "CPU", "x86", index++); - setDataTable(vmInfoTable, "Ram Size", QString(get_emul_ram_size()) + " MB", index++); - setDataTable(vmInfoTable, "Display Resolution", - QString::number(win->uiInfo->resolution.width()) + "x" + - QString::number(win->uiInfo->resolution.height()), index++); + setDataTable(vmInfoTable, DETAILED_INFO_VM_NAME, + win->uiInfo->vmName, index++); + setDataTable(vmInfoTable, DETAILED_INFO_SKIN_NAME, + win->uiInfo->skinName, index++); + setDataTable(vmInfoTable, DETAILED_INFO_CPU, "x86", index++); + setDataTable(vmInfoTable, DETAILED_INFO_RAM_SIZE, + QString(get_emul_ram_size()) + " MB", index++); + setDataTable(vmInfoTable, DETAILED_INFO_DPY_RESOLUTION, + QString::number(win->uiInfo->resolution.width()) + "x" + + QString::number(win->uiInfo->resolution.height()), index++); #if 0 setDataTable(vmInfoTable, "Display Density", "0"/* TODO: */, index++); #endif QString sharingPath(get_emul_file_sharing_path()); - setDataTable(vmInfoTable, "File Sharing Path", (sharingPath.isEmpty()) ? "None" : sharingPath, index++); - setDataTable(vmInfoTable, "CPU Virtualization", (get_emul_cpu_accel()) ? "Enabled" : "Disabled", index++); - setDataTable(vmInfoTable, "GPU Virtualization", (get_emul_gpu_accel()) ? "Enabled" : "Disabled", index++); + setDataTable(vmInfoTable, DETAILED_INFO_HDS_PATH, + (sharingPath.isEmpty()) ? "None" : sharingPath, index++); + setDataTable(vmInfoTable, DETAILED_INFO_CPU_VT, + (get_emul_cpu_accel()) ? "Enabled" : "Disabled", index++); + setDataTable(vmInfoTable, DETAILED_INFO_GPU_VT, + (get_emul_gpu_accel()) ? "Enabled" : "Disabled", index++); for (int i = 0; i < imagePathList.size(); i++) { - setDataTable(vmInfoTable, "Image Path " + QString::number(i + 1), - imagePathList[i], index++); + setDataTable(vmInfoTable, QString(DETAILED_INFO_IMAGE_PATH) + " " + + QString::number(i + 1), imagePathList[i], index++); item->setToolTip(imagePathList[i]); } - setDataTable(vmInfoTable, "Log Path", get_log_path(), index++); + setDataTable(vmInfoTable, DETAILED_INFO_LOG_PATH, get_log_path(), index++); item->setToolTip(get_log_path()); /* temp */ - setDataTable(vmInfoTable, "Logging Telnet Port", QString::number(get_emul_serial_port()), index++); + setDataTable(vmInfoTable, DETAILED_INFO_TELNET_PORT, + QString::number(get_emul_serial_port()), index++); /* add double click event listener */ - connect(vmInfoTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotDoubleClicked(int, int))); + connect(vmInfoTable, SIGNAL(cellDoubleClicked(int, int)), + this, SLOT(slotDoubleClicked(int, int))); int tableHeight = vmInfoTable->horizontalHeader()->height(); for (int i = 0; i < vmInfoTable->rowCount(); i++) { @@ -260,9 +269,9 @@ void DetailedInfoDialog::slotDoubleClicked(int nRow, int nCol) return; item = vmInfoTable->item(nRow, 0); - if (item->text().compare("File Sharing Path", Qt::CaseInsensitive) == 0 || - item->text().startsWith("Image Path") == true || - item->text().compare("Log Path", Qt::CaseInsensitive) == 0) { + if (item->text().compare(DETAILED_INFO_HDS_PATH, Qt::CaseInsensitive) == 0 || + item->text().startsWith(DETAILED_INFO_IMAGE_PATH) == true || + item->text().compare(DETAILED_INFO_LOG_PATH, Qt::CaseInsensitive) == 0) { /* get path name */ item = vmInfoTable->item(nRow, nCol); if (item->text().compare("None", Qt::CaseInsensitive) == 0 || diff --git a/tizen/src/ui/menu/detailedinfodialog.h b/tizen/src/ui/menu/detailedinfodialog.h index 3a549554d2..4efe368305 100644 --- a/tizen/src/ui/menu/detailedinfodialog.h +++ b/tizen/src/ui/menu/detailedinfodialog.h @@ -35,7 +35,6 @@ #include "input/keyboardshortcut.h" -#define DETAILED_INFO_TITLE "Detailed Info" #define TABLE_BORDER_SIZE 2 #define TAB_BORDER_SIZE 4 #define DIALOG_HORIZ_SPACE 20 diff --git a/tizen/src/ui/menu/screenshotdialog.cpp b/tizen/src/ui/menu/screenshotdialog.cpp index 490dfd22f5..3a3d412521 100644 --- a/tizen/src/ui/menu/screenshotdialog.cpp +++ b/tizen/src/ui/menu/screenshotdialog.cpp @@ -31,6 +31,7 @@ #include #include "screenshotdialog.h" +#include "resource/maru_strings.h" #include "screenshotview.h" #include "mainwindow.h" @@ -73,26 +74,26 @@ void ScreenShotDialog::createItems(QGridLayout *layout) toolBar = new QToolBar(this); /* Save */ - actionSave = new QAction("&Save", this); + actionSave = new QAction(SCREENSHOT_SAVE_TEXT, this); actionSave->setShortcuts(QKeySequence::Save); actionSave->setIcon(QIcon(":/icons/save_screenshot_dialog.png")); - actionSave->setToolTip("Save to file"); + actionSave->setToolTip(SCREENSHOT_SAVE_TOOLTIP); connect(actionSave, SIGNAL(triggered()), this, SLOT(slotSave())); toolBar->addAction(actionSave); /* Copy */ - actionCopy = new QAction("&Copy", this); + actionCopy = new QAction(SCREENSHOT_COPY_TEXT, this); actionCopy->setShortcuts(QKeySequence::Copy); actionCopy->setIcon(QIcon(":/icons/copy_screenshot_dialog.png")); - actionCopy->setToolTip("Copy to clipboard"); + actionCopy->setToolTip(SCREENSHOT_COPY_TOOLTIP); connect(actionCopy, SIGNAL(triggered()), this, SLOT(slotCopy())); toolBar->addAction(actionCopy); /* Refresh */ - actionRefresh = new QAction("&Refresh", this); + actionRefresh = new QAction(SCREENSHOT_REFRESH_TEXT, this); actionRefresh->setShortcuts(QKeySequence::Refresh); actionRefresh->setIcon(QIcon(":/icons/refresh_screenshot_dialog.png")); - actionRefresh->setToolTip("Refresh Image"); + actionRefresh->setToolTip(SCREENSHOT_REFRESH_TOOLTIP); connect(actionRefresh, SIGNAL(triggered()), win->getPopupMenu(), SLOT(slotRequestScreenshot())); toolBar->addAction(actionRefresh); diff --git a/tizen/src/ui/resource/maru_strings.h b/tizen/src/ui/resource/maru_strings.h new file mode 100644 index 0000000000..bbd5602718 --- /dev/null +++ b/tizen/src/ui/resource/maru_strings.h @@ -0,0 +1,68 @@ +/* + * Qt UI + * + * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: + * GiWoong Kim + * Sangho Park + * + * 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 MARU_STRINGS_H +#define MARU_STRINGS_H + +/* detailed info dialog */ +#define DETAILED_INFO_TITLE "Detailed Info" +#define DETAILED_INFO_VMTAB_TITLE "VM Info" +#define DETAILED_INFO_SHORTCUTTAB_TITLE "Shortcut Info" +#define DETAILED_INFO_VMTAB_HEADER1 "Feature" +#define DETAILED_INFO_VMTAB_HEADER2 "Value" +#define DETAILED_INFO_SHORTCUTTAB_HEADER1 "Function" +#define DETAILED_INFO_SHORTCUTTAB_HEADER2 "Key sequence" + +#define DETAILED_INFO_VM_NAME "VM Name" +#define DETAILED_INFO_SKIN_NAME "Skin Name" +#define DETAILED_INFO_CPU "CPU" +#define DETAILED_INFO_RAM_SIZE "Ram Size" +#define DETAILED_INFO_DPY_RESOLUTION "Display Resolution" +#define DETAILED_INFO_HDS_PATH "File Sharing Path" +#define DETAILED_INFO_CPU_VT "CPU Virtualization" +#define DETAILED_INFO_GPU_VT "GPU Virtualization" +#define DETAILED_INFO_IMAGE_PATH "Image Path" +#define DETAILED_INFO_LOG_PATH "Log Path" +#define DETAILED_INFO_TELNET_PORT "Logging Telnet Port" + +/* screen shot dialog */ +#define SCREENSHOT_SAVE_TEXT "&Save" +#define SCREENSHOT_SAVE_TOOLTIP "Save to file" +#define SCREENSHOT_COPY_TEXT "&Copy" +#define SCREENSHOT_COPY_TOOLTIP "Copy to clipboard" +#define SCREENSHOT_REFRESH_TEXT "&Refresh" +#define SCREENSHOT_REFRESH_TOOLTIP "Refresh Image" + +/* about dialog */ +#define ABOUT_TITLE "About Emulator" +#define ABOUT_VERSION_TEXT "Version" +#define ABOUT_BUILD_DATE_TEXT "Build Date" +#define ABOUT_VISIT_TEXT "Visit" + +#endif // MARU_STRINGS_H