summaryrefslogtreecommitdiffstats
path: root/kftpgrabber/src/widgets/sidebar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kftpgrabber/src/widgets/sidebar.cpp')
-rw-r--r--kftpgrabber/src/widgets/sidebar.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/kftpgrabber/src/widgets/sidebar.cpp b/kftpgrabber/src/widgets/sidebar.cpp
index bd7545b..0e26987 100644
--- a/kftpgrabber/src/widgets/sidebar.cpp
+++ b/kftpgrabber/src/widgets/sidebar.cpp
@@ -38,47 +38,47 @@
#include "sidebar.h"
#include "multitabbar.h"
-#include <kapplication.h>
-#include <kconfig.h>
+#include <tdeapplication.h>
+#include <tdeconfig.h>
#include <kiconloader.h>
-#include <klocale.h>
+#include <tdelocale.h>
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qsignalmapper.h>
-#include <qstyle.h>
+#include <ntqcursor.h>
+#include <ntqpainter.h>
+#include <ntqsignalmapper.h>
+#include <ntqstyle.h>
namespace KFTPWidgets {
-class Splitter : public QWidget {
+class Splitter : public TQWidget {
public:
Splitter(Sidebar *w)
- : QWidget(w, "divider"),
+ : TQWidget(w, "divider"),
m_position(w->m_position)
{
if (m_position == Sidebar::Left)
- setCursor(QCursor(SplitHCursor));
+ setCursor(TQCursor(SplitHCursor));
else
- setCursor(QCursor(SplitVCursor));
+ setCursor(TQCursor(SplitVCursor));
styleChange(style());
}
- virtual void paintEvent(QPaintEvent*)
+ virtual void paintEvent(TQPaintEvent*)
{
- QPainter p(this);
- parentWidget()->style().drawPrimitive(QStyle::PE_Splitter, &p, rect(), colorGroup(), m_position == Sidebar::Left ? QStyle::Style_Horizontal : 0);
+ TQPainter p(this);
+ parentWidget()->style().drawPrimitive(TQStyle::PE_Splitter, &p, rect(), colorGroup(), m_position == Sidebar::Left ? TQStyle::Style_Horizontal : 0);
}
- virtual void styleChange(QStyle&)
+ virtual void styleChange(TQStyle&)
{
if (m_position == Sidebar::Left)
- setFixedWidth(style().pixelMetric(QStyle::PM_SplitterWidth, this));
+ setFixedWidth(style().pixelMetric(TQStyle::PM_SplitterWidth, this));
else
- setFixedHeight(style().pixelMetric(QStyle::PM_SplitterWidth, this));
+ setFixedHeight(style().pixelMetric(TQStyle::PM_SplitterWidth, this));
}
- virtual void mouseMoveEvent(QMouseEvent *e)
+ virtual void mouseMoveEvent(TQMouseEvent *e)
{
static_cast<Sidebar*>(parent())->mouseMovedOverSplitter(e);
}
@@ -86,16 +86,16 @@ private:
Sidebar::Position m_position;
};
-Sidebar::Sidebar(QWidget *parent, Position position)
- : QWidget(parent, "Sidebar"),
+Sidebar::Sidebar(TQWidget *parent, Position position)
+ : TQWidget(parent, "Sidebar"),
m_position(position),
m_divider(new KFTPWidgets::Splitter(this)),
- m_content(new QVBox(this)),
+ m_content(new TQVBox(this)),
m_tabBar(new MultiTabBar(position == Left ? MultiTabBar::Vertical : MultiTabBar::Horizontal, this)),
- m_sidebarBox(new QWidget(this)),
+ m_sidebarBox(new TQWidget(this)),
m_currentIndex(-1),
m_lastIndex(-1),
- m_mapper(new QSignalMapper(this))
+ m_mapper(new TQSignalMapper(this))
{
m_tabBar->setStyle(MultiTabBar::AMAROK);
m_tabBar->setPosition(m_position == Left ? MultiTabBar::Left : MultiTabBar::Bottom);
@@ -107,7 +107,7 @@ Sidebar::Sidebar(QWidget *parent, Position position)
m_tabBar->setFixedWidth(m_pos);
m_tabBar->move(0, 3);
- QVBoxLayout *layout = new QVBoxLayout(m_sidebarBox);
+ TQVBoxLayout *layout = new TQVBoxLayout(m_sidebarBox);
layout->addSpacing(3);
layout->setAutoAdd(true);
@@ -119,7 +119,7 @@ Sidebar::Sidebar(QWidget *parent, Position position)
m_pos = m_tabBar->sizeHint().height() + 5;
m_tabBar->setFixedHeight(m_pos);
- QVBoxLayout *layout = new QVBoxLayout(m_sidebarBox);
+ TQVBoxLayout *layout = new TQVBoxLayout(m_sidebarBox);
layout->setAutoAdd(true);
m_sidebarBox->hide();
@@ -153,17 +153,17 @@ void Sidebar::setVisible(bool visible)
Sidebar::~Sidebar()
{
- KConfig *config;
+ TDEConfig *config;
// Save the currently selected sidebar
if (m_position == Left) {
- config = KFTPGrabberBase::config(QString("Sidebar_%1").arg("Left"));
+ config = KFTPGrabberBase::config(TQString("Sidebar_%1").arg("Left"));
} else {
- config = KFTPGrabberBase::config(QString("Sidebar_%1").arg("Bottom"));
+ config = KFTPGrabberBase::config(TQString("Sidebar_%1").arg("Bottom"));
}
if (m_currentIndex != -1) {
config->writeEntry("CurrentSidebar", currentSidebar()->name());
} else {
- config->writeEntry("CurrentSidebar", QString::null);
+ config->writeEntry("CurrentSidebar", TQString::null);
}
if (m_position == Left) {
config->writeEntry("Size", m_sidebarBox->width());
@@ -174,9 +174,9 @@ Sidebar::~Sidebar()
void Sidebar::polish()
{
- QWidget::polish();
+ TQWidget::polish();
- KConfig *config = KFTPGrabberBase::config(QString("Sidebar_%1").arg(m_position == Left ? "Left" : "Bottom"));
+ TDEConfig *config = KFTPGrabberBase::config(TQString("Sidebar_%1").arg(m_position == Left ? "Left" : "Bottom"));
const int index = indexForName(config->readEntry("CurrentSidebar"));
if (m_position == Left) {
@@ -250,7 +250,7 @@ void Sidebar::adjustWidgetSizes()
}
}
-void Sidebar::mouseMovedOverSplitter(QMouseEvent *e)
+void Sidebar::mouseMovedOverSplitter(TQMouseEvent *e)
{
const uint oldPos = m_pos;
uint newPos;
@@ -278,10 +278,10 @@ void Sidebar::mouseMovedOverSplitter(QMouseEvent *e)
adjustWidgetSizes();
}
-bool Sidebar::event(QEvent *e)
+bool Sidebar::event(TQEvent *e)
{
switch (e->type()) {
- case QEvent::LayoutHint: {
+ case TQEvent::LayoutHint: {
if (m_position == Left) {
setMinimumWidth(m_tabBar->minimumWidth() + m_divider->minimumWidth() + m_sidebarBox->width() + m_content->minimumWidth());
} else {
@@ -289,7 +289,7 @@ bool Sidebar::event(QEvent *e)
}
break;
}
- case QEvent::Resize: {
+ case TQEvent::Resize: {
if (m_position == Left) {
m_divider->resize(0, height());
m_tabBar->resize(0, height());
@@ -304,21 +304,21 @@ bool Sidebar::event(QEvent *e)
default: break;
}
- return QWidget::event(e);
+ return TQWidget::event(e);
}
-void Sidebar::addSidebar(QWidget *widget, const QString &title, const QString &icon)
+void Sidebar::addSidebar(TQWidget *widget, const TQString &title, const TQString &icon)
{
const int id = m_tabBar->tabs()->count(); // the next available id
- const QString name(widget->name());
- QWidget *tab;
+ const TQString name(widget->name());
+ TQWidget *tab;
- widget->reparent(m_sidebarBox, QPoint());
+ widget->reparent(m_sidebarBox, TQPoint());
widget->hide();
m_tabBar->appendTab(SmallIcon(icon), id, title);
tab = m_tabBar->tab(id);
- tab->setFocusPolicy(QWidget::NoFocus);
+ tab->setFocusPolicy(TQWidget::NoFocus);
// We use a SignalMapper to show/hide the corresponding browser when tabs are clicked
connect(tab, SIGNAL(clicked()), m_mapper, SLOT(map()));
@@ -347,7 +347,7 @@ void Sidebar::showHideSidebar(int index)
adjustWidgetSizes();
} else if ((uint) index < m_sidebars.count()) {
// Open up target
- QWidget* const target = m_sidebars[index];
+ TQWidget* const target = m_sidebars[index];
m_currentIndex = index;
m_divider->show();
@@ -368,7 +368,7 @@ void Sidebar::showHideSidebar(int index)
}
}
-QWidget *Sidebar::sidebar(const QString &name) const
+TQWidget *Sidebar::sidebar(const TQString &name) const
{
for (SidebarList::ConstIterator it = m_sidebars.begin(), end = m_sidebars.end(); it != end; ++it) {
if (name == (*it)->name())
@@ -378,7 +378,7 @@ QWidget *Sidebar::sidebar(const QString &name) const
return 0;
}
-int Sidebar::indexForName(const QString &name) const
+int Sidebar::indexForName(const TQString &name) const
{
for (uint x = 0; x < m_sidebars.count(); ++x) {
if (name == m_sidebars[x]->name())