summaryrefslogtreecommitdiffstats
path: root/src/basket.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/basket.cpp
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-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/basket.cpp')
-rw-r--r--src/basket.cpp1287
1 files changed, 648 insertions, 639 deletions
diff --git a/src/basket.cpp b/src/basket.cpp
index 95a3614..a5fd970 100644
--- a/src/basket.cpp
+++ b/src/basket.cpp
@@ -18,34 +18,34 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qdragobject.h>
-#include <qdom.h>
-#include <qpainter.h>
-#include <qstyle.h>
+#include <tqdragobject.h>
+#include <tqdom.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
#include <kstyle.h>
-#include <qtooltip.h>
-#include <qlistview.h>
-#include <qcursor.h>
-#include <qsimplerichtext.h>
-#include <qpushbutton.h>
+#include <tqtooltip.h>
+#include <tqlistview.h>
+#include <tqcursor.h>
+#include <tqsimplerichtext.h>
+#include <tqpushbutton.h>
#include <ktextedit.h>
-#include <qpoint.h>
-#include <qstringlist.h>
+#include <tqpoint.h>
+#include <tqstringlist.h>
#include <kapplication.h>
#include <kglobalsettings.h>
#include <kopenwith.h>
#include <kservice.h>
#include <klocale.h>
#include <kglobalaccel.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <kfiledialog.h>
#include <kaboutdata.h>
#include <klineedit.h>
#include <ksavefile.h>
#include <kdebug.h>
-#include <qvbox.h>
+#include <tqvbox.h>
#include <unistd.h> // For sleep()
@@ -53,16 +53,16 @@
#include <kiconloader.h>
#include <krun.h>
-#include <qtoolbar.h>
-#include <qclipboard.h>
+#include <tqtoolbar.h>
+#include <tqclipboard.h>
#include <kmessagebox.h>
-#include <qinputdialog.h>
+#include <tqinputdialog.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <stdlib.h> // rand() function
-#include <qdatetime.h> // seed for rand()
+#include <tqdatetime.h> // seed for rand()
#include "basket.h"
#include "note.h"
@@ -90,21 +90,27 @@
NoteSelection* NoteSelection::nextStacked()
{
// First, search in the childs:
- if (firstChild)
- if (firstChild->note && firstChild->note->content())
+ if (firstChild) {
+ if (firstChild->note && firstChild->note->content()) {
return firstChild;
- else
+ }
+ else {
return firstChild->nextStacked();
+ }
+ }
// Then, in the next:
- if (next)
- if (next->note && next->note->content())
+ if (next) {
+ if (next->note && next->note->content()) {
return next;
- else
+ }
+ else {
return next->nextStacked();
+ }
+ }
- // And finally, in the parent:
- NoteSelection *node = parent;
+ // And finally, in the tqparent:
+ NoteSelection *node = tqparent;
while (node)
if (node->next)
if (node->next->note && node->next->note->content())
@@ -112,7 +118,7 @@ NoteSelection* NoteSelection::nextStacked()
else
return node->next->nextStacked();
else
- node = node->parent;
+ node = node->tqparent;
// Not found:
return 0;
@@ -143,7 +149,7 @@ void NoteSelection::append(NoteSelection *node)
firstChild = node;
while (node) {
- node->parent = this;
+ node->tqparent = this;
node = node->next;
}
}
@@ -164,16 +170,16 @@ int NoteSelection::count()
return count;
}
-QValueList<Note*> NoteSelection::parentGroups()
+TQValueList<Note*> NoteSelection::tqparentGroups()
{
- QValueList<Note*> groups;
+ TQValueList<Note*> groups;
// For each note:
for (NoteSelection *node = firstStacked(); node; node = node->nextStacked())
- // For each parent groups of the note:
- for (Note *note = node->note->parentNote(); note; note = note->parentNote())
+ // For each tqparent groups of the note:
+ for (Note *note = node->note->tqparentNote(); note; note = note->tqparentNote())
// Add it (if it was not already in the list):
- if (!note->isColumn() && !groups.contains(note))
+ if (!note->isColumn() && !groups.tqcontains(note))
groups.append(note);
return groups;
@@ -181,10 +187,10 @@ QValueList<Note*> NoteSelection::parentGroups()
/** Class DecoratedBasket: */
-DecoratedBasket::DecoratedBasket(QWidget *parent, const QString &folderName, const char *name, WFlags fl)
- : QWidget(parent, name, fl)
+DecoratedBasket::DecoratedBasket(TQWidget *tqparent, const TQString &folderName, const char *name, WFlags fl)
+ : TQWidget(tqparent, name, fl)
{
- m_layout = new QVBoxLayout(this);
+ m_layout = new TQVBoxLayout(this);
m_filter = new FilterBar(this);
m_basket = new Basket(this, folderName);
m_layout->addWidget(m_basket);
@@ -193,13 +199,13 @@ DecoratedBasket::DecoratedBasket(QWidget *parent, const QString &folderName, con
m_filter->setShown(true);
m_basket->setFocus(); // To avoid the filter bar have focus on load
- connect( m_filter, SIGNAL(newFilter(const FilterData&)), m_basket, SLOT(newFilter(const FilterData&)) );
- connect( m_filter, SIGNAL(escapePressed()), m_basket, SLOT(cancelFilter()) );
- connect( m_filter, SIGNAL(returnPressed()), m_basket, SLOT(validateFilter()) );
+ connect( m_filter, TQT_SIGNAL(newFilter(const FilterData&)), m_basket, TQT_SLOT(newFilter(const FilterData&)) );
+ connect( m_filter, TQT_SIGNAL(escapePressed()), m_basket, TQT_SLOT(cancelFilter()) );
+ connect( m_filter, TQT_SIGNAL(returnPressed()), m_basket, TQT_SLOT(validateFilter()) );
- connect( m_basket, SIGNAL(postMessage(const QString&)), Global::bnpView, SLOT(postStatusbarMessage(const QString&)) );
- connect( m_basket, SIGNAL(setStatusBarText(const QString&)), Global::bnpView, SLOT(setStatusBarHint(const QString&)) );
- connect( m_basket, SIGNAL(resetStatusBarText()), Global::bnpView, SLOT(updateStatusBarHint()) );
+ connect( m_basket, TQT_SIGNAL(postMessage(const TQString&)), Global::bnpView, TQT_SLOT(postStatusbarMessage(const TQString&)) );
+ connect( m_basket, TQT_SIGNAL(setStatusBarText(const TQString&)), Global::bnpView, TQT_SLOT(setStatusBarHint(const TQString&)) );
+ connect( m_basket, TQT_SIGNAL(resetStatusBarText()), Global::bnpView, TQT_SLOT(updateStatusBarHint()) );
}
DecoratedBasket::~DecoratedBasket()
@@ -211,14 +217,14 @@ void DecoratedBasket::setFilterBarPosition(bool onTop)
m_layout->remove(m_filter);
if (onTop) {
m_layout->insertWidget(0, m_filter);
- setTabOrder(this/*(QWidget*)parent()*/, m_filter);
+ setTabOrder(this/*(TQWidget*)tqparent()*/, m_filter);
setTabOrder(m_filter, m_basket);
- setTabOrder(m_basket, (QWidget*)parent());
+ setTabOrder(m_basket, (TQWidget*)tqparent());
} else {
m_layout->addWidget(m_filter);
- setTabOrder(this/*(QWidget*)parent()*/, m_basket);
+ setTabOrder(this/*(TQWidget*)tqparent()*/, m_basket);
setTabOrder(m_basket, m_filter);
- setTabOrder(m_filter, (QWidget*)parent());
+ setTabOrder(m_filter, (TQWidget*)tqparent());
}
}
@@ -246,18 +252,18 @@ void DecoratedBasket::resetFilter()
/** Class TransparentWidget */
TransparentWidget::TransparentWidget(Basket *basket)
- : QWidget(basket->viewport(), "", Qt::WNoAutoErase), m_basket(basket)
+ : TQWidget(basket->viewport(), "", TQt::WNoAutoErase), m_basket(basket)
{
- setFocusPolicy(QWidget::NoFocus);
- setWFlags(Qt::WNoAutoErase);
+ setFocusPolicy(TQ_NoFocus);
+ setWFlags(TQt::WNoAutoErase);
setMouseTracking(true); // To receive mouseMoveEvents
basket->viewport()->installEventFilter(this);
}
-/*void TransparentWidget::reparent(QWidget *parent, WFlags f, const QPoint &p, bool showIt)
+/*void TransparentWidget::reparent(TQWidget *tqparent, WFlags f, const TQPoint &p, bool showIt)
{
- QWidget::reparent(parent, Qt::WNoAutoErase, p, showIt);
+ TQWidget::reparent(tqparent, TQt::WNoAutoErase, p, showIt);
}*/
void TransparentWidget::setPosition(int x, int y)
@@ -266,10 +272,10 @@ void TransparentWidget::setPosition(int x, int y)
m_y = y;
}
-void TransparentWidget::paintEvent(QPaintEvent*event)
+void TransparentWidget::paintEvent(TQPaintEvent*event)
{
- QWidget::paintEvent(event);
- QPainter painter(this);
+ TQWidget::paintEvent(event);
+ TQPainter painter(this);
// painter.save();
@@ -277,21 +283,21 @@ void TransparentWidget::paintEvent(QPaintEvent*event)
m_basket->drawContents(&painter, m_x, m_y, width(), height());
// painter.restore();
-// painter.setPen(Qt::blue);
+// painter.setPen(TQt::blue);
// painter.drawRect(0, 0, width(), height());
}
-void TransparentWidget::mouseMoveEvent(QMouseEvent *event)
+void TransparentWidget::mouseMoveEvent(TQMouseEvent *event)
{
- QMouseEvent *translated = new QMouseEvent(QEvent::MouseMove, event->pos() + QPoint(m_x, m_y), event->button(), event->state());
+ TQMouseEvent *translated = new TQMouseEvent(TQEvent::MouseMove, event->pos() + TQPoint(m_x, m_y), event->button(), event->state());
m_basket->contentsMouseMoveEvent(translated);
delete translated;
}
-bool TransparentWidget::eventFilter(QObject */*object*/, QEvent *event)
+bool TransparentWidget::eventFilter(TQObject */*object*/, TQEvent *event)
{
- // If the parent basket viewport has changed, we should change too:
- if (event->type() == QEvent::Paint)
+ // If the tqparent basket viewport has changed, we should change too:
+ if (event->type() == TQEvent::Paint)
update();
return false; // Event not consumed, in every cases (because it's only a notification)!
@@ -304,18 +310,18 @@ const int Basket::FRAME_DELAY = 50/*1500*/; // Delay between two animation "fram
/*
* Convenient function (defined in note.cpp !):
*/
-void drawGradient( QPainter *p, const QColor &colorTop, const QColor & colorBottom,
+void drawGradient( TQPainter *p, const TQColor &colorTop, const TQColor & colorBottom,
int x, int y, int w, int h,
bool sunken, bool horz, bool flat );
/*
* Defined in note.cpp:
*/
-extern void substractRectOnAreas(const QRect &rectToSubstract, QValueList<QRect> &areas, bool andRemove = true);
+extern void substractRectOnAreas(const TQRect &rectToSubstract, TQValueList<TQRect> &areas, bool andRemove = true);
void debugZone(int zone)
{
- QString s;
+ TQString s;
switch (zone) {
case Note::Handle: s = "Handle"; break;
case Note::Group: s = "Group"; break;
@@ -334,7 +340,7 @@ void debugZone(int zone)
if (zone == Note::Emblem0)
s = "Emblem0";
else
- s = "Emblem0+" + QString::number(zone - Note::Emblem0);
+ s = "Emblem0+" + TQString::number(zone - Note::Emblem0);
break;
}
std::cout << s << std::endl;
@@ -424,7 +430,7 @@ void Basket::appendNoteAfter(Note *note, Note *after)
if (after) {
// The normal case:
for (Note *n = note; n; n = n->next())
- n->setParentNote(after->parentNote());
+ n->setParentNote(after->tqparentNote());
note->setPrev(after);
last->setNext(after->next());
after->setNext(note);
@@ -464,15 +470,15 @@ void Basket::appendNoteBefore(Note *note, Note *before)
if (before) {
// The normal case:
for (Note *n = note; n; n = n->next())
- n->setParentNote(before->parentNote());
+ n->setParentNote(before->tqparentNote());
note->setPrev(before->prev());
last->setNext(before);
before->setPrev(last);
if (note->prev())
note->prev()->setNext(note);
else {
- if (note->parentNote())
- note->parentNote()->setFirstChild(note);
+ if (note->tqparentNote())
+ note->tqparentNote()->setFirstChild(note);
else
m_firstNote = note;
}
@@ -491,7 +497,7 @@ void Basket::appendNoteBefore(Note *note, Note *before)
DecoratedBasket* Basket::decoration()
{
- return (DecoratedBasket*)parent();
+ return (DecoratedBasket*)tqparent();
}
void Basket::preparePlug(Note *note)
@@ -504,7 +510,7 @@ void Basket::preparePlug(Note *note)
Note *last = 0;
for (Note *n = note; n; n = n->next()) {
if (m_loaded)
- n->setSelectedRecursivly(true); // Notes should have a parent basket (and they have, so that's OK).
+ n->setSelectedRecursivly(true); // Notes should have a tqparent basket (and they have, so that's OK).
count += n->count();
founds += n->newFilter(decoration()->filterData());
last = n;
@@ -550,19 +556,19 @@ void Basket::unplugNote(Note *note)
if (note->next())
note->next()->setPrev(note->prev());
- if (note->parentNote()) {
+ if (note->tqparentNote()) {
// If it was the first note of a group, change the first note of the group:
- if (note->parentNote()->firstChild() == note)
- note->parentNote()->setFirstChild( note->next() );
+ if (note->tqparentNote()->firstChild() == note)
+ note->tqparentNote()->setFirstChild( note->next() );
- if (!note->parentNote()->isColumn()) {
- // Ungroup if still 0 note inside parent group:
- if ( ! note->parentNote()->firstChild() )
- unplugNote(note->parentNote()); // TODO delete
+ if (!note->tqparentNote()->isColumn()) {
+ // Ungroup if still 0 note inside tqparent group:
+ if ( ! note->tqparentNote()->firstChild() )
+ unplugNote(note->tqparentNote()); // TODO delete
- // Ungroup if still 1 note inside parent group:
- else if ( ! note->parentNote()->firstChild()->next() )
- ungroupNote(note->parentNote());
+ // Ungroup if still 1 note inside tqparent group:
+ else if ( ! note->tqparentNote()->firstChild()->next() )
+ ungroupNote(note->tqparentNote());
}
}
@@ -587,7 +593,7 @@ void Basket::ungroupNote(Note *group)
lastGroupedNote->next()->setPrev(note);
note->setNext(lastGroupedNote->next());
lastGroupedNote->setNext(note);
- note->setParentNote(group->parentNote());
+ note->setParentNote(group->tqparentNote());
note->setPrev(lastGroupedNote);
note->setGroupWidth(group->groupWidth() - Note::GROUP_WIDTH);
@@ -599,7 +605,7 @@ void Basket::ungroupNote(Note *group)
group->setFirstChild(0);
unplugNote(group); // TODO: delete
- relayoutNotes(true);
+ retqlayoutNotes(true);
}
void Basket::groupNoteBefore(Note *note, Note *with)
@@ -621,11 +627,11 @@ void Basket::groupNoteBefore(Note *note, Note *with)
group->setNext(with->next());
group->setX(with->x());
group->setY(with->y());
- if (with->parentNote() && with->parentNote()->firstChild() == with)
- with->parentNote()->setFirstChild(group);
+ if (with->tqparentNote() && with->tqparentNote()->firstChild() == with)
+ with->tqparentNote()->setFirstChild(group);
else if (m_firstNote == with)
m_firstNote = group;
- group->setParentNote(with->parentNote());
+ group->setParentNote(with->tqparentNote());
group->setFirstChild(note);
group->setGroupWidth(with->groupWidth() + Note::GROUP_WIDTH);
@@ -665,11 +671,11 @@ void Basket::groupNoteAfter(Note *note, Note *with)
group->setNext(with->next());
group->setX(with->x());
group->setY(with->y());
- if (with->parentNote() && with->parentNote()->firstChild() == with)
- with->parentNote()->setFirstChild(group);
+ if (with->tqparentNote() && with->tqparentNote()->firstChild() == with)
+ with->tqparentNote()->setFirstChild(group);
else if (m_firstNote == with)
m_firstNote = group;
- group->setParentNote(with->parentNote());
+ group->setParentNote(with->tqparentNote());
group->setFirstChild(with);
group->setGroupWidth(with->groupWidth() + Note::GROUP_WIDTH);
@@ -690,11 +696,11 @@ void Basket::groupNoteAfter(Note *note, Note *with)
signalCountsChanged();
}
-void Basket::loadNotes(const QDomElement &notes, Note *parent)
+void Basket::loadNotes(const TQDomElement &notes, Note *tqparent)
{
Note *note;
- for (QDomNode n = notes.firstChild(); !n.isNull(); n = n.nextSibling()) {
- QDomElement e = n.toElement();
+ for (TQDomNode n = notes.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomElement e = n.toElement();
if (e.isNull()) // Cannot handle that!
continue;
note = 0;
@@ -703,8 +709,8 @@ void Basket::loadNotes(const QDomElement &notes, Note *parent)
note = new Note(this); // 1. Create the group...
loadNotes(e, note); // 3. ... And populate it with child notes.
int noteCount = note->count();
- if (noteCount > 0 || (parent == 0 && !isFreeLayout())) { // But don't remove columns!
- appendNoteIn(note, parent); // 2. ... Insert it... FIXME: Initially, the if() the insrtion was the step 2. Was it on purpose?
+ if (noteCount > 0 || (tqparent == 0 && !isFreeLayout())) { // But don't remove columns!
+ appendNoteIn(note, tqparent); // 2. ... Insert it... FIXME: Initially, the if() the insrtion was the step 2. Was it on purpose?
// The notes in the group are counted two times (it's why appendNoteIn() was called before loadNotes):
m_count -= noteCount;// TODO: Recompute note count every time noteCount() is emitted!
m_countFounds -= noteCount;
@@ -716,12 +722,12 @@ void Basket::loadNotes(const QDomElement &notes, Note *parent)
NoteFactory__loadNode(XMLWork::getElement(e, "content"), e.attribute("type"), note, /*lazyLoad=*/m_finishLoadOnFirstShow); // ... Populate it with content...
if (e.attribute("type") == "text")
m_shouldConvertPlainTextNotes = true; // Convert Pre-0.6.0 baskets: plain text notes should be converted to rich text ones once all is loaded!
- appendNoteIn(note, parent); // ... And insert it.
+ appendNoteIn(note, tqparent); // ... And insert it.
// Load dates:
if (e.hasAttribute("added"))
- note->setAddedDate( QDateTime::fromString(e.attribute("added"), Qt::ISODate));
+ note->setAddedDate( TQDateTime::fromString(e.attribute("added"), Qt::ISODate));
if (e.hasAttribute("lastModification"))
- note->setLastModificationDate(QDateTime::fromString(e.attribute("lastModification"), Qt::ISODate));
+ note->setLastModificationDate(TQDateTime::fromString(e.attribute("lastModification"), Qt::ISODate));
}
// If we successfully loaded a note:
if (note) {
@@ -740,9 +746,9 @@ void Basket::loadNotes(const QDomElement &notes, Note *parent)
note->toggleFolded(false);
// Tags:
if (note->content()) {
- QString tagsString = XMLWork::getElementText(e, "tags", "");
- QStringList tagsId = QStringList::split(";", tagsString);
- for (QStringList::iterator it = tagsId.begin(); it != tagsId.end(); ++it) {
+ TQString tagsString = XMLWork::getElementText(e, "tags", "");
+ TQStringList tagsId = TQStringList::split(";", tagsString);
+ for (TQStringList::iterator it = tagsId.begin(); it != tagsId.end(); ++it) {
State *state = Tag::stateForId(*it);
if (state)
note->addState(state, /*orReplace=*/true);
@@ -753,12 +759,12 @@ void Basket::loadNotes(const QDomElement &notes, Note *parent)
}
}
-void Basket::saveNotes(QDomDocument &document, QDomElement &element, Note *parent)
+void Basket::saveNotes(TQDomDocument &document, TQDomElement &element, Note *tqparent)
{
- Note *note = (parent ? parent->firstChild() : firstNote());
+ Note *note = (tqparent ? tqparent->firstChild() : firstNote());
while (note) {
// Create Element:
- QDomElement noteElement = document.createElement(note->isGroup() ? "group" : "note");
+ TQDomElement noteElement = document.createElement(note->isGroup() ? "group" : "note");
element.appendChild(noteElement);
// Free Note Properties:
if (note->isFree()) {
@@ -778,12 +784,12 @@ void Basket::saveNotes(QDomDocument &document, QDomElement &element, Note *paren
noteElement.setAttribute("lastModification", note->lastModificationDate().toString(Qt::ISODate));
// Save Content:
noteElement.setAttribute("type", note->content()->lowerTypeName());
- QDomElement content = document.createElement("content");
+ TQDomElement content = document.createElement("content");
noteElement.appendChild(content);
note->content()->saveToNode(document, content);
// Save Tags:
if (note->states().count() > 0) {
- QString tags;
+ TQString tags;
for (State::List::iterator it = note->states().begin(); it != note->states().end(); ++it)
tags += (tags.isEmpty() ? "" : ";") + (*it)->id();
XMLWork::addElement(document, noteElement, "tags", tags);
@@ -796,39 +802,39 @@ void Basket::saveNotes(QDomDocument &document, QDomElement &element, Note *paren
}
}
-void Basket::loadProperties(const QDomElement &properties)
+void Basket::loadProperties(const TQDomElement &properties)
{
// Compute Default Values for When Loading the Properties:
- QString defaultBackgroundColor = (backgroundColorSetting().isValid() ? backgroundColorSetting().name() : "");
- QString defaultTextColor = (textColorSetting().isValid() ? textColorSetting().name() : "");
+ TQString defaultBackgroundColor = (backgroundColorSetting().isValid() ? backgroundColorSetting().name() : "");
+ TQString defaultTextColor = (textColorSetting().isValid() ? textColorSetting().name() : "");
// Load the Properties:
- QString icon = XMLWork::getElementText(properties, "icon", this->icon() );
- QString name = XMLWork::getElementText(properties, "name", basketName() );
+ TQString icon = XMLWork::getElementText(properties, "icon", this->icon() );
+ TQString name = XMLWork::getElementText(properties, "name", basketName() );
- QDomElement appearance = XMLWork::getElement(properties, "appearance");
+ TQDomElement appearance = XMLWork::getElement(properties, "appearance");
// In 0.6.0-Alpha versions, there was a typo error: "backround" instead of "background"
- QString backgroundImage = appearance.attribute( "backgroundImage", appearance.attribute( "backroundImage", backgroundImageName() ) );
- QString backgroundColorString = appearance.attribute( "backgroundColor", appearance.attribute( "backroundColor", defaultBackgroundColor ) );
- QString textColorString = appearance.attribute( "textColor", defaultTextColor );
- QColor backgroundColor = (backgroundColorString.isEmpty() ? QColor() : QColor(backgroundColorString));
- QColor textColor = (textColorString.isEmpty() ? QColor() : QColor(textColorString) );
+ TQString backgroundImage = appearance.attribute( "backgroundImage", appearance.attribute( "backroundImage", backgroundImageName() ) );
+ TQString backgroundColorString = appearance.attribute( "backgroundColor", appearance.attribute( "backroundColor", defaultBackgroundColor ) );
+ TQString textColorString = appearance.attribute( "textColor", defaultTextColor );
+ TQColor backgroundColor = (backgroundColorString.isEmpty() ? TQColor() : TQColor(backgroundColorString));
+ TQColor textColor = (textColorString.isEmpty() ? TQColor() : TQColor(textColorString) );
- QDomElement disposition = XMLWork::getElement(properties, "disposition");
+ TQDomElement disposition = XMLWork::getElement(properties, "disposition");
bool free = XMLWork::trueOrFalse( disposition.attribute( "free", XMLWork::trueOrFalse(isFreeLayout()) ) );
- int columnCount = disposition.attribute( "columnCount", QString::number(this->columnsCount()) ).toInt();
+ int columnCount = disposition.attribute( "columnCount", TQString::number(this->columnsCount()) ).toInt();
bool mindMap = XMLWork::trueOrFalse( disposition.attribute( "mindMap", XMLWork::trueOrFalse(isMindMap()) ) );
- QDomElement shortcut = XMLWork::getElement(properties, "shortcut");
- QString actionStrings[] = { "show", "globalShow", "globalSwitch" };
+ TQDomElement shortcut = XMLWork::getElement(properties, "shortcut");
+ TQString actionStrings[] = { "show", "globalShow", "globalSwitch" };
KShortcut combination = KShortcut( shortcut.attribute( "combination", m_action->shortcut().toStringInternal() ) );
- QString actionString = shortcut.attribute( "action" );
+ TQString actionString = shortcut.attribute( "action" );
int action = shortcutAction();
if (actionString == actionStrings[0]) action = 0;
if (actionString == actionStrings[1]) action = 1;
if (actionString == actionStrings[2]) action = 2;
- QDomElement protection = XMLWork::getElement(properties, "protection");
+ TQDomElement protection = XMLWork::getElement(properties, "protection");
m_encryptionType = protection.attribute( "type" ).toInt();
m_encryptionKey = protection.attribute( "key" );
@@ -838,30 +844,30 @@ void Basket::loadProperties(const QDomElement &properties)
setAppearance(icon, name, backgroundImage, backgroundColor, textColor); // Will emit propertiesChanged(this)
}
-void Basket::saveProperties(QDomDocument &document, QDomElement &properties)
+void Basket::saveProperties(TQDomDocument &document, TQDomElement &properties)
{
XMLWork::addElement( document, properties, "name", basketName() );
XMLWork::addElement( document, properties, "icon", icon() );
- QDomElement appearance = document.createElement("appearance");
+ TQDomElement appearance = document.createElement("appearance");
properties.appendChild(appearance);
appearance.setAttribute( "backgroundImage", backgroundImageName() );
appearance.setAttribute( "backgroundColor", backgroundColorSetting().isValid() ? backgroundColorSetting().name() : "" );
appearance.setAttribute( "textColor", textColorSetting().isValid() ? textColorSetting().name() : "" );
- QDomElement disposition = document.createElement("disposition");
+ TQDomElement disposition = document.createElement("disposition");
properties.appendChild(disposition);
disposition.setAttribute( "free", XMLWork::trueOrFalse(isFreeLayout()) );
- disposition.setAttribute( "columnCount", QString::number(columnsCount()) );
+ disposition.setAttribute( "columnCount", TQString::number(columnsCount()) );
disposition.setAttribute( "mindMap", XMLWork::trueOrFalse(isMindMap()) );
- QDomElement shortcut = document.createElement("shortcut");
+ TQDomElement shortcut = document.createElement("shortcut");
properties.appendChild(shortcut);
- QString actionStrings[] = { "show", "globalShow", "globalSwitch" };
+ TQString actionStrings[] = { "show", "globalShow", "globalSwitch" };
shortcut.setAttribute( "combination", m_action->shortcut().toStringInternal() );
shortcut.setAttribute( "action", actionStrings[shortcutAction()] );
- QDomElement protection = document.createElement("protection");
+ TQDomElement protection = document.createElement("protection");
properties.appendChild(protection);
protection.setAttribute( "type", m_encryptionType );
protection.setAttribute( "key", m_encryptionKey );
@@ -892,7 +898,7 @@ void Basket::unsubscribeBackgroundImages()
}
}
-void Basket::setAppearance(const QString &icon, const QString &name, const QString &backgroundImage, const QColor &backgroundColor, const QColor &textColor)
+void Basket::setAppearance(const TQString &icon, const TQString &name, const TQString &backgroundImage, const TQColor &backgroundColor, const TQColor &textColor)
{
unsubscribeBackgroundImages();
@@ -905,7 +911,7 @@ void Basket::setAppearance(const QString &icon, const QString &name, const QStri
m_action->setText("BASKET SHORTCUT: " + name);
// Basket should ALWAYS have an icon (the "basket" icon by default):
- QPixmap iconTest = kapp->iconLoader()->loadIcon(m_icon, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
+ TQPixmap iconTest = kapp->iconLoader()->loadIcon(m_icon, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
if (iconTest.isNull())
m_icon = "basket";
@@ -942,7 +948,7 @@ void Basket::setDisposition(int disposition, int columnCount)
// Insert each new columns:
for (int i = m_columnsCount; i < columnCount; ++i) {
Note *newColumn = new Note(this);
- insertNote(newColumn, /*clicked=*/lastNote(), /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+ insertNote(newColumn, /*clicked=*/lastNote(), /*zone=*/Note::BottomInsert, TQPoint(), /*animateNewPosition=*/false);
}
} else if (firstNote() && columnCount < m_columnsCount) {
Note *column = firstNote();
@@ -972,16 +978,16 @@ void Basket::setDisposition(int disposition, int columnCount)
}
// Paste the content in the last column:
if (cuttedNotes)
- insertNote(cuttedNotes, /*clicked=*/lastNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
+ insertNote(cuttedNotes, /*clicked=*/lastNote(), /*zone=*/Note::BottomColumn, TQPoint(), /*animateNewPosition=*/true);
unselectAll();
}
if (columnCount != m_columnsCount) {
m_columnsCount = (columnCount <= 0 ? 1 : columnCount);
- equalizeColumnSizes(); // Will relayoutNotes()
+ equalizeColumnSizes(); // Will retqlayoutNotes()
}
} else if (currentDisposition == COLUMNS_LAYOUT && (disposition == FREE_LAYOUT || disposition == MINDMAPS_LAYOUT)) {
Note *column = firstNote();
- m_columnsCount = 0; // Now, so relayoutNotes() will not relayout the free notes as if they were columns!
+ m_columnsCount = 0; // Now, so retqlayoutNotes() will not retqlayout the free notes as if they were columns!
while (column) {
// Move all childs on the first level:
Note *nextColumn = column->next();
@@ -990,7 +996,7 @@ void Basket::setDisposition(int disposition, int columnCount)
}
unselectAll();
m_mindMap = (disposition == MINDMAPS_LAYOUT);
- relayoutNotes(true);
+ retqlayoutNotes(true);
} else if ((currentDisposition == FREE_LAYOUT || currentDisposition == MINDMAPS_LAYOUT) && disposition == COLUMNS_LAYOUT) {
if (firstNote()) {
// TODO: Reorder notes!
@@ -1004,13 +1010,13 @@ void Basket::setDisposition(int disposition, int columnCount)
for (int i = 0; i < columnCount; ++i) {
Note *column = new Note(this);
if (lastInsertedColumn)
- insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+ insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, TQPoint(), /*animateNewPosition=*/false);
else
m_firstNote = column;
lastInsertedColumn = column;
}
// Reinsert the old notes in the first column:
- insertNote(notes, /*clicked=*/firstNote(), /*zone=*/Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
+ insertNote(notes, /*clicked=*/firstNote(), /*zone=*/Note::BottomColumn, TQPoint(), /*animateNewPosition=*/true);
unselectAll();
} else {
// Insert the number of columns that is needed:
@@ -1018,14 +1024,14 @@ void Basket::setDisposition(int disposition, int columnCount)
for (int i = 0; i < columnCount; ++i) {
Note *column = new Note(this);
if (lastInsertedColumn)
- insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
+ insertNote(column, /*clicked=*/lastInsertedColumn, /*zone=*/Note::BottomInsert, TQPoint(), /*animateNewPosition=*/false);
else
m_firstNote = column;
lastInsertedColumn = column;
}
}
m_columnsCount = (columnCount <= 0 ? 1 : columnCount);
- equalizeColumnSizes(); // Will relayoutNotes()
+ equalizeColumnSizes(); // Will retqlayoutNotes()
}
}
@@ -1035,7 +1041,7 @@ void Basket::equalizeColumnSizes()
return;
// Necessary to know the available space;
- relayoutNotes(true);
+ retqlayoutNotes(true);
int availableSpace = visibleWidth();
int columnWidth = (visibleWidth() - (columnsCount()-1)*Note::GROUP_WIDTH) / columnsCount();
@@ -1061,15 +1067,15 @@ void Basket::equalizeColumnSizes()
column = column->next();
}
- relayoutNotes(true);
+ retqlayoutNotes(true);
}
void Basket::enableActions()
{
Global::bnpView->enableActions();
- setFocusPolicy(isLocked() ? QWidget::NoFocus : QWidget::StrongFocus);
+ setFocusPolicy(isLocked() ? TQ_NoFocus : TQ_StrongFocus);
if (isLocked())
- viewport()->setCursor(Qt::ArrowCursor); // When locking, the cursor stays the last form it was
+ viewport()->setCursor(TQt::ArrowCursor); // When locking, the cursor stays the last form it was
}
bool Basket::save()
@@ -1080,17 +1086,17 @@ bool Basket::save()
DEBUG_WIN << "Basket[" + folderName() + "]: Saving...";
// Create Document:
- QDomDocument document(/*doctype=*/"basket");
- QDomElement root = document.createElement("basket");
+ TQDomDocument document(/*doctype=*/"basket");
+ TQDomElement root = document.createElement("basket");
document.appendChild(root);
// Create Properties Element and Populate It:
- QDomElement properties = document.createElement("properties");
+ TQDomElement properties = document.createElement("properties");
saveProperties(document, properties);
root.appendChild(properties);
// Create Notes Element and Populate It:
- QDomElement notes = document.createElement("notes");
+ TQDomElement notes = document.createElement("notes");
saveNotes(document, notes, 0);
root.appendChild(notes);
@@ -1101,7 +1107,7 @@ bool Basket::save()
return false;
}
- Global::bnpView->setUnsavedStatus(false);
+ Global::bnpView->setUnsavedtqStatus(false);
return true;
}
@@ -1111,11 +1117,11 @@ void Basket::aboutToBeActivated()
FOR_EACH_NOTE (note)
note->finishLazyLoad();
- //relayoutNotes(/*animate=*/false);
+ //retqlayoutNotes(/*animate=*/false);
setFocusedNote(0); // So that during the focusInEvent that will come shortly, the FIRST note is focused.
if (Settings::playAnimations() && !decoration()->filterBar()->filterData().isFiltering && Global::bnpView->currentBasket() == this) // No animation when filtering all!
- animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
+ animateLoad();//TQTimer::singleShot( 0, this, TQT_SLOT(animateLoad()) );
m_finishLoadOnFirstShow = false;
}
@@ -1131,13 +1137,13 @@ void Basket::load()
// StopWatch::start(10);
DEBUG_WIN << "Basket[" + folderName() + "]: Loading...";
- QDomDocument *doc = 0;
- QString content;
+ TQDomDocument *doc = 0;
+ TQString content;
// StopWatch::start(0);
if (loadFromFile(fullPath() + ".basket", &content)) {
- doc = new QDomDocument("basket");
+ doc = new TQDomDocument("basket");
if ( ! doc->setContent(content) ) {
DEBUG_WIN << "Basket[" + folderName() + "]: <font color=red>FAILED to parse XML</font>!";
delete doc;
@@ -1156,8 +1162,8 @@ void Basket::load()
}
m_locked = false;
- QDomElement docElem = doc->documentElement();
- QDomElement properties = XMLWork::getElement(docElem, "properties");
+ TQDomElement docElem = doc->documentElement();
+ TQDomElement properties = XMLWork::getElement(docElem, "properties");
loadProperties(properties); // Since we are loading, this time the background image will also be loaded!
// Now that the background image is loaded and subscribed, we display it during the load process:
@@ -1166,7 +1172,7 @@ void Basket::load()
// kapp->processEvents();
//BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
- QDomElement notes = XMLWork::getElement(docElem, "notes");
+ TQDomElement notes = XMLWork::getElement(docElem, "notes");
if (notes.isNull())
notes = XMLWork::getElement(docElem, "items");
m_watcher->stopScan();
@@ -1199,7 +1205,7 @@ void Basket::load()
m_columnsCount = columnsCount;
}
- relayoutNotes(false);
+ retqlayoutNotes(false);
// On application start, the current basket is not focused yet, so the focus rectangle is not shown when calling focusANote():
if (Global::bnpView->currentBasket() == this)
@@ -1207,7 +1213,7 @@ void Basket::load()
focusANote();
if (Settings::playAnimations() && !decoration()->filterBar()->filterData().isFiltering && Global::bnpView->currentBasket() == this) // No animation when filtering all!
- animateLoad();//QTimer::singleShot( 0, this, SLOT(animateLoad()) );
+ animateLoad();//TQTimer::singleShot( 0, this, TQT_SLOT(animateLoad()) );
else
m_loaded = true;
enableActions();
@@ -1223,7 +1229,7 @@ void Basket::filterAgain(bool andEnsureVisible/* = true*/)
void Basket::filterAgainDelayed()
{
- QTimer::singleShot( 0, this, SLOT(filterAgain()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(filterAgain()) );
}
void Basket::newFilter(const FilterData &data, bool andEnsureVisible/* = true*/)
@@ -1237,7 +1243,7 @@ void Basket::newFilter(const FilterData &data, bool andEnsureVisible/* = true*/)
for (Note *note = firstNote(); note; note = note->next())
m_countFounds += note->newFilter(data);
- relayoutNotes(true);
+ retqlayoutNotes(true);
signalCountsChanged();
if (hasFocus()) // if (!hasFocus()), focusANote() will be called at focusInEvent()
@@ -1271,17 +1277,17 @@ bool Basket::isFiltering()
-QString Basket::fullPath()
+TQString Basket::fullPath()
{
return Global::basketsFolder() + folderName();
}
-QString Basket::fullPathForFileName(const QString &fileName)
+TQString Basket::fullPathForFileName(const TQString &fileName)
{
return fullPath() + fileName;
}
-/*static*/ QString Basket::fullPathForFolderName(const QString &folderName)
+/*static*/ TQString Basket::fullPathForFolderName(const TQString &folderName)
{
return Global::basketsFolder() + folderName;
}
@@ -1291,7 +1297,7 @@ void Basket::setShortcut(KShortcut shortcut, int action)
{
if(!Global::globalAccel)
return;
- QString sAction = "global_basket_activate_" + folderName();
+ TQString sAction = "global_basket_activate_" + folderName();
Global::globalAccel->remove(sAction);
Global::globalAccel->updateConnections();
@@ -1299,7 +1305,7 @@ void Basket::setShortcut(KShortcut shortcut, int action)
m_shortcutAction = action;
if (action > 0)
- Global::globalAccel->insert(sAction, m_action->text(), /*whatsThis=*/"", m_action->shortcut(), KShortcut(), this, SLOT(activatedShortcut()), /*configurable=*/false);
+ Global::globalAccel->insert(sAction, m_action->text(), /*whatsThis=*/"", m_action->shortcut(), KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(activatedShortcut()), /*configurable=*/false);
Global::globalAccel->updateConnections();
}
@@ -1323,9 +1329,9 @@ void Basket::countsChangedTimeOut()
}
-Basket::Basket(QWidget *parent, const QString &folderName)
- : QScrollView(parent),
- QToolTip(viewport()),
+Basket::Basket(TQWidget *tqparent, const TQString &folderName)
+ : TQScrollView(tqparent),
+ TQToolTip(viewport()),
m_noActionOnMouseRelease(false), m_ignoreCloseEditorOnNextMouseRelease(false), m_pressPos(-100, -100), m_canDrag(false),
m_firstNote(0), m_columnsCount(1), m_mindMap(false), m_resizingNote(0L), m_pickedResizer(0), m_movingNote(0L), m_pickedHandle(0, 0),
m_clickedToInsert(0), m_zoneToInsert(0), m_posToInsert(-1, -1),
@@ -1345,22 +1351,22 @@ Basket::Basket(QWidget *parent, const QString &folderName)
m_doNotCloseEditor(false), m_editParagraph(0), m_editIndex(0),
m_isDuringDrag(false), m_draggedNotes(),
m_focusedNote(0), m_startOfShiftSelectionNote(0),
- m_finishLoadOnFirstShow(false), m_relayoutOnNextShow(false)
+ m_finishLoadOnFirstShow(false), m_retqlayoutOnNextShow(false)
{
- QString sAction = "local_basket_activate_" + folderName;
- m_action = new KAction("FAKE TEXT", "FAKE ICON", KShortcut(), this, SLOT(activatedShortcut()), Global::bnpView->actionCollection(), sAction);
+ TQString sAction = "local_basket_activate_" + folderName;
+ m_action = new KAction("FAKE TEXT", "FAKE ICON", KShortcut(), TQT_TQOBJECT(this), TQT_SLOT(activatedShortcut()), Global::bnpView->actionCollection(), sAction);
m_action->setShortcutConfigurable(false); // We do it in the basket properties dialog (and keep it in sync with the global one)
if (!m_folderName.endsWith("/"))
m_folderName += "/";
- setFocusPolicy(QWidget::StrongFocus);
- setWFlags(Qt::WNoAutoErase);
+ setFocusPolicy(TQ_StrongFocus);
+ setWFlags(TQt::WNoAutoErase);
setDragAutoScroll(true);
// By default, there is no corner widget: we set one for the corner area to be painted!
// If we don't set one and there are two scrollbars present, slowly resizing up the window show graphical glitches in that area!
- m_cornerWidget = new QWidget(this);
+ m_cornerWidget = new TQWidget(this);
setCornerWidget(m_cornerWidget);
viewport()->setAcceptDrops(true);
@@ -1368,18 +1374,18 @@ Basket::Basket(QWidget *parent, const QString &folderName)
viewport()->setBackgroundMode(NoBackground); // Do not clear the widget before paintEvent() because we always draw every pixels (faster and flicker-free)
// File Watcher:
- m_watcher = new KDirWatch(this);
- connect( m_watcher, SIGNAL(dirty(const QString&)), this, SLOT(watchedFileModified(const QString&)) );
- connect( m_watcher, SIGNAL(deleted(const QString&)), this, SLOT(watchedFileDeleted(const QString&)) );
- connect( &m_watcherTimer, SIGNAL(timeout()), this, SLOT(updateModifiedNotes()) );
+ m_watcher = new KDirWatch(TQT_TQOBJECT(this));
+ connect( m_watcher, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(watchedFileModified(const TQString&)) );
+ connect( m_watcher, TQT_SIGNAL(deleted(const TQString&)), this, TQT_SLOT(watchedFileDeleted(const TQString&)) );
+ connect( &m_watcherTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateModifiedNotes()) );
// Various Connections:
- connect( &m_animationTimer, SIGNAL(timeout()), this, SLOT(animateObjects()) );
- connect( &m_autoScrollSelectionTimer, SIGNAL(timeout()), this, SLOT(doAutoScrollSelection()) );
- connect( &m_timerCountsChanged, SIGNAL(timeout()), this, SLOT(countsChangedTimeOut()) );
- connect( &m_inactivityAutoSaveTimer, SIGNAL(timeout()), this, SLOT(inactivityAutoSaveTimeout()) );
- connect( &m_inactivityAutoLockTimer, SIGNAL(timeout()), this, SLOT(inactivityAutoLockTimeout()) );
- connect( this, SIGNAL(contentsMoving(int, int)), this, SLOT(contentsMoved()) );
+ connect( &m_animationTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(animateObjects()) );
+ connect( &m_autoScrollSelectionTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doAutoScrollSelection()) );
+ connect( &m_timerCountsChanged, TQT_SIGNAL(timeout()), this, TQT_SLOT(countsChangedTimeOut()) );
+ connect( &m_inactivityAutoSaveTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(inactivityAutoSaveTimeout()) );
+ connect( &m_inactivityAutoLockTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(inactivityAutoLockTimeout()) );
+ connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(contentsMoved()) );
#ifdef HAVE_LIBGPGME
m_gpg = new KGpgMe();
#endif
@@ -1389,16 +1395,16 @@ Basket::Basket(QWidget *parent, const QString &folderName)
void Basket::contentsMoved()
{
// This slot is called BEFORE the content move, so we delay the hover effects:
- QTimer::singleShot(0, this, SLOT(doHoverEffects()));
+ TQTimer::singleShot(0, this, TQT_SLOT(doHoverEffects()));
}
-void Basket::enterEvent(QEvent *)
+void Basket::enterEvent(TQEvent *)
{
m_underMouse = true;
doHoverEffects();
}
-void Basket::leaveEvent(QEvent *)
+void Basket::leaveEvent(TQEvent *)
{
m_underMouse = false;
doHoverEffects();
@@ -1417,29 +1423,32 @@ void Basket::leaveEvent(QEvent *)
void Basket::setFocusIfNotInPopupMenu()
{
- if (!kapp->activePopupWidget())
- if (isDuringEdit())
+ if (!kapp->activePopupWidget()) {
+ if (isDuringEdit()) {
m_editor->widget()->setFocus();
- else
+ }
+ else {
setFocus();
+ }
+ }
}
-void Basket::contentsMousePressEvent(QMouseEvent *event)
+void Basket::contentsMousePressEvent(TQMouseEvent *event)
{
// If user click the basket, focus it!
// The focus is delayed because if the click results in showing a popup menu,
// the interface flicker by showing the focused rectangle (as the basket gets focus)
// and immediatly removing it (because the popup menu now have focus).
if (!isDuringEdit())
- QTimer::singleShot(0, this, SLOT(setFocusIfNotInPopupMenu()));
+ TQTimer::singleShot(0, this, TQT_SLOT(setFocusIfNotInPopupMenu()));
// Convenient variables:
- bool controlPressed = event->stateAfter() & Qt::ControlButton;
- bool shiftPressed = event->stateAfter() & Qt::ShiftButton;
+ bool controlPressed = event->stateAfter() & TQt::ControlButton;
+ bool shiftPressed = event->stateAfter() & TQt::ShiftButton;
// Do nothing if we disabled the click some milliseconds sooner.
// For instance when a popup menu has been closed with click, we should not do action:
- if (event->button() == Qt::LeftButton && (kapp->activePopupWidget() || m_lastDisableClick.msecsTo(QTime::currentTime()) <= 80)) {
+ if (event->button() == Qt::LeftButton && (kapp->activePopupWidget() || m_lastDisableClick.msecsTo(TQTime::currentTime()) <= 80)) {
doHoverEffects();
m_noActionOnMouseRelease = true;
// But we allow to select:
@@ -1454,7 +1463,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
// Figure out what is the clicked note and zone:
Note *clicked = noteAt(event->pos().x(), event->pos().y());
- Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()) ) : Note::None);
+ Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()) ) : Note::None);
// Popup Tags menu:
if (zone == Note::TagsArrow && !controlPressed && !shiftPressed && event->button() != Qt::MidButton) {
@@ -1477,7 +1486,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
m_canDrag = true;
// Saving where we were editing, because during a drag, the mouse can fly over the text edit and move the cursor position:
if (m_editor && m_editor->textEdit()) {
- QTextEdit *editor = m_editor->textEdit();
+ TQTextEdit *editor = m_editor->textEdit();
editor->getCursorPosition(&m_editParagraph, &m_editIndex);
}
}
@@ -1496,7 +1505,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
if (zone == Note::Handle || zone == Note::Group || (zone == Note::GroupExpander && (controlPressed || shiftPressed))) {
Note *end = clicked;
if (clicked->isGroup() && shiftPressed) {
- if (clicked->contains(m_startOfShiftSelectionNote)) {
+ if (clicked->tqcontains(m_startOfShiftSelectionNote)) {
m_startOfShiftSelectionNote = clicked->firstRealChild();
end = clicked->lastRealChild();
} else if (clicked->firstRealChild()->isAfter(m_startOfShiftSelectionNote))
@@ -1535,7 +1544,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
// Initializing Note move:
/* if ((zone == Note::Group || zone == Note::Handle) && clicked->isFree()) {
m_movingNote = clicked;
- m_pickedHandle = QPoint(event->pos().x() - clicked->x(), event->pos().y() - clicked->y());
+ m_pickedHandle = TQPoint(event->pos().x() - clicked->x(), event->pos().y() - clicked->y());
m_noActionOnMouseRelease = true;
m_lockedHovering = true;
return;
@@ -1545,7 +1554,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
// Folding/Unfolding group:
if (zone == Note::GroupExpander) {
clicked->toggleFolded(Settings::playAnimations());
- relayoutNotes(true);
+ retqlayoutNotes(true);
m_noActionOnMouseRelease = true;
return;
}
@@ -1575,13 +1584,13 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
menu->removeItem(/*id=*/120);
menu->insertTitle((zone == Note::TopGroup || zone == Note::BottomGroup ? i18n("The verb (Group New Note)", "Group") : i18n("The verb (Insert New Note)", "Insert")), /*id=*/120, /*index=*/0);
setInsertPopupMenu();
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(delayedCancelInsertPopupMenu()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(hideInsertPopupMenu()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(delayedCancelInsertPopupMenu()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(hideInsertPopupMenu()) );
doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
m_lockedHovering = true;
- menu->exec(QCursor::pos());
+ menu->exec(TQCursor::pos());
m_noActionOnMouseRelease = true;
return;
}
@@ -1596,19 +1605,19 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
clicked->setSelected(true);
}
m_startOfShiftSelectionNote = (clicked->isGroup() ? clicked->firstRealChild() : clicked);
- QPopupMenu* menu = Global::bnpView->popupMenu("note_popup");
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
+ TQPopupMenu* menu = Global::bnpView->popupMenu("note_popup");
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
doHoverEffects(clicked, zone); // In the case where another popup menu was open, we should do that manually!
m_lockedHovering = true;
- menu->exec(QCursor::pos());
+ menu->exec(TQCursor::pos());
m_noActionOnMouseRelease = true;
return;
}
// Paste selection under cursor (but not "create new primary note under cursor" because this is on moveRelease):
if (event->button() == Qt::MidButton && zone != Note::Resizer && (!isDuringEdit() || clicked != editedNote())) {
- if ((Settings::middleAction() != 0) && (event->state() == Qt::ShiftButton)) {
+ if ((Settings::middleAction() != 0) && (event->state() == TQt::ShiftButton)) {
m_clickedToInsert = clicked;
m_zoneToInsert = zone;
m_posToInsert = event->pos();
@@ -1649,7 +1658,7 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
}
} else {
if (clicked)
- zone = clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()), true );
+ zone = clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()), true );
closeEditor();
clickedToInsert(event, clicked, zone);
save();
@@ -1678,19 +1687,19 @@ void Basket::contentsMousePressEvent(QMouseEvent *event)
void Basket::delayedCancelInsertPopupMenu()
{
- QTimer::singleShot( 0, this, SLOT(cancelInsertPopupMenu()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(cancelInsertPopupMenu()) );
}
-void Basket::contentsContextMenuEvent(QContextMenuEvent *event)
+void Basket::contentsContextMenuEvent(TQContextMenuEvent *event)
{
- if (event->reason() == QContextMenuEvent::Keyboard) {
+ if (event->reason() == TQContextMenuEvent::Keyboard) {
if (countFounds/*countShown*/() == 0) { // TODO: Count shown!!
- QRect basketRect( mapToGlobal(QPoint(0,0)), size() );
- QPopupMenu *menu = Global::bnpView->popupMenu("insert_popup");
+ TQRect basketRect( mapToGlobal(TQPoint(0,0)), size() );
+ TQPopupMenu *menu = Global::bnpView->popupMenu("insert_popup");
setInsertPopupMenu();
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(delayedCancelInsertPopupMenu()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(delayedCancelInsertPopupMenu()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
removeInserter();
m_lockedHovering = true;
PopupMenu::execAtRectCenter(*menu, basketRect); // Popup at center or the basket
@@ -1700,9 +1709,9 @@ void Basket::contentsContextMenuEvent(QContextMenuEvent *event)
setFocusedNote(m_focusedNote); /// /// ///
m_startOfShiftSelectionNote = (m_focusedNote->isGroup() ? m_focusedNote->firstRealChild() : m_focusedNote);
// Popup at bottom (or top) of the focused note, if visible :
- QPopupMenu *menu = Global::bnpView->popupMenu("note_popup");
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
+ TQPopupMenu *menu = Global::bnpView->popupMenu("note_popup");
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+ connect( menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
doHoverEffects(m_focusedNote, Note::Content); // In the case where another popup menu was open, we should do that manually!
m_lockedHovering = true;
PopupMenu::execAtRectBottom(*menu, noteVisibleRect(m_focusedNote), true);
@@ -1710,11 +1719,11 @@ void Basket::contentsContextMenuEvent(QContextMenuEvent *event)
}
}
-QRect Basket::noteVisibleRect(Note *note)
+TQRect Basket::noteVisibleRect(Note *note)
{
- QRect rect( contentsToViewport(QPoint(note->x(), note->y())), QSize(note->width(),note->height()) );
- QPoint basketPoint = mapToGlobal(QPoint(0,0));
- rect.moveTopLeft( rect.topLeft() + basketPoint + QPoint(frameWidth(), frameWidth()) );
+ TQRect rect( contentsToViewport(TQPoint(note->x(), note->y())), TQSize(note->width(),note->height()) );
+ TQPoint basketPoint = mapToGlobal(TQPoint(0,0));
+ rect.moveTopLeft( rect.topLeft() + basketPoint + TQPoint(frameWidth(), frameWidth()) );
// Now, rect contain the global note rectangle on the screen.
// We have to clip it by the basket widget :
@@ -1744,7 +1753,7 @@ QRect Basket::noteVisibleRect(Note *note)
void Basket::disableNextClick()
{
- m_lastDisableClick = QTime::currentTime();
+ m_lastDisableClick = TQTime::currentTime();
}
void Basket::recomputeAllStyles()
@@ -1753,7 +1762,7 @@ void Basket::recomputeAllStyles()
note->recomputeAllStyles();
}
-void Basket::removedStates(const QValueList<State*> &deletedStates)
+void Basket::removedStates(const TQValueList<State*> &deletedStates)
{
bool modifiedBasket = false;
@@ -1765,7 +1774,7 @@ void Basket::removedStates(const QValueList<State*> &deletedStates)
save();
}
-void Basket::insertNote(Note *note, Note *clicked, int zone, const QPoint &pos, bool animateNewPosition)
+void Basket::insertNote(Note *note, Note *clicked, int zone, const TQPoint &pos, bool animateNewPosition)
{
if (!note) {
std::cout << "Wanted to insert NO note" << std::endl;
@@ -1838,14 +1847,14 @@ void Basket::insertNote(Note *note, Note *clicked, int zone, const QPoint &pos,
appendNoteAfter(note, lastNote());
}
- relayoutNotes(true);
+ retqlayoutNotes(true);
}
-void Basket::clickedToInsert(QMouseEvent *event, Note *clicked, /*Note::Zone*/int zone)
+void Basket::clickedToInsert(TQMouseEvent *event, Note *clicked, /*Note::Zone*/int zone)
{
Note *note;
if (event->button() == Qt::MidButton)
- note = NoteFactory::dropNote(KApplication::clipboard()->data(QClipboard::Selection), this);
+ note = NoteFactory::dropNote(KApplication::tqclipboard()->data(TQClipboard::Selection), this);
else
note = NoteFactory::createNoteText("", this);
@@ -1863,7 +1872,7 @@ void Basket::clickedToInsert(QMouseEvent *event, Note *clicked, /*Note::Zone*/in
}
}
-void Basket::contentsDragEnterEvent(QDragEnterEvent *event)
+void Basket::contentsDragEnterEvent(TQDragEnterEvent *event)
{
m_isDuringDrag = true;
Global::bnpView->updateStatusBarHint();
@@ -1871,7 +1880,7 @@ void Basket::contentsDragEnterEvent(QDragEnterEvent *event)
m_draggedNotes = NoteDrag::notesOf(event);
}
-void Basket::contentsDragMoveEvent(QDragMoveEvent *event)
+void Basket::contentsDragMoveEvent(TQDragMoveEvent *event)
{
// m_isDuringDrag = true;
@@ -1879,8 +1888,8 @@ void Basket::contentsDragMoveEvent(QDragMoveEvent *event)
// return;
// FIXME: viewportToContents does NOT work !!!
-// QPoint pos = viewportToContents(event->pos());
-// QPoint pos( event->pos().x() + contentsX(), event->pos().y() + contentsY() );
+// TQPoint pos = viewportToContents(event->pos());
+// TQPoint pos( event->pos().x() + contentsX(), event->pos().y() + contentsY() );
// if (insertAtCursorPos())
// computeInsertPlace(pos);
@@ -1895,18 +1904,18 @@ void Basket::contentsDragMoveEvent(QDragMoveEvent *event)
}
/* Note *hoveredNote = noteAt(event->pos().x(), event->pos().y());
- if ( (isColumnsLayout() && !hoveredNote) || (draggedNotes().contains(hoveredNote)) ) {
+ if ( (isColumnsLayout() && !hoveredNote) || (draggedNotes().tqcontains(hoveredNote)) ) {
event->acceptAction(false);
event->accept(false);
} else
acceptDropEvent(event);*/
- // A workarround since QScrollView::dragAutoScroll seem to have no effect :
+ // A workarround since TQScrollView::dragAutoScroll seem to have no effect :
// ensureVisible(event->pos().x() + contentsX(), event->pos().y() + contentsY(), 30, 30);
-// QScrollView::dragMoveEvent(event);
+// TQScrollView::dragMoveEvent(event);
}
-void Basket::contentsDragLeaveEvent(QDragLeaveEvent*)
+void Basket::contentsDragLeaveEvent(TQDragLeaveEvent*)
{
// resetInsertTo();
m_isDuringDrag = false;
@@ -1916,9 +1925,9 @@ void Basket::contentsDragLeaveEvent(QDragLeaveEvent*)
doHoverEffects();
}
-void Basket::contentsDropEvent(QDropEvent *event)
+void Basket::contentsDropEvent(TQDropEvent *event)
{
- QPoint pos = event->pos();
+ TQPoint pos = event->pos();
std::cout << "Contents Drop Event at position " << pos.x() << ":" << pos.y() << std::endl;
m_isDuringDrag = false;
@@ -1929,19 +1938,19 @@ void Basket::contentsDropEvent(QDropEvent *event)
// Do NOT check the bottom&right borders.
// Because imagine someone drag&drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
- // the note is first removed, and relayoutNotes() compute the new height that is smaller
+ // the note is first removed, and retqlayoutNotes() compute the new height that is smaller
// Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
// Should, of course, not return 0:
Note *clicked = noteAt(event->pos().x(), event->pos().y());
- if (NoteFactory::movingNotesInTheSameBasket(event, this, event->action()) && event->action() == QDropEvent::Move) {
+ if (NoteFactory::movingNotesInTheSameBasket(event, this, event->action()) && event->action() == TQDropEvent::Move) {
m_doNotCloseEditor = true;
}
Note *note = NoteFactory::dropNote( event, this, true, event->action(), dynamic_cast<Note*>(event->source()) );
if (note) {
- Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()), /*toAdd=*/true ) : Note::None);
+ Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()), /*toAdd=*/true ) : Note::None);
bool animateNewPosition = NoteFactory::movingNotesInTheSameBasket(event, this, event->action());
if (animateNewPosition) {
FOR_EACH_NOTE (n)
@@ -1972,14 +1981,14 @@ void Basket::contentsDropEvent(QDropEvent *event)
// This is because during a drag, the mouse can fly over the text edit and move the cursor position, and even HIDE the cursor.
// So we re-show the cursor, and re-position it at the right place:
if (m_editor && m_editor->textEdit()) {
- QTextEdit *editor = m_editor->textEdit();
+ TQTextEdit *editor = m_editor->textEdit();
editor->setCursorPosition(m_editParagraph, m_editIndex);
}
}
// handles dropping of a note to basket that is not shown
// (usually through its entry in the basket list)
-void Basket::blindDrop(QDropEvent* event)
+void Basket::blindDrop(TQDropEvent* event)
{
if (!m_isInsertPopupMenu && redirectEditActions()) {
if (m_editor->textEdit())
@@ -2034,7 +2043,7 @@ void Basket::insertWizard(int type)
resetInsertionData();
}
-void Basket::insertColor(const QColor &color)
+void Basket::insertColor(const TQColor &color)
{
Note *note = NoteFactory::createNoteColor(color, this);
restoreInsertionData();
@@ -2043,7 +2052,7 @@ void Basket::insertColor(const QColor &color)
resetInsertionData();
}
-void Basket::insertImage(const QPixmap &image)
+void Basket::insertImage(const TQPixmap &image)
{
Note *note = NoteFactory::createNoteImage(image, this);
restoreInsertionData();
@@ -2052,7 +2061,7 @@ void Basket::insertImage(const QPixmap &image)
resetInsertionData();
}
-void Basket::pasteNote(QClipboard::Mode mode)
+void Basket::pasteNote(TQClipboard::Mode mode)
{
if (!m_isInsertPopupMenu && redirectEditActions()) {
if (m_editor->textEdit())
@@ -2066,7 +2075,7 @@ void Basket::pasteNote(QClipboard::Mode mode)
}
closeEditor();
unselectAll();
- Note *note = NoteFactory::dropNote(KApplication::clipboard()->data(mode), this);
+ Note *note = NoteFactory::dropNote(KApplication::tqclipboard()->data(mode), this);
if (note) {
insertCreatedNote(note);
//unselectAllBut(note);
@@ -2079,7 +2088,7 @@ void Basket::insertCreatedNote(Note *note)
// Get the insertion data if the user clicked inside the basket:
Note *clicked = m_clickedToInsert;
int zone = m_zoneToInsert;
- QPoint pos = m_posToInsert;
+ TQPoint pos = m_posToInsert;
// If it isn't the case, use the default position:
if (!clicked && (pos.x() < 0 || pos.y() < 0)) {
@@ -2088,7 +2097,7 @@ void Basket::insertCreatedNote(Note *note)
if (m_focusedNote) {
clicked = m_focusedNote;
zone = (m_focusedNote->isFree() ? Note::BottomGroup : Note::BottomInsert);
- pos = QPoint(m_focusedNote->x(), m_focusedNote->finalBottom());
+ pos = TQPoint(m_focusedNote->x(), m_focusedNote->finalBottom());
// Insert at the end of the last column:
} else if (isColumnsLayout()) {
Note *column = /*(Settings::newNotesPlace == 0 ?*/ firstNote() /*: lastNote())*/;
@@ -2101,7 +2110,7 @@ void Basket::insertCreatedNote(Note *note)
/*}*/
// Insert at free position:
} else {
- pos = QPoint(0, 0);
+ pos = TQPoint(0, 0);
}
}
@@ -2130,12 +2139,12 @@ void Basket::resetInsertionData()
{
m_clickedToInsert = 0;
m_zoneToInsert = 0;
- m_posToInsert = QPoint(-1, -1);
+ m_posToInsert = TQPoint(-1, -1);
}
void Basket::hideInsertPopupMenu()
{
- QTimer::singleShot( 50/*ms*/, this, SLOT(timeoutHideInsertPopupMenu()) );
+ TQTimer::singleShot( 50/*ms*/, this, TQT_SLOT(timeoutHideInsertPopupMenu()) );
}
void Basket::timeoutHideInsertPopupMenu()
@@ -2143,14 +2152,14 @@ void Basket::timeoutHideInsertPopupMenu()
resetInsertionData();
}
-void Basket::acceptDropEvent(QDropEvent *event, bool preCond)
+void Basket::acceptDropEvent(TQDropEvent *event, bool preCond)
{
// FIXME: Should not accept all actions! Or not all actions (link not supported?!)
event->acceptAction(preCond && 1);
event->accept(preCond);
}
-void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
+void Basket::contentsMouseReleaseEvent(TQMouseEvent *event)
{
// Now disallow drag:
m_canDrag = false;
@@ -2167,7 +2176,7 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
// Cancel Note move:
/* if (m_movingNote) {
m_movingNote = 0;
- m_pickedHandle = QPoint(0, 0);
+ m_pickedHandle = TQPoint(0, 0);
m_lockedHovering = false;
//doHoverEffects();
save();
@@ -2185,7 +2194,7 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
m_selectionStarted = false;
Note *clicked = noteAt(event->pos().x(), event->pos().y());
- Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()) ) : Note::None);
+ Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()) ) : Note::None);
if ((zone == Note::Handle || zone == Note::Group) && editedNote() && editedNote() == clicked) {
if (m_ignoreCloseEditorOnNextMouseRelease)
m_ignoreCloseEditorOnNextMouseRelease = false;
@@ -2217,7 +2226,7 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
if (event->button() == Qt::MidButton && zone != Note::Resizer && (!isDuringEdit() || clicked != editedNote())) {
- if ((Settings::middleAction() != 0) && (event->stateAfter() == Qt::ShiftButton)) {
+ if ((Settings::middleAction() != 0) && (event->stateAfter() == TQt::ShiftButton)) {
m_clickedToInsert = clicked;
m_zoneToInsert = zone;
m_posToInsert = event->pos();
@@ -2258,11 +2267,11 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
}
return;
}
-// Note::Zone zone = clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()) );
+// Note::Zone zone = clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()) );
// Convenient variables:
- bool controlPressed = event->stateAfter() & Qt::ControlButton;
- bool shiftPressed = event->stateAfter() & Qt::ShiftButton;
+ bool controlPressed = event->stateAfter() & TQt::ControlButton;
+ bool shiftPressed = event->stateAfter() & TQt::ShiftButton;
if (clicked && zone != Note::None && zone != Note::BottomColumn && zone != Note::Resizer && (controlPressed || shiftPressed)) {
if (controlPressed && shiftPressed)
@@ -2308,12 +2317,12 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
}
// Insert note or past clipboard:
- QString text;
+ TQString text;
// Note *note;
- QString link;
+ TQString link;
//int zone = zone;
if (event->button() == Qt::MidButton && zone == Note::Resizer)
- return; //zone = clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()), true );
+ return; //zone = clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()), true );
if (event->button() == Qt::RightButton && (clicked->isColumn() || zone == Note::Resizer))
return;
if (clicked->isGroup() && zone == Note::None)
@@ -2325,7 +2334,7 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
// But the user can want to drag select_s_ notes, so it the note is selected, we only select it alone on mouseRelease:
if (event->stateAfter() == 0) {
std::cout << "EXEC" << std::endl;
- if ( !(event->stateAfter() & Qt::ControlButton) && clicked->allSelected())
+ if ( !(event->stateAfter() & TQt::ControlButton) && clicked->allSelected())
unselectAllBut(clicked);
if (zone == Note::Handle && isDuringEdit() && editedNote() == clicked) {
closeEditor();
@@ -2345,13 +2354,13 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
break;
case Note::Link:
- link = clicked->linkAt(event->pos() - QPoint(clicked->x(), clicked->y()));
+ link = clicked->linkAt(event->pos() - TQPoint(clicked->x(), clicked->y()));
if ( ! link.isEmpty() ) {
if (link == "basket-internal-remove-basket") {
// TODO: ask confirmation: "Do you really want to delete the welcome baskets?\n You can re-add them at any time in the Help menu."
Global::bnpView->doBasketDeletion(this);
} else if (link == "basket-internal-import") {
- QPopupMenu *menu = Global::bnpView->popupMenu("fileimport");
+ TQPopupMenu *menu = Global::bnpView->popupMenu("fileimport");
menu->exec(event->globalPos());
} else {
KRun *run = new KRun(link); // open the URL.
@@ -2383,10 +2392,10 @@ void Basket::contentsMouseReleaseEvent(QMouseEvent *event)
}
}
-void Basket::contentsMouseDoubleClickEvent(QMouseEvent *event)
+void Basket::contentsMouseDoubleClickEvent(TQMouseEvent *event)
{
Note *clicked = noteAt(event->pos().x(), event->pos().y());
- Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - QPoint(clicked->x(), clicked->y()) ) : Note::None);
+ Note::Zone zone = (clicked ? clicked->zoneAt( event->pos() - TQPoint(clicked->x(), clicked->y()) ) : Note::None);
if (event->button() == Qt::LeftButton && (zone == Note::Group || zone == Note::Handle)) {
doCopy(CopyToSelection);
@@ -2395,7 +2404,7 @@ void Basket::contentsMouseDoubleClickEvent(QMouseEvent *event)
contentsMousePressEvent(event);
}
-void Basket::contentsMouseMoveEvent(QMouseEvent *event)
+void Basket::contentsMouseMoveEvent(TQMouseEvent *event)
{
// Drag the notes:
if (m_canDrag && (m_pressPos - event->pos()).manhattanLength() > KApplication::startDragDistance()) {
@@ -2404,7 +2413,7 @@ void Basket::contentsMouseMoveEvent(QMouseEvent *event)
m_selectionStarted = false;
NoteSelection *selection = selectedNotes();
if (selection->firstStacked()) {
- QDragObject *d = NoteDrag::dragObject(selection, /*cutting=*/false, /*source=*/this); // d will be deleted by QT
+ TQDragObject *d = NoteDrag::dragObject(selection, /*cutting=*/false, /*source=*/this); // d will be deleted by QT
/*bool shouldRemove = */d->drag();
// delete selection;
@@ -2419,7 +2428,7 @@ void Basket::contentsMouseMoveEvent(QMouseEvent *event)
if (m_resizingNote) {
int groupWidth = event->pos().x() - m_resizingNote->x() - m_pickedResizer;
int minRight = m_resizingNote->minRight();
- int maxRight = 100 * contentsWidth(); // A big enough value (+infinity) for free layouts.
+ int maxRight = 100 * contentsWidth(); // A big enough value (+infinity) for free tqlayouts.
Note *nextColumn = m_resizingNote->next();
if (m_resizingNote->isColumn()) {
if (nextColumn)
@@ -2443,7 +2452,7 @@ void Basket::contentsMouseMoveEvent(QMouseEvent *event)
column->setGroupWidth(column->groupWidth() - delta);
}
}
- relayoutNotes(true);
+ retqlayoutNotes(true);
}
// Moving a Note:
@@ -2454,8 +2463,8 @@ void Basket::contentsMouseMoveEvent(QMouseEvent *event)
if (y < 0) y = 0;
m_movingNote->setX(x);
m_movingNote->setY(y);
- m_movingNote->relayoutAt(x, y, / *animate=* /false);
- relayoutNotes(true);
+ m_movingNote->retqlayoutAt(x, y, / *animate=* /false);
+ retqlayoutNotes(true);
}
*/
@@ -2471,7 +2480,7 @@ void Basket::doAutoScrollSelection()
static const int AUTO_SCROLL_MARGIN = 50; // pixels
static const int AUTO_SCROLL_DELAY = 100; // milliseconds
- QPoint pos = viewport()->mapFromGlobal(QCursor::pos());
+ TQPoint pos = viewport()->mapFromGlobal(TQCursor::pos());
// Do the selection:
@@ -2479,13 +2488,13 @@ void Basket::doAutoScrollSelection()
updateContents(m_selectionRect);
m_selectionEndPoint = viewportToContents(pos);
- m_selectionRect = QRect(m_selectionBeginPoint, m_selectionEndPoint).normalize();
+ m_selectionRect = TQRect(m_selectionBeginPoint, m_selectionEndPoint).normalize();
if (m_selectionRect.left() < 0) m_selectionRect.setLeft(0);
if (m_selectionRect.top() < 0) m_selectionRect.setTop(0);
if (m_selectionRect.right() >= contentsWidth()) m_selectionRect.setRight(contentsWidth() - 1);
if (m_selectionRect.bottom() >= contentsHeight()) m_selectionRect.setBottom(contentsHeight() - 1);
- if ( (m_selectionBeginPoint - m_selectionEndPoint).manhattanLength() > QApplication::startDragDistance() ) {
+ if ( (m_selectionBeginPoint - m_selectionEndPoint).manhattanLength() > TQApplication::startDragDistance() ) {
m_isSelecting = true;
selectNotesIn(m_selectionRect, m_selectionInvert);
updateContents(m_selectionRect);
@@ -2494,7 +2503,7 @@ void Basket::doAutoScrollSelection()
// If the user was selecting but cancel by making the rectangle too small, cancel it really!!!
if (m_isSelecting) {
if (m_selectionInvert)
- selectNotesIn(QRect(), m_selectionInvert);
+ selectNotesIn(TQRect(), m_selectionInvert);
else
unselectAllBut(0); // TODO: unselectAll();
}
@@ -2508,7 +2517,7 @@ void Basket::doAutoScrollSelection()
// Do the auto-scrolling:
// FIXME: It's still flickering
- QRect insideRect(AUTO_SCROLL_MARGIN, AUTO_SCROLL_MARGIN, visibleWidth() - 2*AUTO_SCROLL_MARGIN, visibleHeight() - 2*AUTO_SCROLL_MARGIN);
+ TQRect insideRect(AUTO_SCROLL_MARGIN, AUTO_SCROLL_MARGIN, visibleWidth() - 2*AUTO_SCROLL_MARGIN, visibleHeight() - 2*AUTO_SCROLL_MARGIN);
int dx = 0;
int dy = 0;
@@ -2524,7 +2533,7 @@ void Basket::doAutoScrollSelection()
dx = pos.x() - visibleWidth() + AUTO_SCROLL_MARGIN;
if (dx || dy) {
- kapp->sendPostedEvents(); // Do the repaints, because the scrolling will make the area to repaint to be wrong
+ kapp->sendPostedEvents(); // Do the tqrepaints, because the scrolling will make the area to tqrepaint to be wrong
scrollBy(dx, dy);
if (!m_autoScrollSelectionTimer.isActive())
m_autoScrollSelectionTimer.start(AUTO_SCROLL_DELAY);
@@ -2554,16 +2563,16 @@ void Basket::selectAll()
else if (m_editor->lineEdit())
m_editor->lineEdit()->selectAll();
} else {
- // First select all in the group, then in the parent group...
+ // First select all in the group, then in the tqparent group...
Note *child = m_focusedNote;
- Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : 0);
- while (parent) {
- if (!parent->allSelected()) {
- parent->setSelectedRecursivly(true);
+ Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0);
+ while (tqparent) {
+ if (!tqparent->allSelected()) {
+ tqparent->setSelectedRecursivly(true);
return;
}
- child = parent;
- parent = parent->parentNote();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
// Then, select all:
FOR_EACH_NOTE (note)
@@ -2576,7 +2585,7 @@ void Basket::unselectAll()
if (redirectEditActions()) {
if (m_editor->textEdit()) {
m_editor->textEdit()->removeSelection();
- selectionChangedInEditor(); // THIS IS NOT EMITED BY Qt!!!
+ selectionChangedInEditor(); // THIS IS NOT EMITED BY TQt!!!
} else if (m_editor->lineEdit())
m_editor->lineEdit()->deselect();
} else {
@@ -2604,7 +2613,7 @@ void Basket::invertSelectionOf(Note *toSelect)
note->invertSelectionOf(toSelect);
}
-void Basket::selectNotesIn(const QRect &rect, bool invertSelection, bool unselectOthers /*= true*/)
+void Basket::selectNotesIn(const TQRect &rect, bool invertSelection, bool unselectOthers /*= true*/)
{
FOR_EACH_NOTE (note)
note->selectIn(rect, invertSelection, unselectOthers);
@@ -2612,10 +2621,10 @@ void Basket::selectNotesIn(const QRect &rect, bool invertSelection, bool unselec
void Basket::doHoverEffects()
{
- doHoverEffects( viewportToContents( viewport()->mapFromGlobal(QCursor::pos()) ) );
+ doHoverEffects( viewportToContents( viewport()->mapFromGlobal(TQCursor::pos()) ) );
}
-void Basket::doHoverEffects(Note *note, Note::Zone zone, const QPoint &pos)
+void Basket::doHoverEffects(Note *note, Note::Zone zone, const TQPoint &pos)
{
// Inform the old and new hovered note (if any):
Note *oldHoveredNote = m_hoveredNote;
@@ -2645,13 +2654,13 @@ void Basket::doHoverEffects(Note *note, Note::Zone zone, const QPoint &pos)
removeInserter();
// If we are hovering an embedded link in a rich text element, show the destination in the statusbar:
if (zone == Note::Link)
- emit setStatusBarText(m_hoveredNote->linkAt( pos - QPoint(m_hoveredNote->x(), m_hoveredNote->y()) ));
+ emit setStatusBarText(m_hoveredNote->linkAt( pos - TQPoint(m_hoveredNote->x(), m_hoveredNote->y()) ));
else if (m_hoveredNote->content())
emit setStatusBarText(m_hoveredNote->content()->statusBarMessage(m_hoveredZone));//resetStatusBarText();
// If we aren't hovering a note, reset all:
} else {
if (isFreeLayout() && !isSelecting())
- viewport()->setCursor(Qt::CrossCursor);
+ viewport()->setCursor(TQt::CrossCursor);
else
viewport()->unsetCursor();
m_hoveredZone = Note::None;
@@ -2660,7 +2669,7 @@ void Basket::doHoverEffects(Note *note, Note::Zone zone, const QPoint &pos)
}
}
-void Basket::doHoverEffects(const QPoint &pos)
+void Basket::doHoverEffects(const TQPoint &pos)
{
// if (isDuringEdit())
// viewport()->unsetCursor();
@@ -2674,17 +2683,17 @@ void Basket::doHoverEffects(const QPoint &pos)
// Ending the drag INSIDE the basket area will make NO hoverEffects() because m_underMouse is false.
// User need to leave the area and re-enter it to get effects.
// This hack solve that by dismissing the m_underMouse variable:
- bool underMouse = Global::bnpView->currentBasket() == this && QRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).contains(pos);
+ bool underMouse = Global::bnpView->currentBasket() == this && TQRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()).tqcontains(pos);
// Don't do hover effects when a popup menu is opened.
// Primarily because the basket area will only receive mouseEnterEvent and mouveLeaveEvent.
- // It willn't be noticed of mouseMoveEvent, which would result in a apparently broken application state:
+ // It willn't be noticed of mouseMoveEvent, which would result in a aptqparently broken application state:
if (kapp->activePopupWidget())
underMouse = false;
// Compute which note is hovered:
Note *note = (m_isSelecting || !underMouse ? 0 : noteAt(pos.x(), pos.y()));
- Note::Zone zone = (note ? note->zoneAt( pos - QPoint(note->x(), note->y()), isDuringDrag() ) : Note::None);
+ Note::Zone zone = (note ? note->zoneAt( pos - TQPoint(note->x(), note->y()), isDuringDrag() ) : Note::None);
// Inform the old and new hovered note (if any) and update the areas:
doHoverEffects(note, zone, pos);
@@ -2693,12 +2702,12 @@ void Basket::doHoverEffects(const QPoint &pos)
void Basket::mouseEnteredEditorWidget()
{
if (!m_lockedHovering && !kapp->activePopupWidget())
- doHoverEffects(editedNote(), Note::Content, QPoint());
+ doHoverEffects(editedNote(), Note::Content, TQPoint());
}
void Basket::removeInserter()
{
- if (m_inserterShown) { // Do not hide (and then update/repaint the view) if it is already hidden!
+ if (m_inserterShown) { // Do not hide (and then update/tqrepaint the view) if it is already hidden!
m_inserterShown = false;
updateContents(m_inserterRect);
}
@@ -2735,28 +2744,28 @@ void Basket::placeInserter(Note *note, int zone)
if (!m_inserterTop)
y += (note->isColumn() ? note->finalHeight() : note->height());
// Assigning result:
- m_inserterRect = QRect(x, y, width, 6 - (m_inserterGroup ? 2 : 0));
+ m_inserterRect = TQRect(x, y, width, 6 - (m_inserterGroup ? 2 : 0));
// Update the new position:
updateContents(m_inserterRect);
}
-inline void drawLineByRect(QPainter &painter, int x, int y, int width, int height)
+inline void drawLineByRect(TQPainter &painter, int x, int y, int width, int height)
{
painter.drawLine(x, y, x + width - 1, y + height - 1);
}
-void Basket::drawInserter(QPainter &painter, int xPainter, int yPainter)
+void Basket::drawInserter(TQPainter &painter, int xPainter, int yPainter)
{
if (!m_inserterShown)
return;
- QRect rect = m_inserterRect; // For shorter code-lines when drawing!
+ TQRect rect = m_inserterRect; // For shorter code-lines when drawing!
rect.moveBy(-xPainter, -yPainter);
int lineY = (m_inserterGroup && m_inserterTop ? 0 : 2);
int roundY = (m_inserterGroup && m_inserterTop ? 0 : 1);
- QColor dark = KApplication::palette().active().dark();
- QColor light = dark.light().light();
+ TQColor dark = KApplication::tqpalette().active().dark();
+ TQColor light = dark.light().light();
if (m_inserterGroup && Settings::groupOnInsertionLine())
light = Tools::mixColor(light, KGlobalSettings::highlightColor());
painter.setPen(dark);
@@ -2782,23 +2791,23 @@ void Basket::drawInserter(QPainter &painter, int xPainter, int yPainter)
}
}
-void Basket::maybeTip(const QPoint &pos)
+void Basket::maybeTip(const TQPoint &pos)
{
if ( !m_loaded || !Settings::showNotesToolTip() )
return;
- QString message;
- QRect rect;
+ TQString message;
+ TQRect rect;
- QPoint contentPos = viewportToContents(pos);
+ TQPoint contentPos = viewportToContents(pos);
Note *note = noteAt(contentPos.x(), contentPos.y());
if (!note && isFreeLayout()) {
message = i18n("Insert note here\nRight click for more options");
- QRect itRect;
- for (QValueList<QRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
- itRect = QRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it);
- if (itRect.contains(contentPos)) {
+ TQRect itRect;
+ for (TQValueList<TQRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
+ itRect = TQRect(0, 0, visibleWidth(), visibleHeight()).intersect(*it);
+ if (itRect.tqcontains(contentPos)) {
rect = itRect;
rect.moveLeft(rect.left() - contentsX());
rect.moveTop( rect.top() - contentsY());
@@ -2809,7 +2818,7 @@ void Basket::maybeTip(const QPoint &pos)
if (!note)
return;
- Note::Zone zone = note->zoneAt( contentPos - QPoint(note->x(), note->y()) );
+ Note::Zone zone = note->zoneAt( contentPos - TQPoint(note->x(), note->y()) );
switch (zone) {
case Note::Resizer: message = (note->isColumn() ?
i18n("Resize those columns") :
@@ -2821,15 +2830,15 @@ void Basket::maybeTip(const QPoint &pos)
case Note::TagsArrow: message = i18n("Assign or remove tags from this note");
if (note->states().count() > 0) {
message = "<qt><nobr>" + message + "</nobr><br>" + i18n("<b>Assigned Tags</b>: %1");
- QString tagsString = "";
+ TQString tagsString = "";
for (State::List::iterator it = note->states().begin(); it != note->states().end(); ++it) {
- QString tagName = "<nobr>" + Tools::textToHTMLWithoutP((*it)->fullName()) + "</nobr>";
+ TQString tagName = "<nobr>" + Tools::textToHTMLWithoutP((*it)->fullName()) + "</nobr>";
if (tagsString.isEmpty())
tagsString = tagName;
else
- tagsString = i18n("%1, %2").arg(tagsString, tagName);
+ tagsString = i18n("%1, %2").tqarg(tagsString, tagName);
}
- message = message.arg(tagsString);
+ message = message.tqarg(tagsString);
}
break;
case Note::Custom0: message = note->content()->zoneTip(zone); break; //"Open this link/Open this file/Open this sound file/Launch this application"
@@ -2853,8 +2862,8 @@ void Basket::maybeTip(const QPoint &pos)
}
if (zone == Note::Content || zone == Note::Link || zone == Note::Custom0) {
- QStringList keys;
- QStringList values;
+ TQStringList keys;
+ TQStringList values;
note->content()->toolTipInfos(&keys, &values);
keys.append(i18n("Added"));
@@ -2863,17 +2872,17 @@ void Basket::maybeTip(const QPoint &pos)
values.append(note->lastModificationStringDate());
message = "<qt><nobr>" + message;
- QStringList::iterator key;
- QStringList::iterator value;
+ TQStringList::iterator key;
+ TQStringList::iterator value;
for (key = keys.begin(), value = values.begin(); key != keys.end() && value != values.end(); ++key, ++value)
- message += "<br>" + i18n("of the form 'key: value'", "<b>%1</b>: %2").arg(*key, *value);
+ message += "<br>" + i18n("of the form 'key: value'", "<b>%1</b>: %2").tqarg(*key, *value);
message += "</nobr></qt>";
} else if (m_inserterSplit && (zone == Note::TopInsert || zone == Note::BottomInsert))
message += "\n" + i18n("Click on the right to group instead of insert");
else if (m_inserterSplit && (zone == Note::TopGroup || zone == Note::BottomGroup))
message += "\n" + i18n("Click on the left to insert instead of group");
- rect = note->zoneRect( zone, contentPos - QPoint(note->x(), note->y()) );
+ rect = note->zoneRect( zone, contentPos - TQPoint(note->x(), note->y()) );
rect.moveLeft(rect.left() - contentsX());
rect.moveTop( rect.top() - contentsY());
@@ -2924,7 +2933,7 @@ Note* Basket::noteAt(int x, int y)
//NO:
// // Do NOT check the bottom&right borders.
// // Because imagine someone drag&drop a big note from the top to the bottom of a big basket (with big vertical scrollbars),
-// // the note is first removed, and relayoutNotes() compute the new height that is smaller
+// // the note is first removed, and retqlayoutNotes() compute the new height that is smaller
// // Then noteAt() is called for the mouse pointer position, because the basket is now smaller, the cursor is out of boundaries!!!
// // Should, of course, not return 0:
if (x < 0 || x > contentsWidth() || y < 0 || y > contentsHeight())
@@ -2940,7 +2949,7 @@ Note* Basket::noteAt(int x, int y)
while (note) {
possibleNote = note->noteAt(x, y);
if (possibleNote) {
- if (draggedNotes().contains(possibleNote))
+ if (draggedNotes().tqcontains(possibleNote))
return 0;
else
return possibleNote;
@@ -2948,7 +2957,7 @@ Note* Basket::noteAt(int x, int y)
note = note->next();
}
- // If the basket is layouted in columns, return one of the columns to be able to add notes in them:
+ // If the basket is tqlayouted in columns, return one of the columns to be able to add notes in them:
if (isColumnsLayout()) {
Note *column = m_firstNote;
while (column) {
@@ -2973,9 +2982,9 @@ Basket::~Basket()
deleteNotes();
}
-void Basket::viewportResizeEvent(QResizeEvent *event)
+void Basket::viewportResizeEvent(TQResizeEvent *event)
{
- relayoutNotes(true);
+ retqlayoutNotes(true);
//cornerWidget()->setShown(horizontalScrollBar()->isShown() && verticalScrollBar()->isShown());
if (horizontalScrollBar()->isShown() && verticalScrollBar()->isShown()) {
if (!cornerWidget())
@@ -2986,14 +2995,14 @@ void Basket::viewportResizeEvent(QResizeEvent *event)
}
// if (isDuringEdit())
// ensureNoteVisible(editedNote());
- QScrollView::viewportResizeEvent(event);
+ TQScrollView::viewportResizeEvent(event);
}
void Basket::animateLoad()
{
const int viewHeight = contentsY() + visibleHeight();
- QTime t = QTime::currentTime(); // Set random seed
+ TQTime t = TQTime::currentTime(); // Set random seed
srand(t.hour()*12 + t.minute()*60 + t.second()*60);
Note *note = firstNote();
@@ -3006,30 +3015,30 @@ void Basket::animateLoad()
m_loaded = true;
}
-QColor Basket::selectionRectInsideColor()
+TQColor Basket::selectionRectInsideColor()
{
return Tools::mixColor(Tools::mixColor(backgroundColor(), KGlobalSettings::highlightColor()), backgroundColor());
}
-QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
+TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{
// normal button...
- QRgb rgb = bgColor.rgb();
- QRgb rgb_b = fgColor.rgb();
+ TQRgb rgb = bgColor.rgb();
+ TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if (alpha>255) alpha = 255;
if (alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
- QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
- qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
- qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
+ TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
+ tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255,
+ tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) );
return result;
}
void Basket::unlock()
{
- QTimer::singleShot( 0, this, SLOT(load()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(load()) );
}
void Basket::inactivityAutoLockTimeout()
@@ -3037,63 +3046,63 @@ void Basket::inactivityAutoLockTimeout()
lock();
}
-void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight)
+void Basket::drawContents(TQPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight)
{
// Start the load the first time the basket is shown:
if (!m_loadingLaunched)
{
if(!m_locked)
- QTimer::singleShot( 0, this, SLOT(load()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(load()) );
else {
Global::bnpView->notesStateChanged(); // Show "Locked" instead of "Loading..." in the statusbar
}
}
- QBrush brush(backgroundColor()); // FIXME: share it for all the basket?
- QRect clipRect(clipX, clipY, clipWidth, clipHeight);
+ TQBrush brush(backgroundColor()); // FIXME: share it for all the basket?
+ TQRect clipRect(clipX, clipY, clipWidth, clipHeight);
if(m_locked)
{
if(!m_decryptBox)
{
- m_decryptBox = new QFrame( this, "m_decryptBox" );
- m_decryptBox->setFrameShape( QFrame::StyledPanel );
- m_decryptBox->setFrameShadow( QFrame::Plain );
+ m_decryptBox = new TQFrame( this, "m_decryptBox" );
+ m_decryptBox->setFrameShape( TQFrame::StyledPanel );
+ m_decryptBox->setFrameShadow( TQFrame::Plain );
m_decryptBox->setLineWidth( 1 );
- QGridLayout* layout = new QGridLayout( m_decryptBox, 1, 1, 11, 6, "decryptBoxLayout");
+ TQGridLayout* tqlayout = new TQGridLayout( m_decryptBox, 1, 1, 11, 6, "decryptBoxLayout");
#ifdef HAVE_LIBGPGME
- m_button = new QPushButton( m_decryptBox, "button" );
+ m_button = new TQPushButton( m_decryptBox, "button" );
m_button->setText( i18n( "&Unlock" ) );
- layout->addWidget( m_button, 1, 2 );
- connect( m_button, SIGNAL( clicked() ), this, SLOT( unlock() ) );
+ tqlayout->addWidget( m_button, 1, 2 );
+ connect( m_button, TQT_SIGNAL( clicked() ), this, TQT_SLOT( unlock() ) );
#endif
- QLabel* label = new QLabel( m_decryptBox, "label" );
- QString text = "<b>" + i18n("Password protected basket.") + "</b><br/>";
+ TQLabel* label = new TQLabel( m_decryptBox, "label" );
+ TQString text = "<b>" + i18n("Password protected basket.") + "</b><br/>";
#ifdef HAVE_LIBGPGME
label->setText( text + i18n("Press Unlock to access it.") );
#else
- label->setText( text + i18n("Encryption is not supported by<br/>this version of %1.").arg(kapp->aboutData()->programName()) );
+ label->setText( text + i18n("Encryption is not supported by<br/>this version of %1.").tqarg(kapp->aboutData()->programName()) );
#endif
- label->setAlignment( int( QLabel::AlignTop ) );
- layout->addMultiCellWidget( label, 0, 0, 1, 2 );
- QLabel* pixmap = new QLabel( m_decryptBox, "pixmap" );
+ label->tqsetAlignment( int( TQLabel::AlignTop ) );
+ tqlayout->addMultiCellWidget( label, 0, 0, 1, 2 );
+ TQLabel* pixmap = new TQLabel( m_decryptBox, "pixmap" );
pixmap->setPixmap( KGlobal::iconLoader()->loadIcon("encrypted", KIcon::NoGroup, KIcon::SizeHuge) );
- layout->addMultiCellWidget( pixmap, 0, 1, 0, 0 );
+ tqlayout->addMultiCellWidget( pixmap, 0, 1, 0, 0 );
- QSpacerItem* spacer = new QSpacerItem( 40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
- layout->addItem( spacer, 1, 1 );
+ TQSpacerItem* spacer = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
+ tqlayout->addItem( spacer, 1, 1 );
- label = new QLabel("<small>" +
+ label = new TQLabel("<small>" +
i18n("To make baskets stay unlocked, change the automatic<br>"
"locking duration in the application settings.") + "</small>",
m_decryptBox);
- //label->setFixedWidth(label->sizeHint().width() / 2);
- label->setAlignment( int( QLabel::AlignTop ) );
- layout->addMultiCellWidget( label, 2,2,0,2 );
+ //label->setFixedWidth(label->tqsizeHint().width() / 2);
+ label->tqsetAlignment( int( TQLabel::AlignTop ) );
+ tqlayout->addMultiCellWidget( label, 2,2,0,2 );
- m_decryptBox->resize(layout->sizeHint());
+ m_decryptBox->resize(tqlayout->tqsizeHint());
}
if(m_decryptBox->isHidden())
{
@@ -3121,16 +3130,16 @@ void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth
// Draw loading message:
if (!m_loaded) {
- QPixmap pixmap(visibleWidth(), visibleHeight()); // TODO: Clip it to asked size only!
- QPainter painter2(&pixmap);
- QSimpleRichText rt(QString("<center>%1</center>").arg(i18n("Loading...")), QScrollView::font());
+ TQPixmap pixmap(visibleWidth(), visibleHeight()); // TODO: Clip it to asked size only!
+ TQPainter painter2(&pixmap);
+ TQSimpleRichText rt(TQString("<center>%1</center>").tqarg(i18n("Loading...")), TQScrollView::font());
rt.setWidth(visibleWidth());
int hrt = rt.height();
painter2.fillRect(0, 0, visibleWidth(), visibleHeight(), brush);
- blendBackground(painter2, QRect(0, 0, visibleWidth(), visibleHeight()), -1, -1, /*opaque=*/true);
- QColorGroup cg = colorGroup();
- cg.setColor(QColorGroup::Text, textColor());
- rt.draw(&painter2, 0, (visibleHeight() - hrt) / 2, QRect(), cg);
+ blendBackground(painter2, TQRect(0, 0, visibleWidth(), visibleHeight()), -1, -1, /*opaque=*/true);
+ TQColorGroup cg = tqcolorGroup();
+ cg.setColor(TQColorGroup::Text, textColor());
+ rt.draw(&painter2, 0, (visibleHeight() - hrt) / 2, TQRect(), cg);
painter2.end();
painter->drawPixmap(0, 0, pixmap);
return; // TODO: Clip to the wanted rectangle
@@ -3144,10 +3153,10 @@ void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth
// If the background image is not tiled, we know that recomputeBlankRects() broken rects so that they are full of either background pixmap or color, but not a mix.
// Draw blank areas (see the last preparation above):
- QPixmap pixmap;
- QPainter painter2;
- QRect rect;
- for (QValueList<QRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
+ TQPixmap pixmap;
+ TQPainter painter2;
+ TQRect rect;
+ for (TQValueList<TQRect>::iterator it = m_blankAreas.begin(); it != m_blankAreas.end(); ++it) {
rect = clipRect.intersect(*it);
if (rect.width() > 0 && rect.height() > 0) {
// If there is an inserter to draw, draw the image off screen,
@@ -3162,11 +3171,11 @@ void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth
drawInserter(painter2, rect.x(), rect.y());
// Draw selection rect:
if (m_isSelecting && rect.intersects(m_selectionRect)) {
- QRect selectionRect = m_selectionRect;
+ TQRect selectionRect = m_selectionRect;
selectionRect.moveBy(-rect.x(), -rect.y());
- QRect selectionRectInside(selectionRect.x() + 1, selectionRect.y() + 1, selectionRect.width() - 2, selectionRect.height() - 2);
+ TQRect selectionRectInside(selectionRect.x() + 1, selectionRect.y() + 1, selectionRect.width() - 2, selectionRect.height() - 2);
if (selectionRectInside.width() > 0 && selectionRectInside.height() > 0) {
- QColor insideColor = selectionRectInsideColor();
+ TQColor insideColor = selectionRectInsideColor();
painter2.fillRect(selectionRectInside, insideColor);
selectionRectInside.moveBy(rect.x(), rect.y());
blendBackground(painter2, selectionRectInside, rect.x(), rect.y(), true, /*&*/m_selectedBackgroundPixmap);
@@ -3197,7 +3206,7 @@ void Basket::drawContents(QPainter *painter, int clipX, int clipY, int clipWidth
/* rect(x,y,width,height)==(xBackgroundToDraw,yBackgroundToDraw,widthToDraw,heightToDraw)
*/
-void Basket::blendBackground(QPainter &painter, const QRect &rect, int xPainter, int yPainter, bool opaque, QPixmap *bg)
+void Basket::blendBackground(TQPainter &painter, const TQRect &rect, int xPainter, int yPainter, bool opaque, TQPixmap *bg)
{
if (xPainter == -1 && yPainter == -1) {
xPainter = rect.x();
@@ -3205,7 +3214,7 @@ void Basket::blendBackground(QPainter &painter, const QRect &rect, int xPainter,
}
if (hasBackgroundImage()) {
- const QPixmap *bgPixmap = (bg ? /* * */bg : (opaque ? m_opaqueBackgroundPixmap : m_backgroundPixmap));
+ const TQPixmap *bgPixmap = (bg ? /* * */bg : (opaque ? m_opaqueBackgroundPixmap : m_backgroundPixmap));
if (isTiledBackground())
painter.drawTiledPixmap(rect.x() - xPainter, rect.y() - yPainter, rect.width(), rect.height(), *bgPixmap, rect.x(), rect.y());
else
@@ -3216,21 +3225,21 @@ void Basket::blendBackground(QPainter &painter, const QRect &rect, int xPainter,
void Basket::recomputeBlankRects()
{
m_blankAreas.clear();
- m_blankAreas.append( QRect(0, 0, contentsWidth(), contentsHeight()) );
+ m_blankAreas.append( TQRect(0, 0, contentsWidth(), contentsHeight()) );
FOR_EACH_NOTE (note)
note->recomputeBlankRects(m_blankAreas);
// See the drawing of blank areas in Basket::drawContents()
if (hasBackgroundImage() && ! isTiledBackground())
- substractRectOnAreas( QRect(0, 0, backgroundPixmap()->width(), backgroundPixmap()->height()), m_blankAreas, false );
+ substractRectOnAreas( TQRect(0, 0, backgroundPixmap()->width(), backgroundPixmap()->height()), m_blankAreas, false );
}
void Basket::addAnimatedNote(Note *note)
{
if (m_animatedNotes.isEmpty()) {
m_animationTimer.start(FRAME_DELAY);
- m_lastFrameTime = QTime::currentTime();
+ m_lastFrameTime = TQTime::currentTime();
}
m_animatedNotes.append(note);
@@ -3245,7 +3254,7 @@ void Basket::unsetNotesWidth()
}
}
-void Basket::relayoutNotes(bool animate)
+void Basket::retqlayoutNotes(bool animate)
{
if (Global::bnpView->currentBasket() != this)
return; // Optimize load time, and basket will be relaid out when activated, anyway
@@ -3264,12 +3273,12 @@ void Basket::relayoutNotes(bool animate)
Note *note = m_firstNote;
while (note) {
if (note->matching()) {
- note->relayoutAt(0, h, animate);
+ note->retqlayoutAt(0, h, animate);
if (note->hasResizer()) {
int minGroupWidth = note->minRight() - note->finalX();
if (note->groupWidth() < minGroupWidth) {
note->setGroupWidth(minGroupWidth);
- relayoutNotes(animate); // Redo the thing, but this time it should not recurse
+ retqlayoutNotes(animate); // Redo the thing, but this time it should not recurse
return;
}
}
@@ -3283,7 +3292,7 @@ void Basket::relayoutNotes(bool animate)
else
tmpHeight += 15;
- resizeContents( QMAX(tmpWidth, visibleWidth()), QMAX(tmpHeight, visibleHeight()) );
+ resizeContents( TQMAX(tmpWidth, visibleWidth()), TQMAX(tmpHeight, visibleHeight()) );
recomputeBlankRects();
placeEditor();
doHoverEffects();
@@ -3299,7 +3308,7 @@ void Basket::updateNote(Note *note)
void Basket::animateObjects()
{
- QValueList<Note*>::iterator it;
+ TQValueList<Note*>::iterator it;
for (it = m_animatedNotes.begin(); it != m_animatedNotes.end(); )
// if ((*it)->y() >= contentsY() && (*it)->bottom() <= contentsY() + contentsWidth())
// updateNote(*it);
@@ -3327,14 +3336,14 @@ void Basket::animateObjects()
// We refresh content if it was the last frame,
// or if the drawing of the last frame was not too long.
- if (!m_animationTimer.isActive() || (m_lastFrameTime.msecsTo(QTime::currentTime()) < FRAME_DELAY*11/10)) { // *11/10 == *1.1 : We keep a 0.1 security margin
+ if (!m_animationTimer.isActive() || (m_lastFrameTime.msecsTo(TQTime::currentTime()) < FRAME_DELAY*11/10)) { // *11/10 == *1.1 : We keep a 0.1 security margin
m_lastFrameTime = m_lastFrameTime.addMSecs(FRAME_DELAY); // because timers are not accurate and can trigger late
- //m_lastFrameTime = QTime::currentTime();
+ //m_lastFrameTime = TQTime::currentTime();
//std::cout << ">>" << m_lastFrameTime.toString("hh:mm:ss.zzz") << std::endl;
if (m_underMouse)
doHoverEffects();
recomputeBlankRects();
- //relayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view!
+ //retqlayoutNotes(true); // In case an animated note was to the contents view boundaries, resize the view!
updateContents();
// If the drawing of the last frame was too long, we skip the drawing of the current and do the next one:
} else {
@@ -3359,10 +3368,10 @@ void Basket::popupEmblemMenu(Note *note, int emblemNumber)
m_tagPopupNote = note;
State *state = note->stateForEmblemNumber(emblemNumber);
State *nextState = state->nextState(/*cycle=*/false);
- Tag *tag = state->parentTag();
+ Tag *tag = state->tqparentTag();
m_tagPopup = tag;
- QKeySequence sequence = tag->shortcut().operator QKeySequence();
+ TQKeySequence sequence = tag->shortcut().operator TQKeySequence();
bool sequenceOnDelete = (nextState == 0 && !tag->shortcut().isNull());
KPopupMenu menu(this);
@@ -3374,22 +3383,22 @@ void Basket::popupEmblemMenu(Note *note, int emblemNumber)
menu.insertItem( SmallIconSet("filter"), i18n("&Filter by this Tag"), 3 );
} else {
menu.insertTitle(tag->name());
- QValueList<State*>::iterator it;
+ TQValueList<State*>::iterator it;
State *currentState;
int i = 10;
for (it = tag->states().begin(); it != tag->states().end(); ++it) {
currentState = *it;
- QKeySequence sequence;
+ TQKeySequence sequence;
if (currentState == nextState && !tag->shortcut().isNull())
- sequence = tag->shortcut().operator QKeySequence();
- menu.insertItem(StateMenuItem::radioButtonIconSet(state == currentState, menu.colorGroup()), new StateMenuItem(currentState, sequence, false), i );
+ sequence = tag->shortcut().operator TQKeySequence();
+ menu.insertItem(StateMenuItem::radioButtonIconSet(state == currentState, menu.tqcolorGroup()), new StateMenuItem(currentState, sequence, false), i );
if (currentState == nextState && !tag->shortcut().isNull())
menu.setAccel(sequence, i);
++i;
}
menu.insertSeparator();
- menu.insertItem( new IndentedMenuItem(i18n("&Remove"), "editdelete", (sequenceOnDelete ? sequence : QKeySequence())), 1 );
+ menu.insertItem( new IndentedMenuItem(i18n("&Remove"), "editdelete", (sequenceOnDelete ? sequence : TQKeySequence())), 1 );
menu.insertItem( new IndentedMenuItem(i18n("&Customize..."), "configure"), 2 );
menu.insertSeparator();
menu.insertItem( new IndentedMenuItem(i18n("&Filter by this Tag"), "filter"), 3 );
@@ -3398,12 +3407,12 @@ void Basket::popupEmblemMenu(Note *note, int emblemNumber)
if (sequenceOnDelete)
menu.setAccel(sequence, 1);
- connect( &menu, SIGNAL(activated(int)), this, SLOT(toggledStateInMenu(int)) );
- connect( &menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
- connect( &menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
+ connect( &menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(toggledStateInMenu(int)) );
+ connect( &menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+ connect( &menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
m_lockedHovering = true;
- menu.exec(QCursor::pos());
+ menu.exec(TQCursor::pos());
}
void Basket::toggledStateInMenu(int id)
@@ -3411,7 +3420,7 @@ void Basket::toggledStateInMenu(int id)
if (id == 1) {
removeTagFromSelectedNotes(m_tagPopup);
//m_tagPopupNote->removeTag(m_tagPopup);
- //m_tagPopupNote->setWidth(0); // To force a new layout computation
+ //m_tagPopupNote->setWidth(0); // To force a new tqlayout computation
updateEditorAppearance();
filterAgain();
save();
@@ -3474,7 +3483,7 @@ void Basket::popupTagsMenu(Note *note)
KPopupMenu menu(this);
menu.insertTitle(i18n("Tags"));
-// QValueList<Tag*>::iterator it;
+// TQValueList<Tag*>::iterator it;
// Tag *currentTag;
// State *currentState;
// int i = 10;
@@ -3482,10 +3491,10 @@ void Basket::popupTagsMenu(Note *note)
// // Current tag and first state of it:
// currentTag = *it;
// currentState = currentTag->states().first();
-// QKeySequence sequence;
+// TQKeySequence sequence;
// if (!currentTag->shortcut().isNull())
-// sequence = currentTag->shortcut().operator QKeySequence();
-// menu.insertItem(StateMenuItem::checkBoxIconSet(note->hasTag(currentTag), menu.colorGroup()), new StateMenuItem(currentState, sequence, true), i );
+// sequence = currentTag->shortcut().operator TQKeySequence();
+// menu.insertItem(StateMenuItem::checkBoxIconSet(note->hasTag(currentTag), menu.tqcolorGroup()), new StateMenuItem(currentState, sequence, true), i );
// if (!currentTag->shortcut().isNull())
// menu.setAccel(sequence, i);
// ++i;
@@ -3504,14 +3513,14 @@ void Basket::popupTagsMenu(Note *note)
// if (!selectedNotesHaveTags())//note->states().isEmpty())
// menu.setItemEnabled(2, false);
//
-// connect( &menu, SIGNAL(activated(int)), this, SLOT(toggledTagInMenu(int)) );
-// connect( &menu, SIGNAL(aboutToHide()), this, SLOT(unlockHovering()) );
-// connect( &menu, SIGNAL(aboutToHide()), this, SLOT(disableNextClick()) );
+// connect( &menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(toggledTagInMenu(int)) );
+// connect( &menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(unlockHovering()) );
+// connect( &menu, TQT_SIGNAL(aboutToHide()), this, TQT_SLOT(disableNextClick()) );
Global::bnpView->populateTagsMenu(menu, note);
m_lockedHovering = true;
- menu.exec(QCursor::pos());
+ menu.exec(TQCursor::pos());
}
void Basket::unlockHovering()
@@ -3556,7 +3565,7 @@ void Basket::toggledTagInMenu(int id)
removeTagFromSelectedNotes(tag);
else
addTagToSelectedNotes(tag);
- m_tagPopupNote->setWidth(0); // To force a new layout computation
+ m_tagPopupNote->setWidth(0); // To force a new tqlayout computation
filterAgain();
save();
}
@@ -3589,17 +3598,17 @@ void Basket::updateEditorAppearance()
m_editor->widget()->setPaletteBackgroundColor(m_editor->note()->backgroundColor());
m_editor->widget()->setPaletteForegroundColor(m_editor->note()->textColor());
- // Uggly Hack arround Qt bugs: placeCursor() don't call any signal:
+ // Uggly Hack arround TQt bugs: placeCursor() don't call any signal:
HtmlEditor *htmlEditor = dynamic_cast<HtmlEditor*>(m_editor);
if (htmlEditor) {
int para, index;
m_editor->textEdit()->getCursorPosition(&para, &index);
if (para == 0 && index == 0) {
- m_editor->textEdit()->moveCursor(QTextEdit::MoveForward, /*select=*/false);
- m_editor->textEdit()->moveCursor(QTextEdit::MoveBackward, /*select=*/false);
+ m_editor->textEdit()->moveCursor(TQTextEdit::MoveForward, /*select=*/false);
+ m_editor->textEdit()->moveCursor(TQTextEdit::MoveBackward, /*select=*/false);
} else {
- m_editor->textEdit()->moveCursor(QTextEdit::MoveBackward, /*select=*/false);
- m_editor->textEdit()->moveCursor(QTextEdit::MoveForward, /*select=*/false);
+ m_editor->textEdit()->moveCursor(TQTextEdit::MoveBackward, /*select=*/false);
+ m_editor->textEdit()->moveCursor(TQTextEdit::MoveForward, /*select=*/false);
}
htmlEditor->cursorPositionChanged(); // Does not work anyway :-( (when clicking on a red bold text, the toolbar still show black normal text)
}
@@ -3609,7 +3618,7 @@ void Basket::updateEditorAppearance()
void Basket::editorPropertiesChanged()
{
if (isDuringEdit() && m_editor->note()->content()->type() == NoteType::Html) {
- m_editor->textEdit()->setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll : QTextEdit::AutoNone);
+ m_editor->textEdit()->setAutoFormatting(Settings::autoBullet() ? TQTextEdit::AutoAll : TQTextEdit::AutoNone);
}
}
@@ -3635,7 +3644,7 @@ bool Basket::selectedNotesHaveTags()
return false;
}
-QColor Basket::backgroundColor()
+TQColor Basket::backgroundColor()
{
if (m_backgroundColorSetting.isValid())
return m_backgroundColorSetting;
@@ -3643,7 +3652,7 @@ QColor Basket::backgroundColor()
return KGlobalSettings::baseColor();
}
-QColor Basket::textColor()
+TQColor Basket::textColor()
{
if (m_textColorSetting.isValid())
return m_textColorSetting;
@@ -3685,7 +3694,7 @@ bool Basket::hasSelectedTextInEditor()
if (m_editor->textEdit()) {
// The following line does NOT work if one letter is selected and the user press Shift+Left or Shift+Right to unselect than letter:
- // Qt misteriously tell us there is an invisible selection!!
+ // TQt misteriously tell us there is an invisible selection!!
//return m_editor->textEdit()->hasSelectedText();
return !m_editor->textEdit()->selectedText().isEmpty();
} else if (m_editor->lineEdit())
@@ -3721,7 +3730,7 @@ void Basket::contentChangedInEditor()
if (m_inactivityAutoSaveTimer.isActive())
m_inactivityAutoSaveTimer.stop();
m_inactivityAutoSaveTimer.start(3 * 1000, /*singleShot=*/true);
- Global::bnpView->setUnsavedStatus(true);
+ Global::bnpView->setUnsavedtqStatus(true);
// }
}
@@ -3741,15 +3750,15 @@ void Basket::placeEditor(bool /*andEnsureVisible*/ /*= false*/)
if (!isDuringEdit())
return;
- QFrame *editorQFrame = dynamic_cast<QFrame*>(m_editor->widget());
+ TQFrame *editorTQFrame = dynamic_cast<TQFrame*>(m_editor->widget());
KTextEdit *textEdit = m_editor->textEdit();
-// QLineEdit *lineEdit = m_editor->lineEdit();
+// TQLineEdit *lineEdit = m_editor->lineEdit();
Note *note = m_editor->note();
- int frameWidth = (editorQFrame ? editorQFrame->frameWidth() : 0);
+ int frameWidth = (editorTQFrame ? editorTQFrame->frameWidth() : 0);
int x = note->x() + note->contentX() + note->content()->xEditorIndent() - frameWidth;
int y;
- int maxHeight = QMAX(visibleHeight(), contentsHeight());
+ int maxHeight = TQMAX(visibleHeight(), contentsHeight());
int height, width;
if (textEdit) {
@@ -3762,10 +3771,10 @@ void Basket::placeEditor(bool /*andEnsureVisible*/ /*= false*/)
// editor->sync();
y = note->y() + Note::NOTE_MARGIN - frameWidth;
height = textEdit->contentsHeight() + 2*frameWidth;
-// height = /*QMAX(*/height/*, note->height())*/;
-// height = QMIN(height, visibleHeight());
+// height = /*TQMAX(*/height/*, note->height())*/;
+// height = TQMIN(height, visibleHeight());
width = note->x() + note->width() - x + 1;// /*note->x() + note->width()*/note->rightLimit() - x + 2*frameWidth + 1;
-//width=QMAX(width,textEdit->contentsWidth()+2*frameWidth);
+//width=TQMAX(width,textEdit->contentsWidth()+2*frameWidth);
if (y + height > maxHeight)
y = maxHeight - height;
textEdit->setFixedSize(width, height);
@@ -3805,14 +3814,14 @@ void Basket::placeEditor(bool /*andEnsureVisible*/ /*= false*/)
}
#include <iostream>
-#include <private/qrichtext_p.h>
+#include <tqrichtext_p.h>
void Basket::editorCursorPositionChanged()
{
if (!isDuringEdit())
return;
FocusedTextEdit *textEdit = (FocusedTextEdit*) m_editor->textEdit();
- const QTextCursor *cursor = textEdit->textCursor();
+ const TQTextCursor *cursor = textEdit->textCursor();
// std::cout << cursor->x() << ";" << cursor->y() << " "
// << cursor->globalX() << ";" << cursor->globalY() << " "
// << cursor->offsetX() << ";" << cursor->offsetY() << ";" << std::endl;
@@ -3823,7 +3832,7 @@ void Basket::editorCursorPositionChanged()
void Basket::closeEditorDelayed()
{
setFocus();
- QTimer::singleShot( 0, this, SLOT(closeEditor()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(closeEditor()) );
}
bool Basket::closeEditor()
@@ -3835,13 +3844,13 @@ bool Basket::closeEditor()
return true;
if (m_redirectEditActions) {
- disconnect( m_editor->widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()) );
+ disconnect( m_editor->widget(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChangedInEditor()) );
if (m_editor->textEdit()) {
- disconnect( m_editor->textEdit(), SIGNAL(textChanged()), this, SLOT(selectionChangedInEditor()) );
- disconnect( m_editor->textEdit(), SIGNAL(textChanged()), this, SLOT(contentChangedInEditor()) );
+ disconnect( m_editor->textEdit(), TQT_SIGNAL(textChanged()), this, TQT_SLOT(selectionChangedInEditor()) );
+ disconnect( m_editor->textEdit(), TQT_SIGNAL(textChanged()), this, TQT_SLOT(contentChangedInEditor()) );
} else if (m_editor->lineEdit()) {
- disconnect( m_editor->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(selectionChangedInEditor()) );
- disconnect( m_editor->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(contentChangedInEditor()) );
+ disconnect( m_editor->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(selectionChangedInEditor()) );
+ disconnect( m_editor->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(contentChangedInEditor()) );
}
}
m_editor->widget()->disconnect();
@@ -3854,7 +3863,7 @@ bool Basket::closeEditor()
m_rightEditorBorder = 0;
Note *note = m_editor->note();
- note->setWidth(0); // For relayoutNotes() to succeed to take care of the change
+ note->setWidth(0); // For retqlayoutNotes() to succeed to take care of the change
// Delete the editor BEFORE unselecting the note because unselecting the note would trigger closeEditor() recursivly:
bool isEmpty = m_editor->isEmpty();
@@ -3959,7 +3968,7 @@ NoteSelection* Basket::selectedNotes()
return 0;
for (NoteSelection *node = selection.firstChild; node; node = node->next)
- node->parent = 0;
+ node->tqparent = 0;
// If the top-most groups are columns, export only childs of those groups
// (because user is not consciencious that columns are groups, and don't care: it's not what she want):
@@ -3973,12 +3982,12 @@ NoteSelection* Basket::selectedNotes()
for (NoteSelection *subNode = node->firstChild; subNode; subNode = nextSubNode) {
nextSubNode = subNode->next;
tmpSelection.append(subNode);
- subNode->parent = 0;
+ subNode->tqparent = 0;
subNode->next = 0;
}
} else {
tmpSelection.append(node);
- node->parent = 0;
+ node->tqparent = 0;
node->next = 0;
}
}
@@ -3996,14 +4005,14 @@ void Basket::showEditedNoteWhileFiltering()
Note *note = m_editor->note();
filterAgain();
note->setSelected(true);
- relayoutNotes(false);
+ retqlayoutNotes(false);
note->setX(note->finalX());
note->setY(note->finalY());
filterAgainDelayed();
}
}
-void Basket::noteEdit(Note *note, bool justAdded, const QPoint &clickedPoint) // TODO: Remove the first parameter!!!
+void Basket::noteEdit(Note *note, bool justAdded, const TQPoint &clickedPoint) // TODO: Remove the first parameter!!!
{
if (!note)
note = theSelectedNote(); // TODO: Or pick the focused note!
@@ -4021,7 +4030,7 @@ void Basket::noteEdit(Note *note, bool justAdded, const QPoint &clickedPoint) //
}
if (justAdded && isFiltering()) {
- QTimer::singleShot( 0, this, SLOT(showEditedNoteWhileFiltering()) );
+ TQTimer::singleShot( 0, this, TQT_SLOT(showEditedNoteWhileFiltering()) );
}
doHoverEffects(note, Note::Content); // Be sure (in the case Edit was triggered by menu or Enter key...): better feedback!
@@ -4034,33 +4043,33 @@ void Basket::noteEdit(Note *note, bool justAdded, const QPoint &clickedPoint) //
m_editor = editor;
m_leftEditorBorder = new TransparentWidget(this);
m_rightEditorBorder = new TransparentWidget(this);
- m_editor->widget()->reparent(viewport(), QPoint(0,0), true);
- m_leftEditorBorder->reparent(viewport(), QPoint(0,0), true);
- m_rightEditorBorder->reparent(viewport(), QPoint(0,0), true);
+ m_editor->widget()->reparent(viewport(), TQPoint(0,0), true);
+ m_leftEditorBorder->reparent(viewport(), TQPoint(0,0), true);
+ m_rightEditorBorder->reparent(viewport(), TQPoint(0,0), true);
addChild(m_editor->widget(), 0, 0);
placeEditorAndEnsureVisible(); // placeEditor(); // FIXME: After?
m_redirectEditActions = m_editor->lineEdit() || m_editor->textEdit();
if (m_redirectEditActions) {
- connect( m_editor->widget(), SIGNAL(selectionChanged()), this, SLOT(selectionChangedInEditor()) );
+ connect( m_editor->widget(), TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChangedInEditor()) );
// In case there is NO text, "Select All" is disabled. But if the user press a key the there is now a text:
// selection has not changed but "Select All" should be re-enabled:
if (m_editor->textEdit()) {
- connect( m_editor->textEdit(), SIGNAL(textChanged()), this, SLOT(selectionChangedInEditor()) );
- connect( m_editor->textEdit(), SIGNAL(textChanged()), this, SLOT(contentChangedInEditor()) );
+ connect( m_editor->textEdit(), TQT_SIGNAL(textChanged()), this, TQT_SLOT(selectionChangedInEditor()) );
+ connect( m_editor->textEdit(), TQT_SIGNAL(textChanged()), this, TQT_SLOT(contentChangedInEditor()) );
} else if (m_editor->lineEdit()) {
- connect( m_editor->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(selectionChangedInEditor()) );
- connect( m_editor->lineEdit(), SIGNAL(textChanged(const QString&)), this, SLOT(contentChangedInEditor()) );
+ connect( m_editor->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(selectionChangedInEditor()) );
+ connect( m_editor->lineEdit(), TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(contentChangedInEditor()) );
}
}
m_editor->widget()->show();
//m_editor->widget()->raise();
m_editor->widget()->setFocus();
- connect( m_editor, SIGNAL(askValidation()), this, SLOT(closeEditorDelayed()) );
- connect( m_editor, SIGNAL(mouseEnteredEditorWidget()), this, SLOT(mouseEnteredEditorWidget()) );
+ connect( m_editor, TQT_SIGNAL(askValidation()), this, TQT_SLOT(closeEditorDelayed()) );
+ connect( m_editor, TQT_SIGNAL(mouseEnteredEditorWidget()), this, TQT_SLOT(mouseEnteredEditorWidget()) );
if (m_editor->textEdit()) {
- connect( m_editor->textEdit(), SIGNAL(textChanged()), this, SLOT(placeEditorAndEnsureVisible()) );
- if (clickedPoint != QPoint()) {
- QPoint pos(clickedPoint.x() - note->x() - note->contentX() + m_editor->textEdit()->frameWidth() + 4 - m_editor->textEdit()->frameWidth(),
+ connect( m_editor->textEdit(), TQT_SIGNAL(textChanged()), this, TQT_SLOT(placeEditorAndEnsureVisible()) );
+ if (clickedPoint != TQPoint()) {
+ TQPoint pos(clickedPoint.x() - note->x() - note->contentX() + m_editor->textEdit()->frameWidth() + 4 - m_editor->textEdit()->frameWidth(),
clickedPoint.y() - note->y() - m_editor->textEdit()->frameWidth());
// Do it right before the kapp->processEvents() to not have the cursor to quickly flicker at end (and sometimes stay at end AND where clicked):
m_editor->textEdit()->moveCursor(KTextEdit::MoveHome, false);
@@ -4071,7 +4080,7 @@ void Basket::noteEdit(Note *note, bool justAdded, const QPoint &clickedPoint) //
}
// kapp->processEvents(); // Show the editor toolbar before ensuring the note is visible
ensureNoteVisible(note); // because toolbar can create a new line and then partially hide the note
- m_editor->widget()->setFocus(); // When clicking in the basket, a QTimer::singleShot(0, ...) focus the basket! So we focus the the widget after kapp->processEvents()
+ m_editor->widget()->setFocus(); // When clicking in the basket, a TQTimer::singleShot(0, ...) focus the basket! So we focus the the widget after kapp->processEvents()
emit resetStatusBarText(); // Display "Editing. ... to validate."
} else {
// Delete the note user have canceled the addition:
@@ -4127,7 +4136,7 @@ void Basket::focusANonSelectedNoteBelow(bool inSameColumn)
while (next && next->isSelected())
next = next->nextShownInStack();
if (next) {
- if (inSameColumn && isColumnsLayout() && m_focusedNote->parentPrimaryNote() == next->parentPrimaryNote()) {
+ if (inSameColumn && isColumnsLayout() && m_focusedNote->tqparentPrimaryNote() == next->tqparentPrimaryNote()) {
setFocusedNote(next);
m_startOfShiftSelectionNote = next;
}
@@ -4143,7 +4152,7 @@ void Basket::focusANonSelectedNoteAbove(bool inSameColumn)
while (prev && prev->isSelected())
prev = prev->prevShownInStack();
if (prev) {
- if (inSameColumn && isColumnsLayout() && m_focusedNote->parentPrimaryNote() == prev->parentPrimaryNote()) {
+ if (inSameColumn && isColumnsLayout() && m_focusedNote->tqparentPrimaryNote() == prev->tqparentPrimaryNote()) {
setFocusedNote(prev);
m_startOfShiftSelectionNote = prev;
}
@@ -4181,19 +4190,19 @@ void Basket::noteDeleteWithoutConfirmation(bool deleteFilesToo)
note = next;
}
- relayoutNotes(true); // FIXME: filterAgain()?
+ retqlayoutNotes(true); // FIXME: filterAgain()?
save();
}
void Basket::doCopy(CopyMode copyMode)
{
- QClipboard *cb = KApplication::clipboard();
- QClipboard::Mode mode = (copyMode == CopyToSelection ? QClipboard::Selection : QClipboard::Clipboard);
+ TQClipboard *cb = KApplication::tqclipboard();
+ TQClipboard::Mode mode = (copyMode == CopyToSelection ? TQClipboard::Selection : TQClipboard::Clipboard);
NoteSelection *selection = selectedNotes();
int countCopied = countSelecteds();
if (selection->firstStacked()) {
- QDragObject *d = NoteDrag::dragObject(selection, copyMode == CutToClipboard, /*source=*/0); // d will be deleted by QT
+ TQDragObject *d = NoteDrag::dragObject(selection, copyMode == CutToClipboard, /*source=*/0); // d will be deleted by QT
// /*bool shouldRemove = */d->drag();
// delete selection;
cb->setData(d, mode); // NoteMultipleDrag will be deleted by QT
@@ -4250,19 +4259,19 @@ void Basket::noteOpen(Note *note)
return;
KURL url = note->content()->urlToOpen(/*with=*/false);
- QString message = note->content()->messageWhenOpenning(NoteContent::OpenOne /*NoteContent::OpenSeveral*/);
+ TQString message = note->content()->messageWhenOpenning(NoteContent::OpenOne /*NoteContent::OpenSeveral*/);
if (url.isEmpty()) {
if (message.isEmpty())
emit postMessage(i18n("Unable to open this note.") /*"Unable to open those notes."*/);
else {
- int result = KMessageBox::warningContinueCancel(this, message, /*caption=*/QString::null, KGuiItem(i18n("&Edit"), "edit"));
+ int result = KMessageBox::warningContinueCancel(this, message, /*caption=*/TQString(), KGuiItem(i18n("&Edit"), "edit"));
if (result == KMessageBox::Continue)
noteEdit(note);
}
} else {
emit postMessage(message); // "Openning link target..." / "Launching application..." / "Openning note file..."
// Finally do the opening job:
- QString customCommand = note->content()->customOpenCommand();
+ TQString customCommand = note->content()->customOpenCommand();
if (customCommand.isEmpty()) {
KRun *run = new KRun(url);
run->setAutoDelete(true);
@@ -4274,13 +4283,13 @@ void Basket::noteOpen(Note *note)
/** Code from bool KRun::displayOpenWithDialog(const KURL::List& lst, bool tempFiles)
* It does not allow to set a text, so I ripped it to do that:
*/
-bool KRun__displayOpenWithDialog(const KURL::List& lst, bool tempFiles, const QString &text)
+bool KRun__displayOpenWithDialog(const KURL::List& lst, bool tempFiles, const TQString &text)
{
if (kapp && !kapp->authorizeKAction("openwith")) {
KMessageBox::sorry(0L, i18n("You are not authorized to open this file.")); // TODO: Better message, i18n freeze :-(
return false;
}
- KOpenWithDlg l(lst, text, QString::null, 0L);
+ KOpenWithDlg l(lst, text, TQString(), 0L);
if (l.exec()) {
KService::Ptr service = l.service();
if (!!service)
@@ -4299,8 +4308,8 @@ void Basket::noteOpenWith(Note *note)
return;
KURL url = note->content()->urlToOpen(/*with=*/true);
- QString message = note->content()->messageWhenOpenning(NoteContent::OpenOneWith /*NoteContent::OpenSeveralWith*/);
- QString text = note->content()->messageWhenOpenning(NoteContent::OpenOneWithDialog /*NoteContent::OpenSeveralWithDialog*/);
+ TQString message = note->content()->messageWhenOpenning(NoteContent::OpenOneWith /*NoteContent::OpenSeveralWith*/);
+ TQString text = note->content()->messageWhenOpenning(NoteContent::OpenOneWithDialog /*NoteContent::OpenSeveralWithDialog*/);
if (url.isEmpty())
emit postMessage(i18n("Unable to open this note.") /*"Unable to open those notes."*/);
else if (KRun__displayOpenWithDialog(url, false, text))
@@ -4319,7 +4328,7 @@ void Basket::noteSaveAs()
if (url.isEmpty())
return;
- QString fileName = KFileDialog::getSaveFileName(url.fileName(), note->content()->saveAsFilters(), this, i18n("Save to File"));
+ TQString fileName = KFileDialog::getSaveFileName(url.fileName(), note->content()->saveAsFilters(), this, i18n("Save to File"));
// TODO: Ask to overwrite !
if (fileName.isEmpty())
return;
@@ -4418,14 +4427,14 @@ void Basket::noteGroup()
// Create and insert the receiving group:
Note *group = new Note(this);
if (first->isFree()) {
- insertNote(group, 0L, Note::BottomColumn, QPoint(first->finalX(), first->finalY()), /*animateNewPosition=*/false);
+ insertNote(group, 0L, Note::BottomColumn, TQPoint(first->finalX(), first->finalY()), /*animateNewPosition=*/false);
} else {
- insertNote(group, first, Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
+ insertNote(group, first, Note::TopInsert, TQPoint(), /*animateNewPosition=*/false);
}
- // Put a FAKE UNSELECTED note in the new group, so if the new group is inside an allSelected() group, the parent group is not moved inside the new group!
- Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
- insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+ // Put a FAKE UNSELECTED note in the new group, so if the new group is inside an allSelected() group, the tqparent group is not moved inside the new group!
+ Note *fakeNote = NoteFactory::createNoteColor(TQt::red, this);
+ insertNote(fakeNote, group, Note::BottomColumn, TQPoint(), /*animateNewPosition=*/false);
// Group the notes:
Note *nextNote;
@@ -4443,7 +4452,7 @@ void Basket::noteGroup()
unselectAll();
group->setSelectedRecursivly(true); // Notes were unselected by unplugging
- relayoutNotes(true);
+ retqlayoutNotes(true);
save();
}
@@ -4466,9 +4475,9 @@ void Basket::insertSelection(NoteSelection *selection, Note *after)
for (NoteSelection *toUnplug = selection->firstStacked(); toUnplug; toUnplug = toUnplug->nextStacked()) {
if (toUnplug->note->isGroup()) {
Note *group = new Note(this);
- insertNote(group, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/false);
- Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
- insertNote(fakeNote, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+ insertNote(group, after, Note::BottomInsert, TQPoint(), /*animateNewPosition=*/false);
+ Note *fakeNote = NoteFactory::createNoteColor(TQt::red, this);
+ insertNote(fakeNote, group, Note::BottomColumn, TQPoint(), /*animateNewPosition=*/false);
insertSelection(toUnplug->firstChild, fakeNote);
unplugNote(fakeNote);
after = group;
@@ -4476,7 +4485,7 @@ void Basket::insertSelection(NoteSelection *selection, Note *after)
Note *note = toUnplug->note;
note->setPrev(0);
note->setNext(0);
- insertNote(note, after, Note::BottomInsert, QPoint(), /*animateNewPosition=*/true);
+ insertNote(note, after, Note::BottomInsert, TQPoint(), /*animateNewPosition=*/true);
after = note;
}
}
@@ -4494,26 +4503,26 @@ void Basket::selectSelection(NoteSelection *selection)
void Basket::noteMoveOnTop()
{
- // TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
+ // TODO: Get the group containing the selected notes and first move inside the group, then inside tqparent group, then in the basket
// TODO: Move on top/bottom... of the column or basjet
NoteSelection *selection = selectedNotes();
unplugSelection(selection);
// Replug the notes:
- Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+ Note *fakeNote = NoteFactory::createNoteColor(TQt::red, this);
if (isColumnsLayout()) {
if (firstNote()->firstChild())
- insertNote(fakeNote, firstNote()->firstChild(), Note::TopInsert, QPoint(), /*animateNewPosition=*/false);
+ insertNote(fakeNote, firstNote()->firstChild(), Note::TopInsert, TQPoint(), /*animateNewPosition=*/false);
else
- insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+ insertNote(fakeNote, firstNote(), Note::BottomColumn, TQPoint(), /*animateNewPosition=*/false);
} else {
// TODO: Also allow to move notes on top of a group!!!!!!!
- insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+ insertNote(fakeNote, 0, Note::BottomInsert, TQPoint(0, 0), /*animateNewPosition=*/false);
}
insertSelection(selection, fakeNote);
unplugNote(fakeNote);
selectSelection(selection);
- relayoutNotes(true);
+ retqlayoutNotes(true);
save();
}
@@ -4522,23 +4531,23 @@ void Basket::noteMoveOnBottom()
// TODO: Duplicate code: void noteMoveOn();
- // TODO: Get the group containing the selected notes and first move inside the group, then inside parent group, then in the basket
+ // TODO: Get the group containing the selected notes and first move inside the group, then inside tqparent group, then in the basket
// TODO: Move on top/bottom... of the column or basjet
NoteSelection *selection = selectedNotes();
unplugSelection(selection);
// Replug the notes:
- Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+ Note *fakeNote = NoteFactory::createNoteColor(TQt::red, this);
if (isColumnsLayout())
- insertNote(fakeNote, firstNote(), Note::BottomColumn, QPoint(), /*animateNewPosition=*/false);
+ insertNote(fakeNote, firstNote(), Note::BottomColumn, TQPoint(), /*animateNewPosition=*/false);
else {
// TODO: Also allow to move notes on top of a group!!!!!!!
- insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+ insertNote(fakeNote, 0, Note::BottomInsert, TQPoint(0, 0), /*animateNewPosition=*/false);
}
insertSelection(selection, fakeNote);
unplugNote(fakeNote);
selectSelection(selection);
- relayoutNotes(true);
+ retqlayoutNotes(true);
save();
}
@@ -4547,17 +4556,17 @@ void Basket::moveSelectionTo(Note *here, bool below/* = true*/)
NoteSelection *selection = selectedNotes();
unplugSelection(selection);
// Replug the notes:
- Note *fakeNote = NoteFactory::createNoteColor(Qt::red, this);
+ Note *fakeNote = NoteFactory::createNoteColor(TQt::red, this);
// if (isColumnsLayout())
- insertNote(fakeNote, here, (below ? Note::BottomInsert : Note::TopInsert), QPoint(), /*animateNewPosition=*/false);
+ insertNote(fakeNote, here, (below ? Note::BottomInsert : Note::TopInsert), TQPoint(), /*animateNewPosition=*/false);
// else {
// // TODO: Also allow to move notes on top of a group!!!!!!!
-// insertNote(fakeNote, 0, Note::BottomInsert, QPoint(0, 0), /*animateNewPosition=*/false);
+// insertNote(fakeNote, 0, Note::BottomInsert, TQPoint(0, 0), /*animateNewPosition=*/false);
// }
insertSelection(selection, fakeNote);
unplugNote(fakeNote);
selectSelection(selection);
- relayoutNotes(true);
+ retqlayoutNotes(true);
save();
}
@@ -4582,9 +4591,9 @@ void Basket::noteMoveNoteDown()
moveSelectionTo(next, /*below=*/true);
}
-void Basket::wheelEvent(QWheelEvent *event)
+void Basket::wheelEvent(TQWheelEvent *event)
{
- QScrollView::wheelEvent(event);
+ TQScrollView::wheelEvent(event);
}
void Basket::linkLookChanged()
@@ -4594,7 +4603,7 @@ void Basket::linkLookChanged()
note->linkLookChanged();
note = note->next();
}
- relayoutNotes(true);
+ retqlayoutNotes(true);
}
void Basket::slotCopyingDone2(KIO::Job *job)
@@ -4615,7 +4624,7 @@ void Basket::slotCopyingDone2(KIO::Job *job)
} // on bottom of the basket it's not visible entirly anymore
}
-Note* Basket::noteForFullPath(const QString &path)
+Note* Basket::noteForFullPath(const TQString &path)
{
Note *note = firstNote();
Note *found;
@@ -4634,33 +4643,33 @@ void Basket::deleteFiles()
Tools::deleteRecursively(fullPath());
}
-QValueList<State*> Basket::usedStates()
+TQValueList<State*> Basket::usedStates()
{
- QValueList<State*> states;
+ TQValueList<State*> states;
FOR_EACH_NOTE (note)
note->usedStates(states);
return states;
}
-QString Basket::saveGradientBackground(const QColor &color, const QFont &font, const QString &folder)
+TQString Basket::saveGradientBackground(const TQColor &color, const TQFont &font, const TQString &folder)
{
// Construct file name and return if the file already exists:
- QString fileName = "note_background_" + color.name().lower().mid(1) + ".png";
- QString fullPath = folder + fileName;
- if (QFile::exists(fullPath))
+ TQString fileName = "note_background_" + TQString(color.name()).lower().mid(1) + ".png";
+ TQString fullPath = folder + fileName;
+ if (TQFile::exists(fullPath))
return fileName;
// Get the gradient top and bottom colors:
- QColor topBgColor;
- QColor bottomBgColor;
+ TQColor topBgColor;
+ TQColor bottomBgColor;
Note::getGradientColors(color, &topBgColor, &bottomBgColor);
// Draw and save the gradient image:
- int sampleTextHeight = QFontMetrics(font)
- .boundingRect(0, 0, /*width=*/10000, /*height=*/0, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, "Test text")
+ int sampleTextHeight = TQFontMetrics(font)
+ .boundingRect(0, 0, /*width=*/10000, /*height=*/0, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, "Test text")
.height();
- QPixmap noteGradient(100, sampleTextHeight + Note::NOTE_MARGIN);
- QPainter painter(&noteGradient);
+ TQPixmap noteGradient(100, sampleTextHeight + Note::NOTE_MARGIN);
+ TQPainter painter(&noteGradient);
drawGradient(&painter, topBgColor, bottomBgColor, 0, 0, noteGradient.width(), noteGradient.height(), /*sunken=*/false, /*horz=*/true, /*flat=*/false);
painter.end();
noteGradient.save(fullPath, "PNG");
@@ -4669,7 +4678,7 @@ QString Basket::saveGradientBackground(const QColor &color, const QFont &font, c
return fileName;
}
-void Basket::listUsedTags(QValueList<Tag*> &list)
+void Basket::listUsedTags(TQValueList<Tag*> &list)
{
if (!isLoaded()) {
load();
@@ -4786,7 +4795,7 @@ Note* Basket::noteOn(NoteOn side)
int bestDistance = contentsWidth() * contentsHeight() * 10;
Note *note = firstNoteShownInStack();
- Note *primary = m_focusedNote->parentPrimaryNote();
+ Note *primary = m_focusedNote->tqparentPrimaryNote();
while (note) {
switch (side) {
case LEFT_SIDE: distance = m_focusedNote->distanceOnLeftRight(note, LEFT_SIDE); break;
@@ -4794,7 +4803,7 @@ Note* Basket::noteOn(NoteOn side)
case TOP_SIDE: distance = m_focusedNote->distanceOnTopBottom(note, TOP_SIDE); break;
case BOTTOM_SIDE: distance = m_focusedNote->distanceOnTopBottom(note, BOTTOM_SIDE); break;
}
- if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note->parentPrimaryNote()) && note != m_focusedNote && distance > 0 && distance < bestDistance) {
+ if ((side == TOP_SIDE || side == BOTTOM_SIDE || primary != note->tqparentPrimaryNote()) && note != m_focusedNote && distance > 0 && distance < bestDistance) {
bestNote = note;
bestDistance = distance;
}
@@ -4807,12 +4816,12 @@ Note* Basket::noteOn(NoteOn side)
Note* Basket::firstNoteInGroup()
{
Note *child = m_focusedNote;
- Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : 0);
- while (parent) {
- if (parent->firstChild() != child && !parent->isColumn())
- return parent->firstRealChild();
- child = parent;
- parent = parent->parentNote();
+ Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0);
+ while (tqparent) {
+ if (tqparent->firstChild() != child && !tqparent->isColumn())
+ return tqparent->firstRealChild();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
return 0;
}
@@ -4821,12 +4830,12 @@ Note* Basket::noteOnHome()
{
// First try to find the first note of the group containing the focused note:
Note *child = m_focusedNote;
- Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : 0);
- while (parent) {
- if (parent->nextShownInStack() != m_focusedNote)
- return parent->nextShownInStack();
- child = parent;
- parent = parent->parentNote();
+ Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0);
+ while (tqparent) {
+ if (tqparent->nextShownInStack() != m_focusedNote)
+ return tqparent->nextShownInStack();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
// If it was not found, then focus the very first note in the basket:
@@ -4848,10 +4857,10 @@ Note* Basket::noteOnHome()
Note* Basket::noteOnEnd()
{
Note *child = m_focusedNote;
- Note *parent = (m_focusedNote ? m_focusedNote->parentNote() : 0);
+ Note *tqparent = (m_focusedNote ? m_focusedNote->tqparentNote() : 0);
Note *lastChild;
- while (parent) {
- lastChild = parent->lastRealChild();
+ while (tqparent) {
+ lastChild = tqparent->lastRealChild();
if (lastChild && lastChild != m_focusedNote) {
if (lastChild->isShown())
return lastChild;
@@ -4859,8 +4868,8 @@ Note* Basket::noteOnEnd()
if (lastChild && lastChild->isShown() && lastChild != m_focusedNote)
return lastChild;
}
- child = parent;
- parent = parent->parentNote();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
if (isFreeLayout()) {
Note *last;
@@ -4878,14 +4887,14 @@ Note* Basket::noteOnEnd()
}
-void Basket::keyPressEvent(QKeyEvent *event)
+void Basket::keyPressEvent(TQKeyEvent *event)
{
- if (isDuringEdit() && event->key() == Qt::Key_Return) {
+ if (isDuringEdit() && event->key() == TQt::Key_Return) {
//if (m_editor->lineEdit())
// closeEditor();
//else
m_editor->widget()->setFocus();
- } else if (event->key() == Qt::Key_Escape) {
+ } else if (event->key() == TQt::Key_Escape) {
if (isDuringEdit())
closeEditor();
else if (decoration()->filterData().isFiltering)
@@ -4903,19 +4912,19 @@ void Basket::keyPressEvent(QKeyEvent *event)
Note *toFocus = 0L;
switch (event->key()) {
- case Qt::Key_Down:
+ case TQt::Key_Down:
toFocus = (isFreeLayout() ? noteOn(BOTTOM_SIDE) : m_focusedNote->nextShownInStack());
if (toFocus)
break;
scrollBy(0, 30); // This cases do not move focus to another note...
return;
- case Qt::Key_Up:
+ case TQt::Key_Up:
toFocus = (isFreeLayout() ? noteOn(TOP_SIDE) : m_focusedNote->prevShownInStack());
if (toFocus)
break;
scrollBy(0, -30); // This cases do not move focus to another note...
return;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
if (isFreeLayout()) {
Note *lastFocused = m_focusedNote;
for (int i = 0; i < 10 && m_focusedNote; ++i)
@@ -4933,7 +4942,7 @@ void Basket::keyPressEvent(QKeyEvent *event)
break;
scrollBy(0, visibleHeight() / 2); // This cases do not move focus to another note...
return;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
if (isFreeLayout()) {
Note *lastFocused = m_focusedNote;
for (int i = 0; i < 10 && m_focusedNote; ++i)
@@ -4951,13 +4960,13 @@ void Basket::keyPressEvent(QKeyEvent *event)
break;
scrollBy(0, - visibleHeight() / 2); // This cases do not move focus to another note...
return;
- case Qt::Key_Home:
+ case TQt::Key_Home:
toFocus = noteOnHome();
break;
- case Qt::Key_End:
+ case TQt::Key_End:
toFocus = noteOnEnd();
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
if (m_focusedNote->tryFoldParent())
return;
if ( (toFocus = noteOn(LEFT_SIDE)) )
@@ -4966,14 +4975,14 @@ void Basket::keyPressEvent(QKeyEvent *event)
break;
scrollBy(-30, 0); // This cases do not move focus to another note...
return;
- case Qt::Key_Right:
+ case TQt::Key_Right:
if (m_focusedNote->tryExpandParent())
return;
if ( (toFocus = noteOn(RIGHT_SIDE)) )
break;
scrollBy(30, 0); // This cases do not move focus to another note...
return;
- case Qt::Key_Space: // This case do not move focus to another note...
+ case TQt::Key_Space: // This case do not move focus to another note...
if (m_focusedNote) {
m_focusedNote->setSelected( ! m_focusedNote->isSelected() );
event->accept();
@@ -4989,19 +4998,19 @@ void Basket::keyPressEvent(QKeyEvent *event)
return;
}
- if (event->state() & Qt::ShiftButton) { // Shift+arrowKeys selection
+ if (event->state() & TQt::ShiftButton) { // Shift+arrowKeys selection
if (m_startOfShiftSelectionNote == 0L)
m_startOfShiftSelectionNote = toFocus;
- ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
+ ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else tqrepaint would be done on the wrong part!
selectRange(m_startOfShiftSelectionNote, toFocus);
setFocusedNote(toFocus);
event->accept();
return;
} else /*if (toFocus != m_focusedNote)*/ { // Move focus to ANOTHER note...
- ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else repaint would be done on the wrong part!
+ ensureNoteVisible(toFocus); // Important: this line should be before the other ones because else tqrepaint would be done on the wrong part!
setFocusedNote(toFocus);
m_startOfShiftSelectionNote = toFocus;
- if ( ! (event->state() & Qt::ControlButton) ) // ... select only current note if Control
+ if ( ! (event->state() & TQt::ControlButton) ) // ... select only current note if Control
unselectAllBut(m_focusedNote);
event->accept();
return;
@@ -5038,11 +5047,11 @@ void Basket::selectRange(Note *start, Note *end, bool unselectOthers /*= true*/)
return;
}
- // Free layout baskets should select range as if we were drawing a rectangle between start and end:
+ // Free tqlayout baskets should select range as if we were drawing a rectangle between start and end:
if (isFreeLayout()) {
- QRect startRect( start->finalX(), start->finalY(), start->width(), start->finalHeight() );
- QRect endRect( end->finalX(), end->finalY(), end->width(), end->finalHeight() );
- QRect toSelect = startRect.unite(endRect);
+ TQRect startRect( start->finalX(), start->finalY(), start->width(), start->finalHeight() );
+ TQRect endRect( end->finalX(), end->finalY(), end->width(), end->finalHeight() );
+ TQRect toSelect = startRect.unite(endRect);
selectNotesIn(toSelect, /*invertSelection=*/false, unselectOthers);
return;
}
@@ -5077,17 +5086,17 @@ void Basket::selectRange(Note *start, Note *end, bool unselectOthers /*= true*/)
cur->setSelected(false);
}
-void Basket::focusInEvent(QFocusEvent*)
+void Basket::focusInEvent(TQFocusEvent*)
{
// Focus cannot be get with Tab when locked, but a click can focus the basket!
if (isLocked()) {
if (m_button)
- QTimer::singleShot( 0, m_button, SLOT(setFocus()) );
+ TQTimer::singleShot( 0, m_button, TQT_SLOT(setFocus()) );
} else
focusANote(); // hasFocus() is true at this stage, note will be focused
}
-void Basket::focusOutEvent(QFocusEvent*)
+void Basket::focusOutEvent(TQFocusEvent*)
{
if (m_focusedNote != 0L)
m_focusedNote->setFocused(false);
@@ -5101,27 +5110,27 @@ void Basket::ensureNoteVisible(Note *note)
if (note == editedNote()) // HACK: When filtering while editing big notes, etc... cause unwanted scrolls
return;
- int finalBottom = note->finalY() + QMIN(note->finalHeight(), visibleHeight());
- int finalRight = note->finalX() + QMIN(note->width() + (note->hasResizer() ? Note::RESIZER_WIDTH : 0), visibleWidth());
+ int finalBottom = note->finalY() + TQMIN(note->finalHeight(), visibleHeight());
+ int finalRight = note->finalX() + TQMIN(note->width() + (note->hasResizer() ? Note::RESIZER_WIDTH : 0), visibleWidth());
ensureVisible( finalRight, finalBottom, 0,0 );
ensureVisible( note->finalX(), note->finalY(), 0,0 );
}
-void Basket::addWatchedFile(const QString &fullPath)
+void Basket::addWatchedFile(const TQString &fullPath)
{
// DEBUG_WIN << "Watcher>Add Monitoring Of : <font color=blue>" + fullPath + "</font>";
m_watcher->addFile(fullPath);
}
-void Basket::removeWatchedFile(const QString &fullPath)
+void Basket::removeWatchedFile(const TQString &fullPath)
{
// DEBUG_WIN << "Watcher>Remove Monitoring Of : <font color=blue>" + fullPath + "</font>";
m_watcher->removeFile(fullPath);
}
-void Basket::watchedFileModified(const QString &fullPath)
+void Basket::watchedFileModified(const TQString &fullPath)
{
- if (!m_modifiedFiles.contains(fullPath))
+ if (!m_modifiedFiles.tqcontains(fullPath))
m_modifiedFiles.append(fullPath);
// If a big file is saved by an application, notifications are send several times.
// We wait they are not sent anymore to considere the file complete!
@@ -5129,7 +5138,7 @@ void Basket::watchedFileModified(const QString &fullPath)
DEBUG_WIN << "Watcher>Modified : <font color=blue>" + fullPath + "</font>";
}
-void Basket::watchedFileDeleted(const QString &fullPath)
+void Basket::watchedFileDeleted(const TQString &fullPath)
{
Note *note = noteForFullPath(fullPath);
removeWatchedFile(fullPath);
@@ -5147,7 +5156,7 @@ void Basket::watchedFileDeleted(const QString &fullPath)
void Basket::updateModifiedNotes()
{
- for (QValueList<QString>::iterator it = m_modifiedFiles.begin(); it != m_modifiedFiles.end(); ++it) {
+ for (TQValueList<TQString>::iterator it = m_modifiedFiles.begin(); it != m_modifiedFiles.end(); ++it) {
Note *note = noteForFullPath(*it);
if (note)
note->content()->loadFromFile(/*lazyLoad=*/false);
@@ -5155,14 +5164,14 @@ void Basket::updateModifiedNotes()
m_modifiedFiles.clear();
}
-bool Basket::setProtection(int type, QString key)
+bool Basket::setProtection(int type, TQString key)
{
#ifdef HAVE_LIBGPGME
if(type == PasswordEncryption || // Ask a new password
m_encryptionType != type || m_encryptionKey != key)
{
int savedType = m_encryptionType;
- QString savedKey = m_encryptionKey;
+ TQString savedKey = m_encryptionKey;
m_encryptionType = type;
m_encryptionKey = key;
@@ -5209,15 +5218,15 @@ bool Basket::saveAgain()
return result;
}
-bool Basket::loadFromFile(const QString &fullPath, QString *string, bool isLocalEncoding)
+bool Basket::loadFromFile(const TQString &fullPath, TQString *string, bool isLocalEncoding)
{
- QByteArray array;
+ TQByteArray array;
if(loadFromFile(fullPath, &array)){
if (isLocalEncoding)
- *string = QString::fromLocal8Bit(array.data(), array.size());
+ *string = TQString::fromLocal8Bit(array.data(), array.size());
else
- *string = QString::fromUtf8(array.data(), array.size());
+ *string = TQString::fromUtf8(array.data(), array.size());
return true;
}
else
@@ -5231,10 +5240,10 @@ bool Basket::isEncrypted()
bool Basket::isFileEncrypted()
{
- QFile file(fullPath() + ".basket");
+ TQFile file(fullPath() + ".basket");
if (file.open(IO_ReadOnly)){
- QString line;
+ TQString line;
file.readLine(line, 32);
if(line.startsWith("-----BEGIN PGP MESSAGE-----"))
@@ -5243,9 +5252,9 @@ bool Basket::isFileEncrypted()
return false;
}
-bool Basket::loadFromFile(const QString &fullPath, QByteArray *array)
+bool Basket::loadFromFile(const TQString &fullPath, TQByteArray *array)
{
- QFile file(fullPath);
+ TQFile file(fullPath);
bool encrypted = false;
if (file.open(IO_ReadOnly)){
@@ -5264,7 +5273,7 @@ bool Basket::loadFromFile(const QString &fullPath, QByteArray *array)
#ifdef HAVE_LIBGPGME
if(encrypted)
{
- QByteArray tmp(*array);
+ TQByteArray tmp(*array);
tmp.detach();
// Only use gpg-agent for private key encryption since it doesn't
@@ -5273,7 +5282,7 @@ bool Basket::loadFromFile(const QString &fullPath, QByteArray *array)
if(m_encryptionType == PrivateKeyEncryption)
m_gpg->setText(i18n("Please enter the password for the following private key:"), false);
else
- m_gpg->setText(i18n("Please enter the password for the basket <b>%1</b>:").arg(basketName()), false); // Used when decrypting
+ m_gpg->setText(i18n("Please enter the password for the basket <b>%1</b>:").tqarg(basketName()), false); // Used when decrypting
return m_gpg->decrypt(tmp, array);
}
#else
@@ -5287,26 +5296,26 @@ bool Basket::loadFromFile(const QString &fullPath, QByteArray *array)
return false;
}
-bool Basket::saveToFile(const QString& fullPath, const QString& string, bool isLocalEncoding)
+bool Basket::saveToFile(const TQString& fullPath, const TQString& string, bool isLocalEncoding)
{
- QCString bytes = (isLocalEncoding ? string.local8Bit() : string.utf8());
+ TQCString bytes = (isLocalEncoding ? string.local8Bit() : string.utf8());
return saveToFile(fullPath, bytes, bytes.length());
}
-bool Basket::saveToFile(const QString& fullPath, const QByteArray& array)
+bool Basket::saveToFile(const TQString& fullPath, const TQByteArray& array)
{
return saveToFile(fullPath, array, array.size());
}
-bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULONG length)
+bool Basket::saveToFile(const TQString& fullPath, const TQByteArray& array, TQ_ULONG length)
{
bool success = true;
- QByteArray tmp;
+ TQByteArray tmp;
#ifdef HAVE_LIBGPGME
if(isEncrypted())
{
- QString key = QString::null;
+ TQString key = TQString();
// We only use gpg-agent for private key encryption and saving without
// public key doesn't need one.
@@ -5318,7 +5327,7 @@ bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULON
m_gpg->setText("", false);
}
else
- m_gpg->setText(i18n("Please assign a password to the basket <b>%1</b>:").arg(basketName()), true); // Used when defining a new password
+ m_gpg->setText(i18n("Please assign a password to the basket <b>%1</b>:").tqarg(basketName()), true); // Used when defining a new password
success = m_gpg->encrypt(array, length, &tmp, key);
length = tmp.size();
@@ -5332,7 +5341,7 @@ bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULON
tmp = array;
#endif
/*if (success && (success = file.open(IO_WriteOnly))){
- success = (file.writeBlock(tmp) == (Q_LONG)tmp.size());
+ success = (file.writeBlock(tmp) == (TQ_LONG)tmp.size());
file.close();
}*/
@@ -5346,7 +5355,7 @@ bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULON
* Basically, to save a file owned by a basket (a basket or a note file), use saveToFile().
* But to save another file (eg. the basket hierarchy), use this safelySaveToFile() static method.
*/
-/*static*/ bool Basket::safelySaveToFile(const QString& fullPath, const QByteArray& array, Q_ULONG length)
+/*static*/ bool Basket::safelySaveToFile(const TQString& fullPath, const TQByteArray& array, TQ_ULONG length)
{
// Here, we take a double protection:
// - We use KSaveFile to write atomically to the file (either it's a success or the file is untouched)
@@ -5385,11 +5394,11 @@ bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULON
),
(openSuccess
? i18n("Please remove files on the disk <b>%1</b> to let the application safely save your changes.")
- .arg(KIO::findPathMountPoint(fullPath))
- : i18n("File permissions are bad for <b>%1</b>. Please check that you have write access to it and the parent folders.")
- .arg(fullPath)
+ .tqarg(KIO::findPathMountPoint(fullPath))
+ : i18n("File permissions are bad for <b>%1</b>. Please check that you have write access to it and the tqparent folders.")
+ .tqarg(fullPath)
),
- kapp->activeWindow()
+ TQT_TQWIDGET(kapp->activeWindow())
);
}
if (!dialog->isShown())
@@ -5410,47 +5419,47 @@ bool Basket::saveToFile(const QString& fullPath, const QByteArray& array, Q_ULON
return true; // Hum...?!
}
-/*static*/ bool Basket::safelySaveToFile(const QString& fullPath, const QString& string, bool isLocalEncoding)
+/*static*/ bool Basket::safelySaveToFile(const TQString& fullPath, const TQString& string, bool isLocalEncoding)
{
- QCString bytes = (isLocalEncoding ? string.local8Bit() : string.utf8());
+ TQCString bytes = (isLocalEncoding ? string.local8Bit() : string.utf8());
return safelySaveToFile(fullPath, bytes, bytes.length() - 1);
}
-/*static*/ bool Basket::safelySaveToFile(const QString& fullPath, const QByteArray& array)
+/*static*/ bool Basket::safelySaveToFile(const TQString& fullPath, const TQByteArray& array)
{
return safelySaveToFile(fullPath, array, array.size());
}
-DiskErrorDialog::DiskErrorDialog(const QString &titleMessage, const QString &message, QWidget *parent)
+DiskErrorDialog::DiskErrorDialog(const TQString &titleMessage, const TQString &message, TQWidget *tqparent)
: KDialogBase(KDialogBase::Plain, i18n("Save Error"),
- (KDialogBase::ButtonCode)0, (KDialogBase::ButtonCode)0, parent, /*name=*/"DiskError")
+ (KDialogBase::ButtonCode)0, (KDialogBase::ButtonCode)0, tqparent, /*name=*/"DiskError")
{
//enableButtonCancel(false);
//enableButtonClose(false);
//enableButton(Close, false);
//enableButtonOK(false);
setModal(true);
- QHBoxLayout *layout = new QHBoxLayout(plainPage(), /*margin=*/0, spacingHint());
- QPixmap icon = kapp->iconLoader()->loadIcon("hdd_unmount", KIcon::NoGroup, 64, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
- QLabel *iconLabel = new QLabel(plainPage());
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(plainPage(), /*margin=*/0, spacingHint());
+ TQPixmap icon = kapp->iconLoader()->loadIcon("hdd_unmount", KIcon::NoGroup, 64, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
+ TQLabel *iconLabel = new TQLabel(plainPage());
iconLabel->setPixmap(icon);
- iconLabel->setFixedSize(iconLabel->sizeHint());
- QLabel *label = new QLabel("<p><nobr><b><font size='+1'>" + titleMessage + "</font></b></nobr></p><p>" + message + "</p>", plainPage());
+ iconLabel->setFixedSize(iconLabel->tqsizeHint());
+ TQLabel *label = new TQLabel("<p><nobr><b><font size='+1'>" + titleMessage + "</font></b></nobr></p><p>" + message + "</p>", plainPage());
if (!icon.isNull())
- layout->addWidget(iconLabel);
- layout->addWidget(label);
+ tqlayout->addWidget(iconLabel);
+ tqlayout->addWidget(label);
}
DiskErrorDialog::~DiskErrorDialog()
{
}
-void DiskErrorDialog::closeEvent(QCloseEvent *event)
+void DiskErrorDialog::closeEvent(TQCloseEvent *event)
{
event->ignore();
}
-void DiskErrorDialog::keyPressEvent(QKeyEvent*)
+void DiskErrorDialog::keyPressEvent(TQKeyEvent*)
{
// Escape should not close the window...
}
@@ -5471,48 +5480,48 @@ void Basket::lock()
#if 0
-#include <qlayout.h>
-#include <qvbox.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qcolor.h>
+#include <tqlayout.h>
+#include <tqvbox.h>
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
#include <kpopupmenu.h>
#include <kurllabel.h>
-#include <qcheckbox.h>
-#include <qpalette.h>
-#include <qcursor.h>
-#include <qaction.h>
+#include <tqcheckbox.h>
+#include <tqpalette.h>
+#include <tqcursor.h>
+#include <tqaction.h>
#include <kstdaccel.h>
#include <kglobalsettings.h>
-#include <qevent.h>
+#include <tqevent.h>
#include <kapplication.h>
#include <kaboutdata.h>
-#include <qinputdialog.h>
-#include <qdragobject.h>
+#include <tqinputdialog.h>
+#include <tqdragobject.h>
#include <kurldrag.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kmimetype.h>
#include <kfiledialog.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kiconloader.h>
-#include <qregexp.h>
-#include <qfileinfo.h>
+#include <tqregexp.h>
+#include <tqfileinfo.h>
-#include <qstringlist.h>
-#include <qdir.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
#include <kurl.h>
#include <krun.h>
#include <kmessagebox.h>
#include <kdeversion.h>
#include "kdirwatch.h"
-#include <qstringlist.h>
+#include <tqstringlist.h>
#include <klineedit.h>
#include <config.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include "basket.h"
#include "note.h"
@@ -5546,7 +5555,7 @@ void Basket::delNote(Note *note, bool askForMirroredFile)
if (note->isSelected())
note->setSelected(false); //removeSelectedNote();
- relayoutNotes();
+ retqlayoutNotes();
recolorizeNotes();
resetInsertTo(); // If we delete the first or the last, pointer to it is invalid
save();
@@ -5561,7 +5570,7 @@ void Basket::delNote(Note *note, bool askForMirroredFile)
// Calculate where to paste or drop
-void Basket::computeInsertPlace(const QPoint &cursorPosition)
+void Basket::computeInsertPlace(const TQPoint &cursorPosition)
{
int y = cursorPosition.y();
@@ -5583,14 +5592,14 @@ void Basket::computeInsertPlace(const QPoint &cursorPosition)
m_insertAfter = true;
// Code for rectangular notes :
- /*QRect globalRect = it->rect();
+ /*TQRect globalRect = it->rect();
globalRect.moveTopLeft(it->pos() + contentsY());
- if ( globalRect.contains(curPos) ) {
+ if ( globalRect.tqcontains(curPos) ) {
it->doInterestingThing();
}*/
}
-void Basket::dragMoveEvent(QDragMoveEvent* event)
+void Basket::dragMoveEvent(TQDragMoveEvent* event)
{
// m_isDuringDrag = true;
@@ -5598,8 +5607,8 @@ void Basket::dragMoveEvent(QDragMoveEvent* event)
return;
// FIXME: viewportToContents does NOT work !!!
-// QPoint pos = viewportToContents(event->pos());
- QPoint pos( event->pos().x() + contentsX(), event->pos().y() + contentsY() );
+// TQPoint pos = viewportToContents(event->pos());
+ TQPoint pos( event->pos().x() + contentsX(), event->pos().y() + contentsY() );
// if (insertAtCursorPos())
computeInsertPlace(pos);
@@ -5607,14 +5616,14 @@ void Basket::dragMoveEvent(QDragMoveEvent* event)
showFrameInsertTo();
acceptDropEvent(event);
- // A workarround since QScrollView::dragAutoScroll seem to have no effect :
+ // A workarround since TQScrollView::dragAutoScroll seem to have no effect :
ensureVisible(event->pos().x() + contentsX(), event->pos().y() + contentsY(), 30, 30);
-// QScrollView::dragMoveEvent(event);
+// TQScrollView::dragMoveEvent(event);
}
-void Basket::dropEvent(QDropEvent *event)
+void Basket::dropEvent(TQDropEvent *event)
{
- QPoint pos = event->pos();
+ TQPoint pos = event->pos();
std::cout << "Drop Event at position " << pos.x() << ":" << pos.y() << std::endl;
m_isDuringDrag = false;
emit resetStatusBarText();