This repository has been archived by the owner on Apr 3, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.cpp
115 lines (85 loc) · 2.6 KB
/
settings.cpp
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include "settings.h"
float Settings::getDetteClient()
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Limite de dette");
float detteClient = settings.value( "Client", sizeof( float ) ).toFloat();
settings.endGroup();
return detteClient;
}
float Settings::getDetteKFtier()
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Limite de dette");
float detteKFtier = settings.value( "KFtier", sizeof( float ) ).toFloat();
settings.endGroup();
return detteKFtier;
}
QStringList Settings::getTablist()
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Tab");
QStringList key = settings.childKeys();
QStringList tab;
for( int i = 0; i < key.size(); i++ )
{
tab.append( settings.value( key.at(i) ).toString() );
}
settings.endGroup();
return tab;
}
void Settings::setTabList(QStringList liste)
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Tab");
settings.remove("");
for( int i = 0; i < liste.size(); i++ )
{
if( i < 10 )
{
settings.setValue( "Tab0" + QString::number( i ), liste.at(i) );
}
else
{
settings.setValue( "Tab" + QString::number( i ), liste.at(i) );
}
}
settings.endGroup();
}
QList<int> Settings::getBoutonList()
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Bouton");
QStringList key = settings.childKeys();
QList<int> bouton;
for( int i = 0; i < key.size(); i++ )
{
bouton.append( settings.value( key.at(i) ).toInt() );
}
settings.endGroup();
return bouton;
}
void Settings::setBoutonList( QList<int> liste )
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Bouton");
for( int i = 0; i < liste.size(); i++ )
{
if( i < 10 )
{
settings.setValue( "bouton0" + QString::number( i ), liste.at(i) );
}
else
{
settings.setValue( "bouton" + QString::number( i ), liste.at(i) );
}
}
settings.endGroup();
}
void Settings::clearBouton()
{
QSettings settings( QDir::currentPath() + "/systeme/setting.ini", QSettings::IniFormat );
settings.beginGroup("Bouton");
settings.remove("");
settings.endGroup();
}