From: Takumi ASAKI Date: Tue, 10 Apr 2012 17:31:18 +0000 (+0900) Subject: Version 0.5 X-Git-Url: http://git.sourceforge.jp/view?a=commitdiff_plain;p=fontmanager%2Ffontmanager.git Version 0.5 * Add changing config order. * Add editing System font. * Add backup/restore configuration. * Improvement UI & performance --- diff --git a/applicationcontroller.cpp b/applicationcontroller.cpp index 71499ba..2a5d132 100644 --- a/applicationcontroller.cpp +++ b/applicationcontroller.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -46,10 +46,12 @@ #include +#define VERSION_STRING "0.5" + ApplicationController::ApplicationController(QObject *parent) : QObject(parent), mFontDirExists(false), mShowSystemFont(false), mUpdating(0), - mForceOverwrite(false), mWorking(false), mIgnoreUpdate(false), + mWorking(false), mIgnoreUpdate(false), mFontConfig(0) { @@ -96,7 +98,7 @@ void ApplicationController::init() QString ApplicationController::version() const { - return QLatin1String("0.4.95(0.5RC)"); + return QLatin1String(VERSION_STRING); } QString ApplicationController::currentLanguage() const @@ -230,11 +232,23 @@ QString ApplicationController::defaultBackupFilename() const 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; } +QString ApplicationController::path4display(const QString &path) const +{ + QString str(path); + if (str.startsWith(QDir::homePath())) + str.replace(0, QDir::homePath().length(), QLatin1String("~")); +// str.replace(QLatin1Char('/'), "/"); + return str; +} + +QStringList ApplicationController::installedFonts() const +{ + return mInstalledFonts; +} + void ApplicationController::updateAllEditorController() { if (!mFontConfig->fontsConfModified() || mIgnoreUpdate) { @@ -307,9 +321,8 @@ void ApplicationController::resetLocalFontsConf() void ApplicationController::importSystemSettings(const QString &family) { mFontConfig->importSystemSettings(family); - if (mFontConfig->fontsConfModified()) { + if (mFontConfig->fontsConfModified()) updateEditorController(family); - } } void ApplicationController::createRecommendedSettings() @@ -329,6 +342,11 @@ void ApplicationController::restoreConfig(const QString &filename) emit restoreConfigFinished(filename); } +void ApplicationController::restoreConfig(const QUrl &filename) +{ + restoreConfig(filename.toLocalFile()); +} + void ApplicationController::createFontDir() { QDir fontDir(mFontDirPath); @@ -351,6 +369,11 @@ void ApplicationController::installFont(FontInfo *fontinfo) mFontConfig->appendFontProperty(prop); } + if (!mInstalledFonts.contains(dstfont.absoluteFilePath())) { + mInstalledFonts.append(dstfont.absoluteFilePath()); + emit installedFontsChanged(); + } + emit installFinished(srcfont.fileName()); mWorking = true; @@ -367,6 +390,12 @@ void ApplicationController::updateFontsConf(InstalledFontInfo *fontInfo) void ApplicationController::uninstallFont(const QString &fontpath) { bool check = QFile::remove(fontpath); + + if (mInstalledFonts.contains(fontpath)) { + mInstalledFonts.removeOne(fontpath); + emit installedFontsChanged(); + } + if (check) { emit uninstallFinished(fontpath); @@ -404,12 +433,13 @@ void ApplicationController::syncInstallableFamilyFor(const QString &family) void ApplicationController::saveFontsConf() { - if (!mFontConfig->fontsConfModified()) + if (!mFontConfig->fontsConfModified()) { + emit localFontsConfFileUpdated(); return; + } mFontConfig->saveFontsConf(); - mForceOverwrite = false; - emit localFontsConfPathChanged(); + emit localFontsConfFileUpdated(); } void ApplicationController::appendFamilyToConfig(const QString &family, const QString &value, const QString &priority) diff --git a/applicationcontroller.h b/applicationcontroller.h index e858eef..f81ff5a 100644 --- a/applicationcontroller.h +++ b/applicationcontroller.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -59,14 +59,16 @@ class ApplicationController : public QObject Q_PROPERTY(QString localFontsConfPath READ localFontsConfPath NOTIFY localFontsConfPathChanged) Q_PROPERTY(bool localFontsConfExists READ localFontsConfExists NOTIFY localFontsConfExistsChanged) - Q_PROPERTY(bool isEmptyFontsConf READ isEmptyFontsConf NOTIFY localFontsConfChanged) - Q_PROPERTY(QString localFontsConf READ localFontsConf NOTIFY localFontsConfChanged) + Q_PROPERTY(bool isEmptyFontsConf READ isEmptyFontsConf NOTIFY localFontsConfFileUpdated) + Q_PROPERTY(QString localFontsConf READ localFontsConf NOTIFY localFontsConfFileUpdated) Q_PROPERTY(bool showSystemFont READ showSystemFont WRITE setShowSystemFont NOTIFY showSystemFontChanged) Q_PROPERTY(bool working READ working NOTIFY workingChanged) Q_PROPERTY(QUrl backupDir READ backupDir NOTIFY backupDirChanged) + + Q_PROPERTY(QStringList installedFonts READ installedFonts NOTIFY installedFontsChanged) public: explicit ApplicationController(QObject *parent = 0); @@ -101,6 +103,9 @@ public: Q_INVOKABLE QString defaultBackupFilename() const; Q_INVOKABLE QString url2path(const QUrl &url) const; + Q_INVOKABLE QString path4display(const QString &path) const; + + QStringList installedFonts() const; public slots: void updateAllEditorController(); @@ -125,6 +130,7 @@ public slots: void backupConfig(const QString &filename); void restoreConfig(const QString &filename); + void restoreConfig(const QUrl &filename); signals: void alertDialog(const QString &message); @@ -133,6 +139,7 @@ signals: void fontDirExistsChanged(); void showSystemFontChanged(); + void installedFontsChanged(); void installFinished(const QString &fontpath); void uninstallFinished(const QString &fontpath); @@ -148,6 +155,7 @@ signals: void localFontsConfPathChanged(); void localFontsConfExistsChanged(); void localFontsConfChanged(); + void localFontsConfFileUpdated(); void workingChanged(); @@ -181,9 +189,9 @@ private: QString mFontDirPath; bool mFontDirExists; bool mShowSystemFont; + QStringList mInstalledFonts; int mUpdating; - bool mForceOverwrite; bool mWorking; bool mIgnoreUpdate; diff --git a/fontconfigdefs.h b/fontconfigdefs.h index 59c6626..aa1b692 100644 --- a/fontconfigdefs.h +++ b/fontconfigdefs.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontconfigmanager.cpp b/fontconfigmanager.cpp index 9d98f7f..dce59b3 100644 --- a/fontconfigmanager.cpp +++ b/fontconfigmanager.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -51,9 +51,15 @@ #include #include #include +#include #include +#include +#undef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS #include +#endif #define FCBIN_PATH "/usr/bin/" #define FCCACHE_COMMAND "fc-cache" @@ -61,13 +67,11 @@ #define FCLIST_COMMAND "fc-list" #define FCLIST_OPTION "-v" -//static QStringList configKeys; - FontConfigManager::FontConfigManager(QObject *parent) : QObject(parent), mLang("en"), mLocalFontsConf(0) { connect(this, SIGNAL(localFontsConfPathChanged()), SIGNAL(localFontsConfExistsChanged())); -// connect(this, SIGNAL(localFontsConfPathChanged()), SIGNAL(fontsConfUpdated())); + // connect(this, SIGNAL(localFontsConfPathChanged()), SIGNAL(fontsConfUpdated())); mLocalFontsConf = new FontsConf(this); mSystemLocalConf = new FontsConf(this); @@ -401,7 +405,7 @@ void FontConfigManager::createRecommendedSettings() emit startUpdateFontsConfig(); resetFontsConf(); -#if 0 +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS QStringList f; foreach (InstalledFontInfo *info, monospaceFonts) f << info->localefamily(); @@ -431,59 +435,52 @@ void FontConfigManager::createRecommendedSettings() if (monospaceFonts.count()) foreach (InstalledFontInfo *info, monospaceFonts) { addPreferFamily(MONOSPACE_DEF, info->enfamily()); - addPreferFamily(MONOSPACE_DEF, info->localefamily()); } else if (monospaceSansSerifFonts.count()) foreach (InstalledFontInfo *info, monospaceSansSerifFonts) { addPreferFamily(MONOSPACE_DEF, info->enfamily()); - addPreferFamily(MONOSPACE_DEF, info->localefamily()); } else if (monospaceSerifFonts.count()) foreach (InstalledFontInfo *info, monospaceSerifFonts) { addPreferFamily(MONOSPACE_DEF, info->enfamily()); - addPreferFamily(MONOSPACE_DEF, info->localefamily()); } if (sansSerifFonts.count()) foreach (InstalledFontInfo *info, sansSerifFonts) { addPreferFamily(SANSSERIF_DEF, info->enfamily()); - addPreferFamily(SANSSERIF_DEF, info->localefamily()); + addPreferFamily(SYSTEM_DEF, info->enfamily()); } else if (monospaceSansSerifFonts.count()) foreach (InstalledFontInfo *info, monospaceSansSerifFonts) { addPreferFamily(SANSSERIF_DEF, info->enfamily()); - addPreferFamily(SANSSERIF_DEF, info->localefamily()); + addPreferFamily(SYSTEM_DEF, info->enfamily()); } else if (unknownFonts.count()) foreach (InstalledFontInfo *info, unknownFonts) { addPreferFamily(SANSSERIF_DEF, info->enfamily()); - addPreferFamily(SANSSERIF_DEF, info->localefamily()); + addPreferFamily(SYSTEM_DEF, info->enfamily()); } else if (monospaceFonts.count()) foreach (InstalledFontInfo *info, monospaceFonts) { addPreferFamily(SANSSERIF_DEF, info->enfamily()); - addPreferFamily(SANSSERIF_DEF, info->localefamily()); + addPreferFamily(SYSTEM_DEF, info->enfamily()); } if (serifFonts.count()) foreach (InstalledFontInfo *info, serifFonts) { addPreferFamily(SERIF_DEF, info->enfamily()); - addPreferFamily(SERIF_DEF, info->localefamily()); } else if (monospaceSerifFonts.count()) foreach (InstalledFontInfo *info, monospaceSerifFonts) { addPreferFamily(SANSSERIF_DEF, info->enfamily()); - addPreferFamily(SANSSERIF_DEF, info->localefamily()); } else if (unknownFonts.count()) foreach (InstalledFontInfo *info, unknownFonts) { addPreferFamily(SERIF_DEF, info->enfamily()); - addPreferFamily(SERIF_DEF, info->localefamily()); } else if (monospaceFonts.count()) foreach (InstalledFontInfo *info, monospaceFonts) { addPreferFamily(SERIF_DEF, info->enfamily()); - addPreferFamily(SERIF_DEF, info->localefamily()); } foreach (const QString &f, FontsConf::genericFamilies()) @@ -552,18 +549,56 @@ bool FontConfigManager::maybeSerifFont(InstalledFontInfo *info) const return false; } +#define DEFAULT_POINTSIZE 24 + bool FontConfigManager::maybeMonospaceFont(InstalledFontInfo *info) const { - QFont font(info->enfamily()); + int fontId = -1; + QFont font = font4info(info, DEFAULT_POINTSIZE); +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "0 - FontConfigManager::maybeMonospaceFont(" << info->enfamily() << info->enstyle() << point << ")" << font.family() << font.exactMatch(); +#endif + if (!font.exactMatch() || font.family() != info->enfamily()) { + fontId = QFontDatabase::addApplicationFont(info->file()); +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "\tfontId:" << fontId << info->file(); +#endif + if (fontId >= 0) { + font = font4info(info, DEFAULT_POINTSIZE); +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "1 - FontConfigManager::maybeMonospaceFont(" << info->enfamily() << info->enstyle() << point << ")" << font.family() << font.exactMatch(); +#endif + if (!font.exactMatch() || font.family() != info->enfamily()) { + font = QFont(info->enfamily()); +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "2 - FontConfigManager::maybeMonospaceFont(" << info->enfamily() << info->enstyle() << point << ")" << font.family() << font.exactMatch(); +#endif + } + } + } + bool isFixed = false; if (font.exactMatch()) { QFontInfo fi(font); - if (fi.fixedPitch()) - return true; - QFontMetrics fm(font); - int w = fm.width(QLatin1Char('A')); - if (fm.width(QLatin1Char('i')) == w && fm.width(QLatin1Char('X')) == w) - return true; +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "\tfixedPitch:" << fi.fixedPitch(); +#endif + if (fi.fixedPitch()) { + isFixed = true; + } else { + QFontMetrics fm(font); + int w = fm.width(QLatin1Char('A')); +#ifdef FONTMANAGER_DEBUG_RECOMMENDED_SETTINGS + qDebug() << "\twidth:" << w << fm.width(QLatin1Char('i')) << fm.width(QLatin1Char('X')); +#endif + if (fm.width(QLatin1Char('i')) == w && fm.width(QLatin1Char('X')) == w) { + isFixed = true; + } + } } + if (fontId >= 0) + QFontDatabase::removeApplicationFont(fontId); + if (isFixed) + return true; foreach (const QString &f, info->family()) { if (f.contains("courier", Qt::CaseInsensitive) || f.contains("mono", Qt::CaseInsensitive)) @@ -572,6 +607,19 @@ bool FontConfigManager::maybeMonospaceFont(InstalledFontInfo *info) const return false; } +QFont FontConfigManager::font4info(InstalledFontInfo *info, int pointSize) const +{ + QFontDatabase fdb; + int point = pointSize; + if (!fdb.isScalable(info->enfamily(), info->enstyle())) { + QList points = fdb.pointSizes(info->enfamily(), info->enstyle()); + if (points.count() > 0) + point = points.first(); + } + QFont font = fdb.font(info->enfamily(), info->enstyle(), point); + return font; +} + void FontConfigManager::runFcCache() { QProcess *proc = new QProcess(this); @@ -597,7 +645,7 @@ void FontConfigManager::readFcList() QByteArray buf = proc->readAllStandardOutput(); QByteArray errbuf = proc->readAllStandardError(); if (!errbuf.isEmpty()) - qWarning() << errbuf; + qWarning("%s", errbuf.constData()); Q_ASSERT(errbuf.isEmpty()); static QByteArray emptyLine("\n"); @@ -652,9 +700,8 @@ void FontConfigManager::saveFontsConf() } } else { mLocalFontsConf->save(mLocalFontsConfPath); - if (!check) { + if (!check) emit localFontsConfExistsChanged(); - } } } @@ -665,9 +712,8 @@ void FontConfigManager::backupFontsConf(const QString &filepath) mLocalFontsConf->save(filepath); } -void FontConfigManager::restoreFontsConf(const QUrl &fileUrl) +void FontConfigManager::restoreFontsConf(const QString &filepath) { - QString filepath = fileUrl.toLocalFile(); if (filepath.isEmpty() || !QFile::exists(filepath)) return; FontsConf *restoredConf = new FontsConf(this); diff --git a/fontconfigmanager.h b/fontconfigmanager.h index 809f492..98a439e 100644 --- a/fontconfigmanager.h +++ b/fontconfigmanager.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -43,6 +43,7 @@ #include #include #include +#include #include "fontsconfigproperties.h" @@ -120,6 +121,7 @@ private: bool maybeSansSerifFont(InstalledFontInfo *info) const; bool maybeSerifFont(InstalledFontInfo *info) const; bool maybeMonospaceFont(InstalledFontInfo *info) const; + QFont font4info(InstalledFontInfo *info, int pointSize) const; signals: void fcCacheFinished(); @@ -140,7 +142,7 @@ public slots: void readFontsConf(); void saveFontsConf(); void backupFontsConf(const QString &filepath); - void restoreFontsConf(const QUrl &fileUrl); + void restoreFontsConf(const QString &filepath); void resetFontsConf(); diff --git a/fontinfo.cpp b/fontinfo.cpp index b62cb17..694c6c5 100644 --- a/fontinfo.cpp +++ b/fontinfo.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontinfo.h b/fontinfo.h index 42053fb..1ad4335 100644 --- a/fontinfo.h +++ b/fontinfo.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconf.cpp b/fontsconf.cpp index fcf2935..13acafa 100644 --- a/fontsconf.cpp +++ b/fontsconf.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconf.h b/fontsconf.h index 9da9eba..46edabf 100644 --- a/fontsconf.h +++ b/fontsconf.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfeditorcontroller.cpp b/fontsconfeditorcontroller.cpp index 32f1ebc..328cdac 100644 --- a/fontsconfeditorcontroller.cpp +++ b/fontsconfeditorcontroller.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfeditorcontroller.h b/fontsconfeditorcontroller.h index f859031..d89b056 100644 --- a/fontsconfeditorcontroller.h +++ b/fontsconfeditorcontroller.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfelement.cpp b/fontsconfelement.cpp index 66f7575..0f8fc8c 100644 --- a/fontsconfelement.cpp +++ b/fontsconfelement.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfelement.h b/fontsconfelement.h index 42d4919..a37689d 100644 --- a/fontsconfelement.h +++ b/fontsconfelement.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfigproperties.cpp b/fontsconfigproperties.cpp index f72a4b6..00584ee 100644 --- a/fontsconfigproperties.cpp +++ b/fontsconfigproperties.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/fontsconfigproperties.h b/fontsconfigproperties.h index 8ff641d..0f9ca1d 100644 --- a/fontsconfigproperties.h +++ b/fontsconfigproperties.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/installedfontinfo.cpp b/installedfontinfo.cpp index e83eec5..d7618c0 100644 --- a/installedfontinfo.cpp +++ b/installedfontinfo.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/installedfontinfo.h b/installedfontinfo.h index 5d05f89..1646c1e 100644 --- a/installedfontinfo.h +++ b/installedfontinfo.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/main.cpp b/main.cpp index 60d3dd6..50ab518 100644 --- a/main.cpp +++ b/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/BottomButtons.qml b/qml/fontmanager/BottomButtons.qml index 4ebd733..b8ee9fb 100644 --- a/qml/fontmanager/BottomButtons.qml +++ b/qml/fontmanager/BottomButtons.qml @@ -1,3 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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." +** +****************************************************************************/ + import QtQuick 1.1 import com.nokia.meego 1.0 import 'UIConstants.js' as UI diff --git a/qml/fontmanager/ConfigValueComboBox.qml b/qml/fontmanager/ConfigValueComboBox.qml index 6a997fb..5e5962a 100644 --- a/qml/fontmanager/ConfigValueComboBox.qml +++ b/qml/fontmanager/ConfigValueComboBox.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/EditFontsConfPage.qml b/qml/fontmanager/EditFontsConfPage.qml index 5d11699..ceefbd5 100644 --- a/qml/fontmanager/EditFontsConfPage.qml +++ b/qml/fontmanager/EditFontsConfPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -52,20 +52,23 @@ Page { property bool showHelp: false property string helpMessage: qsTr( "

Select font family and edit priorities.

" + - "

: Add fonts to the selected Priority in config file.

" + - "

: Remove fonts from the selected Priority in config file. Note: The fonts are NOT uninstalled.

" + + "

: Add fonts to the target Priority in config file.

" + "
" + - "

Priorities:

" + + "

: Move up selected font.

" + + "

: Remove selected font from the its Priority in config file. Note: The fonts are NOT uninstalled.

" + + "

: Move down selected font.

" + + "
" + + "

Priorities

" + "  Higher: These fonts have a higher priority. ('prepend' fonts in fontconfig)
" + - "  Normal: These fonts are usally used as default. ('prefer' fonts in fontconfig)
" + + "  Normal: These fonts are usally used as default. System settings may be given priority than these. ('prefer' fonts in fontconfig)
" + "  Lowser: These fonts have a lower priority. ('accept' fonts in fontconfig)
" + + "

" + "
" + "

Import System Settings: Import settings from system(/etc/fonts/local.conf).

" + "
" + + "

Menu()

" + "

Remove current font config(Menu): Remove current user's font config file.

" + - "

View current font config(Menu): View current user's font config file.

" + - "
" + - "Please check fontconfig for more details." + "

View current font config(Menu): View current user's font config file.

" ) property Item selectionDialog: null diff --git a/qml/fontmanager/EditorHelper.js b/qml/fontmanager/EditorHelper.js index fe01921..12644f8 100644 --- a/qml/fontmanager/EditorHelper.js +++ b/qml/fontmanager/EditorHelper.js @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/EditorListDelegate.qml b/qml/fontmanager/EditorListDelegate.qml index 5913a46..5ab982d 100644 --- a/qml/fontmanager/EditorListDelegate.qml +++ b/qml/fontmanager/EditorListDelegate.qml @@ -1,3 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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." +** +****************************************************************************/ + import QtQuick 1.1 import com.nokia.meego 1.0 import com.nokia.extras 1.0 @@ -26,6 +64,8 @@ Item { anchors.fill: parent anchors.leftMargin: -UI.MARGIN_XLARGE anchors.rightMargin: -UI.MARGIN_XLARGE + anchors.topMargin: 1 + anchors.bottomMargin: 1 color: UI.COLOR_SELECT visible: listItem.isHeader } diff --git a/qml/fontmanager/FileSelectionPage.qml b/qml/fontmanager/FileSelectionPage.qml index 21e15e7..752b226 100644 --- a/qml/fontmanager/FileSelectionPage.qml +++ b/qml/fontmanager/FileSelectionPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/FontInstallPage.qml b/qml/fontmanager/FontInstallPage.qml index c4e7497..2366732 100644 --- a/qml/fontmanager/FontInstallPage.qml +++ b/qml/fontmanager/FontInstallPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/FontSelectionPage.qml b/qml/fontmanager/FontSelectionPage.qml index 7f2b3bc..0ee2b3d 100644 --- a/qml/fontmanager/FontSelectionPage.qml +++ b/qml/fontmanager/FontSelectionPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/FontsConfEditor.qml b/qml/fontmanager/FontsConfEditor.qml index 924c8ed..c3109f5 100644 --- a/qml/fontmanager/FontsConfEditor.qml +++ b/qml/fontmanager/FontsConfEditor.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/FontsConfProperties.qml b/qml/fontmanager/FontsConfProperties.qml index 1648325..e5c2032 100644 --- a/qml/fontmanager/FontsConfProperties.qml +++ b/qml/fontmanager/FontsConfProperties.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -45,7 +45,8 @@ Item { property variant fontconf property bool modified: (sansSerifCheck.checked !== fontconf.prefer("sans-serif")) || (serifCheck.checked !== fontconf.prefer("serif")) || - (monospaceCheck.checked !== fontconf.prefer("monospace")) + (monospaceCheck.checked !== fontconf.prefer("monospace")) || + (systemCheck.checked !== fontconf.prefer("Nokia Pure Text")) // || // (embeddedBitmapCombo.selectedIndex !== fontconf.embeddedBitmap) || // (hintingCombo.selectedIndex !== fontconf.hinting) @@ -63,6 +64,7 @@ Item { sansSerifCheck.checked = fontconf.prefer("sans-serif") serifCheck.checked = fontconf.prefer("serif") monospaceCheck.checked = fontconf.prefer("monospace") + systemCheck.checked = fontconf.prefer("Nokia Pure Text") // embeddedBitmapCombo.selectedIndex = fontconf.embeddedBitmap // hintingCombo.selectedIndex = fontconf.hinting } @@ -85,6 +87,10 @@ Item { fontconf.addPreferFamily("monospace") else fontconf.removePreferFamily("monospace") + if (systemCheck.checked) + fontconf.addPreferFamily("Nokia Pure Text") + else + fontconf.removePreferFamily("Nokia Pure Text") // fontconf.embeddedBitmap = embeddedBitmapCombo.selectedIndex // fontconf.hinting = hintingCombo.selectedIndex } @@ -107,6 +113,11 @@ Item { width: parent.width text: qsTr("Use as Prefer Font for Monospace") } + CheckBox { + id: systemCheck + width: parent.width + text: qsTr("Use as Prefer Font for System") + } // ConfigValueComboBox { // id: embeddedBitmapCombo // width: parent.width diff --git a/qml/fontmanager/FontsConfViewPage.qml b/qml/fontmanager/FontsConfViewPage.qml index e78e6df..1aafd54 100644 --- a/qml/fontmanager/FontsConfViewPage.qml +++ b/qml/fontmanager/FontsConfViewPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/HelpDialog.js b/qml/fontmanager/HelpDialog.js index c57e6ee..d39bd33 100644 --- a/qml/fontmanager/HelpDialog.js +++ b/qml/fontmanager/HelpDialog.js @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/HelpDialog.qml b/qml/fontmanager/HelpDialog.qml index a5d4ef5..2331eee 100644 --- a/qml/fontmanager/HelpDialog.qml +++ b/qml/fontmanager/HelpDialog.qml @@ -1,3 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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." +** +****************************************************************************/ + // import QtQuick 1.0 // to target S60 5th Edition or Maemo 5 import QtQuick 1.1 import com.nokia.meego 1.0 @@ -13,7 +51,7 @@ Item { Rectangle { id: textRect anchors.fill: parent - anchors.margins: UI.DEFAULT_MARGIN + anchors.margins: UI.DEFAULT_MARGIN / 2 color: "white" Text { @@ -21,7 +59,7 @@ Item { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - anchors.bottomMargin: UI.DEFAULT_MARGIN + anchors.topMargin: UI.DEFAULT_MARGIN / 2 text: helpDialog.titleText font.pixelSize: UI.FONT_XLARGE font.bold: true @@ -31,11 +69,13 @@ Item { Rectangle { id: border anchors.top: helpTitle.bottom - anchors.bottom: okButton.top + anchors.bottom: closeButton.top anchors.left: parent.left anchors.right: parent.right - anchors.rightMargin: 1 - anchors.bottomMargin: UI.DEFAULT_MARGIN + anchors.leftMargin: UI.DEFAULT_MARGIN / 2 + anchors.rightMargin: UI.DEFAULT_MARGIN / 2 + anchors.bottomMargin: UI.DEFAULT_MARGIN / 2 + radius: 3 clip: true border.width: 1 @@ -67,11 +107,11 @@ Item { } Button { - id: okButton + id: closeButton text: qsTr("Close") anchors.horizontalCenter: parent.horizontalCenter anchors.bottom: parent.bottom - anchors.margins: UI.DEFAULT_MARGIN + anchors.bottomMargin: UI.DEFAULT_MARGIN / 2 onClicked: { helpDialog.visible = false helpDialog.clicked() diff --git a/qml/fontmanager/InstalledFontInfoPage.qml b/qml/fontmanager/InstalledFontInfoPage.qml index c72fc9b..9817ae8 100644 --- a/qml/fontmanager/InstalledFontInfoPage.qml +++ b/qml/fontmanager/InstalledFontInfoPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/MainPage.qml b/qml/fontmanager/MainPage.qml index c5a76ad..f678f1c 100644 --- a/qml/fontmanager/MainPage.qml +++ b/qml/fontmanager/MainPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -52,10 +52,15 @@ Page { property bool showHelp: false property string helpMessage: qsTr( "

How to use

" + + "
" + + "

Toolbar

" + "

: Install font. Please copy font file(s) to this device in advance. Currently *.ttf and *.ttc are supported.

" + - "

: Configure fonts(expert). You can assign/unassign any fonts to Serif/Sans Serif/Monospace.

" + + "

: Configure fonts(expert). You can assign/unassign any fonts to Serif/Sans Serif/Monospace/System.

" + "
" + - "

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.

" + "

Menu()

" + + "

Create Recommended Settings: 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.

" + + "

Backup Config: Save current fonts config into ~/MyDocs/Documents

" + + "

Restore Config: Restore fonts config from backuped file

" ) Connections { @@ -89,12 +94,12 @@ Page { anchors.right: parent.right anchors.margins: UI.DEFAULT_MARGIN / 2 clip: true - enabled: !disableTools - opacity: enabled ? 1.0 : 0.5 ListView { - id: listView + id: installedFontListView anchors.fill: parent + enabled: !disableTools + opacity: enabled ? 1.0 : 0.5 model: installedFontList @@ -111,25 +116,28 @@ Page { } + Flickable { + id: helpView + visible: false + anchors.fill: parent + contentHeight: helpText.paintedHeight + Text { + id: helpText + wrapMode: Text.WrapAtWordBoundaryOrAnywhere + width: parent.width + text: helpMessage + font.pixelSize: UI.FONT_DEFAULT + color: "black" + horizontalAlignment: Text.AlignLeft + } + } + ScrollDecorator { - flickableItem: listView + id: scrollDecorator + flickableItem: installedFontListView } - } - Column { - id: warningText - width: contents.width - UI.DEFAULT_MARGIN * 2 - anchors.centerIn: contents - visible: false - Text { - wrapMode: Text.WrapAtWordBoundaryOrAnywhere - width: parent.width - text: helpMessage - font.pixelSize: UI.FONT_DEFAULT - color: "black" - horizontalAlignment: Text.AlignLeft - } } BusyIndicator { @@ -186,6 +194,9 @@ Page { onClicked: { if (mainMenu.status !== DialogStatus.Closed) mainMenu.close() +// if (controller.installedFonts.length > 0) { +// console.log("Installed Fonts:" + controller.installedFonts) +// } if (controller.localFontsConfExists) openCreateConfirmDialog() else @@ -261,16 +272,24 @@ Page { states: [ State { name: "nofonts" - when: (listView.count == 0) && !controller.working && !showHelp + when: (installedFontListView.count == 0) && !controller.working && !showHelp PropertyChanges { target: createRecommendedSettingsItem enabled: false } +// PropertyChanges { +// target: installedFontListView +// visible: false +// } PropertyChanges { - target: warningText + target: helpView visible: true } PropertyChanges { + target: scrollDecorator + flickableItem: helpView + } + PropertyChanges { target: pageHeader text: qsTr("No Fonts Installed") } diff --git a/qml/fontmanager/PageHeader.qml b/qml/fontmanager/PageHeader.qml index 8ee92bc..b1b7820 100644 --- a/qml/fontmanager/PageHeader.qml +++ b/qml/fontmanager/PageHeader.qml @@ -1,3 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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." +** +****************************************************************************/ + import QtQuick 1.1 import com.nokia.meego 1.0 import com.nokia.extras 1.0 diff --git a/qml/fontmanager/RestoreFontsConfPage.qml b/qml/fontmanager/RestoreFontsConfPage.qml index 364547d..a33b952 100644 --- a/qml/fontmanager/RestoreFontsConfPage.qml +++ b/qml/fontmanager/RestoreFontsConfPage.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -61,7 +61,7 @@ FileSelectionPage { function openRestoreConfirmDialog() { queryDialog.titleText = qsTr("Restore it?") - queryDialog.message = qsTr("Existing Fonts Config will be replaced by '%1'. Are you sure?").arg(controller.url2path(restoreFilePath)) + queryDialog.message = qsTr("Existing Fonts Config will be replaced by '%1'. Are you sure?").arg(controller.path4display(controller.url2path(restoreFilePath))) queryDialog.acceptButtonText = qsTr("OK") queryDialog.rejectButtonText = qsTr("Cancel") queryDialog.accepted.connect(restoreFontsConf) diff --git a/qml/fontmanager/SelectInstallFamilyDialog.qml b/qml/fontmanager/SelectInstallFamilyDialog.qml index 448c366..f5cd00b 100644 --- a/qml/fontmanager/SelectInstallFamilyDialog.qml +++ b/qml/fontmanager/SelectInstallFamilyDialog.qml @@ -1,3 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2012 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." +** +****************************************************************************/ + import QtQuick 1.1 import com.nokia.meego 1.0 import 'UIConstants.js' as UI diff --git a/qml/fontmanager/functions.js b/qml/fontmanager/functions.js index 9571282..d88630b 100644 --- a/qml/fontmanager/functions.js +++ b/qml/fontmanager/functions.js @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** diff --git a/qml/fontmanager/main.qml b/qml/fontmanager/main.qml index 6929f1a..9f6b050 100644 --- a/qml/fontmanager/main.qml +++ b/qml/fontmanager/main.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2011 Takumi Asaki +** Copyright (C) 2012 Takumi Asaki ** All rights reserved. ** Contact: Takumi Asaki (takumi.asaki@gmail.com) ** @@ -155,7 +155,7 @@ PageStackWindow { return } queryDialog.titleText = qsTr("Backup finished") - queryDialog.message = qsTr("Fonts Config is backuped as '%1' successfully.").arg(filePath) + queryDialog.message = qsTr("Fonts Config is backuped as '%1' successfully.").arg(controller.path4display(filePath)) openFinishedDialog() } @@ -167,7 +167,7 @@ PageStackWindow { return } queryDialog.titleText = qsTr("Restore finished") - queryDialog.message = qsTr("Fonts Config is restored from '%1' successfully.").arg(filePath) + queryDialog.message = qsTr("Fonts Config is restored from '%1' successfully.").arg(controller.path4display(filePath)) openFinishedDialog() } diff --git a/qtc_packaging/debian_harmattan/changelog b/qtc_packaging/debian_harmattan/changelog index 66aa674..6079c65 100644 --- a/qtc_packaging/debian_harmattan/changelog +++ b/qtc_packaging/debian_harmattan/changelog @@ -1,6 +1,13 @@ +fontmanager (0.5) unstable; urgency=low + + * fix bugs + * update helps + + -- Takumi Asaki Thu, 19 Apr 2012 16:15:00 +0900 + fontmanager (0.4.95) unstable; urgency=low - 0.5RC + 0.5 RC(for internal test only) * UI improvments * UI Optimizations @@ -8,7 +15,7 @@ fontmanager (0.4.95) unstable; urgency=low fontmanager (0.4.9) unstable; urgency=low - 0.5 beta + 0.5 beta(for test only) * Add reorder configuration. * Add backup/restore configuration. * Add edit System font configuration. diff --git a/translations/fontmanager_ja.ts b/translations/fontmanager_ja.ts index f845c4e..2c42bf6 100644 --- a/translations/fontmanager_ja.ts +++ b/translations/fontmanager_ja.ts @@ -4,7 +4,7 @@ ApplicationController - + Could not remove Font '%1' フォント '%1' を削除できません @@ -12,7 +12,7 @@ BottomButtons - + Import System Settings システム設定のインポート @@ -38,12 +38,7 @@ 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 @@ -68,7 +63,12 @@ 現在のフォント設定を削除 - + + <p>Select font family and edit priorities.</p><p><img src="image://theme/icon-m-toolbar-add">: Add fonts to the target <i>Priority</i> in config file.</p><hr/><p><img src="image://theme/icon-m-toolbar-up">: Move up selected font.</p><p><img src="image://theme/icon-m-toolbar-delete">: Remove selected font from the its <i>Priority</i> in config file. <i>Note: The fonts are NOT uninstalled</i>.</p><p><img src="image://theme/icon-m-toolbar-down">: Move down selected font.</p><hr/><h2>Priorities</h2><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. System settings may be given priority than these. ('prefer' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Lowser</b>: These fonts have a lower priority. ('accept' fonts in fontconfig)<br/><ul><li>Please check <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> for more details.</li></ul><hr/><p><b>Import System Settings</b>: Import settings from system(/etc/fonts/local.conf).</p><hr/><h2>Menu(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><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> + <p>フォントファミリーを選択し、プロパティを編集します。</p><p><img src="image://theme/icon-m-toolbar-add">: フォントを設定ファイルの対象となる <i>優先順位</i> に追加します。</p><hr/><p><img src="image://theme/icon-m-toolbar-up">: 選択したフォントの順番を上げます。</p><p><img src="image://theme/icon-m-toolbar-delete">: 選択したフォントを設定ファイルの対象となる <i>優先順位</i> から削除します。<i>注: フォントはアンインストールされません。</i></p><p><img src="image://theme/icon-m-toolbar-down">: 選択したフォントの順番を下げます。</p><hr/><h2>優先順位</h2><p>&nbsp;&nbsp;<b>高</b>: これらのフォントは優先して使用されます。(fontconfig で 'prepend' されるフォントとして扱います)<br/>&nbsp;&nbsp;<b>標準</b>: これらのフォントがデフォルトで使用されます。システム設定のフォントが優先して使用されることがあります。(fontconfig で 'prefer' されるフォントとして扱います)<br/>&nbsp;&nbsp;<b>低</b>: これらのフォントは代替フォントして使用されます。(fontconfig で 'accept' されるフォントとして扱います)<br/><ul><li>詳細は <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> も参照してください。</li></ul><hr/><p><b>システム設定のインポート</b>: システム(/etc/fonts/local.conf)の設定をインポートします。</p><hr/><h2>メニュー(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><p><b>現在のフォント設定を削除</b>: 現在のユーザーのフォント設定ファイルを削除します。</p><p><b>現在のフォント設定を表示</b>: 現在のユーザーのフォント設定ファイルを表示します。</p> + + + System システム @@ -217,7 +217,7 @@ FontsConfProperties - + Use as Prefer Font for Sans-Serif Sans-Serif(ゴシック体)で使用 @@ -231,6 +231,11 @@ Use as Prefer Font for Monospace 等幅フォントで使用 + + + Use as Prefer Font for System + システムフォントで使用 + FontsConfViewPage @@ -248,12 +253,12 @@ HelpDialog - + Help ヘルプ - + Close 閉じる @@ -379,42 +384,42 @@ 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 推奨設定の作成 - + + <h1>How to use</h1><hr/><h2>Toolbar</h2><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/System.</p><hr/><h2>Menu(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><p><b>Create Recommended Settings</b>: 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><p><b>Backup Config</b>: Save current fonts config into ~/MyDocs/Documents</p><p><b>Restore Config</b>: Restore fonts config from backuped file</p> + <h1>使い方</h1><hr/><h2>ツールバー</h2><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/><h2>メニュー(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><p><b>推奨設定の作成</b>: 推奨設定を生成します。ユーザーがインストールしたフォントは<i>標準</i>の優先順位に割り当てます。システムのフォントは<i>高い</i>優先順位に割り当てられますが、ユーザーがインストールしたCJKフォントと競合するフォントの優先順位は<i>低く</i>なります。</p><p><b>設定のバックアップ</b>: 現在のフォント設定を ~/MyDocs/Documents に保存します。</p><p><b>設定の復旧</b>: バックアップしたファイルからフォント設定を復旧します。</p> + + + Backup Config 設定のバックアップ @@ -491,7 +496,7 @@ Application Icon is created by hirao SelectInstallFamilyDialog - + Add 追加 diff --git a/translations/fontmanager_untranslated.ts b/translations/fontmanager_untranslated.ts index 62f1ddb..1708072 100644 --- a/translations/fontmanager_untranslated.ts +++ b/translations/fontmanager_untranslated.ts @@ -4,12 +4,20 @@ ApplicationController - + Could not remove Font '%1' + BottomButtons + + + Import System Settings + + + + ConfigValueComboBox @@ -30,52 +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. - - - - + Sans Serif - + Serif - + Monospace - - Add + + Help - - Add Family for %1 + + Remove current fonts config - - Help + + <p>Select font family and edit priorities.</p><p><img src="image://theme/icon-m-toolbar-add">: Add fonts to the target <i>Priority</i> in config file.</p><hr/><p><img src="image://theme/icon-m-toolbar-up">: Move up selected font.</p><p><img src="image://theme/icon-m-toolbar-delete">: Remove selected font from the its <i>Priority</i> in config file. <i>Note: The fonts are NOT uninstalled</i>.</p><p><img src="image://theme/icon-m-toolbar-down">: Move down selected font.</p><hr/><h2>Priorities</h2><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. System settings may be given priority than these. ('prefer' fonts in fontconfig)<br/>&nbsp;&nbsp;<b>Lowser</b>: These fonts have a lower priority. ('accept' fonts in fontconfig)<br/><ul><li>Please check <a href="http://www.freedesktop.org/software/fontconfig/fontconfig-user.html">fontconfig</a> for more details.</li></ul><hr/><p><b>Import System Settings</b>: Import settings from system(/etc/fonts/local.conf).</p><hr/><h2>Menu(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><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> - - Remove current fonts config + + System + Edit Fonts Config: %1 + + + + View current fonts config - + Remove it? @@ -94,16 +102,21 @@ Cancel + + + Select Family to edit + + FontInstallPage - + Install Font - + <b>Font Family</b>: %1 @@ -118,12 +131,12 @@ - + Install - + Create it? @@ -134,13 +147,13 @@ - + OK - - + + Cancel @@ -156,9 +169,9 @@ - FontSelectPage + FontSelectionPage - + Select Font to install @@ -166,37 +179,27 @@ FontsConfEditor - - Edit Fonts Config: %1 - - - - + Priority: %1 - + System Font - - + + User Font - - - Import System Settings - - FontsConfEditorController - + Higher @@ -214,7 +217,7 @@ FontsConfProperties - + Use as Prefer Font for Sans-Serif @@ -228,11 +231,16 @@ Use as Prefer Font for Monospace + + + Use as Prefer Font for System + + FontsConfViewPage - + Current Fonts Config @@ -245,20 +253,20 @@ HelpDialog - + Help - - OK + + Close InstalledFontInfoPage - + Installed Font Info @@ -338,7 +346,7 @@ - + Delete Font? @@ -353,7 +361,12 @@ - + + Unknown + + + + Do you really want to remove this font now? @@ -371,37 +384,52 @@ MainPage - + Installed Fonts - - No Fonts Installed + + Close - - About + + No Fonts Installed - - <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> + + About - + Help - + Create Recommended Settings - + + <h1>How to use</h1><hr/><h2>Toolbar</h2><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/System.</p><hr/><h2>Menu(<img src="image://theme/icon-m-toolbar-view-menu">)</h2><p><b>Create Recommended Settings</b>: 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><p><b>Backup Config</b>: Save current fonts config into ~/MyDocs/Documents</p><p><b>Restore Config</b>: Restore fonts config from backuped file</p> + + + + + Backup Config + + + + + Restore Config + + + + Replace it? @@ -412,17 +440,16 @@ - OK - + Cancel - + Font Manager for N9 @@ -436,21 +463,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? + + + + OK - + + Cancel + + + + + SelectInstallFamilyDialog + + + Add + + + + + Add Family for %1 + + + + + Unknwon + + + + + main + + Alert + + Close + + + + Install finished @@ -460,7 +532,7 @@ Application Icon is created by hirao - + Uninstall finished @@ -469,5 +541,25 @@ Application Icon is created by hirao Font '%1' is uninstalled successfully. + + + Backup finished + + + + + Fonts Config is backuped as '%1' successfully. + + + + + Restore finished + + + + + Fonts Config is restored from '%1' successfully. + +