diff options
Diffstat (limited to 'knotes/knote.cpp')
-rw-r--r-- | knotes/knote.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/knotes/knote.cpp b/knotes/knote.cpp index 2a78d718..e0ac842a 100644 --- a/knotes/knote.cpp +++ b/knotes/knote.cpp @@ -44,10 +44,10 @@ #include <kcolordrag.h> #include <kiconeffect.h> #include <tdelocale.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <tdemessagebox.h> #include <kfind.h> -#include <kprocess.h> +#include <tdeprocess.h> #include <kinputdialog.h> #include <kmdcodec.h> #include <tdeglobalsettings.h> @@ -105,47 +105,47 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *parent, const char * // create the menu items for the note - not the editor... // rename, mail, print, save as, insert date, alarm, close, delete, new note new TDEAction( i18n("New"), "document-new", 0, - TQT_TQOBJECT(this),TQT_SLOT(slotRequestNewNote()) , actionCollection(), "new_note" ); + this,TQ_SLOT(slotRequestNewNote()) , actionCollection(), "new_note" ); new TDEAction( i18n("Rename..."), "text", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotRename()), actionCollection(), "rename_note" ); + this, TQ_SLOT(slotRename()), actionCollection(), "rename_note" ); m_readOnly = new TDEToggleAction( i18n("Lock"), "system-lock-screen" , 0, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateReadOnly()), actionCollection(), "lock_note" ); + this, TQ_SLOT(slotUpdateReadOnly()), actionCollection(), "lock_note" ); m_readOnly->setCheckedState( KGuiItem( i18n("Unlock"), "unlock" ) ); new TDEAction( i18n("Hide"), "window-close" , Key_Escape, - TQT_TQOBJECT(this), TQT_SLOT(slotClose()), actionCollection(), "hide_note" ); + this, TQ_SLOT(slotClose()), actionCollection(), "hide_note" ); new TDEAction( i18n("Delete"), "knotes_delete", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotKill()), actionCollection(), "delete_note" ); + this, TQ_SLOT(slotKill()), actionCollection(), "delete_note" ); new TDEAction( i18n("Insert Date"), "knotes_date", 0 , - TQT_TQOBJECT(this), TQT_SLOT(slotInsDate()), actionCollection(), "insert_date" ); + this, TQ_SLOT(slotInsDate()), actionCollection(), "insert_date" ); new TDEAction( i18n("Set Alarm..."), "knotes_alarm", 0 , - TQT_TQOBJECT(this), TQT_SLOT(slotSetAlarm()), actionCollection(), "set_alarm" ); + this, TQ_SLOT(slotSetAlarm()), actionCollection(), "set_alarm" ); new TDEAction( i18n("Send..."), "network", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotSend()), actionCollection(), "send_note" ); + this, TQ_SLOT(slotSend()), actionCollection(), "send_note" ); new TDEAction( i18n("Mail..."), "mail-send", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actionCollection(), "mail_note" ); + this, TQ_SLOT(slotMail()), actionCollection(), "mail_note" ); new TDEAction( i18n("Save As..."), "document-save-as", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotSaveAs()), actionCollection(), "save_note" ); - KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), actionCollection(), "print_note" ); + this, TQ_SLOT(slotSaveAs()), actionCollection(), "save_note" ); + KStdAction::print( this, TQ_SLOT(slotPrint()), actionCollection(), "print_note" ); new TDEAction( i18n("Preferences..."), "configure", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotPreferences()), actionCollection(), "configure_note" ); + this, TQ_SLOT(slotPreferences()), actionCollection(), "configure_note" ); m_keepAbove = new TDEToggleAction( i18n("Keep Above Others"), "go-up", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_above" ); + this, TQ_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_above" ); m_keepAbove->setExclusiveGroup( "keepAB" ); m_keepBelow = new TDEToggleAction( i18n("Keep Below Others"), "go-down", 0, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_below" ); + this, TQ_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_below" ); m_keepBelow->setExclusiveGroup( "keepAB" ); m_toDesktop = new TDEListAction( i18n("To Desktop"), 0, - TQT_TQOBJECT(this), TQT_SLOT(slotPopupActionToDesktop(int)), actionCollection(), "to_desktop" ); - connect( m_toDesktop->popupMenu(), TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateDesktopActions()) ); + this, TQ_SLOT(slotPopupActionToDesktop(int)), actionCollection(), "to_desktop" ); + connect( m_toDesktop->popupMenu(), TQ_SIGNAL(aboutToShow()), this, TQ_SLOT(slotUpdateDesktopActions()) ); // invisible action to walk through the notes to make this configurable new TDEAction( i18n("Walk Through Notes"), 0, SHIFT+Key_BackTab, - TQT_TQOBJECT(this), TQT_SIGNAL(sigShowNextNote()), actionCollection(), "walk_notes" ); + this, TQ_SIGNAL(sigShowNextNote()), actionCollection(), "walk_notes" ); // create the note header, button and label... m_label = new TQLabel( this ); @@ -155,17 +155,17 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *parent, const char * setName( m_journal->summary() ); // don't worry, no signals are connected at this stage yet m_button = new KNoteButton( "knotes_close", this ); - connect( m_button, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotClose()) ); + connect( m_button, TQ_SIGNAL(clicked()), this, TQ_SLOT(slotClose()) ); // create the note editor m_editor = new KNoteEdit( actionCollection(), this ); m_editor->setNote( this ); m_editor->installEventFilter( this ); // receive events (for modified) m_editor->viewport()->installEventFilter( this ); - connect( m_editor, TQT_SIGNAL(contentsMoving( int, int )), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateViewport( int, int ))); + connect( m_editor, TQ_SIGNAL(contentsMoving( int, int )), this, TQ_SLOT(slotUpdateViewport( int, int ))); KXMLGUIBuilder builder( this ); - KXMLGUIFactory factory( &builder, TQT_TQOBJECT(this) ); + KXMLGUIFactory factory( &builder, this ); factory.addClient( this ); m_menu = dynamic_cast<TDEPopupMenu*>(factory.container( "note_context", this )); @@ -292,7 +292,7 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *parent, const char * // let KWin do the placement if the position is illegal--at least 10 pixels // of a note need to be visible const TQPoint& position = m_config->position(); - TQRect desk = kapp->desktop()->rect(); + TQRect desk = tdeApp->desktop()->rect(); desk.addCoords( 10, 10, -10, -10 ); if ( desk.intersects( TQRect( position, TQSize( width, height ) ) ) ) move( position ); // do before calling show() to avoid flicker @@ -360,8 +360,8 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *parent, const char * // HACK: update the icon color - again after showing the note, to make kicker aware of the new colors TDEIconEffect effect; - TQPixmap icon = effect.apply( kapp->icon(), TDEIconEffect::Colorize, 1, m_config->bgColor(), false ); - TQPixmap miniIcon = effect.apply( kapp->miniIcon(), TDEIconEffect::Colorize, 1, m_config->bgColor(), false ); + TQPixmap icon = effect.apply( tdeApp->icon(), TDEIconEffect::Colorize, 1, m_config->bgColor(), false ); + TQPixmap miniIcon = effect.apply( tdeApp->miniIcon(), TDEIconEffect::Colorize, 1, m_config->bgColor(), false ); KWin::setIcons( winId(), icon, miniIcon ); } @@ -576,8 +576,8 @@ void KNote::setColor( const TQColor& fg, const TQColor& bg ) // update the icon color TDEIconEffect effect; - TQPixmap icon = effect.apply( kapp->icon(), TDEIconEffect::Colorize, 1, bg, false ); - TQPixmap miniIcon = effect.apply( kapp->miniIcon(), TDEIconEffect::Colorize, 1, bg, false ); + TQPixmap icon = effect.apply( tdeApp->icon(), TDEIconEffect::Colorize, 1, bg, false ); + TQPixmap miniIcon = effect.apply( tdeApp->miniIcon(), TDEIconEffect::Colorize, 1, bg, false ); KWin::setIcons( winId(), icon, miniIcon ); // set the color for the selection used to highlight the find stuff @@ -600,9 +600,9 @@ void KNote::find( const TQString& pattern, long options ) delete m_find; m_find = new KFind( pattern, options, this ); - connect( m_find, TQT_SIGNAL(highlight( const TQString &, int, int )), - TQT_TQOBJECT(this), TQT_SLOT(slotHighlight( const TQString &, int, int )) ); - connect( m_find, TQT_SIGNAL(findNext()), TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()) ); + connect( m_find, TQ_SIGNAL(highlight( const TQString &, int, int )), + this, TQ_SLOT(slotHighlight( const TQString &, int, int )) ); + connect( m_find, TQ_SIGNAL(findNext()), this, TQ_SLOT(slotFindNext()) ); m_find->setData( plainText() ); slotFindNext(); @@ -816,8 +816,8 @@ void KNote::slotPreferences() // create a new preferences dialog... KNoteConfigDlg *dialog = new KNoteConfigDlg( m_config, name(), this, noteId().utf8() ); - connect( dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotApplyConfig()) ); - connect( this, TQT_SIGNAL(sigNameChanged()), dialog, TQT_SLOT(slotUpdateCaption()) ); + connect( dialog, TQ_SIGNAL(settingsChanged()), this, TQ_SLOT(slotApplyConfig()) ); + connect( this, TQ_SIGNAL(sigNameChanged()), dialog, TQ_SLOT(slotUpdateCaption()) ); dialog->show(); } @@ -1285,7 +1285,7 @@ void KNote::resizeEvent( TQResizeEvent *qre ) void KNote::closeEvent( TQCloseEvent *event ) { - if(kapp->sessionSaving()) + if(tdeApp->sessionSaving()) return; event->ignore(); //We don't want to close (and delete the widget). Just hide it slotClose(); @@ -1339,7 +1339,7 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return true; } - if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_label) ) + if ( o == m_label ) { TQMouseEvent *e = (TQMouseEvent *)ev; @@ -1349,12 +1349,12 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) slotRename(); } if ( ev->type() == TQEvent::MouseButtonPress && - (e->button() == Qt::LeftButton || e->button() == Qt::MidButton)) + (e->button() == TQt::LeftButton || e->button() == TQt::MidButton)) { - e->button() == Qt::LeftButton ? KWin::raiseWindow( winId() ) + e->button() == TQt::LeftButton ? KWin::raiseWindow( winId() ) : KWin::lowerWindow( winId() ); - XUngrabPointer( tqt_xdisplay(), GET_QT_X_TIME() ); + XUngrabPointer( tqt_xdisplay(), get_tqt_x_time() ); NETRootInfo wm_root( tqt_xdisplay(), NET::WMMoveResize ); wm_root.moveResizeRequest( winId(), e->globalX(), e->globalY(), NET::Move ); return true; @@ -1370,7 +1370,7 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) #endif if ( m_menu && ( ev->type() == TQEvent::MouseButtonPress ) - && ( e->button() == Qt::RightButton ) ) + && ( e->button() == TQt::RightButton ) ) { m_menu->popup( TQCursor::pos() ); return true; @@ -1379,9 +1379,9 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return false; } - if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editor) ) { + if ( o == m_editor ) { if ( ev->type() == TQEvent::FocusOut ) { - TQFocusEvent *fe = TQT_TQFOCUSEVENT(ev); + TQFocusEvent *fe = static_cast<TQFocusEvent*>(ev); if ( fe->reason() != TQFocusEvent::Popup && fe->reason() != TQFocusEvent::Mouse ) { updateFocus(); @@ -1398,11 +1398,11 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return false; } - if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editor->viewport()) ) + if ( o == m_editor->viewport() ) { if ( m_edit_menu && ev->type() == TQEvent::MouseButtonPress && - ((TQMouseEvent *)ev)->button() == Qt::RightButton ) + ((TQMouseEvent *)ev)->button() == TQt::RightButton ) { m_edit_menu->popup( TQCursor::pos() ); return true; |