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 /kontact/plugins/knotes/knotes_part.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 'kontact/plugins/knotes/knotes_part.cpp')
-rw-r--r-- | kontact/plugins/knotes/knotes_part.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/kontact/plugins/knotes/knotes_part.cpp b/kontact/plugins/knotes/knotes_part.cpp index 5bd160d1d..4702eb2d2 100644 --- a/kontact/plugins/knotes/knotes_part.cpp +++ b/kontact/plugins/knotes/knotes_part.cpp @@ -19,8 +19,8 @@ Boston, MA 02110-1301, USA. */ -#include <qpopupmenu.h> -#include <qclipboard.h> +#include <tqpopupmenu.h> +#include <tqclipboard.h> #include <kapplication.h> #include <kdebug.h> @@ -38,7 +38,7 @@ #include "knotetip.h" -KNotesPart::KNotesPart( QObject *parent, const char *name ) +KNotesPart::KNotesPart( TQObject *parent, const char *name ) : DCOPObject( "KNotesIface" ), KParts::ReadOnlyPart( parent, name ), mNotesView( new KNotesIconView() ), mNoteTip( new KNoteTip( mNotesView ) ), @@ -50,38 +50,38 @@ KNotesPart::KNotesPart( QObject *parent, const char *name ) setInstance( new KInstance( "knotes" ) ); // create the actions - new KAction( i18n( "&New" ), "knotes", CTRL+Key_N, this, SLOT( newNote() ), + new KAction( i18n( "&New" ), "knotes", CTRL+Key_N, this, TQT_SLOT( newNote() ), actionCollection(), "file_new" ); - new KAction( i18n( "Rename..." ), "text", this, SLOT( renameNote() ), + new KAction( i18n( "Rename..." ), "text", this, TQT_SLOT( renameNote() ), actionCollection(), "edit_rename" ); - new KAction( i18n( "Delete" ), "editdelete", Key_Delete, this, SLOT( killSelectedNotes() ), + new KAction( i18n( "Delete" ), "editdelete", Key_Delete, this, TQT_SLOT( killSelectedNotes() ), actionCollection(), "edit_delete" ); - new KAction( i18n( "Print Selected Notes..." ), "print", CTRL+Key_P, this, SLOT( printSelectedNotes() ), + new KAction( i18n( "Print Selected Notes..." ), "print", CTRL+Key_P, this, TQT_SLOT( printSelectedNotes() ), actionCollection(), "print_note" ); // TODO icons: s/editdelete/knotes_delete/ or the other way round in knotes // set the view up - mNotesView->setSelectionMode( QIconView::Extended ); + mNotesView->setSelectionMode( TQIconView::Extended ); mNotesView->setItemsMovable( false ); - mNotesView->setResizeMode( QIconView::Adjust ); + mNotesView->setResizeMode( TQIconView::Adjust ); mNotesView->setAutoArrange( true ); mNotesView->setSorting( true ); - connect( mNotesView, SIGNAL( executed( QIconViewItem* ) ), - this, SLOT( editNote( QIconViewItem* ) ) ); - connect( mNotesView, SIGNAL( returnPressed( QIconViewItem* ) ), - this, SLOT( editNote( QIconViewItem* ) ) ); - connect( mNotesView, SIGNAL( itemRenamed( QIconViewItem* ) ), - this, SLOT( renamedNote( QIconViewItem* ) ) ); - connect( mNotesView, SIGNAL( contextMenuRequested( QIconViewItem*, const QPoint& ) ), - this, SLOT( popupRMB( QIconViewItem*, const QPoint& ) ) ); - connect( mNotesView, SIGNAL( onItem( QIconViewItem* ) ), - this, SLOT( slotOnItem( QIconViewItem* ) ) ); - connect( mNotesView, SIGNAL( onViewport() ), - this, SLOT( slotOnViewport() ) ); - connect( mNotesView, SIGNAL( currentChanged( QIconViewItem* ) ), - this, SLOT( slotOnCurrentChanged( QIconViewItem* ) ) ); + connect( mNotesView, TQT_SIGNAL( executed( TQIconViewItem* ) ), + this, TQT_SLOT( editNote( TQIconViewItem* ) ) ); + connect( mNotesView, TQT_SIGNAL( returnPressed( TQIconViewItem* ) ), + this, TQT_SLOT( editNote( TQIconViewItem* ) ) ); + connect( mNotesView, TQT_SIGNAL( itemRenamed( TQIconViewItem* ) ), + this, TQT_SLOT( renamedNote( TQIconViewItem* ) ) ); + connect( mNotesView, TQT_SIGNAL( contextMenuRequested( TQIconViewItem*, const TQPoint& ) ), + this, TQT_SLOT( popupRMB( TQIconViewItem*, const TQPoint& ) ) ); + connect( mNotesView, TQT_SIGNAL( onItem( TQIconViewItem* ) ), + this, TQT_SLOT( slotOnItem( TQIconViewItem* ) ) ); + connect( mNotesView, TQT_SIGNAL( onViewport() ), + this, TQT_SLOT( slotOnViewport() ) ); + connect( mNotesView, TQT_SIGNAL( currentChanged( TQIconViewItem* ) ), + this, TQT_SLOT( slotOnCurrentChanged( TQIconViewItem* ) ) ); slotOnCurrentChanged( 0 ); @@ -91,10 +91,10 @@ KNotesPart::KNotesPart( QObject *parent, const char *name ) setXMLFile( "knotes_part.rc" ); // connect the resource manager - connect( mManager, SIGNAL( sigRegisteredNote( KCal::Journal* ) ), - this, SLOT( createNote( KCal::Journal* ) ) ); - connect( mManager, SIGNAL( sigDeregisteredNote( KCal::Journal* ) ), - this, SLOT( killNote( KCal::Journal* ) ) ); + connect( mManager, TQT_SIGNAL( sigRegisteredNote( KCal::Journal* ) ), + this, TQT_SLOT( createNote( KCal::Journal* ) ) ); + connect( mManager, TQT_SIGNAL( sigDeregisteredNote( KCal::Journal* ) ), + this, TQT_SLOT( killNote( KCal::Journal* ) ) ); // read the notes mManager->load(); @@ -111,9 +111,9 @@ KNotesPart::~KNotesPart() void KNotesPart::printSelectedNotes() { - QValueList<KCal::Journal*> journals; + TQValueList<KCal::Journal*> journals; - for ( QIconViewItem *it = mNotesView->firstItem(); it; it = it->nextItem() ) { + for ( TQIconViewItem *it = mNotesView->firstItem(); it; it = it->nextItem() ) { if ( it->isSelected() ) { journals.append( static_cast<KNotesIconViewItem *>( it )->journal() ); } @@ -128,9 +128,9 @@ void KNotesPart::printSelectedNotes() printer.printNotes(journals ); #if 0 - QString content; + TQString content; if ( m_editor->textFormat() == PlainText ) - content = QStyleSheet::convertFromPlainText( m_editor->text() ); + content = TQStyleSheet::convertFromPlainText( m_editor->text() ); else content = m_editor->text(); @@ -152,7 +152,7 @@ bool KNotesPart::openFile() // public KNotes DCOP interface implementation -QString KNotesPart::newNote( const QString& name, const QString& text ) +TQString KNotesPart::newNote( const TQString& name, const TQString& text ) { // create the new note KCal::Journal *journal = new KCal::Journal(); @@ -161,7 +161,7 @@ QString KNotesPart::newNote( const QString& name, const QString& text ) if ( !name.isEmpty() ) journal->setSummary( name ); else - journal->setSummary( KGlobal::locale()->formatDateTime( QDateTime::currentDateTime() ) ); + journal->setSummary( KGlobal::locale()->formatDateTime( TQDateTime::currentDateTime() ) ); // the body of the note journal->setDescription( text ); @@ -177,7 +177,7 @@ QString KNotesPart::newNote( const QString& name, const QString& text ) mNoteEditDlg->setTitle( journal->summary() ); mNoteEditDlg->setText( journal->description() ); - if ( mNoteEditDlg->exec() == QDialog::Accepted ) + if ( mNoteEditDlg->exec() == TQDialog::Accepted ) { journal->setSummary( mNoteEditDlg->title() ); journal->setDescription( mNoteEditDlg->text() ); @@ -199,18 +199,18 @@ QString KNotesPart::newNote( const QString& name, const QString& text ) return journal->uid(); } -QString KNotesPart::newNoteFromClipboard( const QString& name ) +TQString KNotesPart::newNoteFromClipboard( const TQString& name ) { - const QString& text = KApplication::clipboard()->text(); + const TQString& text = KApplication::clipboard()->text(); return newNote( name, text ); } -void KNotesPart::killNote( const QString& id ) +void KNotesPart::killNote( const TQString& id ) { killNote( id, false ); } -void KNotesPart::killNote( const QString& id, bool force ) +void KNotesPart::killNote( const TQString& id, bool force ) { KNotesIconViewItem *note = mNoteList[ id ]; @@ -227,25 +227,25 @@ void KNotesPart::killNote( const QString& id, bool force ) } } -QString KNotesPart::name( const QString& id ) const +TQString KNotesPart::name( const TQString& id ) const { KNotesIconViewItem *note = mNoteList[ id ]; if ( note ) return note->text(); else - return QString::null; + return TQString::null; } -QString KNotesPart::text( const QString& id ) const +TQString KNotesPart::text( const TQString& id ) const { KNotesIconViewItem *note = mNoteList[id]; if ( note ) return note->journal()->description(); else - return QString::null; + return TQString::null; } -void KNotesPart::setName( const QString& id, const QString& newName ) +void KNotesPart::setName( const TQString& id, const TQString& newName ) { KNotesIconViewItem *note = mNoteList[ id ]; if ( note ) { @@ -254,7 +254,7 @@ void KNotesPart::setName( const QString& id, const QString& newName ) } } -void KNotesPart::setText( const QString& id, const QString& newText ) +void KNotesPart::setText( const TQString& id, const TQString& newText ) { KNotesIconViewItem *note = mNoteList[ id ]; if ( note ) { @@ -263,10 +263,10 @@ void KNotesPart::setText( const QString& id, const QString& newText ) } } -QMap<QString, QString> KNotesPart::notes() const +TQMap<TQString, TQString> KNotesPart::notes() const { - QMap<QString, QString> notes; - QDictIterator<KNotesIconViewItem> it( mNoteList ); + TQMap<TQString, TQString> notes; + TQDictIterator<KNotesIconViewItem> it( mNoteList ); for ( ; it.current(); ++it ) notes.insert( (*it)->journal()->uid(), (*it)->journal()->summary() ); @@ -279,11 +279,11 @@ QMap<QString, QString> KNotesPart::notes() const void KNotesPart::killSelectedNotes() { - QPtrList<KNotesIconViewItem> items; - QStringList notes; + TQPtrList<KNotesIconViewItem> items; + TQStringList notes; KNotesIconViewItem *knivi; - for ( QIconViewItem *it = mNotesView->firstItem(); it; it = it->nextItem() ) { + for ( TQIconViewItem *it = mNotesView->firstItem(); it; it = it->nextItem() ) { if ( it->isSelected() ) { knivi = static_cast<KNotesIconViewItem *>( it ); items.append( knivi ); @@ -301,7 +301,7 @@ void KNotesPart::killSelectedNotes() KStdGuiItem::del() ); if ( ret == KMessageBox::Continue ) { - QPtrListIterator<KNotesIconViewItem> kniviIt( items ); + TQPtrListIterator<KNotesIconViewItem> kniviIt( items ); while ( (knivi = *kniviIt) ) { ++kniviIt; mManager->deleteNote( knivi->journal() ); @@ -311,14 +311,14 @@ void KNotesPart::killSelectedNotes() } } -void KNotesPart::popupRMB( QIconViewItem *item, const QPoint& pos ) +void KNotesPart::popupRMB( TQIconViewItem *item, const TQPoint& pos ) { - QPopupMenu *contextMenu = NULL; + TQPopupMenu *contextMenu = NULL; if ( item ) - contextMenu = static_cast<QPopupMenu *>( factory()->container( "note_context", this ) ); + contextMenu = static_cast<TQPopupMenu *>( factory()->container( "note_context", this ) ); else - contextMenu = static_cast<QPopupMenu *>( factory()->container( "notepart_context", this ) ); + contextMenu = static_cast<TQPopupMenu *>( factory()->container( "notepart_context", this ) ); if ( !contextMenu ) return; @@ -326,9 +326,9 @@ void KNotesPart::popupRMB( QIconViewItem *item, const QPoint& pos ) contextMenu->popup( pos ); } -void KNotesPart::slotOnItem( QIconViewItem *i ) +void KNotesPart::slotOnItem( TQIconViewItem *i ) { - // TODO: disable (i.e. setNote( QString::null )) when mouse button pressed + // TODO: disable (i.e. setNote( TQString::null )) when mouse button pressed KNotesIconViewItem *item = static_cast<KNotesIconViewItem *>( i ); mNoteTip->setNote( item ); @@ -346,7 +346,7 @@ void KNotesPart::slotOnViewport() void KNotesPart::createNote( KCal::Journal *journal ) { // make sure all fields are existent, initialize them with default values - QString property = journal->customProperty( "KNotes", "BgColor" ); + TQString property = journal->customProperty( "KNotes", "BgColor" ); if ( property.isNull() ) journal->setCustomProperty( "KNotes", "BgColor", "#ffff00" ); @@ -366,7 +366,7 @@ void KNotesPart::killNote( KCal::Journal *journal ) mNoteList.remove( journal->uid() ); } -void KNotesPart::editNote( QIconViewItem *item ) +void KNotesPart::editNote( TQIconViewItem *item ) { if ( !mNoteEditDlg ) mNoteEditDlg = new KNoteEditDlg( widget() ); @@ -377,7 +377,7 @@ void KNotesPart::editNote( QIconViewItem *item ) mNoteEditDlg->setTitle( journal->summary() ); mNoteEditDlg->setText( journal->description() ); - if ( mNoteEditDlg->exec() == QDialog::Accepted ) { + if ( mNoteEditDlg->exec() == TQDialog::Accepted ) { item->setText( mNoteEditDlg->title() ); journal->setDescription( mNoteEditDlg->text() ); mManager->save(); @@ -389,12 +389,12 @@ void KNotesPart::renameNote() mNotesView->currentItem()->rename(); } -void KNotesPart::renamedNote( QIconViewItem* ) +void KNotesPart::renamedNote( TQIconViewItem* ) { mManager->save(); } -void KNotesPart::slotOnCurrentChanged( QIconViewItem* ) +void KNotesPart::slotOnCurrentChanged( TQIconViewItem* ) { KAction *renameAction = actionCollection()->action( "edit_rename" ); KAction *deleteAction = actionCollection()->action( "edit_delete" ); |