summaryrefslogtreecommitdiffstats
path: root/kaddressbook/viewmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kaddressbook/viewmanager.cpp')
-rw-r--r--kaddressbook/viewmanager.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 9d2f632ed..4e4cd5a65 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -21,9 +21,9 @@
without including the source code for Qt in the source distribution.
*/
-#include <qfile.h>
-#include <qlayout.h>
-#include <qwidgetstack.h>
+#include <tqfile.h>
+#include <tqlayout.h>
+#include <tqwidgetstack.h>
#include <libkdepim/kvcarddrag.h>
#include <kabc/addressbook.h>
@@ -49,8 +49,8 @@
#include "viewmanager.h"
-ViewManager::ViewManager( KAB::Core *core, QWidget *parent, const char *name )
- : QWidget( parent, name ), mCore( core ), mActiveView( 0 ),
+ViewManager::ViewManager( KAB::Core *core, TQWidget *parent, const char *name )
+ : TQWidget( parent, name ), mCore( core ), mActiveView( 0 ),
mFilterSelectionWidget( 0 )
{
initGUI();
@@ -70,7 +70,7 @@ ViewManager::~ViewManager()
void ViewManager::restoreSettings()
{
mViewNameList = KABPrefs::instance()->viewNames();
- QString activeViewName = KABPrefs::instance()->currentView();
+ TQString activeViewName = KABPrefs::instance()->currentView();
mActionSelectView->setItems( mViewNameList );
@@ -81,7 +81,7 @@ void ViewManager::restoreSettings()
// Tell the views to reread their config, since they may have
// been modified by global settings
- QDictIterator<KAddressBookView> it( mViewDict );
+ TQDictIterator<KAddressBookView> it( mViewDict );
for ( it.toFirst(); it.current(); ++it ) {
KConfigGroupSaver saver( mCore->config(), it.currentKey() );
it.current()->readConfig( mCore->config() );
@@ -94,7 +94,7 @@ void ViewManager::restoreSettings()
void ViewManager::saveSettings()
{
- QDictIterator<KAddressBookView> it( mViewDict );
+ TQDictIterator<KAddressBookView> it( mViewDict );
for ( it.toFirst(); it.current(); ++it ) {
KConfigGroupSaver saver( mCore->config(), it.currentKey() );
(*it)->writeConfig( mCore->config() );
@@ -110,28 +110,28 @@ void ViewManager::saveSettings()
KABPrefs::instance()->setCurrentView( mActiveView->caption() );
}
-QStringList ViewManager::selectedUids() const
+TQStringList ViewManager::selectedUids() const
{
if ( mActiveView ) {
return mActiveView->selectedUids();
} else
- return QStringList();
+ return TQStringList();
}
-QStringList ViewManager::selectedEmails() const
+TQStringList ViewManager::selectedEmails() const
{
if ( mActiveView )
return mActiveView->selectedEmails();
else
- return QStringList();
+ return TQStringList();
}
KABC::Addressee::List ViewManager::selectedAddressees() const
{
KABC::Addressee::List list;
- const QStringList uids = selectedUids();
- QStringList::ConstIterator it;
+ const TQStringList uids = selectedUids();
+ TQStringList::ConstIterator it;
for ( it = uids.begin(); it != uids.end(); ++it ) {
KABC::Addressee addr = mCore->addressBook()->findByUid( *it );
if ( !addr.isEmpty() )
@@ -164,7 +164,7 @@ KABC::Field::List ViewManager::viewFields() const
return KABC::Field::List();
}
-void ViewManager::setSelected( const QString &uid, bool selected )
+void ViewManager::setSelected( const TQString &uid, bool selected )
{
if ( mActiveView )
mActiveView->setSelected( uid, selected );
@@ -182,7 +182,7 @@ void ViewManager::unloadViews()
mActiveView = 0;
}
-void ViewManager::setActiveView( const QString &name )
+void ViewManager::setActiveView( const TQString &name )
{
KAddressBookView *view = 0;
@@ -201,7 +201,7 @@ void ViewManager::setActiveView( const QString &name )
if ( view == 0 ) {
KConfig *config = mCore->config();
KConfigGroupSaver saver( config, name );
- QString type = config->readEntry( "Type", "Table" );
+ TQString type = config->readEntry( "Type", "Table" );
kdDebug(5720) << "ViewManager::setActiveView: creating view - " << name << endl;
@@ -216,15 +216,15 @@ void ViewManager::setActiveView( const QString &name )
view->readConfig( config );
// The manager just relays the signals
- connect( view, SIGNAL( selected( const QString& ) ),
- SIGNAL( selected( const QString & ) ) );
- connect( view, SIGNAL( executed( const QString& ) ),
- SIGNAL( executed( const QString& ) ) );
- connect( view, SIGNAL( modified() ), SIGNAL( modified() ) );
- connect( view, SIGNAL( dropped( QDropEvent* ) ),
- SLOT( dropped( QDropEvent* ) ) );
- connect( view, SIGNAL( startDrag() ), SLOT( startDrag() ) );
- connect( view, SIGNAL( sortFieldChanged() ), SIGNAL( sortFieldChanged() ) );
+ connect( view, TQT_SIGNAL( selected( const TQString& ) ),
+ TQT_SIGNAL( selected( const TQString & ) ) );
+ connect( view, TQT_SIGNAL( executed( const TQString& ) ),
+ TQT_SIGNAL( executed( const TQString& ) ) );
+ connect( view, TQT_SIGNAL( modified() ), TQT_SIGNAL( modified() ) );
+ connect( view, TQT_SIGNAL( dropped( TQDropEvent* ) ),
+ TQT_SLOT( dropped( TQDropEvent* ) ) );
+ connect( view, TQT_SIGNAL( startDrag() ), TQT_SLOT( startDrag() ) );
+ connect( view, TQT_SIGNAL( sortFieldChanged() ), TQT_SIGNAL( sortFieldChanged() ) );
}
}
@@ -254,7 +254,7 @@ void ViewManager::setActiveView( const QString &name )
kdDebug(5720) << "ViewManager::setActiveView: unable to find view\n";
}
-void ViewManager::refreshView( const QString &uid )
+void ViewManager::refreshView( const TQString &uid )
{
if ( mActiveView )
mActiveView->refresh( uid );
@@ -306,9 +306,9 @@ void ViewManager::editView()
void ViewManager::deleteView()
{
- QString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" )
+ TQString text = i18n( "<qt>Are you sure that you want to delete the view <b>%1</b>?</qt>" )
.arg( mActiveView->caption() );
- QString caption = i18n( "Confirm Delete" );
+ TQString caption = i18n( "Confirm Delete" );
if ( KMessageBox::warningContinueCancel( this, text, caption, KGuiItem( i18n("&Delete"), "editdelete") ) == KMessageBox::Continue ) {
mViewNameList.remove( mActiveView->caption() );
@@ -336,8 +336,8 @@ void ViewManager::addView()
AddViewDialog dialog( &mViewFactoryDict, this );
if ( dialog.exec() ) {
- QString newName = dialog.viewName();
- QString type = dialog.viewType();
+ TQString newName = dialog.viewName();
+ TQString type = dialog.viewType();
// Check for name conflicts
bool firstConflict = true;
@@ -348,7 +348,7 @@ void ViewManager::addView()
firstConflict = false;
}
- newName = QString( "%1 <%2>" ).arg( newName ).arg( numTries );
+ newName = TQString( "%1 <%2>" ).arg( newName ).arg( numTries );
numTries++;
}
@@ -387,7 +387,7 @@ void ViewManager::scrollDown()
void ViewManager::createViewFactories()
{
const KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/View",
- QString( "[X-KDE-KAddressBook-ViewPluginVersion] == %1" ).arg( KAB_VIEW_PLUGIN_VERSION ) );
+ TQString( "[X-KDE-KAddressBook-ViewPluginVersion] == %1" ).arg( KAB_VIEW_PLUGIN_VERSION ) );
KTrader::OfferList::ConstIterator it;
for ( it = plugins.begin(); it != plugins.end(); ++it ) {
if ( !(*it)->hasServiceType( "KAddressBook/View" ) )
@@ -411,7 +411,7 @@ void ViewManager::createViewFactories()
}
}
-void ViewManager::dropped( QDropEvent *e )
+void ViewManager::dropped( TQDropEvent *e )
{
kdDebug(5720) << "ViewManager::dropped: got a drop event" << endl;
@@ -419,14 +419,14 @@ void ViewManager::dropped( QDropEvent *e )
if ( e->source() == this )
return;
- QString clipText, vcards;
+ TQString clipText, vcards;
KURL::List urls;
if ( KURLDrag::decode( e, urls) ) {
KURL::List::ConstIterator it = urls.begin();
int c = urls.count();
if ( c > 1 ) {
- QString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c );
+ TQString questionString = i18n( "Import one contact into your addressbook?", "Import %n contacts into your addressbook?", c );
if ( KMessageBox::questionYesNo( this, questionString, i18n( "Import Contacts?" ), i18n("Import"), i18n("Do Not Import") ) == KMessageBox::Yes ) {
for ( ; it != urls.end(); ++it )
emit urlDropped( *it );
@@ -454,35 +454,35 @@ void ViewManager::startDrag()
{
// Get the list of all the selected addressees
KABC::Addressee::List addrList;
- const QStringList uidList = selectedUids();
+ const TQStringList uidList = selectedUids();
if ( uidList.isEmpty() )
return;
kdDebug(5720) << "ViewManager::startDrag: starting to drag" << endl;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for ( it = uidList.begin(); it != uidList.end(); ++it )
addrList.append( mCore->addressBook()->findByUid( *it ) );
KMultipleDrag *drag = new KMultipleDrag( this );
KABC::VCardConverter converter;
- QString vcards = converter.createVCards( addrList );
+ TQString vcards = converter.createVCards( addrList );
// Best text representation is given by textdrag, so it must be first
- drag->addDragObject( new QTextDrag( AddresseeUtil::addresseesToEmails( addrList ), this ) );
+ drag->addDragObject( new TQTextDrag( AddresseeUtil::addresseesToEmails( addrList ), this ) );
drag->addDragObject( new KVCardDrag( vcards, this ) );
KTempDir tempDir;
// can't set tempDir to autoDelete, in case of dropping on the desktop, the copy is async...
if ( tempDir.status() == 0 ) {
- QString fileName;
+ TQString fileName;
if ( addrList.count() == 1 )
fileName = addrList[ 0 ].givenName() + "_" + addrList[ 0 ].familyName() + ".vcf";
else
fileName = "contacts.vcf";
- QFile tempFile( tempDir.name() + "/" + fileName );
+ TQFile tempFile( tempDir.name() + "/" + fileName );
if ( tempFile.open( IO_WriteOnly ) ) {
tempFile.writeBlock( vcards.utf8() );
tempFile.close();
@@ -514,7 +514,7 @@ void ViewManager::setActiveFilter( int index )
if ( mActiveView ) {
mActiveView->setFilter( currentFilter );
mActiveView->refresh();
- emit selected( QString::null );
+ emit selected( TQString::null );
}
}
@@ -533,9 +533,9 @@ void ViewManager::configureFilters()
setActiveFilter( pos );
}
-QStringList ViewManager::filterNames() const
+TQStringList ViewManager::filterNames() const
{
- QStringList names( i18n( "None" ) );
+ TQStringList names( i18n( "None" ) );
names.append( i18n( "Unfiled" ) );
Filter::List::ConstIterator it;
@@ -545,7 +545,7 @@ QStringList ViewManager::filterNames() const
return names;
}
-int ViewManager::filterPosition( const QString &name ) const
+int ViewManager::filterPosition( const TQString &name ) const
{
int pos = 0;
@@ -563,41 +563,41 @@ void ViewManager::initActions()
#if KDE_VERSION >= 309
mActionSelectView->setMenuAccelsEnabled( false );
#endif
- connect( mActionSelectView, SIGNAL( activated( const QString& ) ),
- SLOT( setActiveView( const QString& ) ) );
+ connect( mActionSelectView, TQT_SIGNAL( activated( const TQString& ) ),
+ TQT_SLOT( setActiveView( const TQString& ) ) );
KAction *action;
action = new KAction( i18n( "Modify View..." ), "configure", 0, this,
- SLOT( editView() ), mCore->actionCollection(),
+ TQT_SLOT( editView() ), mCore->actionCollection(),
"view_modify" );
action->setWhatsThis( i18n( "By pressing this button a dialog opens that allows you to modify the view of the addressbook. There you can add or remove fields that you want to be shown or hidden in the addressbook like the name for example." ) );
action = new KAction( i18n( "Add View..." ), "window_new", 0, this,
- SLOT( addView() ), mCore->actionCollection(),
+ TQT_SLOT( addView() ), mCore->actionCollection(),
"view_add" );
action->setWhatsThis( i18n( "You can add a new view by choosing one from the dialog that appears after pressing the button. You have to give the view a name, so that you can distinguish between the different views." ) );
mActionDeleteView = new KAction( i18n( "Delete View" ), "view_remove", 0,
- this, SLOT( deleteView() ),
+ this, TQT_SLOT( deleteView() ),
mCore->actionCollection(), "view_delete" );
mActionDeleteView->setWhatsThis( i18n( "By pressing this button you can delete the actual view, which you have added before." ) );
action = new KAction( i18n( "Refresh View" ), "reload", 0, this,
- SLOT( refreshView() ), mCore->actionCollection(),
+ TQT_SLOT( refreshView() ), mCore->actionCollection(),
"view_refresh" );
action->setWhatsThis( i18n( "The view will be refreshed by pressing this button." ) );
action = new KAction( i18n( "Edit &Filters..." ), "filter", 0, this,
- SLOT( configureFilters() ), mCore->actionCollection(),
+ TQT_SLOT( configureFilters() ), mCore->actionCollection(),
"options_edit_filters" );
action->setWhatsThis( i18n( "Edit the contact filters<p>You will be presented with a dialog, where you can add, remove and edit filters." ) );
}
void ViewManager::initGUI()
{
- QHBoxLayout *layout = new QHBoxLayout( this );
- mViewWidgetStack = new QWidgetStack( this );
+ TQHBoxLayout *layout = new TQHBoxLayout( this );
+ mViewWidgetStack = new TQWidgetStack( this );
layout->addWidget( mViewWidgetStack );
}