From: Takumi ASAKI Date: Mon, 9 Apr 2012 16:06:33 +0000 (+0900) Subject: Version 0.4.95(0.5RC) X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=179cb1fb74054ee01b4ac54eb30cbe209d405ae6;p=fontmanager%2Ffontmanager.git Version 0.4.95(0.5RC) * Improvement UI & performance --- diff --git a/applicationcontroller.cpp b/applicationcontroller.cpp index 1241b60..71499ba 100644 --- a/applicationcontroller.cpp +++ b/applicationcontroller.cpp @@ -96,7 +96,7 @@ void ApplicationController::init() QString ApplicationController::version() const { - return QLatin1String("0.4.9(0.5beta)"); + return QLatin1String("0.4.95(0.5RC)"); } QString ApplicationController::currentLanguage() const @@ -227,6 +227,14 @@ QString ApplicationController::defaultBackupFilename() const return backupfile; } +QString ApplicationController::url2path(const QUrl &url) const +{ + QString path = url.toLocalFile(); + if (path.startsWith(QDir::homePath())) + path.replace(0, QDir::homePath().length(), QLatin1String("~")); + return path; +} + void ApplicationController::updateAllEditorController() { if (!mFontConfig->fontsConfModified() || mIgnoreUpdate) { @@ -312,11 +320,13 @@ void ApplicationController::createRecommendedSettings() void ApplicationController::backupConfig(const QString &filename) { mFontConfig->backupFontsConf(filename); + emit backupConfigFinished(filename); } void ApplicationController::restoreConfig(const QString &filename) { mFontConfig->restoreFontsConf(filename); + emit restoreConfigFinished(filename); } void ApplicationController::createFontDir() diff --git a/applicationcontroller.h b/applicationcontroller.h index d073c0b..e858eef 100644 --- a/applicationcontroller.h +++ b/applicationcontroller.h @@ -53,7 +53,7 @@ class FontsConfEditorController; class ApplicationController : public QObject { Q_OBJECT - Q_PROPERTY(QString version READ version) + Q_PROPERTY(QString version READ version NOTIFY dummySignal) Q_PROPERTY(QString fontDir READ fontDir WRITE setFontDir NOTIFY fontDirChanged) Q_PROPERTY(bool fontDirExists READ fontDirExists NOTIFY fontDirExistsChanged) @@ -100,6 +100,8 @@ public: QUrl backupDir() const; Q_INVOKABLE QString defaultBackupFilename() const; + Q_INVOKABLE QString url2path(const QUrl &url) const; + public slots: void updateAllEditorController(); @@ -134,6 +136,8 @@ signals: void installFinished(const QString &fontpath); void uninstallFinished(const QString &fontpath); + void backupConfigFinished(const QString &filepath); + void restoreConfigFinished(const QString &filepath); void clearInstalledFontList(); void appendInstalledFont(const QString &family, const QString &fullname); @@ -149,6 +153,8 @@ signals: void backupDirChanged(); + void dummySignal(); + private slots: void readFcListFinished(); diff --git a/fontconfigmanager.cpp b/fontconfigmanager.cpp index f9084ee..9d98f7f 100644 --- a/fontconfigmanager.cpp +++ b/fontconfigmanager.cpp @@ -675,7 +675,7 @@ void FontConfigManager::restoreFontsConf(const QUrl &fileUrl) if (restoredConf->isValid()) { mLocalFontsConf->copy(restoredConf); emit fontsConfUpdated(); - restoredConf->deleteLater(); + delete restoredConf; } } diff --git a/fontsconf.cpp b/fontsconf.cpp index 898785e..fcf2935 100644 --- a/fontsconf.cpp +++ b/fontsconf.cpp @@ -89,7 +89,7 @@ void FontsConf::initFontsConf() { if (mElements) mModified = true; - FontsConfElementPointer rootElem(new FontsConfElement(FONTCONFIG_DEF, this)); + FontsConfElementPointer rootElem(new FontsConfElement(FONTCONFIG_DEF)); mElements = rootElem; } @@ -117,7 +117,7 @@ bool FontsConf::parse(const QByteArray &buf) case Initialized: if (elemName == FONTCONFIG_DEF) { state = Ready; - elem = FontsConfElementPointer(new FontsConfElement(elemName, this)); + elem = FontsConfElementPointer(new FontsConfElement(elemName)); bool check = elem->parse(xml); if (!check) state = UnknownState; @@ -133,7 +133,7 @@ bool FontsConf::parse(const QByteArray &buf) } if (state == InvalidConfig) - qDebug("Invalid Config!!!"); + qWarning("Invalid Config!!!"); if (state == InvalidConfig) break; diff --git a/qml/fontmanager/BottomButtons.qml b/qml/fontmanager/BottomButtons.qml new file mode 100644 index 0000000..4ebd733 --- /dev/null +++ b/qml/fontmanager/BottomButtons.qml @@ -0,0 +1,70 @@ +import QtQuick 1.1 +import com.nokia.meego 1.0 +import 'UIConstants.js' as UI + +Item { + id: bottomButtons + + property Item targetTab + + height: bottomItem.height + importButton.height + UI.DEFAULT_MARGIN * 2 + + Rectangle { + anchors.fill: parent + anchors.topMargin: UI.DEFAULT_MARGIN / 2 + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter("#76221d") } + GradientStop { position: 1.0; color: Qt.lighter("#bd543d") } + } + } + + Item { + id: bottomItem + anchors.bottom: importButton.top + anchors.left: parent.left + anchors.right: parent.right + height: UI.LIST_ITEM_HEIGHT_SMALL + + Button { + width: 75 + anchors.left: parent.left + anchors.leftMargin: UI.DEFAULT_MARGIN + iconSource: "image://theme/icon-m-toolbar-down" + onClicked: targetTab.moveDownFamily() + enabled: targetTab !== null && + (targetTab.listView.currentIndex >= 0 && + targetTab.listView.currentIndex < targetTab.listView.count - 1) && + (!targetTab.listView.model.get(targetTab.listView.currentIndex+1).header) + } + + Button { + width: 75 + anchors.horizontalCenter: parent.horizontalCenter + iconSource: "image://theme/icon-m-toolbar-delete" + onClicked: targetTab.removeFamily() + enabled: targetTab !== null && targetTab.listView.currentIndex >= 0 + } + + Button { + width: 75 + anchors.right: parent.right + anchors.rightMargin: UI.DEFAULT_MARGIN + iconSource: "image://theme/icon-m-toolbar-up" + onClicked: targetTab.moveUpFamily() + enabled: targetTab !== null && (targetTab.listView.currentIndex > 0) && (!targetTab.listView.model.get(targetTab.listView.currentIndex-1).header) + } + } + + Button { + id: importButton + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + anchors.bottomMargin: UI.DEFAULT_MARGIN + text: qsTr("Import System Settings") + opacity: 0.9 + onClicked: { + controller.importSystemSettings(targetTab.family) + } + enabled: targetTab !== null + } +} diff --git a/qml/fontmanager/EditFontsConfPage.qml b/qml/fontmanager/EditFontsConfPage.qml index e3c43ef..5d11699 100644 --- a/qml/fontmanager/EditFontsConfPage.qml +++ b/qml/fontmanager/EditFontsConfPage.qml @@ -39,9 +39,10 @@ // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 import QtQuick 1.1 import com.nokia.meego 1.0 -import com.nokia.extras 1.0 import 'UIConstants.js' as UI +import 'HelpDialog.js' as HelpHelper + Page { id: editorTabPage tools: editorTabTool @@ -67,135 +68,56 @@ Page { "Please check fontconfig for more details." ) - property alias curTab: editFontsConfTab.currentTab + property Item selectionDialog: null + + property int currentIndex: 0 + ListModel { + id: familyModel + ListElement { family: "sans-serif"; name: QT_TR_NOOP("Sans Serif") } + ListElement { family: "serif"; name: QT_TR_NOOP("Serif") } + ListElement { family: "monospace"; name: QT_TR_NOOP("Monospace") } + ListElement { family: "Nokia Pure Text"; name: QT_TR_NOOP("System") } + } PageHeader { id: pageHeader anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - text: qsTr("Edit Fonts Config: %1").arg(curTab.familyName) - } - - TabGroup { - id: editFontsConfTab - anchors.top: pageHeader.bottom - anchors.bottom: bottomButtons.top - - opacity: enabled ? 1.0 : 0.5 - - currentTab: sansSerifTab - - FontsConfEditor { - id: sansSerifTab - family: "sans-serif" - familyName: qsTr("Sans Serif") - editorController: controller.editorController(family) - } - - FontsConfEditor { - id: serifTab - family: "serif" - familyName: qsTr("Serif") - editorController: controller.editorController(family) - } - - FontsConfEditor { - id: monospaceTab - family: "monospace" - familyName: qsTr("Monospace") - editorController: controller.editorController(family) - } - - FontsConfEditor { - id: systemTab - family: "Nokia Pure Text" - familyName: qsTr("System") - editorController: controller.editorController(family) - } - + text: qsTr("Edit Fonts Config: %1").arg(confEditor.familyName) + enabled: !showHelp } Item { - id: bottomButtons - - height: bottomItem.height + importButton.height + UI.DEFAULT_MARGIN * 2 + id: contents + anchors.top: pageHeader.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - Rectangle { - anchors.fill: parent - anchors.topMargin: UI.DEFAULT_MARGIN / 2 - gradient: Gradient { - GradientStop { position: 0.0; color: Qt.lighter("#76221d") } - GradientStop { position: 1.0; color: Qt.lighter("#bd543d") } - } - Component.onCompleted: { - console.log("bottomButtons: " + width + " x " + height) - } - } + opacity: enabled ? 1.0 : 0.5 - Item { - id: bottomItem - anchors.bottom: importButton.top + FontsConfEditor { + id: confEditor + anchors.top: parent.top + anchors.bottom: bottomButtons.top anchors.left: parent.left anchors.right: parent.right - height: UI.LIST_ITEM_HEIGHT_SMALL - - ListButton { - anchors.left: parent.left - anchors.leftMargin: UI.DEFAULT_MARGIN - iconSource: "image://theme/icon-m-toolbar-down" - onClicked: curTab.moveDownFamily() - enabled: (curTab.listView.currentIndex >= 0 && - curTab.listView.currentIndex < curTab.listView.count - 1) && - (!curTab.listView.model.get(curTab.listView.currentIndex+1).header) - } - ListButton { - anchors.horizontalCenter: parent.horizontalCenter - iconSource: "image://theme/icon-m-toolbar-delete" - onClicked: curTab.removeFamily() - enabled: curTab.listView.currentIndex >= 0 - } - - ListButton { - anchors.right: parent.right - anchors.rightMargin: UI.DEFAULT_MARGIN - iconSource: "image://theme/icon-m-toolbar-up" - onClicked: curTab.moveUpFamily() - enabled: (curTab.listView.currentIndex > 0) && (!curTab.listView.model.get(curTab.listView.currentIndex-1).header) - } + family: familyModel.get(currentIndex).family + familyName: familyModel.get(currentIndex).name + editorController: controller.editorController(family) } - Button { - id: importButton - anchors.horizontalCenter: parent.horizontalCenter + BottomButtons { + id: bottomButtons anchors.bottom: parent.bottom - anchors.bottomMargin: UI.DEFAULT_MARGIN - text: qsTr("Import System Settings") - onClicked: { - controller.importSystemSettings(editFontsConfTab.currentTab.family) - } + anchors.left: parent.left + anchors.right: parent.right + targetTab: confEditor } - } - MultiSelectionDialog { - id: selectInstallFamily - model: installableFamilyListModel - acceptButtonText: qsTr("Add") - titleText: qsTr("Add Family for %1").arg(curTab.familyName) - onAccepted: { - for (var i = 0; i < selectedIndexes.length; i++) { - var idx = selectedIndexes[i] - var sItem = installableFamilyListModel.get(idx) - var tab = editFontsConfTab.currentTab - tab.editorController.appendFamily(sItem.enfamily, currentPriority) - tab.insertFamily(sItem.enfamily, currentPriority, sItem.systemFont) - } - } } ToolBarLayout { @@ -210,25 +132,22 @@ Page { pageStack.pop() } } - ButtonRow { - style: TabButtonStyle { } - TabButton { - text: sansSerifTab.familyName - tab: sansSerifTab - } - TabButton { - text: serifTab.familyName - tab: serifTab - } - TabButton { - text: monospaceTab.familyName - tab: monospaceTab + + Button { + text: confEditor.familyName + + Image { + id: openImage + anchors.right: parent.right + anchors.rightMargin: UI.DEFAULT_MARGIN + anchors.verticalCenter: parent.verticalCenter + source: "image://theme/icon-m-common-expand" } - TabButton { - text: systemTab.familyName - tab: systemTab + onClicked: { + selectCurrentFamilyDialog.open() } } + ToolIcon { platformIconId: "toolbar-view-menu" anchors.right: (parent === undefined) ? undefined : parent.right @@ -252,39 +171,81 @@ Page { enabled: !controller.isEmptyFontsConf onClicked: { editMenu.close() - removeConfirmDialog.open() + openRemoveConfirmDialog() } } MenuItem { text: qsTr("View current fonts config"); - // enabled: controller.localFontsConfExists + enabled: controller.localFontsConfExists onClicked: { editMenu.close() - pageStack.push(fontsConfViewPageComponent, { "text": controller.localFontsConf } ) + var component = Qt.createComponent("FontsConfViewPage.qml") + if (component.status === Component.Error) + console.log("Error: " + component.errorString()) + pageStack.push(component, { "text": controller.localFontsConf } ) } } MenuItem { text: qsTr("Help") - onClicked: showHelp = true + onClicked: { + showHelp = true + HelpHelper.openHelpDialog(editorTabPage, contents, helpMessage, closeHelp) + } } } } - QueryDialog { - id: removeConfirmDialog - titleText: qsTr("Remove it?") - message: qsTr("Existing fonts config %1 will be removed. Are you sure?").arg(controller.localFontsConfPath) - acceptButtonText: qsTr("OK") - rejectButtonText: qsTr("Cancel") - onAccepted: controller.resetLocalFontsConf() + function closeHelp() + { + showHelp = false + } + + function openRemoveConfirmDialog() + { + queryDialog.titleText = qsTr("Remove it?") + queryDialog.message = qsTr("Existing fonts config %1 will be removed. Are you sure?").arg(controller.localFontsConfPath) + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(resetLocalFontsConf) + queryDialog.open() } - HelpDialog { - id: helpDialog - anchors.fill: editFontsConfTab - message: helpMessage - visible: showHelp - onClicked: showHelp = false + function resetLocalFontsConf() + { + queryDialog.accepted.disconnect(resetLocalFontsConf) + controller.resetLocalFontsConf() + } + + function openSelectInstallFamilyDialog(priority) + { + deleteSelectInstallFamilyDialog() + var dialogComponent = Qt.createComponent("SelectInstallFamilyDialog.qml") + if (dialogComponent.status === Component.Error) + console.log("Error: " + dialogComponent.errorString()) + controller.syncInstallableFamilyFor(confEditor.family) + editorTabPage.currentPriority = priority + selectionDialog = dialogComponent.createObject(editorTabPage, { "editor": confEditor } ) + selectionDialog.selectedIndexes = [] + selectionDialog.accepted.connect(deleteSelectInstallFamilyDialog) + selectionDialog.rejected.connect(deleteSelectInstallFamilyDialog) + selectionDialog.open() + } + + function deleteSelectInstallFamilyDialog() + { + if (selectionDialog) + selectionDialog.destroy() + selectionDialog = null + } + + SelectionDialog { + id: selectCurrentFamilyDialog + model: familyModel + selectedIndex: currentIndex + titleText: qsTr("Select Family to edit") + onAccepted: { + currentIndex = selectedIndex + } } states: [ @@ -292,7 +253,7 @@ Page { name: "showHelp" when: showHelp PropertyChanges { - target: editFontsConfTab + target: contents enabled: false } PropertyChanges { diff --git a/qml/fontmanager/EditorHelper.js b/qml/fontmanager/EditorHelper.js index 8478f33..fe01921 100644 --- a/qml/fontmanager/EditorHelper.js +++ b/qml/fontmanager/EditorHelper.js @@ -36,7 +36,8 @@ ** ****************************************************************************/ -var sectionIndexes; +var sectionIndexes +var connectionObject function init() { @@ -68,3 +69,11 @@ function updateRemoveIndexes(index) sectionIndexes[key]-- } } + +function setConnection(editController) +{ + if (connectionObject) + connectionObject.destroy() + connectionObject = modelSyncConnections.createObject(editorPage, {target: editController}) + editController.syncFamilyList() +} diff --git a/qml/fontmanager/EditorListDelegate.qml b/qml/fontmanager/EditorListDelegate.qml index 84761f8..5913a46 100644 --- a/qml/fontmanager/EditorListDelegate.qml +++ b/qml/fontmanager/EditorListDelegate.qml @@ -43,7 +43,7 @@ Item { Column { anchors.verticalCenter: parent.verticalCenter - Label { + Text { id: mainText text: model.title font.weight: listItem.titleWeight @@ -51,7 +51,7 @@ Item { color: listItem.titleColor } - Label { + Text { id: subText text: model.subtitle font.weight: listItem.subtitleWeight @@ -71,14 +71,16 @@ Item { anchors.rightMargin: UI.DEFAULT_MARGIN iconSource: "image://theme/icon-m-toolbar-add" onClicked: { - controller.syncInstallableFamilyFor(editorPage.family) - editorTabPage.currentPriority = model.priority - selectInstallFamily.selectedIndexes = [] - selectInstallFamily.open() + openSelectInstallFamilyDialog(model.priority) } visible: listItem.isHeader } + Loader { + id: selectInstallFamilyDialogLoader + anchors.fill: parent + } + MouseArea { id: selectItem anchors.fill: parent diff --git a/qml/fontmanager/FileSelectionPage.qml b/qml/fontmanager/FileSelectionPage.qml index b7cfbc5..21e15e7 100644 --- a/qml/fontmanager/FileSelectionPage.qml +++ b/qml/fontmanager/FileSelectionPage.qml @@ -71,6 +71,8 @@ Page { anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right + anchors.topMargin: UI.DEFAULT_MARGIN / 2 + anchors.bottomMargin: UI.DEFAULT_MARGIN / 2 anchors.leftMargin: UI.DEFAULT_MARGIN anchors.rightMargin: UI.DEFAULT_MARGIN clip: true diff --git a/qml/fontmanager/FontInstallPage.qml b/qml/fontmanager/FontInstallPage.qml index 7b4cf5f..c4e7497 100644 --- a/qml/fontmanager/FontInstallPage.qml +++ b/qml/fontmanager/FontInstallPage.qml @@ -49,10 +49,10 @@ Page { signal saveProperties - function installFont() + function installFont(checked) { - if (controller.fontExists(fontInfo)) - overwriteFontDialog.open() + if (!checked && controller.fontExists(fontInfo)) + openOverwriteFontDialog() else controller.installFont(fontInfo); } @@ -71,105 +71,154 @@ Page { text: qsTr("Install Font") } - Flickable { - id: view + Item { + id: contents anchors.top: pageHeader.bottom anchors.bottom: parent.bottom anchors.left: parent.left anchors.right: parent.right - anchors.topMargin: UI.DEFAULT_MARGIN / 2 - anchors.leftMargin: UI.DEFAULT_MARGIN - anchors.rightMargin: UI.DEFAULT_MARGIN - clip: true - // contentWidth: contentColumn.width - contentHeight: contentColumn.height + Flickable { + id: view + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: bottomField.top + anchors.topMargin: UI.DEFAULT_MARGIN / 2 + anchors.bottomMargin: UI.DEFAULT_MARGIN / 2 + anchors.leftMargin: UI.DEFAULT_MARGIN / 2 + anchors.rightMargin: UI.DEFAULT_MARGIN / 2 + clip: true - Column { - id: contentColumn - width: parent.width - spacing: UI.DEFAULT_MARGIN - Repeater { + contentHeight: contentColumn.height + + Column { + id: contentColumn width: parent.width - model: fontInfo.families - - delegate: Rectangle { - width: parent.width - 1 - height: childrenRect.height + UI.DEFAULT_MARGIN * 2 - border.width: 1 - color: "transparent" - Column { - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right -// width: parent.width - anchors.margins: UI.DEFAULT_MARGIN - spacing: UI.DEFAULT_MARGIN - Label { - width: parent.width - text: qsTr("Font Family: %1").arg(modelData) - } - Label { - width: parent.width - text: qsTr("Example: ") - } - Label { - width: parent.width - UI.DEFAULT_MARGIN * 2 - x: UI.DEFAULT_MARGIN - text: qsTr("The quick brown fox jumps over the lazy dog") - font.family: modelData - } - FontsConfProperties { - id: fontProp - width: parent.width - fontconf: fontInfo.fontProperty(modelData) - Connections { - target: fontInstallPage - onSaveProperties: { - fontProp.save() + spacing: UI.DEFAULT_MARGIN + + Repeater { + width: parent.width + model: fontInfo.families + + delegate: Item { + width: parent.width + height: itemColumn.height + UI.DEFAULT_MARGIN * 2 + Rectangle { + width: parent.width - 1 + height: parent.height - 1 + border.width: 1 + color: "transparent" + Column { + id: itemColumn + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + // width: parent.width + anchors.margins: UI.DEFAULT_MARGIN + spacing: UI.DEFAULT_MARGIN + Label { + width: parent.width + text: qsTr("Font Family: %1").arg(modelData) + } + Label { + width: parent.width + text: qsTr("Example: ") + } + Label { + width: parent.width - UI.DEFAULT_MARGIN * 2 + x: UI.DEFAULT_MARGIN + text: qsTr("The quick brown fox jumps over the lazy dog") + font.family: modelData + } + FontsConfProperties { + id: fontProp + width: parent.width + fontconf: fontInfo.fontProperty(modelData) + Connections { + target: fontInstallPage + onSaveProperties: { + fontProp.save() + } + } } } } } } + + } + + } + + ScrollDecorator { + flickableItem: view + } + + Item { + id: bottomField + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.right: parent.right + height: installButton.height + UI.DEFAULT_MARGIN * 2 + + Rectangle { + id: bgrect + anchors.fill: parent + gradient: Gradient { + GradientStop { position: 0.0; color: Qt.lighter("#76221d") } + GradientStop { position: 1.0; color: Qt.lighter("#bd543d") } + } } Button { id: installButton + anchors.centerIn: parent text: qsTr("Install") - anchors.horizontalCenter: parent.horizontalCenter onClicked: { saveProperties() if (!controller.fontDirExists) - createFontDirDialog.open() + openCreateFontDirDialog() else - installFont() + installFont(false) } } } + } + + + function openCreateFontDirDialog() + { + queryDialog.titleText = qsTr("Create it?") + queryDialog.message = qsTr("Local fonts directory '%1' does not exists! Create it now?").arg(controller.fontDir) + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(createFontDir) + queryDialog.open() + } + function createFontDir() + { + queryDialog.accepted.disconnect(createFontDir) + controller.createFontDir() + installFont(false) } - QueryDialog { - id: createFontDirDialog - titleText: qsTr("Create it?") - message: qsTr("Local fonts directory '%1' does not exists! Create it now?").arg(controller.fontDir) - acceptButtonText: qsTr("OK") - rejectButtonText: qsTr("Cancel") - onAccepted: { - controller.createFontDir() - installFont() - } + function openOverwriteFontDialog() + { + queryDialog.titleText = qsTr("Overwrite it?") + queryDialog.message = qsTr("Local font '%1' already exists! Overwrite it?").arg(fontInfo.fileName) + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(overwriteFont) + queryDialog.open() } - QueryDialog { - id: overwriteFontDialog - titleText: qsTr("Overwrite it?") - message: qsTr("Local font '%1' already exists! Overwrite it?").arg(fontInfo.fileName) - acceptButtonText: qsTr("OK") - rejectButtonText: qsTr("Cancel") - onAccepted: controller.installFont(fontInfo) + function overwriteFont() + { + queryDialog.accepted.disconnect(overwriteFont) + installFont(true) } ToolBarLayout { diff --git a/qml/fontmanager/FontsConfEditor.qml b/qml/fontmanager/FontsConfEditor.qml index 966ea94..924c8ed 100644 --- a/qml/fontmanager/FontsConfEditor.qml +++ b/qml/fontmanager/FontsConfEditor.qml @@ -43,7 +43,7 @@ import com.nokia.extras 1.0 import 'UIConstants.js' as UI import 'EditorHelper.js' as Helper -Page { +Item { id: editorPage property string family @@ -57,8 +57,7 @@ Page { onEditorControllerChanged: { if (editorController) { - modelSyncConnections.createObject(editorPage, {target: editorController}) - editorController.syncFamilyList() + Helper.setConnection(editorController) } } @@ -80,7 +79,6 @@ Page { function insertFamily(family, priority, systemFont) { var index = Helper.index(priority) - // console.log("insertFamily(" + family + "," + priority + "): " + controller.localeFamily(family)) preferFamilyList.insert(index, { "title": controller.localeFamily(family), "subtitle": (systemFont ? qsTr("System Font") : qsTr("User Font")), @@ -94,7 +92,6 @@ Page { function addFamily(section, family, priority, systemFont) { - // console.log("addFamily(" + family + "," + priority + "): " + controller.localeFamily(family)) preferFamilyList.append({ "title": controller.localeFamily(family), "subtitle": (systemFont ? qsTr("System Font") : qsTr("User Font")), diff --git a/qml/fontmanager/HelpDialog.js b/qml/fontmanager/HelpDialog.js new file mode 100644 index 0000000..c57e6ee --- /dev/null +++ b/qml/fontmanager/HelpDialog.js @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2011 Takumi Asaki +** All rights reserved. +** Contact: Takumi Asaki (takumi.asaki@gmail.com) +** +** This file is part of the fontmanager application. +** +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor +** the names of its contributors may be used to endorse or promote +** products derived from this software without specific prior written +** permission. +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +****************************************************************************/ + +var dialogComponent +var helpDialog + +function openHelpDialog(parent, anchorTarget, message, acceptedFunc) +{ + deleteHelpDialog() + if (!dialogComponent) { + dialogComponent = Qt.createComponent("HelpDialog.qml") + if (dialogComponent.status !== Component.Ready) { + console.log("Error: " + dialogComponent.errorString()) + } + } + helpDialog = dialogComponent.createObject(parent, { "anchors.fill": anchorTarget, "message": message } ) + if (!helpDialog) { + console.log("Error: " + dialogComponent.errorString()) + } + helpDialog.clicked.connect(acceptedFunc) + helpDialog.clicked.connect(deleteHelpDialog) +} + +function deleteHelpDialog() +{ + if (helpDialog) + helpDialog.destroy() + helpDialog = null +} diff --git a/qml/fontmanager/HelpDialog.qml b/qml/fontmanager/HelpDialog.qml index da85d8c..a5d4ef5 100644 --- a/qml/fontmanager/HelpDialog.qml +++ b/qml/fontmanager/HelpDialog.qml @@ -72,7 +72,10 @@ Item { anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom anchors.margins: UI.DEFAULT_MARGIN - onClicked: helpDialog.clicked() + onClicked: { + helpDialog.visible = false + helpDialog.clicked() + } } } diff --git a/qml/fontmanager/InstalledFontInfoPage.qml b/qml/fontmanager/InstalledFontInfoPage.qml index c8ed7c7..c72fc9b 100644 --- a/qml/fontmanager/InstalledFontInfoPage.qml +++ b/qml/fontmanager/InstalledFontInfoPage.qml @@ -153,19 +153,23 @@ Page { } } - QueryDialog { - id: confirmDialog - property int fontcount: 1 - property variant fontlist - titleText: qsTr("Delete Font?") - message: fontcount > 1 ? - qsTr("This Font has %1 families(%2). Do you really want to remove these fonts now?").arg(fontcount).arg(fontlist.join(qsTr(', '))) : - qsTr("Do you really want to remove this font now?") - acceptButtonText: qsTr("OK") - rejectButtonText: qsTr("Cancel") - onAccepted: { - controller.uninstallFont(fontInfo.file) - } + function openDeleteConfirmDialog(fontcount, fontlist) + { + queryDialog.titleText = qsTr("Delete Font?") + if (fontcount > 1) + queryDialog.message = qsTr("This Font has %1 families(%2). Do you really want to remove these fonts now?").arg(fontcount).arg(fontlist ? fontlist.join(qsTr(', ')) : qsTr("Unknown")) + else + queryDialog.message = qsTr("Do you really want to remove this font now?") + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(uninstallFont) + queryDialog.open() + } + + function uninstallFont() + { + queryDialog.accepted.disconnect(uninstallFont) + controller.uninstallFont(fontInfo.file) } ToolBarLayout { @@ -180,11 +184,10 @@ Page { } ToolIcon { platformIconId: "toolbar-delete" + anchors.horizontalCenter: parent.horizontalCenter onClicked: { var fontlist = controller.fontCount(fontInfo.file) - confirmDialog.fontcount = fontlist.length - confirmDialog.fontlist = fontlist - confirmDialog.open() + openDeleteConfirmDialog(fontlist.length, fontlist) } } } diff --git a/qml/fontmanager/MainPage.qml b/qml/fontmanager/MainPage.qml index 9f9f366..c5a76ad 100644 --- a/qml/fontmanager/MainPage.qml +++ b/qml/fontmanager/MainPage.qml @@ -41,14 +41,12 @@ import com.nokia.meego 1.0 import com.nokia.extras 1.0 import 'UIConstants.js' as UI +import "HelpDialog.js" as HelpHelper + Page { id: mainPage tools: mainTools - onEnabledChanged: { - console.log("mainPage.enabled: " + enabled) - } - property bool disableTools: false property bool showHelp: false @@ -60,15 +58,6 @@ Page { "

Create Recommended Settings(Menu): Create recommended settings. Normal priority is given to user installed font(s). System fonts have Higher priority. System CJK fonts conflicts your installed fonts have Lower priority.

" ) - PageHeader { - id: pageHeader - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - enabled: !disableTools - text: qsTr("Installed Fonts") - } - Connections { target: controller onClearInstalledFontList: { @@ -83,6 +72,15 @@ Page { id: installedFontList } + PageHeader { + id: pageHeader + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + enabled: !disableTools + text: qsTr("Installed Fonts") + } + Item { id: contents anchors.top: pageHeader.bottom @@ -104,7 +102,10 @@ Page { onClicked: { if (mainMenu.status !== DialogStatus.Closed) mainMenu.close() - pageStack.push(installedFontInfoPageComponent, { "fontInfo": controller.fontInfo(title, subtitle) } ); + var component = Qt.createComponent("InstalledFontInfoPage.qml") + if (component.status === Component.Error) + console.log("Error: " + component.errorString()) + pageStack.push(component, { "fontInfo": controller.fontInfo(title, subtitle) } ); } } @@ -139,25 +140,6 @@ Page { visible: running } - Loader { - id: componentLoader - } - - Component { - id: installedFontInfoPageComponent - InstalledFontInfoPage { } - } - - Component { - id: fontsConfViewPageComponent - FontsConfViewPage { } - } - - Component { - id: editFontsConfPageComponent - EditFontsConfPage {} - } - ToolBarLayout { id: mainTools visible: true @@ -176,7 +158,10 @@ Page { onClicked: { if (mainMenu.status !== DialogStatus.Closed) mainMenu.close() - pageStack.push(editFontsConfPageComponent) + var component = Qt.createComponent("EditFontsConfPage.qml") + if (component.status === Component.Error) + console.log("Error: " + component.errorString()) + pageStack.push(component) } } ToolIcon { @@ -202,77 +187,75 @@ Page { if (mainMenu.status !== DialogStatus.Closed) mainMenu.close() if (controller.localFontsConfExists) - createConfirmDialog.open() + openCreateConfirmDialog() else - controller.createRecommendedSettings() + createRecommendedSettings() } } MenuItem { id: backupConfigItem text: qsTr("Backup Config") onClicked: backupConfig() + enabled: !controller.isEmptyFontsConf } MenuItem { id: restoreConfigItem text: qsTr("Restore Config") - onClicked: pageStack.push(restoreFontsConfPageComponent) + onClicked: { + var component = Qt.createComponent("RestoreFontsConfPage.qml") + if (component.status === Component.Error) + console.log("Error: " + component.errorString()) + pageStack.push(component) + } } MenuItem { text: qsTr("About") - onClicked: aboutDialog.open() + onClicked: openAboutDialog() } MenuItem { text: qsTr("Help") - onClicked: showHelp = true + onClicked: { + showHelp = true + HelpHelper.openHelpDialog(mainPage, contents, helpMessage, closeHelp) + } } } } - QueryDialog { - id: createConfirmDialog - titleText: qsTr("Replace it?") - message: qsTr("Existing %1 will be replaced by recommended settings. Are you sure?").arg(controller.localFontsConfPath) - acceptButtonText: qsTr("OK") - rejectButtonText: qsTr("Cancel") - onAccepted: controller.createRecommendedSettings() - } - - HelpDialog { - id: helpDialog - anchors.fill: contents - message: helpMessage - visible: showHelp - onClicked: showHelp = false + function openCreateConfirmDialog() + { + queryDialog.titleText = qsTr("Replace it?") + queryDialog.message = qsTr("Existing %1 will be replaced by recommended settings. Are you sure?").arg(controller.localFontsConfPath) + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(createRecommendedSettings) + queryDialog.open() } - QueryDialog { - id: aboutDialog - titleText: qsTr("Font Manager for N9") - message: qsTr("Version: %1\nAuthor: Takumi Asaki \n\nApplication Icon is created by hirao").arg(controller.version) - acceptButtonText: qsTr("Close") + function createRecommendedSettings() + { + queryDialog.accepted.disconnect(createRecommendedSettings) + controller.createRecommendedSettings() } - QueryDialog { - id: backupDialog - width: parent.width - property string filepath - titleText: qsTr("Backup finished") - message: qsTr("Current config is backuped as '%1'").arg(filepath) - acceptButtonText: qsTr("Close") + function openAboutDialog() + { + queryDialog.titleText = qsTr("Font Manager for N9") + queryDialog.message = qsTr("Version: %1\nAuthor: Takumi Asaki \n\nApplication Icon is created by hirao").arg(controller.version) + queryDialog.acceptButtonText = qsTr("Close") + queryDialog.rejectButtonText = "" + queryDialog.open() } - Component { - id: restoreFontsConfPageComponent - RestoreFontsConfPage { } + function closeHelp() + { + showHelp = false } function backupConfig() { var filepath = controller.defaultBackupFilename() controller.backupConfig(filepath) - var displaypath = filepath.replace(/^\/home\/[^/]*\//, "~/") - backupDialog.filepath = displaypath - backupDialog.open() } states: [ diff --git a/qml/fontmanager/PageHeader.qml b/qml/fontmanager/PageHeader.qml index c7e254d..8ee92bc 100644 --- a/qml/fontmanager/PageHeader.qml +++ b/qml/fontmanager/PageHeader.qml @@ -11,14 +11,12 @@ Item { property alias text: label.text Rectangle { + id: bgrect anchors.fill: parent gradient: Gradient { GradientStop { position: 0.0; color: Qt.lighter("#bd543d") } GradientStop { position: 1.0; color: Qt.lighter("#76221d") } } - Component.onCompleted: { - console.log("PageHeader: " + width + " x " + height) - } } Label { @@ -28,4 +26,4 @@ Item { font.pixelSize: UI.FONT_LARGE font.bold: true } -} \ No newline at end of file +} diff --git a/qml/fontmanager/RestoreFontsConfPage.qml b/qml/fontmanager/RestoreFontsConfPage.qml index b5a4145..364547d 100644 --- a/qml/fontmanager/RestoreFontsConfPage.qml +++ b/qml/fontmanager/RestoreFontsConfPage.qml @@ -48,15 +48,30 @@ FileSelectionPage { folder: controller.backupDir nameFilters: [ "*.conf" ] - function restoreConfig(filename) + property url restoreFilePath + + onClicked: { + restoreFilePath = filePath + if (controller.localFontsConfExists) + openRestoreConfirmDialog() + else + restoreFontsConf() + } + + function openRestoreConfirmDialog() { - console.log("Restore: " + filename) - controller.restoreConfig(filename) + queryDialog.titleText = qsTr("Restore it?") + queryDialog.message = qsTr("Existing Fonts Config will be replaced by '%1'. Are you sure?").arg(controller.url2path(restoreFilePath)) + queryDialog.acceptButtonText = qsTr("OK") + queryDialog.rejectButtonText = qsTr("Cancel") + queryDialog.accepted.connect(restoreFontsConf) + queryDialog.open() } - onClicked: { - restoreConfig(filePath) - pageStack.pop() + function restoreFontsConf() + { + queryDialog.accepted.disconnect(restoreFontsConf) + controller.restoreConfig(restoreFilePath) } } diff --git a/qml/fontmanager/SelectInstallFamilyDialog.qml b/qml/fontmanager/SelectInstallFamilyDialog.qml new file mode 100644 index 0000000..448c366 --- /dev/null +++ b/qml/fontmanager/SelectInstallFamilyDialog.qml @@ -0,0 +1,19 @@ +import QtQuick 1.1 +import com.nokia.meego 1.0 +import 'UIConstants.js' as UI + +MultiSelectionDialog { + id: selectInstallFamily + model: installableFamilyListModel + property Item editor + acceptButtonText: qsTr("Add") + titleText: qsTr("Add Family for %1").arg(editor !== null ? editor.familyName : qsTr("Unknwon")) + onAccepted: { + for (var i = 0; i < selectedIndexes.length; i++) { + var idx = selectedIndexes[i] + var sItem = installableFamilyListModel.get(idx) + editor.editorController.appendFamily(sItem.enfamily, currentPriority) + editor.insertFamily(sItem.enfamily, currentPriority, sItem.systemFont) + } + } +} diff --git a/qml/fontmanager/main.qml b/qml/fontmanager/main.qml index ba9f11f..6929f1a 100644 --- a/qml/fontmanager/main.qml +++ b/qml/fontmanager/main.qml @@ -49,24 +49,41 @@ PageStackWindow { id: mainPage } + property string filePath + property string alertMessage + Connections { target: controller onAlertDialog: { - alertDialog.message = message - alertDialog.open() + alertMessage = message + openAlertDialog() } + onInstallFinished: { - installFinishedDialog.fontpath = fontpath - installFinishedDialog.open() + filePath = fontpath + openInstallFinishedDialog() } + onUninstallFinished: { - uninstallFinishedDialog.fontpath = fontpath - uninstallFinishedDialog.open() + filePath = fontpath + openUninstallFinishedDialog() + } + + onBackupConfigFinished: { + filePath = filepath + openBackupConfigFinishedDialog() + } + + onRestoreConfigFinished: { + filePath = filepath + openRestoreConfigFinishedDialog() } + onClearInstallableFamilyListFor: { installableFamilyListModel.clear() installableFamilyListModel.family = family; } + onAppendInstallableFamily: { installableFamilyListModel.append( { "name": family, "enfamily": enfamily, "systemFont": systemFont } ) } @@ -83,30 +100,87 @@ PageStackWindow { } } - QueryDialog { - id: alertDialog - titleText: qsTr("Alert") - acceptButtonText: qsTr("OK") + function openAlertDialog() + { + queryDialog.statusChanged.disconnect(openAlertDialog) + if (queryDialog.status !== DialogStatus.Closed) { + queryDialog.statusChanged.connect(openAlertDialog) + return + } + queryDialog.titleText = qsTr("Alert") + queryDialog.message = alertMessage + queryDialog.acceptButtonText = qsTr("Close") + queryDialog.rejectButtonText = "" + queryDialog.open() } - QueryDialog { - id: installFinishedDialog - property string fontpath: "Unknown" - titleText: qsTr("Install finished") - message: qsTr("Font '%1' is installed successfully.").arg(fontpath) - acceptButtonText: qsTr("Close") - onAccepted: { pageStack.pop(mainPage) } - onRejected: { pageStack.pop(mainPage) } + function openFinishedDialog() + { + queryDialog.acceptButtonText = qsTr("Close") + queryDialog.rejectButtonText = "" + queryDialog.accepted.connect(popToMainPage) + queryDialog.rejected.connect(popToMainPage) + queryDialog.open() + } + + function openInstallFinishedDialog() + { + queryDialog.statusChanged.disconnect(openInstallFinishedDialog) + if (queryDialog.status !== DialogStatus.Closed) { + queryDialog.statusChanged.connect(openInstallFinishedDialog) + return + } + queryDialog.titleText = qsTr("Install finished") + queryDialog.message = qsTr("Font '%1' is installed successfully.").arg(filePath) + openFinishedDialog() + } + + function openUninstallFinishedDialog() + { + queryDialog.statusChanged.disconnect(openUninstallFinishedDialog) + if (queryDialog.status !== DialogStatus.Closed) { + queryDialog.statusChanged.connect(openUninstallFinishedDialog) + return + } + queryDialog.titleText = qsTr("Uninstall finished") + queryDialog.message = qsTr("Font '%1' is uninstalled successfully.").arg(filePath) + openFinishedDialog() + } + + function openBackupConfigFinishedDialog() + { + queryDialog.statusChanged.disconnect(openBackupConfigFinishedDialog) + if (queryDialog.status !== DialogStatus.Closed) { + queryDialog.statusChanged.connect(openBackupConfigFinishedDialog) + return + } + queryDialog.titleText = qsTr("Backup finished") + queryDialog.message = qsTr("Fonts Config is backuped as '%1' successfully.").arg(filePath) + openFinishedDialog() + } + + function openRestoreConfigFinishedDialog() + { + queryDialog.statusChanged.disconnect(openRestoreConfigFinishedDialog) + if (queryDialog.status !== DialogStatus.Closed) { + queryDialog.statusChanged.connect(openRestoreConfigFinishedDialog) + return + } + queryDialog.titleText = qsTr("Restore finished") + queryDialog.message = qsTr("Fonts Config is restored from '%1' successfully.").arg(filePath) + openFinishedDialog() + } + + function popToMainPage() + { + queryDialog.accepted.disconnect(popToMainPage) + queryDialog.rejected.disconnect(popToMainPage) + if (pageStack.currentPage !== mainPage) + pageStack.pop(mainPage) } QueryDialog { - id: uninstallFinishedDialog - property string fontpath: "Unknown" - titleText: qsTr("Uninstall finished") - message: qsTr("Font '%1' is uninstalled successfully.").arg(fontpath) - acceptButtonText: qsTr("Close") - onAccepted: pageStack.pop(mainPage) - onRejected: pageStack.pop(mainPage) + id: queryDialog } } diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog index 70eccda..66aa674 100644 --- a/qtc_packaging/debian_harmattan/changelog +++ b/qtc_packaging/debian_harmattan/changelog @@ -1,3 +1,11 @@ +fontmanager (0.4.95) unstable; urgency=low + + 0.5RC + * UI improvments + * UI Optimizations + + -- Takumi Asaki Mon, 9 Apr 2012 21:45:00 +0900 + fontmanager (0.4.9) unstable; urgency=low 0.5 beta diff --git a/translations/fontmanager_ja.ts b/translations/fontmanager_ja.ts index bf72a4d..f845c4e 100644 --- a/translations/fontmanager_ja.ts +++ b/translations/fontmanager_ja.ts @@ -4,12 +4,20 @@ ApplicationController - + Could not remove Font '%1' フォント '%1' を削除できません + BottomButtons + + + Import System Settings + システム設定のインポート + + + ConfigValueComboBox @@ -30,56 +38,52 @@ EditFontsConfPage - + <p>Select font family and edit priorities.</p><p><img src="image://theme/icon-m-toolbar-add">: Add fonts to the selected <i>Priority</i> in config file.</p><p><img src="image://theme/icon-m-toolbar-delete">: Remove fonts from the selected <i>Priority</i> in config file. <i>Note: The fonts are NOT uninstalled</i>.</p><hr/><p><b>Priorities</b>:<p>&nbsp;&nbsp;<b>Higher</b>: These fonts have a higher priority. ('prepend' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Normal</b>: These fonts are usally used as default. ('prefer' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Lowser</b>: These fonts have a lower priority. ('accept' fonts in fontconfig)<br/><hr/><p><b>Import System Settings</b>: Import settings from system(/etc/fonts/local.conf).</p><hr/><p><b>Remove current font config</b>(Menu): Remove current user's font config file.</p><p><b>View current font config</b>(Menu): View current user's font config file.</p><hr/>Please check <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> for more details. <p>フォントファミリーを選択し、プロパティを編集します。</p><p><img src="image://theme/icon-m-toolbar-add">: フォントを設定ファイルの選択した <i>優先順位</i> に追加します。</p><p><img src="image://theme/icon-m-toolbar-delete">: フォントを設定ファイルの選択した <i>優先順位</i> から削除します。<i>注: フォントはアンインストールされません。</i></p><hr/><p><b>優先順位</b>:<p>&nbsp;&nbsp;<b>高</b>: これらのフォントは優先して使用されます。(fontconfig で 'prepend' されるフォントとして扱います)<br/>&nbsp;&nbsp;<b>標準</b>: これらのフォントがデフォルトで使用されます。(fontconfig で 'prefer' されるフォントとして扱います)<br/>&nbsp;&nbsp;<b>低</b>: これらのフォントは代替フォントして使用されます。(fontconfig で 'accept' されるフォントとして扱います)<br/><hr/><p><b>システム設定のインポート</b>: システム(/etc/fonts/local.conf)の設定をインポートします。</p><hr/><p><b>現在のフォント設定を削除</b>(メニュー): 現在のユーザーのフォント設定ファイルを削除します。</p><p><b>現在のフォント設定を表示</b>(メニュー): 現在のユーザーのフォント設定ファイルを表示します。</p><hr/>詳細は <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> も参照してください。 - + Sans Serif - + Serif - + Monospace 等幅 - - Add - 追加 - - - - Add Family for %1 - %1 に追加するフォントファミリー - - - + Help ヘルプ - + Remove current fonts config 現在のフォント設定を削除 - <p>Select font family and edit priorities.</p><p><img src="image://theme/icon-m-toolbar-add">: Add fonts to the selected <i>Priority</i> in config file.</p><p><img src="image://theme/icon-m-toolbar-delete">: Remove fonts from the selected <i>Priority</i> in config file. <i>Note: The fonts are NOT uninstalled</i>.</p><hr/><p><b>Priorities</b>:<p>&nbsp;&nbsp;<b>Higher</b>: These fonts have a higher priority. ('prepend' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Middle</b>: These fonts are usally used as default. ('prefer' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Lowser</b>: These fonts have a lower priority. ('accept' fonts in fontconfig)<br/><hr/><p><b>Import System Settings</b>: Import settings from system(/etc/fonts/local.conf).</p><hr/><p><b>Remove current font config</b>(Menu): Remove current user's font config file.</p><p><b>View current font config</b>(Menu): View current user's font config file.</p><hr/>Please check <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> for more details. - <p>フォントファミリーを選択し、プロパティを編集します。</p><p><img src="image://theme/icon-m-toolbar-add">: フォントを設定ファイルの選択した <i>優先順位</i> に追加します。</p><p><img src="image://theme/icon-m-toolbar-delete">: フォントを設定ファイルの選択した <i>優先順位</i> から削除します。<i>注: フォントはアンインストールされません。</i></p><hr/><p><b>優先順位</b>:<p>&nbsp;&nbsp;<b>高</b>: これらのフォントは優先して使用されます。(fontconfig で 'prepend' されるフォントとして扱います)<br/>&nbsp;&nbsp;<b>Middle</b>: These fonts are usally used as default. ('prefer' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Lowser</b>: These fonts have a lower priority. ('accept' fonts in fontconfig)<br/><hr/><p><b>Import System Settings</b>: Import settings from system(/etc/fonts/local.conf).</p><hr/><p><b>Remove current font config</b>(Menu): Remove current user's font config file.</p><p><b>View current font config</b>(Menu): View current user's font config file.</p><hr/>Please check <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> for more details. + + System + システム + Edit Fonts Config: %1 + フォント設定の編集: %1 + + + View current fonts config 現在のフォント設定を表示 - + Remove it? 削除しますか? @@ -91,23 +95,28 @@ OK - はい + OK Cancel キャンセル + + + Select Family to edit + 編集するファミリの選択 + FontInstallPage - + Install Font フォントのインストール - + <b>Font Family</b>: %1 <b>フォントファミリー</b>: %1 @@ -122,12 +131,12 @@ - + Install インストール - + Create it? 作成しますか? @@ -138,13 +147,13 @@ - + OK - はい + OK - - + + Cancel キャンセル @@ -160,9 +169,9 @@ - FontSelectPage + FontSelectionPage - + Select Font to install インストールするフォントの選択 @@ -170,41 +179,27 @@ FontsConfEditor - - Edit Fonts Config: %1 - フォント設定の編集: %1 - - - + Priority: %1 優先順位: %1 - + System Font システムフォント - - + + User Font ユーザーフォント - - - Import System Settings - システム設定のインポート - FontsConfEditorController - High - 高 - - - + Higher 高 @@ -218,10 +213,6 @@ Lower 低 - - Low - 低 - FontsConfProperties @@ -244,7 +235,7 @@ FontsConfViewPage - + Current Fonts Config 現在のフォント設定 @@ -263,14 +254,14 @@ - OK - はい + Close + 閉じる InstalledFontInfoPage - + Installed Font Info インストール済みフォントの詳細 @@ -350,7 +341,7 @@ <b>フォント設定</b> - + Delete Font? フォントを削除しますか? @@ -365,14 +356,19 @@ このフォントには %1 個のファミリー(%2)があります。これら全てのフォントを削除しますか? - + + Unknown + 不明 + + + Do you really want to remove this font now? このフォントを削除しますか? OK - はい + OK @@ -383,37 +379,52 @@ MainPage - + Installed Fonts インストール済みフォント - + + Close + 閉じる + + + No Fonts Installed フォントは未インストールです - + About Font managerについて - + <h1>How to use</h1><p><img src="image://theme/icon-m-toolbar-add">: Install font. Please copy font file(s) to this device in advance. Currently *.ttf and *.ttc are supported.</p><p><img src="image://theme/icon-m-toolbar-settings">: Configure fonts(expert). You can assign/unassign any fonts to Serif/Sans Serif/Monospace.</p><hr/><p><b>Create Recommended Settings</b>(Menu): Create recommended settings. <i>Normal</i> priority is given to user installed font(s). System fonts have <i>Higher</i> priority. System CJK fonts conflicts your installed fonts have <i>Lower</i> priority.</p> <h1>使い方</h1><p><img src="image://theme/icon-m-toolbar-add">: フォントのインストール。事前にデバイスにフォントファイルをコピーしておいてください。現状では *.ttf と *.ttc のみサポートしています。</p><p><img src="image://theme/icon-m-toolbar-settings">: フォント設定(詳細設定). Serif/Sans Serif/等幅フォントへ任意のフォントを割り当てられます。</p><hr/><p><b>推奨設定の作成</b>(メニュー): 推奨設定を生成します。ユーザーがインストールしたフォントは<i>標準</i>の優先順位に割り当てます。システムのフォントは<i>高い</i>優先順位に割り当てられますが、ユーザーがインストールしたCJKフォントと競合するフォントの優先順位は<i>低く</i>なります。</p> - + Help ヘルプ - + Create Recommended Settings 推奨設定の作成 - + + Backup Config + 設定のバックアップ + + + + Restore Config + 設定の復旧 + + + Replace it? 置き換えますか? @@ -424,17 +435,16 @@ - OK はい - + Cancel キャンセル - + Font Manager for N9 N9用フォントマネージャ @@ -451,21 +461,66 @@ Application Icon is created by hirao - main + RestoreFontsConfPage - - - + + Restore Fonts Config + 復旧させるフォント設定 + + + + Restore it? + 復旧しますか + + + + Existing Fonts Config will be replaced by '%1'. Are you sure? + 既存のフォント設定は %1 で置き換えられます。よろしいですか? + + + OK はい - + + Cancel + キャンセル + + + + SelectInstallFamilyDialog + + + Add + 追加 + + + + Add Family for %1 + %1 に追加するフォントファミリー + + + + Unknwon + 不明 + + + + main + + Alert 警告 + + Close + 閉じる + + + Install finished インストール完了 @@ -475,7 +530,7 @@ Application Icon is created by hirao フォント '%1' のインストールが成功しました。 - + Uninstall finished アンインストール完了 @@ -484,5 +539,25 @@ Application Icon is created by hirao Font '%1' is uninstalled successfully. フォント '%1' のアンインストールが成功しました。 + + + Backup finished + バックアップ完了 + + + + Fonts Config is backuped as '%1' successfully. + フォントの設定を %1 にバックアップしました。 + + + + Restore finished + 復旧完了 + + + + Fonts Config is restored from '%1' successfully. + フォントの設定を %1 から復旧しました。 + diff --git a/translations/translations.pri b/translations/translations.pri index 476e52c..9463a39 100644 --- a/translations/translations.pri +++ b/translations/translations.pri @@ -21,8 +21,6 @@ for(file, files) { lang = $$replace(file, .*_([^/]*)\\.ts, \\1) v = ts-$${lang}.commands $$v = cd $$wd && $$LUPDATE $$sources -ts $$file - v = ts-$${lang}.depends - $$v = extract QMAKE_EXTRA_TARGETS += ts-$$lang } ts-all.commands = cd $$wd && $$LUPDATE $$sources -ts $$files