summaryrefslogtreecommitdiffstats
path: root/src/katemdi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/katemdi.cpp')
-rw-r--r--src/katemdi.cpp144
1 files changed, 72 insertions, 72 deletions
diff --git a/src/katemdi.cpp b/src/katemdi.cpp
index 0f34de1..e518136 100644
--- a/src/katemdi.cpp
+++ b/src/katemdi.cpp
@@ -35,8 +35,8 @@ namespace KateMDI {
//BEGIN SPLITTER
-Splitter::Splitter(Orientation o, QWidget* parent, const char* name)
- : QSplitter(o, parent, name)
+Splitter::Splitter(Qt::Orientation o, TQWidget* tqparent, const char* name)
+ : TQSplitter(o, tqparent, name)
{
}
@@ -44,14 +44,14 @@ Splitter::~Splitter()
{
}
-bool Splitter::isLastChild(QWidget* w) const
+bool Splitter::isLastChild(TQWidget* w) const
{
return ( idAfter( w ) == 0 );
}
-int Splitter::idAfter ( QWidget * w ) const
+int Splitter::idAfter ( TQWidget * w ) const
{
- return QSplitter::idAfter (w);
+ return TQSplitter::idAfter (w);
}
//END SPLITTER
@@ -59,13 +59,13 @@ int Splitter::idAfter ( QWidget * w ) const
//BEGIN TOGGLETOOLVIEWACTION
-ToggleToolViewAction::ToggleToolViewAction ( const QString& text, const KShortcut& cut, ToolView *tv,
- QObject* parent, const char* name )
- : KToggleAction(text,cut,parent,name)
+ToggleToolViewAction::ToggleToolViewAction ( const TQString& text, const KShortcut& cut, ToolView *tv,
+ TQObject* tqparent, const char* name )
+ : KToggleAction(text,cut,tqparent,name)
, m_tv(tv)
{
- connect(this,SIGNAL(toggled(bool)),this,SLOT(slotToggled(bool)));
- connect(m_tv,SIGNAL(visibleChanged(bool)),this,SLOT(visibleChanged(bool)));
+ connect(this,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotToggled(bool)));
+ connect(m_tv,TQT_SIGNAL(visibleChanged(bool)),this,TQT_SLOT(visibleChanged(bool)));
setChecked(m_tv->visible());
}
@@ -101,12 +101,12 @@ void ToggleToolViewAction::slotToggled(bool t)
//BEGIN GUICLIENT
GUIClient::GUIClient ( MainWindow *mw )
- : QObject ( mw )
+ : TQObject ( mw )
, KXMLGUIClient ( mw )
, m_mw (mw)
{
- connect( m_mw->guiFactory(), SIGNAL( clientAdded( KXMLGUIClient * ) ),
- this, SLOT( clientAdded( KXMLGUIClient * ) ) );
+ connect( m_mw->guiFactory(), TQT_SIGNAL( clientAdded( KXMLGUIClient * ) ),
+ this, TQT_SLOT( clientAdded( KXMLGUIClient * ) ) );
if (actionCollection()->kaccel()==0)
actionCollection()->setWidget(m_mw);
@@ -122,12 +122,12 @@ GUIClient::~GUIClient()
void GUIClient::registerToolView (ToolView *tv)
{
- QString aname = QString("kate_mdi_toolview_") + tv->id;
+ TQString aname = TQString("kate_mdi_toolview_") + tv->id;
// try to read the action shortcut
KShortcut sc;
KConfig *cfg = kapp->config();
- QString _grp = cfg->group();
+ TQString _grp = cfg->group();
cfg->setGroup("Shortcuts");
sc = KShortcut( cfg->readEntry( aname, "" ) );
cfg->setGroup( _grp );
@@ -150,8 +150,8 @@ void GUIClient::updateActions()
//BEGIN TOOLVIEW
-ToolView::ToolView (MainWindow *mainwin, Sidebar *sidebar, QWidget *parent)
- : QVBox (parent)
+ToolView::ToolView (MainWindow *mainwin, Sidebar *sidebar, TQWidget *tqparent)
+ : TQVBox (tqparent)
, m_mainWin (mainwin)
, m_sidebar (sidebar)
, m_visible (false)
@@ -178,13 +178,13 @@ bool ToolView::visible () const
return m_visible;
}
-void ToolView::childEvent ( QChildEvent *ev )
+void ToolView::childEvent ( TQChildEvent *ev )
{
// set the widget to be focus proxy if possible
- if (ev->inserted() && ev->child() && ev->child()->qt_cast("QWidget"))
- setFocusProxy ((QWidget *)(ev->child()->qt_cast("QWidget")));
+ if (ev->inserted() && ev->child() && TQT_TQOBJECT(ev->child())->qt_cast(TQWIDGET_OBJECT_NAME_STRING))
+ setFocusProxy ((TQWidget *)(TQT_TQOBJECT(ev->child())->qt_cast(TQWIDGET_OBJECT_NAME_STRING)));
- QVBox::childEvent (ev);
+ TQVBox::childEvent (ev);
}
//END TOOLVIEW
@@ -192,8 +192,8 @@ void ToolView::childEvent ( QChildEvent *ev )
//BEGIN SIDEBAR
-Sidebar::Sidebar (KMultiTabBar::KMultiTabBarPosition pos, MainWindow *mainwin, QWidget *parent)
- : KMultiTabBar ((pos == KMultiTabBar::Top || pos == KMultiTabBar::Bottom) ? KMultiTabBar::Horizontal : KMultiTabBar::Vertical, parent)
+Sidebar::Sidebar (KMultiTabBar::KMultiTabBarPosition pos, MainWindow *mainwin, TQWidget *tqparent)
+ : KMultiTabBar ((pos == KMultiTabBar::Top || pos == KMultiTabBar::Bottom) ? KMultiTabBar::Horizontal : KMultiTabBar::Vertical, tqparent)
, m_mainWin (mainwin)
, m_splitter (0)
, m_ownSplit (0)
@@ -225,11 +225,11 @@ void Sidebar::setSplitter (Splitter *sp)
m_ownSplit = new Splitter ((sidebarPosition() == KMultiTabBar::Top || sidebarPosition() == KMultiTabBar::Bottom) ? Qt::Horizontal : Qt::Vertical, m_splitter);
m_ownSplit->setOpaqueResize( KGlobalSettings::opaqueResize() );
m_ownSplit->setChildrenCollapsible( false );
- m_splitter->setResizeMode( m_ownSplit, QSplitter::KeepSize );
+ m_splitter->setResizeMode( m_ownSplit, TQSplitter::KeepSize );
m_ownSplit->hide ();
}
-ToolView *Sidebar::addWidget (const QPixmap &icon, const QString &text, ToolView *widget)
+ToolView *Sidebar::addWidget (const TQPixmap &icon, const TQString &text, ToolView *widget)
{
static int id = 0;
@@ -255,7 +255,7 @@ ToolView *Sidebar::addWidget (const QPixmap &icon, const QString &text, ToolView
else
{
widget->hide ();
- widget->reparent (m_ownSplit, 0, QPoint());
+ widget->reparent (m_ownSplit, 0, TQPoint());
widget->m_sidebar = this;
}
@@ -268,7 +268,7 @@ ToolView *Sidebar::addWidget (const QPixmap &icon, const QString &text, ToolView
show ();
- connect(tab(newId),SIGNAL(clicked(int)),this,SLOT(tabClicked(int)));
+ connect(tab(newId),TQT_SIGNAL(clicked(int)),this,TQT_SLOT(tabClicked(int)));
tab(newId)->installEventFilter(this);
return widget;
@@ -276,7 +276,7 @@ ToolView *Sidebar::addWidget (const QPixmap &icon, const QString &text, ToolView
bool Sidebar::removeWidget (ToolView *widget)
{
- if (!m_widgetToId.contains(widget))
+ if (!m_widgetToId.tqcontains(widget))
return false;
removeTab(m_widgetToId[widget]);
@@ -286,7 +286,7 @@ bool Sidebar::removeWidget (ToolView *widget)
m_toolviews.remove (widget);
bool anyVis = false;
- QIntDictIterator<ToolView> it( m_idToWidget );
+ TQIntDictIterator<ToolView> it( m_idToWidget );
for ( ; it.current(); ++it )
{
if (!anyVis)
@@ -306,11 +306,11 @@ bool Sidebar::removeWidget (ToolView *widget)
bool Sidebar::showWidget (ToolView *widget)
{
- if (!m_widgetToId.contains(widget))
+ if (!m_widgetToId.tqcontains(widget))
return false;
// hide other non-persistent views
- QIntDictIterator<ToolView> it( m_idToWidget );
+ TQIntDictIterator<ToolView> it( m_idToWidget );
for ( ; it.current(); ++it )
if ((it.current() != widget) && !it.current()->persistent)
{
@@ -331,14 +331,14 @@ bool Sidebar::showWidget (ToolView *widget)
bool Sidebar::hideWidget (ToolView *widget)
{
- if (!m_widgetToId.contains(widget))
+ if (!m_widgetToId.tqcontains(widget))
return false;
bool anyVis = false;
updateLastSize ();
- for ( QIntDictIterator<ToolView> it( m_idToWidget ); it.current(); ++it )
+ for ( TQIntDictIterator<ToolView> it( m_idToWidget ); it.current(); ++it )
{
if (it.current() == widget)
{
@@ -380,11 +380,11 @@ void Sidebar::tabClicked(int i)
}
}
-bool Sidebar::eventFilter(QObject *obj, QEvent *ev)
+bool Sidebar::eventFilter(TQObject *obj, TQEvent *ev)
{
- if (ev->type()==QEvent::ContextMenu)
+ if (ev->type()==TQEvent::ContextMenu)
{
- QContextMenuEvent *e = (QContextMenuEvent *) ev;
+ TQContextMenuEvent *e = (TQContextMenuEvent *) ev;
KMultiTabBarTab *bt = dynamic_cast<KMultiTabBarTab*>(obj);
if (bt)
{
@@ -416,8 +416,8 @@ bool Sidebar::eventFilter(QObject *obj, QEvent *ev)
if (sidebarPosition() != 3)
p->insertItem(SmallIconSet("down"), i18n("Bottom Sidebar"),3);
- connect(p, SIGNAL(activated(int)),
- this, SLOT(buttonPopupActivate(int)));
+ connect(p, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(buttonPopupActivate(int)));
p->exec(e->globalPos());
delete p;
@@ -452,7 +452,7 @@ void Sidebar::buttonPopupActivate (int id)
void Sidebar::updateLastSize ()
{
- QValueList<int> s = m_splitter->sizes ();
+ TQValueList<int> s = m_splitter->sizes ();
int i = 0;
if ((sidebarPosition() == KMultiTabBar::Right || sidebarPosition() == KMultiTabBar::Bottom))
@@ -478,7 +478,7 @@ void Sidebar::restoreSession (KConfig *config)
{
ToolView *tv = m_toolviews[firstWrong];
- unsigned int pos = config->readUnsignedNumEntry (QString ("Kate-MDI-ToolView-%1-Sidebar-Position").arg(tv->id), firstWrong);
+ unsigned int pos = config->readUnsignedNumEntry (TQString ("Kate-MDI-ToolView-%1-Sidebar-Position").tqarg(tv->id), firstWrong);
if (pos != firstWrong)
break;
@@ -488,12 +488,12 @@ void Sidebar::restoreSession (KConfig *config)
if (firstWrong < m_toolviews.size())
{
// first: collect the items to reshuffle
- QValueList<TmpToolViewSorter> toSort;
+ TQValueList<TmpToolViewSorter> toSort;
for (unsigned int i=firstWrong; i < m_toolviews.size(); ++i)
{
TmpToolViewSorter s;
s.tv = m_toolviews[i];
- s.pos = config->readUnsignedNumEntry (QString ("Kate-MDI-ToolView-%1-Sidebar-Position").arg(m_toolviews[i]->id), i);
+ s.pos = config->readUnsignedNumEntry (TQString ("Kate-MDI-ToolView-%1-Sidebar-Position").tqarg(m_toolviews[i]->id), i);
toSort.push_back (s);
}
@@ -508,7 +508,7 @@ void Sidebar::restoreSession (KConfig *config)
}
// then: remove this items from the button bar
- // do this backwards, to minimize the relayout efforts
+ // do this backwards, to minimize the retqlayout efforts
for (int i=m_toolviews.size()-1; i >= (int)firstWrong; --i)
{
removeTab (m_widgetToId[m_toolviews[i]]);
@@ -524,7 +524,7 @@ void Sidebar::restoreSession (KConfig *config)
// readd the button
int newId = m_widgetToId[tv];
appendTab (tv->icon, newId, tv->text);
- connect(tab(newId),SIGNAL(clicked(int)),this,SLOT(tabClicked(int)));
+ connect(tab(newId),TQT_SIGNAL(clicked(int)),this,TQT_SLOT(tabClicked(int)));
tab(newId)->installEventFilter(this);
// reshuffle in splitter
@@ -536,7 +536,7 @@ void Sidebar::restoreSession (KConfig *config)
updateLastSize ();
// restore the own splitter sizes
- QValueList<int> s = config->readIntListEntry (QString ("Kate-MDI-Sidebar-%1-Splitter").arg(sidebarPosition()));
+ TQValueList<int> s = config->readIntListEntry (TQString ("Kate-MDI-Sidebar-%1-Splitter").tqarg(sidebarPosition()));
m_ownSplit->setSizes (s);
// show only correct toolviews, remember persistent values ;)
@@ -545,8 +545,8 @@ void Sidebar::restoreSession (KConfig *config)
{
ToolView *tv = m_toolviews[i];
- tv->persistent = config->readBoolEntry (QString ("Kate-MDI-ToolView-%1-Persistent").arg(tv->id), false);
- tv->setVisible (config->readBoolEntry (QString ("Kate-MDI-ToolView-%1-Visible").arg(tv->id), false));
+ tv->persistent = config->readBoolEntry (TQString ("Kate-MDI-ToolView-%1-Persistent").tqarg(tv->id), false);
+ tv->setVisible (config->readBoolEntry (TQString ("Kate-MDI-ToolView-%1-Visible").tqarg(tv->id), false));
if (!anyVis)
anyVis = tv->visible();
@@ -568,18 +568,18 @@ void Sidebar::restoreSession (KConfig *config)
void Sidebar::saveSession (KConfig *config)
{
// store the own splitter sizes
- QValueList<int> s = m_ownSplit->sizes();
- config->writeEntry (QString ("Kate-MDI-Sidebar-%1-Splitter").arg(sidebarPosition()), s);
+ TQValueList<int> s = m_ownSplit->sizes();
+ config->writeEntry (TQString ("Kate-MDI-Sidebar-%1-Splitter").tqarg(sidebarPosition()), s);
// store the data about all toolviews in this sidebar ;)
for ( unsigned int i=0; i < m_toolviews.size(); ++i )
{
ToolView *tv = m_toolviews[i];
- config->writeEntry (QString ("Kate-MDI-ToolView-%1-Position").arg(tv->id), tv->sidebar()->sidebarPosition());
- config->writeEntry (QString ("Kate-MDI-ToolView-%1-Sidebar-Position").arg(tv->id), i);
- config->writeEntry (QString ("Kate-MDI-ToolView-%1-Visible").arg(tv->id), tv->visible());
- config->writeEntry (QString ("Kate-MDI-ToolView-%1-Persistent").arg(tv->id), tv->persistent);
+ config->writeEntry (TQString ("Kate-MDI-ToolView-%1-Position").tqarg(tv->id), tv->sidebar()->sidebarPosition());
+ config->writeEntry (TQString ("Kate-MDI-ToolView-%1-Sidebar-Position").tqarg(tv->id), i);
+ config->writeEntry (TQString ("Kate-MDI-ToolView-%1-Visible").tqarg(tv->id), tv->visible());
+ config->writeEntry (TQString ("Kate-MDI-ToolView-%1-Persistent").tqarg(tv->id), tv->persistent);
}
}
@@ -588,13 +588,13 @@ void Sidebar::saveSession (KConfig *config)
//BEGIN MAIN WINDOW
-MainWindow::MainWindow (QWidget* parentWidget, const char* name)
- : KParts::MainWindow( parentWidget, name)
+MainWindow::MainWindow (TQWidget* tqparentWidget, const char* name)
+ : KParts::MainWindow( tqparentWidget, name)
, m_restoreConfig (0)
, m_guiClient (new GUIClient (this))
{
// init the internal widgets
- QHBox *hb = new QHBox (this);
+ TQHBox *hb = new TQHBox (this);
setCentralWidget(hb);
m_sidebars[KMultiTabBar::Left] = new Sidebar (KMultiTabBar::Left, this, hb);
@@ -604,7 +604,7 @@ MainWindow::MainWindow (QWidget* parentWidget, const char* name)
m_sidebars[KMultiTabBar::Left]->setSplitter (m_hSplitter);
- QVBox *vb = new QVBox (m_hSplitter);
+ TQVBox *vb = new TQVBox (m_hSplitter);
m_hSplitter->setCollapsible(vb, false);
m_sidebars[KMultiTabBar::Top] = new Sidebar (KMultiTabBar::Top, this, vb);
@@ -614,7 +614,7 @@ MainWindow::MainWindow (QWidget* parentWidget, const char* name)
m_sidebars[KMultiTabBar::Top]->setSplitter (m_vSplitter);
- m_centralWidget = new QVBox (m_vSplitter);
+ m_centralWidget = new TQVBox (m_vSplitter);
m_vSplitter->setCollapsible(m_centralWidget, false);
m_sidebars[KMultiTabBar::Bottom] = new Sidebar (KMultiTabBar::Bottom, this, vb);
@@ -637,12 +637,12 @@ MainWindow::~MainWindow ()
delete m_sidebars[i];
}
-QWidget *MainWindow::centralWidget () const
+TQWidget *MainWindow::centralWidget () const
{
return m_centralWidget;
}
-ToolView *MainWindow::createToolView (const QString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const QPixmap &icon, const QString &text)
+ToolView *MainWindow::createToolView (const TQString &identifier, KMultiTabBar::KMultiTabBarPosition pos, const TQPixmap &icon, const TQString &text)
{
if (m_idToWidget[identifier])
return 0;
@@ -651,7 +651,7 @@ ToolView *MainWindow::createToolView (const QString &identifier, KMultiTabBar::K
if (m_restoreConfig && m_restoreConfig->hasGroup (m_restoreGroup))
{
m_restoreConfig->setGroup (m_restoreGroup);
- pos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (QString ("Kate-MDI-ToolView-%1-Position").arg(identifier), pos);
+ pos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (TQString ("Kate-MDI-ToolView-%1-Position").tqarg(identifier), pos);
}
ToolView *v = m_sidebars[pos]->addWidget (icon, text, 0);
@@ -666,7 +666,7 @@ ToolView *MainWindow::createToolView (const QString &identifier, KMultiTabBar::K
return v;
}
-ToolView *MainWindow::toolView (const QString &identifier) const
+ToolView *MainWindow::toolView (const TQString &identifier) const
{
return m_idToWidget[identifier];
}
@@ -710,7 +710,7 @@ bool MainWindow::moveToolView (ToolView *widget, KMultiTabBar::KMultiTabBarPosit
if (m_restoreConfig && m_restoreConfig->hasGroup (m_restoreGroup))
{
m_restoreConfig->setGroup (m_restoreGroup);
- pos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (QString ("Kate-MDI-ToolView-%1-Position").arg(widget->id), pos);
+ pos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (TQString ("Kate-MDI-ToolView-%1-Position").tqarg(widget->id), pos);
}
m_sidebars[pos]->addWidget (widget->icon, widget->text, widget);
@@ -742,7 +742,7 @@ bool MainWindow::hideToolView (ToolView *widget)
return widget->sidebar()->hideWidget (widget);
}
-void MainWindow::startRestore (KConfig *config, const QString &group)
+void MainWindow::startRestore (KConfig *config, const TQString &group)
{
// first save this stuff
m_restoreConfig = config;
@@ -751,9 +751,9 @@ void MainWindow::startRestore (KConfig *config, const QString &group)
if (!m_restoreConfig || !m_restoreConfig->hasGroup (m_restoreGroup))
{
//BEGIN Added stuff specifically for ktechlab
- QValueList<int> hs;
+ TQValueList<int> hs;
hs << 220 << 100 << 230;
- QValueList<int> vs;
+ TQValueList<int> vs;
vs << 0 << 100 << 150;
m_sidebars[0]->setLastSize (hs[0]);
@@ -775,8 +775,8 @@ void MainWindow::startRestore (KConfig *config, const QString &group)
m_restoreConfig->setGroup (m_restoreGroup);
// get main splitter sizes ;)
- QValueList<int> hs = m_restoreConfig->readIntListEntry ("Kate-MDI-H-Splitter");
- QValueList<int> vs = m_restoreConfig->readIntListEntry ("Kate-MDI-V-Splitter");
+ TQValueList<int> hs = m_restoreConfig->readIntListEntry ("Kate-MDI-H-Splitter");
+ TQValueList<int> vs = m_restoreConfig->readIntListEntry ("Kate-MDI-V-Splitter");
m_sidebars[0]->setLastSize (hs[0]);
m_sidebars[1]->setLastSize (hs[2]);
@@ -803,7 +803,7 @@ void MainWindow::finishRestore ()
m_restoreConfig->setGroup (m_restoreGroup);
for ( unsigned int i=0; i < m_toolviews.size(); ++i )
{
- KMultiTabBar::KMultiTabBarPosition newPos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (QString ("Kate-MDI-ToolView-%1-Position").arg(m_toolviews[i]->id), m_toolviews[i]->sidebar()->sidebarPosition());
+ KMultiTabBar::KMultiTabBarPosition newPos = (KMultiTabBar::KMultiTabBarPosition) m_restoreConfig->readNumEntry (TQString ("Kate-MDI-ToolView-%1-Position").tqarg(m_toolviews[i]->id), m_toolviews[i]->sidebar()->sidebarPosition());
if (m_toolviews[i]->sidebar()->sidebarPosition() != newPos)
{
@@ -822,7 +822,7 @@ void MainWindow::finishRestore ()
m_restoreGroup = "";
}
-void MainWindow::saveSession (KConfig *config, const QString &group)
+void MainWindow::saveSession (KConfig *config, const TQString &group)
{
if (!config)
return;
@@ -832,8 +832,8 @@ void MainWindow::saveSession (KConfig *config, const QString &group)
config->setGroup (group);
// save main splitter sizes ;)
- QValueList<int> hs = m_hSplitter->sizes();
- QValueList<int> vs = m_vSplitter->sizes();
+ TQValueList<int> hs = m_hSplitter->sizes();
+ TQValueList<int> vs = m_vSplitter->sizes();
if (hs[0] <= 2 && !m_sidebars[0]->splitterVisible ())
hs[0] = m_sidebars[0]->lastSize();