diff options
Diffstat (limited to 'kate/tabbarextension')
-rw-r--r-- | kate/tabbarextension/plugin_katetabbarextension.cpp | 116 | ||||
-rw-r--r-- | kate/tabbarextension/plugin_katetabbarextension.h | 46 |
2 files changed, 81 insertions, 81 deletions
diff --git a/kate/tabbarextension/plugin_katetabbarextension.cpp b/kate/tabbarextension/plugin_katetabbarextension.cpp index 7004ff8..cfc4619 100644 --- a/kate/tabbarextension/plugin_katetabbarextension.cpp +++ b/kate/tabbarextension/plugin_katetabbarextension.cpp @@ -37,11 +37,11 @@ #include <kiconloader.h> #include <kfiledialog.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qtooltip.h> -#include <qgroupbox.h> -#include <qcheckbox.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqtooltip.h> +#include <tqgroupbox.h> +#include <tqcheckbox.h> // END class PluginView : public KXMLGUIClient @@ -72,8 +72,8 @@ KatePluginFactory::~KatePluginFactory() delete s_instance; } -QObject* KatePluginFactory::createObject( - QObject* parent, const char* name, const char*, const QStringList & ) +TQObject* KatePluginFactory::createObject( + TQObject* parent, const char* name, const char*, const TQStringList & ) { return new KatePluginTabBarExtension( parent, name ); } @@ -82,7 +82,7 @@ KInstance* KatePluginFactory::s_instance = 0L; // BEGIN KatePluginTabBarExtension KatePluginTabBarExtension::KatePluginTabBarExtension( - QObject* parent, const char* name ) + TQObject* parent, const char* name ) : Kate::Plugin ( (Kate::Application*)parent, name ), pConfig(new KConfig("katetabbarextensionpluginrc")) { @@ -122,8 +122,8 @@ void KatePluginTabBarExtension::addView(Kate::MainWindow *win) KToolBar* toolbar = dynamic_cast<KToolBar*> (win->guiFactory()->container("tabbarExtensionToolBar", view)); if (toolbar) { - connect(toolbar, SIGNAL( orientationChanged(Orientation) ), - view->tabbar, SLOT( slotMoved(Orientation) )); + connect(toolbar, TQT_SIGNAL( orientationChanged(Orientation) ), + view->tabbar, TQT_SLOT( slotMoved(Orientation) )); } } @@ -152,12 +152,12 @@ void KatePluginTabBarExtension::removeView(Kate::MainWindow *win) } Kate::PluginConfigPage* KatePluginTabBarExtension::configPage( - uint, QWidget *w, const char* /*name*/) + uint, TQWidget *w, const char* /*name*/) { KateTabBarExtensionConfigPage* p = new KateTabBarExtensionConfigPage(this, w); initConfigPage( p ); - connect( p, SIGNAL(configPageApplyRequest(KateTabBarExtensionConfigPage*)), - SLOT(applyConfig(KateTabBarExtensionConfigPage*)) ); + connect( p, TQT_SIGNAL(configPageApplyRequest(KateTabBarExtensionConfigPage*)), + TQT_SLOT(applyConfig(KateTabBarExtensionConfigPage*)) ); return (Kate::PluginConfigPage*)p; } @@ -175,8 +175,8 @@ void KatePluginTabBarExtension::applyConfig( KateTabBarExtensionConfigPage* p ) // BEGIN KateTabBarButton KateTabBarButton::KateTabBarButton(Kate::ViewManager* pViewManager, - Kate::Document *pDoc, QWidget * parent, const char * name) - : QPushButton(parent, name), + Kate::Document *pDoc, TQWidget * parent, const char * name) + : TQPushButton(parent, name), modified(false), myDocID(pDoc->documentNumber()), doc(pDoc), @@ -184,11 +184,11 @@ KateTabBarButton::KateTabBarButton(Kate::ViewManager* pViewManager, { setFlat(true); setToggleButton(true); - setFocusPolicy(QWidget::NoFocus); + setFocusPolicy(TQWidget::NoFocus); setText(pDoc->docName()); - connect(this, SIGNAL(toggled(bool)), SLOT(setOn(bool))); + connect(this, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setOn(bool))); } KateTabBarButton::~KateTabBarButton() {} @@ -204,29 +204,29 @@ void KateTabBarButton::setDirty(bool d) setIconSet(SmallIconSet("cancel")); } else { if (modified) setIconSet(SmallIconSet("modified")); - else setIconSet(QIconSet()); + else setIconSet(TQIconSet()); } } -void KateTabBarButton::setText( const QString& newText) +void KateTabBarButton::setText( const TQString& newText) { - QToolTip::remove(this); + TQToolTip::remove(this); if (newText.length() > 20) { // squeeze to length 17+3=20 - QPushButton::setText(newText.left(9) + "..." + newText.right(8)); - QToolTip::add(this, newText); + TQPushButton::setText(newText.left(9) + "..." + newText.right(8)); + TQToolTip::add(this, newText); } else { - QPushButton::setText(newText); + TQPushButton::setText(newText); } } -QString KateTabBarButton::fullName() const +TQString KateTabBarButton::fullName() const { if (doc) { return doc->docName(); } else { - return QString(""); + return TQString(""); } } @@ -234,45 +234,45 @@ void KateTabBarButton::triggerModified() { modified = !modified; if (modified) { - QColor c(255, 0, 0); + TQColor c(255, 0, 0); setPaletteForegroundColor( c ); setIconSet(SmallIconSet("modified")); } else { - QColor c(KGlobalSettings::textColor()); + TQColor c(KGlobalSettings::textColor()); setPaletteForegroundColor( c ); - setIconSet(QIconSet()); + setIconSet(TQIconSet()); } } void KateTabBarButton::setOn(bool on) { - disconnect( SIGNAL(toggled(bool))); + disconnect( TQT_SIGNAL(toggled(bool))); // kdDebug() << "setOn: " << (int)on << endl; if ((!on) && viewManager->activeView()->document()->documentNumber() == documentNumber()) { // kdDebug() << "setOn aborted " << endl; - QPushButton::setOn(true); + TQPushButton::setOn(true); } else { - QPushButton::setOn(on); + TQPushButton::setOn(on); if (on) emit myToggled(this); } - connect(this, SIGNAL(toggled(bool)), SLOT(setOn(bool))); + connect(this, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setOn(bool))); } // END KateTabBarButton // BEGIN KateTabBarExtension KateTabBarExtension::KateTabBarExtension( Kate::DocumentManager *pDocManager, Kate::MainWindow *win, bool bHorizOrientation, bool bSort, - QWidget* parent, const char* name, WFlags f ) - : QWidget(parent, name, f), + TQWidget* parent, const char* name, WFlags f ) + : TQWidget(parent, name, f), pCurrentTab(0), m_win(win), m_docManager(pDocManager), m_sort(false) { if (bHorizOrientation) { - top = new QBoxLayout(this, QBoxLayout::LeftToRight); + top = new TQBoxLayout(this, TQBoxLayout::LeftToRight); m_orientation = Qt::Horizontal; } else { - top = new QBoxLayout(this, QBoxLayout::TopToBottom); + top = new TQBoxLayout(this, TQBoxLayout::TopToBottom); m_orientation = Qt::Vertical; } @@ -282,13 +282,13 @@ KateTabBarExtension::KateTabBarExtension( Kate::DocumentManager *pDocManager, slotDocumentCreated (pDocManager->document(i)); } - connect(m_win->viewManager(), SIGNAL(viewChanged()), SLOT(slotViewChanged())); + connect(m_win->viewManager(), TQT_SIGNAL(viewChanged()), TQT_SLOT(slotViewChanged())); connect(pDocManager, - SIGNAL(documentCreated(Kate::Document *)), - SLOT(slotDocumentCreated(Kate::Document *))); + TQT_SIGNAL(documentCreated(Kate::Document *)), + TQT_SLOT(slotDocumentCreated(Kate::Document *))); connect(pDocManager, - SIGNAL(documentDeleted(uint)), - SLOT(slotDocumentDeleted(uint))); + TQT_SIGNAL(documentDeleted(uint)), + TQT_SLOT(slotDocumentDeleted(uint))); setSortByName(bSort); } @@ -300,11 +300,11 @@ void KateTabBarExtension::slotMoved(Orientation o) // the tabbar moved (top, right, bottom, left or fluently) switch (o) { case Qt::Vertical: - top->setDirection(QBoxLayout::TopToBottom); + top->setDirection(TQBoxLayout::TopToBottom); break; case Qt::Horizontal: - top->setDirection(QBoxLayout::LeftToRight); + top->setDirection(TQBoxLayout::LeftToRight); break; } @@ -357,15 +357,15 @@ void KateTabBarExtension::slotDocumentCreated (Kate::Document *doc) if (!doc) return; KateTabBarButton* tab = new KateTabBarButton(m_win->viewManager(), doc, this); - connect(tab, SIGNAL(myToggled(KateTabBarButton*)), - SLOT(slotActivateView(KateTabBarButton*))); - connect(doc, SIGNAL(nameChanged(Kate::Document *)), - SLOT(slotNameChanged(Kate::Document *))); - connect(doc, SIGNAL(modStateChanged(Kate::Document *)), - SLOT(slotModChanged(Kate::Document *))); + connect(tab, TQT_SIGNAL(myToggled(KateTabBarButton*)), + TQT_SLOT(slotActivateView(KateTabBarButton*))); + connect(doc, TQT_SIGNAL(nameChanged(Kate::Document *)), + TQT_SLOT(slotNameChanged(Kate::Document *))); + connect(doc, TQT_SIGNAL(modStateChanged(Kate::Document *)), + TQT_SLOT(slotModChanged(Kate::Document *))); connect(doc, - SIGNAL(modifiedOnDisc(Kate::Document *, bool, unsigned char)), - SLOT(slotModifiedOnDisc(Kate::Document *, bool, unsigned char))); + TQT_SIGNAL(modifiedOnDisc(Kate::Document *, bool, unsigned char)), + TQT_SLOT(slotModifiedOnDisc(Kate::Document *, bool, unsigned char))); if(doc->isModified()) tab->triggerModified(); tab->show(); top->addWidget(tab); @@ -475,22 +475,22 @@ void KateTabBarExtension::slotViewChanged () // BEGIN KateTabBarExtensionConfigPage KateTabBarExtensionConfigPage::KateTabBarExtensionConfigPage( - QObject* /*parent*/ /*= 0L*/, QWidget *parentWidget /*= 0L*/) + TQObject* /*parent*/ /*= 0L*/, TQWidget *parentWidget /*= 0L*/) : Kate::PluginConfigPage( parentWidget ) { - QVBoxLayout* top = new QVBoxLayout(this, 0, + TQVBoxLayout* top = new TQVBoxLayout(this, 0, KDialogBase::spacingHint()); - QGroupBox* gb = new QGroupBox( i18n("Sorting Behavior"), + TQGroupBox* gb = new TQGroupBox( i18n("Sorting Behavior"), this, "tab_bar_extension_config_page_layout" ); gb->setColumnLayout(1, Qt::Vertical); gb->setInsideSpacing(KDialogBase::spacingHint()); - pSortAlpha = new QCheckBox(i18n("Sort files alphabetically"), gb); + pSortAlpha = new TQCheckBox(i18n("Sort files alphabetically"), gb); top->add(gb); top->addStretch(1); // throw signal changed - connect(pSortAlpha, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(pSortAlpha, TQT_SIGNAL(toggled(bool)), this, TQT_SIGNAL(changed())); } KateTabBarExtensionConfigPage::~KateTabBarExtensionConfigPage() {} @@ -503,8 +503,8 @@ void KateTabBarExtensionConfigPage::apply() // BEGIN MyPtrList implementaion -int MyPtrList::compareItems ( QPtrCollection::Item item1_, - QPtrCollection::Item item2_ ) +int MyPtrList::compareItems ( TQPtrCollection::Item item1_, + TQPtrCollection::Item item2_ ) { KateTabBarButton* item1 = reinterpret_cast<KateTabBarButton*>(item1_); KateTabBarButton* item2 = reinterpret_cast<KateTabBarButton*>(item2_); diff --git a/kate/tabbarextension/plugin_katetabbarextension.h b/kate/tabbarextension/plugin_katetabbarextension.h index 6b53444..db2df7a 100644 --- a/kate/tabbarextension/plugin_katetabbarextension.h +++ b/kate/tabbarextension/plugin_katetabbarextension.h @@ -39,23 +39,23 @@ #include <klocale.h> #include <ktoolbar.h> -#include <qwidget.h> -#include <qpushbutton.h> -#include <qptrlist.h> +#include <tqwidget.h> +#include <tqpushbutton.h> +#include <tqptrlist.h> class QBoxLayout; class QCheckBox; class KateTabBarButton; /** - * Same as QPtrList. Only difference is: overwrite comapreItems() for sorting reason. + * Same as TQPtrList. Only difference is: overwrite comapreItems() for sorting reason. */ -class MyPtrList : public QPtrList <KateTabBarButton> +class MyPtrList : public TQPtrList <KateTabBarButton> { public: - MyPtrList() { QPtrList<KateTabBarButton>::QPtrList(); } + MyPtrList() { TQPtrList<KateTabBarButton>::TQPtrList(); } - virtual int compareItems ( QPtrCollection::Item item1_, QPtrCollection::Item item2_ ); + virtual int compareItems ( TQPtrCollection::Item item1_, TQPtrCollection::Item item2_ ); }; class KatePluginFactory : public KLibFactory @@ -66,8 +66,8 @@ class KatePluginFactory : public KLibFactory KatePluginFactory(); virtual ~KatePluginFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, - const char* name = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* parent = 0, const char* pname = 0, + const char* name = "TQObject", const TQStringList &args = TQStringList() ); private: static KInstance* s_instance; @@ -90,7 +90,7 @@ class KateTabBarButton: public QPushButton * @param name name of the tab button */ KateTabBarButton(Kate::ViewManager* pViewManager, Kate::Document *pDoc, - QWidget* parent = 0, const char * name = 0); + TQWidget* parent = 0, const char * name = 0); /** * standard destructor (emtpy) @@ -106,7 +106,7 @@ class KateTabBarButton: public QPushButton * get the document's full name (eg. main.cpp), used for comparison * @return the document's name */ - QString fullName() const; + TQString fullName() const; /** * negate the modified flag and change the button color @@ -124,7 +124,7 @@ class KateTabBarButton: public QPushButton * set text for this tab * @param newText new text */ - virtual void setText( const QString& newText); + virtual void setText( const TQString& newText); signals: /** @@ -167,7 +167,7 @@ class KateTabBarExtension : public QWidget */ KateTabBarExtension( Kate::DocumentManager *pDocManager, Kate::MainWindow *win, bool bHorizOrientation, bool bSort, - QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); /** standard destructor */ ~KateTabBarExtension(); @@ -245,10 +245,10 @@ class KateTabBarExtension : public QWidget private: KateTabBarButton* pCurrentTab; ///< pointer to the current tab - QBoxLayout* top; ///< layout that contains all tabs + TQBoxLayout* top; ///< layout that contains all tabs Kate::MainWindow* m_win; ///< pointer to the main window Kate::DocumentManager* m_docManager; ///< pointer to the document manager -// QPtrList <KateTabBarButton> m_tabs; ///< list containing all tabs +// TQPtrList <KateTabBarButton> m_tabs; ///< list containing all tabs MyPtrList m_tabs; ///< list containing all tabs Qt::Orientation m_orientation; ///< save tabbar's orientation bool m_sort; ///< how to sort @@ -264,7 +264,7 @@ class KateTabBarExtensionConfigPage : public Kate::PluginConfigPage friend class KatePluginTabBarExtension; public: - KateTabBarExtensionConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L); + KateTabBarExtensionConfigPage (TQObject* parent = 0L, TQWidget *parentWidget = 0L); ~KateTabBarExtensionConfigPage (); /** @@ -288,7 +288,7 @@ class KateTabBarExtensionConfigPage : public Kate::PluginConfigPage void configPageInitRequest( KateTabBarExtensionConfigPage* ); private: - QCheckBox* pSortAlpha; + TQCheckBox* pSortAlpha; }; class KatePluginTabBarExtension : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension @@ -296,17 +296,17 @@ class KatePluginTabBarExtension : public Kate::Plugin, Kate::PluginViewInterface Q_OBJECT public: - KatePluginTabBarExtension( QObject* parent = 0, const char* name = 0 ); + KatePluginTabBarExtension( TQObject* parent = 0, const char* name = 0 ); virtual ~KatePluginTabBarExtension(); void addView (Kate::MainWindow *win); void removeView (Kate::MainWindow *win); uint configPages () const { return 1; } - Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); - QString configPageName(uint) const { return i18n("Tab Bar Extension"); } - QString configPageFullName(uint) const { return i18n("Configure Tab Bar Extension"); } - QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; } + Kate::PluginConfigPage *configPage (uint , TQWidget *w, const char *name=0); + TQString configPageName(uint) const { return i18n("Tab Bar Extension"); } + TQString configPageFullName(uint) const { return i18n("Configure Tab Bar Extension"); } + TQPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; } public slots: void applyConfig( KateTabBarExtensionConfigPage* ); @@ -315,7 +315,7 @@ class KatePluginTabBarExtension : public Kate::Plugin, Kate::PluginViewInterface void initConfigPage( KateTabBarExtensionConfigPage* ); private: - QPtrList<class PluginView> m_views; + TQPtrList<class PluginView> m_views; KConfig* pConfig; }; |