klettres
prefs_addons.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2004 by Waldo Bastian * 00003 * bastian@kde.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef PREFS_ADDONS_H 00022 #define PREFS_ADDONS_H 00023 00024 public: 00025 static QString defaultLanguage(); 00026 static void setLanguages(const QStringList &languages) 00027 { 00028 Prefs::self()->m_languages = languages; 00029 } 00030 00031 static void setLanguageNumber(int i) 00032 { 00033 setLanguage(Prefs::self()->m_languages[i]); 00034 } 00035 00036 static int languageNumber() 00037 { 00038 int i = Prefs::self()->m_languages.indexOf(language()); 00039 if (i != -1) 00040 return i; 00041 i = Prefs::self()->m_languages.indexOf(defaultLanguage()); 00042 if (i != -1) 00043 return i; 00044 i = Prefs::self()->m_languages.indexOf("en"); 00045 if (i != -1) 00046 return i; 00047 00048 return 0; 00049 } 00050 QStringList m_languages; 00051 00052 #endif 00053
KDE 4.0 API Reference