diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-17 08:20:48 +0000 |
commit | aa0726b20f398264f0a2abc60215be044b106f9c (patch) | |
tree | 070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/basketstatusbar.cpp | |
parent | d3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff) | |
download | basket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip |
TQt4 port basket
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/basketstatusbar.cpp')
-rw-r--r-- | src/basketstatusbar.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/basketstatusbar.cpp b/src/basketstatusbar.cpp index 02e18f5..72e706b 100644 --- a/src/basketstatusbar.cpp +++ b/src/basketstatusbar.cpp @@ -22,8 +22,8 @@ #include <kstatusbar.h> #include <klocale.h> #include <kdebug.h> -#include <qlabel.h> -#include <qobjectlist.h> +#include <tqlabel.h> +#include <tqobjectlist.h> #include "basketstatusbar.h" #include "clickablelabel.h" #include "global.h" @@ -31,15 +31,15 @@ #include "basket.h" #include "tools.h" #include <kiconloader.h> -#include <qtooltip.h> +#include <tqtooltip.h> BasketStatusBar::BasketStatusBar(KStatusBar *bar) - : m_bar(bar), m_extension(0), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0) + : m_bar(bar), m_extension(0), m_selectiontqStatus(0), m_locktqStatus(0), m_baskettqStatus(0), m_savedtqStatus(0) { } BasketStatusBar::BasketStatusBar(KParts::StatusBarExtension *extension) - : m_bar(0), m_extension(extension), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0) + : m_bar(0), m_extension(extension), m_selectiontqStatus(0), m_locktqStatus(0), m_baskettqStatus(0), m_savedtqStatus(0) { } @@ -56,7 +56,7 @@ KStatusBar *BasketStatusBar::statusBar () const return m_bar; } -void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent) +void BasketStatusBar::addWidget(TQWidget * widget, int stretch, bool permanent) { if(m_extension) m_extension->addStatusBarItem(widget, stretch, permanent); @@ -66,53 +66,53 @@ void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent) void BasketStatusBar::setupStatusBar() { - QWidget* parent = statusBar(); - QObjectList* lst = parent->queryList("KRSqueezedTextLabel"); + TQWidget* tqparent = statusBar(); + TQObjectList* lst = tqparent->queryList("KRSqueezedTextLabel"); - //Tools::printChildren(parent); + //Tools::printChildren(tqparent); if(lst->count() == 0) { - m_basketStatus = new QLabel(parent); - m_basketStatus->setSizePolicy( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored, 0, 0, false) ); - addWidget( m_basketStatus, 1, false ); // Fit all extra space and is hiddable + m_baskettqStatus = new TQLabel(tqparent); + m_baskettqStatus->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored, 0, 0, false) ); + addWidget( m_baskettqStatus, 1, false ); // Fit all extra space and is hiddable } else - m_basketStatus = static_cast<QLabel*>(lst->at(0)); + m_baskettqStatus = static_cast<TQLabel*>(TQT_TQWIDGET(lst->at(0))); delete lst; - m_selectionStatus = new QLabel(i18n("Loading..."), parent); - addWidget( m_selectionStatus, 0, true ); + m_selectiontqStatus = new TQLabel(i18n("Loading..."), tqparent); + addWidget( m_selectiontqStatus, 0, true ); - m_lockStatus = new ClickableLabel(0/*this*/); - m_lockStatus->setMinimumSize(18, 18); - m_lockStatus->setAlignment(Qt::AlignCenter); -// addWidget( m_lockStatus, 0, true ); - connect( m_lockStatus, SIGNAL(clicked()), Global::bnpView, SLOT(lockBasket()) ); + m_locktqStatus = new ClickableLabel(0/*this*/); + m_locktqStatus->setMinimumSize(18, 18); + m_locktqStatus->tqsetAlignment(TQt::AlignCenter); +// addWidget( m_locktqStatus, 0, true ); + connect( m_locktqStatus, TQT_SIGNAL(clicked()), Global::bnpView, TQT_SLOT(lockBasket()) ); m_savedStatusPixmap = SmallIcon("filesave"); - m_savedStatus = new QLabel(parent); - m_savedStatus->setPixmap(m_savedStatusPixmap); - m_savedStatus->setFixedSize(m_savedStatus->sizeHint()); - m_savedStatus->clear(); - //m_savedStatus->setPixmap(m_savedStatusIconSet.pixmap(QIconSet::Small, QIconSet::Disabled)); - //m_savedStatus->setEnabled(false); - addWidget( m_savedStatus, 0, true ); - QToolTip::add(m_savedStatus, "<p>" + i18n("Shows if there are changes that have not yet been saved.")); + m_savedtqStatus = new TQLabel(tqparent); + m_savedtqStatus->setPixmap(m_savedStatusPixmap); + m_savedtqStatus->setFixedSize(m_savedtqStatus->tqsizeHint()); + m_savedtqStatus->clear(); + //m_savedtqStatus->setPixmap(m_savedStatusIconSet.pixmap(TQIconSet::Small, TQIconSet::Disabled)); + //m_savedtqStatus->setEnabled(false); + addWidget( m_savedtqStatus, 0, true ); + TQToolTip::add(m_savedtqStatus, "<p>" + i18n("Shows if there are changes that have not yet been saved.")); } -void BasketStatusBar::postStatusbarMessage(const QString& text) +void BasketStatusBar::postStatusbarMessage(const TQString& text) { if(statusBar()) statusBar()->message(text, 2000); } -void BasketStatusBar::setStatusText(const QString &txt) +void BasketStatusBar::setStatusText(const TQString &txt) { - if(m_basketStatus && m_basketStatus->text() != txt) - m_basketStatus->setText(txt); + if(m_baskettqStatus && m_baskettqStatus->text() != txt) + m_baskettqStatus->setText(txt); } -void BasketStatusBar::setStatusBarHint(const QString &hint) +void BasketStatusBar::setStatusBarHint(const TQString &hint) { if (hint.isEmpty()) updateStatusBarHint(); @@ -122,7 +122,7 @@ void BasketStatusBar::setStatusBarHint(const QString &hint) void BasketStatusBar::updateStatusBarHint() { - QString message = ""; + TQString message = ""; if (Global::bnpView->currentBasket()->isDuringDrag()) message = i18n("Ctrl+drop: copy, Shift+drop: move, Shift+Ctrl+drop: link."); @@ -137,40 +137,40 @@ void BasketStatusBar::updateStatusBarHint() setStatusText(message); } -void BasketStatusBar::setLockStatus(bool isLocked) +void BasketStatusBar::setLocktqStatus(bool isLocked) { - if(!m_lockStatus) + if(!m_locktqStatus) return; if (isLocked) { - m_lockStatus->setPixmap(SmallIcon("encrypted.png")); - QToolTip::add(m_lockStatus, i18n( - "<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").replace(" ", " ") ); -// QToolTip::add(m_lockStatus, i18n("This basket is locked.\nClick to unlock it.")); + m_locktqStatus->setPixmap(SmallIcon("encrypted.png")); + TQToolTip::add(m_locktqStatus, i18n( + "<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").tqreplace(" ", " ") ); +// TQToolTip::add(m_locktqStatus, i18n("This basket is locked.\nClick to unlock it.")); } else { - m_lockStatus->clear(); - QToolTip::add(m_lockStatus, i18n( - "<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").replace(" ", " ") ); -// QToolTip::add(m_lockStatus, i18n("This basket is unlocked.\nClick to lock it.")); + m_locktqStatus->clear(); + TQToolTip::add(m_locktqStatus, i18n( + "<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").tqreplace(" ", " ") ); +// TQToolTip::add(m_locktqStatus, i18n("This basket is unlocked.\nClick to lock it.")); } } -void BasketStatusBar::setSelectionStatus(const QString &s) +void BasketStatusBar::setSelectiontqStatus(const TQString &s) { - if (m_selectionStatus) - m_selectionStatus->setText(s); + if (m_selectiontqStatus) + m_selectiontqStatus->setText(s); } -void BasketStatusBar::setUnsavedStatus(bool isUnsaved) +void BasketStatusBar::setUnsavedtqStatus(bool isUnsaved) { - if (!m_savedStatus) + if (!m_savedtqStatus) return; if (isUnsaved) { - if (m_savedStatus->pixmap() == 0) - m_savedStatus->setPixmap(m_savedStatusPixmap); + if (m_savedtqStatus->pixmap() == 0) + m_savedtqStatus->setPixmap(m_savedStatusPixmap); } else - m_savedStatus->clear(); + m_savedtqStatus->clear(); } #include "basketstatusbar.moc" |