* Add changing config order.
* Add editing System font.
* Add backup/restore configuration.
* Adjust layouts.
*~
*.bak
header.*
+.DS_Store
QString ApplicationController::version() const
{
- return QLatin1String("0.4.3");
+ return QLatin1String("0.4.9(0.5beta)");
}
QString ApplicationController::currentLanguage() const
controller = new FontsConfEditorController(family, this);
mEditorController.insert(family, controller);
connect(controller, SIGNAL(appendFamilyToConfig(QString,QString,QString)), SLOT(appendFamilyToConfig(QString,QString,QString)));
+ connect(controller, SIGNAL(insertFamilyToConfig(QString,QString,QString,int)), SLOT(insertFamilyToConfig(QString,QString,QString,int)));
connect(controller, SIGNAL(removeFamilyFromList(QString,QString,QString)), SLOT(removeFamilyFromConfig(QString,QString,QString)));
updateEditorController(family);
}
controller->syncFamilyList();
}
+QUrl ApplicationController::backupDir() const
+{
+ return QUrl(QDir::homePath() + QLatin1String("/MyDocs/Documents"));
+}
+
+QString ApplicationController::defaultBackupFilename() const
+{
+ QString backupdir = backupDir().toString();
+ QString backupfile = backupdir + QLatin1String("/fonts.conf");
+ int idx = 0;
+ while (QFile::exists(backupfile)) {
+ backupfile = backupdir + QString::fromAscii("/fonts-%1.conf").arg(++idx);
+ }
+ return backupfile;
+}
+
void ApplicationController::updateAllEditorController()
{
if (!mFontConfig->fontsConfModified() || mIgnoreUpdate) {
mFontConfig->createRecommendedSettings();
}
+void ApplicationController::backupConfig(const QString &filename)
+{
+ mFontConfig->backupFontsConf(filename);
+}
+
+void ApplicationController::restoreConfig(const QString &filename)
+{
+ mFontConfig->restoreFontsConf(filename);
+}
+
void ApplicationController::createFontDir()
{
QDir fontDir(mFontDirPath);
mFontConfig->addAcceptFamily(family, value);
}
+void ApplicationController::insertFamilyToConfig(const QString &family, const QString &value, const QString &priority, int index)
+{
+ FontsConfEditorController *controller = qobject_cast<FontsConfEditorController*>(sender());
+ if (controller)
+ mIgnoreUpdate = true;
+ if (priority == PREPEND_DEF)
+ mFontConfig->insertPrependFamily(family, value, index);
+ else if (priority == APPEND_DEF)
+ mFontConfig->insertAppendFamily(family, value, index);
+ else if (priority == PREFER_DEF)
+ mFontConfig->insertPreferFamily(family, value, index);
+ else if (priority == ACCEPT_DEF)
+ mFontConfig->insertAcceptFamily(family, value, index);
+}
+
void ApplicationController::removeFamilyFromConfig(const QString &family, const QString &value, const QString &priority)
{
FontsConfEditorController *controller = qobject_cast<FontsConfEditorController*>(sender());
#include <QObject>
#include <QStringList>
#include <QVariant>
+#include <QUrl>
#include "fontinfo.h"
-class QUrl;
-
class FontConfigManager;
class InstalledFontInfo;
class FontsConfEditorController;
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)
public:
explicit ApplicationController(QObject *parent = 0);
Q_INVOKABLE FontsConfEditorController *editorController(const QString &family);
void updateEditorController(const QString &family);
+
+ QUrl backupDir() const;
+ Q_INVOKABLE QString defaultBackupFilename() const;
+
public slots:
void updateAllEditorController();
void createRecommendedSettings();
+ void backupConfig(const QString &filename);
+ void restoreConfig(const QString &filename);
+
signals:
void alertDialog(const QString &message);
void workingChanged();
+ void backupDirChanged();
+
private slots:
void readFcListFinished();
void saveFontsConf();
void appendFamilyToConfig(const QString &family, const QString &value, const QString &priority);
+ void insertFamilyToConfig(const QString &family, const QString &value, const QString &priority, int index);
void removeFamilyFromConfig(const QString &family, const QString &value, const QString &priority);
private:
#define SANSSERIF_DEF "sans-serif"
#define SERIF_DEF "serif"
#define MONOSPACE_DEF "monospace"
+#define SYSTEM_DEF "Nokia Pure Text"
#define TRUE_DEF "true"
#define FALSE_DEF "false"
#include <QVariant>
#include <QFontInfo>
#include <QFontMetrics>
+#include <QUrl>
#include <QDebug>
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);
}
}
+void FontConfigManager::backupFontsConf(const QString &filepath)
+{
+ if (filepath.isEmpty() || isEmptyLocalFontsConf())
+ return;
+ mLocalFontsConf->save(filepath);
+}
+
+void FontConfigManager::restoreFontsConf(const QUrl &fileUrl)
+{
+ QString filepath = fileUrl.toLocalFile();
+ if (filepath.isEmpty() || !QFile::exists(filepath))
+ return;
+ FontsConf *restoredConf = new FontsConf(this);
+ restoredConf->load(filepath);
+ if (restoredConf->isValid()) {
+ mLocalFontsConf->copy(restoredConf);
+ emit fontsConfUpdated();
+ restoredConf->deleteLater();
+ }
+}
+
void FontConfigManager::resetFontsConf()
{
if (!mLocalFontsConf)
emit fontsConfUpdated();
}
+void FontConfigManager::insertPreferFamily(const QString &family, const QString &value, int index)
+{
+ mLocalFontsConf->insertPreferFamilyFor(family, value, index);
+ emit fontsConfUpdated();
+}
+
+void FontConfigManager::insertAcceptFamily(const QString &family, const QString &value, int index)
+{
+ mLocalFontsConf->insertAcceptFamilyFor(family, value, index);
+ emit fontsConfUpdated();
+}
+
+void FontConfigManager::insertPrependFamily(const QString &family, const QString &value, int index)
+{
+ mLocalFontsConf->insertPrependFamilyFor(family, value, index);
+ emit fontsConfUpdated();
+}
+
+void FontConfigManager::insertAppendFamily(const QString &family, const QString &value, int index)
+{
+ mLocalFontsConf->insertAppendFamilyFor(family, value, index);
+ emit fontsConfUpdated();
+}
+
void FontConfigManager::removePreferFamily(const QString &family, const QString &value)
{
mLocalFontsConf->removePreferFamilyFor(family, value);
#include "fontsconfigproperties.h"
+class QUrl;
+
class InstalledFontInfo;
class FontsConf;
void addPrependFamily(const QString &family, const QString &value);
void addAppendFamily(const QString &family, const QString &value);
+ void insertPreferFamily(const QString &family, const QString &value, int index);
+ void insertAcceptFamily(const QString &family, const QString &value, int index);
+ void insertPrependFamily(const QString &family, const QString &value, int index);
+ void insertAppendFamily(const QString &family, const QString &value, int index);
+
void removePreferFamily(const QString &family, const QString &value);
void removeAcceptFamily(const QString &family, const QString &value);
void removePrependFamily(const QString &family, const QString &value);
void readFcList();
void readFontsConf();
void saveFontsConf();
+ void backupFontsConf(const QString &filepath);
+ void restoreFontsConf(const QUrl &fileUrl);
void resetFontsConf();
}
emit fontPathChanged();
-#if 0
- QFontDatabase fdb;
- foreach (const QString &family, mFontFamilies) {
- QList<QFontDatabase::WritingSystem> wslist = fdb.writingSystems(family);
- qDebug() << family << "(" << wslist.count() << ")";
- for (int i = 0; i < wslist.count(); i++) {
- qDebug() << "\t" << QFontDatabase::writingSystemName(wslist.at(i));
- }
- }
-#endif
}
QStringList FontInfo::families() const
#include "fontsconfelement.h"
#include <QFile>
+#include <QTextStream>
#include <QXmlStreamReader>
-#include <QDebug>
-
enum FCState {
Initialized, Ready, InvalidConfig, UnknownState
};
}
FontsConf::FontsConf(QObject *parent) :
- QObject(parent), mModified(false), mHasUnknownConfig(false)
+ QObject(parent), mModified(false), mValid(true), mHasUnknownConfig(false)
{
initFontsConf();
}
return mModified;
}
+void FontsConf::setModified(bool value)
+{
+ mModified = value;
+}
+
bool FontsConf::hasUnknownConfig() const
{
return mHasUnknownConfig;
}
+bool FontsConf::isValid() const
+{
+ return mValid;
+}
+
void FontsConf::initFontsConf()
{
if (mElements)
Q_ASSERT(check);
}
+void FontsConf::insertAliasFamilyFor(const QString &family, const QString &mode, const QString &value, int idx)
+{
+ int index = 0;
+ while ((index = mElements->indexOf(ALIAS_DEF, index)) >= 0) {
+ FontsConfElementPointer aliasElem = mElements->childElementAt(index++);
+ bool check = insertFamilyToAlias(aliasElem, family, mode, value, idx);
+ if (check)
+ return;
+ }
+
+ FontsConfElementPointer aliasElem = aliasElementFor(family);
+ mElements->addChildElement(aliasElem);
+ bool check = appendFamilyToAlias(aliasElem, family, mode, value);
+ Q_ASSERT(check);
+}
+
void FontsConf::removeAliasFamilyFor(const QString &family, const QString &mode, const QString &value)
{
int index = 0;
appendAliasFamilyFor(family, PREFER_DEF, value);
}
+void FontsConf::insertPreferFamilyFor(const QString &family, const QString &value, int index)
+{
+ insertAliasFamilyFor(family, PREFER_DEF, value, index);
+}
+
void FontsConf::removePreferFamilyFor(const QString &family, const QString &value)
{
removeAliasFamilyFor(family, PREFER_DEF, value);
appendAliasFamilyFor(family, ACCEPT_DEF, value);
}
+void FontsConf::insertAcceptFamilyFor(const QString &family, const QString &value, int index)
+{
+ insertAliasFamilyFor(family, ACCEPT_DEF, value, index);
+}
+
void FontsConf::removeAcceptFamilyFor(const QString &family, const QString &value)
{
removeAliasFamilyFor(family, ACCEPT_DEF, value);
void FontsConf::appendPatternFamilyFor(const QString &family, const QString &mode, const QString &value)
{
+ insertPatternFamilyFor(family, mode, value, -1);
+}
+
+void FontsConf::insertPatternFamilyFor(const QString &family, const QString &mode, const QString &value, int idx)
+{
FontsConfElementPointer matchElem;
int index = 0;
FontsConfElementPointer stringElem(new FontsConfElement(STRING_DEF));
stringElem->setText(value);
- editElem->addChildElement(stringElem);
+ if (idx < 0)
+ editElem->addChildElement(stringElem);
+ else
+ editElem->insertChildElement(stringElem, idx);
mModified = true;
}
appendPatternFamilyFor(family, PREPEND_DEF, value);
}
+void FontsConf::insertPrependFamilyFor(const QString &family, const QString &value, int index)
+{
+ insertPatternFamilyFor(family, PREPEND_DEF, value, index);
+}
+
void FontsConf::removePrependFamilyFor(const QString &family, const QString &value)
{
removePatternFamilyFor(family, PREPEND_DEF, value);
appendPatternFamilyFor(family, APPEND_DEF, value);
}
+void FontsConf::insertAppendFamilyFor(const QString &family, const QString &value, int index)
+{
+ insertPatternFamilyFor(family, APPEND_DEF, value, index);
+}
+
void FontsConf::removeAppendFamilyFor(const QString &family, const QString &value)
{
removePatternFamilyFor(family, APPEND_DEF, value);
}
+void FontsConf::copy(FontsConf *src)
+{
+ mModified = true;
+ mValid = src->mValid;
+ mHasUnknownConfig = src->mHasUnknownConfig;
+ mElements = src->mElements;
+}
+
QStringList FontsConf::genericFamilies()
{
static QStringList families;
if (families.isEmpty())
- families << SANSSERIF_DEF << SERIF_DEF << MONOSPACE_DEF;
+ families << SANSSERIF_DEF << SERIF_DEF << MONOSPACE_DEF << SYSTEM_DEF;
return families;
}
fp.close();
- bool check = parse(buf);
- Q_UNUSED(check);
-
+ mValid = parse(buf);
}
void FontsConf::save(const QString &path)
QXmlStreamWriter xml(&buf);
xml.setAutoFormatting(true);
+ xml.setAutoFormattingIndent(8);
xml.writeStartDocument();
bool FontsConf::appendFamilyToAlias(FontsConfElementPointer aliasElem, const QString &family, const QString &mode, const QString &value)
{
+ return insertFamilyToAlias(aliasElem, family, mode, value, -1);
+}
+
+bool FontsConf::insertFamilyToAlias(FontsConfElementPointer aliasElem, const QString &family, const QString &mode, const QString &value, int index)
+{
if (aliasElem->type() != ALIAS_DEF)
return false;
FontsConfElementPointer valueElem(new FontsConfElement(FAMILY_DEF));
valueElem->setText(value);
- targetElem->addChildElement(valueElem);
+ if (index < 0)
+ targetElem->addChildElement(valueElem);
+ else
+ targetElem->insertChildElement(valueElem, index);
mModified = true;
return true;
bool isEmpty() const;
bool modified() const;
+ void setModified(bool value);
bool hasUnknownConfig() const;
+ bool isValid() const;
+
void initFontsConf();
bool parse(const QByteArray &buf);
QStringList preferFamily() const;
QStringList aliasFamilyFor(const QString &family, const QString &mode) const;
+ int indxOfAliasFamilyFor(const QString &family, const QString &mode, const QString &value) const;
void appendAliasFamilyFor(const QString &family, const QString &mode, const QString &value);
+ void insertAliasFamilyFor(const QString &family, const QString &mode, const QString &value, int index);
void removeAliasFamilyFor(const QString &family, const QString &mode, const QString &value);
QStringList preferFamilyFor(const QString &family) const;
+ int indxOfPreferFamilyFor(const QString &family, const QString &value) const;
void appendPreferFamilyFor(const QString &family, const QString &value);
+ void insertPreferFamilyFor(const QString &family, const QString &value, int index);
void removePreferFamilyFor(const QString &family, const QString &value);
QStringList acceptFamilyFor(const QString &family) const;
+ int indxOfAcceptFamilyFor(const QString &family, const QString &value) const;
void appendAcceptFamilyFor(const QString &family, const QString &value);
+ void insertAcceptFamilyFor(const QString &family, const QString &value, int index);
void removeAcceptFamilyFor(const QString &family, const QString &value);
QStringList matchFamilyFor(const QString &config, bool val) const;
void unsetMatchEditValueFor(const QString &config, const QString &family);
QStringList patternFamilyFor(const QString &family, const QString &mode) const;
+ int indxOfPatternFamilyFor(const QString &family, const QString &mode, const QString &value) const;
void appendPatternFamilyFor(const QString &family, const QString &mode, const QString &value);
+ void insertPatternFamilyFor(const QString &family, const QString &mode, const QString &value, int index);
void removePatternFamilyFor(const QString &family, const QString &mode, const QString &value);
QStringList prependFamilyFor(const QString &family) const;
+ int indxOfPrependFamilyFor(const QString &family, const QString &value) const;
void appendPrependFamilyFor(const QString &family, const QString &value);
+ void insertPrependFamilyFor(const QString &family, const QString &value, int index);
void removePrependFamilyFor(const QString &family, const QString &value);
QStringList appendFamilyFor(const QString &family) const;
+ int indxOfAppendFamilyFor(const QString &family, const QString &value) const;
void appendAppendFamilyFor(const QString &family, const QString &value);
+ void insertAppendFamilyFor(const QString &family, const QString &value, int index);
void removeAppendFamilyFor(const QString &family, const QString &value);
+ void copy(FontsConf *src);
+
static QStringList genericFamilies();
static QStringList configKeys();
FontsConfElementPointer patternElementFor(const QString &family) const;
bool appendFamilyToAlias(FontsConfElementPointer aliasElem, const QString &family, const QString &mode, const QString &value);
+ bool insertFamilyToAlias(FontsConfElementPointer aliasElem, const QString &family, const QString &mode, const QString &value, int index);
bool isMatchElementFor(FontsConfElementPointer matchElem, const QString &config, const QString &family, const QString &val = QString()) const;
bool isPatternElementFor(FontsConfElementPointer matchElem, const QString &family, const QString &mode = QString()) const;
FontsConfElementPointer getEditPatternElementFor(FontsConfElementPointer matchElem, const QString &family, const QString &mode = QString()) const;
private:
bool mModified;
+ bool mValid;
bool mHasUnknownConfig;
FontsConfElementPointer mElements;
};
#include "installedfontinfo.h"
FontsConfEditorController::FontsConfEditorController(const QString &family, QObject *parent) :
- QObject(parent), mFamily(family)
+ QObject(parent), mFromApp(false), mFamily(family)
{
}
return mPrependFamily.count() + mPreferFamily.count() + mAcceptFamily.count();
}
+int FontsConfEditorController::countOfFamily(const QString &priority) const
+{
+ if (priority == PREPEND_DEF)
+ return mPrependFamily.count();
+ else if (priority == PREFER_DEF)
+ return mPreferFamily.count();
+ else if (priority == ACCEPT_DEF)
+ return mAcceptFamily.count();
+ return -1;
+}
+
+int FontsConfEditorController::indexOfFamily(const QString &family, const QString &priority) const
+{
+ if (priority == PREPEND_DEF)
+ return mPrependFamily.indexOf(family);
+ else if (priority == PREFER_DEF)
+ return mPreferFamily.indexOf(family);
+ else if (priority == ACCEPT_DEF)
+ return mAcceptFamily.indexOf(family);
+ return -1;
+}
+
void FontsConfEditorController::syncFamilyList()
{
emit clearFamilyList();
void FontsConfEditorController::appendFontsInfo(const QString &family, const QString &priority, InstalledFontInfo *info)
{
+ mFromApp = true;
mFontInfoMap.insert(family, info);
appendFamily(family, priority);
+ mFromApp = false;
}
void FontsConfEditorController::appendFamily(const QString &family, const QString &priority)
mPreferFamily.append(family);
else if (priority == ACCEPT_DEF)
mAcceptFamily.append(family);
- emit appendFamilyToConfig(mFamily, family, priority);
+ if (!mFromApp)
+ emit appendFamilyToConfig(mFamily, family, priority);
emit countChanged();
}
{
if (priority.isEmpty() || priority == PREPEND_DEF) {
mPrependFamily.removeOne(family);
- emit removeFamilyFromList(mFamily, family, PREPEND_DEF);
+ if (!mFromApp)
+ emit removeFamilyFromList(mFamily, family, PREPEND_DEF);
emit countChanged();
}
if (priority.isEmpty() || priority == PREFER_DEF) {
mPreferFamily.removeOne(family);
- emit removeFamilyFromList(mFamily, family, PREFER_DEF);
+ if (!mFromApp)
+ emit removeFamilyFromList(mFamily, family, PREFER_DEF);
emit countChanged();
}
if (priority.isEmpty() || priority == ACCEPT_DEF) {
mAcceptFamily.removeOne(family);
- emit removeFamilyFromList(mFamily, family, ACCEPT_DEF);
+ if (!mFromApp)
+ emit removeFamilyFromList(mFamily, family, ACCEPT_DEF);
emit countChanged();
}
if (!mPrependFamily.contains(family) && !mPreferFamily.contains(family) && !mAcceptFamily.contains(family))
mFontInfoMap.remove(family);
}
+void FontsConfEditorController::insertFamily(const QString &family, const QString &priority, int index)
+{
+ if (priority == PREPEND_DEF)
+ mPrependFamily.insert(index, family);
+ else if (priority == PREFER_DEF)
+ mPreferFamily.insert(index, family);
+ else if (priority == ACCEPT_DEF)
+ mAcceptFamily.insert(index, family);
+ if (!mFromApp)
+ emit insertFamilyToConfig(mFamily, family, priority, index);
+ emit countChanged();
+}
+
+void FontsConfEditorController::moveFamilyUp(const QString &family, const QString &priority)
+{
+ int index = indexOfFamily(family, priority);
+ if (index > 0) {
+ removeFamily(family, priority);
+ insertFamily(family, priority, index - 1);
+ }
+}
+
+void FontsConfEditorController::moveFamilyDown(const QString &family, const QString &priority)
+{
+ int index = indexOfFamily(family, priority);
+ if (index - 1 < countOfFamily(priority)) {
+ removeFamily(family, priority);
+ insertFamily(family, priority, index + 1);
+ }
+}
+
void FontsConfEditorController::clear()
{
mFontInfoMap.clear();
int count() const;
+ int countOfFamily(const QString &priority) const;
+ int indexOfFamily(const QString &family, const QString &priority) const;
+
signals:
void clearFamilyList();
void startSection(const QString §ion, const QString §ionName);
void countChanged();
void appendFamilyToConfig(const QString &family, const QString &value, const QString &priority);
+ void insertFamilyToConfig(const QString &family, const QString &value, const QString &priority, int index);
public slots:
void clear();
void appendFamily(const QString &family, const QString &priority);
void removeFamily(const QString &family, const QString &priority);
+ void insertFamily(const QString &family, const QString &priority, int index);
+ void moveFamilyUp(const QString &family, const QString &priority);
+ void moveFamilyDown(const QString &family, const QString &priority);
+
private:
+ bool mFromApp;
QString mFamily;
QStringList mPrependFamily;
mChildElements.append(elem);
}
+void FontsConfElement::insertChildElement(FontsConfElementPointer elem, int index)
+{
+ if (!elem || mChildElements.contains(elem))
+ return;
+ elem->setParent(this);
+ mChildElements.insert(index, elem);
+}
+
void FontsConfElement::removeAt(int index)
{
mChildElements.removeAt(index);
int indexOf(const QString &type, int from = 0) const;
FontsConfElementPointer childElementOf(const QString &type, int from = 0) const;
void addChildElement(FontsConfElementPointer elem);
+ void insertChildElement(FontsConfElementPointer elem, int index);
void removeAt(int index);
void removeOne(FontsConfElementPointer elem);
ApplicationController appController;
+#if 0
+ qmlRegisterUncreatableType<FontsConfigProperties>("FontConfig", 1, 0, "FontsConfigProperties", "Error");
+ qmlRegisterUncreatableType<FontInfo>("FontConfig", 1, 0, "FontInfo", "Error");
+ qmlRegisterUncreatableType<InstalledFontInfo>("FontConfig", 1, 0, "InstalledFontInfo", "Error");
+ qmlRegisterUncreatableType<FontsConfEditorController>("FontConfig", 1, 0, "FontsConfEditorController", "Error");
+#else
qmlRegisterType<FontsConfigProperties>();
qmlRegisterType<FontInfo>();
qmlRegisterType<InstalledFontInfo>();
qmlRegisterType<FontsConfEditorController>();
+#endif
QmlApplicationViewer viewer;
viewer.rootContext()->setContextProperty("controller", &appController);
// 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
Page {
"Please check <a href=\"http://www.freedesktop.org/software/fontconfig/fontconfig-user.html\">fontconfig</a> for more details."
)
+ property alias curTab: editFontsConfTab.currentTab
+
+ 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
editorController: controller.editorController(family)
}
+ FontsConfEditor {
+ id: systemTab
+ family: "Nokia Pure Text"
+ familyName: qsTr("System")
+ editorController: controller.editorController(family)
+ }
+
+ }
+
+ Item {
+ id: bottomButtons
+
+ height: bottomItem.height + importButton.height + UI.DEFAULT_MARGIN * 2
+ 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)
+ }
+ }
+
+ Item {
+ id: bottomItem
+ anchors.bottom: importButton.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)
+ }
+ }
+
+ Button {
+ id: importButton
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: UI.DEFAULT_MARGIN
+ text: qsTr("Import System Settings")
+ onClicked: {
+ controller.importSystemSettings(editFontsConfTab.currentTab.family)
+ }
+ }
}
MultiSelectionDialog {
id: selectInstallFamily
model: installableFamilyListModel
acceptButtonText: qsTr("Add")
- titleText: qsTr("Add Family for %1").arg(editFontsConfTab.currentTab.familyName)
+ titleText: qsTr("Add Family for %1").arg(curTab.familyName)
onAccepted: {
for (var i = 0; i < selectedIndexes.length; i++) {
var idx = selectedIndexes[i]
text: monospaceTab.familyName
tab: monospaceTab
}
+ TabButton {
+ text: systemTab.familyName
+ tab: systemTab
+ }
}
ToolIcon {
platformIconId: "toolbar-view-menu"
}
MenuItem {
text: qsTr("View current fonts config");
-// enabled: controller.localFontsConfExists
+ // enabled: controller.localFontsConfExists
onClicked: {
editMenu.close()
pageStack.push(fontsConfViewPageComponent, { "text": controller.localFontsConf } )
--- /dev/null
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import com.nokia.extras 1.0
+import 'UIConstants.js' as UI
+
+Item {
+ id: listItem
+
+ signal clicked
+ property bool pressed: false
+
+ property bool isHeader: model.header
+
+ property int titleSize: (model.header ? UI.FONT_XLARGE : UI.FONT_DEFAULT)
+ property int titleWeight: Font.Bold
+ property color titleColor: theme.inverted ? (model.header ? UI.COLOR_FOREGROUND : UI.COLOR_INVERTED_FOREGROUND) : (UI.COLOR_FOREGROUND)
+
+ property int subtitleSize: UI.FONT_XSMALL
+ property int subtitleWeight: Font.Light
+ property color subtitleColor: theme.inverted ? UI.COLOR_SECONDARY_FOREGROUND : UI.COLOR_INVERTED_SECONDARY_FOREGROUND
+
+ height: UI.LIST_ITEM_HEIGHT_SMALL
+ width: parent.width
+
+ Rectangle {
+ anchors.fill: parent
+ anchors.leftMargin: -UI.MARGIN_XLARGE
+ anchors.rightMargin: -UI.MARGIN_XLARGE
+ color: UI.COLOR_SELECT
+ visible: listItem.isHeader
+ }
+
+ Row {
+ anchors.fill: parent
+ spacing: UI.DEFAULT_MARGIN
+
+ Item { width: UI.DEFAULT_MARGIN; height: 1; visible: !model.header }
+
+ Item {
+ // anchors.top: parent.top
+ height: UI.LIST_ITEM_HEIGHT_SMALL
+
+ Column {
+ anchors.verticalCenter: parent.verticalCenter
+
+ Label {
+ id: mainText
+ text: model.title
+ font.weight: listItem.titleWeight
+ font.pixelSize: listItem.titleSize
+ color: listItem.titleColor
+ }
+
+ Label {
+ id: subText
+ text: model.subtitle
+ font.weight: listItem.subtitleWeight
+ font.pixelSize: listItem.subtitleSize
+ color: listItem.subtitleColor
+
+ visible: text != ""
+ }
+ }
+ }
+ }
+
+ ListButton {
+ id: appendButton
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ 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()
+ }
+ visible: listItem.isHeader
+ }
+
+ MouseArea {
+ id: selectItem
+ anchors.fill: parent
+ enabled: !listItem.isHeader
+ visible: !listItem.isHeader
+ onClicked: {
+ if (preferFamilyListView.currentIndex === index)
+ preferFamilyListView.currentIndex = -1
+ else
+ preferFamilyListView.currentIndex = index
+ }
+ }
+}
import 'UIConstants.js' as UI
Page {
+ id: fileSelectionPage
tools: backToolBar
+ property alias pageTitle: pageHeader.text
+ property alias folder: folderListModel.folder
+ property alias nameFilters: folderListModel.nameFilters
+
+ signal clicked(string filePath)
+
FolderListModel {
id: folderListModel
- nameFilters: [ "*.ttf", "*.ttc" ]
showDotAndDotDot: true
}
- Label {
+ PageHeader {
id: pageHeader
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
- text: qsTr("Select Font to install")
+ anchors.left: parent.left
+ anchors.right: parent.right
}
ListView {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
- anchors.margins: UI.DEFAULT_MARGIN
+ anchors.leftMargin: UI.DEFAULT_MARGIN
+ anchors.rightMargin: UI.DEFAULT_MARGIN
clip: true
model: folderListModel
if (folderListModel.isFolder(index)) {
folderListModel.folder = filePath
} else {
- var fontInfo = controller.checkFontInfo(filePath)
- pageStack.push(fontInstallPage, { "fontInfo": fontInfo })
+ fileSelectionPage.clicked(filePath)
}
}
}
ToolBarLayout {
id: backToolBar
- visible: true
ToolIcon {
platformIconId: "toolbar-back"
- onClicked: {
- pageStack.pop()
- }
+ onClicked: pageStack.pop()
}
}
- Component {
- id: fontInstallPage
- FontInstallPage {
-
- }
- }
}
}
}
- Label {
+ PageHeader {
id: pageHeader
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
+ anchors.left: parent.left
+ anchors.right: parent.right
text: qsTr("Install Font")
}
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
- anchors.margins: UI.DEFAULT_MARGIN
+ anchors.topMargin: UI.DEFAULT_MARGIN / 2
+ anchors.leftMargin: UI.DEFAULT_MARGIN
+ anchors.rightMargin: UI.DEFAULT_MARGIN
clip: true
// contentWidth: contentColumn.width
onAccepted: controller.installFont(fontInfo)
}
+ ToolBarLayout {
+ id: backToolBar
+ ToolIcon {
+ platformIconId: "toolbar-back"
+ onClicked: pageStack.pop()
+ }
+ }
+
}
--- /dev/null
+/****************************************************************************
+**
+** 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."
+**
+****************************************************************************/
+
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import Qt.labs.folderlistmodel 1.0
+import com.nokia.extras 1.0
+import 'UIConstants.js' as UI
+
+FileSelectionPage {
+
+ pageTitle: qsTr("Select Font to install")
+ nameFilters: [ "*.ttf", "*.ttc" ]
+
+ onClicked: {
+ var fontInfo = controller.checkFontInfo(filePath)
+ pageStack.push(fontInstallPage, { "fontInfo": fontInfo })
+ }
+
+ Component {
+ id: fontInstallPage
+ FontInstallPage { }
+ }
+
+}
property string family
property string familyName
- property variant editorController
-
property string curSection
property string curSectionName
+ property variant editorController: null
- Label {
- id: pageHeader
- anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
- text: qsTr("Edit Fonts Config: %1").arg(familyName)
- }
+ property alias listView: preferFamilyListView
onEditorControllerChanged: {
if (editorController) {
function insertFamily(family, priority, systemFont)
{
var index = Helper.index(priority)
-// console.log("insertFamily(" + family + "," + priority + "): " + controller.localeFamily(family))
+ // console.log("insertFamily(" + family + "," + priority + "): " + controller.localeFamily(family))
preferFamilyList.insert(index, {
"title": controller.localeFamily(family),
"subtitle": (systemFont ? qsTr("System Font") : qsTr("User Font")),
function addFamily(section, family, priority, systemFont)
{
-// console.log("addFamily(" + family + "," + priority + "): " + controller.localeFamily(family))
+ // console.log("addFamily(" + family + "," + priority + "): " + controller.localeFamily(family))
preferFamilyList.append({
"title": controller.localeFamily(family),
"subtitle": (systemFont ? qsTr("System Font") : qsTr("User Font")),
Helper.setIndex(curSection, preferFamilyList.count)
}
- function removeFamily(index)
+ function moveUpFamily()
+ {
+ var index = preferFamilyListView.currentIndex
+ if (index < 1)
+ return;
+ var prevItem = preferFamilyList.get(index - 1)
+ if (!prevItem.header) {
+ var item = preferFamilyList.get(index)
+ editorController.moveFamilyUp(item.family, item.priority)
+ preferFamilyList.move(index, index - 1, 1)
+ }
+ }
+
+ function moveDownFamily()
+ {
+ var index = preferFamilyListView.currentIndex
+ if (index >= preferFamilyList.count - 1)
+ return;
+ var nextItem = preferFamilyList.get(index + 1)
+ if (!nextItem.header) {
+ var item = preferFamilyList.get(index)
+ editorController.moveFamilyDown(item.family, item.priority)
+ preferFamilyList.move(index, index + 1, 1)
+ }
+ }
+
+ function removeFamily()
{
+ var index = preferFamilyListView.currentIndex
var item = preferFamilyList.get(index)
editorController.removeFamily(item.family, item.priority)
preferFamilyList.remove(index)
Helper.updateRemoveIndexes(index)
+ preferFamilyListView.currentIndex = -1
}
Component {
}
Item {
- anchors.top: pageHeader.bottom
- anchors.bottom: importButton.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.topMargin: UI.DEFAULT_MARGIN
- anchors.bottomMargin: UI.DEFAULT_MARGIN
+// anchors.top: pageHeader.bottom
+ anchors.fill: parent
+ anchors.topMargin: UI.DEFAULT_MARGIN / 2
+// anchors.bottomMargin: UI.DEFAULT_MARGIN / 2
clip: true
ListView {
anchors.leftMargin: UI.DEFAULT_MARGIN
anchors.rightMargin: UI.DEFAULT_MARGIN
+ cacheBuffer: 100
+
+ currentIndex: -1
+
model: preferFamilyList
- delegate: editorListDelegate
+ delegate: EditorListDelegate { }
+
+ highlight: Rectangle {
+ x: - UI.MARGIN_XLARGE / 2
+ width: preferFamilyListView.width + UI.MARGIN_XLARGE
+ height: UI.LIST_ITEM_HEIGHT_SMALL
+ color: "transparent"
+ border.width: 5
+ border.color: "#bd543d"
+ radius: 5
+// z: 1
+ }
+ highlightFollowsCurrentItem: true
+ highlightMoveDuration: 100
}
ScrollDecorator {
flickableItem: preferFamilyListView
}
- // SectionScroller {
- // listView: preferFamilyListView
- // }
-
- }
-
- Button {
- id: importButton
- anchors.horizontalCenter: parent.horizontalCenter
- // width: parent.width - UI.DEFAULT_MARGIN * 2
- anchors.bottom: parent.bottom
- anchors.bottomMargin: UI.DEFAULT_MARGIN
- text: qsTr("Import System Settings")
- onClicked: {
- controller.importSystemSettings(family)
- }
- }
-
- ButtonStyle {
- id: buttonStyle
- }
-
- Component {
- id: editorListDelegate
-
- Item {
- id: listItem
-
- signal clicked
- property bool pressed: false
-
- property int titleSize: (model.header ? UI.FONT_XLARGE : UI.FONT_DEFAULT)
- property int titleWeight: Font.Bold
- property color titleColor: theme.inverted ? (model.header ? UI.COLOR_FOREGROUND : UI.COLOR_INVERTED_FOREGROUND) : (UI.COLOR_FOREGROUND)
-
- property int subtitleSize: UI.FONT_XSMALL
- property int subtitleWeight: Font.Light
- property color subtitleColor: theme.inverted ? UI.COLOR_SECONDARY_FOREGROUND : UI.COLOR_INVERTED_SECONDARY_FOREGROUND
-
- height: UI.LIST_ITEM_HEIGHT_SMALL
- width: parent.width
-
- Rectangle {
- anchors.fill: parent
- anchors.leftMargin: -UI.MARGIN_XLARGE
- anchors.rightMargin: -UI.MARGIN_XLARGE
- color: model.header ? UI.COLOR_SELECT : UI.COLOR_BACKGROUND
- }
-
- Row {
- anchors.fill: parent
- spacing: UI.DEFAULT_MARGIN
-
- Item { width: UI.DEFAULT_MARGIN; height: 1; visible: !model.header }
-
- Image {
- anchors.verticalCenter: parent.verticalCenter
- visible: model.iconSource ? true : false
- width: UI.SIZE_ICON_DEFAULT
- height: UI.SIZE_ICON_DEFAULT
- source: model.iconSource ? model.iconSource : ""
- }
-
- Column {
- anchors.verticalCenter: parent.verticalCenter
-
-
- Label {
- id: mainText
- text: model.title
- font.weight: listItem.titleWeight
- font.pixelSize: listItem.titleSize
- color: listItem.titleColor
- }
-
- Label {
- id: subText
- text: model.subtitle
- font.weight: listItem.subtitleWeight
- font.pixelSize: listItem.subtitleSize
- color: listItem.subtitleColor
-
- visible: text != ""
- }
- }
- }
- // MouseArea {
- // id: mouseArea;
- // anchors.fill: parent
- // onClicked: {
- // listItem.clicked();
- // }
- // }
-
- ListButton {
- anchors.right: parent.right
- anchors.verticalCenter: parent.verticalCenter
- anchors.rightMargin: UI.DEFAULT_MARGIN
- iconSource: (model.header ? "image://theme/icon-m-toolbar-add" : "image://theme/icon-m-toolbar-delete")
- onClicked: {
- if (model.header) {
- controller.syncInstallableFamilyFor(editorPage.family)
- editorTabPage.currentPriority = model.priority
- selectInstallFamily.selectedIndexes = []
- selectInstallFamily.open()
- } else {
- removeFamily(model.index)
- }
- }
- }
-
- }
}
}
+
property alias text: textArea.text
- Label {
+ PageHeader {
id: pageHeader
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
+ anchors.left: parent.left
+ anchors.right: parent.right
text: qsTr("Current Fonts Config")
}
Button {
id: okButton
- text: qsTr("OK")
+ text: qsTr("Close")
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.margins: UI.DEFAULT_MARGIN
}
}
- Label {
+ PageHeader {
id: pageHeader
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
+ anchors.left: parent.left
+ anchors.right: parent.right
text: qsTr("Installed Font Info")
}
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
- anchors.margins: UI.DEFAULT_MARGIN
+ anchors.margins: UI.DEFAULT_MARGIN / 2
clip: true
// contentWidth: contentColumn.width
"<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>"
)
- Label {
+ PageHeader {
id: pageHeader
anchors.top: parent.top
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.margins: UI.DEFAULT_MARGIN
+ anchors.left: parent.left
+ anchors.right: parent.right
enabled: !disableTools
- opacity: enabled ? 1.0 : 0.5
-
- horizontalAlignment: Text.AlignHCenter
- font.pixelSize: UI.FONT_LARGE
- font.bold: true
text: qsTr("Installed Fonts")
-
}
Connections {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
+ anchors.margins: UI.DEFAULT_MARGIN / 2
clip: true
enabled: !disableTools
opacity: enabled ? 1.0 : 0.5
ListView {
id: listView
anchors.fill: parent
- anchors.margins: UI.DEFAULT_MARGIN
model: installedFontList
visible: running
}
+ Loader {
+ id: componentLoader
+ }
+
Component {
id: installedFontInfoPageComponent
InstalledFontInfoPage { }
onClicked: {
if (mainMenu.status !== DialogStatus.Closed)
mainMenu.close()
- pageStack.push(fontSelectPage)
+ pageStack.push(fontSelectionPage)
}
}
ToolIcon {
}
}
MenuItem {
+ id: backupConfigItem
+ text: qsTr("Backup Config")
+ onClicked: backupConfig()
+ }
+ MenuItem {
+ id: restoreConfigItem
+ text: qsTr("Restore Config")
+ onClicked: pageStack.push(restoreFontsConfPageComponent)
+ }
+ MenuItem {
text: qsTr("About")
onClicked: aboutDialog.open()
}
id: aboutDialog
titleText: qsTr("Font Manager for N9")
message: qsTr("Version: %1\nAuthor: Takumi Asaki <takumi.asaki@gmail.com>\n\nApplication Icon is created by hirao").arg(controller.version)
- acceptButtonText: qsTr("OK")
+ acceptButtonText: qsTr("Close")
+ }
+
+ 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")
+ }
+
+ Component {
+ id: restoreFontsConfPageComponent
+ RestoreFontsConfPage { }
+ }
+
+ function backupConfig()
+ {
+ var filepath = controller.defaultBackupFilename()
+ controller.backupConfig(filepath)
+ var displaypath = filepath.replace(/^\/home\/[^/]*\//, "~/")
+ backupDialog.filepath = displaypath
+ backupDialog.open()
}
states: [
--- /dev/null
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import com.nokia.extras 1.0
+import 'UIConstants.js' as UI
+
+Item {
+ id: pageHeader
+ height: UI.HEADER_DEFAULT_HEIGHT_PORTRAIT
+ opacity: enabled ? 1.0 : 0.5
+
+ property alias text: label.text
+
+ Rectangle {
+ 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 {
+ id: label
+ anchors.centerIn: parent
+ horizontalAlignment: Text.AlignHCenter
+ font.pixelSize: UI.FONT_LARGE
+ font.bold: true
+ }
+}
\ No newline at end of file
--- /dev/null
+/****************************************************************************
+**
+** 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."
+**
+****************************************************************************/
+
+// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
+import QtQuick 1.1
+import com.nokia.meego 1.0
+import Qt.labs.folderlistmodel 1.0
+import 'UIConstants.js' as UI
+
+FileSelectionPage {
+
+ pageTitle: qsTr("Restore Fonts Config")
+ folder: controller.backupDir
+ nameFilters: [ "*.conf" ]
+
+ function restoreConfig(filename)
+ {
+ console.log("Restore: " + filename)
+ controller.restoreConfig(filename)
+ }
+
+ onClicked: {
+ restoreConfig(filePath)
+ pageStack.pop()
+ }
+
+}
}
Component {
- id: fontSelectPage
- FontSelectPage {
+ id: fontSelectionPage
+ FontSelectionPage {
}
}
property string fontpath: "Unknown"
titleText: qsTr("Install finished")
message: qsTr("Font '%1' is installed successfully.").arg(fontpath)
- acceptButtonText: qsTr("OK")
+ acceptButtonText: qsTr("Close")
onAccepted: { pageStack.pop(mainPage) }
onRejected: { pageStack.pop(mainPage) }
}
property string fontpath: "Unknown"
titleText: qsTr("Uninstall finished")
message: qsTr("Font '%1' is uninstalled successfully.").arg(fontpath)
- acceptButtonText: qsTr("OK")
+ acceptButtonText: qsTr("Close")
onAccepted: pageStack.pop(mainPage)
onRejected: pageStack.pop(mainPage)
}
+fontmanager (0.4.9) unstable; urgency=low
+
+ 0.5 beta
+ * Add reorder configuration.
+ * Add backup/restore configuration.
+ * Add edit System font configuration.
+ * Adjust UI layout.
+
+ -- Takumi Asaki <takumi.asaki@gmail.com> Tue, 3 Apr 2012 01:00:00 +0900
+
fontmanager (0.4.3) unstable; urgency=low
* Don't add non-English family name to ~/.fonts.conf