summaryrefslogtreecommitdiffstats
path: root/klatin/klatin/klatin.kcfg
blob: 407f47a27f31d9d21d0df358cae91750b348fdae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8"?>
<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
      http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
	<kcfgfile name="klatinrc"/>
		<group name="Language">
			<entry name="UserLanguage" type="String">
				<label>The language selected by the user</label>
					<code>
						KConfigBase *globalConf = KGlobal::config();
						globalConf->setGroup("Locale");
						QString m_language = globalConf->readEntry("Language", "en");
						//keep only the first 2 characters
						m_language = m_language.left(2);
						QString filename = locate("data", "klatin/data/vocabs/");
						filename += m_language;
						QDir check(filename);

						if (check.exists() == FALSE) {
							m_language = "en";
						}
						kdDebug()&lt;&lt; m_language &lt;&lt;endl;
					</code>
				<default code="true">m_language</default>
			</entry> 
		</group>
		<group name="Vocabulary"> 
		<entry name="NumOfQuestions" type="Int"> 
			<label>how many questions are asked in one session.</label> 
			<default>10</default> 
		</entry> 
		<entry name="UnlimitedQuestions" type="Int"> 
			<label>whether KLatin should ask unlimited questions.</label> 
			<default>0</default> 
		</entry> 
		<entry name="DefaultFile" type="String"> 
			<label>the default vocabulary file.</label>
			<code>
				QString fileDir = locate("data", "klatin/data/vocabs/");
				fileDir += m_language;
				QDir vocabDirectory(fileDir, "*.kvtml");
				kdDebug()&lt;&lt; m_language &lt;&lt;endl;
				
				QString defaultFile = (fileDir + "/" + vocabDirectory[0]);
				kdDebug()&lt;&lt; defaultFile &lt;&lt;endl;
			</code>
			<default code="true">defaultFile</default>
		</entry> 
		<entry name="LatinToLang" type="Bool"> 
			<label>whether the questions should be Latin to the user's language.</label> 
			<default>true</default>
		</entry> 
		<entry name="LangToLatin" type="Bool"> 
			<label>whether the questions should be the user's language to Latin.</label> 
			<default>false</default>
		</entry>
	</group> 
</kcfg>