--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/image/qgn_menu_note.svg Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="100%" height="100%" viewBox="0 0 88 88">
+<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="46.99" y1="48.62" x2="57.59" y2="67.17">
+<stop stop-color="#A2C2DD" offset="0.1"/>
+<stop stop-color="#6C83BB" offset="0.71"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<path fill="url(#_20)" d="M37.755,14.563c-0.625-0.15-3.215-0.771-3.215-0.771l-6.344,9.318 C14.325,41.71,3.561,47.928,2.801,48.401l6.468,2.128l-1.694,2.4l1.111,3.48l41.153,18.198l14.238-26.409l16.804-2.157l2.899-4.356 l-1.079-7.683l-3.737-4.507l-5.312,0.944l0.463-0.857l0.251-6.262c0,0-4.423-1.069-4.374-1.063 c-0.755-3.548-4.226-3.896-6.26-1.475c-0.013-0.005-2.825-0.708-2.818-0.712c-0.742-3.492-4.2-3.939-6.269-1.469 c-0.004-0.012-2.582-0.668-2.595-0.661c-0.749-3.501-4.18-3.806-6.163-1.437c-0.027,0.008-2.09-0.508-2.088-0.523 C43.063,12.593,39.706,12.258,37.755,14.563z"/>
+<polygon fill="#FFFFFF" points="35.11,15.12 8.336,53.049 48.798,69.047 72.646,28.459 73.573,25.04 "/>
+<linearGradient id="_21" gradientUnits="userSpaceOnUse" x1="30.63" y1="59.56" x2="27.89" y2="65.83">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_21)" points="8.45,52.959 48.528,68.704 49.52,73.706 9.246,55.897 "/>
+<linearGradient id="_22" gradientUnits="userSpaceOnUse" x1="56.86" y1="45.11" x2="69.16" y2="54.68">
+<stop stop-color="#DEE9F3" offset="0"/>
+<stop stop-color="#235487" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_22)" points="48.528,68.704 73.633,23.86 73.411,29.393 49.52,73.706 "/>
+<linearGradient id="_23" gradientUnits="userSpaceOnUse" x1="4.44" y1="38.62" x2="45.79" y2="38.62">
+<stop stop-color="#CADCEC" offset="0"/>
+<stop stop-color="#87A8CB" offset="1"/>
+</linearGradient>
+<path fill="url(#_23)" d="M34.894,14.715C18.737,39.471,4.443,48.209,4.443,48.209 c7.75,2.391,41.35,14.314,41.35,14.314L34.894,14.715z"/>
+<linearGradient id="_24" gradientUnits="userSpaceOnUse" x1="15.64" y1="58.6" x2="44.93" y2="34.82">
+<stop stop-color="#FFFFFF" offset="0.15"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_24)" d="M10.557,50.247c11.41,4.494,35.236,12.277,35.236,12.277 c15.358-11.682,27.74-38.658,27.74-38.658l-38.697-9.279L10.557,50.247z"/>
+<linearGradient id="_25" gradientUnits="userSpaceOnUse" x1="68.03" y1="52.73" x2="41.63" y2="18.62">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_25)" points="33.619,23.77 33.263,24.6 64.586,33.327 64.445,31.303 "/>
+<polygon fill="url(#_25)" points="30.349,28.944 29.959,29.764 60.965,39.577 60.895,37.549 "/>
+<polygon fill="url(#_25)" points="26.981,34.229 26.567,35.036 57.195,45.958 57.195,43.926 "/>
+<polyline fill="url(#_25)" points="37.03,44.815 23.809,40.569 23.396,41.375 34.393,45.297 37.03,44.815 "/>
+<path fill="#3F5AA6" d="M37.265,17.37c-1.227,0.744-1.05,2.494,0.11,3.184c1.821,1.088,4.019-0.83,2.968-2.572 c0.449-1.01,1.511-1.695,1.794-1.643l1.055,0.223C42.339,13.018,37.265,17.37,37.265,17.37z"/>
+<linearGradient id="_29" gradientUnits="userSpaceOnUse" x1="39.83" y1="18.64" x2="40.83" y2="14.3">
+<stop stop-color="#87A8CB" offset="0"/>
+<stop stop-color="#CADCEC" offset="0.5"/>
+<stop stop-color="#87A8CB" offset="1"/>
+</linearGradient>
+<path fill="url(#_29)" d="M38.914,19.569c-0.589,0.107-1.317-0.102-1.613-0.867c-0.736-5.027,5.301-6.996,5.913-2.141 C42.121,14.176,39.059,15.401,38.914,19.569z"/>
+<path fill="#3F5AA6" d="M45.395,19.34c-1.25,0.758-1.071,2.543,0.112,3.248c1.859,1.107,4.099-0.848,3.027-2.625 c0.458-1.031,1.542-1.729,1.83-1.676l1.076,0.227C50.57,14.901,45.395,19.34,45.395,19.34z"/>
+<path fill="url(#_29)" d="M47.076,21.584c-0.601,0.107-1.342-0.105-1.645-0.887c-0.75-5.129,5.407-7.137,6.031-2.184 C50.348,16.081,47.225,17.331,47.076,21.584z"/>
+<path fill="#3F5AA6" d="M54.135,21.483c-1.274,0.775-1.092,2.594,0.114,3.314c1.897,1.129,4.181-0.863,3.088-2.678 c0.468-1.051,1.574-1.762,1.867-1.709l1.099,0.232C59.414,16.956,54.135,21.483,54.135,21.483z"/>
+<path fill="url(#_29)" d="M55.85,23.772c-0.611,0.111-1.367-0.107-1.676-0.902c-0.767-5.232,5.515-7.281,6.151-2.227 C59.188,18.161,56.002,19.436,55.85,23.772z"/>
+<path fill="#3F5AA6" d="M63.214,23.67c-1.275,0.775-1.093,2.596,0.114,3.314c1.897,1.131,4.181-0.863,3.088-2.678 c0.467-1.051,1.573-1.762,1.867-1.709l1.098,0.23C68.493,19.143,63.214,23.67,63.214,23.67z"/>
+<path fill="url(#_29)" d="M64.929,25.959c-0.612,0.111-1.368-0.105-1.677-0.902c-0.766-5.23,5.515-7.279,6.151-2.229 C68.267,20.348,65.081,21.624,64.929,25.959z"/>
+<linearGradient id="_33" gradientUnits="userSpaceOnUse" x1="39.98" y1="48.02" x2="38.35" y2="40.21">
+<stop stop-color="#81C7C8" offset="0"/>
+<stop stop-color="#BFDAE1" offset="0.01"/>
+<stop stop-color="#FFFFFF" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_33)" points="44.766,36.286 32.146,45.174 47.337,49.641 "/>
+<linearGradient id="_34" gradientUnits="userSpaceOnUse" x1="76.2" y1="30.96" x2="76.09" y2="43.23">
+<stop stop-color="#D6E6EC" offset="0"/>
+<stop stop-color="#298595" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_34)" points="78.675,30.256 82.024,34.297 83.039,41.52 80.464,45.389 69.202,39.09 "/>
+<linearGradient id="_35" gradientUnits="userSpaceOnUse" x1="32.44" y1="33.5" x2="65.81" y2="41.63">
+<stop stop-color="#D6E6EC" offset="0"/>
+<stop stop-color="#298595" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_35)" points="76.59,34.737 77.632,41.426 45.104,46.104 44.105,39.893 "/>
+<linearGradient id="_36" gradientUnits="userSpaceOnUse" x1="30.73" y1="46.42" x2="88.73" y2="44.8">
+<stop stop-color="#E6EEF4" offset="0"/>
+<stop stop-color="#2F8E9A" offset="0.44"/>
+<stop stop-color="#003D6D" offset="0.94"/>
+</linearGradient>
+<polygon fill="url(#_36)" points="77.632,41.426 80.464,45.389 47.337,49.641 45.104,46.104 "/>
+<linearGradient id="_37" gradientUnits="userSpaceOnUse" x1="45.63" y1="37.46" x2="101.75" y2="28.96">
+<stop stop-color="#D6E6EC" offset="0"/>
+<stop stop-color="#298595" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_37)" points="76.59,34.737 78.675,30.256 44.766,36.286 44.105,39.893 "/>
+<linearGradient id="_38" gradientUnits="userSpaceOnUse" x1="35.44" y1="45.89" x2="34.76" y2="40.93">
+<stop stop-color="#235487" offset="0"/>
+<stop stop-color="#496DA2" offset="0.5"/>
+<stop stop-color="#235487" offset="1"/>
+</linearGradient>
+<path fill="url(#_38)" d="M38.261,40.885l-6.462,4.201l7.347,2.1C38.319,46.098,37.854,42.79,38.261,40.885z"/>
+<rect fill="none" height="88" width="88"/>
+</svg>
\ No newline at end of file
Binary file controlpanelplugins/themeplugin/image/themePreview.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/image/themePreview.svg Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg width="84" height="72" viewBox="0 0 84 72">
+<linearGradient id="_78" gradientUnits="userSpaceOnUse" x1="30.87" y1="28.75" x2="37.09" y2="60.51">
+<stop stop-color="#A2C2DD" offset="0.1"/>
+<stop stop-color="#6C83BB" offset="0.71"/>
+<stop stop-color="#003D6D" offset="0.99"/>
+</linearGradient>
+<path fill="url(#_78)" d="M23.531,11.281L5.719,42.5l1.328,2.391l24.031,6.734l17.641-13.141c0,0-0.158-2.493-0.162-2.503 c0,0-3.672-8.489-3.9-9.028c0.514-0.3,11.891-6.938,11.891-6.938l-0.109-2.859L23.531,11.281z"/>
+<path fill="url(#_78)" d="M52.281,29.016c0,0,2.75,11.217,2.875,11.734c-0.483,0.248-19.281,9.906-19.281,9.906l0.594,2.781 L59.5,63.391l19.641-32.897L78.938,27l-11.516-3.859L52.281,29.016z"/>
+<linearGradient id="_80" gradientUnits="userSpaceOnUse" x1="21.51" y1="35.87" x2="18.01" y2="49.87">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_80)" points="6.549,42.57 7.615,44.447 31.021,50.963 30.717,48.865 "/>
+<linearGradient id="_81" gradientUnits="userSpaceOnUse" x1="13.09" y1="-0.2" x2="49.83" y2="61.22">
+<stop stop-color="#FFFFFF" offset="0.15"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_81)" points="43.439,25.218 55.939,17.628 23.871,12.013 6.518,42.631 30.486,48.939 33.328,46.857 "/>
+<linearGradient id="_82" gradientUnits="userSpaceOnUse" x1="47.19" y1="50.73" x2="23.44" y2="19.48">
+<stop stop-color="#FFFFFF" offset="0.15"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_82)" points="43.42,24.953 53.211,19.302 24.766,14.07 10.072,41.236 33.07,47.236 48.176,36.132 "/>
+<linearGradient id="_83" gradientUnits="userSpaceOnUse" x1="23.7" y1="56.84" x2="22.11" y2="42.87">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#003D6D" offset="1"/>
+</linearGradient>
+<path fill="url(#_83)" d="M12.896,36.508l-2.679,4.568l22.774,6.088c0.578-0.389,0.99-0.688,1.199-0.844 C33.67,46.248,17.619,40.061,12.896,36.508z"/>
+<polygon fill="#115B7E" points="23.068,37.926 26.33,41.092 37.918,43.674 42.563,40.258 "/>
+<polygon fill="#BFDAE1" points="30.498,39.459 33.217,39.76 36.553,43.365 33.635,43.055 "/>
+<polygon fill="#2F8E9A" points="30.498,39.459 30.383,39.869 33.033,42.955 33.57,42.961 "/>
+<path fill="#298595" d="M25.684,41.143c-0.34,0.478-3.08,1.111-3.701,0.918c0.584,1.197,8.281,3.697,12.223,4.34 c1.152-0.844,2.383-1.745,3.625-2.655C37.682,43.734,29.107,42.438,25.684,41.143z"/>
+<linearGradient id="_84" gradientUnits="userSpaceOnUse" x1="21.12" y1="39.41" x2="24.58" y2="41.68">
+<stop stop-color="#D6E6EC" offset="0"/>
+<stop stop-color="#298595" offset="1"/>
+</linearGradient>
+<path fill="url(#_84)" d="M21.859,37.691c0,0,3.859,3.41,3.824,3.451c-0.486,0.532-1.895,1.582-3.225,1.356 c-1.406-0.969-1.516-2.535-1.516-2.535S21.143,38.691,21.859,37.691z"/>
+<path fill="#BFDAE1" d="M37.176,43.164c-3.891-0.346-8.678-1.727-10.75-2.424l-2.869-2.592 c2.453-0.051,12.23,1.278,18.695,2.393c0.133-0.098,0.266-0.193,0.395-0.287c-7.146-1.283-17.438-2.85-20.735-2.557 l3.785,3.512c2.773,1.098,7.793,2.355,11.797,2.68c0.063,0.006,0.117,0.006,0.178,0.01c0.293-0.215,0.588-0.428,0.879-0.643 C38.096,43.232,37.639,43.203,37.176,43.164z"/>
+<path fill="#FFFFFF" d="M43.801,25.99c-1.008,1.018-2.887,1.582-5.258,0.744c-3.121,0.617-14.422-1.703-18.314-4.434 l1.998-3.733c1.73-0.021,3.557,0.43,4.418,0.979c0.021-1.244,4.799-3.408,6.994-0.418c2.146-1.813,8.777-2.26,8.297,2.594 c1.927,0.375,2.727,1.459,2.671,2.562l-1.198,0.656L43.801,25.99z"/>
+<linearGradient id="_85" gradientUnits="userSpaceOnUse" x1="41.69" y1="29.27" x2="17.36" y2="33.57">
+<stop stop-color="#2B98A0" offset="0"/>
+<stop stop-color="#0A4A60" offset="1"/>
+</linearGradient>
+<polygon fill="url(#_85)" points="33.205,40.467 44.795,19.023 23.104,34.765 "/>
+<polygon fill="#2F8E9A" points="40.377,41.775 34.348,41.842 42.938,23.255 42.648,40.254 "/>
+<linearGradient id="_86" gradientUnits="userSpaceOnUse" x1="68.92" y1="17.39" x2="38.92" y2="25.01">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_86)" points="55.939,17.628 56.088,19.786 44.148,26.745 43.408,24.939 "/>
+<linearGradient id="_87" gradientUnits="userSpaceOnUse" x1="69.87" y1="44.4" x2="30.62" y2="43.28">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_87)" points="48.141,36.109 48.287,38.27 31.021,50.963 30.436,48.941 "/>
+<linearGradient id="_88" gradientUnits="userSpaceOnUse" x1="44.31" y1="7.26" x2="56.64" y2="37.42">
+<stop stop-color="#FFFFFF" offset="0.15"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<path fill="url(#_88)" d="M78.33,27.458l-11.006-3.77c-0.477,0.186-3.596,1.404-3.596,1.404l-7.695,16.415 l-16.508,7.646l-3.176,1.65l21.958,9.551L78.33,27.458z"/>
+<linearGradient id="_89" gradientUnits="userSpaceOnUse" x1="61.03" y1="50.36" x2="53.03" y2="27.86">
+<stop stop-color="#FFFFFF" offset="0.15"/>
+<stop stop-color="#A2C2DD" offset="1"/>
+</linearGradient>
+<polyline fill="url(#_89)" points="57.227,56.859 74.799,28.55 64.098,24.958 52.76,29.253 55.58,40.939 39.156,49.361 "/>
+<path fill="#298595" d="M51.652,44.461c-1.846,1.014-3.752,1.346-5.568,1.35l-4.371,2.238 C46.66,48.316,49.598,46.246,51.652,44.461z"/>
+<path fill="#115B7E" d="M49.533,44.045l-2.205,1.146c1.115-0.109,2.188-0.34,3.188-0.75 C50.252,44.324,49.916,44.189,49.533,44.045z"/>
+<path fill="#CFECFF" d="M50.516,44.441c-1.002,0.41-2.072,0.641-3.188,0.75l-1.244,0.619 c1.512,0.034,2.809-0.218,4.102-0.668c0.455-0.168,0.939-0.392,1.467-0.685c-0.438-0.19-1.729-0.615-1.729-0.615 l-0.387,0.199C49.916,44.189,50.252,44.324,50.516,44.441z"/>
+<linearGradient id="_90" gradientUnits="userSpaceOnUse" x1="51.3" y1="60.44" x2="47.14" y2="39.31">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#A2C2DD" offset="0.35"/>
+<stop stop-color="#6C83BB" offset="0.7"/>
+<stop stop-color="#003D6D" offset="1"/>
+</linearGradient>
+<path fill="url(#_90)" d="M42.832,47.469l-3.646,1.877l18.055,7.525l2.504-3.982 C59.744,52.889,53.578,48.111,42.832,47.469z"/>
+<linearGradient id="_91" gradientUnits="userSpaceOnUse" x1="83.79" y1="20.58" x2="59.13" y2="60.86">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_91)" points="78.363,27.452 58.451,59.945 59.256,62.68 78.479,30.382 "/>
+<linearGradient id="_92" gradientUnits="userSpaceOnUse" x1="51.25" y1="49.13" x2="46.5" y2="59.63">
+<stop stop-color="#FFFFFF" offset="0"/>
+<stop stop-color="#496DA2" offset="0.71"/>
+<stop stop-color="#235487" offset="0.99"/>
+</linearGradient>
+<polygon fill="url(#_92)" points="58.508,59.967 36.35,50.805 36.85,52.969 59.256,62.68 "/>
+</svg>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/rom/themeplugin.iby Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef __THEMEPLUGIN_IBY__
+#define __THEMEPLUGIN_IBY__
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\cpthemeplugin.dll SHARED_LIB_DIR\cpthemeplugin.dll
+
+data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpthemeplugin.qtplugin resource\qt\plugins\controlpanel\cpthemeplugin.qtplugin
+
+#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/rom/themeplugin_rom.pri Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,21 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+symbian {
+ BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include<platform_paths.hrh>" \
+ "rom/themeplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(themeplugin.iby)"
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,122 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Implementation of the HbThemeChanger class
+ *
+*/
+
+
+#include "cpthemechanger.h"
+#include "cpthemechanger_p.h"
+
+/*!
+ @alpha
+ @hbcore
+ \class CpThemeChanger
+
+ \brief CpThemeChanger provides an interface for changing the current
+ theme and enumerating the available themes (e.g., for the UI to provide
+ a list of themes to show).
+
+ This API is only for use with the control panel and its theme
+ changing plugin.
+*/
+
+/*!
+ Constructor.
+*/
+CpThemeChanger::CpThemeChanger(QObject* p) :
+ QObject(p),
+ d_ptr(new CpThemeChangerPrivate(this))
+{
+}
+
+/*!
+ Provides a list of themes as a const QAbstractItemModel*.
+*/
+QAbstractItemModel& CpThemeChanger::model()
+{
+ Q_D(CpThemeChanger);
+
+ return d->model;
+}
+
+/*!
+ Provide a list of currently available themes.
+*/
+const QList<CpThemeChanger::ThemeInfo> CpThemeChanger::themes() const
+{
+ Q_D(const CpThemeChanger);
+
+ return d->themes();
+}
+
+/*!
+ Creates a connection to the theme server for the purpose of
+ changing the theme.
+ */
+bool CpThemeChanger::connectToServer()
+{
+ Q_D(CpThemeChanger);
+
+ return d->connectToServer();
+}
+
+/*!
+ Indicates if the client is connected to the theme server.
+*/
+bool CpThemeChanger::isConnected() const
+{
+ Q_D(const CpThemeChanger);
+
+ return d->isConnected();
+}
+
+
+/*!
+ Returns a ThemeInfo struct containing the current theme name and
+ a repersentative HbIcon.
+
+ If no repersentative icon exists, the HbIcon returned will be
+ uninitialized.
+*/
+const CpThemeChanger::ThemeInfo& CpThemeChanger::currentTheme() const
+{
+ Q_D(const CpThemeChanger);
+
+ return d->currentTheme();
+}
+
+/*!
+ Change a theme. Returns true on success, false otherwise.
+ */
+bool CpThemeChanger::changeTheme(const QString& newtheme)
+{
+ Q_D(CpThemeChanger);
+
+ return d->changeTheme(newtheme);
+}
+
+/*!
+ Destructor
+ */
+CpThemeChanger::~CpThemeChanger()
+{
+ delete d_ptr;
+ d_ptr = 0;
+}
+
+#include "moc_cpthemechanger.cpp"
+
+// End of file
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbThemeChanger class definition
+*
+*/
+
+
+#ifndef CPTHEMECHANGER_H
+#define CPTHEMECHANGER_H
+
+#include <QStringList>
+#include <hbicon.h>
+#include <hbglobal.h>
+
+class CpThemeChangerPrivate;
+
+QT_BEGIN_NAMESPACE
+class QAbstractItemModel;
+QT_END_NAMESPACE
+
+class CpThemeChanger : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit CpThemeChanger(QObject* parent=0);
+ ~CpThemeChanger();
+
+ struct ThemeInfo
+ {
+ QString name;
+ HbIcon icon;
+ bool operator < (const struct ThemeInfo &other) const {
+ return name.localeAwareCompare(other.name) < 0;
+ }
+ };
+
+ const QList<ThemeInfo> themes() const;
+ QAbstractItemModel& model();
+
+ const ThemeInfo& currentTheme() const;
+
+ bool changeTheme(const QString& newtheme);
+
+ bool connectToServer();
+ bool isConnected() const;
+
+private:
+ CpThemeChangerPrivate* d_ptr;
+ Q_DECLARE_PRIVATE(CpThemeChanger)
+ Q_PRIVATE_SLOT(d_func(), void _q_themeDirectoryChanged(const QString&))
+};
+
+#endif /* CPTHEMECHANGER_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,345 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Private implementation of the theme changer.
+ *
+*/
+
+#include "cpthemechanger.h"
+#include "cpthemechanger_p.h"
+#include <QStringList>
+#include <QSettings>
+#include <QFileSystemWatcher>
+#include <HbIcon.h>
+#include <hbinstance.h>
+#include "cpthemeclient_p.h"
+#include "cpthemecommon_p.h"
+#ifdef Q_OS_SYMBIAN
+#include "cpthemeclientsymbian_p.h"
+#else
+#include "cpthemeclientqt_p.h"
+#endif
+
+namespace {
+#if !defined(Q_OS_SYMBIAN)
+ #include <stdio.h>
+ static const char* KThemePathKey = "HB_THEMES_DIR";
+#endif
+
+ static const char* KDefaultTheme = "hbdefault";
+ static const char* KSettingsGroup = "hborbit";
+ static const char* KSettingsCategory = "currenttheme";
+ static const bool KDefaultPreviewAvailable = true;
+}
+
+CpThemeChangerPrivate::CpThemeChangerPrivate(CpThemeChanger* qq):
+ q_ptr(qq),
+ themeClient(CpThemeClient::global()),
+ fileWatcher(new QFileSystemWatcher(qq)),
+ model(this, qq)
+
+{
+ Q_Q(CpThemeChanger);
+
+ // Figure out where our themes are. This is platform-dependent,
+ // but not worth breaking out into platform-private implementations
+ // at the moment. Ideally, this would be given to us by the theme server,
+ #ifdef Q_OS_WIN
+ static char* _path=NULL;
+ static size_t _size=0;
+ _dupenv_s(&_path, &_size, KThemePathKey);
+ themeRootPath = QString(_path);
+ themeRootPathPostfix = QString();
+ free(_path);
+ #elif defined(Q_OS_SYMBIAN)
+ themeRootPath = "c:\\resource\\hb";
+ themeRootPathPostfix = "resource\\hb";
+ #elif defined(Q_OS_UNIX)
+ themeRootPath = QString(getenv(KThemePathKey));
+ themeRootPathPostfix = QString();
+ #elif defined(Q_OS_MACX)
+ themeRootPath = QDir::homePath() + '/' + "Library" + QString("hb");
+ themeRootPathPostfix = QString();
+ #else
+ themeRootPath = "c:\\resource\\hb";
+ themeRootPathPostfix = QString();
+ #endif
+
+ // Get our current state
+ QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT));
+ mCurrentTheme.name = settings.value(KSettingsCategory).toString();
+ updateThemeList(mCurrentTheme.name);
+
+ // Watch for changes to the theme directory in flash.
+ // This may change once we start offering a model.
+ fileWatcher->addPath(themeRootPath+"/themes/");
+ q->connect(fileWatcher, SIGNAL(directoryChanged(const QString&)),
+ q, SLOT(_q_themeDirectoryChanged(const QString&)));
+
+ // Connect to the theme server
+ connectToServer();
+}
+
+CpThemeChangerPrivate::~CpThemeChangerPrivate()
+{
+ themeClient->releaseInstance();
+}
+
+const CpThemeChanger::ThemeInfo& CpThemeChangerPrivate::currentTheme() const
+{
+ return mCurrentTheme;
+}
+
+const QString& CpThemeChangerPrivate::currentThemeName() const
+{
+ return mCurrentTheme.name.isEmpty() ? KDefaultTheme : mCurrentTheme.name;
+}
+
+void CpThemeChangerPrivate::updateThemeList(const QString& newThemeName)
+{
+ if(!themeList.isEmpty()) {
+ themeList.clear();
+ }
+
+ mCurrentTheme.name = newThemeName.isEmpty() ? KDefaultTheme : newThemeName;
+
+ // Get the list of Drives here
+ QStringList themesPathList;
+
+#if defined(Q_OS_WIN32)
+ themesPathList << themeRootPath;
+#elif defined(Q_OS_SYMBIAN)
+ QFileInfoList driveInfoList = QDir::drives();
+ foreach (const QFileInfo &driveInfo, driveInfoList) {
+ const QString drive = driveInfo.absolutePath();
+ themesPathList << drive + themeRootPathPostfix;
+ }
+#elif defined(Q_OS_UNIX)
+ themesPathList << themeRootPath;
+#elif defined(Q_OS_MACX)
+ themesPathList << themeRootPath;
+#endif
+
+ foreach (const QString &path, themesPathList) {
+ QDir themeDir;
+ themeDir.setPath( path ) ;
+ QStringList iconthemeslist;
+ QStringList list = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
+ CpThemeChanger::ThemeInfo nameIconPair;
+
+ if(list.contains("themes",Qt::CaseSensitive )) {
+ QDir root(themeDir.path());
+ themeDir.setPath(root.path()+"/themes/icons/") ;
+ iconthemeslist=themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
+ foreach(QString themefolder, iconthemeslist) {
+ QDir iconThemePath(root.path()+"/themes/icons/"+themefolder);
+ if(iconThemePath.exists("index.theme") &&
+ (iconThemePath.exists("scalable") || iconThemePath.exists("pixmap") )) {
+ QSettings iniSetting(iconThemePath.path()+"/index.theme",QSettings::IniFormat);
+ iniSetting.beginGroup("Icon Theme");
+ QString hidden = iniSetting.value("Hidden").toString();
+ QString name = iniSetting.value("Name").toString();
+ QString iconPath = iniSetting.value("PreviewIconPath").toString();
+ if (name.isEmpty()) {
+ continue;
+ }
+ if (!KDefaultPreviewAvailable && iconPath.isEmpty())
+ {
+ continue;
+ }
+ QString fullPathToIcon(iconThemePath.path() + iconPath);
+ // Don't treat this as a theme unless it's got a preview.
+ if (!QFileInfo(fullPathToIcon).exists() && !KDefaultPreviewAvailable) {
+ continue;
+ }
+ if(iconPath.isEmpty()){
+
+ //if no preview graphics path specified,look for the background graphic.
+ //first look in /scalable folder. if not there, look in pixmap folder.
+ if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){
+ nameIconPair.icon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg");
+ } else if(QFileInfo(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png").exists()){
+ nameIconPair.icon = HbIcon(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png");
+ } else{
+ nameIconPair.icon = HbIcon(":/image/themePreview.svg");
+ }
+ } else {
+ nameIconPair.icon = HbIcon(fullPathToIcon);
+ }
+ nameIconPair.name = name;
+ themeList.append(nameIconPair);
+
+ if (name == mCurrentTheme.name) {
+ mCurrentTheme = nameIconPair;
+ }
+
+ iniSetting.endGroup();
+ if((hidden == "true") ||( hidden == "")||(name!=themefolder) ) {
+ iconthemeslist.removeOne(themefolder);
+ if(!themeList.isEmpty()) {
+ themeList.removeLast();
+ }
+ }
+ } else {
+ iconthemeslist.removeOne(themefolder);
+ if(!themeList.isEmpty()) {
+ themeList.removeLast();
+ }
+ }
+ }
+ }
+ }
+ // Include default
+ CpThemeChanger::ThemeInfo def;
+ def.name = KDefaultTheme;
+ def.icon = HbIcon(":/image/themePreview.svg");
+ themeList.append(def);
+ if (mCurrentTheme.name == KDefaultTheme)
+ {
+ mCurrentTheme = def;
+ }
+
+ // Sort the themes list
+ qSort(themeList.begin(), themeList.end());
+}
+
+const QList<CpThemeChanger::ThemeInfo>& CpThemeChangerPrivate::themes() const
+{
+ return themeList;
+}
+
+bool CpThemeChangerPrivate::connectToServer()
+{
+ return themeClient->connectToServer();
+}
+
+/**
+ * Indicate if the client is connected to the server
+ */
+bool CpThemeChangerPrivate::isConnected() const
+{
+ return themeClient->isConnected();
+}
+
+/**
+ * Change a theme
+ */
+bool CpThemeChangerPrivate::changeTheme(const QString& newTheme)
+{
+ bool result = false;
+ // Skip doing this if the request is for the current theme
+ if (newTheme.isEmpty() || newTheme == mCurrentTheme.name) return result;
+
+ // Make sure it's a valid theme name
+ bool exists = false;
+ QList<CpThemeChanger::ThemeInfo> themeList = themes();
+ QList<CpThemeChanger::ThemeInfo>::const_iterator i;
+ for (i = themeList.constBegin(); i != themeList.constEnd(); ++i) {
+ if ( newTheme == i->name) {
+ exists = true;
+ break;
+ }
+ }
+
+ if (exists) {
+ result = themeClient->changeTheme(newTheme);
+ updateThemeList(newTheme);
+}
+ return result;
+}
+
+void CpThemeChangerPrivate::_q_themeDirectoryChanged(const QString&)
+{
+ updateThemeList();
+}
+
+/*
+ HbThemeChangerModel provides an interface to the data contained in the
+ HbThemeChanger using QAbstractListModel.
+*/
+
+/*
+ Constructor
+*/
+HbThemeListModel::HbThemeListModel(CpThemeChangerPrivate *dd, QObject* parent)
+ : QAbstractListModel(parent)
+ , mThemeChangerPrivate(dd)
+{
+ connect(dd->fileWatcher, SIGNAL(directoryChanged(const QString&)),
+ this, SLOT(themeListChanged()));
+}
+
+/*
+ Destructor
+*/
+HbThemeListModel::~HbThemeListModel()
+{
+
+}
+
+/*
+ Reimplemented from QAbstractListModel.
+*/
+int HbThemeListModel::rowCount(const QModelIndex&) const
+{
+ return mThemeChangerPrivate->themeList.size();
+}
+
+/*
+ Reimplemented from QAbstractListModel. Provides the data for Qt::DisplayRole and
+ Qt::DecorationRole.
+*/
+QVariant HbThemeListModel::data(const QModelIndex& index, int role) const
+{
+ QVariant retVal = QVariant();
+
+ if (index.isValid()) {
+ switch (role) {
+ case Qt::DisplayRole:
+ retVal = mThemeChangerPrivate->themeList.at(index.row()).name;
+ break;
+
+ case Qt::DecorationRole:
+ retVal = mThemeChangerPrivate->themeList.at(index.row()).icon;
+ break;
+
+ case Qt::SizeHintRole:
+ retVal = mThemeChangerPrivate->themeList.at(index.row()).icon.size();
+ break;
+
+ default:
+ // do nothing
+ qt_noop();
+ }
+ }
+
+ return retVal;
+}
+
+/*
+ Responds appropriately when the underlying data in the theme changer is modified.
+
+ Unfortunately the directory watcher from QFileWatcher only says when something changed
+ not what changed. Therefore the model is considered reset rather than having rows
+ with dataChanged.
+*/
+void HbThemeListModel::themeListChanged()
+{
+ beginResetModel();
+
+ mThemeChangerPrivate->themes();
+
+ endResetModel();
+}
+
+// End of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,94 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: HbThemeChangerPrivate class definition
+*
+*/
+
+
+#ifndef HBTHEMECHANGER_P_H
+#define HBTHEMECHANGER_P_H
+
+#include <hbglobal.h>
+
+#include <QObject>
+
+#include <QAbstractListModel>
+#include <QDir>
+#include <QModelIndex>
+#include <QString>
+#include <QStringList>
+
+#include "cpthemechanger.h"
+
+QT_BEGIN_NAMESPACE
+class QFileSystemWatcher;
+QT_END_NAMESPACE
+
+class CpThemeClient;
+
+class HbThemeListModel : public QAbstractListModel
+{
+ Q_OBJECT
+
+public:
+ HbThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0);
+ virtual ~HbThemeListModel();
+
+ virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
+ virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
+
+public slots:
+ void themeListChanged();
+
+private:
+ CpThemeChangerPrivate *mThemeChangerPrivate;
+};
+
+class CpThemeChangerPrivate
+{
+ CpThemeChanger* q_ptr;
+ Q_DECLARE_PUBLIC(CpThemeChanger)
+
+public:
+ CpThemeChangerPrivate(CpThemeChanger* q);
+ ~CpThemeChangerPrivate();
+
+ bool connectToServer();
+ bool isConnected() const;
+
+ const QList<CpThemeChanger::ThemeInfo>& themes() const;
+ void updateThemeList(const QString& currentThemeName = QString());
+
+ const QStringList directories() const;
+
+ const CpThemeChanger::ThemeInfo& currentTheme() const;
+
+ const QString& currentThemeName() const;
+ bool changeTheme(const QString& newtheme);
+
+ void _q_themeDirectoryChanged(const QString&);
+
+ CpThemeChanger::ThemeInfo mCurrentTheme;
+
+ QString themeRootPath;
+ QString themeRootPathPostfix;
+
+ CpThemeClient* themeClient;
+ QFileSystemWatcher* fileWatcher;
+ QList<CpThemeChanger::ThemeInfo> themeList;
+ HbThemeListModel model;
+ friend class HbThemeChangerModel;
+};
+
+#endif /* HBTHEMECHANGER_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclient_p.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,92 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "cpthemeclient_p.h"
+
+#ifdef Q_OS_SYMBIAN
+#include "cpthemeclientsymbian_p.h"
+#else
+#include "cpthemeclientqt_p.h"
+#endif
+
+static CpThemeClient *clientInst=0;
+
+/**
+ * Constructor
+ */
+CpThemeClient::CpThemeClient():d_ptr(new CpThemeClientPrivate)
+{
+
+}
+
+/**
+ * CpThemeClient::connectToServer()
+ */
+bool CpThemeClient::connectToServer()
+{
+ Q_D(CpThemeClient);
+ return d->connectToServer();
+}
+
+bool CpThemeClient::isConnected()
+{
+ Q_D(CpThemeClient);
+ return d->isConnected();
+}
+
+/**
+ * Change a theme
+ */
+bool CpThemeClient::changeTheme(const QString& newtheme)
+{
+ Q_D(CpThemeClient);
+ return d->changeTheme(newtheme);
+}
+
+
+
+/**
+ * CpThemeClient::~CpThemeClient()
+ */
+CpThemeClient::~CpThemeClient()
+{
+ Q_D(CpThemeClient);
+ delete d;
+}
+
+
+
+/**
+ * CpThemeClient::global()
+ */
+CpThemeClient *CpThemeClient::global()
+{
+ if ( !clientInst ) {
+ clientInst = new CpThemeClient;
+ }
+ return clientInst;
+}
+
+/**
+ * CpThemeClient::releaseInstance()
+ */
+void CpThemeClient::releaseInstance()
+{
+ delete clientInst;
+ clientInst = 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclient_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#ifndef CPTHEMECLIENT_P_H
+#define CPTHEMECLIENT_P_H
+
+#include <qglobal.h>
+#include <QByteArray>
+
+
+class CpThemeClientPrivate;
+
+class CpThemeClient
+{
+ CpThemeClientPrivate* d_ptr;
+ Q_DECLARE_PRIVATE_D(d_ptr, CpThemeClient)
+
+public:
+ bool connectToServer();
+
+ bool changeTheme(const QString& newtheme);
+
+ bool isConnected();
+
+public:
+ static CpThemeClient *global();
+ static void releaseInstance();
+ ~CpThemeClient();
+
+private:
+ CpThemeClient();
+};
+
+#endif /* CPTHEMECLIENT_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclientqt_p.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "cpthemeclientqt_p.h"
+#include <QLocalSocket>
+#include <QProcess>
+#include <QFile>
+#include <QCoreApplication>
+#include <QDebug>
+#include <QDir>
+
+#include <hbinstance.h>
+// TODO Do we need these?
+//#include <hbtheme_p.h>
+//#include <hbtheme.h>
+//#include <hbevent.h>
+//#include "hbthemecommon_p.h"
+
+#define WAIT_TIME_TO_CONNECT_TO_SERVER 500
+#define WAIT_TIME_TO_START_SERVER 5000
+//static const QString SERVERFILEPATH = QLatin1String(HB_BIN_DIR) + QDir::separator() + QLatin1String("hbthemeserver");
+
+/**
+ * Constructor
+ */
+CpThemeClientPrivate::CpThemeClientPrivate():clientConnected( false ),localSocket( new QLocalSocket() )
+{
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO ;
+#endif
+}
+
+/**
+ * connectToServer
+ */
+bool CpThemeClientPrivate::connectToServer()
+{
+ localSocket->connectToServer(THEME_SERVER_NAME);
+ // This logic needs to be improved
+ bool success = localSocket->waitForConnected( WAIT_TIME_TO_CONNECT_TO_SERVER );
+
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO << "Socket Connect status: " << success;
+#endif
+
+// Stub shouldn't try starting the theme server yet again.
+#if 0
+ if(!success) {
+ QProcess *newProcess = new QProcess();
+ newProcess->start(SERVERFILEPATH);
+ success = newProcess->waitForStarted( WAIT_TIME_TO_START_SERVER );
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO << "Server Start Status: " << success << "Error = " << newProcess->error ();
+#endif
+
+ // If server started
+ if (success) {
+ // ToDo: This is to wait for server to start running. Logic needs to be improved.
+ newProcess->waitForFinished(3000);
+#ifdef THEME_SERVER_TRACES
+ qDebug() <<Q_FUNC_INFO<< " Server Start Wait is over" ;
+#endif
+ localSocket->connectToServer(THEME_SERVER_NAME);
+ success = localSocket->waitForConnected();
+#ifdef THEME_SERVER_TRACES
+ qDebug() <<Q_FUNC_INFO<< "socketconnected : "<<success;
+#endif
+ }
+ }
+#endif
+ if (success) {
+ connect(localSocket, SIGNAL(readyRead()), this, SLOT(themeChanged()));
+ }
+ return clientConnected = success;
+}
+
+/**
+ * isConnected
+ */
+bool CpThemeClientPrivate::isConnected()
+{
+ return clientConnected;
+}
+
+/**
+ * Destructor
+ */
+CpThemeClientPrivate::~CpThemeClientPrivate()
+{
+ localSocket->disconnectFromServer();
+ delete localSocket;
+}
+
+/**
+ * CpThemeClientPrivate::themeChanged()
+ */
+void CpThemeClientPrivate::themeChanged()
+{
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO;
+#endif
+
+ QByteArray inputByteArray = localSocket->readAll();
+ QDataStream inputDataStream(inputByteArray);
+ int request;
+ inputDataStream >> request;
+
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO << "recognizer: "<<request;
+#endif
+
+ if(EThemeSelection==request) {
+ QString themeName;
+ handleThemeChangeRequest(inputDataStream);
+ }
+#if 0
+ // TODO determine if we need this for the control panel app
+ if(EThemeContentUpdate == request) {
+ hbInstance->theme()->d_ptr->clearCache();
+ }
+#endif
+}
+
+/**
+ * CpThemeClientPrivate::handleThemeChangeRequest()
+ */
+void CpThemeClientPrivate::handleThemeChangeRequest(QDataStream &dataStream)
+{
+ QString themeName;
+ dataStream >> themeName;
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO <<"themeName is : " <<themeName;
+#endif
+
+ if(!(hbInstance->theme()->name() == themeName)) {
+#ifdef THEME_SERVER_TRACES
+ qDebug() << Q_FUNC_INFO <<"themeChanged(): called";
+#endif
+#if 0
+ // TODO determine if we need this for the control panel app
+ hbInstance->theme()->d_ptr->handleThemeChange();
+#endif
+ }
+}
+
+/**
+ * changeTheme
+ */
+bool CpThemeClientPrivate::changeTheme(const QString &newTheme)
+{
+#ifdef THEME_CHANGER_TRACES
+ qDebug() <<"ThemeClientQt::changeTheme("<<newTheme<<") called";
+#endif
+ if( (themeName==newTheme) || (newTheme.isEmpty()) ) {
+#ifdef THEME_CHANGER_TRACES
+ qDebug() <<"ThemeClientQt:: return Sametheme applied";
+#endif
+ return false;
+ }
+ QByteArray outputByteArray;
+ QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly);
+ ThemeServerRequest requestType = EThemeSelection;
+ outputDataStream << (int)requestType;
+ outputDataStream << newTheme;
+ themeName = newTheme;
+ int expected = outputByteArray.size();
+ int count = localSocket->write(outputByteArray);
+#ifdef THEME_CHANGER_TRACES
+ qDebug()<<"ThemeClientQt::ThemeName written to server";
+#endif
+ localSocket->flush();
+ return count == expected;
+}
+
+
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclientqt_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef CPTHEMECLIENTQT_P_H
+#define CPTHEMECLIENTQT_P_H
+
+#include <QIcon>
+#include "cpthemecommon_p.h"
+
+class QString;
+class QSizeF;
+class QLocalSocket;
+
+class CpThemeClientPrivate : public QObject
+{
+ Q_OBJECT
+
+public:
+ CpThemeClientPrivate();
+ bool connectToServer();
+ bool isConnected();
+
+ bool changeTheme(const QString& newtheme);
+
+ ~CpThemeClientPrivate();
+
+public slots:
+ void themeChanged();
+
+public:
+ bool clientConnected;
+
+private:
+ void handleThemeChangeRequest(QDataStream &dataStream);
+
+private:
+ QLocalSocket* localSocket;
+ QString themeName;
+};
+
+#endif // HBTHEMECLIENTQT_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#include "cpthemeclientsymbian_p.h"
+#include "cpthemesymbiancommon_p.h"
+
+#include <QFile>
+#include <QDebug>
+#include <QTime>
+
+const TUint KDefaultMessageSlots = 4;
+
+/**
+* constructor
+*/
+CpThemeClientPrivate::CpThemeClientPrivate():
+ clientConnected(false)
+{
+}
+
+/**
+* CpThemeClientPrivate::connectToServer()
+*
+* Connects to the server
+*/
+bool CpThemeClientPrivate::connectToServer()
+{
+
+ TInt error;
+
+ error = CreateSession(KThemeServerName, Version(), KDefaultMessageSlots);
+ return( clientConnected = (KErrNone == error ) );
+}
+
+/**
+Indicates a connection to the server
+*/
+bool CpThemeClientPrivate::isConnected()
+{
+ return connected;
+}
+
+
+
+/**
+Returns the version number
+*/
+TVersion CpThemeClientPrivate::Version(void) const
+{
+ return(TVersion(KThemeServerMajorVersionNumber,
+ KThemeServerMinorVersionNumber,
+ KThemeServerBuildVersionNumber));
+}
+
+/**
+ * Destructor
+ */
+CpThemeClientPrivate::~CpThemeClientPrivate()
+{
+ RSessionBase::Close();
+}
+
+/**
+ * StartServer
+ */
+TInt CpThemeClientPrivate::StartServer()
+{
+ TFindServer findThemeServer(KThemeServerName);
+ TFullName name;
+ if ( KErrNone == findThemeServer.Next( name ) ) {
+ // Server already running
+ return KErrNone;
+ }
+ return CreateServerProcess();
+}
+
+/**
+ * CreateServerProcess
+ */
+TInt CpThemeClientPrivate::CreateServerProcess()
+{
+ TInt result;
+ const TUid KServerUid2={0x100039CE};
+ const TUidType serverUid( KNullUid, KServerUid2, KServerUid3 );
+ RProcess server;
+ _LIT(KThemeServerExe,"hbthemeserver.exe");
+
+ result = server.Create( KThemeServerExe, KNullDesC, EOwnerProcess );
+
+ if (KErrNone != result) {
+ return result;
+ }
+ else {
+ TRequestStatus status;
+ server.Rendezvous(status);
+ if (status!=KRequestPending) {
+ server.Kill(0); // abort startup
+ }
+ else {
+ server.Resume(); // logon OK - start the server
+ }
+ User::WaitForRequest(status);// wait for start or death
+ server.Close();
+ connected == status.Int() == KErrNone ? true : false;
+ return status.Int(); // return the error
+ }
+}
+
+/**
+ * changeTheme
+ */
+bool CpThemeClientPrivate::changeTheme(const QString& aString )
+{
+ TPtrC themeName(reinterpret_cast<const TUint16 *>(aString.constData()));
+ TIpcArgs args(&themeName);
+ TInt err = SendReceive(EThemeSelection, args);
+ return KErrNone == err;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef CPTHEMECLIENTSYMBIAN_P_H
+#define CPTHEMECLIENTSYMBIAN_P_H
+
+
+#include <QIcon>
+// TODO Do we need this?
+//#include "hbthemecommon_p.h"
+//ToDo: replace this with forward declaration
+#if !defined(__E32BASE_H__)
+#include <e32base.h>
+#endif
+
+class CThemeListenerPrivate;
+class QSizeF;
+class HbEffectFxmlData;
+struct MeshItem;
+
+class CpThemeClientPrivate : public RSessionBase
+{
+public:
+ CpThemeClientPrivate();
+
+ bool connectToServer();
+ bool isConnected();
+
+ bool changeTheme(const QString& newtheme);
+ ~CpThemeClientPrivate();
+
+public:
+ bool clientConnected;
+
+private:
+ TVersion Version() const;
+ TInt StartServer();
+ TInt CreateServerProcess();
+
+private:
+ CThemeListenerPrivate *themelistener;
+ QString themeName;
+ bool connected;
+};
+
+#endif /* CPTHEMECLIENTSYMBIAN_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemecommon_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,197 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef HBTHEMECOMMON_P_H
+#define HBTHEMECOMMON_P_H
+
+#include <QImage>
+#include <QSize>
+#include <QStringList>
+#include <QColor>
+
+#define THEME_SERVER_NAME "hbthemeserver"
+#define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk"
+#define ORGANIZATION "Nokia"
+#define THEME_COMPONENT "ThemeFramework"
+
+// To enable/disable debug messages for theme server functionality
+#undef THEME_SERVER_TRACES
+
+// To enable fute testing for cache
+//#define HB_ICON_CACHE_DEBUG
+struct MultiPartSizeData
+{
+ // Indexing order is:
+
+ // 'NinePieces' -> tl, t, tr, l, c, r, bl, b, br
+ // 'ThreePiecesHorizontal' -> l, c, r
+ // 'ThreePiecesVertical' -> t, c, b
+ QString multiPartIconId;
+ QRect sources[9]; // rects used from the rasterized frame part pixmaps
+ QRect targets[9]; // frame part target rects inside the bounding rectangle of the frame
+ QSize pixmapSizes[9]; // frame part pixmaps are rasterized to these sizes
+};
+
+
+struct HbMultiIconParams
+{
+ QString multiPartIconId;
+ QStringList multiPartIconList;
+ MultiPartSizeData multiPartIconData;
+ QSizeF size;
+ int aspectRatioMode;
+ int mode;
+ int options;
+ bool mirrored;
+ QColor color;
+ int rgba;
+ bool colorflag;
+};
+
+
+enum IconFormatType {
+ INVALID_FORMAT = -1,
+ NVG,
+ PIC,
+ SVG,
+ BLOB,
+ OTHER_SUPPORTED_FORMATS
+};
+
+struct HbSharedPixmapInfo
+{
+ int offset;
+ int width;
+ int height;
+ int defaultWidth;
+ int defaultHeight;
+ QImage::Format format;
+};
+
+struct HbSharedNVGInfo
+{
+ int offset;
+ int dataSize;
+ int width;
+ int height;
+ int defaultWidth;
+ int defaultHeight;
+
+};
+
+struct HbSharedPICInfo
+{
+ int offset;
+ int dataSize;
+ int width;
+ int height;
+ int defaultWidth;
+ int defaultHeight;
+};
+
+struct HbSharedBLOBInfo
+{
+ int offset;
+ int dataSize;
+};
+
+struct HbSharedIconInfo
+{
+ IconFormatType type;
+
+ union
+ {
+ HbSharedPixmapInfo pixmapData;
+ HbSharedNVGInfo nvgData;
+ HbSharedPICInfo picData;
+ HbSharedBLOBInfo blobData;
+ };
+
+};
+
+struct HbSharedStyleSheetInfo
+{
+ int offset;
+ int refCount;
+ HbSharedStyleSheetInfo():
+ offset(-1),
+ refCount(0)
+ {}
+};
+
+struct HbSharedEffectInfo
+{
+ int offset;
+ HbSharedEffectInfo(): offset(-1){}
+};
+
+struct HbSharedWMLInfo
+{
+ int offset;
+ HbSharedWMLInfo() : offset(-1) {}
+};
+
+struct HbDeviceProfileInfo
+{
+ int offset;
+ HbDeviceProfileInfo() : offset(-1) {}
+};
+
+// Function codes (opcodes) used in message passing between client and server
+enum ThemeServerRequest
+ {
+ EIconLookup = 1,
+ EIconDefaultSize,
+ EStyleSheetLookup,
+ EThemeSelection,
+ EMultiPieceIcon,
+ EWidgetMLLookup,
+ EDeviceProfileOffset,
+ #ifdef HB_ICON_CACHE_DEBUG
+ EIconCleanUp,
+ ECacheIconCount,
+ ERasterMemLimit,
+ EVectorMemLimit,
+ EFreeRasterMem,
+ EFreeVectorMem,
+ ELastAddedItemMem,
+ ELastAddedItemRefCount,
+ ELastRemovedItemMem,
+ ELastRemovedItemRefCount,
+ EEnableCache,
+ ECacheHit,
+ ECacheMiss,
+ ECleanRasterLRUList,
+ ECleanVectorLRUList,
+ EServerHeap,
+ EGpuLruCount,
+ ECpuLruCount,
+ EServerStat,
+ EServerHeapMarkStart,
+ EServerHeapMarkEnd,
+ EServerAllocFail,
+ EServerAllocReset,
+ #endif
+ EThemeContentUpdate,
+ EEffectLookupFilePath,
+ EEffectAdd,
+ EUnloadIcon,
+ EThemeServerStop
+ };
+
+#endif /* HBTHEMECOMMON_P_H */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,241 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+/*!
+ \class CpThemeControl
+ \brief CpThemeControl creates and controls two views for Theme Changer plugin and handles
+ user interaction to preview and change the themes.
+
+ It creates a list view of the themes. When a list item is selected, it creates a preview
+ of the theme icon using a CpThemePreview class.
+
+ This class also connects to the theme server using the HbThemeChanger and sets the theme
+ based on user interaction with the views.
+
+ */
+
+#include <QString>
+#include <QModelIndex>
+#include <QStandardItemModel>
+#include <QStandardItem>
+#include <QTranslator>
+
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include "cpthemechanger.h"
+
+#include "cpthemecontrol.h"
+#include "cpthemelistview.h"
+#include "cpthemepreview.h"
+
+static const QString KPlaceholderPreview = ":/image/themePreview.svg";
+
+/*!
+ Helper function to fetch the main window.
+*/
+
+static HbMainWindow *mainWindow()
+{
+ QList< HbMainWindow* > mainWindows = hbInstance->allMainWindows();
+ if (!mainWindows.isEmpty()) {
+ return mainWindows.front();
+ }
+ return 0;
+}
+
+/*!
+ constructor.
+*/
+CpThemeControl::CpThemeControl(): mThemeListView(0),
+ mThemePreview(0),
+ mThemeChanger(0),
+ mListModel(0)
+{
+ mThemeChanger = new CpThemeChanger();
+
+
+ QTranslator *translator = new QTranslator(this);
+ QString lang = QLocale::system().name();
+ QString path = "Z:/resource/qt/translations/";
+ translator->load("control_panel_" + lang, path);
+ qApp->installTranslator(translator);
+
+}
+
+
+
+/*!
+ destorys the list view, preview and theme changer objects.
+*/
+CpThemeControl::~CpThemeControl()
+{
+ delete mThemeListView;
+ mThemeListView = 0;
+
+ delete mThemeChanger;
+ mThemeChanger = 0;
+
+ delete mThemePreview;
+ mThemePreview = 0;
+}
+
+/*!
+ Creates the theme list view. Gets the themes, creates a model based on
+ theme names, icons, and icon paths and sets the list model.
+*/
+void CpThemeControl::createThemeList()
+{
+
+ mThemeListView = new CpThemeListView();
+
+ mListModel = &mThemeChanger->model();
+
+ // Set the model for theme list.
+ mThemeListView->setModel(mListModel);
+
+ //connect to signal for selecting a list item.
+ connect(mThemeListView,SIGNAL(newThemeSelected(const QModelIndex&)),
+ this,SLOT(newThemeSelected(const QModelIndex&)));
+
+ //handle signal for list view closing. (e.g Back softkey pressed)
+ connect(mThemeListView,SIGNAL(aboutToClose()),
+ this,SLOT(themeListClosed()));
+}
+
+/*!
+ returns the instance of themelist view. Used by control panel to set
+ the view.
+*/
+CpBaseSettingView* CpThemeControl::themeListView()
+{
+ //If the view was removed before by control panel app, create it again.
+ if(!mThemeListView)
+ createThemeList();
+
+ return mThemeListView;
+}
+
+/*!
+ returns the name of the current theme.
+*/
+QString CpThemeControl::currentThemeName() const
+{
+ return mThemeChanger->currentTheme().name;
+}
+
+/*!
+ returns the repersenatative icon of the current theme.
+*/
+HbIcon CpThemeControl::currentThemeIcon() const
+{
+ return mThemeChanger->currentTheme().icon;
+}
+
+/*!
+ Slot called when a list item of the theme list is selected.
+*/
+void CpThemeControl::newThemeSelected(const QModelIndex& index)
+{
+ if(!index.isValid()) {
+ return;
+ }
+
+ CpThemeChanger::ThemeInfo themeInfo = mThemeChanger->themes().at(index.row());
+
+ //Set up the theme preview and set it to
+ //the current view of main window.
+ HbMainWindow* mWindow = ::mainWindow();
+
+ if(!mThemePreview){
+ mThemePreview = new CpThemePreview(themeInfo);
+ mWindow->addView(mThemePreview);
+
+ connect(mThemePreview,SIGNAL(aboutToClose()),
+ this, SLOT(previewClosed()));
+
+ connect(mThemePreview, SIGNAL(applyTheme(const QString&)),
+ this, SLOT(themeApplied(const QString&)));
+ } else {
+ mThemePreview->setThemeInfo(themeInfo);
+ }
+ //TODO: use qtTrId(text_id).
+ mThemePreview->setTitle(tr("Control Panel"));
+
+ mWindow->setCurrentView(mThemePreview);
+
+}
+
+/*!
+ Slot called when a Select key is pressed in theme preview view.
+*/
+void CpThemeControl::themeApplied(const QString& theme)
+{
+ bool success = false;
+
+ success = mThemeChanger->connectToServer();
+
+ if (success) {
+ mThemeChanger->changeTheme(theme);
+ emit themeUpdated(mThemeChanger->currentTheme().name, mThemeChanger->currentTheme().icon);
+ }
+
+ //Go back to control panel view. Close theme preview.
+ previewClosed();
+ //ask the themelistview to close. Control Panel will
+ //take care of removing it from window.
+ triggerThemeListClose();
+
+}
+/*!
+ Slot called when the theme preview view is closed.
+*/
+void CpThemeControl::previewClosed()
+{
+ //The theme preview closed, go back
+ //to theme list view.
+ HbMainWindow* mainWindow = ::mainWindow();
+ mainWindow->removeView(mThemePreview);
+ mThemePreview->deleteLater();
+ mThemePreview = 0;
+
+ mainWindow->setCurrentView(mThemeListView);
+}
+
+/*!
+ Slot for when the theme list view is closed. Ownership of the theme list was given to
+ control panel, so the class won't delete it.
+
+*/
+void CpThemeControl::themeListClosed()
+{
+ mThemeListView = 0;
+
+ delete mThemePreview;
+ mThemePreview = 0;
+}
+
+/*!
+ asks the theme list view to close.
+*/
+void CpThemeControl::triggerThemeListClose()
+{
+ mThemeListView->closeView();
+}
+
+
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CPTHEMECONTROL_H
+#define CPTHEMECONTROL_H
+
+#include <QObject>
+#include <QList>
+
+#include "cpthemechanger.h"
+#include <hbicon.h>
+
+QT_BEGIN_NAMESPACE
+class QModelIndex;
+class QString;
+class QStandardItemModel;
+QT_END_NAMESPACE
+
+class CpThemeListView;
+class CpThemePreview;
+class CpBaseSettingView;
+
+
+
+class CpThemeControl : public QObject
+{
+ Q_OBJECT
+
+public:
+ CpThemeControl();
+ ~CpThemeControl();
+ CpBaseSettingView* themeListView();
+ QString currentThemeName() const;
+ HbIcon currentThemeIcon() const;
+
+signals:
+ void themeUpdated(const QString& themeName, const HbIcon& icon);
+
+public slots:
+ void newThemeSelected(const QModelIndex& index);
+ void previewClosed();
+ void themeApplied(const QString& theme);
+ void themeListClosed();
+
+private:
+ void createThemeList();
+ void triggerThemeListClose();
+
+private:
+ CpThemeListView* mThemeListView;
+ CpThemePreview* mThemePreview;
+ CpThemeChanger* mThemeChanger;
+ QAbstractItemModel* mListModel;
+};
+
+#endif //CPTHEMECONTROL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+
+#include <QGraphicsLinearLayout>
+#include <QModelIndex>
+
+#include <hbview>
+#include <hblabel.h>
+#include <hblistview.h>
+
+#include "cpthemelistview.h"
+
+/*!
+ \class CpThemeListView
+ \brief CpThemeListView displays a heading (Select theme) and a list of themes with
+ corresponding icons.
+
+ Note: This class is a subclass of CpBaseSettingView for compatibility with Control Panel
+ framework. However, it does not use HbDataForm as its widget and as its parent does, so
+ it uses SetWidget to set the listview to its widget instead of an HbDataForm.
+ */
+
+/*!
+ constructor. Creates the heading label and the list and adds it to layout.
+*/
+CpThemeListView::CpThemeListView(QGraphicsItem *parent) : CpBaseSettingView(0, parent),
+ mThemeList(new HbListView(this))
+{
+
+ //Create a layout with a heading "Select theme" at top and the list below it.
+ HbWidget* contentWidget = new HbWidget(this);
+ QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+
+
+ //setup the heading.
+ HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget);
+ label->setFontSpec(HbFontSpec(HbFontSpec::Primary));
+ layout->addItem(label);
+
+ connect(mThemeList, SIGNAL(activated(const QModelIndex&)),
+ this, SIGNAL(newThemeSelected(const QModelIndex&)));
+
+ //add the list to layout.
+ layout->addItem(mThemeList);
+
+ contentWidget->setLayout(layout);
+
+ setWidget(contentWidget);
+}
+
+/*!
+ destructor.
+*/
+CpThemeListView::~CpThemeListView()
+{
+}
+
+/*!
+ returns the listview instance (list of themes).
+*/
+HbListView* CpThemeListView::themeList() const
+{
+ return mThemeList;
+}
+
+/*!
+ Sets the model of its listView.
+*/
+void CpThemeListView::setModel(QAbstractItemModel* model)
+{
+ mThemeList->setModel(model);
+}
+
+/*!
+ sets the widget. Reimplementation from HbView.
+*/
+void CpThemeListView::setWidget(QGraphicsWidget *widget)
+{
+ HbView::setWidget(widget);
+}
+
+/*!
+ emits aboutToClose() signal.
+*/
+void CpThemeListView::closeView()
+{
+ emit aboutToClose();
+}
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemelistview.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#ifndef CPTHEMELISTVIEW_H
+#define CPTHEMELISTVIEW_H
+
+#include <QAbstractItemModel>
+
+#include <hbview.h>
+#include <hblistview.h>
+
+#include <cpbasesettingview.h>
+
+
+class CpThemeSelectionList;
+
+class CpThemeListView : public CpBaseSettingView
+{
+ Q_OBJECT
+
+public:
+ CpThemeListView(QGraphicsItem *parent = 0);
+ ~CpThemeListView();
+ void setWidget(QGraphicsWidget *widget);
+ HbListView* themeList() const;
+ void setModel(QAbstractItemModel* model);
+ void closeView();
+
+signals:
+ void newThemeSelected(const QModelIndex& index);
+
+private:
+ HbListView* mThemeList;
+
+};
+
+#endif //CPTHEMELISTVIEW_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeplugin.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#include "cpthemeplugin.h"
+#include "cpthemepluginentryitemdata.h"
+
+/*!
+ \class CpThemePlugin
+ \brief CpThemePlugin is a control panel plugin that allows a user to view available themes and
+ change the current theme of the phone.
+
+*/
+
+/*!
+ constructor.
+*/
+CpThemePlugin::CpThemePlugin()
+{
+}
+
+/*!
+ destructor.
+*/
+CpThemePlugin::~CpThemePlugin()
+{
+}
+
+/*!
+ create the control panel entry item data for Theme settins.
+*/
+CpSettingFormItemData *CpThemePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
+{
+
+ //create a cpthemepluginentryitemdata with default values and return it.
+ CpSettingFormEntryItemData *entryItem = new CpThemePluginEntryItemData(
+ itemDataHelper,
+ tr("Theme"),
+ tr("Theme Name"),
+ HbIcon(":/image/qgn_menu_note.svg"));
+ return entryItem;
+}
+
+Q_EXPORT_PLUGIN2(cpthemeplugin, CpThemePlugin);
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeplugin.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CPTHEMEPLUGIN_H
+#define CPTHEMEPLUGIN_H
+
+#include <qobject.h>
+#include <cppluginplatinterface.h>
+
+class CpThemePlugin : public QObject, public CpPluginPlatInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(CpPluginPlatInterface)
+public:
+ CpThemePlugin();
+ virtual ~CpThemePlugin();
+ virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const;
+};
+
+#endif //CPTHEMEPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <hbdataform>
+#include <hbiconitem>
+
+#include <cpbasesettingview.h>
+#include "cpthemecontrol.h"
+#include "cpthemepluginentryitemdata.h"
+#include <cpitemdatahelper.h>
+
+/*!
+ \class CpThemePluginEntryItemData
+ \brief CpThemePluginEntryItemData is the entry item view for Theme Changer plugin. It displays a title "Theme",
+ the name of current theme and the preview icon of the current theme.
+
+*/
+
+/*!
+ constructor.
+*/
+CpThemePluginEntryItemData::CpThemePluginEntryItemData(CpItemDataHelper &itemDataHelper,
+ const QString &text,
+ const QString &description,
+ const HbIcon &icon,
+ const HbDataFormModelItem *parent) :
+ CpSettingFormEntryItemData(itemDataHelper,
+ text,
+ description,
+ icon,
+ parent)
+{
+ //Create a CpThemeControl. the themeControl takes care of displaying the themes
+ //and letting user select a theme and apply a theme change.
+ mThemeControl = new CpThemeControl();
+
+ setEntryItemIcon(mThemeControl->currentThemeIcon());
+ setDescription(mThemeControl->currentThemeName());
+
+ //connect to signal to update the current theme name and icon whenever the theme changes.
+ QObject::connect(mThemeControl, SIGNAL(themeUpdated(const QString&, const HbIcon&)), this,
+ SLOT(themeUpdated(const QString&, const HbIcon&)));
+}
+
+/*!
+ destructor.
+*/
+CpThemePluginEntryItemData::~CpThemePluginEntryItemData()
+{
+ delete mThemeControl;
+ mThemeControl = 0;
+}
+
+/*!
+ Slot used for updating entry item's description and icon with current theme name and its
+ preview icon.
+ */
+void CpThemePluginEntryItemData::themeUpdated(const QString& themeName, const HbIcon& icon)
+{
+ setEntryItemIcon(icon);
+ setDescription(themeName);
+}
+
+/*!
+ Return the theme changer UI view. Returns 0 if it can't create
+ the view.
+*/
+CpBaseSettingView *CpThemePluginEntryItemData::createSettingView() const
+{
+ if(mThemeControl) {
+ CpBaseSettingView *view = mThemeControl->themeListView();
+ return view;
+ }
+
+ return 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CPTHEMEPLUGINENTRYITEMDATA_H
+#define CPTHEMEPLUGINENTRYITEMDATA_H
+
+#include <QObject>
+#include <cpsettingformentryitemdata.h>
+
+class CpThemeControl;
+
+class CpThemePluginEntryItemData : public CpSettingFormEntryItemData
+{
+ Q_OBJECT
+
+public:
+ explicit CpThemePluginEntryItemData(CpItemDataHelper &itemDataHelper,
+ const QString &text = QString(),
+ const QString &description = QString(),
+ const HbIcon &icon = HbIcon(),
+ const HbDataFormModelItem *parent = 0);
+ virtual ~CpThemePluginEntryItemData();
+
+private slots:
+ void themeUpdated(const QString& themeName, const HbIcon& icon);
+private:
+ CpThemeControl* mThemeControl;
+ virtual CpBaseSettingView *createSettingView() const;
+
+};
+
+#endif //CPTHEMEPLUGINENTRYITEMDATA_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include <QString>
+#include <QGraphicsPixmapItem>
+#include <QGraphicsLinearLayout>
+
+#include <hbaction>
+#include <hbtoolbar>
+#include <hbicon.h>
+#include <hbaction.h>
+#include <hblabel.h>
+#include <hbiconitem.h>
+
+#include "cpthemepreview.h"
+
+/*!
+ \class CpThemePreview
+ \brief CpThemePreview shows a preview of a selected theme with a heading displaying the name of the theme as well as
+ a toolbar with Select and Cancel buttons. This view is used for the user to either select the theme and apply
+ the theme change or press Cancel and go back to theme list view.
+*/
+
+/*!
+ constructor.
+*/
+CpThemePreview::CpThemePreview(const CpThemeChanger::ThemeInfo& theme, QGraphicsItem *parent) :
+ HbView(parent),
+ mTheme(theme),
+ mSoftKeyBackAction(0)
+{
+
+ //Create the layout and add heading and and preview icon to the layout.
+ QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
+
+
+ //setup the heading.
+ //TODO: translation of string hbTrId("txt_cp_title_preview_1")
+
+ QString themeHeading = tr("Preview: ") + mTheme.name;
+ HbLabel* label = new HbLabel(themeHeading, this);
+ label->setFontSpec(HbFontSpec(HbFontSpec::Primary));
+
+ layout->addItem(label);
+
+ //Create the toolbar and "Select" and "Cancel" actions.
+ HbToolBar* mToolBar = new HbToolBar(this);
+
+ HbAction* selectAction = new HbAction(tr("Select"));
+
+ //Add Action to the toolbar and show toolbar
+ mToolBar->addAction( selectAction );
+
+ HbAction* cancelAction = new HbAction(tr("Cancel"));
+ mToolBar->addAction( cancelAction );
+
+ QObject::connect( selectAction, SIGNAL(triggered()),
+ this, SLOT(themeSelected()));
+
+ QObject::connect( cancelAction, SIGNAL(triggered()),
+ this, SIGNAL(aboutToClose()));
+
+ //layout->addItem(&HbIconItem(mTheme.icon, this ));
+ HbIconItem* layoutItem = new HbIconItem(mTheme.icon, this);
+ layout->addItem(layoutItem);
+ setToolBar(mToolBar);
+ setLayout(layout);
+
+ //Setup the Back button action and set softkey. Back button
+ //takes the user to the theme list view.
+ mSoftKeyBackAction = new HbAction(Hb::BackAction, this);
+ QObject::connect(mSoftKeyBackAction, SIGNAL(triggered()),
+ this, SIGNAL(aboutToClose()) );
+
+ this->setNavigationAction(mSoftKeyBackAction);
+}
+
+/*!
+ destructor.
+*/
+CpThemePreview::~CpThemePreview()
+{
+}
+
+/*!
+ sets the theme to \a theme.
+*/
+void CpThemePreview::setThemeInfo(const CpThemeChanger::ThemeInfo& theme)
+{
+ mTheme = theme;
+}
+
+/*!
+ returns the themeName.
+*/
+const QString& CpThemePreview::themeName() const
+{
+ return mTheme.name;
+}
+
+/*!
+ returns the repersentative themeIcon of the current theme.
+*/
+const HbIcon& CpThemePreview::themeIcon() const
+{
+ return mTheme.icon;
+}
+
+/*!
+ Slot to handle when the user selects a theme.
+*/
+void CpThemePreview::themeSelected()
+{
+ emit applyTheme(mTheme.name);
+}
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemepreview.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef CPTHEMEPREVIEW_H
+#define CPTHEMEPREVIEW_H
+
+#include <hbview.h>
+#include <QObject>
+#include <hbicon.h>
+#include <cpthemechanger.h>
+
+QT_BEGIN_NAMESPACE
+class QString;
+QT_END_NAMESPACE
+
+class HbAction;
+class HbMainWindow;
+class HbIconItem;
+
+class CpThemePreview : public HbView
+{
+ Q_OBJECT
+
+public:
+ explicit CpThemePreview(const CpThemeChanger::ThemeInfo &theme, QGraphicsItem *parent = 0);
+ ~CpThemePreview();
+ void setThemeInfo(const CpThemeChanger::ThemeInfo& theme);
+ const QString& themeName() const;
+ const HbIcon& themeIcon() const;
+
+signals:
+ void applyTheme(const QString&);
+ void aboutToClose();
+
+public slots:
+ void themeSelected();
+
+private:
+ CpThemeChanger::ThemeInfo mTheme;
+ HbAction* mSoftKeyBackAction;
+};
+
+#endif //CPTHEMEPREVIEW_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemesymbiancommon_p.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,70 @@
+/*
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+#ifndef HBTHEMESYMBIANCOMMON_P_H
+#define HBTHEMESYMBIANCOMMON_P_H
+
+#include <e32base.h>
+#include "cpthemecommon_p.h"
+struct TIconParams
+{
+ TBuf<256> fileName;
+ TReal width;
+ TReal height;
+ TUint8 aspectRatioMode;
+ TUint8 mode;
+ TUint8 options;
+ TBool mirrored;
+ TUint32 rgba;
+ TBool colorflag;
+ };
+
+struct TMultiIconSymbParams
+{
+ TBuf<256> multiPartIconId;
+ TBuf<256> multiPartIconList[9];
+ TRect sources[9];
+ TRect targets[9];
+ TSize pixmapSizes[9];
+ QSizeF size;
+ TInt aspectRatioMode;
+ TInt mode;
+ TInt options;
+ TBool mirrored;
+ TInt rgba;
+ TBool colorflag;
+ };
+
+// server name
+_LIT(KThemeServerName,"hbthemeserver");
+const TUid KServerUid3={0x20022E82};
+
+// A version must be specifyed when creating a session with the server
+
+
+const TUint KThemeServerMajorVersionNumber=0;
+const TUint KThemeServerMinorVersionNumber=1;
+const TUint KThemeServerBuildVersionNumber=1;
+
+enum TThemeServerLeave
+{
+ ENonNumericString = 99
+};
+
+#endif // HBTHEMESYMBIANCOMMON_P_H
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/themeplugin.pri Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,52 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: cpthemeplugin source files
+#
+
+# Input
+HEADERS += src/cpthemepreview.h \
+ src/cpthemecontrol.h \
+ src/cpthemeplugin.h \
+ src/cpthemelistview.h \
+ src/cpthemepluginentryitemdata.h
+
+SOURCES += src/cpthemepreview.cpp \
+ src/cpthemecontrol.cpp \
+ src/cpthemeplugin.cpp \
+ src/cpthemelistview.cpp \
+ src/cpthemepluginentryitemdata.cpp
+
+# Remove once this goes into Hb.
+HEADERS += src/cpthemechanger.h \
+ src/cpthemeclient_p.h \
+ src/cpthemecommon_p.h \
+ src/cpthemechanger_p.h
+
+# Remove once this goes into Hb.
+SOURCES += src/cpthemechanger.cpp \
+ src/cpthemechanger_p.cpp \
+ src/cpthemeclient_p.cpp
+
+# Remove once this goes into Hb.
+win32|mac {
+ HEADERS += src/cpthemeclientqt_p.h
+ SOURCES += src/cpthemeclientqt_p.cpp
+}
+
+# Remove once this goes into Hb.
+symbian {
+ HEADERS += src/cpthemeclientsymbian_p.h \
+ src/cpthemesymbiancommon_p.h
+ SOURCES += src/cpthemeclientsymbian_p.cpp
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/themeplugin.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,95 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = lib
+TARGET = cpthemeplugin
+
+CONFIG += hb plugin
+
+LIBS += -lcpframework
+TRANSLATIONS = control_panel.ts
+
+CONFIG += debug_and_release
+RESOURCES += themeplugin.qrc
+
+include (themeplugin.pri)
+include (rom/themeplugin_rom.pri)
+
+MOC_DIR = moc
+OBJECT_DIR = obj
+RCC_DIR = rcc
+
+# On win32 and mac, debug and release libraries are named differently.
+# We must follow the debug and release settings Qt was compiled with:
+# build debug iff Qt built debug, build release iff Qt built release.
+
+win32|mac {
+ !contains(QT_CONFIG,debug)|!contains(QT_CONFIG,release) {
+ CONFIG -= debug_and_release debug release
+ contains(QT_CONFIG,debug): CONFIG+=debug
+ contains(QT_CONFIG,release):CONFIG+=release
+ }
+}
+
+CONFIG(debug, debug|release) {
+ SUBDIRPART = debug
+} else {
+ SUBDIRPART = release
+}
+
+win32 {
+ DESTDIR = C:/ControlPanel/$$SUBDIRPART/bin
+ OBJECTS_DIR = $$PWD/$$SUBDIRPART/tmp/$$TARGET
+ # add platfrom API for windows
+ INCLUDEPATH += $$PWD/../../../controlpanel_plat/inc
+}
+
+# Add the output dirs to the link path too
+LIBS += -L$$DESTDIR
+
+
+#For some reason the default include path doesn't include MOC_DIR on symbian
+symbian {
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ INCLUDEPATH += $$MOC_DIR
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.EPOCALLOWDLLDATA = 1
+ TARGET.UID3 = 0X2002C2F3
+}
+
+
+symbian: plugin { # copy qtstub and manifest
+
+ PLUGIN_STUB_PATH = /resource/qt/plugins/controlpanel
+
+ deploy.path = C:
+ pluginstub.sources = $${TARGET}.dll
+ pluginstub.path = $$PLUGIN_STUB_PATH
+ DEPLOYMENT += pluginstub
+
+ qtplugins.path = $$PLUGIN_STUB_PATH
+ qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+
+ for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)"
+}
+
+#symbian: INCLUDEPATH += /sf/mw/hb/include/hbservices \
+# /sf/mw/hb/include/hbservices/private \
+# /sf/mw/hb/include/hbcore \
+# /sf/mw/hb/include/hbcore/private
+#
+
+# End of file --Don't remove this.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/themeplugin.qrc Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,7 @@
+<RCC>
+ <qresource prefix="/" >
+ <file>image/qgn_menu_note.svg</file>
+ <file>image/themePreview.png</file>
+ <file>image/themePreview.svg</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/themeplugin.ts Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="3.0" language="en_GB" sourcelanguage="en_GB">
+<context>
+<message numerus="no" id="txt_cp_title_select_theme">
+ <comment>Select theme view title</comment>
+ <source>Select theme</source>
+ <translation variants="no">Select theme</translation>
+ <extra-loc-layout_id></extra-loc-layout_id>
+ <extra-loc-viewid>CP_04</extra-loc-viewid>
+ <extra-loc-positionid>subtitle</extra-loc-positionid>
+ <extra-loc-feature>CP</extra-loc-feature>
+ <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_cp_title_control_panel">
+ <comment>This is the view title, shown in all Control Panel views.</comment>
+ <source>Control Panel</source>
+ <translation variants="no">Control Panel</translation>
+ <extra-loc-layout_id>qtl_chrome_title</extra-loc-layout_id>
+ <extra-loc-viewid>CP_01</extra-loc-viewid>
+ <extra-loc-positionid>title</extra-loc-positionid>
+ <extra-loc-feature>CP</extra-loc-feature>
+ <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_cp_dblist_theme">
+ <comment>List item, opens Theme selector view</comment>
+ <source>Theme</source>
+ <translation variants="no">Theme</translation>
+ <extra-loc-layout_id>qtl_list_pri_large_graphic</extra-loc-layout_id>
+ <extra-loc-viewid>CP_01</extra-loc-viewid>
+ <extra-loc-positionid>list</extra-loc-positionid>
+ <extra-loc-feature>CP</extra-loc-feature>
+ <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_cp_title_preview_u">
+ <comment>Theme preview view title, where %1 is the name of the theme that is previewed</comment>
+ <source>Preview: %1</source>
+ <translation variants="no">Preview: %1</translation>
+ <extra-loc-layout_id></extra-loc-layout_id>
+ <extra-loc-viewid>CP_05</extra-loc-viewid>
+ <extra-loc-positionid>subtitle</extra-loc-positionid>
+ <extra-loc-feature>CP</extra-loc-feature>
+ <extra-loc-blank>False</extra-loc-blank>
+</message>
+</context>
+</TS>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/tsrc.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
+
+TEMPLATE = subdirs
+SUBDIRS += unit/unittest_cpthemecontrol
+SUBDIRS += unit/unittest_cpthemelistview
+SUBDIRS += unit/unittest_cpthemeplugin
+SUBDIRS += unit/unittest_cpthemepluginentryitemdata
+
+CONFIG += ordered
+test.depends = first
+test.CONFIG += recursive
+autotest.depends = first
+autotest.CONFIG += recursive
+QMAKE_EXTRA_TARGETS += test autotest
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/common.pri Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: Stuff for all unit tests
+#
+
+QT += testlib
+CONFIG += qtestlib hb
+
+
+win32 {
+ INCLUDEPATH += .
+ INCLUDEPATH += ../../../src/inc
+ INCLUDEPATH += ../../../src/cpframework/src
+ INCLUDEPATH += ../../../controlpanel_plat/inc
+}
+
+unix {
+ test.commands = ./$(TARGET)
+ autotest.commands = ./$(TARGET) -xml -o ../$(QMAKE_TARGET).xml
+} else:win32 {
+ test.CONFIG += recursive
+ autotest.CONFIG += recursive
+ build_pass {
+ test.commands =/epoc32/RELEASE/WINSCW/udeb/$(QMAKE_TARGET).exe
+ autotest.commands =/epoc32/RELEASE/WINSCW/udeb/$(QMAKE_TARGET).exe -xml -o c:/$(QMAKE_TARGET).xml
+ }
+}
+
+QMAKE_EXTRA_TARGETS += test autotest
+
+symbian {
+ INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ INCLUDEPATH += $$MOC_DIR
+ TARGET.CAPABILITY = ALL -TCB
+ TARGET.EPOCALLOWDLLDATA = 1
+}
+
+
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemecontrol/unittest_cpthemecontrol.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,148 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: XENT-MV
+*
+* Description: unit tests for the CpThemeControl class from themeplugin
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QModelIndex>
+#include <QSignalSpy>
+
+#include "cpthemechanger.h"
+#include "cpthemecontrol.h"
+#include "cpthemechanger.h"
+
+class TestCpThemeControl : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void init();
+
+ void testConstructor();
+ void testThemeListView();
+ void testCurrentThemeName();
+ void testCurrentThemeIcon();
+ void testNewThemeSelected();
+ void testPreviewClosed();
+ void testThemeApplied();
+ void testUpdateThemeList();
+
+ void cleanup();
+
+private:
+ CpThemeChanger* mThemeChanger;
+};
+
+// setup and cleanup
+void TestCpThemeControl::init()
+{
+ mThemeChanger = new CpThemeChanger();
+}
+
+void TestCpThemeControl::cleanup()
+{
+ delete mThemeChanger;
+}
+
+// verify that the constructor works and that the
+// defaults are sane.
+void TestCpThemeControl::testConstructor()
+{
+ CpThemeControl * control = new CpThemeControl();
+
+ QVERIFY(control !=0 );
+ QVERIFY(!control->currentThemeName().isEmpty());
+ QVERIFY(!control->currentThemeIcon().isEmpty());
+
+ delete control;
+}
+
+// verify that the themeListView doesn't return NULL (or crash)
+void TestCpThemeControl::testThemeListView()
+{
+ CpThemeControl control;
+
+ QVERIFY(control.themeListView() != 0);
+}
+
+// test that we get back a non-empty QString
+void TestCpThemeControl::testCurrentThemeName()
+{
+ CpThemeControl control;
+
+ QVERIFY((control.currentThemeName() == mThemeChanger->currentTheme())
+ || (control.currentThemeName() == QString("hbdefault")));
+}
+
+// test that we get a non-empty string for current theme icon
+void TestCpThemeControl::testCurrentThemeIcon()
+{
+ CpThemeControl control;
+
+ QVERIFY(!control.currentThemeIcon().isEmpty());
+}
+
+// NULL test there's no way to externally get the model the QModelIndex is based on
+void TestCpThemeControl::testNewThemeSelected()
+{
+ CpThemeControl control;
+
+ control.newThemeSelected(QModelIndex());
+
+}
+
+// NULL test - basically verifies that it doesn't burst into flames.
+void TestCpThemeControl::testPreviewClosed()
+{
+ CpThemeControl control;
+
+ control.previewClosed();
+
+}
+
+void TestCpThemeControl::testThemeApplied()
+{
+ CpThemeControl control;
+ QList<CpThemeChanger::ThemeInfo> themeList = mThemeChanger->themes();
+ QSignalSpy spy(&control, SIGNAL(themeUpdated(const QString&, const QString&)));
+ int expectedSignalCount = 0;
+
+ for (int i = 0; i < themeList.size(); ++i) {
+ CpThemeChanger::ThemeInfo info = themeList.at(i);
+ QString name = info.themeName;
+
+ if (control.currentThemeName() == mThemeChanger->currentTheme()) {
+ ++expectedSignalCount;
+ }
+
+ control.themeApplied(name);
+ QCOMPARE(control.currentThemeName(), mThemeChanger->currentTheme());
+
+ QCOMPARE(spy.count(),expectedSignalCount);
+ }
+}
+
+// NULL test - basically verifies that it doesn't burst into flames.
+void TestCpThemeControl::testUpdateThemeList()
+{
+ CpThemeControl control;
+
+ control.updateThemeList();
+}
+
+
+
+QTEST_MAIN(TestCpThemeControl)
+#include "unittest_cpthemecontrol.moc"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemecontrol/unittest_cpthemecontrol.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,54 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0".
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: unit tests for the cpthemecontrol class in the themeplugin.
+#
+#
+
+include(../common.pri)
+
+
+TEMPLATE = app
+TARGET = unittest_cpthemecontrol
+DEPENDPATH += .
+win32::DEPENDPATH += c:/ControlPanel/debug/bin
+
+INCLUDEPATH += .
+INCLUDEPATH += src/
+INCLUDEPATH += ../../../src
+
+LIBS += -lcpframework
+win32::LIBS += -LC:/ControlPanel/debug/bin
+
+symbian::TARGET.UID3=0x2002DD2A
+
+
+# Input
+
+HEADERS += ../../../src/cpthemecontrol.h
+HEADERS += ../../../src/cpthemechanger.h
+HEADERS += ../../../src/cpthemechanger_p.h
+HEADERS += ../../../src/cpthemeclient_p.h
+symbian::HEADERS += ../../../src/cpthemeclientsymbian_p.h
+win32::HEADERS += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.h
+HEADERS += ../../../src/cpthemelistview.h
+HEADERS += ../../../src/cpthemepreview.h
+SOURCES += unittest_cpthemecontrol.cpp
+SOURCES += ../../../src/cpthemecontrol.cpp
+SOURCES += ../../../src/cpthemechanger.cpp
+SOURCES += ../../../src/cpthemechanger_p.cpp
+SOURCES += ../../../src/cpthemeclient_p.cpp
+symbian::SOURCES += ../../../src/cpthemeclientsymbian_p.cpp
+win32::SOURCES += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.cpp
+SOURCES += ../../../src/cpthemelistview.cpp
+SOURCES += ../../../src/cpthemepreview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemelistview/unittest_cpthemelistview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: XENT-MV
+*
+* Description: unit tests for the CpThemeControl class from themeplugin
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QGraphicsWidget>
+#include <QStandardItemModel>
+
+#include "cpthemelistview.h"
+
+class TestCpThemeListView : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testConstructor();
+ void testSetWidget();
+ void testThemeList();
+ void testSetModel();
+ void testCloseView();
+};
+
+void TestCpThemeListView::testConstructor()
+{
+ CpThemeListView* obj = new CpThemeListView();
+ QVERIFY( obj != 0 );
+ delete obj;
+}
+
+void TestCpThemeListView::testSetWidget()
+{
+ CpThemeListView *listView = new CpThemeListView();
+ QGraphicsWidget *testWidget = new QGraphicsWidget();
+
+ listView->setWidget(testWidget);
+
+ QVERIFY( listView->widget() == testWidget);
+
+ delete testWidget;
+ delete listView;
+}
+
+void TestCpThemeListView::testThemeList()
+{
+ CpThemeListView *listView = new CpThemeListView();
+
+ QVERIFY( listView->themeList() != 0 );
+
+ delete listView;
+}
+
+// no getter so this is basically a NULL test.
+void TestCpThemeListView::testSetModel()
+{
+ CpThemeListView *listView = new CpThemeListView();
+ QStandardItemModel *model = new QStandardItemModel(this);
+
+ listView->setModel(model);
+
+ // model shouldn't be deleted because it is a QObject with a parent.
+
+ delete listView;
+}
+
+// null test
+void TestCpThemeListView::testCloseView()
+{
+ CpThemeListView *listView = new CpThemeListView();
+
+ listView->closeView();
+
+ delete listView;
+}
+
+
+
+QTEST_MAIN(TestCpThemeListView)
+#include "unittest_cpthemelistview.moc"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemelistview/unittest_cpthemelistview.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,39 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0".
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: unit tests for the cpthemelistview class in the themeplugin.
+#
+#
+
+include(../common.pri)
+
+TEMPLATE = app
+TARGET = unittest_cpthemelistview
+DEPENDPATH += .
+win32::DEPENDPATH += c:/ControlPanel/debug/bin
+
+INCLUDEPATH += .
+INCLUDEPATH += src/
+INCLUDEPATH += ../../../src
+
+LIBS += -lcpframework
+win32::LIBS += -LC:/ControlPanel/debug/bin
+
+symbian::TARGET.UID3=0x2002DD2C
+
+
+# Input
+
+HEADERS += ../../../src/cpthemelistview.h
+SOURCES += unittest_cpthemelistview.cpp
+SOURCES += ../../../src/cpthemelistview.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemeplugin/unittest_cpthemeplugin.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: XENT-MV
+*
+* Description: unit tests for the CpThemeControl class from themeplugin
+*
+*/
+
+#include <QtTest/QtTest>
+
+#include "cpthemeplugin.h"
+#include <cppluginplatinterface.h>
+#include <cpitemdatahelper.h>
+
+class TestCpThemePlugin : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testConstructor();
+ void testCreateSettingFormItemData();
+};
+
+void TestCpThemePlugin::testConstructor()
+{
+ CpThemePlugin *obj = new CpThemePlugin();
+
+ delete obj;
+}
+
+void TestCpThemePlugin::testCreateSettingFormItemData()
+{
+ CpThemePlugin *obj = new CpThemePlugin();
+ CpItemDataHelper helper;
+
+ QVERIFY(obj->createSettingFormItemData(helper) != 0);
+
+ delete obj;
+}
+
+
+QTEST_MAIN(TestCpThemePlugin)
+#include "unittest_cpthemeplugin.moc"
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemeplugin/unittest_cpthemeplugin.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0".
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: unit tests for the cpthemeplugin class in the themeplugin.
+#
+#
+
+include(../common.pri)
+
+TEMPLATE = app
+TARGET = unittest_cpthemeplugin
+DEPENDPATH += .
+win32::DEPENDPATH += c:/ControlPanel/debug/bin
+
+INCLUDEPATH += .
+INCLUDEPATH += src/
+INCLUDEPATH += ../../../src
+
+LIBS += -lcpframework
+win32::LIBS += -LC:/ControlPanel/debug/bin
+
+symbian::TARGET.UID3=0x2002DD2D
+
+
+# Input
+
+HEADERS += ../../../src/cpthemecontrol.h
+HEADERS += ../../../src/cpthemeclient_p.h
+win32::HEADERS += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.h
+symbian::HEADERS += ../../../src/cpthemeclientsymbian_p.h
+HEADERS += ../../../src/cpthemepreview.h
+HEADERS += ../../../src/cpthemechanger.h
+HEADERS += ../../../src/cpthemechanger_p.h
+HEADERS += ../../../src/cpthemelistview.h
+HEADERS += ../../../src/cpthemeplugin.h
+HEADERS += ../../../src/cpthemepluginentryitemdata.h
+SOURCES += unittest_cpthemeplugin.cpp
+SOURCES += ../../../src/cpthemecontrol.cpp
+SOURCES += ../../../src/cpthemeclient_p.cpp
+win32::SOURCES += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.cpp
+symbian::SOURCES += ../../../src/cpthemeclientsymbian_p.cpp
+SOURCES += ../../../src/cpthemepreview.cpp
+SOURCES += ../../../src/cpthemechanger.cpp
+SOURCES += ../../../src/cpthemechanger_p.cpp
+SOURCES += ../../../src/cpthemelistview.cpp
+SOURCES += ../../../src/cpthemeplugin.cpp
+SOURCES += ../../../src/cpthemepluginentryitemdata.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemepluginentryitemdata/unittest_cpthemepluginentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,47 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: XENT-MV
+*
+* Description: unit tests for the CpThemePluginEntryItemData class from themeplugin
+*
+*/
+
+#include <QtTest/QtTest>
+#include <QObject>
+
+#include <cpitemdatahelper.h>
+
+#include "cpthemepluginentryitemdata.h"
+
+class TestCpThemePluginEntryItemData : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void testConstructor();
+};
+
+void TestCpThemePluginEntryItemData::testConstructor()
+{
+ CpItemDataHelper helper;
+
+ CpThemePluginEntryItemData *obj = new CpThemePluginEntryItemData(helper);
+
+ QVERIFY(obj != NULL);
+
+ delete obj;
+}
+
+
+QTEST_MAIN(TestCpThemePluginEntryItemData)
+#include "unittest_cpthemepluginentryitemdata.moc"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemepluginentryitemdata/unittest_cpthemepluginentryitemdata.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,56 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0".
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: unit tests for the cpthemepluginentryitemdata class in the themeplugin.
+#
+#
+
+include(../common.pri)
+
+TEMPLATE = app
+TARGET = unittest_cpthemepluginentryitemdata
+DEPENDPATH += .
+win32::DEPENDPATH += c:/ControlPanel/debug/bin
+
+INCLUDEPATH += .
+INCLUDEPATH += src/
+INCLUDEPATH += ../../../src
+
+LIBS += -lcpframework
+win32::LIBS += -LC:/ControlPanel/debug/bin
+
+symbian::TARGET.UID3=0x2002DD2E
+
+
+# Input
+
+HEADERS += ../../../src/cpthemecontrol.h
+HEADERS += ../../../src/cpthemelistview.h
+HEADERS += ../../../src/cpthemechanger.h
+HEADERS += ../../../src/cpthemepreview.h
+HEADERS += ../../../src/cpthemechanger_p.h
+HEADERS += ../../../src/cpthemeclient_p.h
+win32::HEADERS += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.h
+symbian::HEADERS += ../../../src/cpthemeclientsymbian_p.h
+HEADERS += ../../../src/cpthemepluginentryitemdata.h
+SOURCES += unittest_cpthemepluginentryitemdata.cpp
+SOURCES += ../../../src/cpthemepluginentryitemdata.cpp
+SOURCES += ../../../src/cpthemelistview.cpp
+SOURCES += ../../../src/cpthemecontrol.cpp
+SOURCES += ../../../src/cpthemepreview.cpp
+SOURCES += ../../../src/cpthemechanger.cpp
+SOURCES += ../../../src/cpthemechanger_p.cpp
+SOURCES += ../../../src/cpthemeclient_p.cpp
+win32::SOURCES += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.cpp
+symbian::SOURCES += ../../../src/cpthemeclientsymbian_p.cpp
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemepreview/unittest_cpthemepreview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,134 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0""
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors: XENT-MV
+*
+* Description: unit tests for the CpThemePreview class from themeplugin
+*
+*/
+
+#include <QtTest/QtTest>
+
+#include "cpthemepreview.h"
+#include "cpthemechanger.h"
+
+class TestCpThemePreview : public QObject
+{
+ Q_OBJECT
+
+private slots:
+ void init();
+
+ void testConstructor();
+ void testConstructor2();
+ void testSetThemeName();
+ void testSetPreviewIcon();
+ void testThemeSelected();
+
+ void cleanup();
+
+private:
+ CpThemeChanger *mThemeChanger;
+};
+
+void TestCpThemePreview::init()
+{
+ mThemeChanger = new CpThemeChanger();
+}
+
+void TestCpThemePreview::cleanup()
+{
+ delete mThemeChanger;
+}
+
+void TestCpThemePreview::testConstructor()
+{
+ CpThemePreview *obj = new CpThemePreview();
+
+ QVERIFY( obj != 0 );
+
+ delete obj;
+}
+
+void TestCpThemePreview::testConstructor2()
+{
+ QList<CpThemeChanger::ThemeInfo> themeInfo = mThemeChanger->themes();
+
+ for (int i = 0; i < themeInfo.size(); ++i) {
+ QString name = themeInfo.at(i).themeName;
+ QString icon = themeInfo.at(i).iconPath;
+
+ CpThemePreview *obj = new CpThemePreview(name, icon);
+ QVERIFY (obj != 0 );
+ QCOMPARE(obj->themeName(), name);
+
+ delete obj;
+ }
+
+ // try with gibberish for the name and/or icon
+ QString name = QString("alzihgiaureh");
+ QString icon = QString("ahilwvihln");
+ CpThemePreview *obj = new CpThemePreview(name);
+ QVERIFY(obj != 0);
+ delete obj;
+
+ obj = new CpThemePreview(name,icon);
+ QVERIFY(obj != 0);
+ delete obj;
+}
+
+void TestCpThemePreview::testSetThemeName()
+{
+ CpThemePreview *obj = new CpThemePreview();
+ QList<CpThemeChanger::ThemeInfo> themeInfo = mThemeChanger->themes();
+
+ for (int i = 0; i < themeInfo.size(); ++i) {
+ QString name = themeInfo.at(i).themeName;
+
+ obj->setThemeName(name);
+ QCOMPARE(obj->themeName(), name);
+ }
+
+ delete obj;
+}
+
+// NULL TEST
+void TestCpThemePreview::testSetPreviewIcon()
+{
+ CpThemePreview *obj = new CpThemePreview();
+ QList<CpThemeChanger::ThemeInfo> themeInfo = mThemeChanger->themes();
+
+ for (int i = 0; i < themeInfo.size(); ++i) {
+ QString name = themeInfo.at(i).themeName;
+
+ obj->setThemeName(name);
+ QCOMPARE(obj->themeName(), name);
+ }
+
+ delete obj;
+}
+
+void TestCpThemePreview::testThemeSelected()
+{
+ CpThemePreview *obj = new CpThemePreview();
+ QSignalSpy spy(obj,SIGNAL(applyTheme(const QString&)));
+
+ obj->themeSelected();
+
+ QCOMPARE(spy.count(), 1);
+
+ delete obj;
+}
+
+
+QTEST_MAIN(TestCpThemePreview)
+#include "unittest_cpthemepreview.moc"
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/tsrc/unit/unittest_cpthemepreview/unittest_cpthemepreview.pro Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,49 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0".
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors: XENT-MV
+#
+# Description: unit tests for the cpthemepreview class in the themeplugin.
+#
+#
+
+include(../common.pri)
+
+TEMPLATE = app
+TARGET = unittest_cpthemepreview
+DEPENDPATH += .
+win32::DEPENDPATH += c:/ControlPanel/debug/bin
+
+INCLUDEPATH += .
+INCLUDEPATH += src/
+INCLUDEPATH += ../../../src
+
+LIBS += -lcpframework
+win32::LIBS += -LC:/ControlPanel/debug/bin
+
+symbian::TARGET.UID3=0x2002DDEF
+
+
+# Input
+
+HEADERS += ../../../src/cpthemepreview.h
+HEADERS += ../../../src/cpthemeclient_p.h
+win32::HEADERS += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.h
+symbian::HEADERS += ../../../src/cpthemeclientsymbian_p.h
+HEADERS += ../../../src/cpthemechanger.h
+HEADERS += ../../../src/cpthemechanger_p.h
+SOURCES += unittest_cpthemepreview.cpp
+SOURCES += ../../../src/cpthemepreview.cpp
+SOURCES += ../../../src/cpthemechanger.cpp
+SOURCES += ../../../src/cpthemeclient_p.cpp
+win32::SOURCES += ../../../src/cpplugins/themeplugin/src/cpthemeclientqt_p.cpp
+symbian::SOURCES += ../../../src/cpthemeclientsymbian_p.cpp
+SOURCES += ../../../src/cpthemechanger_p.cpp
--- a/controlpanelui/cpcfg_win.pl Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/cpcfg_win.pl Fri Apr 16 14:59:22 2010 +0300
@@ -1,3 +1,18 @@
+#
+# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description:
+#
# description: copy all cpcfg files to destination directory when building control panel in window envionment
# usage: go to control panel source directory,
--- a/controlpanelui/rom/controlpanelui.iby Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/rom/controlpanelui.iby Fri Apr 16 14:59:22 2010 +0300
@@ -41,7 +41,6 @@
file=ABI_DIR\BUILD_DIR\cpplaceholdernoiconplugin.dll SHARED_LIB_DIR\cpplaceholdernoiconplugin.dll
file=ABI_DIR\BUILD_DIR\cpdisplayplugin.dll SHARED_LIB_DIR\cpdisplayplugin.dll
file=ABI_DIR\BUILD_DIR\cplookfeelplugin.dll SHARED_LIB_DIR\cplookfeelplugin.dll
-file=ABI_DIR\BUILD_DIR\cpthemeplugin.dll SHARED_LIB_DIR\cpthemeplugin.dll
file=ABI_DIR\BUILD_DIR\cpkeytouchfdbkplugin.dll SHARED_LIB_DIR\cpkeytouchfdbkplugin.dll
file=ABI_DIR\BUILD_DIR\cpaccountsplugin.dll SHARED_LIB_DIR\cpaccountsplugin.dll
file=ABI_DIR\BUILD_DIR\cppincodeplugin.dll SHARED_LIB_DIR\cppincodeplugin.dll
@@ -64,7 +63,6 @@
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpplaceholdernoiconplugin.qtplugin resource\qt\plugins\controlpanel\cpplaceholdernoiconplugin.qtplugin
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin
-data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpthemeplugin.qtplugin resource\qt\plugins\controlpanel\cpthemeplugin.qtplugin
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdisplayplugin.qtplugin resource\qt\plugins\controlpanel\cpdisplayplugin.qtplugin
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin
data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpaccountsplugin.qtplugin resource\qt\plugins\controlpanel\cpaccountsplugin.qtplugin
--- a/controlpanelui/rom/controlpanelui_resources.iby Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/rom/controlpanelui_resources.iby Fri Apr 16 14:59:22 2010 +0300
@@ -22,5 +22,7 @@
#include <data_caging_paths_for_iby.hrh>
data=DATAZ_\QT_TRANSLATIONS_DIR\control_panel.qm QT_TRANSLATIONS_DIR\control_panel.qm
+data=DATAZ_\APP_RESOURCE_DIR\ControlPanel.RSC APP_RESOURCE_DIR\ControlPanel.rsc
+
#endif // CONTROLPANELUI_RESOURCES
\ No newline at end of file
--- a/controlpanelui/src/common.pri Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/common.pri Fri Apr 16 14:59:22 2010 +0300
@@ -50,6 +50,7 @@
symbian {
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger)
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$MOC_DIR
TARGET.CAPABILITY = ALL -TCB
TARGET.EPOCALLOWDLLDATA = 1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpapplication/data/controlpanellog.conf Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,17 @@
+
+# copy the file(controlpanellog.conf) to C:/data/.config to enable logging
+
+[CpFramework]
+logdatetime = 1
+logloggername = 1
+datetimeformat = hh:mm:ss:zzz
+output = debugoutput fileoutput
+fileoutput/logfile = C:/data/logs/cpframework.log
+fileoutput/truncate = 1
+
+#[CpPerformance]
+logdatetime = 1
+datetimeformat = hh:mm:ss:zzz
+output = fileoutput
+fileoutput/logfile = C:/data/logs/cpperformance.log
+fileoutput/truncate = 1
\ No newline at end of file
--- a/controlpanelui/src/cpapplication/data/mainview.cpcfg Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpapplication/data/mainview.cpcfg Fri Apr 16 14:59:22 2010 +0300
@@ -13,14 +13,7 @@
<desc></desc>
</plugin>
- <plugin displayname = "Accounts" id = "0x2feed8de" dll = "cpaccountsplugin.dll">
- <desc></desc>
- </plugin>
-
- <plugin displayname = "Application settings" id = "0x20025FDC" dll = "cpapplicationsettingsplugin.dll">
- <desc></desc>
- </plugin>
-
+
<plugin displayname = "Privacy" id = "0x20025FE1" dll = "cpprivacyplugin.dll">
<desc></desc>
</plugin>
--- a/controlpanelui/src/cpapplication/src/cpmainview.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpapplication/src/cpmainview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -20,6 +20,7 @@
#include <QList>
#include <hbdataform.h>
#include <cpitemdatahelper.h>
+#include <cplogger.h>
CpMainView::CpMainView(QGraphicsItem *parent /*= 0*/)
: CpBaseSettingView(0,parent), mMainModel(0), mItemDataHelper(0)
@@ -39,4 +40,12 @@
delete mItemDataHelper;
}
+bool CpMainView::event(QEvent *e)
+{
+ if (e->type() == QEvent::Show || e->type() == QEvent::ShowToParent) {
+ CPPERF_LOG("CpMainView shown.");
+ }
+ return CpBaseSettingView::event(e);
+}
+
// End of File
--- a/controlpanelui/src/cpapplication/src/cpmainview.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpapplication/src/cpmainview.h Fri Apr 16 14:59:22 2010 +0300
@@ -30,6 +30,7 @@
public:
explicit CpMainView(QGraphicsItem *parent = 0);
virtual ~CpMainView();
+ bool event(QEvent *e);
private:
Q_DISABLE_COPY(CpMainView)
private:
--- a/controlpanelui/src/cpapplication/src/main.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpapplication/src/main.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -32,11 +32,14 @@
Logger::instance(CPFW_LOGGER_NAME)->configure(
CP_LOGGER_CONFIG_PATH,QSettings::IniFormat);
+ Logger::instance(CPPERF_LOGGER_NAME)->configure(
+ CP_LOGGER_CONFIG_PATH,QSettings::IniFormat);
CPFW_LOG("Entering ControlPanel.exe...");
+ CPPERF_LOG("Entering ControlPanel.exe...");
QTranslator translator;
- if (translator.load("controlpanel_" + QLocale::system().name()))
+ if (translator.load("control_panel_" + QLocale::system().name(),"Z:/resource/qt/translations"))
{
qApp->installTranslator(&translator);
}
--- a/controlpanelui/src/cpcategorymodel/src/cpplaceholderitemdata.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpcategorymodel/src/cpplaceholderitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -47,7 +47,7 @@
<< "3. if the plugin stub file is in place.\n"
<< "4. if the dll is valid Qt plugin.";
- HbMessageBox::launchWarningMessageBox(message);
+ HbMessageBox::warning(message);
}
CpBaseSettingView *CpPlaceHolderItemData::createSettingView() const
--- a/controlpanelui/src/cpcategorymodel/src/cputility.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpcategorymodel/src/cputility.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -160,17 +160,6 @@
return dirs;
}
-QStringList CpUtility::applicationPluginDirectories()
-{
- static QStringList dirs;
- if (dirs.empty()) {
- CPFW_LOG("ControlPanel application plugin derectories:");
-// dirs = directoriesFromAllDrives(CP_APPLICATION_PLUGIN_PATH);
- }
- return dirs;
-}
-
-
QStringList CpUtility::configFileDirectories()
{
static QStringList dirs;
--- a/controlpanelui/src/cpcategorymodel/src/cputility.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpcategorymodel/src/cputility.h Fri Apr 16 14:59:22 2010 +0300
@@ -44,10 +44,6 @@
*/
static QStringList pluginDirectories();
- /*
- get all application plugin directories of the device
- */
- static QStringList applicationPluginDirectories();
/*
get all config directories of the device
--- a/controlpanelui/src/cpplugins/applicationsettingsplugin/data/cpapplicationsettingsplugin.cpcfg Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/applicationsettingsplugin/data/cpapplicationsettingsplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300
@@ -6,7 +6,7 @@
<plugin displayname = "Calendar" id = "0x2002B338" dll = "calensettingsplugin.dll">
<desc></desc>
</plugin>
- <plugin displayname = Mail" id = "0x2002BCF6" dll = "nmsettingsplugin.dll">
+ <plugin displayname = Mail" id = "0x2002BCF6" dll = "nmailcpplugin.dll">
<desc></desc>
</plugin>
--- a/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -39,7 +39,7 @@
void CpCommunicationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/)
{
HbDataFormModelItem *airPlaneMode = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
- QString("Airplane Mode"));
+ tr("Offline mode"));
QStringList airModeList;
airModeList << QObject::tr("On") << QObject::tr("Off");
--- a/controlpanelui/src/cpplugins/cpplugins.pro Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/cpplugins.pro Fri Apr 16 14:59:22 2010 +0300
@@ -16,17 +16,17 @@
TEMPLATE = subdirs
SUBDIRS = communicationplugin \
- placeholderplugin \
deviceplugin \
privacyplugin \
personalizationplugin \
- applicationsettingsplugin \
- lookfeelplugin \
- placeholdernoiconplugin \
- displayplugin \
- keytouchfdbkplugin \
+ lookfeelplugin \
+ keytouchfdbkplugin \
pincodeplugin \
- devicelockplugin \
- accountsplugin
+ devicelockplugin
+ #displayplugin \
+ #applicationsettingsplugin \
+ #accountsplugin
+ #placeholdernoiconplugin \
+ #placeholderplugin \
CONFIG += ordered
\ No newline at end of file
--- a/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300
@@ -9,13 +9,16 @@
<plugin displayname = "Text and keyboard" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
<desc></desc>
</plugin>
+ <plugin displayname = "Positioning" id = "0x2002C318" dll = "possettingsplugin.dll">
+ <desc></desc>
+ </plugin>
<plugin displayname = "Voice commands" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
<desc></desc>
</plugin>
- <plugin displayname = "Device updates" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
+ <plugin displayname = "Device updates" id = "0X2002DD04" dll = "deviceupdatesplugin.dll">
<desc></desc>
</plugin>
- <plugin displayname = "Reset" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
+ <plugin displayname = "Reset" id = "0x10275117" dll = "cprfsplugin.dll">
<desc></desc>
</plugin>
<plugin displayname = "About" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
--- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -15,13 +15,15 @@
*
*/
-#include <qglobal.h>
+
#include "cpdisplaymodel.h"
#ifdef Q_OS_SYMBIAN
#include "cpdisplaymodel_p.h"
#endif
+#include <qglobal.h>
+
CpDisplayModel::CpDisplayModel()
{
#ifdef Q_OS_SYMBIAN
--- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpktfdbkview.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpktfdbkview.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -16,7 +16,7 @@
*/
#include "cpktfdbkview.h"
#include <hbdataform.h>
-#include <qstringlist>
+#include <QStringList>
#include <QDebug>
#include <hbdataformmodel.h>
#include <cpsettingformitemdata.h>
--- a/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pri Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pri Fri Apr 16 14:59:22 2010 +0300
@@ -21,7 +21,8 @@
src/cppersonalizationcustomviewitem.h \
src/cpmastervolumevaluecontroller.h \
src/cpprofilesgroupitemdata.h \
- src/cpprofilesettingform.h
+ src/cpprofilesettingform.h \
+ src/cppersonalizationentryitemdata.h
SOURCES += src/cppersonalizationplugin.cpp \
src/cppersonalizationgroupitemdata.cpp \
@@ -29,4 +30,5 @@
src/cppersonalizationcustomviewitem.cpp \
src/cpmastervolumevaluecontroller.cpp \
src/cpprofilesgroupitemdata.cpp \
- src/cpprofilesettingform.cpp
\ No newline at end of file
+ src/cpprofilesettingform.cpp \
+ src/cppersonalizationentryitemdata.cpp
--- a/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pro Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pro Fri Apr 16 14:59:22 2010 +0300
@@ -21,6 +21,7 @@
RESOURCES += personalizationplugin.qrc
LIBS += -lcpprofilewrapper
+LIBS += -lxqservice -lxqserviceutil
include ( ../cpplugincommon.pri )
include ( personalizationplugin.pri )
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumeslider.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumeslider.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -29,7 +29,7 @@
setElements( elements );
setOrientation(Qt::Horizontal);
- setMaximum(11);
+ setMaximum(10);
setMinimum(0);
setIcon(HbSlider::DecreaseElement, HbIcon(":/icon/hb_vol_slider_decrement.svg"));
@@ -41,8 +41,8 @@
// set tick and beep label
#if 1
- setMajorTickInterval(1);
- setTickPosition(Hb::SliderTicksBothSides);
+// setMajorTickInterval(1);
+// setTickPosition(Hb::SliderTicksBothSides);
// QStringList labelList;
// labelList<< tr("")
// << tr("Beep");
@@ -61,7 +61,7 @@
{
}
-bool CpMasterVolumeSlider::isBeepMode()
+/*bool CpMasterVolumeSlider::isBeepMode()
{
if (value() == minimum()+1) {
return true;
@@ -79,9 +79,9 @@
else {
setValue(mPreviousValue);
}
-}
+}*/
-bool CpMasterVolumeSlider::isSilentMode()
+/*bool CpMasterVolumeSlider::isSilentMode()
{
if (value() == minimum()) {
return true;
@@ -110,7 +110,7 @@
{
setValue(normalValue+1);
}
-
+*/
void CpMasterVolumeSlider::onValueChanged(int value)
{
if (this->minimum( ) == value) {
@@ -127,23 +127,23 @@
this->setIconCheckable(true);
- if (value == 1) {
+ /*if (value == 1) {
emit beepActivated();
- }
- else {
- int valueMap = value - 1;
- emit normalValueChanged(valueMap);
- }
+ }*/
+ //else {
+ int valueMap = value;
+ emit normalValueChanged(valueMap);
+ //}
}
}
-void CpMasterVolumeSlider::onIncreaseIconClicked()
+/*void CpMasterVolumeSlider::onIncreaseIconClicked()
{
}
void CpMasterVolumeSlider::onDecreaseIconClicked()
{
-}
+}*/
void CpMasterVolumeSlider::onMuteIconToggled(bool isToggled)
{
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumeslider.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumeslider.h Fri Apr 16 14:59:22 2010 +0300
@@ -22,30 +22,30 @@
class CpMasterVolumeSlider: public HbSlider
{
Q_OBJECT
- Q_PROPERTY(bool beepMode READ isBeepMode WRITE setBeepMode)
- Q_PROPERTY(bool silentMode READ isSilentMode WRITE setSilentMode)
- Q_PROPERTY(int normalValue READ normalValue WRITE setNormalValue)
+ //Q_PROPERTY(bool beepMode READ isBeepMode WRITE setBeepMode)
+ //Q_PROPERTY(bool silentMode READ isSilentMode WRITE setSilentMode)
+ //Q_PROPERTY(int normalValue READ normalValue WRITE setNormalValue)
public:
explicit CpMasterVolumeSlider(QGraphicsItem *parent = 0);
~CpMasterVolumeSlider();
public:
- bool isBeepMode();
- void setBeepMode(bool isBeepMode);
- bool isSilentMode();
- void setSilentMode(bool isSilentMode);
- int normalValue();
- void setNormalValue(int normalValue);
+ //bool isBeepMode();
+ //void setBeepMode(bool isBeepMode);
+ //bool isSilentMode();
+ //void setSilentMode(bool isSilentMode);
+ //int normalValue();
+ //void setNormalValue(int normalValue);
signals:
- void beepActivated();
+ //void beepActivated();
void silentActivated();
void normalValueChanged(int value);
private slots:
void onValueChanged(int value);
- void onIncreaseIconClicked();
- void onDecreaseIconClicked();
+ //void onIncreaseIconClicked();
+ //void onDecreaseIconClicked();
void onMuteIconToggled(bool isToggled);
private:
int mPreviousValue;
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -26,11 +26,13 @@
CpMasterVolumeValueController::CpMasterVolumeValueController(CpProfileModel *profileModel,
HbDataFormModelItem *masterVolumeItem,
- CpItemDataHelper &itemDataHelper)
- : mProfileModle(profileModel),
- mMasterVolumeItem(masterVolumeItem)
+ CpItemDataHelper &itemDataHelper,
+ HbDataFormModelItem *profileItem)
+ : mProfileModel(profileModel),
+ mMasterVolumeItem(masterVolumeItem),
+ mProfileItem(profileItem)
{
- itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(beepActivated()),this,SLOT(onBeepActivated()));
+ //itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(beepActivated()),this,SLOT(onBeepActivated()));
itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(silentActivated()),this,SLOT(onSilentActivated()));
itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(normalValueChanged(int)),this,SLOT(onNormalValueChanged(int)));
updateMasterVolumeValue();
@@ -41,38 +43,49 @@
}
-void CpMasterVolumeValueController::onBeepActivated()
+/*void CpMasterVolumeValueController::onBeepActivated()
{
#ifdef Q_OS_SYMBIAN
- mProfileModle->activateBeep();
+ mProfileModel->activateBeep();
#endif
-}
+}*/
void CpMasterVolumeValueController::onSilentActivated()
{
#ifdef Q_OS_SYMBIAN
- mProfileModle->activateSilent();
+ //mProfileModel->activateSilent();
+ int err = mProfileModel->activateProfile(EProfileWrapperSilentId);
+ if (err == KErrNone) {
+ //update the radio buttonlist of profile
+ mProfileItem->setContentWidgetData("selected",2);
+ //mMasterVolumeItem->setContentWidgetData("value",0);
+ //mMasterVolumeItem->setContentWidgetData("enabled",false);
+ updateMasterVolumeValue();
+ }
#endif
}
void CpMasterVolumeValueController::onNormalValueChanged(int value)
{
#ifdef Q_OS_SYMBIAN
- mProfileModle->setRingVolume(value);
+ mProfileModel->setRingVolume(value);
#endif
}
void CpMasterVolumeValueController::updateMasterVolumeValue()
{
#ifdef Q_OS_SYMBIAN
- if (mProfileModle->isBeep()) {
+ /*if (mProfileModel->isBeep()) {
mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(1));
}
- else if (mProfileModle->isSilent()) {
+ else*/
+ if (mProfileModel->isSilent()) {
mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(0));
+
+ mMasterVolumeItem->setEnabled(false);
}
else {
- mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(mProfileModle->ringVolume()+1));
+ mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(mProfileModel->ringVolume()));
}
#endif
}
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.h Fri Apr 16 14:59:22 2010 +0300
@@ -29,17 +29,19 @@
public:
CpMasterVolumeValueController(CpProfileModel *profileModel,
HbDataFormModelItem *masterVolumeItem,
- CpItemDataHelper &itemDataHelper);
+ CpItemDataHelper &itemDataHelper,
+ HbDataFormModelItem *profileItem);
virtual ~CpMasterVolumeValueController();
private slots:
- void onBeepActivated();
+ //void onBeepActivated();
void onSilentActivated();
void onNormalValueChanged(int value);
private:
void updateMasterVolumeValue();
private:
- CpProfileModel *mProfileModle;
+ CpProfileModel *mProfileModel;
HbDataFormModelItem *mMasterVolumeItem;
+ HbDataFormModelItem *mProfileItem;
};
#endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#include "cppersonalizationentryitemdata.h"
+#include <xqaiwrequest.h>
+#include <cpitemdatahelper.h>
+
+CpPersonalizationEntryItemData::CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper,
+ const QString &text,
+ const QString &description,
+ const HbIcon &icon,
+ const HbDataFormModelItem *parent)
+ :CpSettingFormEntryItemData(itemDataHelper,text,description,
+ icon,parent),mReq(0)
+{
+}
+CpPersonalizationEntryItemData::~CpPersonalizationEntryItemData()
+{
+}
+void CpPersonalizationEntryItemData::onLaunchView()
+{
+ //launch media fetcher
+ if (!mReq)
+ {
+ mReq = mAppMgr.create("com.nokia.services.media.Music", "fetch(QString)", true);
+
+ if (!mReq)
+ {
+ return;
+ }
+ else
+ {
+ connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&)));
+ connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&)));
+ }
+ }
+
+ // Set arguments for request (music fetcher application title)
+ QList<QVariant> args;
+ args << QVariant( text() );
+ mReq->setArguments(args);
+
+ // Make the request
+ if (!mReq->send())
+ {
+ //report error
+ return;
+ }
+}
+void CpPersonalizationEntryItemData::handleOk(const QVariant &result)
+{
+ if (!result.canConvert<QString>())
+ {
+ setDescription( "Corrupt result" );
+ }
+ else
+ {
+ setDescription( result.value<QString>() );
+ }
+}
+void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage)
+{
+ //
+ Q_UNUSED(errorCode);
+ Q_UNUSED(errorMessage);
+ setDescription("Error");
+}
+
+CpBaseSettingView *CpPersonalizationEntryItemData::createSettingView() const
+{
+ return 0;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationentryitemdata.h Fri Apr 16 14:59:22 2010 +0300
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#ifndef CPPERSONALIZATIONENTRYITEMDATA_H
+#define CPPERSONALIZATIONENTRYITEMDATA_H
+
+#include <cpsettingformentryitemdata.h>
+#include <xqappmgr.h>
+
+
+class XQApplicationManager;
+class XQAiwRequest;
+
+
+class CpPersonalizationEntryItemData : public CpSettingFormEntryItemData
+{
+ Q_OBJECT
+public:
+ explicit CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper,
+ const QString &text = QString(),
+ const QString &description = QString(),
+ const HbIcon &icon = HbIcon(),
+ const HbDataFormModelItem *parent = 0);
+ virtual ~CpPersonalizationEntryItemData();
+private slots:
+ void onLaunchView();
+ void handleOk(const QVariant &result);
+ void handleError(int errorCode, const QString& errorMessage);
+private:
+ virtual CpBaseSettingView *createSettingView() const;
+private:
+ XQApplicationManager mAppMgr;
+ XQAiwRequest* mReq;
+};
+
+#endif // CPPERSONALIZATIONENTRYITEMDATA_H
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -37,6 +37,7 @@
mEmailTone(0),
mReminderTone(0),
mClockTone(0),
+ mSayCallerName(0),
mProfileModel(0),
mMasterVolumeValueController(0)
{
@@ -51,7 +52,7 @@
void CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper)
{
-
+ /*
itemDataHelper.addItemPrototype(new CpPersonalizationCustomViewItem);
mMasterVolume = new HbDataFormModelItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem));
@@ -76,12 +77,19 @@
this->appendChild(mMasterVibra);
+ */
mRingTone = new CpSettingFormEntryItemDataImpl<CpBaseSettingView>(itemDataHelper,
tr("Ring tone"),
tr("Nokia tone"));
this->appendChild(mRingTone);
+
+ /*mSayCallerName = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, QString());
+ mSayCallerName->setContentWidgetData("text", tr("Say caller's name"));
+ this->appendChild(mSayCallerName);*/
+
+
mMessageTone = new CpSettingFormEntryItemDataImpl<CpBaseSettingView>(itemDataHelper,
tr("Message tone"),
tr("Nokia message tone"));
@@ -105,7 +113,7 @@
void CpPersonalizationGroupItemData::masterVolumeValueChanged(int value)
{
Q_UNUSED(value);
- HbMessageBox::launchInformationMessageBox(QString("volume changed to:%1").arg(value));
+ HbMessageBox::information(QString("volume changed to:%1").arg(value));
}
void CpPersonalizationGroupItemData::onVibraValueChange(int isVibra)
{
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.h Fri Apr 16 14:59:22 2010 +0300
@@ -48,6 +48,7 @@
CpSettingFormEntryItemData *mEmailTone;
CpSettingFormEntryItemData *mReminderTone;
CpSettingFormEntryItemData *mClockTone;
+ HbDataFormModelItem *mSayCallerName;
CpProfileModel *mProfileModel;
CpMasterVolumeValueController *mMasterVolumeValueController;
};
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -31,18 +31,16 @@
QList<CpSettingFormItemData*> CpPersonalizationPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
{
- Q_UNUSED(itemDataHelper);
- /*
CpProfilesGroupItemData *profileItemData =
new CpProfilesGroupItemData(itemDataHelper);
- */
+
CpPersonalizationGroupItemData *personalItemData =
new CpPersonalizationGroupItemData(
HbDataFormModelItem::GroupItem,
- tr("Default tones"),
+ tr("Tones"),
QString("cppersonalizationplugin.cpcfg") );
- return QList<CpSettingFormItemData*>() /*<< profileItemData*/ << personalItemData;
+ return QList<CpSettingFormItemData*>() << profileItemData << personalItemData;
}
Q_EXPORT_PLUGIN2(cppersonalizationplugin, CpPersonalizationPlugin);
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -43,14 +43,18 @@
mModel = new HbDataFormModel();
QStringList profileList;
- profileList << "Normal" << "Meeting" << "Silent"; //should be got from engine.
+ profileList << "General" << "Meeting" << "Silent"; //should be got from engine.
foreach (const QString &profile,profileList) {
HbDataFormModelItem *profilePage = mModel->appendDataFormPage(profile);
+ //hard code: profile name should be got from profile engine
+ if (profile != "Silent") {
initVolumeGroup(profilePage);
- initRingToneGroup(profilePage);
- initMessageToneGroup(profilePage);
- initAlertToneGroup(profilePage);
- initKeyAndScreenToneGroup(profilePage);
+ }
+ initVibraGroup(profilePage);
+ //initRingToneGroup(profilePage);
+ //initMessageToneGroup(profilePage);
+ //initAlertToneGroup(profilePage);
+ //initKeyAndScreenToneGroup(profilePage);
}
setModel(mModel);
}
@@ -59,15 +63,36 @@
{
HbDataFormModelItem *volumeGroup = mModel->appendDataFormGroup(
tr("Volume"),parent);
- mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString(),volumeGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Ring alert vibra"),volumeGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("New message alert vibra"),volumeGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("New e-mail alert vibra"),volumeGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Reminder alarm vibra"),volumeGroup);
- mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Clock alarm vibra"),volumeGroup);
+ // mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Master volume"),volumeGroup);
+ HbDataFormModelItem *informationTone = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),volumeGroup);
+ informationTone->setContentWidgetData("text", tr("information tones"));
+ mModel->appendDataFormItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem),QString("Key and touch screen tones"),volumeGroup);
+}
+void CpProfileSettingForm::initVibraGroup(HbDataFormModelItem *parent)
+{
+ HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup(
+ tr("Vibra"),parent);
+ HbDataFormModelItem *ringVibar = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ ringVibar->setContentWidgetData("text", tr("Ring alert vibra"));
+
+ HbDataFormModelItem *messageVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ messageVibra->setContentWidgetData("text", tr("New message alert vibra"));
+
+ HbDataFormModelItem *emailVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ emailVibra->setContentWidgetData("text", tr("New e-mail alert vibra"));
+
+ HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ reminderVibra->setContentWidgetData("text", tr("Reminder alarm vibra"));
+
+ HbDataFormModelItem *clockVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ clockVibra->setContentWidgetData("text", tr("Clock alarm vibra"));
+
+ HbDataFormModelItem *informationVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup);
+ informationVibra->setContentWidgetData("text", tr("Information vibra"));
+
}
-void CpProfileSettingForm::initRingToneGroup(HbDataFormModelItem *parent)
+/*void CpProfileSettingForm::initRingToneGroup(HbDataFormModelItem *parent)
{
HbDataFormModelItem *ringToneGroup = mModel->appendDataFormGroup(
tr("Ring tone"),parent);
@@ -146,3 +171,4 @@
mModel->appendDataFormItem(HbDataFormModelItem::SliderItem,
tr("Touch screen vibra"),keyAndScreenToneGroup);
}
+*/
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Fri Apr 16 14:59:22 2010 +0300
@@ -32,10 +32,11 @@
private:
void initModel();
void initVolumeGroup(HbDataFormModelItem *parent);
- void initRingToneGroup(HbDataFormModelItem *parent);
- void initMessageToneGroup(HbDataFormModelItem *parent);
- void initAlertToneGroup(HbDataFormModelItem *parent);
- void initKeyAndScreenToneGroup(HbDataFormModelItem *parent);
+ void initVibraGroup(HbDataFormModelItem *parent);
+ // void initRingToneGroup(HbDataFormModelItem *parent);
+ // void initMessageToneGroup(HbDataFormModelItem *parent);
+ // void initAlertToneGroup(HbDataFormModelItem *parent);
+ // void initKeyAndScreenToneGroup(HbDataFormModelItem *parent);
private:
HbDataFormModel *mModel;
};
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -18,16 +18,26 @@
#include <QStringList>
#include <cpsettingformentryitemdataimpl.h>
#include <cpbasesettingview.h>
+#include <cpitemdatahelper.h>
+#include <hbmessagebox.h>
#include "cpprofilesettingform.h"
+#include "cpmastervolumevaluecontroller.h"
+#include "cppersonalizationcustomviewitem.h"
+
CpProfilesGroupItemData::CpProfilesGroupItemData(CpItemDataHelper &itemDataHelper)
-: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("Profiles"))
+: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("Profiles")),mProfileModel(0)
{
+ mProfileModel = new CpProfileModel();
initItems(itemDataHelper);
}
CpProfilesGroupItemData::~CpProfilesGroupItemData()
{
+ delete mProfileModel;
+ if (mMasterVolumeValueController != 0) {
+ delete mMasterVolumeValueController;
+ }
}
namespace
@@ -39,21 +49,80 @@
{
}
};
-};
+}
void CpProfilesGroupItemData::initItems(CpItemDataHelper &itemDataHelper)
{
+ itemDataHelper.addItemPrototype(new CpPersonalizationCustomViewItem);
HbDataFormModelItem *activeProfileItem = new HbDataFormModelItem(
HbDataFormModelItem::RadioButtonListItem,tr("Profiles"));
-
+ //enable the profile activating
+ // why come into slots twice when select a item?
+ itemDataHelper.addConnection(activeProfileItem,SIGNAL(itemSelected(int)),this,SLOT(activateProfile(int)));
+
+ mCurrentProfileId = static_cast<ProfileWrapperProfileId>(mProfileModel->activeProfileId());
+ // QString warnningNote = "Profile Id = "+ mCurrentProfileId;
+ //HbMessageBox::information(warnningNote);
QStringList items;
- items << tr("Normal") << tr("Meeting") << tr("Silent");
+ items << tr("General") << tr("Meeting") << tr("Silent");
activeProfileItem->setContentWidgetData("items",items);
- activeProfileItem->setContentWidgetData("selected",0);
+ switch (mCurrentProfileId) {
+ case EProfileWrapperGeneralId:
+ activeProfileItem->setContentWidgetData("selected",0);
+ break;
+ case EProfileWrapperSilentId:
+ activeProfileItem->setContentWidgetData("selected",2);
+ break;
+ case EProfileWrapperMeetingId:
+ activeProfileItem->setContentWidgetData("selected",1);
+ break;
+ default:
+ // HbMessageBox::information("unknown id of profile");
+ break;
+ };
+
+ appendChild(activeProfileItem);
+
+ mMasterVolume = new HbDataFormModelItem(static_cast<HbDataFormModelItem::DataItemType>(MasterVolumeSliderItem));
- appendChild(activeProfileItem);
+ mMasterVolumeValueController = new CpMasterVolumeValueController(mProfileModel, mMasterVolume,
+ itemDataHelper, activeProfileItem);
+ this->appendChild(mMasterVolume);
HbDataFormModelItem *editProfileItem = new CpSettingFormEntryItemDataImpl<CpProfileSettingView>(
itemDataHelper,tr("Edit profiles"));
appendChild(editProfileItem);
}
+void CpProfilesGroupItemData::activateProfile(int profileIndex)
+{
+ switch (profileIndex) {
+ case 0: // general
+ {
+ mProfileModel->activateProfile(EProfileWrapperGeneralId);
+ int volumeValue = mProfileModel->ringVolume();
+ // update the master volume when profile changed
+ // should be used profileChangedObserver in the future;
+ mMasterVolume->setEnabled(true);
+ mMasterVolume->setContentWidgetData("value", volumeValue);
+ break;
+ }
+ case 1: // meeting
+ {
+ mProfileModel->activateProfile(EProfileWrapperMeetingId);
+ int volumeValue = mProfileModel->ringVolume();
+ mMasterVolume->setEnabled(true);
+ mMasterVolume->setContentWidgetData("value", volumeValue);
+ break;
+ }
+ case 2: // silent
+ {
+ mProfileModel->activateProfile(EProfileWrapperSilentId);
+ mMasterVolume->setContentWidgetData("value", 0);
+ mMasterVolume->setEnabled(false);
+ break;
+ }
+ default:
+ break;
+
+ }
+}
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.h Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.h Fri Apr 16 14:59:22 2010 +0300
@@ -19,17 +19,26 @@
#define CPPROFILESGROUPITEMDATA_H
#include <cpsettingformitemdata.h>
+#include <cpprofilemodel.h>
+class CpProfileModel;
class CpItemDataHelper;
+class CpMasterVolumeValueController;
class CpProfilesGroupItemData : public CpSettingFormItemData
{
Q_OBJECT
public:
explicit CpProfilesGroupItemData(CpItemDataHelper &itemDataHelper);
virtual ~CpProfilesGroupItemData();
+private slots:
+ void activateProfile(int profileIndex);
private:
Q_DISABLE_COPY(CpProfilesGroupItemData)
void initItems(CpItemDataHelper &itemDataHelper);
+ CpProfileModel *mProfileModel;
+ ProfileWrapperProfileId mCurrentProfileId;
+ HbDataFormModelItem *mMasterVolume;
+ CpMasterVolumeValueController *mMasterVolumeValueController;
};
#endif
--- a/controlpanelui/src/cpplugins/privacyplugin/data/cpprivacyplugin.cpcfg Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpplugins/privacyplugin/data/cpprivacyplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300
@@ -1,13 +1,13 @@
<childplugins>
- <plugin displayname = "Pin code" id = "0X20028731" dll = "cppincodeplugin.dll">
+ <plugin displayname = "Pin code" id = "0X2002E682" dll = "cppincodeplugin.dll">
<desc></desc>
</plugin>
- <plugin displayname = "Device lock" id = "0X20028732" dll = "cpdevicelockplugin.dll">
+ <plugin displayname = "Device lock" id = "0X2002E683" dll = "cpdevicelockplugin.dll">
<desc></desc>
</plugin>
- <plugin displayname = "Advanced security" id = "0X20025FDD" dll = "cpplaceholdernoiconplugin.dll">
+ <plugin displayname = "Advanced security" id = "0X2002E684" dll = "cpplaceholdernoiconplugin.dll">
<desc></desc>
</plugin>
--- a/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Fri Apr 16 14:59:22 2010 +0300
@@ -61,6 +61,7 @@
symbian {
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \
+ $$APP_LAYER_SYSTEMINCLUDE \
$$MOC_DIR
SOURCES += src/cpprofilemodel_p.cpp
--- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -16,6 +16,7 @@
*/
#include "cpprofilemodel_p.h"
+#include <cpprofilemodel.h>
#include <e32base.h>
#include <QString>
#include <MProfileEngineExtended.h>
@@ -78,7 +79,7 @@
CpProfileModelPrivate::~CpProfileModelPrivate()
{
delete mVibraCenRep;
- mVibraCenRep = NULL;
+ mVibraCenRep = 0;
}
/*
@@ -238,10 +239,29 @@
{
return;
}
+ mProfileExt = mEngine->ProfileL( EProfileWrapperGeneralId );
+ // General tones volume
+ TProfileToneSettings& toneSettingsGeneral = mProfileExt->ProfileSetTones().SetToneSettings();
+ mToneSettings = &toneSettingsGeneral;
+
mToneSettings->iRingingType = EProfileRingingTypeRinging;
mToneSettings->iRingingVolume = volume;
commitChange();
+
+ mProfileExt = mEngine->ProfileL( EProfileWrapperMeetingId );
+
+ // meeting tones volume
+ TProfileToneSettings& toneSettingsMeeting = mProfileExt->ProfileSetTones().SetToneSettings();
+ mToneSettings = &toneSettingsMeeting;
+
+ mToneSettings->iRingingType = EProfileRingingTypeRinging;
+ mToneSettings->iRingingVolume = volume;
+
+ commitChange();
+
+ mProfileExt = mEngine->ProfileL(mEngine->ActiveProfileId());
+ // currently implementation: keep the two profiles same volume
}
/*
--- a/controlpanelui/src/seccodeui/seccodeui.pro Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/seccodeui/seccodeui.pro Fri Apr 16 14:59:22 2010 +0300
@@ -43,6 +43,7 @@
symbian: {
INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
INCLUDEPATH += $$MOC_DIR
TARGET.CAPABILITY = ALL -TCB
TARGET.EPOCALLOWDLLDATA = 1
--- a/controlpanelui/src/seccodeui/src/seccodeuiutility.cpp Fri Mar 19 09:29:29 2010 +0200
+++ b/controlpanelui/src/seccodeui/src/seccodeuiutility.cpp Fri Apr 16 14:59:22 2010 +0300
@@ -35,7 +35,7 @@
if(ok) {
*ok = true;
}
- result = dlg->textValue().toString();
+ result = dlg->value().toString();
}
delete dlg;
return result;
@@ -43,17 +43,17 @@
void SecCodeUiUtility::showInformationMessage(const QString &message,QGraphicsItem *parent /*= 0*/ )
{
- HbMessageBox::launchInformationMessageBox(message,0,0,parent);
+ HbMessageBox::information(message,0,0,parent);
}
void SecCodeUiUtility::showWarningMessage(const QString &message,QGraphicsItem *parent /*= 0*/)
{
- HbMessageBox::launchWarningMessageBox(message,0,0,parent);
+ HbMessageBox::warning(message,0,0,parent);
}
void SecCodeUiUtility::showErrorMessage(const QString &message,QGraphicsItem *parent /*= 0*/)
{
- HbMessageBox::launchInformationMessageBox(message,0,0,parent);
+ HbMessageBox::information(message,0,0,parent);
}
QString SecCodeUiUtility::getPinRemainingAttemptsMessage(int remainingAttempts)
--- a/layers.sysdef.xml Fri Mar 19 09:29:29 2010 +0200
+++ b/layers.sysdef.xml Fri Apr 16 14:59:22 2010 +0300
@@ -6,6 +6,9 @@
<SystemDefinition name="settingsuis" schema="1.5.1">
<systemModel>
<layer name="app_layer">
+ <module name="themeplugin">
+ <unit unitID="themeplugin" mrp="" bldFile="&layer_real_source_path;/controlpanelplugins/themeplugin" name="themeplugin" proFile="themeplugin.pro" qmakeArgs="-r -config rom"/>
+ </module>
<module name="controlpanelui">
<unit unitID="controlpanelui" mrp="" bldFile="&layer_real_source_path;/controlpanelui" name="controlpanelui" proFile="controlpanelui.pro" qmakeArgs="-r -config rom"/>
</module>
--- a/package_definition.xml Fri Mar 19 09:29:29 2010 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SystemDefinition schema="3.0.0">
- <package id="settingsuis" name="Settings UIs" levels="rsc ui">
- <collection id="defaultapplicationsettings" name="Default Application Settings" level="rsc">
- <component id="services_db" filter="s60" name="Services Database" introduced="^1">
- <unit bldFile="defaultapplicationsettings/services_db/group"/>
- </component>
- <component id="defaultapplicationsettings_server" filter="s60" name="Default Application Server" introduced="^1">
- <unit bldFile="defaultapplicationsettings/server/group"/>
- </component>
- <component id="service" filter="s60" name="Default Application Service" introduced="^1">
- <unit bldFile="defaultapplicationsettings/service/group"/>
- </component>
- <component id="dasgsplugin" filter="s60" name="Default Application Settings GS Plugin" class="plugin" introduced="^1">
- <unit bldFile="defaultapplicationsettings/gsplugin/group"/>
- </component>
- <component id="defaultapplicationsettings_build" filter="s60" name="Default Application Settings Build" introduced="^1">
- <!-- split the IBYs up into the appropriate components? -->
- <unit bldFile="defaultapplicationsettings/group"/>
- </component>
- </collection>
- <collection id="systemswuis" name="System SW UIs" level="ui">
- <component id="touchscreencalib" filter="s60" name="Touchscreen Calibration" introduced="^1">
- <unit bldFile="systemswuis/touchscreencalib/group"/>
- </component>
- </collection>
- <collection id="settingsuis_info" name="Settings UIs Info" level="ui">
- <component id="devmngt_pub" filter="s60" class="api" name="Settings UIs Public Interfaces" introduced="^1">
- <unit bldFile="devmngt_pub/group"/>
- </component>
- <component id="settingsuis_test" filter="s60" purpose="development" name="Settings UIs Test" introduced="^1">
- <!-- what needs to be done about this? -->
- <!-- <unit bldFile="tsrc/group"/> -->
- </component>
- <component id="devmngt_plat" filter="s60" class="api" name="Settings UIs Platform Interfaces" introduced="^1">
- <unit bldFile="devmngt_plat/group"/>
- <!-- should these be #included elsewhere? -->
- <!-- <unit bldFile="devmngt_plat/services_db_api/tsrc/servicesdbapitest/group"/> -->
- <!-- <unit bldFile="devmngt_plat/default_app_client_api/tsrc/dasclientapitest/group"/> -->
- </component>
- </collection>
- </package>
-</SystemDefinition>