From f138d74fe16092003b06f5bde9663841929cde7f Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 17 Jun 2011 22:17:08 +0000 Subject: TQt4 port kdeaccessibility This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1237325 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl | 2 +- kttsd/plugins/hadifix/hadifixconf.cpp | 38 ++++++------ kttsd/plugins/hadifix/hadifixconf.h | 9 +-- kttsd/plugins/hadifix/hadifixconfigui.ui | 94 +++++++++++++++--------------- kttsd/plugins/hadifix/hadifixconfigui.ui.h | 10 ++-- kttsd/plugins/hadifix/hadifixproc.cpp | 32 +++++----- kttsd/plugins/hadifix/hadifixproc.h | 5 +- kttsd/plugins/hadifix/initialconfig.h | 8 +-- kttsd/plugins/hadifix/voicefileui.ui | 16 ++--- kttsd/plugins/hadifix/voicefileui.ui.h | 6 +- 10 files changed, 111 insertions(+), 109 deletions(-) (limited to 'kttsd/plugins/hadifix') diff --git a/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl b/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl index 5a81c8f..afa9b43 100644 --- a/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl +++ b/kttsd/plugins/hadifix/SSMLtoTxt2pho.xsl @@ -113,7 +113,7 @@ - + diff --git a/kttsd/plugins/hadifix/hadifixconf.cpp b/kttsd/plugins/hadifix/hadifixconf.cpp index 0249aea..1d4a2cc 100644 --- a/kttsd/plugins/hadifix/hadifixconf.cpp +++ b/kttsd/plugins/hadifix/hadifixconf.cpp @@ -14,7 +14,7 @@ * * ***************************************************************************/ -// Qt includes. +// TQt includes. #include #include #include @@ -92,15 +92,15 @@ class HadifixConfPrivate { TQString name = TQFileInfo(*it).fileName(); gender = HadifixProc::determineGender(defaultMbrolaExec, *it); if (gender == HadifixProc::MaleGender) - configWidget->addVoice(*it, true, i18n("Male voice \"%1\"").arg(name)); + configWidget->addVoice(*it, true, i18n("Male voice \"%1\"").tqarg(name)); else if (gender == HadifixProc::FemaleGender) - configWidget->addVoice(*it, false, i18n("Female voice \"%1\"").arg(name)); + configWidget->addVoice(*it, false, i18n("Female voice \"%1\"").tqarg(name)); else { if (name == "de1") - configWidget->addVoice(*it, false, i18n("Female voice \"%1\"").arg(name)); + configWidget->addVoice(*it, false, i18n("Female voice \"%1\"").tqarg(name)); else { - configWidget->addVoice(*it, true, i18n("Unknown voice \"%1\"").arg(name)); - configWidget->addVoice(*it, false, i18n("Unknown voice \"%1\"").arg(name)); + configWidget->addVoice(*it, true, i18n("Unknown voice \"%1\"").tqarg(name)); + configWidget->addVoice(*it, false, i18n("Unknown voice \"%1\"").tqarg(name)); } } } @@ -203,11 +203,11 @@ class HadifixConfPrivate { }; /** Constructor */ -HadifixConf::HadifixConf( TQWidget* parent, const char* name, const TQStringList &) : - PlugInConf( parent, name ){ +HadifixConf::HadifixConf( TQWidget* tqparent, const char* name, const TQStringList &) : + PlugInConf( tqparent, name ){ // kdDebug() << "HadifixConf::HadifixConf: Running" << endl; - TQVBoxLayout *layout = new TQVBoxLayout (this, KDialog::marginHint(), KDialog::spacingHint(), "CommandConfigWidgetLayout"); - layout->setAlignment (Qt::AlignTop); + TQVBoxLayout *tqlayout = new TQVBoxLayout (this, KDialog::marginHint(), KDialog::spacingHint(), "CommandConfigWidgetLayout"); + tqlayout->tqsetAlignment (TQt::AlignTop); d = new HadifixConfPrivate(); d->configWidget = new HadifixConfigUI (this, "configWidget"); @@ -224,7 +224,7 @@ HadifixConf::HadifixConf( TQWidget* parent, const char* name, const TQStringList d->initializeCharacterCodes(); d->initializeVoices(); d->setDefaults(); - layout->addWidget (d->configWidget); + tqlayout->addWidget (d->configWidget); } /** Destructor */ @@ -284,15 +284,15 @@ TQString HadifixConf::getTalkerCode() "" "" "") - .arg(d->languageCode) - .arg(voiceCode) - .arg(gender) - .arg(volume) - .arg(rate) - .arg("Hadifix"); + .tqarg(d->languageCode) + .tqarg(voiceCode) + .tqarg(gender) + .tqarg(volume) + .tqarg(rate) + .tqarg("Hadifix"); } } - return TQString::null; + return TQString(); } void HadifixConf::voiceButton_clicked () { @@ -393,7 +393,7 @@ void HadifixConf::slotSynthFinished() // Player object deletes the wave file when done. if (m_player) m_player->play(d->waveFile); TQFile::remove(d->waveFile); - d->waveFile = TQString::null; + d->waveFile = TQString(); if (d->progressDlg) d->progressDlg->close(); } diff --git a/kttsd/plugins/hadifix/hadifixconf.h b/kttsd/plugins/hadifix/hadifixconf.h index 4ef96a6..7eb7b30 100644 --- a/kttsd/plugins/hadifix/hadifixconf.h +++ b/kttsd/plugins/hadifix/hadifixconf.h @@ -11,11 +11,12 @@ class HadifixProc; class HadifixConfPrivate; class HadifixConf : public PlugInConf { - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: /** Constructor */ - HadifixConf( TQWidget* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); + HadifixConf( TQWidget* tqparent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~HadifixConf(); @@ -44,7 +45,7 @@ class HadifixConf : public PlugInConf { * This function informs the plugin of the desired language to be spoken * by the plugin. The plugin should attempt to adapt itself to the * specified language code, choosing sensible defaults if necessary. - * If the passed-in code is TQString::null, no specific language has + * If the passed-in code is TQString(), no specific language has * been chosen. * @param lang The desired language code or Null if none. * @@ -62,7 +63,7 @@ class HadifixConf : public PlugInConf { * Return fully-specified talker code for the configured plugin. This code * uniquely identifies the configured instance of the plugin and distinquishes * one instance from another. If the plugin has not been fully configured, - * i.e., cannot yet synthesize, return TQString::null. + * i.e., cannot yet synthesize, return TQString(). * @return Fully-specified talker code. */ TQString getTalkerCode(); diff --git a/kttsd/plugins/hadifix/hadifixconfigui.ui b/kttsd/plugins/hadifix/hadifixconfigui.ui index 302c1de..8a61bff 100644 --- a/kttsd/plugins/hadifix/hadifixconfigui.ui +++ b/kttsd/plugins/hadifix/hadifixconfigui.ui @@ -1,6 +1,6 @@ HadifixConfigUI - + HadifixConfigUI @@ -28,7 +28,7 @@ 6 - + GroupBox4 @@ -56,7 +56,7 @@ 6 - + basicOptions @@ -81,7 +81,7 @@ unnamed - + voiceLabel @@ -135,7 +135,7 @@ &Select... - + volumeLabel @@ -188,7 +188,7 @@ Adjusts the volume of speech. Slide to left for softer speech; to the right for louder. - + volumeSlider @@ -223,7 +223,7 @@ Adjusts the volume of speech. Slide to left for softer speech; to the right for louder. - + timeLabel @@ -276,7 +276,7 @@ Adjusts the speed of speech. Slide to left for slower speech; to the right for faster. - + timeSlider @@ -305,7 +305,7 @@ Adjusts the speed of speech. Slide to left for slower speech; to the right for faster. - + frequencyLabel @@ -355,7 +355,7 @@ Adjusts the pitch (tone) of speech. Slide to left for lower speech; to the right for higher. - + frequencySlider @@ -383,7 +383,7 @@ - + advancedOptions @@ -408,7 +408,7 @@ 6 - + hadifixBinLabel @@ -438,7 +438,7 @@ If the txt2pho program is in your PATH environment variable, simply enter "txt2pho", otherwise specify the full path to the txt2pho executable program. - + mbrolaBinLabel @@ -468,15 +468,15 @@ If the Mbrola program is in your PATH environment variable, simply enter "mbrola", otherwise specify the full path to the Mbrola executable program. - + - layout5 + tqlayout5 unnamed - + characterCodingLabel @@ -525,7 +525,7 @@ Preferred - + 240 20 @@ -596,84 +596,84 @@ voiceCombo - activated(const QString&) + activated(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) volumeBox - valueChanged(const QString&) + valueChanged(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) timeBox - valueChanged(const QString&) + valueChanged(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) frequencyBox - valueChanged(const QString&) + valueChanged(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) hadifixURL - textChanged(const QString&) + textChanged(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) mbrolaURL - textChanged(const QString&) + textChanged(const TQString&) HadifixConfigUI - changed(const QString&) + changed(const TQString&) - qradiobutton.h - qpixmap.h + tqradiobutton.h + tqpixmap.h kurl.h - qmap.h + tqmap.h kglobal.h - qstringlist.h + tqstringlist.h math.h kiconloader.h - class QStringList; + class TQStringList; - QMap<QString,int> maleVoices; - QMap<int,QString> defaultVoices; + TQMap<TQString,int> maleVoices; + TQMap<int,TQString> defaultVoices; QPixmap female; QPixmap male; - QMap<QString,int> femaleVoices; + TQMap<TQString,int> femaleVoices; - + changed(bool) - - + + volumeBox_valueChanged( int percentValue ) timeBox_valueChanged( int percentValue ) frequencyBox_valueChanged( int percentValue ) volumeSlider_valueChanged( int sliderValue ) timeSlider_valueChanged( int sliderValue ) frequencySlider_valueChanged( int sliderValue ) - changed( const QString & ) - + changed( const TQString & ) + percentToSlider( int percentValue ) sliderToPercent( int sliderValue ) init() - addVoice( const QString &filename, bool isMale ) - addVoice( const QString &filename, bool isMale, const QString &displayname ) - setVoice( const QString &filename, bool isMale ) - getVoiceFilename() + addVoice( const TQString &filename, bool isMale ) + addVoice( const TQString &filename, bool isMale, const TQString &displayname ) + setVoice( const TQString &filename, bool isMale ) + getVoiceFilename() isMaleVoice() - + kcombobox.h kpushbutton.h diff --git a/kttsd/plugins/hadifix/hadifixconfigui.ui.h b/kttsd/plugins/hadifix/hadifixconfigui.ui.h index 7c21c54..cc6632c 100644 --- a/kttsd/plugins/hadifix/hadifixconfigui.ui.h +++ b/kttsd/plugins/hadifix/hadifixconfigui.ui.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** -** If you wish to add, delete or rename slots use Qt Designer which will +** If you wish to add, delete or rename slots use TQt Designer which will ** update this file, preserving your code. Create an init() slot in place of ** a constructor, and a destroy() slot in place of a destructor. *****************************************************************************/ @@ -53,14 +53,14 @@ void HadifixConfigUI::init () { void HadifixConfigUI::addVoice (const TQString &filename, bool isMale) { if (isMale) { - if (!maleVoices.contains(filename)) { + if (!maleVoices.tqcontains(filename)) { int id = voiceCombo->count(); maleVoices.insert (filename, id); voiceCombo->insertItem (male, filename, id); } } else { - if (!femaleVoices.contains(filename)) { + if (!femaleVoices.tqcontains(filename)) { int id = voiceCombo->count(); femaleVoices.insert (filename, id); voiceCombo->insertItem (female, filename, id); @@ -93,7 +93,7 @@ TQString HadifixConfigUI::getVoiceFilename() { int curr = voiceCombo->currentItem(); TQString filename = voiceCombo->text(curr); - if (defaultVoices.contains(curr)) + if (defaultVoices.tqcontains(curr)) filename = defaultVoices[curr]; return filename; @@ -103,7 +103,7 @@ bool HadifixConfigUI::isMaleVoice() { int curr = voiceCombo->currentItem(); TQString filename = getVoiceFilename(); - if (maleVoices.contains(filename)) + if (maleVoices.tqcontains(filename)) return maleVoices[filename] == curr; else return false; diff --git a/kttsd/plugins/hadifix/hadifixproc.cpp b/kttsd/plugins/hadifix/hadifixproc.cpp index 598eb21..3e4b4ee 100644 --- a/kttsd/plugins/hadifix/hadifixproc.cpp +++ b/kttsd/plugins/hadifix/hadifixproc.cpp @@ -35,7 +35,7 @@ class HadifixProcPrivate { hadifixProc = 0; waitingStop = false; state = psIdle; - synthFilename = TQString::null; + synthFilename = TQString(); gender = false; volume = 100; time = 100; @@ -49,9 +49,9 @@ class HadifixProcPrivate { void load(KConfig *config, const TQString &configGroup) { config->setGroup(configGroup); - hadifix = config->readEntry ("hadifixExec", TQString::null); - mbrola = config->readEntry ("mbrolaExec", TQString::null); - voice = config->readEntry ("voice", TQString::null); + hadifix = config->readEntry ("hadifixExec", TQString()); + mbrola = config->readEntry ("mbrolaExec", TQString()); + voice = config->readEntry ("voice", TQString()); gender = config->readBoolEntry("gender", false); volume = config->readNumEntry ("volume", 100); time = config->readNumEntry ("time", 100); @@ -75,8 +75,8 @@ class HadifixProcPrivate { }; /** Constructor */ -HadifixProc::HadifixProc( TQObject* parent, const char* name, const TQStringList &) : - PlugInProc( parent, name ){ +HadifixProc::HadifixProc( TQObject* tqparent, const char* name, const TQStringList &) : + PlugInProc( tqparent, name ){ // kdDebug() << "HadifixProc::HadifixProc: Running" << endl; d = 0; } @@ -184,9 +184,9 @@ void HadifixProc::synth(TQString text, TQString mbrolaCommand = d->hadifixProc->quote(mbrola); mbrolaCommand += " -e"; //Ignore fatal errors on unkown diphone - mbrolaCommand += TQString(" -v %1").arg(volume/100.0); // volume ratio - mbrolaCommand += TQString(" -f %1").arg(pitch/100.0); // freqency ratio - mbrolaCommand += TQString(" -t %1").arg(1/(time/100.0)); // time ratio + mbrolaCommand += TQString(" -v %1").tqarg(volume/100.0); // volume ratio + mbrolaCommand += TQString(" -f %1").tqarg(pitch/100.0); // freqency ratio + mbrolaCommand += TQString(" -t %1").tqarg(1/(time/100.0)); // time ratio mbrolaCommand += " " + d->hadifixProc->quote(voice); mbrolaCommand += " - " + d->hadifixProc->quote(waveFilename); @@ -285,7 +285,7 @@ void HadifixProc::ackFinished() if (d->state == psFinished) { d->state = psIdle; - d->synthFilename = TQString::null; + d->synthFilename = TQString(); } } @@ -364,8 +364,8 @@ HadifixProc::VoiceGender HadifixProc::determineGender(TQString mbrola, TQString connect(&proc, TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), &speech, TQT_SLOT(receivedStderr(KProcess *, char *, int))); - speech.stdOut = TQString::null; - speech.stdErr = TQString::null; + speech.stdOut = TQString(); + speech.stdErr = TQString(); proc.start (KProcess::Block, KProcess::AllOutput); VoiceGender result; @@ -377,9 +377,9 @@ HadifixProc::VoiceGender HadifixProc::determineGender(TQString mbrola, TQString else { if (output != 0) *output = speech.stdOut; - if (speech.stdOut.contains("female", false)) + if (speech.stdOut.tqcontains("female", false)) result = FemaleGender; - else if (speech.stdOut.contains("male", false)) + else if (speech.stdOut.tqcontains("male", false)) result = MaleGender; else result = NoGender; @@ -389,11 +389,11 @@ HadifixProc::VoiceGender HadifixProc::determineGender(TQString mbrola, TQString } void HadifixProc::receivedStdout (KProcess *, char *buffer, int buflen) { - stdOut += TQString::fromLatin1(buffer, buflen); + stdOut += TQString::tqfromLatin1(buffer, buflen); } void HadifixProc::receivedStderr (KProcess *, char *buffer, int buflen) { - stdErr += TQString::fromLatin1(buffer, buflen); + stdErr += TQString::tqfromLatin1(buffer, buflen); } /** diff --git a/kttsd/plugins/hadifix/hadifixproc.h b/kttsd/plugins/hadifix/hadifixproc.h index 01b7c5d..4fbf03b 100644 --- a/kttsd/plugins/hadifix/hadifixproc.h +++ b/kttsd/plugins/hadifix/hadifixproc.h @@ -26,7 +26,8 @@ class KProcess; class HadifixProcPrivate; class HadifixProc : public PlugInProc{ - Q_OBJECT + Q_OBJECT + TQ_OBJECT public: enum VoiceGender { @@ -37,7 +38,7 @@ class HadifixProc : public PlugInProc{ }; /** Constructor */ - HadifixProc( TQObject* parent = 0, const char* name = 0, const TQStringList &args = TQStringList()); + HadifixProc( TQObject* tqparent = 0, const char* name = 0, const TQStringList &args = TQStringList()); /** Destructor */ ~HadifixProc(); diff --git a/kttsd/plugins/hadifix/initialconfig.h b/kttsd/plugins/hadifix/initialconfig.h index 02e920c..62ff659 100644 --- a/kttsd/plugins/hadifix/initialconfig.h +++ b/kttsd/plugins/hadifix/initialconfig.h @@ -71,7 +71,7 @@ TQString findExecutable (const TQStringList &names, const TQString &possiblePath } // Both tries failed, so the user has to locate the executable. - return TQString::null; + return TQString(); } /** Tries to find the voice files by looking onto the hard disk. */ @@ -100,7 +100,7 @@ TQStringList findVoices(TQString mbrolaExec, const TQString &hadifixDataPath) { // 2b) search near the hadifix data path info.setFile(hadifixDataPath + "../../mbrola"); TQString mbrolaPath = info.dirPath (true) + "/mbrola"; - if (!list.contains(mbrolaPath)) + if (!list.tqcontains(mbrolaPath)) list += mbrolaPath; // 2c) broaden the search by adding subdirs (with a depth of 2) @@ -114,7 +114,7 @@ TQStringList findVoices(TQString mbrolaExec, const TQString &hadifixDataPath) { TQStringList result; TQStringList::iterator it; for (it = list.begin(); it != list.end(); ++it) { - TQDir baseDir (*it, TQString::null, + TQDir baseDir (*it, TQString(), TQDir::Name|TQDir::IgnoreCase, TQDir::Files); TQStringList files = baseDir.entryList(); @@ -148,7 +148,7 @@ TQStringList findSubdirs (const TQStringList &baseDirs) { TQStringList::ConstIterator itEnd = baseDirs.constEnd(); for (it = baseDirs.constBegin(); it != itEnd; ++it) { // a) get a list of directory names - TQDir baseDir (*it, TQString::null, + TQDir baseDir (*it, TQString(), TQDir::Name|TQDir::IgnoreCase, TQDir::Dirs); TQStringList list = baseDir.entryList(); diff --git a/kttsd/plugins/hadifix/voicefileui.ui b/kttsd/plugins/hadifix/voicefileui.ui index 6c038f7..3c9a5fa 100644 --- a/kttsd/plugins/hadifix/voicefileui.ui +++ b/kttsd/plugins/hadifix/voicefileui.ui @@ -1,6 +1,6 @@ VoiceFileWidget - + VoiceFileWidget @@ -25,7 +25,7 @@ 6 - + voiceFileLabel @@ -44,7 +44,7 @@ Plain - + genderOption @@ -61,7 +61,7 @@ 6 - + femaleOption @@ -69,7 +69,7 @@ Female - + maleOption @@ -106,10 +106,10 @@ QString mbrola; - + genderButton_clicked() - - + + kurlrequester.h klineedit.h diff --git a/kttsd/plugins/hadifix/voicefileui.ui.h b/kttsd/plugins/hadifix/voicefileui.ui.h index 16e65e5..dfd177d 100644 --- a/kttsd/plugins/hadifix/voicefileui.ui.h +++ b/kttsd/plugins/hadifix/voicefileui.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use -** Qt Designer which will update this file, preserving your code. Create an +** TQt Designer which will update this file, preserving your code. Create an ** init() function in place of a constructor, and a destroy() function in ** place of a destructor. *****************************************************************************/ @@ -24,12 +24,12 @@ void VoiceFileWidget::genderButton_clicked() } else if (gender == HadifixProc::NoGender) { KMessageBox::sorry (this, - i18n("The gender of the voice file %1 could not be detected.").arg(voiceFileURL->url()), + i18n("The gender of the voice file %1 could not be detected.").tqarg(voiceFileURL->url()), i18n("Trying to Determine the Gender - Hadifix Plug In")); } else { KMessageBox::detailedSorry (this, - i18n("The file %1 does not seem to be a voice file.").arg(voiceFileURL->url()), + i18n("The file %1 does not seem to be a voice file.").tqarg(voiceFileURL->url()), details, i18n("Trying to Determine the Gender - Hadifix Plug In")); } } -- cgit v1.2.1