diff options
Diffstat (limited to 'tdehtml/tdehtml_ext.cpp')
| -rw-r--r-- | tdehtml/tdehtml_ext.cpp | 135 |
1 files changed, 67 insertions, 68 deletions
diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 0391345f3..9b5d2efe5 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -1,4 +1,3 @@ -// -*- c-basic-offset: 2 -*- /* This file is part of the KDE project * * Copyright (C) 2000-2003 Simon Hausmann <hausmann@kde.org> @@ -40,14 +39,14 @@ #include <tqpopupmenu.h> #include <tqurl.h> #include <tqmetaobject.h> -#include <tqucomextra_p.h> +#include <private/tqucomextra_p.h> #include <tqdragobject.h> #include <kdebug.h> #include <tdelocale.h> #include <tdefiledialog.h> #include <tdeio/job.h> -#include <kprocess.h> +#include <tdeprocess.h> #include <tdetoolbarbutton.h> #include <tdetoolbar.h> #include <ksavefile.h> @@ -55,11 +54,11 @@ #include <kstringhandler.h> #include <tdeapplication.h> #include <tdemessagebox.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <krun.h> #include <kurifilter.h> #include <kiconloader.h> -#include <kdesktopfile.h> +#include <tdedesktopfile.h> #include <tdemultipledrag.h> #include <kinputdialog.h> @@ -112,12 +111,12 @@ void TDEHTMLPartBrowserExtension::editableWidgetFocused( TQWidget *widget ) if ( !m_connectedToClipboard && m_editableFormWidget ) { - connect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), - this, TQT_SLOT( updateEditActions() ) ); + connect( TQApplication::clipboard(), TQ_SIGNAL( dataChanged() ), + this, TQ_SLOT( updateEditActions() ) ); - if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) - connect( m_editableFormWidget, TQT_SIGNAL( selectionChanged() ), - this, TQT_SLOT( updateEditActions() ) ); + if ( m_editableFormWidget->inherits( "TQLineEdit" ) || m_editableFormWidget->inherits( "TQTextEdit" ) ) + connect( m_editableFormWidget, TQ_SIGNAL( selectionChanged() ), + this, TQ_SLOT( updateEditActions() ) ); m_connectedToClipboard = true; } @@ -135,14 +134,14 @@ void TDEHTMLPartBrowserExtension::editableWidgetBlurred( TQWidget * /*widget*/ ) if ( m_connectedToClipboard ) { - disconnect( TQApplication::clipboard(), TQT_SIGNAL( dataChanged() ), - this, TQT_SLOT( updateEditActions() ) ); + disconnect( TQApplication::clipboard(), TQ_SIGNAL( dataChanged() ), + this, TQ_SLOT( updateEditActions() ) ); if ( oldWidget ) { - if ( oldWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) || oldWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) - disconnect( oldWidget, TQT_SIGNAL( selectionChanged() ), - this, TQT_SLOT( updateEditActions() ) ); + if ( oldWidget->inherits( "TQLineEdit" ) || oldWidget->inherits( "TQTextEdit" ) ) + disconnect( oldWidget, TQ_SIGNAL( selectionChanged() ), + this, TQ_SLOT( updateEditActions() ) ); } m_connectedToClipboard = false; @@ -154,14 +153,14 @@ void TDEHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *p { if ( m_extensionProxy ) { - disconnect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), - this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + disconnect( m_extensionProxy, TQ_SIGNAL( enableAction( const char *, bool ) ), + this, TQ_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); if ( m_extensionProxy->inherits( "TDEHTMLPartBrowserExtension" ) ) { - disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), - this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); - disconnect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), - this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); + disconnect( m_extensionProxy, TQ_SIGNAL( editableWidgetFocused() ), + this, TQ_SLOT( extensionProxyEditableWidgetFocused() ) ); + disconnect( m_extensionProxy, TQ_SIGNAL( editableWidgetBlurred() ), + this, TQ_SLOT( extensionProxyEditableWidgetBlurred() ) ); } } @@ -169,14 +168,14 @@ void TDEHTMLPartBrowserExtension::setExtensionProxy( KParts::BrowserExtension *p if ( m_extensionProxy ) { - connect( m_extensionProxy, TQT_SIGNAL( enableAction( const char *, bool ) ), - this, TQT_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); + connect( m_extensionProxy, TQ_SIGNAL( enableAction( const char *, bool ) ), + this, TQ_SLOT( extensionProxyActionEnabled( const char *, bool ) ) ); if ( m_extensionProxy->inherits( "TDEHTMLPartBrowserExtension" ) ) { - connect( m_extensionProxy, TQT_SIGNAL( editableWidgetFocused() ), - this, TQT_SLOT( extensionProxyEditableWidgetFocused() ) ); - connect( m_extensionProxy, TQT_SIGNAL( editableWidgetBlurred() ), - this, TQT_SLOT( extensionProxyEditableWidgetBlurred() ) ); + connect( m_extensionProxy, TQ_SIGNAL( editableWidgetFocused() ), + this, TQ_SLOT( extensionProxyEditableWidgetFocused() ) ); + connect( m_extensionProxy, TQ_SIGNAL( editableWidgetBlurred() ), + this, TQ_SLOT( extensionProxyEditableWidgetBlurred() ) ); } enableAction( "cut", m_extensionProxy->isActionEnabled( "cut" ) ); @@ -201,9 +200,9 @@ void TDEHTMLPartBrowserExtension::cut() if ( !m_editableFormWidget ) return; - if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->cut(); - else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->cut(); } @@ -224,7 +223,7 @@ void TDEHTMLPartBrowserExtension::copy() TQClipboard *cb = TQApplication::clipboard(); - disconnect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); + disconnect( cb, TQ_SIGNAL( selectionChanged() ), m_part, TQ_SLOT( slotClearSelection() ) ); #ifndef TQT_NO_MIMECLIPBOARD TQString htmltext; /* @@ -250,13 +249,13 @@ void TDEHTMLPartBrowserExtension::copy() cb->setText(text); #endif - connect( cb, TQT_SIGNAL( selectionChanged() ), m_part, TQT_SLOT( slotClearSelection() ) ); + connect( cb, TQ_SIGNAL( selectionChanged() ), m_part, TQ_SLOT( slotClearSelection() ) ); } else { - if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->copy(); - else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->copy(); } } @@ -264,7 +263,7 @@ void TDEHTMLPartBrowserExtension::copy() void TDEHTMLPartBrowserExtension::searchProvider() { // action name is of form "previewProvider[<searchproviderprefix>:]" - const TQString searchProviderPrefix = TQString( TQT_TQOBJECT_CONST(sender())->name() ).mid( 14 ); + const TQString searchProviderPrefix = TQString( sender()->name() ).mid( 14 ); KURIFilterData data; TQStringList list; @@ -273,7 +272,7 @@ void TDEHTMLPartBrowserExtension::searchProvider() if( !KURIFilter::self()->filterURI(data, list) ) { - KDesktopFile file("searchproviders/google.desktop", true, "services"); + TDEDesktopFile file("searchproviders/google.desktop", true, "services"); TQString encodedSearchTerm = m_part->selectedText(); TQUrl::encode(encodedSearchTerm); data.setData(file.readEntry("Query").replace("\\{@}", encodedSearchTerm)); @@ -304,9 +303,9 @@ void TDEHTMLPartBrowserExtension::paste() if ( !m_editableFormWidget ) return; - if ( m_editableFormWidget->inherits( TQLINEEDIT_OBJECT_NAME_STRING ) ) + if ( m_editableFormWidget->inherits( "TQLineEdit" ) ) static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->paste(); - else if ( m_editableFormWidget->inherits( TQTEXTEDIT_OBJECT_NAME_STRING ) ) + else if ( m_editableFormWidget->inherits( "TQTextEdit" ) ) static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->paste(); } @@ -344,9 +343,9 @@ void TDEHTMLPartBrowserExtension::updateEditActions() bool hasSelection = false; if( m_editableFormWidget) { - if ( ::tqqt_cast<TQLineEdit*>(m_editableFormWidget)) + if ( ::tqt_cast<TQLineEdit*>(m_editableFormWidget)) hasSelection = static_cast<TQLineEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); - else if(::tqqt_cast<TQTextEdit*>(m_editableFormWidget)) + else if(::tqt_cast<TQTextEdit*>(m_editableFormWidget)) hasSelection = static_cast<TQTextEdit *>( &(*m_editableFormWidget) )->hasSelectedText(); } @@ -430,7 +429,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri if (hasSelection) { - TDEAction* copyAction = KStdAction::copy( d->m_tdehtml->browserExtension(), TQT_SLOT( copy() ), actionCollection(), "copy" ); + TDEAction* copyAction = KStdAction::copy( d->m_tdehtml->browserExtension(), TQ_SLOT( copy() ), actionCollection(), "copy" ); copyAction->setText(i18n("&Copy Text")); copyAction->setEnabled(d->m_tdehtml->browserExtension()->isActionEnabled( "copy" )); actionCollection()->insert( tdehtml->actionCollection()->action( "selectAll" ) ); @@ -478,7 +477,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri // using .arg(foo, bar) instead of .arg(foo).arg(bar), as foo can contain %x new TDEAction( i18n( "Search for '%1' with %2" ).arg( selectedText, name ), icon, 0, d->m_tdehtml->browserExtension(), - TQT_SLOT( searchProvider() ), actionCollection(), "searchProvider" ); + TQ_SLOT( searchProvider() ), actionCollection(), "searchProvider" ); // favorite search providers TQStringList favoriteEngines; @@ -508,7 +507,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri name = service->name(); providerList->insert( new TDEAction( name, icon, 0, d->m_tdehtml->browserExtension(), - TQT_SLOT( searchProvider() ), actionCollection(), TQString( "searchProvider" + searchProviderPrefix ).latin1() ) ); + TQ_SLOT( searchProvider() ), actionCollection(), TQString( "searchProvider" + searchProviderPrefix ).latin1() ) ); } } } @@ -516,13 +515,13 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri if ( selectedText.contains("://") && KURL(selectedText).isValid() ) new TDEAction( i18n( "Open '%1'" ).arg( selectedText ), "window-new", 0, - d->m_tdehtml->browserExtension(), TQT_SLOT( openSelection() ), actionCollection(), "openSelection" ); + d->m_tdehtml->browserExtension(), TQ_SLOT( openSelection() ), actionCollection(), "openSelection" ); } else if ( url.isEmpty() && !isImage ) { actionCollection()->insert( tdehtml->actionCollection()->action( "security" ) ); actionCollection()->insert( tdehtml->actionCollection()->action( "setEncoding" ) ); - new TDEAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + new TDEAction( i18n( "Stop Animations" ), 0, this, TQ_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -530,14 +529,14 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri { if (url.protocol() == "mailto") { - new TDEAction( i18n( "Copy Email Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + new TDEAction( i18n( "Copy Email Address" ), 0, this, TQ_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } else { - new TDEAction( i18n( "&Save Link As..." ), 0, this, TQT_SLOT( slotSaveLinkAs() ), + new TDEAction( i18n( "&Save Link As..." ), 0, this, TQ_SLOT( slotSaveLinkAs() ), actionCollection(), "savelinkas" ); - new TDEAction( i18n( "Copy &Link Address" ), 0, this, TQT_SLOT( slotCopyLinkLocation() ), + new TDEAction( i18n( "Copy &Link Address" ), 0, this, TQ_SLOT( slotCopyLinkLocation() ), actionCollection(), "copylinklocation" ); } } @@ -547,28 +546,28 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri { if ( tdehtml->parentPart() ) { - new TDEAction( i18n( "Open in New &Window" ), "window-new", 0, this, TQT_SLOT( slotFrameInWindow() ), + new TDEAction( i18n( "Open in New &Window" ), "window-new", 0, this, TQ_SLOT( slotFrameInWindow() ), actionCollection(), "frameinwindow" ); - new TDEAction( i18n( "Open in &This Window" ), 0, this, TQT_SLOT( slotFrameInTop() ), + new TDEAction( i18n( "Open in &This Window" ), 0, this, TQ_SLOT( slotFrameInTop() ), actionCollection(), "frameintop" ); - new TDEAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQT_SLOT( slotFrameInTab() ), + new TDEAction( i18n( "Open in &New Tab" ), "tab_new", 0, this, TQ_SLOT( slotFrameInTab() ), actionCollection(), "frameintab" ); - new TDEAction( i18n( "Reload Frame" ), 0, this, TQT_SLOT( slotReloadFrame() ), + new TDEAction( i18n( "Reload Frame" ), 0, this, TQ_SLOT( slotReloadFrame() ), actionCollection(), "reloadframe" ); if ( TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled() ) { if ( tdehtml->d->m_frame->m_type == tdehtml::ChildFrame::IFrame ) - new TDEAction( i18n( "Block IFrame..." ), 0, this, TQT_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); + new TDEAction( i18n( "Block IFrame..." ), 0, this, TQ_SLOT( slotBlockIFrame() ), actionCollection(), "blockiframe" ); } - new TDEAction( i18n( "View Frame Source" ), 0, d->m_tdehtml, TQT_SLOT( slotViewDocumentSource() ), + new TDEAction( i18n( "View Frame Source" ), 0, d->m_tdehtml, TQ_SLOT( slotViewDocumentSource() ), actionCollection(), "viewFrameSource" ); - new TDEAction( i18n( "View Frame Information" ), 0, d->m_tdehtml, TQT_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); + new TDEAction( i18n( "View Frame Information" ), 0, d->m_tdehtml, TQ_SLOT( slotViewPageInfo() ), actionCollection(), "viewFrameInfo" ); // This one isn't in tdehtml_popupmenu.rc anymore, because Print isn't either, // and because print frame is already in the toolbar and the menu. // But leave this here, so that it's easy to read it. - new TDEAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_tdehtml->browserExtension(), TQT_SLOT( print() ), actionCollection(), "printFrame" ); - new TDEAction( i18n( "Save &Frame As..." ), 0, d->m_tdehtml, TQT_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); + new TDEAction( i18n( "Print Frame..." ), "frameprint", 0, d->m_tdehtml->browserExtension(), TQ_SLOT( print() ), actionCollection(), "printFrame" ); + new TDEAction( i18n( "Save &Frame As..." ), 0, d->m_tdehtml, TQ_SLOT( slotSaveFrame() ), actionCollection(), "saveFrame" ); actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( tdehtml->parentPart()->actionCollection()->action( "viewPageInfo" ) ); @@ -579,7 +578,7 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri } else if (isImage || !url.isEmpty()) { actionCollection()->insert( tdehtml->actionCollection()->action( "viewDocumentSource" ) ); actionCollection()->insert( tdehtml->actionCollection()->action( "viewPageInfo" ) ); - new TDEAction( i18n( "Stop Animations" ), 0, this, TQT_SLOT( slotStopAnimations() ), + new TDEAction( i18n( "Stop Animations" ), 0, this, TQ_SLOT( slotStopAnimations() ), actionCollection(), "stopanimations" ); } @@ -598,35 +597,35 @@ TDEHTMLPopupGUIClient::TDEHTMLPopupGUIClient( TDEHTMLPart *tdehtml, const TQStri } else d->m_imageURL = KURL( static_cast<DOM::HTMLInputElement>( e ).src().string() ); - new TDEAction( i18n( "Save Image As..." ), 0, this, TQT_SLOT( slotSaveImageAs() ), + new TDEAction( i18n( "Save Image As..." ), 0, this, TQ_SLOT( slotSaveImageAs() ), actionCollection(), "saveimageas" ); - new TDEAction( i18n( "Send Image..." ), 0, this, TQT_SLOT( slotSendImage() ), + new TDEAction( i18n( "Send Image..." ), 0, this, TQ_SLOT( slotSendImage() ), actionCollection(), "sendimage" ); #ifndef TQT_NO_MIMECLIPBOARD - (new TDEAction( i18n( "Copy Image" ), 0, this, TQT_SLOT( slotCopyImage() ), + (new TDEAction( i18n( "Copy Image" ), 0, this, TQ_SLOT( slotCopyImage() ), actionCollection(), "copyimage" ))->setEnabled(!d->m_pixmap.isNull()); #endif if(d->m_pixmap.isNull()) { //fallback to image location if still loading the image. this will always be true if ifdef TQT_NO_MIMECLIPBOARD - new TDEAction( i18n( "Copy Image Location" ), 0, this, TQT_SLOT( slotCopyImageLocation() ), + new TDEAction( i18n( "Copy Image Location" ), 0, this, TQ_SLOT( slotCopyImageLocation() ), actionCollection(), "copyimagelocation" ); } TQString name = KStringHandler::csqueeze(d->m_imageURL.fileName()+d->m_imageURL.query(), 25); - new TDEAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQT_SLOT( slotViewImage() ), + new TDEAction( i18n( "View Image (%1)" ).arg(d->m_suggestedFilename.isEmpty() ? name.replace("&", "&&") : d->m_suggestedFilename.replace("&", "&&")), 0, this, TQ_SLOT( slotViewImage() ), actionCollection(), "viewimage" ); if (TDEHTMLFactory::defaultHTMLSettings()->isAdFilterEnabled()) { - new TDEAction( i18n( "Block Image..." ), 0, this, TQT_SLOT( slotBlockImage() ), + new TDEAction( i18n( "Block Image..." ), 0, this, TQ_SLOT( slotBlockImage() ), actionCollection(), "blockimage" ); if (!d->m_imageURL.host().isEmpty() && !d->m_imageURL.protocol().isEmpty()) { - new TDEAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQT_SLOT( slotBlockHost() ), + new TDEAction( i18n( "Block Images From %1" ).arg(d->m_imageURL.host()), 0, this, TQ_SLOT( slotBlockHost() ), actionCollection(), "blockhost" ); } } @@ -658,7 +657,7 @@ void TDEHTMLPopupGUIClient::slotSendImage() TQStringList urls; urls.append( d->m_imageURL.url()); TQString subject = d->m_imageURL.url(); - kapp->invokeMailer(TQString::null, TQString::null, TQString::null, subject, + tdeApp->invokeMailer(TQString::null, TQString::null, TQString::null, subject, TQString::null, //body TQString::null, urls); // attachments @@ -957,8 +956,8 @@ void TDEHTMLPartBrowserHostExtension::virtual_hook( int id, void *data ) // defined in tdehtml_part.cpp -extern const int KDE_NO_EXPORT fastZoomSizes[]; -extern const int KDE_NO_EXPORT fastZoomSizeCount; +extern const int TDE_NO_EXPORT fastZoomSizes[]; +extern const int TDE_NO_EXPORT fastZoomSizeCount; // BCI: remove in KDE 4 TDEHTMLZoomFactorAction::TDEHTMLZoomFactorAction( TDEHTMLPart *part, bool direction, const TQString &text, const TQString &icon, const TQObject *receiver, const char *slot, TQObject *parent, const char *name ) @@ -996,7 +995,7 @@ void TDEHTMLZoomFactorAction::init(TDEHTMLPart *part, bool direction) m_popup->insertItem( i18n( "%1%" ).arg( fastZoomSizes[ofs + i] ) ); } - connect( m_popup, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotActivated( int ) ) ); + connect( m_popup, TQ_SIGNAL( activated( int ) ), this, TQ_SLOT( slotActivated( int ) ) ); } TDEHTMLZoomFactorAction::~TDEHTMLZoomFactorAction() |
