diff options
author | Timothy Pearson <[email protected]> | 2013-02-01 15:02:43 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2013-02-01 15:02:43 -0600 |
commit | aea627236e4de24599c3e30617cf264c3c1b7d40 (patch) | |
tree | 467e13ca5a7eb0ab292259289ecc3572f53c5eae /lib/kofficeui | |
parent | 786304c6211f35ddc4cdd54b7aa7985fef4a2e70 (diff) | |
download | koffice-aea627236e4de24599c3e30617cf264c3c1b7d40.tar.gz koffice-aea627236e4de24599c3e30617cf264c3c1b7d40.zip |
Rename a number of classes to enhance compatibility with KDE4
Diffstat (limited to 'lib/kofficeui')
29 files changed, 243 insertions, 243 deletions
diff --git a/lib/kofficeui/KoCommandHistory.cpp b/lib/kofficeui/KoCommandHistory.cpp index 2b5824ed..c0c81596 100644 --- a/lib/kofficeui/KoCommandHistory.cpp +++ b/lib/kofficeui/KoCommandHistory.cpp @@ -84,14 +84,14 @@ KoCommandHistory::KoCommandHistory() : clear(); } -KoCommandHistory::KoCommandHistory(KActionCollection * actionCollection, bool withMenus) : +KoCommandHistory::KoCommandHistory(TDEActionCollection * actionCollection, bool withMenus) : m_undoLimit(50), m_redoLimit(30), m_first(false) { d=new KoCommandHistoryPrivate(); if (withMenus) { - KToolBarPopupAction * undo = new KToolBarPopupAction( i18n("&Undo"), "undo", - KStdAccel::undo(), this, TQT_SLOT( undo() ), + TDEToolBarPopupAction * undo = new TDEToolBarPopupAction( i18n("&Undo"), "undo", + TDEStdAccel::undo(), this, TQT_SLOT( undo() ), actionCollection, /*KStdAction::stdName( KStdAction::Undo )*/"koffice_undo" ); connect( undo->popupMenu(), TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( slotUndoAboutToShow() ) ); connect( undo->popupMenu(), TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( slotUndoActivated( int ) ) ); @@ -109,8 +109,8 @@ KoCommandHistory::KoCommandHistory(KActionCollection * actionCollection, bool wi connect( d->m_undoListBox, TQT_SIGNAL( changeNumberOfSelectedItem( int )), this, TQT_SLOT( slotChangeUndoNumberOfSelectedItem( int ))); - KToolBarPopupAction * redo = new KToolBarPopupAction( i18n("&Redo"), "redo", - KStdAccel::redo(), this, TQT_SLOT( redo() ), + TDEToolBarPopupAction * redo = new TDEToolBarPopupAction( i18n("&Redo"), "redo", + TDEStdAccel::redo(), this, TQT_SLOT( redo() ), actionCollection, /*KStdAction::stdName( KStdAction::Redo )*/ "koffice_redo"); connect( redo->popupMenu(), TQT_SIGNAL( aboutToShow() ), this, TQT_SLOT( slotRedoAboutToShow() ) ); diff --git a/lib/kofficeui/KoCommandHistory.h b/lib/kofficeui/KoCommandHistory.h index 554b4b19..02af7c80 100644 --- a/lib/kofficeui/KoCommandHistory.h +++ b/lib/kofficeui/KoCommandHistory.h @@ -26,8 +26,8 @@ #include <tqobject.h> #include <koffice_export.h> -class KAction; -class KActionCollection; +class TDEAction; +class TDEActionCollection; class TQPopupMenu; class KCommand; #include <tqlistbox.h> @@ -76,7 +76,7 @@ public: * @param withMenus if true, the actions will display a menu when plugged * into a toolbar. */ - KoCommandHistory(KActionCollection *actionCollection, bool withMenus = true); + KoCommandHistory(TDEActionCollection *actionCollection, bool withMenus = true); /** * Destructs the command history object. @@ -133,12 +133,12 @@ public: public slots: /** * Undoes the last action. - * Call this if you don't use the builtin KActions. + * Call this if you don't use the builtin TDEActions. */ virtual void undo(); /** * Redoes the last undone action. - * Call this if you don't use the builtin KActions. + * Call this if you don't use the builtin TDEActions. */ virtual void redo(); /** @@ -186,7 +186,7 @@ private: void clipCommands(); // ensures that the limits are kept TQPtrList<KCommand> m_commands; - KAction *m_undo, *m_redo; + TDEAction *m_undo, *m_redo; TQPopupMenu *m_undoPopup, *m_redoPopup; int m_undoLimit, m_redoLimit; bool m_first; // attention: it's the first command in the list! diff --git a/lib/kofficeui/KoContextCelp.cpp b/lib/kofficeui/KoContextCelp.cpp index 8e129f98..e6ae509d 100644 --- a/lib/kofficeui/KoContextCelp.cpp +++ b/lib/kofficeui/KoContextCelp.cpp @@ -507,8 +507,8 @@ void KoContextHelpPopup::keyReleaseEvent( TQKeyEvent* e ) } } // KoContextHelpPopup::keyPressEvent -KoContextHelpAction::KoContextHelpAction( KActionCollection* parent, TQWidget* /*popupParent*/ ) - : KToggleAction( i18n( "Context Help" ), BarIcon( "help" ), KShortcut( "CTRL+SHIFT+F1" ), 0, 0, parent, "help_context" ) +KoContextHelpAction::KoContextHelpAction( TDEActionCollection* parent, TQWidget* /*popupParent*/ ) + : TDEToggleAction( i18n( "Context Help" ), BarIcon( "help" ), TDEShortcut( "CTRL+SHIFT+F1" ), 0, 0, parent, "help_context" ) { m_popup = new KoContextHelpPopup( 0L ); connect( m_popup, TQT_SIGNAL( wantsToBeClosed() ), this, TQT_SLOT( closePopup() ) ); diff --git a/lib/kofficeui/KoContextCelp.h b/lib/kofficeui/KoContextCelp.h index 9e466677..2776d409 100644 --- a/lib/kofficeui/KoContextCelp.h +++ b/lib/kofficeui/KoContextCelp.h @@ -214,13 +214,13 @@ class KoContextHelpPopup : public TQWidget * This action displays on demand a context help in a popup. * The context help is set by the updateHelp slot. */ -class KOFFICEUI_EXPORT KoContextHelpAction : public KToggleAction +class KOFFICEUI_EXPORT KoContextHelpAction : public TDEToggleAction { Q_OBJECT public: - KoContextHelpAction( KActionCollection* parentCollection, TQWidget* parent = 0 ); + KoContextHelpAction( TDEActionCollection* parentCollection, TQWidget* parent = 0 ); virtual ~KoContextHelpAction(); public slots: diff --git a/lib/kofficeui/KoGuides.cpp b/lib/kofficeui/KoGuides.cpp index 870fddc6..61200fbe 100644 --- a/lib/kofficeui/KoGuides.cpp +++ b/lib/kofficeui/KoGuides.cpp @@ -36,7 +36,7 @@ #include "KoGuideLineDia.h" -class KoGuides::Popup : public KPopupMenu +class KoGuides::Popup : public TDEPopupMenu { public: Popup( KoGuides * guides ) diff --git a/lib/kofficeui/KoInsertLink.cpp b/lib/kofficeui/KoInsertLink.cpp index 098a4880..e3fd77cc 100644 --- a/lib/kofficeui/KoInsertLink.cpp +++ b/lib/kofficeui/KoInsertLink.cpp @@ -466,7 +466,7 @@ fileLinkPage::fileLinkPage( TQWidget *parent , char *name ) recentFile->setMaximumWidth( kapp->desktop()->width()*3/4 ); lay2->addWidget(recentFile); - TQStringList fileList = KRecentDocument::recentDocuments(); + TQStringList fileList = TDERecentDocument::recentDocuments(); TQStringList lst; lst <<""; for (TQStringList::ConstIterator it = fileList.begin();it != fileList.end(); ++it) diff --git a/lib/kofficeui/KoPartSelectAction.cpp b/lib/kofficeui/KoPartSelectAction.cpp index 17bda1e3..2077b31d 100644 --- a/lib/kofficeui/KoPartSelectAction.cpp +++ b/lib/kofficeui/KoPartSelectAction.cpp @@ -22,14 +22,14 @@ #include <kdebug.h> KoPartSelectAction::KoPartSelectAction( const TQString& text, TQObject* parent, const char* name ) - : KActionMenu( text, parent, name ) + : TDEActionMenu( text, parent, name ) { init(); } KoPartSelectAction::KoPartSelectAction( const TQString& text, const TQString& icon, TQObject* parent, const char* name ) - : KActionMenu( text, icon, parent, name ) + : TDEActionMenu( text, icon, parent, name ) { init(); } @@ -37,7 +37,7 @@ KoPartSelectAction::KoPartSelectAction( const TQString& text, const TQString& ic KoPartSelectAction::KoPartSelectAction( const TQString& text, const TQString& icon, TQObject* receiver, const char* slot, TQObject* parent, const char* name ) - : KActionMenu( text, icon, parent, name ) + : TDEActionMenu( text, icon, parent, name ) { if (receiver) connect( this, TQT_SIGNAL( activated() ), receiver, slot ); @@ -52,7 +52,7 @@ void KoPartSelectAction::init() for( ; it != m_lstEntries.end(); ++it ) { KService::Ptr serv = (*it).service(); if (!serv->genericName().isEmpty()) { - KAction *action = new KAction( serv->genericName().replace('&',"&&"), serv->icon(), 0, + TDEAction *action = new TDEAction( serv->genericName().replace('&',"&&"), serv->icon(), 0, this, TQT_SLOT( slotActionActivated() ), parentCollection(), serv->name().latin1() ); insert( action ); diff --git a/lib/kofficeui/KoPartSelectAction.h b/lib/kofficeui/KoPartSelectAction.h index 2bfc119e..7f38617d 100644 --- a/lib/kofficeui/KoPartSelectAction.h +++ b/lib/kofficeui/KoPartSelectAction.h @@ -27,7 +27,7 @@ * In a toolbar it presents itself as a button that opens the part-select dialog, * but in a popupmenu it presents itself as a submenu with all available parts. */ -class KOFFICEUI_EXPORT KoPartSelectAction : public KActionMenu +class KOFFICEUI_EXPORT KoPartSelectAction : public TDEActionMenu { Q_OBJECT diff --git a/lib/kofficeui/KoSelectAction.cpp b/lib/kofficeui/KoSelectAction.cpp index 171c455b..eb308452 100644 --- a/lib/kofficeui/KoSelectAction.cpp +++ b/lib/kofficeui/KoSelectAction.cpp @@ -37,7 +37,7 @@ class KoSelectAction::KoSelectActionPrivate public: KoSelectActionPrivate() { - m_popup = new KPopupMenu(0L,"KoLineStyleAction::popup"); + m_popup = new TDEPopupMenu(0L,"KoLineStyleAction::popup"); m_currentSelection = 0; } @@ -47,12 +47,12 @@ class KoSelectAction::KoSelectActionPrivate m_popup = 0; } - KPopupMenu* m_popup; + TDEPopupMenu* m_popup; int m_currentSelection; }; KoSelectAction::KoSelectAction(const TQString &text, const TQString& icon, - TQObject* parent, const char* name) : KAction(text, icon, 0, parent, name) + TQObject* parent, const char* name) : TDEAction(text, icon, 0, parent, name) { d = new KoSelectActionPrivate; setShowCurrentSelection(true); @@ -61,7 +61,7 @@ KoSelectAction::KoSelectAction(const TQString &text, const TQString& icon, } KoSelectAction::KoSelectAction(const TQString &text, const TQString& icon, const TQObject* receiver, - const char* slot, TQObject* parent, const char* name) : KAction(text, icon, 0, parent, name) + const char* slot, TQObject* parent, const char* name) : TDEAction(text, icon, 0, parent, name) { d = new KoSelectActionPrivate; @@ -74,7 +74,7 @@ KoSelectAction::~KoSelectAction() delete d; } -KPopupMenu* KoSelectAction::popupMenu() const +TDEPopupMenu* KoSelectAction::popupMenu() const { return d->m_popup; } @@ -86,10 +86,10 @@ void KoSelectAction::popup(const TQPoint& global) int KoSelectAction::plug(TQWidget* widget, int index) { - // This function is copied from KActionMenu::plug - if (kapp && !kapp->authorizeKAction(name())) + // This function is copied from TDEActionMenu::plug + if (kapp && !kapp->authorizeTDEAction(name())) return -1; - kdDebug(129) << "KAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis + kdDebug(129) << "TDEAction::plug( " << widget << ", " << index << " )" << endl; // remove -- ellis if ( widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) ) { TQPopupMenu* menu = static_cast<TQPopupMenu*>( widget ); @@ -109,11 +109,11 @@ int KoSelectAction::plug(TQWidget* widget, int index) return containerCount() - 1; } - else if ( widget->inherits( "KToolBar" ) ) + else if ( widget->inherits( "TDEToolBar" ) ) { - KToolBar *bar = static_cast<KToolBar *>( widget ); + TDEToolBar *bar = static_cast<TDEToolBar *>( widget ); - int id_ = KAction::getToolButtonID(); + int id_ = TDEAction::getToolButtonID(); if ( icon().isEmpty() && !iconSet().isNull() ) { bar->insertButton( iconSet().pixmap(), id_, TQT_SIGNAL( clicked() ), this, diff --git a/lib/kofficeui/KoSelectAction.h b/lib/kofficeui/KoSelectAction.h index 4c0f65d3..7c0f5a25 100644 --- a/lib/kofficeui/KoSelectAction.h +++ b/lib/kofficeui/KoSelectAction.h @@ -21,14 +21,14 @@ #include <kaction.h> #include <koffice_export.h> -class KPopupMenu; +class TDEPopupMenu; class TQPoint; /** An action that provides a menu with items that can be selected. - * The main difference between this action and a KSelectAction is that + * The main difference between this action and a TDESelectAction is that * it is plugged into a toolbar as a dropdown menu and not as a combobox. */ -class KOFFICEUI_EXPORT KoSelectAction : public KAction +class KOFFICEUI_EXPORT KoSelectAction : public TDEAction { Q_OBJECT @@ -53,7 +53,7 @@ class KOFFICEUI_EXPORT KoSelectAction : public KAction ~KoSelectAction(); /** Returns a pointer to the popup menu. */ - KPopupMenu* popupMenu() const; + TDEPopupMenu* popupMenu() const; /** Shows the popup menu. * @param global Position at which the popup menu is shown. */ diff --git a/lib/kofficeui/KoTemplateChooseDia.cpp b/lib/kofficeui/KoTemplateChooseDia.cpp index 7fa49228..1bd11b36 100644 --- a/lib/kofficeui/KoTemplateChooseDia.cpp +++ b/lib/kofficeui/KoTemplateChooseDia.cpp @@ -223,7 +223,7 @@ KoTemplateChooseDia::~KoTemplateChooseDia() // Keep in sync with KoMainWindow::chooseNewDocument static bool cancelQuits() { bool onlyDoc = !KoDocument::documentList() || KoDocument::documentList()->count() <= 1; - bool onlyMainWindow = !KMainWindow::memberList || KMainWindow::memberList->count() <= 1; + bool onlyMainWindow = !TDEMainWindow::memberList || TDEMainWindow::memberList->count() <= 1; return onlyDoc && onlyMainWindow && kapp->instanceName() != "koshell"; // hack for koshell } diff --git a/lib/kofficeui/KoTemplateCreateDia.cpp b/lib/kofficeui/KoTemplateCreateDia.cpp index a42b580f..1d0fec2a 100644 --- a/lib/kofficeui/KoTemplateCreateDia.cpp +++ b/lib/kofficeui/KoTemplateCreateDia.cpp @@ -81,7 +81,7 @@ public: TQLabel *m_preview; TQString m_customFile; TQPixmap m_customPixmap; - KListView *m_groups; + TDEListView *m_groups; TQPushButton *m_add, *m_remove; TQCheckBox *m_defaultTemplate; TDEInstance *m_instance; @@ -120,7 +120,7 @@ KoTemplateCreateDia::KoTemplateCreateDia( const TQCString &templateType, TDEInst label=new TQLabel(i18n("Group:"), mainwidget); leftbox->addWidget(label); - d->m_groups=new KListView(mainwidget); + d->m_groups=new TDEListView(mainwidget); leftbox->addWidget(d->m_groups); d->m_groups->addColumn(""); d->m_groups->header()->hide(); diff --git a/lib/kofficeui/KoToolBox.cpp b/lib/kofficeui/KoToolBox.cpp index d266aaaa..12c8b06e 100644 --- a/lib/kofficeui/KoToolBox.cpp +++ b/lib/kofficeui/KoToolBox.cpp @@ -44,8 +44,8 @@ #include <config.h> #endif -KoToolBox::KoToolBox( KMainWindow *mainWin, const char* name, TDEInstance* instance, int numberOfTooltypes ) - : KToolBar( mainWin, TQt::DockLeft, false, name, true, true), m_instance(instance) +KoToolBox::KoToolBox( TDEMainWindow *mainWin, const char* name, TDEInstance* instance, int numberOfTooltypes ) + : TDEToolBar( mainWin, TQt::DockLeft, false, name, true, true), m_instance(instance) { setFullSize( false ); setMargin(2); @@ -83,7 +83,7 @@ void KoToolBox::slotButtonPressed( int id ) } -void KoToolBox::registerTool( KAction *tool, int toolType, TQ_UINT32 priority ) +void KoToolBox::registerTool( TDEAction *tool, int toolType, TQ_UINT32 priority ) { uint prio = priority; ToolList * tl = m_tools.at(toolType); @@ -122,7 +122,7 @@ void KoToolBox::setupTools() ToolList::Iterator it; for ( it = tl->begin(); it != tl->end(); ++it ) { - KAction *tool = it.data(); + TDEAction *tool = it.data(); if(! tool) continue; TQToolButton *bn = createButton(tools->getNextParent(), tool->icon().latin1(), tool->toolTip()); @@ -179,7 +179,7 @@ void KoToolBox::enableTools(bool enable) void KoToolBox::slotSetTool(const TQString & toolname) { for (uint i = 0; i < m_idToActionMap.count(); ++i) { - KAction * a = m_idToActionMap.at(i); + TDEAction * a = m_idToActionMap.at(i); if (!a || a->name() != toolname) continue; m_buttonGroup->setButton(i); diff --git a/lib/kofficeui/KoToolBox.h b/lib/kofficeui/KoToolBox.h index 25c9f1c4..93a82b34 100644 --- a/lib/kofficeui/KoToolBox.h +++ b/lib/kofficeui/KoToolBox.h @@ -26,15 +26,15 @@ #include <ktoolbar.h> class TQWidget; -class KAction; -class KMainWindow; +class TDEAction; +class TDEMainWindow; class KDualColorButton; class TQGridLayout; class ToolArea; /** - * KActionBox is a kind of super-specialized toolbox that can order + * TDEActionBox is a kind of super-specialized toolbox that can order * tools according to type and priority. * * This is to a large extent a port of the Karbon vtoolbox -- with @@ -42,21 +42,21 @@ class ToolArea; * tool-like class, it aggregates actions. */ -class KOFFICEUI_EXPORT KoToolBox : public KToolBar { +class KOFFICEUI_EXPORT KoToolBox : public TDEToolBar { Q_OBJECT public: - KoToolBox( KMainWindow *mainWin, const char* name, TDEInstance* instance, int numberOfTooltypes); + KoToolBox( TDEMainWindow *mainWin, const char* name, TDEInstance* instance, int numberOfTooltypes); virtual ~KoToolBox(); // Called by the toolcontroller for each tool. For every category, // there is a separate list, and the tool is categorized correctly. // The tool is not yet added to the widgets; call setupTools() // to do that. We don't store the tool. - void registerTool(KAction * tool, int toolType, TQ_UINT32 priority); + void registerTool(TDEAction * tool, int toolType, TQ_UINT32 priority); // Called when all tools have been added by the tool controller void setupTools(); @@ -84,10 +84,10 @@ private: TQPtrList<ToolArea> m_toolBoxes; // For every ToolArea - typedef TQMap< int, KAction*> ToolList; // The priority ordered list of tools for a certain tooltype + typedef TQMap< int, TDEAction*> ToolList; // The priority ordered list of tools for a certain tooltype TQPtrList<ToolList> m_tools; - TQPtrList<KAction> m_idToActionMap; // Map the buttongroup id's to actions for easy activating. + TQPtrList<TDEAction> m_idToActionMap; // Map the buttongroup id's to actions for easy activating. TDEInstance* m_instance; }; diff --git a/lib/kofficeui/KoTooluButton.cpp b/lib/kofficeui/KoTooluButton.cpp index cc04c714..ba08e1a1 100644 --- a/lib/kofficeui/KoTooluButton.cpp +++ b/lib/kofficeui/KoTooluButton.cpp @@ -647,14 +647,14 @@ void KoColorPopupProxy::slotMoreColors() KoToolButton::KoToolButton( const TQString& icon, int id, TQWidget* parent, const char* name, const TQString& txt, TDEInstance* _instance ) : - KToolBarButton( icon, id, parent, name, txt, _instance ), m_arrowPressed( false ) + TDEToolBarButton( icon, id, parent, name, txt, _instance ), m_arrowPressed( false ) { init(); } KoToolButton::KoToolButton( const TQPixmap& pixmap, int id, TQWidget* parent, const char* name, const TQString& txt ) : - KToolBarButton( pixmap, id, parent, name, txt ), m_arrowPressed( false ) + TDEToolBarButton( pixmap, id, parent, name, txt ), m_arrowPressed( false ) { init(); } @@ -670,7 +670,7 @@ TQSize KoToolButton::sizeHint() const TQSize KoToolButton::minimumSizeHint() const { - TQSize size = KToolBarButton::minimumSizeHint(); + TQSize size = TDEToolBarButton::minimumSizeHint(); size.setWidth( size.width() + ARROW_WIDTH ); return size; } @@ -695,7 +695,7 @@ void KoToolButton::drawButton(TQPainter *_painter) if ( isEnabled() ) { flags |= TQStyle::Style_Enabled; - if ( KToolBarButton::isRaised() || m_arrowPressed ) + if ( TDEToolBarButton::isRaised() || m_arrowPressed ) flags |= TQStyle::Style_Raised; } if ( isOn() ) @@ -723,7 +723,7 @@ void KoToolButton::drawButton(TQPainter *_painter) style().tqdrawPrimitive( TQStyle::PE_ArrowDown, _painter, TQRect( width() - ARROW_WIDTH - 1, 0, ARROW_WIDTH, height() ), cg, flags, opt ); - if ( KToolBarButton::isRaised() || m_arrowPressed ) + if ( TDEToolBarButton::isRaised() || m_arrowPressed ) qDrawShadeLine( _painter, width() - ARROW_WIDTH - 1, 0, width() - ARROW_WIDTH - 1, height() - 1, colorGroup(), true ); int dx, dy; @@ -732,9 +732,9 @@ void KoToolButton::drawButton(TQPainter *_painter) TQRect textRect; int textFlags = 0; - if ( static_cast<KToolBar::IconText>( iconTextMode() ) == KToolBar::IconOnly ) { // icon only + if ( static_cast<TDEToolBar::IconText>( iconTextMode() ) == TDEToolBar::IconOnly ) { // icon only TQPixmap pixmap = iconSet().pixmap( TQIconSet::Automatic, - isEnabled() ? ( KToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : + isEnabled() ? ( TDEToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : TQIconSet::Disabled, isOn() ? TQIconSet::On : TQIconSet::Off ); if ( !pixmap.isNull() ) { dx = ( width() - ARROW_WIDTH - pixmap.width() ) / 2; @@ -743,9 +743,9 @@ void KoToolButton::drawButton(TQPainter *_painter) _painter->drawPixmap( dx, dy, pixmap ); } } - else if ( static_cast<KToolBar::IconText>( iconTextMode() ) == KToolBar::IconTextRight ) { // icon and text (if any) + else if ( static_cast<TDEToolBar::IconText>( iconTextMode() ) == TDEToolBar::IconTextRight ) { // icon and text (if any) TQPixmap pixmap = iconSet().pixmap( TQIconSet::Automatic, - isEnabled() ? ( KToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : + isEnabled() ? ( TDEToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : TQIconSet::Disabled, isOn() ? TQIconSet::On : TQIconSet::Off ); if( !pixmap.isNull()) { dx = 4; @@ -765,7 +765,7 @@ void KoToolButton::drawButton(TQPainter *_painter) textRect = TQRect( dx, dy, width() - dx, height() ); } } - else if ( static_cast<KToolBar::IconText>( iconTextMode() ) == KToolBar::TextOnly ) { + else if ( static_cast<TDEToolBar::IconText>( iconTextMode() ) == TDEToolBar::TextOnly ) { if ( !textLabel().isNull() ) { textFlags = AlignTop | AlignLeft; dx = ( width() - ARROW_WIDTH - fm.width( textLabel() ) ) / 2; @@ -774,9 +774,9 @@ void KoToolButton::drawButton(TQPainter *_painter) textRect = TQRect( dx, dy, fm.width(textLabel()), fm.lineSpacing() ); } } - else if ( static_cast<KToolBar::IconText>( iconTextMode() ) == KToolBar::IconTextBottom ) { + else if ( static_cast<TDEToolBar::IconText>( iconTextMode() ) == TDEToolBar::IconTextBottom ) { TQPixmap pixmap = iconSet().pixmap( TQIconSet::Automatic, - isEnabled() ? ( KToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : + isEnabled() ? ( TDEToolBarButton::isActive() ? TQIconSet::Active : TQIconSet::Normal ) : TQIconSet::Disabled, isOn() ? TQIconSet::On : TQIconSet::Off ); if( !pixmap.isNull()) { dx = ( width() - ARROW_WIDTH - pixmap.width() ) / 2; @@ -799,7 +799,7 @@ void KoToolButton::drawButton(TQPainter *_painter) _painter->setFont( TDEGlobalSettings::toolBarFont() ); if ( !isEnabled() ) _painter->setPen( palette().disabled().dark() ); - else if( KToolBarButton::isRaised() ) + else if( TDEToolBarButton::isRaised() ) _painter->setPen( TDEGlobalSettings::toolBarHighlightColor() ); else _painter->setPen( colorGroup().buttonText() ); @@ -827,7 +827,7 @@ bool KoToolButton::eventFilter( TQObject* o, TQEvent* e ) } else if ( e->type() == TQEvent::MouseButtonRelease ) m_arrowPressed = false; - return KToolBarButton::eventFilter( o, e ); + return TDEToolBarButton::eventFilter( o, e ); } void KoToolButton::init() diff --git a/lib/kofficeui/KoTooluButton.h b/lib/kofficeui/KoTooluButton.h index 1f2ff03c..31a3d332 100644 --- a/lib/kofficeui/KoTooluButton.h +++ b/lib/kofficeui/KoTooluButton.h @@ -126,8 +126,8 @@ private: }; -// Parts of the code are from KToolBarButton -class KoToolButton : public KToolBarButton +// Parts of the code are from TDEToolBarButton +class KoToolButton : public TDEToolBarButton { Q_OBJECT diff --git a/lib/kofficeui/KoZoomAction.cpp b/lib/kofficeui/KoZoomAction.cpp index df1bac4d..09f7d3e4 100644 --- a/lib/kofficeui/KoZoomAction.cpp +++ b/lib/kofficeui/KoZoomAction.cpp @@ -26,15 +26,15 @@ #include <klocale.h> KoZoomAction::KoZoomAction( const TQString& text, const TQIconSet& pix, - const KShortcut& cut, TQObject* parent, const char* name ): - KSelectAction( text, pix, cut, parent, name ) + const TDEShortcut& cut, TQObject* parent, const char* name ): + TDESelectAction( text, pix, cut, parent, name ) { init(); } KoZoomAction::KoZoomAction( const TQString& text, const TQString& pix, - const KShortcut& cut, TQObject* parent, const char* name ): - KSelectAction( text, pix, cut, parent, name ) + const TDEShortcut& cut, TQObject* parent, const char* name ): + TDESelectAction( text, pix, cut, parent, name ) { init(); diff --git a/lib/kofficeui/KoZoomAction.h b/lib/kofficeui/KoZoomAction.h index 118c7a13..12e38103 100644 --- a/lib/kofficeui/KoZoomAction.h +++ b/lib/kofficeui/KoZoomAction.h @@ -28,7 +28,7 @@ * (must be an integer). The values shown on the list are alwalys * sorted. */ -class KOFFICEUI_EXPORT KoZoomAction : public KSelectAction +class KOFFICEUI_EXPORT KoZoomAction : public TDESelectAction { Q_OBJECT @@ -39,13 +39,13 @@ public: * Creates a new zoom action. */ KoZoomAction( const TQString& text, const TQIconSet& pix, - const KShortcut& cut = KShortcut(), TQObject* parent = 0, const char* name = 0 ); + const TDEShortcut& cut = TDEShortcut(), TQObject* parent = 0, const char* name = 0 ); /** * Creates a new zoom action. */ KoZoomAction( const TQString& text, const TQString& pix, - const KShortcut& cut = KShortcut(), TQObject* parent = 0, const char* name = 0 ); + const TDEShortcut& cut = TDEShortcut(), TQObject* parent = 0, const char* name = 0 ); public slots: diff --git a/lib/kofficeui/Kolinestyleaction.cpp b/lib/kofficeui/Kolinestyleaction.cpp index 5fa296f0..c2405045 100644 --- a/lib/kofficeui/Kolinestyleaction.cpp +++ b/lib/kofficeui/Kolinestyleaction.cpp @@ -65,7 +65,7 @@ KoLineStyleAction::~KoLineStyleAction() void KoLineStyleAction::createMenu() { - KPopupMenu* popup = popupMenu(); + TDEPopupMenu* popup = popupMenu(); TQBitmap mask; TQPixmap pix(70, 21); TQPainter p(&pix, popup); diff --git a/lib/kofficeui/Kolinewidthaction.cpp b/lib/kofficeui/Kolinewidthaction.cpp index c812c1c6..84e770cc 100644 --- a/lib/kofficeui/Kolinewidthaction.cpp +++ b/lib/kofficeui/Kolinewidthaction.cpp @@ -80,7 +80,7 @@ KoLineWidthAction::~KoLineWidthAction() void KoLineWidthAction::createMenu() { - KPopupMenu* popup = popupMenu(); + TDEPopupMenu* popup = popupMenu(); TQBitmap mask; TQPixmap pix(70, 21); TQPainter p(&pix, popup); diff --git a/lib/kofficeui/kcoloractions.cpp b/lib/kofficeui/kcoloractions.cpp index b6dc0408..96e48001 100644 --- a/lib/kofficeui/kcoloractions.cpp +++ b/lib/kofficeui/kcoloractions.cpp @@ -30,7 +30,7 @@ KColorAction::KColorAction( const TQString& text, int accel, TQObject* parent, const char* name ) - : KAction( text, accel, parent, name ) + : TDEAction( text, accel, parent, name ) { typ = TextColor; init(); @@ -39,7 +39,7 @@ KColorAction::KColorAction( const TQString& text, int accel, KColorAction::KColorAction( const TQString& text, int accel, TQObject* receiver, const char* slot, TQObject* parent, const char* name ) - : KAction( text, accel, receiver, slot, parent, name ) + : TDEAction( text, accel, receiver, slot, parent, name ) { typ = TextColor; init(); @@ -47,7 +47,7 @@ KColorAction::KColorAction( const TQString& text, int accel, KColorAction::KColorAction( const TQString& text, Type type, int accel, TQObject* parent, const char* name ) - : KAction( text, accel, parent, name ) + : TDEAction( text, accel, parent, name ) { typ = type; init(); @@ -56,14 +56,14 @@ KColorAction::KColorAction( const TQString& text, Type type, int accel, KColorAction::KColorAction( const TQString& text, Type type, int accel, TQObject* receiver, const char* slot, TQObject* parent, const char* name ) - : KAction( text, accel, receiver, slot, parent, name ) + : TDEAction( text, accel, receiver, slot, parent, name ) { typ = type; init(); } KColorAction::KColorAction( TQObject* parent, const char* name ) - : KAction( parent, name ) + : TDEAction( parent, name ) { typ = TextColor; init(); @@ -216,25 +216,25 @@ void KColorAction::createPixmap() } -KSelectColorAction::KSelectColorAction( const TQString& text, Type type, +TDESelectColorAction::TDESelectColorAction( const TQString& text, Type type, const TQObject* receiver, const char* slot, - KActionCollection* parent, const char* name ) : - KAction( text, KShortcut(), receiver, slot, parent, name ), m_type( type ), + TDEActionCollection* parent, const char* name ) : + TDEAction( text, TDEShortcut(), receiver, slot, parent, name ), m_type( type ), m_color( TQt::black ) { } -KSelectColorAction::~KSelectColorAction() +TDESelectColorAction::~TDESelectColorAction() { } -int KSelectColorAction::plug( TQWidget* w, int index ) +int TDESelectColorAction::plug( TQWidget* w, int index ) { if (w == 0) { - kdWarning() << "KSelectColorAction::plug called with 0 argument\n"; + kdWarning() << "TDESelectColorAction::plug called with 0 argument\n"; return -1; } - if (kapp && !kapp->authorizeKAction(name())) + if (kapp && !kapp->authorizeTDEAction(name())) return -1; if ( w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) ) @@ -276,9 +276,9 @@ int KSelectColorAction::plug( TQWidget* w, int index ) return containerCount() - 1; } - else if ( w->inherits( "KToolBar" ) ) + else if ( w->inherits( "TDEToolBar" ) ) { - KToolBar *bar = static_cast<KToolBar *>( w ); + TDEToolBar *bar = static_cast<TDEToolBar *>( w ); int id_ = getToolButtonID(); TDEInstance *instance; @@ -319,25 +319,25 @@ int KSelectColorAction::plug( TQWidget* w, int index ) return -1; } -TQColor KSelectColorAction::color() const +TQColor TDESelectColorAction::color() const { return m_color; } -KSelectColorAction::Type KSelectColorAction::type() const +TDESelectColorAction::Type TDESelectColorAction::type() const { return m_type; } -void KSelectColorAction::setColor( const TQColor &/*c*/ ) +void TDESelectColorAction::setColor( const TQColor &/*c*/ ) { } -void KSelectColorAction::setType( Type /*t*/ ) +void TDESelectColorAction::setType( Type /*t*/ ) { } -TQString KSelectColorAction::whatsThisWithIcon() const +TQString TDESelectColorAction::whatsThisWithIcon() const { TQString text = whatsThis(); if (!icon().isEmpty()) diff --git a/lib/kofficeui/kcoloractions.h b/lib/kofficeui/kcoloractions.h index 3ca03c62..db832d8b 100644 --- a/lib/kofficeui/kcoloractions.h +++ b/lib/kofficeui/kcoloractions.h @@ -26,7 +26,7 @@ * An action whose pixmap is automatically generated from a color. * It knows three types of pixmaps: text color, frame color and background color */ -class KColorAction : public KAction +class KColorAction : public TDEAction { Q_OBJECT @@ -65,7 +65,7 @@ private: }; -class KSelectColorAction : public KAction +class TDESelectColorAction : public TDEAction { Q_OBJECT @@ -76,10 +76,10 @@ public: FillColor }; - KSelectColorAction( const TQString& text, Type type, + TDESelectColorAction( const TQString& text, Type type, const TQObject* receiver, const char* slot, - KActionCollection* parent, const char* name ); - virtual ~KSelectColorAction(); + TDEActionCollection* parent, const char* name ); + virtual ~TDESelectColorAction(); virtual int plug( TQWidget* w, int index = -1 ); diff --git a/lib/kofficeui/tests/coloraction_test.cpp b/lib/kofficeui/tests/coloraction_test.cpp index 3e9c146a..d04a31c4 100644 --- a/lib/kofficeui/tests/coloraction_test.cpp +++ b/lib/kofficeui/tests/coloraction_test.cpp @@ -72,7 +72,7 @@ TopLevel::TopLevel( TQWidget* parent, const char* name) : TQMainWindow( parent, file->insertSeparator(); file->insertItem( "&Quit", tqApp, TQT_SLOT( closeAllWindows() ), CTRL+Key_Q ); - KToolBar* toolBar = new KToolBar( this ); + TDEToolBar* toolBar = new TDEToolBar( this ); addDockWindow( toolBar ); ( void ) new KoToolButton( "color_fill", 1, toolBar, "funky button", "Fill Color" ); } diff --git a/lib/kofficeui/tkaction.cpp b/lib/kofficeui/tkaction.cpp index 7ab01d3f..56c626f8 100644 --- a/lib/kofficeui/tkaction.cpp +++ b/lib/kofficeui/tkaction.cpp @@ -30,8 +30,8 @@ #define SET_FOR_ALL_CONTAINER(WIDGET_TYPE,METHOD_NAME,VALUE) \ for( int id = 0; id < containerCount(); ++id ) { \ TQWidget* w = container(id); \ - if ( w->inherits("KToolBar") ) { \ - TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); \ + if ( w->inherits("TDEToolBar") ) { \ + TQWidget* r = static_cast<TDEToolBar*>(w)->getWidget(itemId(id)); \ if (qstrcmp(r->name(),"KTToolBarLayout")==0) \ r = (TQWidget*)r->child("widget"); \ if ( r && r->inherits(#WIDGET_TYPE) ) { \ @@ -41,21 +41,21 @@ } \ } -TKAction::TKAction(TQObject* parent, const char* name) -: KAction( "", 0, parent, name ) +TTDEAction::TTDEAction(TQObject* parent, const char* name) +: TDEAction( "", 0, parent, name ) { m_imode = TK::IconOnly; } -TKAction::~TKAction() +TTDEAction::~TTDEAction() { } -int TKAction::plug(TQWidget* widget, int index) +int TTDEAction::plug(TQWidget* widget, int index) { - if ( widget->inherits("KToolBar") ) { - KToolBar* bar = static_cast<KToolBar*>(widget); - int id_ = KAction::getToolButtonID(); + if ( widget->inherits("TDEToolBar") ) { + TDEToolBar* bar = static_cast<TDEToolBar*>(widget); + int id_ = TDEAction::getToolButtonID(); TDEInstance *instance; if ( parentCollection() ) @@ -63,7 +63,7 @@ int TKAction::plug(TQWidget* widget, int index) else instance = TDEGlobal::instance(); - TKToolBarButton* b = new TKToolBarButton(icon(),plainText(),bar,name(),instance); + TTDEToolBarButton* b = new TTDEToolBarButton(icon(),plainText(),bar,name(),instance); // we don't need clicked() and buttonClicked(), do we? // connect(b,TQT_SIGNAL(clicked()),TQT_SLOT(slotActivated())); b->setIconMode(m_imode); @@ -75,44 +75,44 @@ int TKAction::plug(TQWidget* widget, int index) return containerCount() - 1; } - return KAction::plug(widget,index); + return TDEAction::plug(widget,index); } -void TKAction::initToolBarButton(TKToolBarButton* button) +void TTDEAction::initToolBarButton(TTDEToolBarButton* button) { connect(button,TQT_SIGNAL(buttonClicked()),TQT_SLOT(slotActivated())); } -TK::IconMode TKAction::iconMode() +TK::IconMode TTDEAction::iconMode() { return m_imode; } -void TKAction::setIconMode(TK::IconMode mode) +void TTDEAction::setIconMode(TK::IconMode mode) { m_imode = mode; - SET_FOR_ALL_CONTAINER(TKToolBarButton,setIconMode,mode) + SET_FOR_ALL_CONTAINER(TTDEToolBarButton,setIconMode,mode) } -void TKAction::setText(const TQString& text) +void TTDEAction::setText(const TQString& text) { - KAction::setText(text); + TDEAction::setText(text); updateLayout(); } -void TKAction::setIcon(const TQString& icon) +void TTDEAction::setIcon(const TQString& icon) { - KAction::setIcon(icon); + TDEAction::setIcon(icon); updateLayout(); } -void TKAction::updateLayout() +void TTDEAction::updateLayout() { int len = containerCount(); for( int id = 0; id < len; ++id ) { TQWidget* w = container( id ); - if (w->inherits("KToolBar")) { - TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); + if (w->inherits("TDEToolBar")) { + TQWidget* r = static_cast<TDEToolBar*>(w)->getWidget(itemId(id)); if (qstrcmp(r->name(),"KTToolBarLayout")==0) { updateLayout(r); } @@ -120,7 +120,7 @@ void TKAction::updateLayout() } } -TQWidget* TKAction::createLayout(TQWidget* parent, TQWidget* children) +TQWidget* TTDEAction::createLayout(TQWidget* parent, TQWidget* children) { TQWidget* base = new TQWidget(parent,"KTToolBarLayout"); TQLabel* textLabel = new TQLabel(base,"text"); @@ -138,7 +138,7 @@ TQWidget* TKAction::createLayout(TQWidget* parent, TQWidget* children) return base; } -void TKAction::updateLayout(TQWidget* base) +void TTDEAction::updateLayout(TQWidget* base) { TQLabel* textLabel = (TQLabel*)base->child("text"); TQLabel* pixLabel = (TQLabel*)base->child("pixmap"); @@ -172,7 +172,7 @@ void TKAction::updateLayout(TQWidget* base) } /******************************************************************************/ TKBaseSelectAction::TKBaseSelectAction( TQObject* parent, const char* name ) -: TKAction(parent,name) +: TTDEAction(parent,name) { m_current = 0; m_editable = false; @@ -184,10 +184,10 @@ TKBaseSelectAction::~TKBaseSelectAction() int TKBaseSelectAction::plug(TQWidget* widget, int index) { - if ( widget->inherits("KToolBar") ) + if ( widget->inherits("TDEToolBar") ) { - KToolBar* bar = static_cast<KToolBar*>( widget ); - int id_ = KAction::getToolButtonID(); + TDEToolBar* bar = static_cast<TDEToolBar*>( widget ); + int id_ = TDEAction::getToolButtonID(); TKComboBox* cb = new TKComboBox(m_editable,bar); initComboBox(cb); @@ -248,28 +248,28 @@ void TKBaseSelectAction::activate(int id) emit activated(id); } /******************************************************************************/ -TKSelectAction::TKSelectAction( TQObject* parent, const char* name ) +TTDESelectAction::TTDESelectAction( TQObject* parent, const char* name ) : TKBaseSelectAction(parent,name) { } -TKSelectAction::~TKSelectAction() +TTDESelectAction::~TTDESelectAction() { } -void TKSelectAction::initComboBox(TKComboBox* cb) +void TTDESelectAction::initComboBox(TKComboBox* cb) { TKBaseSelectAction::initComboBox(cb); connect(cb,TQT_SIGNAL(activated(const TQString&)),TQT_SLOT(slotActivated(const TQString&))); cb->insertStringList(items()); } -void TKSelectAction::slotActivated(const TQString& text) +void TTDESelectAction::slotActivated(const TQString& text) { emit activated(text); } -void TKSelectAction::setItems(const TQStringList& lst ) +void TTDESelectAction::setItems(const TQStringList& lst ) { m_list = lst; m_current = -1; @@ -281,17 +281,17 @@ void TKSelectAction::setItems(const TQStringList& lst ) setEnabled ( lst.count() > 0 || m_editable ); } -TQStringList TKSelectAction::items() const +TQStringList TTDESelectAction::items() const { return m_list; } -void TKSelectAction::clear() +void TTDESelectAction::clear() { SET_FOR_ALL_CONTAINER(TKComboBox,clear, ) } -void TKSelectAction::setEditText(const TQString& text) +void TTDESelectAction::setEditText(const TQString& text) { SET_FOR_ALL_CONTAINER(TKComboBox,setEditText,text) } diff --git a/lib/kofficeui/tkaction.h b/lib/kofficeui/tkaction.h index da38f38d..736bb141 100644 --- a/lib/kofficeui/tkaction.h +++ b/lib/kofficeui/tkaction.h @@ -27,22 +27,22 @@ namespace TK { enum IconMode { IconOnly, IconAndText, TextOnly }; } -class TKToolBarButton; +class TTDEToolBarButton; class TKComboBox; -class KOFFICEUI_EXPORT TKAction : public KAction +class KOFFICEUI_EXPORT TTDEAction : public TDEAction { Q_OBJECT public: - TKAction(TQObject* parent, const char* name); - ~TKAction(); + TTDEAction(TQObject* parent, const char* name); + ~TTDEAction(); virtual int plug(TQWidget* widget, int index = -1); TK::IconMode iconMode(); protected: - virtual void initToolBarButton(TKToolBarButton*); + virtual void initToolBarButton(TTDEToolBarButton*); TQWidget* createLayout(TQWidget* parent, TQWidget* children); void updateLayout(); @@ -55,14 +55,14 @@ public slots: private: TK::IconMode m_imode; - class TKActionPrivate; - TKActionPrivate *d; + class TTDEActionPrivate; + TTDEActionPrivate *d; }; /******************************************************************************/ -class KOFFICEUI_EXPORT TKBaseSelectAction : public TKAction +class KOFFICEUI_EXPORT TKBaseSelectAction : public TTDEAction { Q_OBJECT -friend class TKSelectAction; +friend class TTDESelectAction; public: TKBaseSelectAction(TQObject* parent, const char* name); ~TKBaseSelectAction(); @@ -94,12 +94,12 @@ private: TKBaseSelectActionPrivate *d; }; /******************************************************************************/ -class KOFFICEUI_EXPORT TKSelectAction : public TKBaseSelectAction +class KOFFICEUI_EXPORT TTDESelectAction : public TKBaseSelectAction { Q_OBJECT public: - TKSelectAction(TQObject* parent, const char* name); - ~TKSelectAction(); + TTDESelectAction(TQObject* parent, const char* name); + ~TTDESelectAction(); TQStringList items() const; @@ -119,8 +119,8 @@ signals: private: TQStringList m_list; - class TKSelectActionPrivate; - TKSelectActionPrivate *d; + class TTDESelectActionPrivate; + TTDESelectActionPrivate *d; }; /******************************************************************************/ #endif diff --git a/lib/kofficeui/tkcoloractions.cpp b/lib/kofficeui/tkcoloractions.cpp index 11ddbc7f..3e7d6480 100644 --- a/lib/kofficeui/tkcoloractions.cpp +++ b/lib/kofficeui/tkcoloractions.cpp @@ -33,7 +33,7 @@ #include <tqapplication.h> TKColorPopupMenu::TKColorPopupMenu( TQWidget* parent, const char* name ) -: KPopupMenu(parent,name) +: TDEPopupMenu(parent,name) { } @@ -46,10 +46,10 @@ void TKColorPopupMenu::updateItemSize() styleChange(style()); } /****************************************************************************************/ -class TKSelectColorActionPrivate +class TTDESelectColorActionPrivate { public: - TKSelectColorActionPrivate() + TTDESelectColorActionPrivate() { } bool defaultColorMenu; @@ -57,10 +57,10 @@ public: }; -TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, TQObject* parent, const char* name, bool menuDefaultColor ) -: TKAction(parent,name) +TTDESelectColorAction::TTDESelectColorAction( const TQString& text, Type type, TQObject* parent, const char* name, bool menuDefaultColor ) +: TTDEAction(parent,name) { - d=new TKSelectColorActionPrivate(); + d=new TTDESelectColorActionPrivate(); d->defaultColorMenu=menuDefaultColor; d->defaultColor=TQColor(); setText(text); @@ -68,12 +68,12 @@ TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, TQObj init(); } -TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, +TTDESelectColorAction::TTDESelectColorAction( const TQString& text, Type type, TQObject* receiver, const char* slot, TQObject* parent, const char* name, bool menuDefaultColor) -: TKAction(parent,name) +: TTDEAction(parent,name) { - d=new TKSelectColorActionPrivate(); + d=new TTDESelectColorActionPrivate(); d->defaultColorMenu=menuDefaultColor; d->defaultColor=TQColor(); setText(text); @@ -82,7 +82,7 @@ TKSelectColorAction::TKSelectColorAction( const TQString& text, Type type, init(); } -void TKSelectColorAction::init() +void TTDESelectColorAction::init() { m_pStandardColor = new TKColorPanel(); m_pRecentColor = new TKColorPanel(); @@ -129,40 +129,40 @@ void TKSelectColorAction::init() connect(m_pRecentColor,TQT_SIGNAL(sizeChanged()),m_pMenu,TQT_SLOT(updateItemSize())); } -TKSelectColorAction::~TKSelectColorAction() +TTDESelectColorAction::~TTDESelectColorAction() { delete m_pMenu; delete d; } -void TKSelectColorAction::initToolBarButton(TKToolBarButton* b) +void TTDESelectColorAction::initToolBarButton(TTDEToolBarButton* b) { TQWhatsThis::add( b, whatsThis() ); - TKAction::initToolBarButton(b); + TTDEAction::initToolBarButton(b); b->setDelayedPopup( popupMenu() ); updatePixmap(b); updatePixmap(); } -void TKSelectColorAction::defaultColor() +void TTDESelectColorAction::defaultColor() { m_pCurrentColor = d->defaultColor; emit activated(); } -void TKSelectColorAction::setDefaultColor(const TQColor &_col) +void TTDESelectColorAction::setDefaultColor(const TQColor &_col) { d->defaultColor=_col; } -void TKSelectColorAction::updatePixmap() +void TTDESelectColorAction::updatePixmap() { for( int id = 0; id < containerCount(); ++id ) { TQWidget* w = container(id); - if ( w->inherits("KToolBar") ) { - TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); - if ( r->inherits("TKToolBarButton") ) { - updatePixmap(static_cast<TKToolBarButton*>(r)); + if ( w->inherits("TDEToolBar") ) { + TQWidget* r = static_cast<TDEToolBar*>(w)->getWidget(itemId(id)); + if ( r->inherits("TTDEToolBarButton") ) { + updatePixmap(static_cast<TTDEToolBarButton*>(r)); } } else if(w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) ) { @@ -191,7 +191,7 @@ void TKSelectColorAction::updatePixmap() } } -void TKSelectColorAction::updatePixmap(TKToolBarButton* b) +void TTDESelectColorAction::updatePixmap(TTDEToolBarButton* b) { if (!b) return; @@ -219,7 +219,7 @@ void TKSelectColorAction::updatePixmap(TKToolBarButton* b) b->setPixmap(pix); } -void TKSelectColorAction::setCurrentColor( const TQColor& color ) +void TTDESelectColorAction::setCurrentColor( const TQColor& color ) { if ( color == m_pCurrentColor ) return; @@ -229,12 +229,12 @@ void TKSelectColorAction::setCurrentColor( const TQColor& color ) updatePixmap(); } -void TKSelectColorAction::setActiveColor( const TQColor& color ) +void TTDESelectColorAction::setActiveColor( const TQColor& color ) { m_pStandardColor->setActiveColor(color); } -void TKSelectColorAction::selectColorDialog() +void TTDESelectColorAction::selectColorDialog() { TQColor c = color(); @@ -260,19 +260,19 @@ void TKSelectColorAction::selectColorDialog() } // Called when activating the menu item -void TKSelectColorAction::slotActivated() +void TTDESelectColorAction::slotActivated() { - //kdDebug() << "TKSelectColorAction::slotActivated" << endl; + //kdDebug() << "TTDESelectColorAction::slotActivated" << endl; selectColorDialog(); } -void TKSelectColorAction::activate() +void TTDESelectColorAction::activate() { emit colorSelected(m_pCurrentColor); emit activated(); } -void TKSelectColorAction::panelColorSelected( const TQColor& color ) +void TTDESelectColorAction::panelColorSelected( const TQColor& color ) { m_pMenu->hide(); setCurrentColor(color); @@ -280,7 +280,7 @@ void TKSelectColorAction::panelColorSelected( const TQColor& color ) activate(); } -void TKSelectColorAction::panelReject() +void TTDESelectColorAction::panelReject() { m_pMenu->hide(); } diff --git a/lib/kofficeui/tkcoloractions.h b/lib/kofficeui/tkcoloractions.h index 5ef5d3f4..2b5dcd82 100644 --- a/lib/kofficeui/tkcoloractions.h +++ b/lib/kofficeui/tkcoloractions.h @@ -28,9 +28,9 @@ class TQGridLayout; class TKColorPanel; -class TKSelectColorActionPrivate; +class TTDESelectColorActionPrivate; -class TKColorPopupMenu : public KPopupMenu +class TKColorPopupMenu : public TDEPopupMenu { Q_OBJECT public: @@ -41,7 +41,7 @@ public slots: void updateItemSize(); }; /****************************************************************************************/ -class KOFFICEUI_EXPORT TKSelectColorAction : public TKAction +class KOFFICEUI_EXPORT TTDESelectColorAction : public TTDEAction { Q_OBJECT public: @@ -52,16 +52,16 @@ public: Color }; - TKSelectColorAction( const TQString& text, Type type, TQObject* parent, const char* name, bool menuDefaultColor=false); - TKSelectColorAction( const TQString& text, Type type, + TTDESelectColorAction( const TQString& text, Type type, TQObject* parent, const char* name, bool menuDefaultColor=false); + TTDESelectColorAction( const TQString& text, Type type, TQObject* receiver, const char* slot, TQObject* parent, const char* name,bool menuDefaultColor=false ); - virtual ~TKSelectColorAction(); + virtual ~TTDESelectColorAction(); TQColor color() const { return m_pCurrentColor; } - KPopupMenu* popupMenu() const { return m_pMenu; } + TDEPopupMenu* popupMenu() const { return m_pMenu; } void setDefaultColor(const TQColor &_col); @@ -82,9 +82,9 @@ protected slots: protected: void init(); - virtual void initToolBarButton(TKToolBarButton*); + virtual void initToolBarButton(TTDEToolBarButton*); void updatePixmap(); - void updatePixmap(TKToolBarButton*); + void updatePixmap(TTDEToolBarButton*); protected: TKColorPopupMenu* m_pMenu; @@ -95,7 +95,7 @@ protected: TQColor m_pCurrentColor; private: - TKSelectColorActionPrivate *d; + TTDESelectColorActionPrivate *d; }; /****************************************************************************************/ class TKColorPanelButton : public TQFrame diff --git a/lib/kofficeui/tktoolbarbutton.cpp b/lib/kofficeui/tktoolbarbutton.cpp index 92c42c10..c4c8e27b 100644 --- a/lib/kofficeui/tktoolbarbutton.cpp +++ b/lib/kofficeui/tktoolbarbutton.cpp @@ -36,10 +36,10 @@ // Delay in ms before delayed popup pops up #define POPUP_DELAY 500 -class TKToolBarButton::TKToolBarButtonPrivate +class TTDEToolBarButton::TTDEToolBarButtonPrivate { public: - TKToolBarButtonPrivate() + TTDEToolBarButtonPrivate() { m_iconMode = TK::IconOnly; m_isPopup = false; @@ -61,7 +61,7 @@ public: m_instance = TDEGlobal::instance(); } - ~TKToolBarButtonPrivate() + ~TTDEToolBarButtonPrivate() { delete m_delayTimer; m_delayTimer = 0; @@ -88,12 +88,12 @@ public: TDEInstance *m_instance; }; -TKToolBarButton::TKToolBarButton( const TQString& icon, const TQString& txt, +TTDEToolBarButton::TTDEToolBarButton( const TQString& icon, const TQString& txt, TQWidget* parent, const char* name, TDEInstance *instance ) : TQToolButton(parent,name) { - d = new TKToolBarButtonPrivate; + d = new TTDEToolBarButtonPrivate; d->m_text = txt; d->m_instance = instance; @@ -109,10 +109,10 @@ TKToolBarButton::TKToolBarButton( const TQString& icon, const TQString& txt, modeChange(); } -TKToolBarButton::TKToolBarButton( const TQPixmap& pixmap, const TQString& txt, TQWidget* parent, const char* name ) +TTDEToolBarButton::TTDEToolBarButton( const TQPixmap& pixmap, const TQString& txt, TQWidget* parent, const char* name ) : TQToolButton(parent,name ) { - d = new TKToolBarButtonPrivate; + d = new TTDEToolBarButtonPrivate; d->m_text = txt; setFocusPolicy( TQ_NoFocus ); @@ -127,17 +127,17 @@ TKToolBarButton::TKToolBarButton( const TQPixmap& pixmap, const TQString& txt, T modeChange(); } -TKToolBarButton::~TKToolBarButton() +TTDEToolBarButton::~TTDEToolBarButton() { delete d; } -TQString TKToolBarButton::text() +TQString TTDEToolBarButton::text() { return d->m_text; } -void TKToolBarButton::modeChange() +void TTDEToolBarButton::modeChange() { TQToolTip::add(this,d->m_text); @@ -170,7 +170,7 @@ void TKToolBarButton::modeChange() updateGeometry(); } -void TKToolBarButton::setEnabled( bool enabled ) +void TTDEToolBarButton::setEnabled( bool enabled ) { if (isEnabled()==enabled) return; @@ -179,13 +179,13 @@ void TKToolBarButton::setEnabled( bool enabled ) TQToolButton::setEnabled( enabled ); } -void TKToolBarButton::setText( const TQString& text) +void TTDEToolBarButton::setText( const TQString& text) { d->m_text = text; repaint(false); } -void TKToolBarButton::setIcon( const TQString& icon ) +void TTDEToolBarButton::setIcon( const TQString& icon ) { d->m_iconName = icon; int iconSize = 16; @@ -195,31 +195,31 @@ void TKToolBarButton::setIcon( const TQString& icon ) setDefaultPixmap( BarIcon(icon, iconSize, KIcon::DefaultState, d->m_instance) ); } -void TKToolBarButton::setDisabledIcon( const TQString &icon ) +void TTDEToolBarButton::setDisabledIcon( const TQString &icon ) { d->m_disabledIconName = icon; int iconSize = 16; setDisabledPixmap( BarIcon(icon, iconSize, KIcon::DisabledState, d->m_instance) ); } -void TKToolBarButton::setDefaultIcon( const TQString &icon ) +void TTDEToolBarButton::setDefaultIcon( const TQString &icon ) { d->m_defaultIconName = icon; int iconSize = 16; setDefaultPixmap( BarIcon(icon, iconSize, KIcon::DefaultState, d->m_instance) ); } -TQPixmap TKToolBarButton::getActivePixmap() const +TQPixmap TTDEToolBarButton::getActivePixmap() const { return activePixmap; } -void TKToolBarButton::setPixmap( const TQPixmap &pixmap ) +void TTDEToolBarButton::setPixmap( const TQPixmap &pixmap ) { setPixmap( pixmap, true ); } -void TKToolBarButton::setPixmap( const TQPixmap &pixmap, bool generate ) +void TTDEToolBarButton::setPixmap( const TQPixmap &pixmap, bool generate ) { activePixmap = pixmap; @@ -239,19 +239,19 @@ void TKToolBarButton::setPixmap( const TQPixmap &pixmap, bool generate ) TQToolButton::setPixmap( isEnabled() ? defaultPixmap : disabledPixmap ); } -void TKToolBarButton::setDefaultPixmap( const TQPixmap &pixmap ) +void TTDEToolBarButton::setDefaultPixmap( const TQPixmap &pixmap ) { defaultPixmap = pixmap; TQToolButton::setPixmap( isEnabled() ? defaultPixmap : disabledPixmap ); } -void TKToolBarButton::setDisabledPixmap( const TQPixmap &pixmap ) +void TTDEToolBarButton::setDisabledPixmap( const TQPixmap &pixmap ) { disabledPixmap = pixmap; TQToolButton::setPixmap( isEnabled() ? defaultPixmap : disabledPixmap ); } -void TKToolBarButton::setPopup(TQPopupMenu *p) +void TTDEToolBarButton::setPopup(TQPopupMenu *p) { d->m_popup = p; d->m_popup->setFont(TDEGlobalSettings::toolBarFont()); @@ -260,12 +260,12 @@ void TKToolBarButton::setPopup(TQPopupMenu *p) modeChange(); } -TQPopupMenu *TKToolBarButton::popup() +TQPopupMenu *TTDEToolBarButton::popup() { return d->m_popup; } -void TKToolBarButton::setDelayedPopup (TQPopupMenu *p, bool toggle ) +void TTDEToolBarButton::setDelayedPopup (TQPopupMenu *p, bool toggle ) { d->m_isPopup = true; setToggle(toggle); @@ -278,18 +278,18 @@ void TKToolBarButton::setDelayedPopup (TQPopupMenu *p, bool toggle ) setPopup(p); } -void TKToolBarButton::setRaised(bool f) +void TTDEToolBarButton::setRaised(bool f) { d->m_isRaised = f; repaint(false); } -void TKToolBarButton::setAutoRaised(bool f) +void TTDEToolBarButton::setAutoRaised(bool f) { d->m_autoRaised = f; } -void TKToolBarButton::leaveEvent(TQEvent *) +void TTDEToolBarButton::leaveEvent(TQEvent *) { if (!d->m_isToggle && !(d->m_popup && d->m_popup->isVisible()) ) { TQToolButton::setPixmap(isEnabled() ? defaultPixmap : disabledPixmap); @@ -298,7 +298,7 @@ void TKToolBarButton::leaveEvent(TQEvent *) } } -void TKToolBarButton::enterEvent(TQEvent *) +void TTDEToolBarButton::enterEvent(TQEvent *) { if (!d->m_isToggle) { if (isEnabled()) { @@ -312,7 +312,7 @@ void TKToolBarButton::enterEvent(TQEvent *) } } -bool TKToolBarButton::eventFilter(TQObject *o, TQEvent *ev) +bool TTDEToolBarButton::eventFilter(TQObject *o, TQEvent *ev) { if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) ) if (ev->type() == TQEvent::MouseButtonPress && d->m_popup && d->m_isPopup ) { @@ -348,7 +348,7 @@ bool TKToolBarButton::eventFilter(TQObject *o, TQEvent *ev) return false; } -void TKToolBarButton::drawButton( TQPainter* p ) +void TTDEToolBarButton::drawButton( TQPainter* p ) { #define DRAW_PIXMAP_AND_TEXT \ int x = 3;\ @@ -402,7 +402,7 @@ void TKToolBarButton::drawButton( TQPainter* p ) } } -void TKToolBarButton::paletteChange(const TQPalette &) +void TTDEToolBarButton::paletteChange(const TQPalette &) { makeDisabledPixmap(); if ( !isEnabled() ) @@ -412,7 +412,7 @@ void TKToolBarButton::paletteChange(const TQPalette &) repaint(false); } -void TKToolBarButton::makeDefaultPixmap() +void TTDEToolBarButton::makeDefaultPixmap() { if (activePixmap.isNull()) return; @@ -421,7 +421,7 @@ void TKToolBarButton::makeDefaultPixmap() defaultPixmap = effect.apply(activePixmap, KIcon::Toolbar, KIcon::DefaultState); } -void TKToolBarButton::makeDisabledPixmap() +void TTDEToolBarButton::makeDisabledPixmap() { if (activePixmap.isNull()) return; @@ -430,17 +430,17 @@ void TKToolBarButton::makeDisabledPixmap() disabledPixmap = effect.apply(activePixmap, KIcon::Toolbar, KIcon::DisabledState); } -TQSize TKToolBarButton::sizeHint() const +TQSize TTDEToolBarButton::sizeHint() const { return minimumSize(); } -TQSize TKToolBarButton::minimumSizeHint() const +TQSize TTDEToolBarButton::minimumSizeHint() const { return minimumSize(); } -void TKToolBarButton::showMenu() +void TTDEToolBarButton::showMenu() { TQPoint p ( mapToGlobal( TQPoint( 0, 0 ) ) ); const int deskHeight = TDEGlobalSettings::desktopGeometry(this).height(); @@ -452,13 +452,13 @@ void TKToolBarButton::showMenu() d->m_popup->popup(p); } -void TKToolBarButton::slotDelayTimeout() +void TTDEToolBarButton::slotDelayTimeout() { d->m_delayTimer->stop(); showMenu(); } -void TKToolBarButton::slotClicked() +void TTDEToolBarButton::slotClicked() { if ( d->ignoreNextMousePress ) { d->ignoreNextMousePress=false; @@ -471,7 +471,7 @@ void TKToolBarButton::slotClicked() emit buttonClicked(); } -void TKToolBarButton::slotPressed() +void TTDEToolBarButton::slotPressed() { if ( d->ignoreNextMousePress ) return; @@ -486,7 +486,7 @@ void TKToolBarButton::slotPressed() d->ignoreNextMousePress = false; } -void TKToolBarButton::slotReleased() +void TTDEToolBarButton::slotReleased() { if (d->m_popup && d->m_isPopup) d->m_delayTimer->stop(); @@ -494,23 +494,23 @@ void TKToolBarButton::slotReleased() emit buttonReleased(); } -void TKToolBarButton::slotToggled() +void TTDEToolBarButton::slotToggled() { emit buttonToggled(); } -void TKToolBarButton::on(bool flag) +void TTDEToolBarButton::on(bool flag) { d->m_isOn = flag; repaint(); } -void TKToolBarButton::toggle() +void TTDEToolBarButton::toggle() { on(!d->m_isOn); } -void TKToolBarButton::setToggle(bool flag) +void TTDEToolBarButton::setToggle(bool flag) { d->m_isToggle = flag; if (flag == true) @@ -522,7 +522,7 @@ void TKToolBarButton::setToggle(bool flag) repaint(); } -void TKToolBarButton::setIconMode( TK::IconMode m ) +void TTDEToolBarButton::setIconMode( TK::IconMode m ) { d->m_iconMode = m; modeChange(); diff --git a/lib/kofficeui/tktoolbarbutton.h b/lib/kofficeui/tktoolbarbutton.h index 0e74b7e3..14d3b285 100644 --- a/lib/kofficeui/tktoolbarbutton.h +++ b/lib/kofficeui/tktoolbarbutton.h @@ -26,21 +26,21 @@ #include <tqtoolbutton.h> #include <kglobal.h> -class KToolBar; +class TDEToolBar; class TDEInstance; class TQPopupMenu; class TQPainter; -class TKToolBarButton : public TQToolButton +class TTDEToolBarButton : public TQToolButton { Q_OBJECT public: - TKToolBarButton(const TQString& icon, const TQString& txt, + TTDEToolBarButton(const TQString& icon, const TQString& txt, TQWidget* parent = 0, const char *name=0L, TDEInstance *_instance = TDEGlobal::instance()); - TKToolBarButton(const TQPixmap&, const TQString&, TQWidget* parent=0, const char* name=0); - ~TKToolBarButton(); + TTDEToolBarButton(const TQPixmap&, const TQString&, TQWidget* parent=0, const char* name=0); + ~TTDEToolBarButton(); void setIconMode(TK::IconMode); void setRaised(bool); @@ -213,8 +213,8 @@ private: TQPixmap activePixmap; TQPixmap disabledPixmap; virtual void setIcon(const TQPixmap &p) { TQButton::setIcon(p); } - class TKToolBarButtonPrivate; - TKToolBarButtonPrivate *d; + class TTDEToolBarButtonPrivate; + TTDEToolBarButtonPrivate *d; protected slots: |