summaryrefslogtreecommitdiffstats
path: root/src/profiledialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/profiledialog.cpp')
-rw-r--r--src/profiledialog.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/src/profiledialog.cpp b/src/profiledialog.cpp
index b4c8f2b..c6c8ef7 100644
--- a/src/profiledialog.cpp
+++ b/src/profiledialog.cpp
@@ -20,18 +20,18 @@
* *
***************************************************************************/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qlistbox.h>
-#include <qmap.h>
-#include <qpopupmenu.h>
+#include <ntqlabel.h>
+#include <ntqlayout.h>
+#include <ntqlineedit.h>
+#include <ntqlistbox.h>
+#include <ntqmap.h>
+#include <ntqpopupmenu.h>
#include <kapplication.h>
-#include <kconfig.h>
+#include <tdeconfig.h>
#include <kdebug.h>
#include <kinputdialog.h>
-#include <klocale.h>
+#include <tdelocale.h>
#include <kmessagebox.h>
#include "profiledialog.h"
@@ -40,8 +40,8 @@
// ===========
ProfileDialog::ProfileDialog( Action action,
- const QString& currentProfile,
- QWidget* parent,
+ const TQString& currentProfile,
+ TQWidget* parent,
const char* name )
: KDialogBase( Plain, "", Ok | Cancel, Ok, parent, name ),
m_action( action )
@@ -56,27 +56,27 @@ ProfileDialog::ProfileDialog( Action action,
createlayout( );
setInitialValues( currentProfile );
- connect( m_profileListBox, SIGNAL( contextMenuRequested( QListBoxItem*, const QPoint& )), SLOT( slotProfileListContextMenu( QListBoxItem*, const QPoint& )));
- connect( m_profileListBox, SIGNAL( doubleClicked( QListBoxItem* )), SLOT( slotOk( )));
+ connect( m_profileListBox, SIGNAL( contextMenuRequested( TQListBoxItem*, const TQPoint& )), SLOT( slotProfileListContextMenu( TQListBoxItem*, const TQPoint& )));
+ connect( m_profileListBox, SIGNAL( doubleClicked( TQListBoxItem* )), SLOT( slotOk( )));
connect( m_profileListBox, SIGNAL( selectionChanged( )), SLOT( slotProfileListBoxChanged( )));
}
// checkForDuplicateName
// =====================
-bool ProfileDialog::checkForDuplicateName( const QString& profileName )
+bool ProfileDialog::checkForDuplicateName( const TQString& profileName )
{ if( !kapp->config( )->hasGroup( PROFILE_PREFIX + profileName ))
return true;
- KMessageBox::sorry( this, QString( i18n( "Profile \"%1\" already exists, please choose another name or press 'Cancel'" )).arg( profileName ), i18n( "Duplicate profile name" ));
+ KMessageBox::sorry( this, TQString( i18n( "Profile \"%1\" already exists, please choose another name or press 'Cancel'" )).arg( profileName ), i18n( "Duplicate profile name" ));
return false;
}
// constructNewProfileName
// =======================
-QString ProfileDialog::constructNewProfileName( const QString& initialProfileName ) const
-{ QString profileName = PROFILE_PREFIX + initialProfileName + "_copy";
+TQString ProfileDialog::constructNewProfileName( const TQString& initialProfileName ) const
+{ TQString profileName = PROFILE_PREFIX + initialProfileName + "_copy";
while( kapp->config( )->hasGroup( profileName ))
profileName += "_copy";
@@ -87,11 +87,11 @@ QString ProfileDialog::constructNewProfileName( const QString& initialProfileNam
// copy
// ====
-void ProfileDialog::copy( const QString& fromProfileName, const QString& toProfileName )
-{ QMap<QString, QString> map = kapp->config( )->entryMap( PROFILE_PREFIX + fromProfileName );
+void ProfileDialog::copy( const TQString& fromProfileName, const TQString& toProfileName )
+{ TQMap<TQString, TQString> map = kapp->config( )->entryMap( PROFILE_PREFIX + fromProfileName );
kapp->config( )->setGroup( PROFILE_PREFIX + toProfileName );
- for( QMap<QString, QString>::Iterator it = map.begin( ); it != map.end( ); ++it )
+ for( TQMap<TQString, TQString>::Iterator it = map.begin( ); it != map.end( ); ++it )
kapp->config( )->writeEntry( it.key( ), it.data( ));
m_profileListBox->insertItem( toProfileName );
@@ -102,13 +102,13 @@ void ProfileDialog::copy( const QString& fromProfileName, const QString& toProfi
// ============
void ProfileDialog::createlayout( )
-{ QGridLayout* layout = new QGridLayout( plainPage( ));
- m_profileListBox = new QListBox( plainPage( ), "profiles list box" );
- m_profileLineEdit = new QLineEdit( plainPage( ), "profiles line edit" );
+{ TQGridLayout* layout = new TQGridLayout( plainPage( ));
+ m_profileListBox = new TQListBox( plainPage( ), "profiles list box" );
+ m_profileLineEdit = new TQLineEdit( plainPage( ), "profiles line edit" );
- layout->addWidget( new QLabel( "Profile name: ", plainPage( ), "name label" ), 1, 1, Qt::AlignRight );
+ layout->addWidget( new TQLabel( "Profile name: ", plainPage( ), "name label" ), 1, 1, TQt::AlignRight );
layout->addWidget( m_profileLineEdit, 1, 2 );
- layout->addWidget( new QLabel( "Known profiles: ", plainPage( ), "name label" ), 3, 1, Qt::AlignRight | Qt::AlignTop );
+ layout->addWidget( new TQLabel( "Known profiles: ", plainPage( ), "name label" ), 3, 1, TQt::AlignRight | TQt::AlignTop );
layout->addWidget( m_profileListBox, 3, 2 );
layout->setColStretch( 0, 1 );
@@ -134,13 +134,13 @@ void ProfileDialog::createlayout( )
// deelete
// =======
-void ProfileDialog::deelete( const QString& profileName, const bool ask )
+void ProfileDialog::deelete( const TQString& profileName, const bool ask )
{ if( !kapp->config( )->hasGroup( PROFILE_PREFIX + profileName ))
{ ASSERT( false );
return ;
}
- QListBoxItem* item = m_profileListBox->findItem( profileName, Qt::ExactMatch );
+ TQListBoxItem* item = m_profileListBox->findItem( profileName, TQt::ExactMatch );
ASSERT( item != NULL );
if( item != NULL )
@@ -150,9 +150,9 @@ void ProfileDialog::deelete( const QString& profileName, const bool ask )
// deelete
// =======
-void ProfileDialog::deelete( QListBoxItem* item, const bool ask )
+void ProfileDialog::deelete( TQListBoxItem* item, const bool ask )
{ if( ask && KMessageBox::Yes != KMessageBox::questionYesNo( this,
- QString( i18n( "Delete profile \"%1\"?" )).arg( item->text( )),
+ TQString( i18n( "Delete profile \"%1\"?" )).arg( item->text( )),
i18n( "Confirm profile deletion" )))
return;
@@ -164,7 +164,7 @@ void ProfileDialog::deelete( QListBoxItem* item, const bool ask )
// getNewProfileName
// =================
-bool ProfileDialog::getNewProfileName( QString& profileName )
+bool ProfileDialog::getNewProfileName( TQString& profileName )
{ while( true )
{ bool ok;
profileName = KInputDialog::getText( i18n( "Profile name" ), i18n( "New profile name" ), profileName, &ok, this, "profile name" );
@@ -182,11 +182,11 @@ bool ProfileDialog::getNewProfileName( QString& profileName )
// setInitialValues
// ================
-void ProfileDialog::setInitialValues( const QString& currentProfile )
+void ProfileDialog::setInitialValues( const TQString& currentProfile )
{ ushort currentItem = ushort( -1 );
- QStringList profileList = kapp->config( )->groupList( );
+ TQStringList profileList = kapp->config( )->groupList( );
ushort i;
- QStringList::Iterator it;
+ TQStringList::Iterator it;
for( i = 0, it = profileList.begin( ); it != profileList.end( ); ++it )
if( (*it).startsWith( PROFILE_PREFIX ))
@@ -214,8 +214,8 @@ void ProfileDialog::setInitialValues( const QString& currentProfile )
// ========
void ProfileDialog::slotCopy( )
-{ QString fromProfileName = m_contextItem->text( );
- QString toProfileName = constructNewProfileName( fromProfileName );
+{ TQString fromProfileName = m_contextItem->text( );
+ TQString toProfileName = constructNewProfileName( fromProfileName );
if( getNewProfileName( toProfileName ))
copy( fromProfileName, toProfileName );
@@ -232,9 +232,9 @@ void ProfileDialog::slotDelete( )
// ======
void ProfileDialog::slotOk( )
-{ QString fromProfileName;
- QListBoxItem* item;
- QString toProfileName;
+{ TQString fromProfileName;
+ TQListBoxItem* item;
+ TQString toProfileName;
switch( m_action )
{ case Copy:
@@ -268,10 +268,10 @@ void ProfileDialog::slotOk( )
case SaveAs:
m_profileName = m_profileLineEdit->text( );
- item = m_profileListBox->findItem( m_profileName, Qt::ExactMatch );
+ item = m_profileListBox->findItem( m_profileName, TQt::ExactMatch );
if( item != NULL )
- if( KMessageBox::Yes != KMessageBox::questionYesNo( this, QString( i18n( "Profile \"%1\" already exists - overwrite it?" )).arg( m_profileName ), i18n( "Profile exists" )))
+ if( KMessageBox::Yes != KMessageBox::questionYesNo( this, TQString( i18n( "Profile \"%1\" already exists - overwrite it?" )).arg( m_profileName ), i18n( "Profile exists" )))
return;
m_profileName = PROFILE_PREFIX + m_profileName;
@@ -294,9 +294,9 @@ void ProfileDialog::slotProfileListBoxChanged( )
// slotProfileListContextMenu
// ==========================
-void ProfileDialog::slotProfileListContextMenu( QListBoxItem* item, const QPoint& pos )
+void ProfileDialog::slotProfileListContextMenu( TQListBoxItem* item, const TQPoint& pos )
{ m_contextItem = item;
- QPopupMenu* contextMenu = new QPopupMenu( this, "context menu" );
+ TQPopupMenu* contextMenu = new TQPopupMenu( this, "context menu" );
contextMenu->insertItem( i18n( "&Copy" ), this, SLOT( slotCopy( )));
contextMenu->insertItem( i18n( "&Delete" ), this, SLOT( slotDelete( )));
@@ -309,7 +309,7 @@ void ProfileDialog::slotProfileListContextMenu( QListBoxItem* item, const QPoint
// ==========
void ProfileDialog::slotRename( )
-{ QString profileName = m_contextItem->text( );
+{ TQString profileName = m_contextItem->text( );
if( getNewProfileName( profileName ))
{ copy( m_contextItem->text( ), profileName );
@@ -320,6 +320,6 @@ void ProfileDialog::slotRename( )
// stripPrefix
// ===========
-QString ProfileDialog::stripPrefix( const QString& profileName ) const
+TQString ProfileDialog::stripPrefix( const TQString& profileName ) const
{ return profileName.right( profileName.length( ) - strlen( PROFILE_PREFIX ));
}