summaryrefslogtreecommitdiffstats
path: root/src/optionssimple.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 23:15:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-01 23:15:51 +0000
commit6b1b516f42036cf9eff691dba3fd6e9eab82a7e1 (patch)
tree6830f75fd57d0fac7e33c097ee98b210e90c5239 /src/optionssimple.cpp
parent6318b8bb3ef964cfa99ba454a2630779cc9ac3ec (diff)
downloadsoundkonverter-6b1b516f42036cf9eff691dba3fd6e9eab82a7e1.tar.gz
soundkonverter-6b1b516f42036cf9eff691dba3fd6e9eab82a7e1.zip
TQt4 port soundkonverter
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/soundkonverter@1239038 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/optionssimple.cpp')
-rwxr-xr-xsrc/optionssimple.cpp128
1 files changed, 64 insertions, 64 deletions
diff --git a/src/optionssimple.cpp b/src/optionssimple.cpp
index 47b431f..48bb131 100755
--- a/src/optionssimple.cpp
+++ b/src/optionssimple.cpp
@@ -4,10 +4,10 @@
#include "convertpluginloader.h"
#include "optionsdetailed.h"
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qstring.h>
-#include <qtooltip.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqstring.h>
+#include <tqtooltip.h>
#include <klocale.h>
#include <kcombobox.h>
@@ -21,8 +21,8 @@
// FIXME when changing the output directory, check if the profile is a user defined and set it to 'User defined', if it is
// TODO hide lossless/hybrid/etc. when not available
-OptionsSimple::OptionsSimple( Config* _config, OptionsDetailed* _optionsDetailed, const QString &text, QWidget *parent, const char *name )
- : QWidget( parent, name )
+OptionsSimple::OptionsSimple( Config* _config, OptionsDetailed* _optionsDetailed, const TQString &text, TQWidget *tqparent, const char *name )
+ : TQWidget( tqparent, name )
{
config = _config;
optionsDetailed = _optionsDetailed;
@@ -30,13 +30,13 @@ OptionsSimple::OptionsSimple( Config* _config, OptionsDetailed* _optionsDetailed
// create an icon loader object for loading icons
KIconLoader* iconLoader = new KIconLoader();
- QGridLayout *grid = new QGridLayout( this, 3, 1, 6, 3 );
+ TQGridLayout *grid = new TQGridLayout( this, 3, 1, 6, 3 );
- QHBoxLayout *topBox = new QHBoxLayout( );
+ TQHBoxLayout *topBox = new TQHBoxLayout( );
grid->addLayout( topBox, 0, 0 );
- QLabel *lQuality = new QLabel( i18n("Quality")+":", this, "lQuality" );
- topBox->addWidget( lQuality, 0, Qt::AlignVCenter );
+ TQLabel *lQuality = new TQLabel( i18n("Quality")+":", this, "lQuality" );
+ topBox->addWidget( lQuality, 0, TQt::AlignVCenter );
cProfile = new KComboBox( this, "cProfile" );
sProfile += i18n("Very low");
sProfile += i18n("Low");
@@ -50,75 +50,75 @@ OptionsSimple::OptionsSimple( Config* _config, OptionsDetailed* _optionsDetailed
sProfile.remove( "Last used" );
sProfile += i18n("User defined");
cProfile->insertStringList( sProfile );
- topBox->addWidget( cProfile, 0, Qt::AlignVCenter );
- connect( cProfile, SIGNAL(activated(int)),
- this, SLOT(profileChanged())
+ topBox->addWidget( cProfile, 0, TQt::AlignVCenter );
+ connect( cProfile, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(profileChanged())
);
- connect( cProfile, SIGNAL(activated(int)),
- this, SLOT(somethingChanged())
+ connect( cProfile, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(somethingChanged())
);
topBox->addSpacing( 3 );
//pProfileRemove = new KToolBarButton( "editdelete", 1002, this, "pProfileRemove" );
pProfileRemove = new KPushButton( iconLoader->loadIcon("editdelete",KIcon::Small), i18n("Remove"), this, "pProfileRemove" );
pProfileRemove->hide();
- QToolTip::add( pProfileRemove, i18n("Remove the selected profile") );
- topBox->addWidget( pProfileRemove, 0, Qt::AlignVCenter );
- connect( pProfileRemove, SIGNAL(clicked()),
- this, SLOT(profileRemove())
+ TQToolTip::add( pProfileRemove, i18n("Remove the selected profile") );
+ topBox->addWidget( pProfileRemove, 0, TQt::AlignVCenter );
+ connect( pProfileRemove, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(profileRemove())
);
//pProfileInfo = new KToolBarButton( "messagebox_info", 1110, this, "pProfileInfo" );
pProfileInfo = new KPushButton( iconLoader->loadIcon("messagebox_info",KIcon::Small), i18n("Info"), this, "pProfileInfo" );
- QToolTip::add( pProfileInfo, i18n("Information about the selected profile") );
- topBox->addWidget( pProfileInfo, 0, Qt::AlignVCenter );
- connect( pProfileInfo, SIGNAL(clicked()),
- this, SLOT(profileInfo())
+ TQToolTip::add( pProfileInfo, i18n("Information about the selected profile") );
+ topBox->addWidget( pProfileInfo, 0, TQt::AlignVCenter );
+ connect( pProfileInfo, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(profileInfo())
);
topBox->addSpacing( 18 );
- QLabel *lFormat = new QLabel( i18n("Output format")+":", this, "lFormat" );
- topBox->addWidget( lFormat, 0, Qt::AlignVCenter );
+ TQLabel *lFormat = new TQLabel( i18n("Output format")+":", this, "lFormat" );
+ topBox->addWidget( lFormat, 0, TQt::AlignVCenter );
cFormat = new KComboBox( this, "cFormat" );
- topBox->addWidget( cFormat, 0, Qt::AlignVCenter );
- connect( cFormat, SIGNAL(activated(int)),
- this, SLOT(formatChanged())
+ topBox->addWidget( cFormat, 0, TQt::AlignVCenter );
+ connect( cFormat, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(formatChanged())
);
- connect( cFormat, SIGNAL(activated(int)),
- this, SLOT(somethingChanged())
+ connect( cFormat, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(somethingChanged())
);
topBox->addSpacing( 3 );
//pFormatInfo = new KToolBarButton( "messagebox_info", 1111, this, "pFormatInfo" );
pFormatInfo = new KPushButton( iconLoader->loadIcon("messagebox_info",KIcon::Small), i18n("Info"), this, "pFormatInfo" );
- QToolTip::add( pFormatInfo, i18n("Information about the selected file format") );
- topBox->addWidget( pFormatInfo, 0, Qt::AlignVCenter );
- connect( pFormatInfo, SIGNAL(clicked()),
- this, SLOT(formatInfo())
+ TQToolTip::add( pFormatInfo, i18n("Information about the selected file format") );
+ topBox->addWidget( pFormatInfo, 0, TQt::AlignVCenter );
+ connect( pFormatInfo, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(formatInfo())
);
topBox->addStretch( );
- QHBoxLayout *middleBox = new QHBoxLayout( );
+ TQHBoxLayout *middleBox = new TQHBoxLayout( );
grid->addLayout( middleBox, 1, 0 );
outputDirectory = new OutputDirectory( config, this, "outputDirectory" );
- middleBox->addWidget( outputDirectory, 0, Qt::AlignVCenter );
- connect( outputDirectory, SIGNAL(modeChanged(OutputDirectory::Mode)),
- this, SLOT(outputDirectoryModeChanged(OutputDirectory::Mode))
+ middleBox->addWidget( outputDirectory, 0, TQt::AlignVCenter );
+ connect( outputDirectory, TQT_SIGNAL(modeChanged(OutputDirectory::Mode)),
+ this, TQT_SLOT(outputDirectoryModeChanged(OutputDirectory::Mode))
);
- connect( outputDirectory, SIGNAL(directoryChanged(const QString&)),
- this, SLOT(outputDirectoryPathChanged(const QString&))
+ connect( outputDirectory, TQT_SIGNAL(directoryChanged(const TQString&)),
+ this, TQT_SLOT(outputDirectoryPathChanged(const TQString&))
);
- connect( outputDirectory, SIGNAL(modeChanged(OutputDirectory::Mode)),
- this, SLOT(somethingChanged())
+ connect( outputDirectory, TQT_SIGNAL(modeChanged(OutputDirectory::Mode)),
+ this, TQT_SLOT(somethingChanged())
);
- connect( outputDirectory, SIGNAL(directoryChanged(const QString&)),
- this, SLOT(somethingChanged())
+ connect( outputDirectory, TQT_SIGNAL(directoryChanged(const TQString&)),
+ this, TQT_SLOT(somethingChanged())
);
- QHBoxLayout *bottomBox = new QHBoxLayout( );
+ TQHBoxLayout *bottomBox = new TQHBoxLayout( );
grid->addLayout( bottomBox, 2, 0 );
- QLabel *lInfo = new QLabel( text, this, "lInfo" );
+ TQLabel *lInfo = new TQLabel( text, this, "lInfo" );
lInfo->setFixedHeight( cProfile->height() );
- bottomBox->addWidget( lInfo, 0, Qt::AlignVCenter | Qt::AlignLeft );
+ bottomBox->addWidget( lInfo, 0, TQt::AlignVCenter | TQt::AlignLeft );
// delete the icon loader object
delete iconLoader;
@@ -129,9 +129,9 @@ OptionsSimple::~OptionsSimple()
{
}
-int OptionsSimple::profileIndex( const QString &string )
+int OptionsSimple::profileIndex( const TQString &string )
{
- QString profile = string;
+ TQString profile = string;
if( profile == "Very low" ) profile = i18n("Very low");
else if( profile == "Low" ) profile = i18n("Low");
else if( profile == "Medium" ) profile = i18n("Medium");
@@ -140,17 +140,17 @@ int OptionsSimple::profileIndex( const QString &string )
else if( profile == "Lossless" ) profile = i18n("Lossless");
else if( profile == "Hybrid" ) profile = i18n("Hybrid");
else if( profile == "User defined" ) profile = i18n("User defined");
- return sProfile.findIndex( profile );
+ return sProfile.tqfindIndex( profile );
}
-int OptionsSimple::formatIndex( const QString &string )
+int OptionsSimple::formatIndex( const TQString &string )
{
- return sFormat.findIndex( string );
+ return sFormat.tqfindIndex( string );
}
void OptionsSimple::profileInfo()
{
- QString sProfileString = cProfile->currentText();
+ TQString sProfileString = cProfile->currentText();
if( sProfileString == i18n("Very low") ) {
KMessageBox::information( this,
@@ -202,7 +202,7 @@ void OptionsSimple::profileInfo()
void OptionsSimple::profileRemove()
{
int ret = KMessageBox::questionYesNo( this,
- i18n("Do you really want to remove the profile: %1").arg(cProfile->currentText()),
+ i18n("Do you really want to remove the profile: %1").tqarg(cProfile->currentText()),
i18n("Remove profile?") );
if( ret != KMessageBox::Yes ) return;
@@ -227,26 +227,26 @@ void OptionsSimple::profileRemove()
void OptionsSimple::formatInfo()
{
- QString format = cFormat->currentText();
+ TQString format = cFormat->currentText();
if( format == "wav" ) {
KMessageBox::information( this,
i18n("<p>Wave is a file format, that doesn't compress it's audio data.</p>\n<p>So the quality is very high, but the file size is enormous. It is widely spread and should work with every audio player.</p>\n<a href=\"http://en.wikipedia.org/wiki/Wav\">http://en.wikipedia.org/wiki/Wav</a>"),
i18n("File format")+": " + format,
- QString::null, KMessageBox::Notify | KMessageBox::AllowLink );
+ TQString(), KMessageBox::Notify | KMessageBox::AllowLink );
return;
}
else {
KMessageBox::information( this,
config->getFormatDescription(format),
i18n("File format")+": " + format,
- QString::null, KMessageBox::Notify | KMessageBox::AllowLink );
+ TQString(), KMessageBox::Notify | KMessageBox::AllowLink );
}
}
void OptionsSimple::profileChanged()
{
- QString last;
+ TQString last;
ConversionOptions options = config->getProfile( cProfile->currentText() );
if( !options.encodingOptions.sFormat.isEmpty() ) {
@@ -451,7 +451,7 @@ void OptionsSimple::formatChanged()
void OptionsSimple::outputDirectoryModeChanged( OutputDirectory::Mode mode )
{
optionsDetailed->setOutputDirectoryMode( mode );
- if( cProfile->currentText() != i18n("User defined") && config->getAllProfiles().findIndex(cProfile->currentText()) != -1 ) {
+ if( cProfile->currentText() != i18n("User defined") && config->getAllProfiles().tqfindIndex(cProfile->currentText()) != -1 ) {
ConversionOptions options = config->getProfile( cProfile->currentText() );
// if( options.encodingOptions.sFormat.isEmpty() ) return;
if( outputDirectory->mode() != options.outputOptions.mode || outputDirectory->directory() != options.outputOptions.directory ) {
@@ -462,10 +462,10 @@ void OptionsSimple::outputDirectoryModeChanged( OutputDirectory::Mode mode )
}
}
-void OptionsSimple::outputDirectoryPathChanged( const QString& path )
+void OptionsSimple::outputDirectoryPathChanged( const TQString& path )
{
optionsDetailed->setOutputDirectoryPath( path );
- if( cProfile->currentText() != i18n("User defined") && config->getAllProfiles().findIndex(cProfile->currentText()) != -1 ) {
+ if( cProfile->currentText() != i18n("User defined") && config->getAllProfiles().tqfindIndex(cProfile->currentText()) != -1 ) {
ConversionOptions options = config->getProfile( cProfile->currentText() );
// if( options.encodingOptions.sFormat.isEmpty() ) return;
if( outputDirectory->mode() != options.outputOptions.mode || outputDirectory->directory() != options.outputOptions.directory ) {
@@ -476,21 +476,21 @@ void OptionsSimple::outputDirectoryPathChanged( const QString& path )
}
}
-void OptionsSimple::setCurrentProfile( const QString& profile )
+void OptionsSimple::setCurrentProfile( const TQString& profile )
{
// TODO check profile (and don't change, if not available)
cProfile->setCurrentItem( profileIndex(profile) );
profileChanged();
}
-void OptionsSimple::setCurrentFormat( const QString& format )
+void OptionsSimple::setCurrentFormat( const TQString& format )
{
cFormat->setCurrentItem( formatIndex(format) );
formatChanged();
}
// TODO check for errors
-void OptionsSimple::setCurrentOutputDirectory( const QString& directory )
+void OptionsSimple::setCurrentOutputDirectory( const TQString& directory )
{
outputDirectory->setMode( OutputDirectory::Specify );
outputDirectory->setDirectory( directory );