1 /****************************************************************************
3 ** Copyright (C) 2011 Takumi Asaki
4 ** All rights reserved.
5 ** Contact: Takumi Asaki (takumi.asaki@gmail.com)
7 ** This file is part of the fontmanager application.
9 ** You may use this file under the terms of the BSD license as follows:
11 ** "Redistribution and use in source and binary forms, with or without
12 ** modification, are permitted provided that the following conditions are
14 ** * Redistributions of source code must retain the above copyright
15 ** notice, this list of conditions and the following disclaimer.
16 ** * Redistributions in binary form must reproduce the above copyright
17 ** notice, this list of conditions and the following disclaimer in
18 ** the documentation and/or other materials provided with the
20 ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
21 ** the names of its contributors may be used to endorse or promote
22 ** products derived from this software without specific prior written
25 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
37 ****************************************************************************/
40 import com.nokia.meego 1.0
41 import com.nokia.extras 1.1
42 import 'UIConstants.js' as UI
49 anchors.top: parent.top
50 anchors.horizontalCenter: parent.horizontalCenter
51 anchors.margins: UI.DEFAULT_MARGIN
53 horizontalAlignment: Text.AlignHCenter
54 font.pixelSize: UI.FONT_LARGE
56 text: qsTr("Installed Fonts")
61 onClearInstalledFontList: {
62 installedFontList.clear()
64 onAppendInstalledFont: {
65 installedFontList.append({ "title": family, "subtitle": fullname })
75 anchors.top: pageHeader.bottom
76 anchors.bottom: parent.bottom
77 anchors.left: parent.left
78 anchors.right: parent.right
79 anchors.margins: UI.DEFAULT_MARGIN
82 model: installedFontList
84 delegate: ListDelegate {
86 if (mainMenu.status != DialogStatus.Closed)
88 pageStack.push(installedFontInfoPage, { "fontInfo": controller.fontInfo(title) } );
96 anchors.centerIn: parent
97 text: qsTr("No Fonts Found!")
98 font.pixelSize: UI.FONT_XLARGE
101 visible: listView.count == 0
105 id: installedFontInfoPage
106 InstalledFontInfoPage { }
110 id: fontsConfViewPageComponent
111 FontsConfViewPage { }
118 platformIconId: "toolbar-add"
120 if (mainMenu.status != DialogStatus.Closed)
122 pageStack.push(fontSelectPage)
126 platformIconId: "toolbar-view-menu"
127 anchors.right: (parent === undefined) ? undefined : parent.right
128 onClicked: (mainMenu.status == DialogStatus.Closed) ? mainMenu.open() : mainMenu.close()
134 visualParent: pageStack
137 text: qsTr("View current fonts config");
138 enabled: controller.localFontsConfExists
141 pageStack.push(fontsConfViewPageComponent, { "text": controller.localFontsConf } )
145 text: qsTr("Remove uninstalled fonts from config");
146 enabled: controller.configHasUninstalledFonts
149 controller.removeUninstalledFontsFromConfig()
150 controller.saveFontsConf()