diff options
Diffstat (limited to 'knotes/knote.cpp')
-rw-r--r-- | knotes/knote.cpp | 90 |
1 files changed, 44 insertions, 46 deletions
diff --git a/knotes/knote.cpp b/knotes/knote.cpp index 0f0ec426c..4281f713d 100644 --- a/knotes/knote.cpp +++ b/knotes/knote.cpp @@ -77,8 +77,6 @@ using namespace KCal; -extern Time qt_x_time; - int KNote::s_ppOffset = 0; KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *tqparent, const char *name ) @@ -107,47 +105,47 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *tqparent, 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 KAction( i18n("New"), "filenew", 0, - this,TQT_SLOT(slotRequestNewNote()) , actionCollection(), "new_note" ); + TQT_TQOBJECT(this),TQT_SLOT(slotRequestNewNote()) , actionCollection(), "new_note" ); new KAction( i18n("Rename..."), "text", 0, - this, TQT_SLOT(slotRename()), actionCollection(), "rename_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotRename()), actionCollection(), "rename_note" ); m_readOnly = new KToggleAction( i18n("Lock"), "lock" , 0, - this, TQT_SLOT(slotUpdateReadOnly()), actionCollection(), "lock_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateReadOnly()), actionCollection(), "lock_note" ); m_readOnly->setCheckedState( KGuiItem( i18n("Unlock"), "unlock" ) ); new KAction( i18n("Hide"), "fileclose" , Key_Escape, - this, TQT_SLOT(slotClose()), actionCollection(), "hide_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotClose()), actionCollection(), "hide_note" ); new KAction( i18n("Delete"), "knotes_delete", 0, - this, TQT_SLOT(slotKill()), actionCollection(), "delete_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotKill()), actionCollection(), "delete_note" ); new KAction( i18n("Insert Date"), "knotes_date", 0 , - this, TQT_SLOT(slotInsDate()), actionCollection(), "insert_date" ); + TQT_TQOBJECT(this), TQT_SLOT(slotInsDate()), actionCollection(), "insert_date" ); new KAction( i18n("Set Alarm..."), "knotes_alarm", 0 , - this, TQT_SLOT(slotSetAlarm()), actionCollection(), "set_alarm" ); + TQT_TQOBJECT(this), TQT_SLOT(slotSetAlarm()), actionCollection(), "set_alarm" ); new KAction( i18n("Send..."), "network", 0, - this, TQT_SLOT(slotSend()), actionCollection(), "send_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotSend()), actionCollection(), "send_note" ); new KAction( i18n("Mail..."), "mail_send", 0, - this, TQT_SLOT(slotMail()), actionCollection(), "mail_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotMail()), actionCollection(), "mail_note" ); new KAction( i18n("Save As..."), "filesaveas", 0, - this, TQT_SLOT(slotSaveAs()), actionCollection(), "save_note" ); - KStdAction::print( this, TQT_SLOT(slotPrint()), actionCollection(), "print_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotSaveAs()), actionCollection(), "save_note" ); + KStdAction::print( TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), actionCollection(), "print_note" ); new KAction( i18n("Preferences..."), "configure", 0, - this, TQT_SLOT(slotPreferences()), actionCollection(), "configure_note" ); + TQT_TQOBJECT(this), TQT_SLOT(slotPreferences()), actionCollection(), "configure_note" ); m_keepAbove = new KToggleAction( i18n("Keep Above Others"), "up", 0, - this, TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_above" ); + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_above" ); m_keepAbove->setExclusiveGroup( "keepAB" ); m_keepBelow = new KToggleAction( i18n("Keep Below Others"), "down", 0, - this, TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_below" ); + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateKeepAboveBelow()), actionCollection(), "keep_below" ); m_keepBelow->setExclusiveGroup( "keepAB" ); m_toDesktop = new KListAction( i18n("To Desktop"), 0, - this, TQT_SLOT(slotPopupActionToDesktop(int)), actionCollection(), "to_desktop" ); - connect( m_toDesktop->popupMenu(), TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(slotUpdateDesktopActions()) ); + TQT_TQOBJECT(this), TQT_SLOT(slotPopupActionToDesktop(int)), actionCollection(), "to_desktop" ); + connect( m_toDesktop->popupMenu(), TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateDesktopActions()) ); // invisible action to walk through the notes to make this configurable new KAction( i18n("Walk Through Notes"), 0, SHIFT+Key_BackTab, - this, TQT_SIGNAL(sigShowNextNote()), actionCollection(), "walk_notes" ); + TQT_TQOBJECT(this), TQT_SIGNAL(sigShowNextNote()), actionCollection(), "walk_notes" ); // create the note header, button and label... m_label = new TQLabel( this ); @@ -157,17 +155,17 @@ KNote::KNote( TQDomDocument buildDoc, Journal *j, TQWidget *tqparent, 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()), this, TQT_SLOT(slotClose()) ); + connect( m_button, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_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 )), this, TQT_SLOT(slotUpdateViewport( int, int ))); + connect( m_editor, TQT_SIGNAL(contentsMoving( int, int )), TQT_TQOBJECT(this), TQT_SLOT(slotUpdateViewport( int, int ))); KXMLGUIBuilder builder( this ); - KXMLGUIFactory factory( &builder, this ); + KXMLGUIFactory factory( &builder, TQT_TQOBJECT(this) ); factory.addClient( this ); m_menu = dynamic_cast<KPopupMenu*>(factory.container( "note_context", this )); @@ -395,7 +393,7 @@ void KNote::slotKill( bool force ) m_blockEmitDataChanged = true; if ( !force && KMessageBox::warningContinueCancel( this, - i18n("<qt>Do you really want to delete note <b>%1</b>?</qt>").arg( m_label->text() ), + i18n("<qt>Do you really want to delete note <b>%1</b>?</qt>").tqarg( m_label->text() ), i18n("Confirm Delete"), KGuiItem( i18n("&Delete"), "editdelete" ), "ConfirmDeleteNote" ) @@ -583,8 +581,8 @@ void KNote::tqfind( const TQString& pattern, long options ) m_tqfind = new KFind( pattern, options, this ); connect( m_tqfind, TQT_SIGNAL(highlight( const TQString &, int, int )), - this, TQT_SLOT(slotHighlight( const TQString &, int, int )) ); - connect( m_tqfind, TQT_SIGNAL(findNext()), this, TQT_SLOT(slotFindNext()) ); + TQT_TQOBJECT(this), TQT_SLOT(slotHighlight( const TQString &, int, int )) ); + connect( m_tqfind, TQT_SIGNAL(findNext()), TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()) ); m_tqfind->setData( plainText() ); slotFindNext(); @@ -596,7 +594,7 @@ void KNote::slotFindNext() // TODO: dialogClosed() -> delete m_tqfind // Let KFind inspect the text fragment, and display a dialog if a match is found - KFind::Result res = m_tqfind->tqfind(); + KFind::Result res = m_tqfind->find(); if ( res == KFind::NoMatch ) // i.e. at end-pos { @@ -798,7 +796,7 @@ void KNote::slotPreferences() // create a new preferences dialog... KNoteConfigDlg *dialog = new KNoteConfigDlg( m_config, name(), this, noteId().utf8() ); - connect( dialog, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT(slotApplyConfig()) ); + connect( dialog, TQT_SIGNAL(settingsChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotApplyConfig()) ); connect( this, TQT_SIGNAL(sigNameChanged()), dialog, TQT_SLOT(slotUpdateCaption()) ); dialog->show(); } @@ -806,7 +804,7 @@ void KNote::slotPreferences() void KNote::slotSend() { // pop up dialog to get the IP - KNoteHostDlg hostDlg( i18n("Send \"%1\"").arg( name() ), this ); + KNoteHostDlg hostDlg( i18n("Send \"%1\"").tqarg( name() ), this ); aboutToEnterEventLoop(); bool ok = (hostDlg.exec() == TQDialog::Accepted); eventLoopLeft(); @@ -893,7 +891,7 @@ void KNote::slotSaveAs() if ( file.exists() && KMessageBox::warningContinueCancel( this, i18n("<qt>A file named <b>%1</b> already exists.<br>" - "Are you sure you want to overwrite it?</qt>").arg( TQFileInfo(file).fileName() ) ) + "Are you sure you want to overwrite it?</qt>").tqarg( TQFileInfo(file).fileName() ) ) != KMessageBox::Continue ) { m_blockEmitDataChanged = false; @@ -988,7 +986,7 @@ void KNote::slotUpdateDesktopActions() int count = wm_root.numberOfDesktops(); for ( int n = 1; n <= count; n++ ) - desktops.append( TQString("&%1 %2").arg( n ).arg( TQString::fromUtf8(wm_root.desktopName( n )) ) ); + desktops.append( TQString("&%1 %2").tqarg( n ).tqarg( TQString::fromUtf8(wm_root.desktopName( n )) ) ); m_toDesktop->setItems( desktops ); @@ -1022,7 +1020,7 @@ void KNote::createFold() TQPixmap fold( 15, 15 ); TQPainter foldp( &fold ); foldp.setPen( TQt::NoPen ); - foldp.setBrush( palette().active().dark() ); + foldp.setBrush( tqpalette().active().dark() ); TQPointArray foldpoints( 3 ); foldpoints.putPoints( 0, 3, 0, 0, 14, 0, 0, 14 ); foldp.drawPolygon( foldpoints ); @@ -1044,7 +1042,7 @@ void KNote::updateFocus() { if ( hasFocus() ) { - m_label->setBackgroundColor( palette().active().shadow() ); + m_label->setBackgroundColor( tqpalette().active().shadow() ); m_button->show(); if ( !m_editor->isReadOnly() ) @@ -1080,11 +1078,11 @@ void KNote::updateFocus() if ( s_ppOffset ) { - m_label->setBackgroundColor( palette().active().midlight() ); + m_label->setBackgroundColor( tqpalette().active().midlight() ); m_fold->show(); } else - m_label->setBackgroundColor( palette().active().background() ); + m_label->setBackgroundColor( tqpalette().active().background() ); } } @@ -1137,7 +1135,7 @@ void KNote::updateBackground( int y_offset ) TQImage grad_img( w, h, 32 ); TQRgb rgbcol; - TQColor bg = palette().active().background(); + TQColor bg = tqpalette().active().background(); for ( int i = 0; i < h; ++i ) { @@ -1171,7 +1169,7 @@ void KNote::updateLayout() if ( s_ppOffset ) { if ( !m_editor->paper().pixmap() ) // just changed the style - setColor( palette().active().foreground(), palette().active().background() ); + setColor( tqpalette().active().foreground(), tqpalette().active().background() ); m_pushpin->show(); setFrameStyle( Panel | Raised ); @@ -1184,7 +1182,7 @@ void KNote::updateLayout() else { if ( m_editor->paper().pixmap() ) // just changed the style - setColor( palette().active().foreground(), palette().active().background() ); + setColor( tqpalette().active().foreground(), tqpalette().active().background() ); setFrameStyle( WinPanel | Raised ); m_pushpin->hide(); @@ -1318,7 +1316,7 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return true; } - if ( o == m_label ) + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_label) ) { TQMouseEvent *e = (TQMouseEvent *)ev; @@ -1328,12 +1326,12 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) slotRename(); } if ( ev->type() == TQEvent::MouseButtonPress && - (e->button() == LeftButton || e->button() == MidButton)) + (e->button() == Qt::LeftButton || e->button() == Qt::MidButton)) { - e->button() == LeftButton ? KWin::raiseWindow( winId() ) + e->button() == Qt::LeftButton ? KWin::raiseWindow( winId() ) : KWin::lowerWindow( winId() ); - XUngrabPointer( qt_xdisplay(), qt_x_time ); + XUngrabPointer( qt_xdisplay(), GET_QT_X_TIME() ); NETRootInfo wm_root( qt_xdisplay(), NET::WMMoveResize ); wm_root.moveResizeRequest( winId(), e->globalX(), e->globalY(), NET::Move ); return true; @@ -1349,7 +1347,7 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) #endif if ( m_menu && ( ev->type() == TQEvent::MouseButtonPress ) - && ( e->button() == RightButton ) ) + && ( e->button() == Qt::RightButton ) ) { m_menu->popup( TQCursor::pos() ); return true; @@ -1358,9 +1356,9 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return false; } - if ( o == m_editor ) { + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editor) ) { if ( ev->type() == TQEvent::FocusOut ) { - TQFocusEvent *fe = static_cast<TQFocusEvent *>(ev); + TQFocusEvent *fe = TQT_TQFOCUSEVENT(ev); if ( fe->reason() != TQFocusEvent::Popup && fe->reason() != TQFocusEvent::Mouse ) { updateFocus(); @@ -1377,11 +1375,11 @@ bool KNote::eventFilter( TQObject *o, TQEvent *ev ) return false; } - if ( o == m_editor->viewport() ) + if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(m_editor->viewport()) ) { if ( m_edit_menu && ev->type() == TQEvent::MouseButtonPress && - ((TQMouseEvent *)ev)->button() == RightButton ) + ((TQMouseEvent *)ev)->button() == Qt::RightButton ) { m_edit_menu->popup( TQCursor::pos() ); return true; |