summaryrefslogtreecommitdiffstats
path: root/kbabel/commonui/roughtransdlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/commonui/roughtransdlg.cpp')
-rw-r--r--kbabel/commonui/roughtransdlg.cpp160
1 files changed, 80 insertions, 80 deletions
diff --git a/kbabel/commonui/roughtransdlg.cpp b/kbabel/commonui/roughtransdlg.cpp
index de321044..75395630 100644
--- a/kbabel/commonui/roughtransdlg.cpp
+++ b/kbabel/commonui/roughtransdlg.cpp
@@ -40,16 +40,16 @@
#include "regexpextractor.h"
#include "roughtransdlg.h"
-#include <qmemarray.h>
-#include <qcheckbox.h>
-#include <qhbuttongroup.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qradiobutton.h>
-#include <qtimer.h>
-#include <qvgroupbox.h>
-#include <qvbox.h>
-#include <qwhatsthis.h>
+#include <tqmemarray.h>
+#include <tqcheckbox.h>
+#include <tqhbuttongroup.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqradiobutton.h>
+#include <tqtimer.h>
+#include <tqvgroupbox.h>
+#include <tqvbox.h>
+#include <tqwhatsthis.h>
#include <kapplication.h>
#include <kconfig.h>
@@ -64,7 +64,7 @@
using namespace KBabel;
RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
- , QWidget *parent,const char *name)
+ , TQWidget *parent,const char *name)
: KDialogBase(parent,name,true
,i18n("Caption of dialog","Rough Translation")
, User1|User2|User3|Close)
@@ -85,45 +85,45 @@ RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
enableButton(User2,false);
enableButton(User3,false);
- QWidget *mw = new QWidget(this);
+ TQWidget *mw = new TQWidget(this);
setMainWidget(mw);
- QVBoxLayout *mainLayout = new QVBoxLayout(mw);
+ TQVBoxLayout *mainLayout = new TQVBoxLayout(mw);
- configWidget = new QVBox(mw);
+ configWidget = new TQVBox(mw);
mainLayout->addWidget(configWidget);
- QVGroupBox *box = new QVGroupBox(i18n("What to Translate"),configWidget);
+ TQVGroupBox *box = new TQVGroupBox(i18n("What to Translate"),configWidget);
- QHButtonGroup *bBox = new QHButtonGroup(box);
+ TQHButtonGroup *bBox = new TQHButtonGroup(box);
bBox->setMargin(0);
- bBox->setFrameStyle(QFrame::NoFrame);
+ bBox->setFrameStyle(TQFrame::NoFrame);
whatBox = bBox;
- untransButton = new QCheckBox(i18n("U&ntranslated entries"),bBox);
- fuzzyButton = new QCheckBox(i18n("&Fuzzy entries"),bBox);
- transButton = new QCheckBox(i18n("T&ranslated entries"),bBox);
+ untransButton = new TQCheckBox(i18n("U&ntranslated entries"),bBox);
+ fuzzyButton = new TQCheckBox(i18n("&Fuzzy entries"),bBox);
+ transButton = new TQCheckBox(i18n("T&ranslated entries"),bBox);
- connect(bBox,SIGNAL(clicked(int)),this,SLOT(msgButtonClicked(int)));
+ connect(bBox,TQT_SIGNAL(clicked(int)),this,TQT_SLOT(msgButtonClicked(int)));
- QWhatsThis::add(bBox,i18n("<qt><p><b>What entries to translate</b></p>"
+ TQWhatsThis::add(bBox,i18n("<qt><p><b>What entries to translate</b></p>"
"<p>Choose here, for which entries of the file KBabel "
"tries to find a translation. Changed entries are always "
"marked as fuzzy, no matter which option you choose.</p></qt>"));
- box = new QVGroupBox(i18n("How to Translate"),configWidget);
- bBox = new QHButtonGroup(box);
- bBox->setFrameStyle(QFrame::NoFrame);
+ box = new TQVGroupBox(i18n("How to Translate"),configWidget);
+ bBox = new TQHButtonGroup(box);
+ bBox->setFrameStyle(TQFrame::NoFrame);
bBox->setMargin(0);
- searchMatchButton = new QCheckBox(i18n("&Use dictionary settings")
+ searchMatchButton = new TQCheckBox(i18n("&Use dictionary settings")
,bBox);
- fuzzyMatchButton = new QCheckBox(i18n("Fu&zzy translation (slow)")
+ fuzzyMatchButton = new TQCheckBox(i18n("Fu&zzy translation (slow)")
,bBox);
- singleWordButton = new QCheckBox(i18n("&Single word translation")
+ singleWordButton = new TQCheckBox(i18n("&Single word translation")
,bBox);
- QWhatsThis::add(bBox,i18n("<qt><p><b>How messages get translated</b></p>"
+ TQWhatsThis::add(bBox,i18n("<qt><p><b>How messages get translated</b></p>"
"<p>Here you can define if a message can only get translated "
"completely, if similar messages are acceptable or if KBabel "
"is supposed to try translating "
@@ -131,11 +131,11 @@ RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
"complete message or similar message was found.</p></qt>"));
- box = new QVGroupBox(i18n("Options"),configWidget);
+ box = new TQVGroupBox(i18n("Options"),configWidget);
- markFuzzyButton = new QCheckBox(i18n("&Mark changed entries as fuzzy"),box);
+ markFuzzyButton = new TQCheckBox(i18n("&Mark changed entries as fuzzy"),box);
markFuzzyButton->setChecked(true);
- QWhatsThis::add(markFuzzyButton,
+ TQWhatsThis::add(markFuzzyButton,
i18n("<qt><p><b>Mark changed entries as fuzzy</b></p>"
"<p>When a translation for a message is found, the entry "
"will be marked <b>fuzzy</b> by default. This is because the "
@@ -144,25 +144,25 @@ RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
"you know what you are doing.</p></qt>"));
- connect(markFuzzyButton, SIGNAL(toggled(bool))
- , this, SLOT(fuzzyButtonToggled(bool)));
+ connect(markFuzzyButton, TQT_SIGNAL(toggled(bool))
+ , this, TQT_SLOT(fuzzyButtonToggled(bool)));
- kdeButton = new QCheckBox(i18n("Initialize &KDE-specific entries"),box);
+ kdeButton = new TQCheckBox(i18n("Initialize &KDE-specific entries"),box);
kdeButton->setChecked(true);
- QWhatsThis::add(kdeButton,
+ TQWhatsThis::add(kdeButton,
i18n("<qt><p><b>Initialize KDE-specific entries</b></p>"
"<p>Initialize \"Comment=\" and \"Name=\" entries "
"if a translation is not found. Also, \"NAME OF TRANSLATORS\" "
"and \"EMAIL OF TRANSLATORS\" is filled with identity settings.</p></qt>"));
- QVGroupBox *dBox = new QVGroupBox(i18n("Dictionaries"),configWidget);
+ TQVGroupBox *dBox = new TQVGroupBox(i18n("Dictionaries"),configWidget);
configWidget->setStretchFactor(dBox,1);
- QPtrList<ModuleInfo> moduleList = dict->moduleInfos();
+ TQPtrList<ModuleInfo> moduleList = dict->moduleInfos();
KConfig *config = KGlobal::config();
KConfigGroupSaver gs(config,"RoughTranslation");
- QStringList selectedList=config->readListEntry("Selected");
+ TQStringList selectedList=config->readListEntry("Selected");
if(selectedList.isEmpty())
{
int a = dict->activeModule();
@@ -174,7 +174,7 @@ RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
}
dictChooser = new DictChooser(dict,selectedList,dBox,"dictChooser");
- QWhatsThis::add(dictChooser,i18n("<qt><p><b>Dictionaries</b></p>"
+ TQWhatsThis::add(dictChooser,i18n("<qt><p><b>Dictionaries</b></p>"
"<p>Choose here, which dictionaries have to be used for "
"finding a translation. If you select more than one "
"dictionary, they are used in the same order as they "
@@ -183,11 +183,11 @@ RoughTransDlg::RoughTransDlg(KBabelDictBox *dict, Catalog *cat
"configure selected dictionary. The original settings "
"will be restored after closing the dialog.</p></qt>"));
- QLabel* label = new QLabel( i18n("Messages:"), mw );
+ TQLabel* label = new TQLabel( i18n("Messages:"), mw );
progressbar = new KProgress(mw,"progressbar");
progressbar->setTextEnabled(true);
progressbar->setFormat("%v/%m (%p%)");
- QHBoxLayout* pblayout= new QHBoxLayout(mainLayout);
+ TQHBoxLayout* pblayout= new TQHBoxLayout(mainLayout);
pblayout->add(label);
pblayout->add(progressbar);
@@ -249,7 +249,7 @@ void RoughTransDlg::slotUser1()
partTransCounter=0;
totalTried=0;
- QTimer::singleShot(0,this, SLOT(translate()));
+ TQTimer::singleShot(0,this, TQT_SLOT(translate()));
}
void RoughTransDlg::translate()
@@ -263,16 +263,16 @@ void RoughTransDlg::translate()
int total=catalog->numberOfEntries();
progressbar->setTotalSteps(total);
- QStringList dictList = dictChooser->selectedDicts();
+ TQStringList dictList = dictChooser->selectedDicts();
catalog->applyBeginCommand(0,Msgstr,0);
bool singleWords=singleWordButton->isChecked();
bool fuzzyMatch=fuzzyMatchButton->isChecked();
bool searchMatch=searchMatchButton->isChecked();
- QRegExp contextReg=catalog->miscSettings().contextInfo;
- QChar accelMarker=catalog->miscSettings().accelMarker;
- QRegExp endPunctReg("[\\.?!: ]+$");
+ TQRegExp contextReg=catalog->miscSettings().contextInfo;
+ TQChar accelMarker=catalog->miscSettings().accelMarker;
+ TQRegExp endPunctReg("[\\.?!: ]+$");
for(int i = 0; i < total; i++)
@@ -283,18 +283,18 @@ void RoughTransDlg::translate()
if(stop || cancel) break;
// FIXME: should care about plural forms
- QString msg=catalog->msgid(i,true).first();
- QString translation;
+ TQString msg=catalog->msgid(i,true).first();
+ TQString translation;
// this is KDE specific:
if( kdeSpecific )
{
if( catalog->pluralForm(i) == NoPluralForm )
{
- QString origTrans = catalog->msgstr(i).first();
+ TQString origTrans = catalog->msgstr(i).first();
if(msg.find("_: NAME OF TRANSLATORS\\n")==0)
{
- QString authorName;
+ TQString authorName;
if( !catalog->identitySettings().authorLocalizedName.isEmpty() )
authorName = catalog->identitySettings().authorLocalizedName;
else // fallback to non-localized name
@@ -302,7 +302,7 @@ void RoughTransDlg::translate()
authorName = catalog->identitySettings().authorName;
else continue; // there is no name to be inserted
- if( !QStringList::split(',', origTrans).contains(authorName) )
+ if( !TQStringList::split(',', origTrans).contains(authorName) )
{
if(origTrans.isEmpty() ) translation=authorName;
else translation+=origTrans+","+authorName;
@@ -313,7 +313,7 @@ void RoughTransDlg::translate()
// skip, if email is not specified in settings
if( catalog->identitySettings().authorEmail.isEmpty() ) continue;
- if( !QStringList::split(',', origTrans).contains(catalog->identitySettings().authorEmail) )
+ if( !TQStringList::split(',', origTrans).contains(catalog->identitySettings().authorEmail) )
{
if(origTrans.isEmpty() ) translation=catalog->identitySettings().authorEmail;
else translation=origTrans+","+catalog->identitySettings().authorEmail;
@@ -321,7 +321,7 @@ void RoughTransDlg::translate()
}
else if (msg.find("ROLES_OF_TRANSLATORS") == 0)
{
- QString temp = "<othercredit role=\\\"translator\\\">\n<firstname></firstname>"
+ TQString temp = "<othercredit role=\\\"translator\\\">\n<firstname></firstname>"
"<surname></surname>\n<affiliation><address><email>" +
catalog->identitySettings( ).authorEmail+"</email></address>\n"
"</affiliation><contrib></contrib></othercredit>";
@@ -332,12 +332,12 @@ void RoughTransDlg::translate()
}
else if (msg.find("CREDIT_FOR_TRANSLATORS") == 0)
{
- QString authorName;
+ TQString authorName;
if (!catalog->identitySettings( ).authorLocalizedName.isEmpty( ))
authorName = catalog->identitySettings( ).authorLocalizedName;
else if (!catalog->identitySettings( ).authorName.isEmpty( ))
authorName = catalog->identitySettings( ).authorName;
- QString temp = "<para>" + authorName + "\n" + "<email>" +
+ TQString temp = "<para>" + authorName + "\n" + "<email>" +
catalog->identitySettings( ).authorEmail + "</email></para>";
if (origTrans.isEmpty( ))
translation = temp;
@@ -370,7 +370,7 @@ void RoughTransDlg::translate()
}
// try exact translation
- QStringList::Iterator dit = dictList.begin();
+ TQStringList::Iterator dit = dictList.begin();
while(translation.isEmpty() && dit != dictList.end())
{
dictBox->setActiveModule(*dit);
@@ -386,7 +386,7 @@ void RoughTransDlg::translate()
// try search settings translation
else if (searchMatch) {
- QString tr;
+ TQString tr;
int score, best_score = 0;
dit = dictList.begin();
while(dit != dictList.end())
@@ -412,7 +412,7 @@ void RoughTransDlg::translate()
// try fuzzy translation
else if (fuzzyMatch) {
- QString tr;
+ TQString tr;
int score, best_score = 0;
dit = dictList.begin();
while(dit != dictList.end())
@@ -439,9 +439,9 @@ void RoughTransDlg::translate()
// try single word translation
if(translation.isEmpty() && singleWords)
{
- QStringList wordList;
- QChar accel;
- QString endingPunctuation;
+ TQStringList wordList;
+ TQChar accel;
+ TQString endingPunctuation;
int pos = msg.findRev(endPunctReg);
if(pos >= 0)
{
@@ -456,12 +456,12 @@ void RoughTransDlg::translate()
te.setString(msg);
msg=te.matchesReplaced(" KBABELTAG ");
- QString word;
+ TQString word;
int length = msg.length();
- QRegExp digitReg("^[0-9]*$");
+ TQRegExp digitReg("^[0-9]*$");
for(int index=0; index < length; index++)
{
- QChar c=msg[index];
+ TQChar c=msg[index];
if(c==accelMarker)
{
@@ -478,7 +478,7 @@ void RoughTransDlg::translate()
if(!word.contains(digitReg))
wordList.append(word);
- word=QString::null;
+ word=TQString::null;
}
}
else if(!word.isEmpty())
@@ -486,7 +486,7 @@ void RoughTransDlg::translate()
if(!word.contains(digitReg))
wordList.append(word);
- word=QString::null;
+ word=TQString::null;
}
}
@@ -503,7 +503,7 @@ void RoughTransDlg::translate()
if(!word.isEmpty() && !word.contains(digitReg))
wordList.append(word);
- word=QString::null;
+ word=TQString::null;
wordList.append("\\n\n");
index+=2;
@@ -513,7 +513,7 @@ void RoughTransDlg::translate()
if(!word.contains(digitReg))
wordList.append(word);
- word=QString::null;
+ word=TQString::null;
}
}
else if(!word.isEmpty())
@@ -521,7 +521,7 @@ void RoughTransDlg::translate()
if(!word.contains(digitReg))
wordList.append(word);
- word=QString::null;
+ word=TQString::null;
}
}
else if(!word.isEmpty())
@@ -530,7 +530,7 @@ void RoughTransDlg::translate()
wordList.append(word);
}
- word=QString::null;
+ word=TQString::null;
}
}
@@ -543,7 +543,7 @@ void RoughTransDlg::translate()
{
dictBox->setActiveModule(*dit);
- for(QStringList::Iterator it=wordList.begin();
+ for(TQStringList::Iterator it=wordList.begin();
it!=wordList.end(); ++it)
{
if( (*it)=="\\n\n" )
@@ -556,7 +556,7 @@ void RoughTransDlg::translate()
}
else
{
- QString trans = dictBox->translate(*it);
+ TQString trans = dictBox->translate(*it);
if(!trans.isEmpty())
{
@@ -571,7 +571,7 @@ void RoughTransDlg::translate()
}
if(wordCounter==0)
- translation=QString::null;
+ translation=TQString::null;
++dit;
}
@@ -610,9 +610,9 @@ void RoughTransDlg::translate()
{
if(!catalog->isUntranslated(i))
{
- QStringList msgs = catalog->msgstr(i);
+ TQStringList msgs = catalog->msgstr(i);
uint counter = 0;
- for( QStringList::Iterator it = msgs.begin() ; it != msgs.end() ; ++it)
+ for( TQStringList::Iterator it = msgs.begin() ; it != msgs.end() ; ++it)
{
DelTextCmd* delCmd = new DelTextCmd(0
,(*it),counter++);
@@ -668,7 +668,7 @@ void RoughTransDlg::showStatistics()
{
int nothing=totalTried-partTransCounter-exactTransCounter;
KLocale *locale = KGlobal::locale();
- QString statMsg = i18n("Result of the translation:\n"
+ TQString statMsg = i18n("Result of the translation:\n"
"Edited entries: %1\n"
"Exact translations: %2 (%3%)\n"
"Approximate translations: %4 (%5%)\n"
@@ -717,7 +717,7 @@ void RoughTransDlg::msgButtonClicked(int id)
if(!transButton->isChecked() && !untransButton->isChecked()
&& !fuzzyButton->isChecked())
{
- QButton *button = whatBox->find(id);
+ TQButton *button = whatBox->find(id);
if(button == transButton)
{
transButton->setChecked(true);
@@ -741,14 +741,14 @@ void RoughTransDlg::fuzzyButtonToggled(bool on)
{
if(!on)
{
- QString msg=i18n("<qt><p>"
+ TQString msg=i18n("<qt><p>"
"When a translation for a message is found, the entry "
"will be marked <b>fuzzy</b> by default. This is because the "
"translation is just guessed by KBabel and you should always "
"check the results carefully. Deactivate this option only if "
"you know what you are doing.</p></qt>");
- KMessageBox::information(this, msg, QString::null,"MarkFuzzyWarningInRoughTransDlg");
+ KMessageBox::information(this, msg, TQString::null,"MarkFuzzyWarningInRoughTransDlg");
}
}