diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /kmail/configuredialog_p.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmail/configuredialog_p.cpp')
-rw-r--r-- | kmail/configuredialog_p.cpp | 164 |
1 files changed, 82 insertions, 82 deletions
diff --git a/kmail/configuredialog_p.cpp b/kmail/configuredialog_p.cpp index 2b716b2d8..5cc86ccc2 100644 --- a/kmail/configuredialog_p.cpp +++ b/kmail/configuredialog_p.cpp @@ -26,61 +26,61 @@ #include <kdebug.h> // Qt headers: -#include <qheader.h> -#include <qtabwidget.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qlabel.h> -#include <qlayout.h> +#include <tqheader.h> +#include <tqtabwidget.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlayout.h> // Other headers: #include <assert.h> -NewIdentityDialog::NewIdentityDialog( const QStringList & identities, - QWidget *parent, const char *name, +NewIdentityDialog::NewIdentityDialog( const TQStringList & identities, + TQWidget *parent, const char *name, bool modal ) : KDialogBase( parent, name, modal, i18n("New Identity"), Ok|Cancel|Help, Ok, true ) { - setHelp( QString::fromLatin1("configure-identity-newidentitydialog") ); - QWidget * page = makeMainWidget(); - QVBoxLayout * vlay = new QVBoxLayout( page, 0, spacingHint() ); + setHelp( TQString::fromLatin1("configure-identity-newidentitydialog") ); + TQWidget * page = makeMainWidget(); + TQVBoxLayout * vlay = new TQVBoxLayout( page, 0, spacingHint() ); // row 0: line edit with label - QHBoxLayout * hlay = new QHBoxLayout( vlay ); // inherits spacing + TQHBoxLayout * hlay = new TQHBoxLayout( vlay ); // inherits spacing mLineEdit = new KLineEdit( page ); mLineEdit->setFocus(); - hlay->addWidget( new QLabel( mLineEdit, i18n("&New identity:"), page ) ); + hlay->addWidget( new TQLabel( mLineEdit, i18n("&New identity:"), page ) ); hlay->addWidget( mLineEdit, 1 ); - connect( mLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(slotEnableOK(const QString&)) ); + connect( mLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(slotEnableOK(const TQString&)) ); - mButtonGroup = new QButtonGroup( page ); + mButtonGroup = new TQButtonGroup( page ); mButtonGroup->hide(); // row 1: radio button - QRadioButton *radio = new QRadioButton( i18n("&With empty fields"), page ); + TQRadioButton *radio = new TQRadioButton( i18n("&With empty fields"), page ); radio->setChecked( true ); mButtonGroup->insert( radio, Empty ); vlay->addWidget( radio ); // row 2: radio button - radio = new QRadioButton( i18n("&Use Control Center settings"), page ); + radio = new TQRadioButton( i18n("&Use Control Center settings"), page ); mButtonGroup->insert( radio, ControlCenter ); vlay->addWidget( radio ); // row 3: radio button - radio = new QRadioButton( i18n("&Duplicate existing identity"), page ); + radio = new TQRadioButton( i18n("&Duplicate existing identity"), page ); mButtonGroup->insert( radio, ExistingEntry ); vlay->addWidget( radio ); // row 4: combobox with existing identities and label - hlay = new QHBoxLayout( vlay ); // inherits spacing - mComboBox = new QComboBox( false, page ); + hlay = new TQHBoxLayout( vlay ); // inherits spacing + mComboBox = new TQComboBox( false, page ); mComboBox->insertStringList( identities ); mComboBox->setEnabled( false ); - QLabel *label = new QLabel( mComboBox, i18n("&Existing identities:"), page ); + TQLabel *label = new TQLabel( mComboBox, i18n("&Existing identities:"), page ); label->setEnabled( false ); hlay->addWidget( label ); hlay->addWidget( mComboBox, 1 ); @@ -89,10 +89,10 @@ NewIdentityDialog::NewIdentityDialog( const QStringList & identities, // enable/disable combobox and label depending on the third radio // button's state: - connect( radio, SIGNAL(toggled(bool)), - label, SLOT(setEnabled(bool)) ); - connect( radio, SIGNAL(toggled(bool)), - mComboBox, SLOT(setEnabled(bool)) ); + connect( radio, TQT_SIGNAL(toggled(bool)), + label, TQT_SLOT(setEnabled(bool)) ); + connect( radio, TQT_SIGNAL(toggled(bool)), + mComboBox, TQT_SLOT(setEnabled(bool)) ); enableButtonOK( false ); // since line edit is empty } @@ -105,9 +105,9 @@ NewIdentityDialog::DuplicateMode NewIdentityDialog::duplicateMode() const { return static_cast<DuplicateMode>( id ); } -void NewIdentityDialog::slotEnableOK( const QString & proposedIdentityName ) { +void NewIdentityDialog::slotEnableOK( const TQString & proposedIdentityName ) { // OK button is disabled if - QString name = proposedIdentityName.stripWhiteSpace(); + TQString name = proposedIdentityName.stripWhiteSpace(); // name isn't empty if ( name.isEmpty() ) { enableButtonOK( false ); @@ -122,7 +122,7 @@ void NewIdentityDialog::slotEnableOK( const QString & proposedIdentityName ) { enableButtonOK( true ); } -ListView::ListView( QWidget *parent, const char *name, +ListView::ListView( TQWidget *parent, const char *name, int visibleItem ) : KListView( parent, name ) { @@ -130,14 +130,14 @@ ListView::ListView( QWidget *parent, const char *name, } -void ListView::resizeEvent( QResizeEvent *e ) +void ListView::resizeEvent( TQResizeEvent *e ) { KListView::resizeEvent(e); resizeColums(); } -void ListView::showEvent( QShowEvent *e ) +void ListView::showEvent( TQShowEvent *e ) { KListView::showEvent(e); resizeColums(); @@ -169,16 +169,16 @@ void ListView::setVisibleItem( int visibleItem, bool updateSize ) mVisibleItem = QMAX( 1, visibleItem ); if( updateSize == true ) { - QSize s = sizeHint(); + TQSize s = sizeHint(); setMinimumSize( s.width() + verticalScrollBar()->sizeHint().width() + lineWidth() * 2, s.height() ); } } -QSize ListView::sizeHint() const +TQSize ListView::sizeHint() const { - QSize s = QListView::sizeHint(); + TQSize s = TQListView::sizeHint(); int h = fontMetrics().height() + 2*itemMargin(); if( h % 2 > 0 ) { h++; } @@ -188,45 +188,45 @@ QSize ListView::sizeHint() const } -static QString flagPng = QString::fromLatin1("/flag.png"); +static TQString flagPng = TQString::fromLatin1("/flag.png"); NewLanguageDialog::NewLanguageDialog( LanguageItemList & suppressedLangs, - QWidget *parent, const char *name, + TQWidget *parent, const char *name, bool modal ) : KDialogBase( parent, name, modal, i18n("New Language"), Ok|Cancel, Ok, true ) { // layout the page (a combobox with label): - QWidget *page = makeMainWidget(); - QHBoxLayout *hlay = new QHBoxLayout( page, 0, spacingHint() ); - mComboBox = new QComboBox( false, page ); - hlay->addWidget( new QLabel( mComboBox, i18n("Choose &language:"), page ) ); + TQWidget *page = makeMainWidget(); + TQHBoxLayout *hlay = new TQHBoxLayout( page, 0, spacingHint() ); + mComboBox = new TQComboBox( false, page ); + hlay->addWidget( new TQLabel( mComboBox, i18n("Choose &language:"), page ) ); hlay->addWidget( mComboBox, 1 ); - QStringList pathList = KGlobal::dirs()->findAllResources( "locale", - QString::fromLatin1("*/entry.desktop") ); + TQStringList pathList = KGlobal::dirs()->findAllResources( "locale", + TQString::fromLatin1("*/entry.desktop") ); // extract a list of language tags that should not be included: - QStringList suppressedAcronyms; + TQStringList suppressedAcronyms; for ( LanguageItemList::Iterator lit = suppressedLangs.begin(); lit != suppressedLangs.end(); ++lit ) suppressedAcronyms << (*lit).mLanguage; // populate the combo box: - for ( QStringList::ConstIterator it = pathList.begin(); + for ( TQStringList::ConstIterator it = pathList.begin(); it != pathList.end(); ++it ) { KSimpleConfig entry( *it ); entry.setGroup( "KCM Locale" ); // full name: - QString name = entry.readEntry( "Name" ); + TQString name = entry.readEntry( "Name" ); // {2,3}-letter abbreviation: // we extract it from the path: "/prefix/de/entry.desktop" -> "de" - QString acronym = (*it).section( '/', -2, -2 ); + TQString acronym = (*it).section( '/', -2, -2 ); if ( suppressedAcronyms.find( acronym ) == suppressedAcronyms.end() ) { // not found: - QString displayname = QString::fromLatin1("%1 (%2)") + TQString displayname = TQString::fromLatin1("%1 (%2)") .arg( name ).arg( acronym ); - QPixmap flag( locate("locale", acronym + flagPng ) ); + TQPixmap flag( locate("locale", acronym + flagPng ) ); mComboBox->insertItem( flag, displayname ); } } @@ -236,40 +236,40 @@ NewLanguageDialog::NewLanguageDialog( LanguageItemList & suppressedLangs, } else mComboBox->listBox()->sort(); } -QString NewLanguageDialog::language() const +TQString NewLanguageDialog::language() const { - QString s = mComboBox->currentText(); + TQString s = mComboBox->currentText(); int i = s.findRev( '(' ); return s.mid( i + 1, s.length() - i - 2 ); } -LanguageComboBox::LanguageComboBox( bool rw, QWidget *parent, const char *name ) - : QComboBox( rw, parent, name ) +LanguageComboBox::LanguageComboBox( bool rw, TQWidget *parent, const char *name ) + : TQComboBox( rw, parent, name ) { } -int LanguageComboBox::insertLanguage( const QString & language ) +int LanguageComboBox::insertLanguage( const TQString & language ) { - static QString entryDesktop = QString::fromLatin1("/entry.desktop"); + static TQString entryDesktop = TQString::fromLatin1("/entry.desktop"); KSimpleConfig entry( locate("locale", language + entryDesktop) ); entry.setGroup( "KCM Locale" ); - QString name = entry.readEntry( "Name" ); - QString output = QString::fromLatin1("%1 (%2)").arg( name ).arg( language ); - insertItem( QPixmap( locate("locale", language + flagPng ) ), output ); + TQString name = entry.readEntry( "Name" ); + TQString output = TQString::fromLatin1("%1 (%2)").arg( name ).arg( language ); + insertItem( TQPixmap( locate("locale", language + flagPng ) ), output ); return listBox()->index( listBox()->findItem(output) ); } -QString LanguageComboBox::language() const +TQString LanguageComboBox::language() const { - QString s = currentText(); + TQString s = currentText(); int i = s.findRev( '(' ); return s.mid( i + 1, s.length() - i - 2 ); } -void LanguageComboBox::setLanguage( const QString & language ) +void LanguageComboBox::setLanguage( const TQString & language ) { - QString parenthizedLanguage = QString::fromLatin1("(%1)").arg( language ); + TQString parenthizedLanguage = TQString::fromLatin1("(%1)").arg( language ); for (int i = 0; i < count(); i++) // ### FIXME: use .endWith(): if ( text(i).find( parenthizedLanguage ) >= 0 ) { @@ -284,12 +284,12 @@ void LanguageComboBox::setLanguage( const QString & language ) // // -ProfileDialog::ProfileDialog( QWidget * parent, const char * name, bool modal ) +ProfileDialog::ProfileDialog( TQWidget * parent, const char * name, bool modal ) : KDialogBase( parent, name, modal, i18n("Load Profile"), Ok|Cancel, Ok, true ) { // tmp. vars: - QWidget * page = makeMainWidget(); - QVBoxLayout * vlay = new QVBoxLayout( page, 0, spacingHint() ); + TQWidget * page = makeMainWidget(); + TQVBoxLayout * vlay = new TQVBoxLayout( page, 0, spacingHint() ); mListView = new KListView( page, "mListView" ); mListView->addColumn( i18n("Available Profiles") ); @@ -298,19 +298,19 @@ ProfileDialog::ProfileDialog( QWidget * parent, const char * name, bool modal ) mListView->setAllColumnsShowFocus( true ); mListView->setSorting( -1 ); - vlay->addWidget( new QLabel( mListView, + vlay->addWidget( new TQLabel( mListView, i18n("&Select a profile and click 'OK' to " "load its settings:"), page ) ); vlay->addWidget( mListView, 1 ); setup(); - connect( mListView, SIGNAL(selectionChanged()), - SLOT(slotSelectionChanged()) ); - connect( mListView, SIGNAL(doubleClicked ( QListViewItem *, const QPoint &, int ) ), - SLOT(slotOk()) ); + connect( mListView, TQT_SIGNAL(selectionChanged()), + TQT_SLOT(slotSelectionChanged()) ); + connect( mListView, TQT_SIGNAL(doubleClicked ( TQListViewItem *, const TQPoint &, int ) ), + TQT_SLOT(slotOk()) ); - connect( this, SIGNAL(finished()), SLOT(delayedDestruct()) ); + connect( this, TQT_SIGNAL(finished()), TQT_SLOT(delayedDestruct()) ); enableButtonOK( false ); } @@ -323,31 +323,31 @@ void ProfileDialog::slotSelectionChanged() void ProfileDialog::setup() { mListView->clear(); // find all profiles (config files named "profile-xyz-rc"): - const QString profileFilenameFilter = QString::fromLatin1("kmail/profile-*-rc"); + const TQString profileFilenameFilter = TQString::fromLatin1("kmail/profile-*-rc"); mProfileList = KGlobal::dirs()->findAllResources( "data", profileFilenameFilter ); kdDebug(5006) << "Profile manager: found " << mProfileList.count() << " profiles:" << endl; // build the list and populate the list view: - QListViewItem * listItem = 0; - for ( QStringList::const_iterator it = mProfileList.begin() ; + TQListViewItem * listItem = 0; + for ( TQStringList::const_iterator it = mProfileList.begin() ; it != mProfileList.end() ; ++it ) { KConfig profile( *it, true /* read-only */, false /* no KDE global */ ); profile.setGroup("KMail Profile"); - QString name = profile.readEntry( "Name" ); + TQString name = profile.readEntry( "Name" ); if ( name.isEmpty() ) { kdWarning(5006) << "File \"" << (*it) << "\" doesn't provide a profile name!" << endl; name = i18n("Missing profile name placeholder","Unnamed"); } - QString desc = profile.readEntry( "Comment" ); + TQString desc = profile.readEntry( "Comment" ); if ( desc.isEmpty() ) { kdWarning(5006) << "File \"" << (*it) << "\" doesn't provide a description!" << endl; desc = i18n("Missing profile description placeholder","Not available"); } - listItem = new QListViewItem( mListView, listItem, name, desc ); + listItem = new TQListViewItem( mListView, listItem, name, desc ); } } @@ -364,19 +364,19 @@ void ProfileDialog::slotOk() { } -ConfigModuleWithTabs::ConfigModuleWithTabs( QWidget * parent, +ConfigModuleWithTabs::ConfigModuleWithTabs( TQWidget * parent, const char * name ) : ConfigModule( parent, name ) { - QVBoxLayout *vlay = new QVBoxLayout( this, 0, KDialog::spacingHint() ); - mTabWidget = new QTabWidget( this ); + TQVBoxLayout *vlay = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); + mTabWidget = new TQTabWidget( this ); vlay->addWidget( mTabWidget ); } -void ConfigModuleWithTabs::addTab( ConfigModuleTab* tab, const QString & title ) { +void ConfigModuleWithTabs::addTab( ConfigModuleTab* tab, const TQString & title ) { mTabWidget->addTab( tab, title ); - connect( tab, SIGNAL(changed( bool )), - this, SIGNAL(changed( bool )) ); + connect( tab, TQT_SIGNAL(changed( bool )), + this, TQT_SIGNAL(changed( bool )) ); } void ConfigModuleWithTabs::load() { |