~ubuntu-branches/ubuntu/precise/kalzium/precise

« back to all changes in this revision

Viewing changes to src/rsdialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Philip Muškovac
  • Date: 2011-07-03 12:28:58 UTC
  • Revision ID: james.westby@ubuntu.com-20110703122858-q1yyxncs89e4w0hs
Tags: upstream-4.6.90+repack
Import upstream version 4.6.90+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2006, 2008 by Carsten Niehaus                           *
 
3
 *   cniehaus@kde.org                                                      *
 
4
 *
 
5
 *                                                                         *
 
6
 *   This program is free software; you can redistribute it and/or modify  *
 
7
 *   it under the terms of the GNU General Public License as published by  *
 
8
 *   the Free Software Foundation; either version 2 of the License, or     *
 
9
 *   (at your option) any later version.                                   *
 
10
 *                                                                         *
 
11
 *   This program is distributed in the hope that it will be useful,       *
 
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 
14
 *   GNU General Public License for more details.                          *
 
15
 *                                                                         *
 
16
 *   You should have received a copy of the GNU General Public License     *
 
17
 *   along with this program; if not, write to the                         *
 
18
 *   Free Software Foundation, Inc.,                                       *
 
19
 *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
 
20
 ***************************************************************************/
 
21
 
 
22
#include "rsdialog.h"
 
23
 
 
24
#include <QRegExp>
 
25
 
 
26
#include "kalziumdataobject.h"
 
27
#include "kalziumutils.h"
 
28
 
 
29
#include <KLocale>
 
30
#include <ktoolinvocation.h>
 
31
#include <KToolInvocation>
 
32
#include <KMessageBox>
 
33
 
 
34
RSDialog::RSDialog( QWidget* parent )
 
35
        : KDialog( parent )
 
36
{
 
37
        setCaption( i18n( "Risks/Security Phrases" ) );
 
38
        setButtons( Help | Close );
 
39
 
 
40
        createRPhrases();
 
41
        createSPhrases();
 
42
 
 
43
        ui.setupUi( mainWidget() );
 
44
 
 
45
        connect( ui.filterButton, SIGNAL( clicked() ), 
 
46
                this, SLOT( filter() ) );
 
47
        connect( this, SIGNAL( helpClicked() ), 
 
48
                this, SLOT( slotHelp() ) );
 
49
 
 
50
        filter();
 
51
}
 
52
 
 
53
void RSDialog::filter()
 
54
{
 
55
        //if the RS sentence starts or ends with a - invalidate it.
 
56
        //It is probably an user error
 
57
        if(
 
58
                ui.r_le->text().startsWith('-') ||
 
59
                ui.r_le->text().endsWith('-') || 
 
60
                ui.s_le->text().startsWith('-') || 
 
61
                ui.s_le->text().endsWith('-') 
 
62
        )
 
63
        {
 
64
                invalidPhaseString();
 
65
                return;
 
66
        }
 
67
 
 
68
    QList<int> r;
 
69
    QList<int> s;
 
70
 
 
71
    //for now only separation by a - is allowed
 
72
    if (!ui.r_le->text().isEmpty() )
 
73
    {
 
74
        const QStringList rSplit = ui.r_le->text().split( '-' );
 
75
        foreach( const QString &st, rSplit )
 
76
            r << st.toInt();
 
77
    }
 
78
 
 
79
    //for now only separation by a - is allowed
 
80
    if (!ui.s_le->text().isEmpty() )
 
81
    {
 
82
        const QStringList sSplit = ui.s_le->text().split( '-' );
 
83
        foreach( const QString &st, sSplit )
 
84
            s << st.toInt();
 
85
    }
 
86
        
 
87
                        filterRS( r, s );
 
88
}
 
89
 
 
90
void RSDialog::filterRS( const QList<int>& r, const QList<int>& s )
 
91
{
 
92
    QString string( "<qt>" );
 
93
 
 
94
    if (r.count() > 0 ) {
 
95
        string.append( "<h2>" + i18n( "R-Phrases:" ) + "</h2>" );
 
96
        foreach( int i, r )
 
97
        {
 
98
            QString phrase( "<b>" + QString::number( i ) + " - " );
 
99
            phrase.append( rphrase( i ) + "</b>" );
 
100
            string.append( phrase + "<br>" );
 
101
        }
 
102
    }
 
103
    if (s.count() > 0 ) {
 
104
        string.append( "<h2>" + i18n( "S-Phrases:" ) + "</h2>" );
 
105
        foreach( int i, s )
 
106
        {
 
107
            QString phrase( "<b>" + QString::number( i ) + " -  " );
 
108
            phrase.append( sphrase( i ) + "</b>" );
 
109
            string.append( phrase + "<br>" );
 
110
        }
 
111
    }
 
112
    if (s.count() == 0 && r.count() == 0 )
 
113
        string.append( "<h2>" + i18n( "You asked for no R/S-Phrases." ) + "</h2>" );
 
114
 
 
115
    string.append( "</qt>" );
 
116
 
 
117
    ui.text->setHtml( string );
 
118
}
 
119
 
 
120
QString RSDialog::rphrase( int number )
 
121
{
 
122
        QString p;
 
123
        
 
124
        QMap<int, QString>::const_iterator i = rphrases_map.constBegin();
 
125
        while ( i != rphrases_map.constEnd() )
 
126
        {
 
127
                if ( i.key() == number )
 
128
                        return i.value();
 
129
 
 
130
                ++i;
 
131
        }
 
132
 
 
133
        return p;
 
134
}
 
135
 
 
136
QString RSDialog::sphrase( int number )
 
137
{
 
138
        QString p;
 
139
        
 
140
        QMap<int, QString>::const_iterator i = sphrases_map.constBegin();
 
141
        while ( i != sphrases_map.constEnd() )
 
142
        {
 
143
                if ( i.key() == number )
 
144
                        return i.value();
 
145
 
 
146
                ++i;
 
147
        }
 
148
 
 
149
        return p;
 
150
}
 
151
 
 
152
 
 
153
void RSDialog::createSPhrases()
 
154
{
 
155
        QStringList sphrases;
 
156
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S1: Keep locked up");
 
157
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S2: Keep out of the reach of children");
 
158
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S3: Keep in a cool place");
 
159
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S4: Keep away from living quarters");
 
160
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S5: Keep contents under ... ( appropriate liquid to be specified by the manufacturer )");
 
161
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S6: Keep under ... ( inert gas to be specified by the manufacturer )");
 
162
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S7: Keep container tightly closed");
 
163
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S8: Keep container dry");
 
164
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S9: Keep container in a well-ventilated place");
 
165
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S12: Do not keep the container sealed");
 
166
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S13: Keep away from food, drink and animal feedingstuffs");
 
167
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S14: Keep away from ... ( incompatible materials to be indicated by the manufacturer )");
 
168
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S15: Keep away from heat");
 
169
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S16: Keep away from sources of ignition - No smoking");
 
170
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S17: Keep away from combustible material");
 
171
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S18: Handle and open container with care");
 
172
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S20: When using do not eat or drink");
 
173
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S21: When using do not smoke");
 
174
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S22: Do not breathe dust");
 
175
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S23: Do not breathe gas/fumes/vapour/spray ( appropriate wording to be specified by the manufacturer )");
 
176
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S24: Avoid contact with skin");
 
177
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S25: Avoid contact with eyes");
 
178
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S26: In case of contact with eyes, rinse immediately with plenty of water and seek medical advice");
 
179
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S27: Take off immediately all contaminated clothing");
 
180
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S28: After contact with skin, wash immediately with plenty of ... ( to be specified by the manufacturer )");
 
181
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S29: Do not empty into drains");
 
182
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S30: Never add water to this product");
 
183
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S33: Take precautionary measures against static discharges");
 
184
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S35: This material and its container must be disposed of in a safe way");
 
185
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S36: Wear suitable protective clothing");
 
186
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S37: Wear suitable gloves");
 
187
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S38: In case of insufficient ventilation wear suitable respiratory equipment");
 
188
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S39: Wear eye/face protection");
 
189
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S40: To clean the floor and all objects contaminated by this material use ... ( to be specified by the manufacturer )");
 
190
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S41: In case of fire and/or explosion do not breathe fumes");
 
191
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S42: During fumigation/spraying wear suitable respiratory equipment ( appropriate wording to be specified by the manufacturer )");
 
192
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S43: In case of fire use ... ( indicate in the space the precise type of fire-fighting equipment. If water increases the risk add - Never use water )");
 
193
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S45: In case of accident or if you feel unwell seek medical advice immediately ( show the label where possible )");
 
194
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S46: If swallowed, seek medical advice immediately and show this container or label");
 
195
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S47: Keep at temperature not exceeding ... °C ( to be specified by the manufacturer )");
 
196
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S48: Keep wet with ... ( appropriate material to be specified by the manufacturer )");
 
197
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S49: Keep only in the original container");
 
198
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S50: Do not mix with ... ( to be specified by the manufacturer )");
 
199
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S51: Use only in well-ventilated areas");
 
200
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S52: Not recommended for interior use on large surface areas");
 
201
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S53: Avoid exposure - obtain special instructions before use");
 
202
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S56: Dispose of this material and its container at hazardous or special waste collection point");
 
203
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S57: Use appropriate containment to avoid environmental contamination");
 
204
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S59: Refer to manufacturer/supplier for information on recovery/recycling");
 
205
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S60: This material and its container must be disposed of as hazardous waste");
 
206
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S61: Avoid release to the environment. Refer to special instructions/safety data sheet");
 
207
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S62: If swallowed, do not induce vomiting: seek medical advice immediately and show this container or label");
 
208
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S63: In case of accident by inhalation: remove casualty to fresh air and keep at rest");
 
209
        sphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "S64: If swallowed, rinse mouth with water ( only if the person is conscious )");
 
210
 
 
211
        QRegExp reg( "(R|S)(\\d+): (.*)" );
 
212
 
 
213
        foreach( const QString &p , sphrases )
 
214
        {
 
215
                int number = 0;
 
216
                QString phrase( "" );
 
217
 
 
218
                if ( reg.indexIn( p ) > -1 )
 
219
                {
 
220
                        QString part1 = reg.cap( 2 );
 
221
                        QString part2 = reg.cap( 3 );
 
222
 
 
223
                        phrase = part2;
 
224
                        number = part1.toInt();
 
225
                }
 
226
                
 
227
                sphrases_map.insert(number, phrase);
 
228
        }
 
229
}
 
230
 
 
231
void RSDialog::createRPhrases()
 
232
{
 
233
        QStringList rphrases;
 
234
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R1: Explosive when dry");
 
235
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R2: Risk of explosion by shock, friction, fire or other sources of ignition");
 
236
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R3: Extreme risk of explosion by shock, friction, fire or other sources of ignition");
 
237
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R4: Forms very sensitive explosive metallic compounds");
 
238
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R5: Heating may cause an explosion");
 
239
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R6: Explosive with or without contact with air");
 
240
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R7: May cause fire");
 
241
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R8: Contact with combustible material may cause fire");
 
242
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R9: Explosive when mixed with combustible material");
 
243
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R10: Flammable");
 
244
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R11: Highly flammable");
 
245
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R12: Extremely flammable");
 
246
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R14: Reacts violently with water");
 
247
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R15: Contact with water liberates extremely flammable gases");
 
248
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R16: Explosive when mixed with oxidising substances");
 
249
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R17: Spontaneously flammable in air");
 
250
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R18: In use, may form flammable/explosive vapour-air mixture");
 
251
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R19: May form explosive peroxides");
 
252
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R20: Harmful by inhalation");
 
253
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R21: Harmful in contact with skin");
 
254
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R22: Harmful if swallowed");
 
255
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R23: Toxic by inhalation");
 
256
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R24: Toxic in contact with skin");
 
257
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R25: Toxic if swallowed");
 
258
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R26: Very toxic by inhalation");
 
259
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R27: Very toxic in contact with skin");
 
260
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R28: Very toxic if swallowed");
 
261
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R29: Contact with water liberates toxic gas.");
 
262
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R30: Can become highly flammable in use");
 
263
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R31: Contact with acids liberates toxic gas");
 
264
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R32: Contact with acids liberates very toxic gas");
 
265
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R33: Danger of cumulative effects");
 
266
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R34: Causes burns");
 
267
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R35: Causes severe burns");
 
268
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R36: Irritating to eyes");
 
269
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R37: Irritating to respiratory system");
 
270
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R38: Irritating to skin");
 
271
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R39: Danger of very serious irreversible effects");
 
272
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R40: Limited evidence of a carcinogenic effect");
 
273
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R41: Risk of serious damage to eyes");
 
274
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R42: May cause sensitisation by inhalation");
 
275
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R43: May cause sensitisation by skin contact");
 
276
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R44: Risk of explosion if heated under confinement");
 
277
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R45: May cause cancer");
 
278
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R46: May cause heritable genetic damage");
 
279
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R48: Danger of serious damage to health by prolonged exposure");
 
280
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R49: May cause cancer by inhalation");
 
281
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R50: Very toxic to aquatic organisms");
 
282
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R51: Toxic to aquatic organisms");
 
283
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R52: Harmful to aquatic organisms");
 
284
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R53: May cause long-term adverse effects in the aquatic environment");
 
285
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R54: Toxic to flora");
 
286
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R55: Toxic to fauna");
 
287
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R56: Toxic to soil organisms");
 
288
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R57: Toxic to bees");
 
289
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R58: May cause long-term adverse effects in the environment");
 
290
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R59: Dangerous for the ozone layer");
 
291
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R60: May impair fertility");
 
292
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R61: May cause harm to the unborn child");
 
293
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R62: Possible risk of impaired fertility");
 
294
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R63: Possible risk of harm to the unborn child");
 
295
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R64: May cause harm to breast-fed babies");
 
296
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R65: Harmful: may cause lung damage if swallowed");
 
297
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R66: Repeated exposure may cause skin dryness or cracking");
 
298
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R67: Vapours may cause drowsiness and dizziness");
 
299
        rphrases << i18nc("Please take the official translations! You find them here: http://europa.eu.int/eur-lex/lex/LexUriServ/LexUriServ.do?uri=CELEX:32001L0059:EN:HTML" , "R68: Possible risk of irreversible effects");
 
300
        
 
301
        QRegExp reg( "(R|S)(\\d+): (.*)" );
 
302
 
 
303
        foreach( const QString &p , rphrases )
 
304
        {
 
305
                int number = 0;
 
306
                QString phrase( "" );
 
307
 
 
308
                if ( reg.indexIn( p ) > -1 )
 
309
                {
 
310
                        QString part1 = reg.cap( 2 );
 
311
                        QString part2 = reg.cap( 3 );
 
312
 
 
313
                        phrase = part2;
 
314
                        number = part1.toInt();
 
315
                }
 
316
                
 
317
                rphrases_map.insert(number, phrase);
 
318
        }
 
319
}
 
320
 
 
321
void RSDialog::slotHelp()
 
322
{
 
323
    KToolInvocation::invokeHelp( "rs_phrases", QLatin1String( "kalzium" ) );
 
324
}
 
325
 
 
326
void RSDialog::invalidPhaseString()
 
327
{
 
328
                KMessageBox::error(0, i18n("At least one of the specified phrases is invalid."));
 
329
}
 
330
 
 
331
 
 
332
#include "rsdialog.moc"