diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bd9e6617827818fd043452c08c606f07b78014a0 (patch) | |
tree | 425bb4c3168f9c02f10150f235d2cb998dcc6108 /kbabel/datatools/setfuzzy | |
download | tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/datatools/setfuzzy')
-rw-r--r-- | kbabel/datatools/setfuzzy/Makefile.am | 19 | ||||
-rw-r--r-- | kbabel/datatools/setfuzzy/kbabel_setfuzzytool.desktop | 98 | ||||
-rw-r--r-- | kbabel/datatools/setfuzzy/main.cc | 98 | ||||
-rw-r--r-- | kbabel/datatools/setfuzzy/main.h | 47 |
4 files changed, 262 insertions, 0 deletions
diff --git a/kbabel/datatools/setfuzzy/Makefile.am b/kbabel/datatools/setfuzzy/Makefile.am new file mode 100644 index 00000000..f1a5b8bc --- /dev/null +++ b/kbabel/datatools/setfuzzy/Makefile.am @@ -0,0 +1,19 @@ + +INCLUDES = -I$(srcdir)/../../common -I../../common $(all_includes) +kbabel_setfuzzytool_la_LIBADD = ../../common/libkbabelcommon.la + +####### Files + +kde_module_LTLIBRARIES = kbabel_setfuzzytool.la + +kbabel_setfuzzytool_la_SOURCES = main.cc + +kbabel_setfuzzytool_la_LDFLAGS = $(all_libraries) -avoid-version -module -no-undefined + +noinst_HEADERS = main.h + +kbabel_setfuzzytool_la_METASOURCES = AUTO + +service_DATA = kbabel_setfuzzytool.desktop +servicedir = $(kde_servicesdir) + diff --git a/kbabel/datatools/setfuzzy/kbabel_setfuzzytool.desktop b/kbabel/datatools/setfuzzy/kbabel_setfuzzytool.desktop new file mode 100644 index 00000000..ead62f13 --- /dev/null +++ b/kbabel/datatools/setfuzzy/kbabel_setfuzzytool.desktop @@ -0,0 +1,98 @@ +[Desktop Entry] +Name=Toggle Fuzzy Tool for KBabel +Name[bs]=Fuzzy prekidač - alat za KBabel +Name[ca]=Eina per a KBabel que des/marca entrades inexactes +Name[cs]=Nástroj pro přepínání fuzzy položek +Name[cy]=Erfyn Newid i Bras i KBabel +Name[da]=Slå fuzzy-værktøj til og fra for KBabel +Name[de]=Umschalter für fragwürdige Einträge für KBabel +Name[el]=Εργαλείο εναλλαγής ασάφειας για το KBabel +Name[es]=Herramienta de conmutación de entradas dudosas para KBabel +Name[et]=KBabeli kahtlaste teadete lülitamise tööriist +Name[eu]=Zalantzazko sarreren aldaketa tresna KBabel-entzat +Name[fa]=زدن ضامن ابزار مبهم برای KBabel +Name[fi]=KBabel-työkalu sumean tilan vaihtamiseksi +Name[fr]=Outil d'inversion de fuzzy pour KBabel +Name[gl]=Ferramenta de comutación da marca de dubida para KBabel +Name[hu]=Ellenőrzési eszköz a KBabelhez +Name[is]=Víxla loðnu tól fyrir KBabel +Name[it]=Strumento di KBabel per commutare le voci fuzzy +Name[ja]=KBabel あいまい状態切り替えツール +Name[ka]=დაუზუსტებელის გადართვის ხელსაწყო KBabel-სთვის +Name[kk]=KBabel-дың жазу дүмбілездік күйін терістеу құралы +Name[lt]=KBabel įrankis, visus pranešimus pažymintis „neaiškiais“ +Name[ms]=Alat Togol Kabur untuk KBabel +Name[nb]=Slå av/på uklar-statusen i KBabel +Name[nds]=Twiefelhaftig-Status ümschalten för KBabel +Name[ne]=केब्याबलका लागि फजी उपकरण टगल गर्नुहोस् +Name[nl]=Fuzzystatusomschakeling voor KBabel +Name[nn]=Slå av/på uklar-statusen i KBabel +Name[pa]=ਕੇਬਬੇਲ ਲਈ ਤਬਦੀਲੀ ਅਸਪਸ਼ਟ ਸੰਦ +Name[pl]=Narzędzie do przełączania statusu wątpliwego komunikatu w KBabel +Name[pt]=Classificação Global Aproximada para o KBabel +Name[pt_BR]=Ferramenta para Alternar Aproximado para o KBabel +Name[ru]=Изменение статуса черновой записи для KBabel +Name[sk]=Nástroje pre prepnutie nepresného stavu per KBabel +Name[sl]=Preklopi vse v ohlapno; za KBabel +Name[sr]=Укључи/искључи алат за нејасне поруке за KBabel +Name[sr@Latn]=Uključi/isključi alat za nejasne poruke za KBabel +Name[sv]=Verktyg för att ändra inexakta för Kbabel +Name[ta]= Kபாபேலுக்கு நிலைமாற்றி இடைநிலை கருவி +Name[tg]=Утилита барои сиёҳнависӣ дар KBabel +Name[tr]=KBabel için Geçiş Bulanık Aracı +Name[uk]=Засіб перемикання неточних фраз для KBabel +Name[zh_CN]=KBabel 切换模糊工具 +Name[zh_TW]=KBabel 切換模糊狀態工具 +X-KDE-Library=kbabel_setfuzzytool +Type=Service +Commands=allfuzzy +Comment=Set All Fuzzy +Comment[bg]=Маркиране на всички като неясни +Comment[bs]=Podesi sve kao fuzzy +Comment[ca]=Estableix totes les entrades a inexacta +Comment[cs]=Nastavit vše jako fuzzy +Comment[cy]=Gosod Popeth i Fras +Comment[da]=Sæt alle til fuzzy +Comment[de]=Alle auf fragwürdig setzen +Comment[el]=Ορισμός όλων ως ασαφή +Comment[es]=Cambiar todo a dudoso +Comment[et]=Kõigi teadete määramine kahtlaseks +Comment[eu]=Ezarri denak zalantzazko bezala +Comment[fa]=تنظیم همۀ مبهمها +Comment[fi]=Aseta kaikki sumeiksi +Comment[fr]=Mettre tout en fuzzy +Comment[gl]=Marce todas as mensaxes como dúbidas +Comment[hi]=सभी फजी नियत करें +Comment[hu]=Az összes üzenet ellenőrzendővé alakítása +Comment[is]=Setja öll loðin +Comment[it]=Imposta tutte le voci come fuzzy +Comment[ja]=すべてあいまいとしてマーク +Comment[ka]=ყველასთვის დაუზუსტებელის დაყენება +Comment[kk]=Барлығын дүмбілез деп кою +Comment[lt]=Žymėti visus neaiškiais +Comment[ms]=Tetapkan Semua Kabur +Comment[nb]=Sett alle strengene som uklare +Comment[nds]=All op "twiefelhaftig" setten +Comment[ne]=सबै फजी सेट गर्नुहोस् +Comment[nl]=Alles fuzzy markeren +Comment[nn]=Set alle strengane som uklare +Comment[pa]= ਸਭ ਅਸਪਸ਼ਟ ਕਰੋ +Comment[pl]=Ustawia wszystkie komunikaty jako wątpliwe +Comment[pt]=Coloca todas as mensagens como aproximadas +Comment[pt_BR]=Configura Todos Aproximados +Comment[ru]=Установить статус "черновые" для всех записей +Comment[sk]=Nastaviť všetky ako nepresné +Comment[sl]=Nastavi vse ohlapno +Comment[sr]=Постави све на нејасно +Comment[sr@Latn]=Postavi sve na nejasno +Comment[sv]=Gör alla inexakta +Comment[ta]= எல்லா இடைநிலையையும் அமை +Comment[tg]=Барқарор кардани ҳолати "сиёҳнависҳо" барои ҳамаи сабтҳо +Comment[tr]=Tümünü Bulanık Ata +Comment[uk]=Встановити всі фрази як "неточні" +Comment[zh_CN]=全部设为模糊 +Comment[zh_TW]=全部設為模糊 +ServiceTypes=KDataTool,KBabelTool +DataType=Catalog +DataMimeTypes=application/x-kbabel-catalog +ReadOnly=false diff --git a/kbabel/datatools/setfuzzy/main.cc b/kbabel/datatools/setfuzzy/main.cc new file mode 100644 index 00000000..077004d8 --- /dev/null +++ b/kbabel/datatools/setfuzzy/main.cc @@ -0,0 +1,98 @@ +/* This file is part of KBabel + based Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> + 2003 Stanislav Visnovsky <visnovsky@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. + +*/ + +#include <resources.h> +#include "catalog.h" +#include "main.h" + +#include <kdebug.h> +#include <kgenericfactory.h> +#include <klibloader.h> +#include <klocale.h> + +/*************************************************** + * + * Factory + * + ***************************************************/ + +K_EXPORT_COMPONENT_FACTORY( kbabel_setfuzzytool, KGenericFactory<SetFuzzyTool> ( "kbabeldatatool" ) ) + +using namespace KBabel; + +SetFuzzyTool::SetFuzzyTool( QObject* parent, const char* name, const QStringList & ) + : KDataTool( parent, name ) +{ +} + +bool SetFuzzyTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +{ + if ( command != "allfuzzy" ) + { + kdDebug(KBABEL) << "Fuzzy Toggling Tool does only accept the command 'allfuzzy'" << endl; + kdDebug(KBABEL) << " The commands " << command << " is not accepted" << endl; + return FALSE; + } + + // Check wether we can accept the data + if ( datatype != "Catalog" ) + { + kdDebug(KBABEL) << "Fuzzy Toggling Tool only accepts datatype Catalog" << endl; + return FALSE; + } + + if ( mimetype != "application/x-kbabel-catalog" ) + { + kdDebug(KBABEL) << "Plural Forms Tool only accepts mimetype application/x-kbabel-catalog" << endl; + return FALSE; + } + + if( command == "allfuzzy" ) + { + Catalog* catalog = (Catalog*)(data); + + catalog->applyBeginCommand(0,Msgstr,0); + + for( uint index=0; index < catalog->numberOfEntries(); index++ ) + { + if( !catalog->isUntranslated(index) ) + { + catalog->setFuzzy(index,true); + } + } + + catalog->applyEndCommand(0,Msgstr,0); + } + return TRUE; +} + +#include "main.moc" diff --git a/kbabel/datatools/setfuzzy/main.h b/kbabel/datatools/setfuzzy/main.h new file mode 100644 index 00000000..da28a9d1 --- /dev/null +++ b/kbabel/datatools/setfuzzy/main.h @@ -0,0 +1,47 @@ +/* This file is part of KBabel + based on Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> + 2003 Stanislav Visnovsky <visnovsky@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. + +*/ + +#ifndef __main_h__ +#define __main_h__ + +#include <kdatatool.h> + +class SetFuzzyTool : public KDataTool +{ + Q_OBJECT + +public: + SetFuzzyTool( QObject* parent, const char* name, const QStringList & ); + virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); +}; + +#endif |