summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--file-integration/basketthumbcreator.cpp44
-rw-r--r--file-integration/basketthumbcreator.h6
-rw-r--r--kontact_plugin/basket_plugin.cpp8
-rw-r--r--kontact_plugin/basket_plugin.h5
-rw-r--r--kontact_plugin/basketdcopiface_stub.cpp18
-rw-r--r--kontact_plugin/uniqueapphandler.cpp24
-rw-r--r--kontact_plugin/uniqueapphandler.h11
-rw-r--r--src/application.cpp16
-rw-r--r--src/application.h2
-rw-r--r--src/archive.cpp302
-rw-r--r--src/archive.h34
-rw-r--r--src/backgroundmanager.cpp84
-rw-r--r--src/backgroundmanager.h71
-rw-r--r--src/backup.cpp158
-rw-r--r--src/backup.h33
-rw-r--r--src/basket.cpp1287
-rw-r--r--src/basket.h393
-rw-r--r--src/basket_part.cpp18
-rw-r--r--src/basket_part.h13
-rw-r--r--src/basketfactory.cpp76
-rw-r--r--src/basketfactory.h20
-rw-r--r--src/basketlistview.cpp314
-rw-r--r--src/basketlistview.h55
-rw-r--r--src/basketproperties.cpp108
-rw-r--r--src/basketproperties.h23
-rw-r--r--src/basketstatusbar.cpp104
-rw-r--r--src/basketstatusbar.h35
-rw-r--r--src/bnpview.cpp656
-rw-r--r--src/bnpview.h105
-rw-r--r--src/clickablelabel.cpp2
-rw-r--r--src/clickablelabel.h13
-rw-r--r--src/colorpicker.cpp24
-rw-r--r--src/colorpicker.h11
-rw-r--r--src/crashhandler.cpp66
-rw-r--r--src/debugwindow.cpp30
-rw-r--r--src/debugwindow.h25
-rw-r--r--src/exporterdialog.cpp54
-rw-r--r--src/exporterdialog.h17
-rw-r--r--src/filter.cpp74
-rw-r--r--src/filter.h25
-rw-r--r--src/focusedwidgets.cpp96
-rw-r--r--src/focusedwidgets.h39
-rw-r--r--src/formatimporter.cpp154
-rw-r--r--src/formatimporter.h15
-rw-r--r--src/global.cpp34
-rw-r--r--src/global.h18
-rw-r--r--src/htmlexporter.cpp122
-rw-r--r--src/htmlexporter.h40
-rw-r--r--src/kcm_basket.cpp20
-rw-r--r--src/kcolorcombo2.cpp242
-rw-r--r--src/kcolorcombo2.h98
-rw-r--r--src/keyboard.cpp14
-rw-r--r--src/keyboard.h2
-rw-r--r--src/kgpgme.cpp110
-rw-r--r--src/kgpgme.h30
-rw-r--r--src/kiconcanvas.cpp84
-rw-r--r--src/kiconcanvas.h31
-rw-r--r--src/kicondialog.cpp148
-rw-r--r--src/kicondialog.h82
-rw-r--r--src/kicondialogui.ui20
-rw-r--r--src/likeback.cpp294
-rw-r--r--src/likeback.h35
-rw-r--r--src/likeback_private.h50
-rw-r--r--src/linklabel.cpp314
-rw-r--r--src/linklabel.h114
-rw-r--r--src/main.cpp6
-rw-r--r--src/mainwindow.cpp82
-rw-r--r--src/mainwindow.h43
-rw-r--r--src/newbasketdialog.cpp112
-rw-r--r--src/newbasketdialog.h40
-rw-r--r--src/note.cpp634
-rw-r--r--src/note.h96
-rw-r--r--src/notecontent.cpp836
-rw-r--r--src/notecontent.h448
-rw-r--r--src/notedrag.cpp280
-rw-r--r--src/notedrag.h44
-rw-r--r--src/noteedit.cpp358
-rw-r--r--src/noteedit.h90
-rw-r--r--src/notefactory.cpp522
-rw-r--r--src/notefactory.h78
-rw-r--r--src/password.cpp34
-rw-r--r--src/password.h14
-rw-r--r--src/passwordlayout.ui28
-rw-r--r--src/popupmenu.cpp72
-rw-r--r--src/popupmenu.h42
-rw-r--r--src/qeffects.cpp266
-rw-r--r--src/qeffects.h120
-rw-r--r--src/regiongrabber.cpp90
-rw-r--r--src/regiongrabber.h33
-rw-r--r--src/settings.cpp432
-rw-r--r--src/settings.h147
-rw-r--r--src/softwareimporters.cpp374
-rw-r--r--src/softwareimporters.h32
-rw-r--r--src/systemtray.cpp146
-rw-r--r--src/systemtray.h38
-rw-r--r--src/tag.cpp308
-rw-r--r--src/tag.h122
-rw-r--r--src/tagsedit.cpp478
-rw-r--r--src/tagsedit.h86
-rw-r--r--src/tools.cpp234
-rw-r--r--src/tools.h44
-rw-r--r--src/variouswidgets.cpp124
-rw-r--r--src/variouswidgets.h68
-rw-r--r--src/xmlwork.cpp52
-rw-r--r--src/xmlwork.h20
105 files changed, 6868 insertions, 6775 deletions
diff --git a/file-integration/basketthumbcreator.cpp b/file-integration/basketthumbcreator.cpp
index afad656..abc6e90 100644
--- a/file-integration/basketthumbcreator.cpp
+++ b/file-integration/basketthumbcreator.cpp
@@ -18,30 +18,30 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstringlist.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtextstream.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtextstream.h>
#include <ktempdir.h>
#include "basketthumbcreator.h"
-bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height*/, QImage &image)
+bool BasketThumbCreator::create(const TQString &path, int /*width*/, int /*height*/, TQImage &image)
{
// Create the temporar folder:
KTempDir tempDir;
tempDir.setAutoDelete(true);
- QString tempFolder = tempDir.name();
- QDir dir;
+ TQString tempFolder = tempDir.name();
+ TQDir dir;
dir.mkdir(tempFolder);
- const Q_ULONG BUFFER_SIZE = 1024;
+ const TQ_ULONG BUFFER_SIZE = 1024;
- QFile file(path);
+ TQFile file(path);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::Latin1);
- QString line = stream.readLine();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::Latin1);
+ TQString line = stream.readLine();
if (line != "BasKetNP:archive" && line != "BasKetNP:template") {
file.close();
return false;
@@ -49,9 +49,9 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height
while (!stream.atEnd()) {
// Get Key/Value Pair From the Line to Read:
line = stream.readLine();
- int index = line.find(':');
- QString key;
- QString value;
+ int index = line.tqfind(':');
+ TQString key;
+ TQString value;
if (index >= 0) {
key = line.left(index);
value = line.right(line.length() - index - 1);
@@ -67,17 +67,17 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height
return false;
}
// Get the preview file:
- QFile previewFile(tempFolder + "preview.png");
+ TQFile previewFile(tempFolder + "preview.png");
if (previewFile.open(IO_WriteOnly)) {
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) {
+ TQ_LONG sizeRead;
+ while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) {
previewFile.writeBlock(buffer, sizeRead);
size -= sizeRead;
}
previewFile.close();
delete buffer;
- image = QImage(tempFolder + "preview.png");
+ image = TQImage(tempFolder + "preview.png");
file.close();
return true;
}
@@ -91,8 +91,8 @@ bool BasketThumbCreator::create(const QString &path, int /*width*/, int /*height
}
// Get the archive file:
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) {
+ TQ_LONG sizeRead;
+ while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) {
size -= sizeRead;
}
delete buffer;
diff --git a/file-integration/basketthumbcreator.h b/file-integration/basketthumbcreator.h
index 8a10cab..fe16b68 100644
--- a/file-integration/basketthumbcreator.h
+++ b/file-integration/basketthumbcreator.h
@@ -18,12 +18,12 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qimage.h>
+#include <tqstring.h>
+#include <tqimage.h>
#include <kio/thumbcreator.h>
class BasketThumbCreator : public ThumbCreator
{
- bool create(const QString &path, int width, int height, QImage &image);
+ bool create(const TQString &path, int width, int height, TQImage &image);
Flags flags() const;
};
diff --git a/kontact_plugin/basket_plugin.cpp b/kontact_plugin/basket_plugin.cpp
index ea92b33..e6cfb9f 100644
--- a/kontact_plugin/basket_plugin.cpp
+++ b/kontact_plugin/basket_plugin.cpp
@@ -33,12 +33,12 @@ typedef KGenericFactory<BasketPlugin, Kontact::Core> BasketPluginFactory;
K_EXPORT_COMPONENT_FACTORY( libkontact_basket,
BasketPluginFactory( "kontact_basketplugin" ) )
-BasketPlugin::BasketPlugin( Kontact::Core *core, const char *, const QStringList& )
+BasketPlugin::BasketPlugin( Kontact::Core *core, const char *, const TQStringList& )
: Kontact::Plugin( core, core, "basket" )
{
setInstance( BasketPluginFactory::instance() );
insertNewAction(new KAction( i18n("&New Basket..."), "basket", CTRL+SHIFT+Key_B,
- this, SLOT(newBasket()), actionCollection(), "basket_new" ));
+ this, TQT_SLOT(newBasket()), actionCollection(), "basket_new" ));
m_uniqueAppWatcher = new Kontact::UniqueAppWatcher(
new Kontact::UniqueAppHandlerFactory<BasketUniqueAppHandler>(), this);
@@ -55,7 +55,7 @@ KParts::ReadOnlyPart* BasketPlugin::createPart()
return 0;
m_stub = new BasketDcopInterface_stub(dcopClient(), "basket", "BasketIface");
- connect(part, SIGNAL(showPart()), this, SLOT(showPart()));
+ connect(part, TQT_SIGNAL(showPart()), this, TQT_SLOT(showPart()));
return part;
}
@@ -75,7 +75,7 @@ void BasketPlugin::showPart()
}
#if 0
-bool BasketPlugin::createDCOPInterface( const QString& serviceType )
+bool BasketPlugin::createDCOPInterface( const TQString& serviceType )
{
kdDebug() << k_funcinfo << serviceType << endl;
return false;
diff --git a/kontact_plugin/basket_plugin.h b/kontact_plugin/basket_plugin.h
index f49cef1..a11026a 100644
--- a/kontact_plugin/basket_plugin.h
+++ b/kontact_plugin/basket_plugin.h
@@ -40,15 +40,16 @@ class BasketUniqueAppHandler : public Kontact::UniqueAppHandler
class BasketPlugin : public Kontact::Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
BasketPlugin( Kontact::Core *core, const char *name,
- const QStringList & );
+ const TQStringList & );
~BasketPlugin();
int weight() const { return 700; }
virtual bool isRunningStandalone();
- //virtual bool createDCOPInterface( const QString& serviceType );
+ //virtual bool createDCOPInterface( const TQString& serviceType );
public slots:
void newBasket();
diff --git a/kontact_plugin/basketdcopiface_stub.cpp b/kontact_plugin/basketdcopiface_stub.cpp
index eff3122..a170b62 100644
--- a/kontact_plugin/basketdcopiface_stub.cpp
+++ b/kontact_plugin/basketdcopiface_stub.cpp
@@ -12,12 +12,12 @@
#include <kdatastream.h>
-BasketDcopInterface_stub::BasketDcopInterface_stub( const QCString& app, const QCString& obj )
+BasketDcopInterface_stub::BasketDcopInterface_stub( const TQCString& app, const TQCString& obj )
: DCOPStub( app, obj )
{
}
-BasketDcopInterface_stub::BasketDcopInterface_stub( DCOPClient* client, const QCString& app, const QCString& obj )
+BasketDcopInterface_stub::BasketDcopInterface_stub( DCOPClient* client, const TQCString& app, const TQCString& obj )
: DCOPStub( client, app, obj )
{
}
@@ -30,24 +30,24 @@ BasketDcopInterface_stub::BasketDcopInterface_stub( const DCOPRef& ref )
void BasketDcopInterface_stub::newBasket()
{
if ( !dcopClient() ) {
- setStatus( CallFailed );
+ settqStatus( CallFailed );
return;
}
- QByteArray data;
+ TQByteArray data;
dcopClient()->send( app(), obj(), "newBasket()", data );
- setStatus( CallSucceeded );
+ settqStatus( CallSucceeded );
}
void BasketDcopInterface_stub::handleCommandLine()
{
if ( !dcopClient() ) {
- setStatus( CallFailed );
+ settqStatus( CallFailed );
return;
}
- QByteArray data, replyData;
- QCString replyType;
+ TQByteArray data, replyData;
+ TQCString replyType;
if ( dcopClient()->call( app(), obj(), "handleCommandLine()", data, replyType, replyData ) ) {
- setStatus( CallSucceeded );
+ settqStatus( CallSucceeded );
} else {
callFailed();
}
diff --git a/kontact_plugin/uniqueapphandler.cpp b/kontact_plugin/uniqueapphandler.cpp
index 29dc888..2f80a86 100644
--- a/kontact_plugin/uniqueapphandler.cpp
+++ b/kontact_plugin/uniqueapphandler.cpp
@@ -82,8 +82,8 @@ int UniqueAppHandler::newInstance()
return 0;
}
-bool UniqueAppHandler::process( const QCString &fun, const QByteArray &data,
- QCString& replyType, QByteArray &replyData )
+bool UniqueAppHandler::process( const TQCString &fun, const TQByteArray &data,
+ TQCString& replyType, TQByteArray &replyData )
{
if ( fun == "newInstance()" ) {
replyType = "int";
@@ -92,21 +92,21 @@ bool UniqueAppHandler::process( const QCString &fun, const QByteArray &data,
loadCommandLineOptions();
// This bit is duplicated from KUniqueApplication::processDelayed()
- QDataStream ds( data, IO_ReadOnly );
+ TQDataStream ds( data, IO_ReadOnly );
KCmdLineArgs::loadAppArgs( ds );
if ( !ds.atEnd() ) { // backwards compatibility
- QCString asn_id;
+ TQCString asn_id;
ds >> asn_id;
kapp->setStartupId( asn_id );
}
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << newInstance( );
} else if ( fun == "load()" ) {
replyType = "bool";
(void)mPlugin->part(); // load the part without bringing it to front
- QDataStream _replyStream( replyData, IO_WriteOnly );
+ TQDataStream _replyStream( replyData, IO_WriteOnly );
_replyStream << true;
} else {
return DCOPObject::process( fun, data, replyType, replyData );
@@ -130,7 +130,7 @@ QCStringList UniqueAppHandler::functions()
}
UniqueAppWatcher::UniqueAppWatcher( UniqueAppHandlerFactoryBase* factory, Plugin* plugin )
- : QObject( plugin ), mFactory( factory ), mPlugin( plugin )
+ : TQObject( plugin ), mFactory( factory ), mPlugin( plugin )
{
// The app is running standalone if 1) that name is known to DCOP
mRunningStandalone = kapp->dcopClient()->isApplicationRegistered( plugin->name() );
@@ -141,8 +141,8 @@ UniqueAppWatcher::UniqueAppWatcher( UniqueAppHandlerFactoryBase* factory, Plugin
if ( mRunningStandalone ) {
kapp->dcopClient()->setNotifications( true );
- connect( kapp->dcopClient(), SIGNAL( applicationRemoved( const QCString& ) ),
- this, SLOT( unregisteredFromDCOP( const QCString& ) ) );
+ connect( kapp->dcopClient(), TQT_SIGNAL( applicationRemoved( const TQCString& ) ),
+ this, TQT_SLOT( unregisteredFromDCOP( const TQCString& ) ) );
} else {
mFactory->createHandler( mPlugin );
}
@@ -156,11 +156,11 @@ UniqueAppWatcher::~UniqueAppWatcher()
delete mFactory;
}
-void UniqueAppWatcher::unregisteredFromDCOP( const QCString& appId )
+void UniqueAppWatcher::unregisteredFromDCOP( const TQCString& appId )
{
if ( appId == mPlugin->name() && mRunningStandalone ) {
- disconnect( kapp->dcopClient(), SIGNAL( applicationRemoved( const QCString& ) ),
- this, SLOT( unregisteredFromDCOP( const QCString& ) ) );
+ disconnect( kapp->dcopClient(), TQT_SIGNAL( applicationRemoved( const TQCString& ) ),
+ this, TQT_SLOT( unregisteredFromDCOP( const TQCString& ) ) );
kdDebug(5601) << k_funcinfo << appId << endl;
mFactory->createHandler( mPlugin );
kapp->dcopClient()->setNotifications( false );
diff --git a/kontact_plugin/uniqueapphandler.h b/kontact_plugin/uniqueapphandler.h
index e954eb7..a39aa04 100644
--- a/kontact_plugin/uniqueapphandler.h
+++ b/kontact_plugin/uniqueapphandler.h
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef KONTACT_UNIQUEAPPHANDLER_H
-#define KONTACT_UNIQUEAPPHANDLER_H
+#ifndef KONTACT_UNITQUEAPPHANDLER_H
+#define KONTACT_UNITQUEAPPHANDLER_H
#include <dcopobject.h>
#include <kontact/plugin.h>
@@ -86,9 +86,10 @@ template <class T> class UniqueAppHandlerFactory : public UniqueAppHandlerFactor
* Kontact takes over from there.
*
*/
-class KDE_EXPORT UniqueAppWatcher : public QObject
+class KDE_EXPORT UniqueAppWatcher : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
@@ -107,7 +108,7 @@ class KDE_EXPORT UniqueAppWatcher : public QObject
bool isRunningStandalone() const { return mRunningStandalone; }
protected slots:
- void unregisteredFromDCOP( const QCString& appId );
+ void unregisteredFromDCOP( const TQCString& appId );
private:
bool mRunningStandalone;
@@ -117,4 +118,4 @@ class KDE_EXPORT UniqueAppWatcher : public QObject
} // namespace
-#endif /* KONTACT_UNIQUEAPPHANDLER_H */
+#endif /* KONTACT_UNITQUEAPPHANDLER_H */
diff --git a/src/application.cpp b/src/application.cpp
index f15cdf4..56606e3 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -19,10 +19,10 @@
***************************************************************************/
#include <kcmdlineargs.h>
-#include <qstring.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qtimer.h>
+#include <tqstring.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqtimer.h>
#include "application.h"
#include "global.h"
@@ -44,14 +44,14 @@ int Application::newInstance()
// Open the basket archive or template file supplied as argument:
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args && args->count() >= 1) {
- QString fileName = QFile::decodeName(args->arg(args->count() - 1));
- if (QFile::exists(fileName)) {
- QFileInfo fileInfo(fileName);
+ TQString fileName = TQFile::decodeName(args->arg(args->count() - 1));
+ if (TQFile::exists(fileName)) {
+ TQFileInfo fileInfo(fileName);
if (!fileInfo.isDir()) { // Do not mis-interpret data-folder param!
// Tags are not loaded until Global::bnpView::lateInit() is called.
// It is called 0ms after the application start.
BNPView::s_fileToOpen = fileName;
- QTimer::singleShot( 100, Global::bnpView, SLOT(delayedOpenArchive()) );
+ TQTimer::singleShot( 100, Global::bnpView, TQT_SLOT(delayedOpenArchive()) );
// Global::bnpView->openArchive(fileName);
args->clear();
}
diff --git a/src/application.h b/src/application.h
index fd8d5ea..e6b9470 100644
--- a/src/application.h
+++ b/src/application.h
@@ -22,7 +22,7 @@
#define APPLICATION_H
#include <kuniqueapplication.h>
-#include <qstring.h>
+#include <tqstring.h>
/**
* @author Sébastien Laoût <slaout@linux62.org>
diff --git a/src/archive.cpp b/src/archive.cpp
index 7365501..6541a8e 100644
--- a/src/archive.cpp
+++ b/src/archive.cpp
@@ -18,16 +18,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qvaluelist.h>
-#include <qmap.h>
-#include <qdir.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
+#include <tqdir.h>
#include <ktar.h>
-#include <qdom.h>
+#include <tqdom.h>
#include <kmessagebox.h>
-#include <qpixmap.h>
-#include <qpainter.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
#include <kstandarddirs.h>
#include <kapplication.h>
#include <kiconloader.h>
@@ -48,9 +48,9 @@
#include <iostream>
-void Archive::save(Basket *basket, bool withSubBaskets, const QString &destination)
+void Archive::save(Basket *basket, bool withSubBaskets, const TQString &destination)
{
- QDir dir;
+ TQDir dir;
KProgressDialog dialog(0, 0, i18n("Save as Basket Archive"), i18n("Saving as basket archive. Please wait..."), /*Not modal, for password dialogs!*/false);
dialog.showCancelButton(false);
@@ -61,11 +61,11 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
progress->setValue(0);
// Create the temporar folder:
- QString tempFolder = Global::savesFolder() + "temp-archive/";
+ TQString tempFolder = Global::savesFolder() + "temp-archive/";
dir.mkdir(tempFolder);
// Create the temporar archive file:
- QString tempDestination = tempFolder + "temp-archive.tar.gz";
+ TQString tempDestination = tempFolder + "temp-archive.tar.gz";
KTar tar(tempDestination, "application/x-gzip");
tar.open(IO_WriteOnly);
tar.writeDir("baskets", "", "");
@@ -74,12 +74,12 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
std::cout << "Preparation finished out of " << progress->totalSteps() << std::endl;
// Copy the baskets data into the archive:
- QStringList backgrounds;
+ TQStringList backgrounds;
saveBasketToArchive(basket, withSubBaskets, &tar, backgrounds, tempFolder, progress);
// Create a Small baskets.xml Document:
- QDomDocument document("basketTree");
- QDomElement root = document.createElement("basketTree");
+ TQDomDocument document("basketTree");
+ TQDomElement root = document.createElement("basketTree");
document.appendChild(root);
Global::bnpView->saveSubHierarchy(Global::bnpView->listViewItemForBasket(basket), document, root, withSubBaskets);
Basket::safelySaveToFile(tempFolder + "baskets.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + document.toString());
@@ -87,22 +87,22 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
dir.remove(tempFolder + "baskets.xml");
// Save a Small tags.xml Document:
- QValueList<Tag*> tags;
+ TQValueList<Tag*> tags;
listUsedTags(basket, withSubBaskets, tags);
Tag::saveTagsTo(tags, tempFolder + "tags.xml");
tar.addLocalFile(tempFolder + "tags.xml", "tags.xml");
dir.remove(tempFolder + "tags.xml");
// Save Tag Emblems (in case they are loaded on a computer that do not have those icons):
- QString tempIconFile = tempFolder + "icon.png";
+ TQString tempIconFile = tempFolder + "icon.png";
for (Tag::List::iterator it = tags.begin(); it != tags.end(); ++it) {
State::List states = (*it)->states();
for (State::List::iterator it2 = states.begin(); it2 != states.end(); ++it2) {
State *state = (*it2);
- QPixmap icon = kapp->iconLoader()->loadIcon(state->emblem(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
+ TQPixmap icon = kapp->iconLoader()->loadIcon(state->emblem(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
if (!icon.isNull()) {
icon.save(tempIconFile, "PNG");
- QString iconFileName = state->emblem().replace('/', '_');
+ TQString iconFileName = state->emblem().tqreplace('/', '_');
tar.addLocalFile(tempIconFile, "tag-emblems/" + iconFileName);
}
}
@@ -114,8 +114,8 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
// Computing the File Preview:
Basket *previewBasket = basket; // FIXME: Use the first non-empty basket!
- QPixmap previewPixmap(previewBasket->visibleWidth(), previewBasket->visibleHeight());
- QPainter painter(&previewPixmap);
+ TQPixmap previewPixmap(previewBasket->visibleWidth(), previewBasket->visibleHeight());
+ TQPainter painter(&previewPixmap);
// Save old state, and make the look clean ("smile, you are filmed!"):
NoteSelection *selection = previewBasket->selectedNotes();
previewBasket->unselectAll();
@@ -130,35 +130,35 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
previewBasket->doHoverEffects();
// End and save our splandid painting:
painter.end();
- QImage previewImage = previewPixmap.convertToImage();
+ TQImage previewImage = previewPixmap.convertToImage();
const int PREVIEW_SIZE = 256;
- previewImage = previewImage.scale(PREVIEW_SIZE, PREVIEW_SIZE, QImage::ScaleMin);
+ previewImage = previewImage.scale(PREVIEW_SIZE, PREVIEW_SIZE, TQ_ScaleMin);
previewImage.save(tempFolder + "preview.png", "PNG");
// Finaly Save to the Real Destination file:
- QFile file(destination);
+ TQFile file(destination);
if (file.open(IO_WriteOnly)) {
- ulong previewSize = QFile(tempFolder + "preview.png").size();
- ulong archiveSize = QFile(tempDestination).size();
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::Latin1);
+ ulong previewSize = TQFile(tempFolder + "preview.png").size();
+ ulong archiveSize = TQFile(tempDestination).size();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::Latin1);
stream << "BasKetNP:archive\n"
<< "version:0.6.1\n"
// << "read-compatible:0.6.1\n"
// << "write-compatible:0.6.1\n"
<< "preview*:" << previewSize << "\n";
// Copy the Preview File:
- const Q_ULONG BUFFER_SIZE = 1024;
+ const TQ_ULONG BUFFER_SIZE = 1024;
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- QFile previewFile(tempFolder + "preview.png");
+ TQ_LONG sizeRead;
+ TQFile previewFile(tempFolder + "preview.png");
if (previewFile.open(IO_ReadOnly)) {
while ((sizeRead = previewFile.readBlock(buffer, BUFFER_SIZE)) > 0)
file.writeBlock(buffer, sizeRead);
}
stream << "archive*:" << archiveSize << "\n";
// Copy the Archive File:
- QFile archiveFile(tempDestination);
+ TQFile archiveFile(tempDestination);
if (archiveFile.open(IO_ReadOnly)) {
while ((sizeRead = archiveFile.readBlock(buffer, BUFFER_SIZE)) > 0)
file.writeBlock(buffer, sizeRead);
@@ -178,7 +178,7 @@ void Archive::save(Basket *basket, bool withSubBaskets, const QString &destinati
dir.rmdir(tempFolder);
}
-void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QStringList &backgrounds, const QString &tempFolder, KProgress *progress)
+void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, TQStringList &backgrounds, const TQString &tempFolder, KProgress *progress)
{
// Basket need to be loaded for tags exportation.
// We load it NOW so that the progress bar really reflect the state of the exportation:
@@ -186,33 +186,33 @@ void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QSt
basket->load();
}
- QDir dir;
+ TQDir dir;
// Save basket data:
tar->addLocalDirectory(basket->fullPath(), "baskets/" + basket->folderName());
tar->addLocalFile(basket->fullPath() + ".basket", "baskets/" + basket->folderName() + ".basket"); // The hidden files were not added
// Save basket icon:
- QString tempIconFile = tempFolder + "icon.png";
+ TQString tempIconFile = tempFolder + "icon.png";
if (!basket->icon().isEmpty() && basket->icon() != "basket") {
- QPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
+ TQPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::Small, 16, KIcon::DefaultState, /*path_store=*/0L, /*canReturnNull=*/true);
if (!icon.isNull()) {
icon.save(tempIconFile, "PNG");
- QString iconFileName = basket->icon().replace('/', '_');
+ TQString iconFileName = basket->icon().tqreplace('/', '_');
tar->addLocalFile(tempIconFile, "basket-icons/" + iconFileName);
}
}
// Save basket backgorund image:
- QString imageName = basket->backgroundImageName();
- if (!basket->backgroundImageName().isEmpty() && !backgrounds.contains(imageName)) {
- QString backgroundPath = Global::backgroundManager->pathForImageName(imageName);
+ TQString imageName = basket->backgroundImageName();
+ if (!basket->backgroundImageName().isEmpty() && !backgrounds.tqcontains(imageName)) {
+ TQString backgroundPath = Global::backgroundManager->pathForImageName(imageName);
if (!backgroundPath.isEmpty()) {
// Save the background image:
tar->addLocalFile(backgroundPath, "backgrounds/" + imageName);
// Save the preview image:
- QString previewPath = Global::backgroundManager->previewPathForImageName(imageName);
+ TQString previewPath = Global::backgroundManager->previewPathForImageName(imageName);
if (!previewPath.isEmpty())
tar->addLocalFile(previewPath, "backgrounds/previews/" + imageName);
// Save the configuration file:
- QString configPath = backgroundPath + ".config";
+ TQString configPath = backgroundPath + ".config";
if (dir.exists(configPath))
tar->addLocalFile(configPath, "backgrounds/" + imageName + ".config");
}
@@ -231,7 +231,7 @@ void Archive::saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QSt
}
}
-void Archive::listUsedTags(Basket *basket, bool recursive, QValueList<Tag*> &list)
+void Archive::listUsedTags(Basket *basket, bool recursive, TQValueList<Tag*> &list)
{
basket->listUsedTags(list);
BasketListViewItem *item = Global::bnpView->listViewItemForBasket(basket);
@@ -242,34 +242,34 @@ void Archive::listUsedTags(Basket *basket, bool recursive, QValueList<Tag*> &lis
}
}
-void Archive::open(const QString &path)
+void Archive::open(const TQString &path)
{
// Create the temporar folder:
- QString tempFolder = Global::savesFolder() + "temp-archive/";
- QDir dir;
+ TQString tempFolder = Global::savesFolder() + "temp-archive/";
+ TQDir dir;
dir.mkdir(tempFolder);
- const Q_ULONG BUFFER_SIZE = 1024;
+ const TQ_ULONG BUFFER_SIZE = 1024;
- QFile file(path);
+ TQFile file(path);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::Latin1);
- QString line = stream.readLine();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::Latin1);
+ TQString line = stream.readLine();
if (line != "BasKetNP:archive") {
KMessageBox::error(0, i18n("This file is not a basket archive."), i18n("Basket Archive Error"));
file.close();
Tools::deleteRecursively(tempFolder);
return;
}
- QString version;
- QStringList readCompatibleVersions;
- QStringList writeCompatibleVersions;
+ TQString version;
+ TQStringList readCompatibleVersions;
+ TQStringList writeCompatibleVersions;
while (!stream.atEnd()) {
// Get Key/Value Pair From the Line to Read:
line = stream.readLine();
- int index = line.find(':');
- QString key;
- QString value;
+ int index = line.tqfind(':');
+ TQString key;
+ TQString value;
if (index >= 0) {
key = line.left(index);
value = line.right(line.length() - index - 1);
@@ -280,9 +280,9 @@ void Archive::open(const QString &path)
if (key == "version") {
version = value;
} else if (key == "read-compatible") {
- readCompatibleVersions = QStringList::split(value, ";");
+ readCompatibleVersions = TQStringList::split(value, ";");
} else if (key == "write-compatible") {
- writeCompatibleVersions = QStringList::split(value, ";");
+ writeCompatibleVersions = TQStringList::split(value, ";");
} else if (key == "preview*") {
bool ok;
ulong size = value.toULong(&ok);
@@ -294,11 +294,11 @@ void Archive::open(const QString &path)
}
// Get the preview file:
//FIXME: We do not need the preview for now
-// QFile previewFile(tempFolder + "preview.png");
+// TQFile previewFile(tempFolder + "preview.png");
// if (previewFile.open(IO_WriteOnly)) {
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) {
+ TQ_LONG sizeRead;
+ while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) {
// previewFile.writeBlock(buffer, sizeRead);
size -= sizeRead;
}
@@ -306,22 +306,22 @@ void Archive::open(const QString &path)
delete buffer;
// }
} else if (key == "archive*") {
- if (version != "0.6.1" && readCompatibleVersions.contains("0.6.1") && !writeCompatibleVersions.contains("0.6.1")) {
+ if (version != "0.6.1" && readCompatibleVersions.tqcontains("0.6.1") && !writeCompatibleVersions.tqcontains("0.6.1")) {
KMessageBox::information(
0,
i18n("This file was created with a recent version of %1. "
"It can be opened but not every information will be available to you. "
"For instance, some notes may be missing because they are of a type only available in new versions. "
"When saving the file back, consider to save it to another file, to preserve the original one.")
- .arg(kapp->aboutData()->programName()),
+ .tqarg(kapp->aboutData()->programName()),
i18n("Basket Archive Error")
);
}
- if (version != "0.6.1" && !readCompatibleVersions.contains("0.6.1") && !writeCompatibleVersions.contains("0.6.1")) {
+ if (version != "0.6.1" && !readCompatibleVersions.tqcontains("0.6.1") && !writeCompatibleVersions.tqcontains("0.6.1")) {
KMessageBox::error(
0,
i18n("This file was created with a recent version of %1. Please upgrade to a newer version to be able to open that file.")
- .arg(kapp->aboutData()->programName()),
+ .tqarg(kapp->aboutData()->programName()),
i18n("Basket Archive Error")
);
file.close();
@@ -341,12 +341,12 @@ void Archive::open(const QString &path)
Global::mainWindow()->raise();
// Get the archive file:
- QString tempArchive = tempFolder + "temp-archive.tar.gz";
- QFile archiveFile(tempArchive);
+ TQString tempArchive = tempFolder + "temp-archive.tar.gz";
+ TQFile archiveFile(tempArchive);
if (archiveFile.open(IO_WriteOnly)) {
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) {
+ TQ_LONG sizeRead;
+ while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) {
archiveFile.writeBlock(buffer, sizeRead);
size -= sizeRead;
}
@@ -354,8 +354,8 @@ void Archive::open(const QString &path)
delete buffer;
// Extract the Archive:
- QString extractionFolder = tempFolder + "extraction/";
- QDir dir;
+ TQString extractionFolder = tempFolder + "extraction/";
+ TQDir dir;
dir.mkdir(extractionFolder);
KTar tar(tempArchive, "application/x-gzip");
tar.open(IO_ReadOnly);
@@ -364,8 +364,8 @@ void Archive::open(const QString &path)
// Import the Tags:
importTagEmblems(extractionFolder); // Import and rename tag emblems BEFORE loading them!
- QMap<QString, QString> mergedStates = Tag::loadTags(extractionFolder + "tags.xml");
- QMap<QString, QString>::Iterator it;
+ TQMap<TQString, TQString> mergedStates = Tag::loadTags(extractionFolder + "tags.xml");
+ TQMap<TQString, TQString>::Iterator it;
if (mergedStates.count() > 0) {
Tag::saveTags();
}
@@ -389,8 +389,8 @@ void Archive::open(const QString &path)
}
// Get the archive file:
char *buffer = new char[BUFFER_SIZE];
- Q_LONG sizeRead;
- while ((sizeRead = file.readBlock(buffer, QMIN(BUFFER_SIZE, size))) > 0) {
+ TQ_LONG sizeRead;
+ while ((sizeRead = file.readBlock(buffer, TQMIN(BUFFER_SIZE, size))) > 0) {
size -= sizeRead;
}
delete buffer;
@@ -411,40 +411,40 @@ void Archive::open(const QString &path)
* This method check for every emblems and import the missing ones.
* It also modify the tags.xml copy for the emblems to point to the absolute path of the impported icons.
*/
-void Archive::importTagEmblems(const QString &extractionFolder)
+void Archive::importTagEmblems(const TQString &extractionFolder)
{
- QDomDocument *document = XMLWork::openFile("basketTags", extractionFolder + "tags.xml");
+ TQDomDocument *document = XMLWork::openFile("basketTags", extractionFolder + "tags.xml");
if (document == 0)
return;
- QDomElement docElem = document->documentElement();
+ TQDomElement docElem = document->documentElement();
- QDir dir;
+ TQDir dir;
dir.mkdir(Global::savesFolder() + "tag-emblems/");
FormatImporter copier; // Only used to copy files synchronously
- QDomNode node = docElem.firstChild();
+ TQDomNode node = docElem.firstChild();
while (!node.isNull()) {
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
if ( (!element.isNull()) && element.tagName() == "tag" ) {
- QDomNode subNode = element.firstChild();
+ TQDomNode subNode = element.firstChild();
while (!subNode.isNull()) {
- QDomElement subElement = subNode.toElement();
+ TQDomElement subElement = subNode.toElement();
if ( (!subElement.isNull()) && subElement.tagName() == "state" ) {
- QString emblemName = XMLWork::getElementText(subElement, "emblem");
+ TQString emblemName = XMLWork::getElementText(subElement, "emblem");
if (!emblemName.isEmpty()) {
- QPixmap emblem = kapp->iconLoader()->loadIcon(emblemName, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
+ TQPixmap emblem = kapp->iconLoader()->loadIcon(emblemName, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
// The icon does not exists on that computer, import it:
if (emblem.isNull()) {
// Of the emblem path was eg. "/home/seb/emblem.png", it was exported as "tag-emblems/_home_seb_emblem.png".
// So we need to copy that image to "~/.kde/share/apps/basket/tag-emblems/emblem.png":
- int slashIndex = emblemName.findRev("/");
- QString emblemFileName = (slashIndex < 0 ? emblemName : emblemName.right(slashIndex - 2));
- QString source = extractionFolder + "tag-emblems/" + emblemName.replace('/', '_');
- QString destination = Global::savesFolder() + "tag-emblems/" + emblemFileName;
+ int slashIndex = emblemName.tqfindRev("/");
+ TQString emblemFileName = (slashIndex < 0 ? emblemName : emblemName.right(slashIndex - 2));
+ TQString source = extractionFolder + "tag-emblems/" + emblemName.tqreplace('/', '_');
+ TQString destination = Global::savesFolder() + "tag-emblems/" + emblemFileName;
if (!dir.exists(destination))
copier.copyFolder(source, destination);
// Replace the emblem path in the tags.xml copy:
- QDomElement emblemElement = XMLWork::getElement(subElement, "emblem");
+ TQDomElement emblemElement = XMLWork::getElement(subElement, "emblem");
subElement.removeChild(emblemElement);
XMLWork::addElement(*document, subElement, "emblem", destination);
}
@@ -458,28 +458,28 @@ void Archive::importTagEmblems(const QString &extractionFolder)
Basket::safelySaveToFile(extractionFolder + "tags.xml", document->toString());
}
-void Archive::importArchivedBackgroundImages(const QString &extractionFolder)
+void Archive::importArchivedBackgroundImages(const TQString &extractionFolder)
{
FormatImporter copier; // Only used to copy files synchronously
- QString destFolder = KGlobal::dirs()->saveLocation("data", "basket/backgrounds/");
+ TQString destFolder = KGlobal::dirs()->saveLocation("data", "basket/backgrounds/");
- QDir dir(extractionFolder + "backgrounds/", /*nameFilder=*/"*.png", /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
- QStringList files = dir.entryList();
- for (QStringList::Iterator it = files.begin(); it != files.end(); ++it) {
- QString image = *it;
+ TQDir dir(extractionFolder + "backgrounds/", /*nameFilder=*/"*.png", /*sortSpec=*/TQDir::Name | TQDir::IgnoreCase, /*filterSpec=*/TQDir::Files | TQDir::NoSymLinks);
+ TQStringList files = dir.entryList();
+ for (TQStringList::Iterator it = files.begin(); it != files.end(); ++it) {
+ TQString image = *it;
if (!Global::backgroundManager->exists(image)) {
// Copy images:
- QString imageSource = extractionFolder + "backgrounds/" + image;
- QString imageDest = destFolder + image;
+ TQString imageSource = extractionFolder + "backgrounds/" + image;
+ TQString imageDest = destFolder + image;
copier.copyFolder(imageSource, imageDest);
// Copy configuration file:
- QString configSource = extractionFolder + "backgrounds/" + image + ".config";
- QString configDest = destFolder + image;
+ TQString configSource = extractionFolder + "backgrounds/" + image + ".config";
+ TQString configDest = destFolder + image;
if (dir.exists(configSource))
copier.copyFolder(configSource, configDest);
// Copy preview:
- QString previewSource = extractionFolder + "backgrounds/previews/" + image;
- QString previewDest = destFolder + "previews/" + image;
+ TQString previewSource = extractionFolder + "backgrounds/previews/" + image;
+ TQString previewDest = destFolder + "previews/" + image;
if (dir.exists(previewSource)) {
dir.mkdir(destFolder + "previews/"); // Make sure the folder exists!
copier.copyFolder(previewSource, previewDest);
@@ -490,38 +490,38 @@ void Archive::importArchivedBackgroundImages(const QString &extractionFolder)
}
}
-void Archive::renameBasketFolders(const QString &extractionFolder, QMap<QString, QString> &mergedStates)
+void Archive::renameBasketFolders(const TQString &extractionFolder, TQMap<TQString, TQString> &mergedStates)
{
- QDomDocument *doc = XMLWork::openFile("basketTree", extractionFolder + "baskets/baskets.xml");
+ TQDomDocument *doc = XMLWork::openFile("basketTree", extractionFolder + "baskets/baskets.xml");
if (doc != 0) {
- QMap<QString, QString> folderMap;
- QDomElement docElem = doc->documentElement();
- QDomNode node = docElem.firstChild();
+ TQMap<TQString, TQString> folderMap;
+ TQDomElement docElem = doc->documentElement();
+ TQDomNode node = docElem.firstChild();
renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
loadExtractedBaskets(extractionFolder, node, folderMap, 0);
}
}
-void Archive::renameBasketFolder(const QString &extractionFolder, QDomNode &basketNode, QMap<QString, QString> &folderMap, QMap<QString, QString> &mergedStates)
+void Archive::renameBasketFolder(const TQString &extractionFolder, TQDomNode &basketNode, TQMap<TQString, TQString> &folderMap, TQMap<TQString, TQString> &mergedStates)
{
- QDomNode n = basketNode;
+ TQDomNode n = basketNode;
while ( ! n.isNull() ) {
- QDomElement element = n.toElement();
+ TQDomElement element = n.toElement();
if ( (!element.isNull()) && element.tagName() == "basket" ) {
- QString folderName = element.attribute("folderName");
+ TQString folderName = element.attribute("folderName");
if (!folderName.isEmpty()) {
// Find a folder name:
- QString newFolderName = BasketFactory::newFolderName();
+ TQString newFolderName = BasketFactory::newFolderName();
folderMap[folderName] = newFolderName;
// Reserve the folder name:
- QDir dir;
+ TQDir dir;
dir.mkdir(Global::basketsFolder() + newFolderName);
// Rename the merged tag ids:
// if (mergedStates.count() > 0) {
renameMergedStatesAndBasketIcon(extractionFolder + "baskets/" + folderName + ".basket", mergedStates, extractionFolder);
// }
// Child baskets:
- QDomNode node = element.firstChild();
+ TQDomNode node = element.firstChild();
renameBasketFolder(extractionFolder, node, folderMap, mergedStates);
}
}
@@ -529,69 +529,69 @@ void Archive::renameBasketFolder(const QString &extractionFolder, QDomNode &bask
}
}
-void Archive::renameMergedStatesAndBasketIcon(const QString &fullPath, QMap<QString, QString> &mergedStates, const QString &extractionFolder)
+void Archive::renameMergedStatesAndBasketIcon(const TQString &fullPath, TQMap<TQString, TQString> &mergedStates, const TQString &extractionFolder)
{
- QDomDocument *doc = XMLWork::openFile("basket", fullPath);
+ TQDomDocument *doc = XMLWork::openFile("basket", fullPath);
if (doc == 0)
return;
- QDomElement docElem = doc->documentElement();
- QDomElement properties = XMLWork::getElement(docElem, "properties");
+ TQDomElement docElem = doc->documentElement();
+ TQDomElement properties = XMLWork::getElement(docElem, "properties");
importBasketIcon(properties, extractionFolder);
- QDomElement notes = XMLWork::getElement(docElem, "notes");
+ TQDomElement notes = XMLWork::getElement(docElem, "notes");
if (mergedStates.count() > 0)
renameMergedStates(notes, mergedStates);
Basket::safelySaveToFile(fullPath, /*"<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + */doc->toString());
}
-void Archive::importBasketIcon(QDomElement properties, const QString &extractionFolder)
+void Archive::importBasketIcon(TQDomElement properties, const TQString &extractionFolder)
{
- QString iconName = XMLWork::getElementText(properties, "icon");
+ TQString iconName = XMLWork::getElementText(properties, "icon");
if (!iconName.isEmpty() && iconName != "basket") {
- QPixmap icon = kapp->iconLoader()->loadIcon(iconName, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
+ TQPixmap icon = kapp->iconLoader()->loadIcon(iconName, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true);
// The icon does not exists on that computer, import it:
if (icon.isNull()) {
- QDir dir;
+ TQDir dir;
dir.mkdir(Global::savesFolder() + "basket-icons/");
FormatImporter copier; // Only used to copy files synchronously
// Of the icon path was eg. "/home/seb/icon.png", it was exported as "basket-icons/_home_seb_icon.png".
// So we need to copy that image to "~/.kde/share/apps/basket/basket-icons/icon.png":
- int slashIndex = iconName.findRev("/");
- QString iconFileName = (slashIndex < 0 ? iconName : iconName.right(slashIndex - 2));
- QString source = extractionFolder + "basket-icons/" + iconName.replace('/', '_');
- QString destination = Global::savesFolder() + "basket-icons/" + iconFileName;
+ int slashIndex = iconName.tqfindRev("/");
+ TQString iconFileName = (slashIndex < 0 ? iconName : iconName.right(slashIndex - 2));
+ TQString source = extractionFolder + "basket-icons/" + iconName.tqreplace('/', '_');
+ TQString destination = Global::savesFolder() + "basket-icons/" + iconFileName;
if (!dir.exists(destination))
copier.copyFolder(source, destination);
// Replace the emblem path in the tags.xml copy:
- QDomElement iconElement = XMLWork::getElement(properties, "icon");
+ TQDomElement iconElement = XMLWork::getElement(properties, "icon");
properties.removeChild(iconElement);
- QDomDocument document = properties.ownerDocument();
+ TQDomDocument document = properties.ownerDocument();
XMLWork::addElement(document, properties, "icon", destination);
}
}
}
-void Archive::renameMergedStates(QDomNode notes, QMap<QString, QString> &mergedStates)
+void Archive::renameMergedStates(TQDomNode notes, TQMap<TQString, TQString> &mergedStates)
{
- QDomNode n = notes.firstChild();
+ TQDomNode n = notes.firstChild();
while ( ! n.isNull() ) {
- QDomElement element = n.toElement();
+ TQDomElement element = n.toElement();
if (!element.isNull()) {
if (element.tagName() == "group" ) {
renameMergedStates(n, mergedStates);
} else if (element.tagName() == "note") {
- QString tags = XMLWork::getElementText(element, "tags");
+ TQString tags = XMLWork::getElementText(element, "tags");
if (!tags.isEmpty()) {
- QStringList tagNames = QStringList::split(";", tags);
- for (QStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) {
- QString &tag = *it;
- if (mergedStates.contains(tag)) {
+ TQStringList tagNames = TQStringList::split(";", tags);
+ for (TQStringList::Iterator it = tagNames.begin(); it != tagNames.end(); ++it) {
+ TQString &tag = *it;
+ if (mergedStates.tqcontains(tag)) {
tag = mergedStates[tag];
}
}
- QString newTags = tagNames.join(";");
- QDomElement tagsElement = XMLWork::getElement(element, "tags");
+ TQString newTags = tagNames.join(";");
+ TQDomElement tagsElement = XMLWork::getElement(element, "tags");
element.removeChild(tagsElement);
- QDomDocument document = element.ownerDocument();
+ TQDomDocument document = element.ownerDocument();
XMLWork::addElement(document, element, "tags", newTags);
}
}
@@ -600,27 +600,27 @@ void Archive::renameMergedStates(QDomNode notes, QMap<QString, QString> &mergedS
}
}
-void Archive::loadExtractedBaskets(const QString &extractionFolder, QDomNode &basketNode, QMap<QString, QString> &folderMap, Basket *parent)
+void Archive::loadExtractedBaskets(const TQString &extractionFolder, TQDomNode &basketNode, TQMap<TQString, TQString> &folderMap, Basket *tqparent)
{
- bool basketSetAsCurrent = (parent != 0);
- QDomNode n = basketNode;
+ bool basketSetAsCurrent = (tqparent != 0);
+ TQDomNode n = basketNode;
while ( ! n.isNull() ) {
- QDomElement element = n.toElement();
+ TQDomElement element = n.toElement();
if ( (!element.isNull()) && element.tagName() == "basket" ) {
- QString folderName = element.attribute("folderName");
+ TQString folderName = element.attribute("folderName");
if (!folderName.isEmpty()) {
// Move the basket folder to its destination, while renaming it uniquely:
- QString newFolderName = folderMap[folderName];
+ TQString newFolderName = folderMap[folderName];
FormatImporter copier;
// The folder has been "reserved" by creating it. Avoid asking the user to override:
- QDir dir;
+ TQDir dir;
dir.rmdir(Global::basketsFolder() + newFolderName);
copier.moveFolder(extractionFolder + "baskets/" + folderName, Global::basketsFolder() + newFolderName);
// Append and load the basket in the tree:
Basket *basket = Global::bnpView->loadBasket(newFolderName);
- BasketListViewItem *basketItem = Global::bnpView->appendBasket(basket, (basket && parent ? Global::bnpView->listViewItemForBasket(parent) : 0));
+ BasketListViewItem *basketItem = Global::bnpView->appendBasket(basket, (basket && tqparent ? Global::bnpView->listViewItemForBasket(tqparent) : 0));
basketItem->setOpen(!XMLWork::trueOrFalse(element.attribute("folded", "false"), false));
- QDomElement properties = XMLWork::getElement(element, "properties");
+ TQDomElement properties = XMLWork::getElement(element, "properties");
importBasketIcon(properties, extractionFolder); // Rename the icon fileName if necessary
basket->loadProperties(properties);
// Open the first basket of the archive:
@@ -628,7 +628,7 @@ void Archive::loadExtractedBaskets(const QString &extractionFolder, QDomNode &ba
Global::bnpView->setCurrentBasket(basket);
basketSetAsCurrent = true;
}
- QDomNode node = element.firstChild();
+ TQDomNode node = element.firstChild();
loadExtractedBaskets(extractionFolder, node, folderMap, basket);
}
}
diff --git a/src/archive.h b/src/archive.h
index 5389015..d2525cb 100644
--- a/src/archive.h
+++ b/src/archive.h
@@ -21,15 +21,15 @@
#ifndef ARCHIVE_H
#define ARCHIVE_H
-#include <qvaluelist.h>
-#include <qmap.h>
+#include <tqvaluelist.h>
+#include <tqmap.h>
class Basket;
class Tag;
-class QString;
-class QStringList;
-class QDomNode;
+class TQString;
+class TQStringList;
+class TQDomNode;
class KTar;
class KProgress;
@@ -39,21 +39,21 @@ class KProgress;
class Archive
{
public:
- static void save(Basket *basket, bool withSubBaskets, const QString &destination);
- static void open(const QString &path);
+ static void save(Basket *basket, bool withSubBaskets, const TQString &destination);
+ static void open(const TQString &path);
private:
// Convenient Methods for Saving:
- static void saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, QStringList &backgrounds, const QString &tempFolder, KProgress *progress);
- static void listUsedTags(Basket *basket, bool recursive, QValueList<Tag*> &list);
+ static void saveBasketToArchive(Basket *basket, bool recursive, KTar *tar, TQStringList &backgrounds, const TQString &tempFolder, KProgress *progress);
+ static void listUsedTags(Basket *basket, bool recursive, TQValueList<Tag*> &list);
// Convenient Methods for Loading:
- static void renameBasketFolders(const QString &extractionFolder, QMap<QString, QString> &mergedStates);
- static void renameBasketFolder(const QString &extractionFolder, QDomNode &basketNode, QMap<QString, QString> &folderMap, QMap<QString, QString> &mergedStates);
- static void renameMergedStatesAndBasketIcon(const QString &fullPath, QMap<QString, QString> &mergedStates, const QString &extractionFolder);
- static void renameMergedStates(QDomNode notes, QMap<QString, QString> &mergedStates);
- static void importBasketIcon(QDomElement properties, const QString &extractionFolder);
- static void loadExtractedBaskets(const QString &extractionFolder, QDomNode &basketNode, QMap<QString, QString> &folderMap, Basket *parent);
- static void importTagEmblems(const QString &extractionFolder);
- static void importArchivedBackgroundImages(const QString &extractionFolder);
+ static void renameBasketFolders(const TQString &extractionFolder, TQMap<TQString, TQString> &mergedStates);
+ static void renameBasketFolder(const TQString &extractionFolder, TQDomNode &basketNode, TQMap<TQString, TQString> &folderMap, TQMap<TQString, TQString> &mergedStates);
+ static void renameMergedStatesAndBasketIcon(const TQString &fullPath, TQMap<TQString, TQString> &mergedStates, const TQString &extractionFolder);
+ static void renameMergedStates(TQDomNode notes, TQMap<TQString, TQString> &mergedStates);
+ static void importBasketIcon(TQDomElement properties, const TQString &extractionFolder);
+ static void loadExtractedBaskets(const TQString &extractionFolder, TQDomNode &basketNode, TQMap<TQString, TQString> &folderMap, Basket *tqparent);
+ static void importTagEmblems(const TQString &extractionFolder);
+ static void importArchivedBackgroundImages(const TQString &extractionFolder);
};
#endif
diff --git a/src/backgroundmanager.cpp b/src/backgroundmanager.cpp
index c289eca..14a2ac2 100644
--- a/src/backgroundmanager.cpp
+++ b/src/backgroundmanager.cpp
@@ -22,9 +22,9 @@
#include <kglobal.h>
#include <kstandarddirs.h>
#include <ksimpleconfig.h>
-#include <qpainter.h>
-#include <qdir.h>
-#include <qimage.h>
+#include <tqpainter.h>
+#include <tqdir.h>
+#include <tqimage.h>
#include <iostream>
@@ -32,7 +32,7 @@
/** class BackgroundEntry: */
-BackgroundEntry::BackgroundEntry(const QString &location)
+BackgroundEntry::BackgroundEntry(const TQString &location)
{
this->location = location;
name = KURL(location).fileName();
@@ -50,7 +50,7 @@ BackgroundEntry::~BackgroundEntry()
/** class OpaqueBackgroundEntry: */
-OpaqueBackgroundEntry::OpaqueBackgroundEntry(const QString &name, const QColor &color)
+OpaqueBackgroundEntry::OpaqueBackgroundEntry(const TQString &name, const TQColor &color)
{
this->name = name;
this->color = color;
@@ -68,14 +68,14 @@ OpaqueBackgroundEntry::~OpaqueBackgroundEntry()
BackgroundManager::BackgroundManager()
{
/// std::cout << "BackgroundManager: Found the following background images in ";
- QStringList directories = KGlobal::dirs()->resourceDirs("data"); // eg. { "/home/seb/.kde/share/apps/", "/usr/share/apps/" }
+ TQStringList directories = KGlobal::dirs()->resourceDirs("data"); // eg. { "/home/seb/.kde/share/apps/", "/usr/share/apps/" }
// For each folder:
- for (QStringList::Iterator it = directories.begin(); it != directories.end(); ++it) {
+ for (TQStringList::Iterator it = directories.begin(); it != directories.end(); ++it) {
// For each file in those directories:
- QDir dir(*it + "basket/backgrounds/", /*nameFilder=*/"*.png", /*sortSpec=*/QDir::Name | QDir::IgnoreCase, /*filterSpec=*/QDir::Files | QDir::NoSymLinks);
+ TQDir dir(*it + "basket/backgrounds/", /*nameFilder=*/"*.png", /*sortSpec=*/TQDir::Name | TQDir::IgnoreCase, /*filterSpec=*/TQDir::Files | TQDir::NoSymLinks);
/// std::cout << *it + "basket/backgrounds/ ";
- QStringList files = dir.entryList();
- for (QStringList::Iterator it2 = files.begin(); it2 != files.end(); ++it2) // TODO: If an image name is present in two folders?
+ TQStringList files = dir.entryList();
+ for (TQStringList::Iterator it2 = files.begin(); it2 != files.end(); ++it2) // TODO: If an image name is present in two folders?
addImage(*it + "basket/backgrounds/" + *it2);
}
@@ -83,19 +83,19 @@ BackgroundManager::BackgroundManager()
/// for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
/// std::cout << "* " << (*it)->location << " [ref: " << (*it)->name << "]" << std::endl;
- connect( &m_garbageTimer, SIGNAL(timeout()), this, SLOT(doGarbage()) );
+ connect( &m_garbageTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(doGarbage()) );
}
BackgroundManager::~BackgroundManager()
{
}
-void BackgroundManager::addImage(const QString &fullPath)
+void BackgroundManager::addImage(const TQString &fullPath)
{
m_backgroundsList.append(new BackgroundEntry(fullPath));
}
-BackgroundEntry* BackgroundManager::backgroundEntryFor(const QString &image)
+BackgroundEntry* BackgroundManager::backgroundEntryFor(const TQString &image)
{
for (BackgroundsList::Iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
if ((*it)->name == image)
@@ -103,7 +103,7 @@ BackgroundEntry* BackgroundManager::backgroundEntryFor(const QString &image)
return 0;
}
-OpaqueBackgroundEntry* BackgroundManager::opaqueBackgroundEntryFor(const QString &image, const QColor &color)
+OpaqueBackgroundEntry* BackgroundManager::opaqueBackgroundEntryFor(const TQString &image, const TQColor &color)
{
for (OpaqueBackgroundsList::Iterator it = m_opaqueBackgroundsList.begin(); it != m_opaqueBackgroundsList.end(); ++it)
if ((*it)->name == image && (*it)->color == color)
@@ -111,14 +111,14 @@ OpaqueBackgroundEntry* BackgroundManager::opaqueBackgroundEntryFor(const QString
return 0;
}
-bool BackgroundManager::subscribe(const QString &image)
+bool BackgroundManager::subscribe(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
if (entry) {
// If it's the first time something subscribe to this image:
if (!entry->pixmap) {
// Try to load the pixmap:
- entry->pixmap = new QPixmap(entry->location);
+ entry->pixmap = new TQPixmap(entry->location);
// Try to figure out if it's a tiled background image or not (default to NO):
KSimpleConfig config(entry->location + ".config", /*readOnly=*/true);
config.setGroup("BasKet Background Image Configuration");
@@ -139,7 +139,7 @@ bool BackgroundManager::subscribe(const QString &image)
}
}
-bool BackgroundManager::subscribe(const QString &image, const QColor &color)
+bool BackgroundManager::subscribe(const TQString &image, const TQColor &color)
{
BackgroundEntry *backgroundEntry = backgroundEntryFor(image);
@@ -155,9 +155,9 @@ bool BackgroundManager::subscribe(const QString &image, const QColor &color)
if (!opaqueBackgroundEntry) {
/// std::cout << "BackgroundManager: Computing (" << image << "," << color.name() << ")..." << std::endl;
opaqueBackgroundEntry = new OpaqueBackgroundEntry(image, color);
- opaqueBackgroundEntry->pixmap = new QPixmap(backgroundEntry->pixmap->size());
+ opaqueBackgroundEntry->pixmap = new TQPixmap(backgroundEntry->pixmap->size());
opaqueBackgroundEntry->pixmap->fill(color);
- QPainter painter(opaqueBackgroundEntry->pixmap);
+ TQPainter painter(opaqueBackgroundEntry->pixmap);
painter.drawPixmap(0, 0, *(backgroundEntry->pixmap));
painter.end();
m_opaqueBackgroundsList.append(opaqueBackgroundEntry);
@@ -168,7 +168,7 @@ bool BackgroundManager::subscribe(const QString &image, const QColor &color)
return true;
}
-void BackgroundManager::unsubscribe(const QString &image)
+void BackgroundManager::unsubscribe(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
@@ -182,7 +182,7 @@ void BackgroundManager::unsubscribe(const QString &image)
requestDelayedGarbage();
}
-void BackgroundManager::unsubscribe(const QString &image, const QColor &color)
+void BackgroundManager::unsubscribe(const TQString &image, const TQColor &color)
{
OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
@@ -196,7 +196,7 @@ void BackgroundManager::unsubscribe(const QString &image, const QColor &color)
requestDelayedGarbage();
}
-QPixmap* BackgroundManager::pixmap(const QString &image)
+TQPixmap* BackgroundManager::pixmap(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
@@ -208,7 +208,7 @@ QPixmap* BackgroundManager::pixmap(const QString &image)
return entry->pixmap;
}
-QPixmap* BackgroundManager::opaquePixmap(const QString &image, const QColor &color)
+TQPixmap* BackgroundManager::opaquePixmap(const TQString &image, const TQColor &color)
{
OpaqueBackgroundEntry *entry = opaqueBackgroundEntryFor(image, color);
@@ -220,7 +220,7 @@ QPixmap* BackgroundManager::opaquePixmap(const QString &image, const QColor &col
return entry->pixmap;
}
-bool BackgroundManager::tiled(const QString &image)
+bool BackgroundManager::tiled(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
@@ -232,7 +232,7 @@ bool BackgroundManager::tiled(const QString &image)
return entry->tiled;
}
-bool BackgroundManager::exists(const QString &image)
+bool BackgroundManager::exists(const TQString &image)
{
for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
if ((*it)->name == image)
@@ -240,19 +240,19 @@ bool BackgroundManager::exists(const QString &image)
return false;
}
-QStringList BackgroundManager::imageNames()
+TQStringList BackgroundManager::imageNames()
{
- QStringList list;
+ TQStringList list;
for (BackgroundsList::iterator it = m_backgroundsList.begin(); it != m_backgroundsList.end(); ++it)
list.append((*it)->name);
return list;
}
-QPixmap* BackgroundManager::preview(const QString &image)
+TQPixmap* BackgroundManager::preview(const TQString &image)
{
static const int MAX_WIDTH = 100;
static const int MAX_HEIGHT = 75;
- static const QColor PREVIEW_BG = Qt::white;
+ static const TQColor PREVIEW_BG = TQt::white;
BackgroundEntry *entry = backgroundEntryFor(image);
@@ -266,8 +266,8 @@ QPixmap* BackgroundManager::preview(const QString &image)
return entry->preview;
// Then, try to load the preview from file:
- QString previewPath = KGlobal::dirs()->findResource("data", "basket/backgrounds/previews/" + entry->name);
- QPixmap *previewPixmap = new QPixmap(previewPath);
+ TQString previewPath = KGlobal::dirs()->findResource("data", "basket/backgrounds/previews/" + entry->name);
+ TQPixmap *previewPixmap = new TQPixmap(previewPath);
// Success:
if (!previewPixmap->isNull()) {
/// std::cout << "BackgroundManager: Loaded image preview for " << entry->location << " from file " << previewPath << std::endl;
@@ -283,9 +283,9 @@ QPixmap* BackgroundManager::preview(const QString &image)
// Already used? Good: we don't have to load it...
if (!entry->pixmap) {
- // Note: it's a code duplication from BackgroundManager::subscribe(const QString &image),
+ // Note: it's a code duplication from BackgroundManager::subscribe(const TQString &image),
// Because, as we are loading the pixmap we ALSO need to know if it's a tile or not, in case that image will soon be used (and not destroyed by the garbager):
- entry->pixmap = new QPixmap(entry->location);
+ entry->pixmap = new TQPixmap(entry->location);
// Try to figure out if it's a tiled background image or not (default to NO):
KSimpleConfig config(entry->location + ".config", /*readOnly=*/true);
config.setGroup("BasKet Background Image Configuration");
@@ -309,17 +309,17 @@ QPixmap* BackgroundManager::preview(const QString &image)
height = MAX_HEIGHT;
}
// And create the resulting pixmap:
- QPixmap *result = new QPixmap(width, height);
+ TQPixmap *result = new TQPixmap(width, height);
result->fill(PREVIEW_BG);
- QImage imageToScale = entry->pixmap->convertToImage();
- QPixmap pmScaled;
+ TQImage imageToScale = entry->pixmap->convertToImage();
+ TQPixmap pmScaled;
pmScaled.convertFromImage(imageToScale.smoothScale(width, height));
- QPainter painter(result);
+ TQPainter painter(result);
painter.drawPixmap(0, 0, pmScaled);
painter.end();
// Saving it to file for later:
- QString folder = KGlobal::dirs()->saveLocation("data", "basket/backgrounds/previews/");
+ TQString folder = KGlobal::dirs()->saveLocation("data", "basket/backgrounds/previews/");
result->save(folder + entry->name, "PNG");
// Ouf! That's done:
@@ -328,7 +328,7 @@ QPixmap* BackgroundManager::preview(const QString &image)
return entry->preview;
}
-QString BackgroundManager::pathForImageName(const QString &image)
+TQString BackgroundManager::pathForImageName(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
if (entry == 0)
@@ -337,14 +337,14 @@ QString BackgroundManager::pathForImageName(const QString &image)
return entry->location;
}
-QString BackgroundManager::previewPathForImageName(const QString &image)
+TQString BackgroundManager::previewPathForImageName(const TQString &image)
{
BackgroundEntry *entry = backgroundEntryFor(image);
if (entry == 0)
return "";
else {
- QString previewPath = KGlobal::dirs()->findResource("data", "basket/backgrounds/previews/" + entry->name);
- QDir dir;
+ TQString previewPath = KGlobal::dirs()->findResource("data", "basket/backgrounds/previews/" + entry->name);
+ TQDir dir;
if (!dir.exists(previewPath))
return "";
else
diff --git a/src/backgroundmanager.h b/src/backgroundmanager.h
index 0db7898..2d1a442 100644
--- a/src/backgroundmanager.h
+++ b/src/backgroundmanager.h
@@ -21,12 +21,12 @@
#ifndef BACKGROUNDMANAGER_H
#define BACKGROUNDMANAGER_H
-#include <qobject.h>
-#include <qvaluelist.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qtimer.h>
+#include <tqobject.h>
+#include <tqvaluelist.h>
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
+#include <tqtimer.h>
/** A node in the list of background images of BackgroundManager.
* It can only be used by BackgroundManager because it is an internal structure of this manager.
@@ -37,14 +37,14 @@ class BackgroundEntry
friend class BackgroundManager;
protected:
- BackgroundEntry(const QString &location);
+ BackgroundEntry(const TQString &location);
~BackgroundEntry();
- QString name;
- QString location;
+ TQString name;
+ TQString location;
bool tiled; /// << Only valid after some object subscribed to this image! Because it's only read at this time.
- QPixmap *pixmap; /// << Only valid (non-null) after some object subscribed to this image! Because it's only read at this time.
- QPixmap *preview; /// << Only valid (non-null) after some object requested the preview.
+ TQPixmap *pixmap; /// << Only valid (non-null) after some object subscribed to this image! Because it's only read at this time.
+ TQPixmap *preview; /// << Only valid (non-null) after some object requested the preview.
int customersCount;
};
@@ -57,18 +57,18 @@ class OpaqueBackgroundEntry
friend class BackgroundManager;
protected:
- OpaqueBackgroundEntry(const QString &name, const QColor &color);
+ OpaqueBackgroundEntry(const TQString &name, const TQColor &color);
~OpaqueBackgroundEntry();
- QString name;
- QColor color;
- QPixmap *pixmap;
+ TQString name;
+ TQColor color;
+ TQPixmap *pixmap;
int customersCount;
};
/** Manage the list of background images.
* BASIC FUNCTIONNING OF A BACKGROUND CHOOSER:
- * It get all image names with imageNames() to put them in eg. a QComboBox and then,
+ * It get all image names with imageNames() to put them in eg. a TQComboBox and then,
* when it's time to get the preview of an image it call preview() with the image name to get it.
* Preview are only computed on demand and then cached to fast the next demands (only the pointer will have to be returned).
* Previews are scalled to fit in a rectangle of 100 by 75 pixels, and with a white background color.
@@ -85,45 +85,46 @@ class OpaqueBackgroundEntry
* if nothing is subscribed to them (to free memory).
* @author S�astien Laot
*/
-class BackgroundManager : private QObject
+class BackgroundManager : private TQObject
{
Q_OBJECT
+ TQ_OBJECT
private:
/// LIST OF IMAGES:
- typedef QValueList<BackgroundEntry*> BackgroundsList;
- typedef QValueList<OpaqueBackgroundEntry*> OpaqueBackgroundsList;
+ typedef TQValueList<BackgroundEntry*> BackgroundsList;
+ typedef TQValueList<OpaqueBackgroundEntry*> OpaqueBackgroundsList;
public:
/// CONTRUCTOR AND DESTRUCTOR:
BackgroundManager();
~BackgroundManager();
/// SUBSCRIPTION TO IMAGES:
- bool subscribe(const QString &image); /// << @Return true if the loading is a success. In the counter-case, calling methods below is unsafe with this @p image name.
- bool subscribe(const QString &image, const QColor &color); /// << Idem.
- void unsubscribe(const QString &image);
- void unsubscribe(const QString &image, const QColor &color);
+ bool subscribe(const TQString &image); /// << @Return true if the loading is a success. In the counter-case, calling methods below is unsafe with this @p image name.
+ bool subscribe(const TQString &image, const TQColor &color); /// << Idem.
+ void unsubscribe(const TQString &image);
+ void unsubscribe(const TQString &image, const TQColor &color);
/// GETTING THE IMAGES AND PROPERTIES:
- QPixmap* pixmap(const QString &image);
- QPixmap* opaquePixmap(const QString &image, const QColor &color);
- bool tiled(const QString &image);
+ TQPixmap* pixmap(const TQString &image);
+ TQPixmap* opaquePixmap(const TQString &image, const TQColor &color);
+ bool tiled(const TQString &image);
/// LIST OF IMAGES AND PREVIEWS:
- bool exists(const QString &image);
- QStringList imageNames();
- QPixmap* preview(const QString &image);
+ bool exists(const TQString &image);
+ TQStringList imageNames();
+ TQPixmap* preview(const TQString &image);
/// USED FOR EXPORTATION:
- QString pathForImageName(const QString &image); /// << It is STRONGLY advised to not use those two methods unless it's to copy (export) the images or something like that...
- QString previewPathForImageName(const QString &image);
+ TQString pathForImageName(const TQString &image); /// << It is STRONGLY advised to not use those two methods unless it's to copy (export) the images or something like that...
+ TQString previewPathForImageName(const TQString &image);
/// USED FOR IMPORTATION:
- void addImage(const QString &fullPath);
+ void addImage(const TQString &fullPath);
private:
- BackgroundEntry* backgroundEntryFor(const QString &image);
- OpaqueBackgroundEntry* opaqueBackgroundEntryFor(const QString &image, const QColor &color);
+ BackgroundEntry* backgroundEntryFor(const TQString &image);
+ OpaqueBackgroundEntry* opaqueBackgroundEntryFor(const TQString &image, const TQColor &color);
private:
BackgroundsList m_backgroundsList;
OpaqueBackgroundsList m_opaqueBackgroundsList;
- QTimer m_garbageTimer;
+ TQTimer m_garbageTimer;
private slots:
void requestDelayedGarbage();
void doGarbage();
diff --git a/src/backup.cpp b/src/backup.cpp
index 00bc660..6c0bd4e 100644
--- a/src/backup.cpp
+++ b/src/backup.cpp
@@ -26,16 +26,16 @@
#include "tools.h"
#include "formatimporter.h" // To move a folder
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
#include <klocale.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kapplication.h>
#include <kaboutdata.h>
-#include <qgroupbox.h>
+#include <tqgroupbox.h>
#include <kdirselectdialog.h>
#include <krun.h>
#include <kconfig.h>
@@ -50,26 +50,26 @@
* Backups are wrapped in a .tar.gz, inside that folder name.
* An archive is not a backup or is corrupted if data are not in that folder!
*/
-const QString backupMagicFolder = "BasKet-Note-Pads_Backup";
+const TQString backupMagicFolder = "BasKet-Note-Pads_Backup";
/** class BackupDialog: */
-BackupDialog::BackupDialog(QWidget *parent, const char *name)
- : KDialogBase(parent, name, /*modal=*/true, i18n("Backup & Restore"),
+BackupDialog::BackupDialog(TQWidget *tqparent, const char *name)
+ : KDialogBase(tqparent, name, /*modal=*/true, i18n("Backup & Restore"),
KDialogBase::Close, KDialogBase::Close, /*separator=*/false)
{
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
// page->setSpacing(spacingHint());
- QString savesFolder = Global::savesFolder();
+ TQString savesFolder = Global::savesFolder();
savesFolder = savesFolder.left(savesFolder.length() - 1); // savesFolder ends with "/"
- QGroupBox *folderGroup = new QGroupBox(1, Qt::Horizontal, i18n("Save Folder"), page);
- new QLabel("<qt><nobr>" + i18n("Your baskets are currently stored in that folder:<br><b>%1</b>").arg(savesFolder), folderGroup);
- QWidget *folderWidget = new QWidget(folderGroup);
- QHBoxLayout *folderLayout = new QHBoxLayout(folderWidget, 0, spacingHint());
- QPushButton *moveFolder = new QPushButton(i18n("&Move to Another Folder..."), folderWidget);
- QPushButton *useFolder = new QPushButton(i18n("&Use Another Existing Folder..."), folderWidget);
+ TQGroupBox *folderGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Save Folder"), page);
+ new TQLabel("<qt><nobr>" + i18n("Your baskets are currently stored in that folder:<br><b>%1</b>").tqarg(savesFolder), folderGroup);
+ TQWidget *folderWidget = new TQWidget(folderGroup);
+ TQHBoxLayout *folderLayout = new TQHBoxLayout(folderWidget, 0, spacingHint());
+ TQPushButton *moveFolder = new TQPushButton(i18n("&Move to Another Folder..."), folderWidget);
+ TQPushButton *useFolder = new TQPushButton(i18n("&Use Another Existing Folder..."), folderWidget);
HelpLabel *helpLabel = new HelpLabel(i18n("Why to do that?"), i18n(
"<p>You can move the folder where %1 store your baskets to:</p><ul>"
"<li>Store your baskets in a visible place in your home folder, like ~/Notes or ~/Baskets, so you can manually backup them when you want.</li>"
@@ -77,33 +77,33 @@ BackupDialog::BackupDialog(QWidget *parent, const char *name)
"In this case, mount the shared-folder to the local file system and ask %2 to use that mount point.<br>"
"Warning: you should not run %3 at the same time on both computers, or you risk to loss data while the two applications are desynced.</li>"
"</ul><p>Please remember that you should not change the content of that folder manually (eg. adding a file in a basket folder will not add that file to the basket).</p>")
- .arg(kapp->aboutData()->programName())
- .arg(kapp->aboutData()->programName())
- .arg(kapp->aboutData()->programName()),
+ .tqarg(kapp->aboutData()->programName())
+ .tqarg(kapp->aboutData()->programName())
+ .tqarg(kapp->aboutData()->programName()),
folderWidget);
folderLayout->addWidget(moveFolder);
folderLayout->addWidget(useFolder);
folderLayout->addWidget(helpLabel);
folderLayout->addStretch();
- connect( moveFolder, SIGNAL(clicked()), this, SLOT(moveToAnotherFolder()) );
- connect( useFolder, SIGNAL(clicked()), this, SLOT(useAnotherExistingFolder()) );
-
- QGroupBox *backupGroup = new QGroupBox(1, Qt::Horizontal, i18n("Backups"), page);
- QWidget *backupWidget = new QWidget(backupGroup);
- QHBoxLayout *backupLayout = new QHBoxLayout(backupWidget, 0, spacingHint());
- QPushButton *backupButton = new QPushButton(i18n("&Backup..."), backupWidget);
- QPushButton *restoreButton = new QPushButton(i18n("&Restore a Backup..."), backupWidget);
- m_lastBackup = new QLabel("", backupWidget);
+ connect( moveFolder, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveToAnotherFolder()) );
+ connect( useFolder, TQT_SIGNAL(clicked()), this, TQT_SLOT(useAnotherExistingFolder()) );
+
+ TQGroupBox *backupGroup = new TQGroupBox(1, Qt::Horizontal, i18n("Backups"), page);
+ TQWidget *backupWidget = new TQWidget(backupGroup);
+ TQHBoxLayout *backupLayout = new TQHBoxLayout(backupWidget, 0, spacingHint());
+ TQPushButton *backupButton = new TQPushButton(i18n("&Backup..."), backupWidget);
+ TQPushButton *restoreButton = new TQPushButton(i18n("&Restore a Backup..."), backupWidget);
+ m_lastBackup = new TQLabel("", backupWidget);
backupLayout->addWidget(backupButton);
backupLayout->addWidget(restoreButton);
backupLayout->addWidget(m_lastBackup);
backupLayout->addStretch();
- connect( backupButton, SIGNAL(clicked()), this, SLOT(backup()) );
- connect( restoreButton, SIGNAL(clicked()), this, SLOT(restore()) );
+ connect( backupButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(backup()) );
+ connect( restoreButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(restore()) );
populateLastBackup();
- (new QWidget(page))->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ (new TQWidget(page))->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
}
BackupDialog::~BackupDialog()
@@ -112,9 +112,9 @@ BackupDialog::~BackupDialog()
void BackupDialog::populateLastBackup()
{
- QString lastBackupText = i18n("Last backup: never");
+ TQString lastBackupText = i18n("Last backup: never");
if (Settings::lastBackup().isValid())
- lastBackupText = i18n("Last backup: %1").arg(Settings::lastBackup().toString(Qt::LocalDate));
+ lastBackupText = i18n("Last backup: %1").tqarg(Settings::lastBackup().toString(Qt::LocalDate));
m_lastBackup->setText(lastBackupText);
}
@@ -122,20 +122,20 @@ void BackupDialog::populateLastBackup()
void BackupDialog::moveToAnotherFolder()
{
KURL selectedURL = KDirSelectDialog::selectDirectory(
- /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
+ /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*tqparent=*/0,
/*caption=*/i18n("Choose a Folder Where to Move Baskets"));
if (!selectedURL.isEmpty()) {
- QString folder = selectedURL.path();
- QDir dir(folder);
+ TQString folder = selectedURL.path();
+ TQDir dir(folder);
// The folder should not exists, or be empty (because KDirSelectDialog will likely create it anyway):
if (dir.exists()) {
// Get the content of the folder:
- QStringList content = dir.entryList();
+ TQStringList content = dir.entryList();
if (content.count() > 2) { // "." and ".."
int result = KMessageBox::questionYesNo(
0,
- "<qt>" + i18n("The folder <b>%1</b> is not empty. Do you want to override it?").arg(folder),
+ "<qt>" + i18n("The folder <b>%1</b> is not empty. Do you want to override it?").tqarg(folder),
i18n("Override Folder?"),
KGuiItem(i18n("&Override"), "filesave")
);
@@ -153,7 +153,7 @@ void BackupDialog::moveToAnotherFolder()
void BackupDialog::useAnotherExistingFolder()
{
KURL selectedURL = KDirSelectDialog::selectDirectory(
- /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*parent=*/0,
+ /*startDir=*/Global::savesFolder(), /*localOnly=*/true, /*tqparent=*/0,
/*caption=*/i18n("Choose an Existing Folder to Store Baskets"));
if (!selectedURL.isEmpty()) {
@@ -163,19 +163,19 @@ void BackupDialog::useAnotherExistingFolder()
void BackupDialog::backup()
{
- QDir dir;
+ TQDir dir;
// Compute a default file name & path (eg. "Baskets_2007-01-31.tar.gz"):
KConfig *config = KGlobal::config();
config->setGroup("Backups");
- QString folder = config->readEntry("lastFolder", QDir::homeDirPath()) + "/";
- QString fileName = i18n("Backup filename (without extension), %1 is the date", "Baskets_%1")
- .arg(QDate::currentDate().toString(Qt::ISODate));
- QString url = folder + fileName;
+ TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
+ TQString fileName = i18n("Backup filename (without extension), %1 is the date", "Baskets_%1")
+ .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate));
+ TQString url = folder + fileName;
// Ask a file name & path to the user:
- QString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
- QString destination = url;
+ TQString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
+ TQString destination = url;
for (bool askAgain = true; askAgain; ) {
// Ask:
destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n("Backup Baskets"));
@@ -187,7 +187,7 @@ void BackupDialog::backup()
int result = KMessageBox::questionYesNoCancel(
0,
"<qt>" + i18n("The file <b>%1</b> already exists. Do you really want to override it?")
- .arg(KURL(destination).fileName()),
+ .tqarg(KURL(destination).fileName()),
i18n("Override File?"),
KGuiItem(i18n("&Override"), "filesave")
);
@@ -216,7 +216,7 @@ void BackupDialog::backup()
usleep(300); // Not too long because if the backup process is finished, we wait for nothing
}
- Settings::setLastBackup(QDate::currentDate());
+ Settings::setLastBackup(TQDate::tqcurrentDate());
Settings::saveConfig();
populateLastBackup();
}
@@ -226,35 +226,35 @@ void BackupDialog::restore()
// Get last backup folder:
KConfig *config = KGlobal::config();
config->setGroup("Backups");
- QString folder = config->readEntry("lastFolder", QDir::homeDirPath()) + "/";
+ TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
// Ask a file name to the user:
- QString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
- QString path = KFileDialog::getOpenFileName(folder, filter, this, i18n("Open Basket Archive"));
+ TQString filter = "*.tar.gz|" + i18n("Tar Archives Compressed by Gzip") + "\n*|" + i18n("All Files");
+ TQString path = KFileDialog::getOpenFileName(folder, filter, this, i18n("Open Basket Archive"));
if (path.isEmpty()) // User has canceled
return;
// Before replacing the basket data folder with the backup content, we safely backup the current baskets to the home folder.
// So if the backup is corrupted or something goes wrong while restoring (power cut...) the user will be able to restore the old working data:
- QString safetyPath = Backup::newSafetyFolder();
+ TQString safetyPath = Backup::newSafetyFolder();
FormatImporter copier;
copier.moveFolder(Global::savesFolder(), safetyPath);
// Add the README file for user to cancel a bad restoration:
- QString readmePath = safetyPath + i18n("README.txt");
- QFile file(readmePath);
+ TQString readmePath = safetyPath + i18n("README.txt");
+ TQFile file(readmePath);
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream << i18n("This is a safety copy of your baskets like they were before you started to restore the backup %1.").arg(KURL(path).fileName()) + "\n\n"
+ TQTextStream stream(&file);
+ stream << i18n("This is a safety copy of your baskets like they were before you started to restore the backup %1.").tqarg(KURL(path).fileName()) + "\n\n"
<< i18n("If the restoration was a success and you restored what you wanted to restore, you can remove this folder.") + "\n\n"
<< i18n("If something went wrong during the restoration process, you can re-use this folder to store your baskets and nothing will be lost.") + "\n\n"
<< i18n("Choose \"Basket\" -> \"Backup & Restore...\" -> \"Use Another Existing Folder...\" and select that folder.") + "\n";
file.close();
}
- QString message =
- "<p><nobr>" + i18n("Restoring <b>%1</b>. Please wait...").arg(KURL(path).fileName()) + "</nobr></p><p>" +
- i18n("If something goes wrong during the restoration process, read the file <b>%1</b>.").arg(readmePath);
+ TQString message =
+ "<p><nobr>" + i18n("Restoring <b>%1</b>. Please wait...").tqarg(KURL(path).fileName()) + "</nobr></p><p>" +
+ i18n("If something goes wrong during the restoration process, read the file <b>%1</b>.").tqarg(readmePath);
KProgressDialog *dialog = new KProgressDialog(0, 0, i18n("Restore Baskets"), message, /*modal=*/true);
dialog->setAllowCancel(false);
@@ -282,7 +282,7 @@ void BackupDialog::restore()
// Check for errors:
if (!thread.success()) {
// Restore the old baskets:
- QDir dir;
+ TQDir dir;
dir.remove(readmePath);
copier.moveFolder(safetyPath, Global::savesFolder());
// Tell the user:
@@ -299,11 +299,11 @@ void BackupDialog::restore()
/** class Backup: */
-QString Backup::binaryPath = "";
+TQString Backup::binaryPath = "";
#include <iostream>
-void Backup::figureOutBinaryPath(const char *argv0, QApplication &app)
+void Backup::figureOutBinaryPath(const char *argv0, TQApplication &app)
{
/*
The application can be launched by two ways:
@@ -311,18 +311,18 @@ void Backup::figureOutBinaryPath(const char *argv0, QApplication &app)
- In KDevelop or with an absolute path (app.applicationFilePath() is wrong)
This function is called at the very start of main() so that the current directory has not been changed yet.
- Command line (argv[0]) QDir(argv[0]).canonicalPath() app.applicationFilePath()
+ Command line (argv[0]) TQDir(argv[0]).canonicalPath() app.applicationFilePath()
====================== ============================================= =========================
"basket" "" "/opt/kde3/bin/basket"
"./src/.libs/basket" "/home/seb/prog/basket/debug/src/.lib/basket" "/opt/kde3/bin/basket"
*/
- binaryPath = QDir(argv0).canonicalPath();
+ binaryPath = TQDir(argv0).canonicalPath();
if (binaryPath.isEmpty())
binaryPath = app.applicationFilePath();
}
-void Backup::setFolderAndRestart(const QString &folder, const QString &message)
+void Backup::setFolderAndRestart(const TQString &folder, const TQString &message)
{
// Set the folder:
Settings::setDataFolder(folder);
@@ -332,7 +332,7 @@ void Backup::setFolderAndRestart(const QString &folder, const QString &message)
// This is important for users to trust the application in such a critical phase and understands what's happening:
KMessageBox::information(
0,
- "<qt>" + message.arg(
+ "<qt>" + message.tqarg(
(folder.endsWith("/") ? folder.left(folder.length() - 1) : folder),
kapp->aboutData()->programName()),
i18n("Restart")
@@ -343,17 +343,17 @@ void Backup::setFolderAndRestart(const QString &folder, const QString &message)
exit(0);
}
-QString Backup::newSafetyFolder()
+TQString Backup::newSafetyFolder()
{
- QDir dir;
- QString fullPath;
+ TQDir dir;
+ TQString fullPath;
- fullPath = QDir::homeDirPath() + "/" + i18n("Safety folder name before restoring a basket data archive", "Baskets Before Restoration") + "/";
+ fullPath = TQDir::homeDirPath() + "/" + i18n("Safety folder name before restoring a basket data archive", "Baskets Before Restoration") + "/";
if (!dir.exists(fullPath))
return fullPath;
for (int i = 2; ; ++i) {
- fullPath = QDir::homeDirPath() + "/" + i18n("Safety folder name before restoring a basket data archive", "Baskets Before Restoration (%1)").arg(i) + "/";
+ fullPath = TQDir::homeDirPath() + "/" + i18n("Safety folder name before restoring a basket data archive", "Baskets Before Restoration (%1)").tqarg(i) + "/";
if (!dir.exists(fullPath))
return fullPath;
}
@@ -363,7 +363,7 @@ QString Backup::newSafetyFolder()
/** class BackupThread: */
-BackupThread::BackupThread(const QString &tarFile, const QString &folderToBackup)
+BackupThread::BackupThread(const TQString &tarFile, const TQString &folderToBackup)
: m_tarFile(tarFile), m_folderToBackup(folderToBackup)
{
}
@@ -374,9 +374,9 @@ void BackupThread::run()
tar.open(IO_WriteOnly);
tar.addLocalDirectory(m_folderToBackup, backupMagicFolder);
// KArchive does not add hidden files. Basket description files (".basket") are hidden, we add them manually:
- QDir dir(m_folderToBackup + "baskets/");
- QStringList baskets = dir.entryList(QDir::Dirs);
- for (QStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it) {
+ TQDir dir(m_folderToBackup + "baskets/");
+ TQStringList baskets = dir.entryList(TQDir::Dirs);
+ for (TQStringList::Iterator it = baskets.begin(); it != baskets.end(); ++it) {
tar.addLocalFile(
m_folderToBackup + "baskets/" + *it + "/.basket",
backupMagicFolder + "/baskets/" + *it + "/.basket"
@@ -388,7 +388,7 @@ void BackupThread::run()
/** class RestoreThread: */
-RestoreThread::RestoreThread(const QString &tarFile, const QString &destFolder)
+RestoreThread::RestoreThread(const TQString &tarFile, const TQString &destFolder)
: m_tarFile(tarFile), m_destFolder(destFolder)
{
}
@@ -400,7 +400,7 @@ void RestoreThread::run()
tar.open(IO_ReadOnly);
if (tar.isOpened()) {
const KArchiveDirectory *directory = tar.directory();
- if (directory->entries().contains(backupMagicFolder)) {
+ if (directory->entries().tqcontains(backupMagicFolder)) {
const KArchiveEntry *entry = directory->entry(backupMagicFolder);
if (entry->isDirectory()) {
((const KArchiveDirectory*) entry)->copyTo(m_destFolder);
diff --git a/src/backup.h b/src/backup.h
index 092aba9..cd63d7d 100644
--- a/src/backup.h
+++ b/src/backup.h
@@ -22,8 +22,8 @@
#define BACKUP_H
#include <kdialogbase.h>
-#include <qapplication.h>
-#include <qthread.h>
+#include <tqapplication.h>
+#include <tqthread.h>
/**
* @author Sébastien Laoût
@@ -31,8 +31,9 @@
class BackupDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- BackupDialog(QWidget *parent = 0, const char *name = 0);
+ BackupDialog(TQWidget *tqparent = 0, const char *name = 0);
~BackupDialog();
private slots:
void moveToAnotherFolder();
@@ -41,7 +42,7 @@ class BackupDialog : public KDialogBase
void restore();
void populateLastBackup();
private:
- QLabel *m_lastBackup;
+ TQLabel *m_lastBackup;
};
/**
@@ -50,35 +51,35 @@ class BackupDialog : public KDialogBase
class Backup
{
public:
- static void figureOutBinaryPath(const char *argv0, QApplication &app);
- static void setFolderAndRestart(const QString &folder, const QString &message);
- static QString newSafetyFolder();
+ static void figureOutBinaryPath(const char *argv0, TQApplication &app);
+ static void setFolderAndRestart(const TQString &folder, const TQString &message);
+ static TQString newSafetyFolder();
private:
- static QString binaryPath;
+ static TQString binaryPath;
};
-class BackupThread : public QThread
+class BackupThread : public TQThread
{
public:
- BackupThread(const QString &tarFile, const QString &folderToBackup);
+ BackupThread(const TQString &tarFile, const TQString &folderToBackup);
protected:
virtual void run();
private:
- QString m_tarFile;
- QString m_folderToBackup;
+ TQString m_tarFile;
+ TQString m_folderToBackup;
};
-class RestoreThread : public QThread
+class RestoreThread : public TQThread
{
public:
- RestoreThread(const QString &tarFile, const QString &destFolder);
+ RestoreThread(const TQString &tarFile, const TQString &destFolder);
inline bool success() { return m_success; }
protected:
virtual void run();
private:
- QString m_tarFile;
- QString m_destFolder;
+ TQString m_tarFile;
+ TQString m_destFolder;
bool m_success;
};
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();
diff --git a/src/basket.h b/src/basket.h
index 4e0331f..2c20224 100644
--- a/src/basket.h
+++ b/src/basket.h
@@ -21,13 +21,13 @@
#ifndef BASKET_H
#define BASKET_H
-#include <qscrollview.h>
-#include <qtooltip.h>
-#include <qvaluelist.h>
-#include <qtimer.h>
-#include <qimage.h>
-#include <qdatetime.h>
-#include <qclipboard.h>
+#include <tqscrollview.h>
+#include <tqtooltip.h>
+#include <tqvaluelist.h>
+#include <tqtimer.h>
+#include <tqimage.h>
+#include <tqdatetime.h>
+#include <tqclipboard.h>
#include <kshortcut.h>
#include <kdirwatch.h>
#include <kaction.h>
@@ -38,9 +38,9 @@
#include "note.h" // For Note::Zone
#include "config.h"
-class QVBoxLayout;
-class QDomDocument;
-class QDomElement;
+class TQVBoxLayout;
+class TQDomDocument;
+class TQDomElement;
class Basket;
class Note;
@@ -57,12 +57,13 @@ class KGpgMe;
class DiskErrorDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- DiskErrorDialog(const QString &titleMessage, const QString &message, QWidget *parent = 0);
+ DiskErrorDialog(const TQString &titleMessage, const TQString &message, TQWidget *tqparent = 0);
~DiskErrorDialog();
protected:
- void closeEvent(QCloseEvent *event);
- void keyPressEvent(QKeyEvent*);
+ void closeEvent(TQCloseEvent *event);
+ void keyPressEvent(TQKeyEvent*);
};
@@ -86,21 +87,21 @@ namespace PlugOptions
class NoteSelection
{
public:
- NoteSelection() : note(0), parent(0), firstChild(0), next(0), fullPath() {}
- NoteSelection(Note *n) : note(n), parent(0), firstChild(0), next(0), fullPath() {}
+ NoteSelection() : note(0), tqparent(0), firstChild(0), next(0), fullPath() {}
+ NoteSelection(Note *n) : note(n), tqparent(0), firstChild(0), next(0), fullPath() {}
Note *note;
- NoteSelection *parent;
+ NoteSelection *tqparent;
NoteSelection *firstChild;
NoteSelection *next;
- QString fullPath; // Needeed for 'Cut' code to store temporary path of the cutted note.
+ TQString fullPath; // Needeed for 'Cut' code to store temporary path of the cutted note.
NoteSelection* firstStacked();
NoteSelection* nextStacked();
void append(NoteSelection *node);
int count();
- QValueList<Note*> parentGroups();
+ TQValueList<Note*> tqparentGroups();
};
/** This store all needed information when exporting to HTML
@@ -108,12 +109,12 @@ class NoteSelection
class HtmlExportData
{
public:
- QString iconsFolderPath;
- QString iconsFolderName;
- QString imagesFolderPath;
- QString imagesFolderName;
- QString dataFolderPath;
- QString dataFolderName;
+ TQString iconsFolderPath;
+ TQString iconsFolderName;
+ TQString imagesFolderPath;
+ TQString imagesFolderName;
+ TQString dataFolderPath;
+ TQString dataFolderName;
bool formatForImpression;
bool embedLinkedFiles;
bool embedLinkedFolders;
@@ -122,11 +123,12 @@ class HtmlExportData
/** This class handle Basket and add a FilterWidget on top of it.
* @author S�astien Laot
*/
-class DecoratedBasket : public QWidget
+class DecoratedBasket : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- DecoratedBasket(QWidget *parent, const QString &folderName, const char *name = 0, WFlags fl = 0);
+ DecoratedBasket(TQWidget *tqparent, const TQString &folderName, const char *name = 0, WFlags fl = 0);
~DecoratedBasket();
void setFilterBarPosition(bool onTop);
void resetFilter();
@@ -136,22 +138,23 @@ class DecoratedBasket : public QWidget
FilterBar* filterBar() { return m_filter; }
Basket* basket() { return m_basket; }
private:
- QVBoxLayout *m_layout;
+ TQVBoxLayout *m_layout;
FilterBar *m_filter;
Basket *m_basket;
};
-class TransparentWidget : public QWidget
+class TransparentWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
TransparentWidget(Basket *basket);
void setPosition(int x, int y);
- //void reparent(QWidget *parent, WFlags f, const QPoint &p, bool showIt = FALSE);
+ //void reparent(TQWidget *tqparent, WFlags f, const TQPoint &p, bool showIt = FALSE);
protected:
- void paintEvent(QPaintEvent*);
- void mouseMoveEvent(QMouseEvent *event);
- bool eventFilter(QObject *object, QEvent *event);
+ void paintEvent(TQPaintEvent*);
+ void mouseMoveEvent(TQMouseEvent *event);
+ bool eventFilter(TQObject *object, TQEvent *event);
private:
Basket *m_basket;
int m_x;
@@ -161,10 +164,11 @@ class TransparentWidget : public QWidget
/**
* @author S�astien Laot
*/
-class Basket : public QScrollView, public QToolTip
+class Basket : public TQScrollView, public TQToolTip
{
/// CONSTRUCTOR AND DESTRUCTOR:
Q_OBJECT
+ TQ_OBJECT
public:
enum EncryptionTypes {
NoEncryption = 0,
@@ -173,27 +177,27 @@ class Basket : public QScrollView, public QToolTip
};
public:
- Basket(QWidget *parent, const QString &folderName);
+ Basket(TQWidget *tqparent, const TQString &folderName);
~Basket();
/// USER INTERACTION:
private:
bool m_noActionOnMouseRelease;
bool m_ignoreCloseEditorOnNextMouseRelease;
- QPoint m_pressPos;
+ TQPoint m_pressPos;
bool m_canDrag;
public:
- void viewportResizeEvent(QResizeEvent *);
- void drawContents(QPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight);
- void enterEvent(QEvent *);
- void leaveEvent(QEvent *);
- void contentsMouseMoveEvent(QMouseEvent *event);
- void contentsMousePressEvent(QMouseEvent *event);
- void contentsMouseReleaseEvent(QMouseEvent *event);
- void contentsMouseDoubleClickEvent(QMouseEvent *event);
- void contentsContextMenuEvent(QContextMenuEvent *event);
+ void viewportResizeEvent(TQResizeEvent *);
+ void drawContents(TQPainter *painter, int clipX, int clipY, int clipWidth, int clipHeight);
+ void enterEvent(TQEvent *);
+ void leaveEvent(TQEvent *);
+ void contentsMouseMoveEvent(TQMouseEvent *event);
+ void contentsMousePressEvent(TQMouseEvent *event);
+ void contentsMouseReleaseEvent(TQMouseEvent *event);
+ void contentsMouseDoubleClickEvent(TQMouseEvent *event);
+ void contentsContextMenuEvent(TQContextMenuEvent *event);
void updateNote(Note *note);
- void clickedToInsert(QMouseEvent *event, Note *clicked = 0, int zone = 0);
+ void clickedToInsert(TQMouseEvent *event, Note *clicked = 0, int zone = 0);
private slots:
void setFocusIfNotInPopupMenu();
@@ -205,13 +209,13 @@ class Basket : public QScrollView, public QToolTip
Note *m_resizingNote;
int m_pickedResizer;
Note *m_movingNote;
- QPoint m_pickedHandle;
+ TQPoint m_pickedHandle;
public:
int tmpWidth;
int tmpHeight;
public:
void unsetNotesWidth();
- void relayoutNotes(bool animate);
+ void retqlayoutNotes(bool animate);
Note* noteAt(int x, int y);
inline Note* firstNote() { return m_firstNote; }
inline int columnsCount() { return m_columnsCount; }
@@ -226,7 +230,7 @@ class Basket : public QScrollView, public QToolTip
/// NOTES INSERTION AND REMOVAL:
public:
- /// The following methods assume that the note(s) to insert already all have 'this' as the parent basket:
+ /// The following methods assume that the note(s) to insert already all have 'this' as the tqparent basket:
void prependNoteIn( Note *note, Note *in); /// << Add @p note (and the next linked notes) as the first note(s) of the group @p in.
void appendNoteIn( Note *note, Note *in); /// << Add @p note (and the next linked notes) as the last note(s) of the group @p in.
void appendNoteAfter( Note *note, Note *after); /// << Add @p note (and the next linked notes) just after (just below) the note @p after.
@@ -237,7 +241,7 @@ class Basket : public QScrollView, public QToolTip
/// << After that, you should delete the notes yourself. Do not call prepend/append/group... functions two times: unplug and ok
void ungroupNote( Note *group); /// << Unplug @p group but put child notes at its place.
/// And this one do almost all the above methods depending on the context:
- void insertNote(Note *note, Note *clicked, int zone, const QPoint &pos = QPoint(), bool animateNewPosition = false);
+ void insertNote(Note *note, Note *clicked, int zone, const TQPoint &pos = TQPoint(), bool animateNewPosition = false);
void insertCreatedNote(Note *note);
/// And working with selections:
void unplugSelection(NoteSelection *selection);
@@ -248,10 +252,10 @@ class Basket : public QScrollView, public QToolTip
private:
Note *m_clickedToInsert;
int m_zoneToInsert;
- QPoint m_posToInsert;
+ TQPoint m_posToInsert;
Note *m_savedClickedToInsert;
int m_savedZoneToInsert;
- QPoint m_savedPosToInsert;
+ TQPoint m_savedPosToInsert;
bool m_isInsertPopupMenu;
public:
void saveInsertionData();
@@ -260,9 +264,9 @@ class Basket : public QScrollView, public QToolTip
public slots:
void insertEmptyNote(int type);
void insertWizard(int type);
- void insertColor(const QColor &color);
- void insertImage(const QPixmap &image);
- void pasteNote(QClipboard::Mode mode = QClipboard::Clipboard);
+ void insertColor(const TQColor &color);
+ void insertImage(const TQPixmap &image);
+ void pasteNote(TQClipboard::Mode mode = TQClipboard::Clipboard);
void delayedCancelInsertPopupMenu();
void setInsertPopupMenu() { m_isInsertPopupMenu = true; }
void cancelInsertPopupMenu() { m_isInsertPopupMenu = false; }
@@ -272,14 +276,14 @@ class Basket : public QScrollView, public QToolTip
/// TOOL TIPS:
protected:
- void maybeTip(const QPoint &pos);
+ void maybeTip(const TQPoint &pos);
/// ANIMATIONS:
private:
- QValueList<Note*> m_animatedNotes;
- QTimer m_animationTimer;
+ TQValueList<Note*> m_animatedNotes;
+ TQTimer m_animationTimer;
int m_deltaY;
- QTime m_lastFrameTime;
+ TQTime m_lastFrameTime;
static const int FRAME_DELAY;
private slots:
void animateObjects();
@@ -294,26 +298,26 @@ class Basket : public QScrollView, public QToolTip
bool m_loadingLaunched;
bool m_locked;
bool m_shouldConvertPlainTextNotes;
- QFrame* m_decryptBox;
- QPushButton* m_button;
+ TQFrame* m_decryptBox;
+ TQPushButton* m_button;
int m_encryptionType;
- QString m_encryptionKey;
+ TQString m_encryptionKey;
#ifdef HAVE_LIBGPGME
KGpgMe* m_gpg;
#endif
- QTimer m_inactivityAutoLockTimer;
+ TQTimer m_inactivityAutoLockTimer;
void enableActions();
private slots:
- void loadNotes(const QDomElement &notes, Note *parent);
- void saveNotes(QDomDocument &document, QDomElement &element, Note *parent);
+ void loadNotes(const TQDomElement &notes, Note *tqparent);
+ void saveNotes(TQDomDocument &document, TQDomElement &element, Note *tqparent);
void unlock();
protected slots:
void inactivityAutoLockTimeout();
public slots:
void load();
- void loadProperties(const QDomElement &properties);
- void saveProperties(QDomDocument &document, QDomElement &properties);
+ void loadProperties(const TQDomElement &properties);
+ void saveProperties(TQDomDocument &document, TQDomElement &properties);
bool save();
public:
bool isEncrypted();
@@ -322,39 +326,39 @@ public slots:
void lock();
bool isLoaded() { return m_loaded; };
bool loadingLaunched() { return m_loadingLaunched; };
- bool loadFromFile(const QString &fullPath, QString* string, bool isLocalEncoding = false);
- bool loadFromFile(const QString &fullPath, QByteArray* array);
- bool saveToFile(const QString& fullPath, const QByteArray& array);
- bool saveToFile(const QString& fullPath, const QByteArray& array, Q_ULONG length);
- bool saveToFile(const QString& fullPath, const QString& string, bool isLocalEncoding = false);
- static bool safelySaveToFile(const QString& fullPath, const QByteArray& array);
- static bool safelySaveToFile(const QString& fullPath, const QByteArray& array, Q_ULONG length);
- static bool safelySaveToFile(const QString& fullPath, const QString& string, bool isLocalEncoding = false);
- bool setProtection(int type, QString key);
+ bool loadFromFile(const TQString &fullPath, TQString* string, bool isLocalEncoding = false);
+ bool loadFromFile(const TQString &fullPath, TQByteArray* array);
+ bool saveToFile(const TQString& fullPath, const TQByteArray& array);
+ bool saveToFile(const TQString& fullPath, const TQByteArray& array, TQ_ULONG length);
+ bool saveToFile(const TQString& fullPath, const TQString& string, bool isLocalEncoding = false);
+ static bool safelySaveToFile(const TQString& fullPath, const TQByteArray& array);
+ static bool safelySaveToFile(const TQString& fullPath, const TQByteArray& array, TQ_ULONG length);
+ static bool safelySaveToFile(const TQString& fullPath, const TQString& string, bool isLocalEncoding = false);
+ bool setProtection(int type, TQString key);
int encryptionType() { return m_encryptionType; };
- QString encryptionKey(){ return m_encryptionKey; };
+ TQString encryptionKey(){ return m_encryptionKey; };
bool saveAgain();
/// BACKGROUND:
private:
- QColor m_backgroundColorSetting;
- QString m_backgroundImageName;
- QPixmap *m_backgroundPixmap;
- QPixmap *m_opaqueBackgroundPixmap;
- QPixmap *m_selectedBackgroundPixmap;
+ TQColor m_backgroundColorSetting;
+ TQString m_backgroundImageName;
+ TQPixmap *m_backgroundPixmap;
+ TQPixmap *m_opaqueBackgroundPixmap;
+ TQPixmap *m_selectedBackgroundPixmap;
bool m_backgroundTiled;
- QColor m_textColorSetting;
+ TQColor m_textColorSetting;
public:
inline bool hasBackgroundImage() { return m_backgroundPixmap != 0; }
- inline const QPixmap* backgroundPixmap() { return m_backgroundPixmap; }
+ inline const TQPixmap* backgroundPixmap() { return m_backgroundPixmap; }
inline bool isTiledBackground() { return m_backgroundTiled; }
- inline QString backgroundImageName() { return m_backgroundImageName; }
- inline QColor backgroundColorSetting() { return m_backgroundColorSetting; }
- inline QColor textColorSetting() { return m_textColorSetting; }
- QColor backgroundColor();
- QColor textColor();
- void setAppearance(const QString &icon, const QString &name, const QString &backgroundImage, const QColor &backgroundColor, const QColor &textColor);
- void blendBackground(QPainter &painter, const QRect &rect, int xPainter = -1, int yPainter = -1, bool opaque = false, QPixmap *bg = 0);
+ inline TQString backgroundImageName() { return m_backgroundImageName; }
+ inline TQColor backgroundColorSetting() { return m_backgroundColorSetting; }
+ inline TQColor textColorSetting() { return m_textColorSetting; }
+ TQColor backgroundColor();
+ TQColor textColor();
+ void setAppearance(const TQString &icon, const TQString &name, const TQString &backgroundImage, const TQColor &backgroundColor, const TQColor &textColor);
+ void blendBackground(TQPainter &painter, const TQRect &rect, int xPainter = -1, int yPainter = -1, bool opaque = false, TQPixmap *bg = 0);
void unbufferizeAll();
void subscribeBackgroundImages();
void unsubscribeBackgroundImages();
@@ -377,7 +381,7 @@ public slots:
int m_hoveredZone;
bool m_lockedHovering;
bool m_underMouse;
- QRect m_inserterRect;
+ TQRect m_inserterRect;
bool m_inserterShown;
bool m_inserterSplit;
bool m_inserterTop;
@@ -389,8 +393,8 @@ public slots:
bool inserterSplit() { return m_inserterSplit; }
bool inserterGroup() { return m_inserterGroup; }
public slots:
- void doHoverEffects(Note *note, Note::Zone zone, const QPoint &pos = QPoint(0, 0)); /// << @p pos is optionnal and only used to show the link target in the statusbar
- void doHoverEffects(const QPoint &pos);
+ void doHoverEffects(Note *note, Note::Zone zone, const TQPoint &pos = TQPoint(0, 0)); /// << @p pos is optionnal and only used to show the link target in the statusbar
+ void doHoverEffects(const TQPoint &pos);
void doHoverEffects(); // The same, but using the current cursor position
void mouseEnteredEditorWidget();
public:
@@ -402,15 +406,15 @@ public slots:
void addStateToSelectedNotes(State *state);
void changeStateOfSelectedNotes(State *state);
bool selectedNotesHaveTags();
- const QRect& inserterRect() { return m_inserterRect; }
+ const TQRect& inserterRect() { return m_inserterRect; }
bool inserterShown() { return m_inserterShown; }
- void drawInserter(QPainter &painter, int xPainter, int yPainter);
+ void drawInserter(TQPainter &painter, int xPainter, int yPainter);
DecoratedBasket* decoration();
State *stateForTagFromSelectedNotes(Tag *tag);
public slots:
void activatedTagShortcut(Tag *tag);
void recomputeAllStyles();
- void removedStates(const QValueList<State*> &deletedStates);
+ void removedStates(const TQValueList<State*> &deletedStates);
private slots:
void toggledTagInMenu(int id);
void toggledStateInMenu(int id);
@@ -421,44 +425,44 @@ public slots:
Note *m_tagPopupNote;
private:
Tag *m_tagPopup;
- QTime m_lastDisableClick;
+ TQTime m_lastDisableClick;
/// SELECTION:
private:
bool m_isSelecting;
bool m_selectionStarted;
bool m_selectionInvert;
- QPoint m_selectionBeginPoint;
- QPoint m_selectionEndPoint;
- QRect m_selectionRect;
- QTimer m_autoScrollSelectionTimer;
+ TQPoint m_selectionBeginPoint;
+ TQPoint m_selectionEndPoint;
+ TQRect m_selectionRect;
+ TQTimer m_autoScrollSelectionTimer;
void stopAutoScrollSelection();
private slots:
void doAutoScrollSelection();
public:
inline bool isSelecting() { return m_isSelecting; }
- inline const QRect& selectionRect() { return m_selectionRect; }
- void selectNotesIn(const QRect &rect, bool invertSelection, bool unselectOthers = true);
+ inline const TQRect& selectionRect() { return m_selectionRect; }
+ void selectNotesIn(const TQRect &rect, bool invertSelection, bool unselectOthers = true);
void resetWasInLastSelectionRect();
void selectAll();
void unselectAll();
void invertSelection();
void unselectAllBut(Note *toSelect);
void invertSelectionOf(Note *toSelect);
- QColor selectionRectInsideColor();
+ TQColor selectionRectInsideColor();
Note* theSelectedNote();
NoteSelection* selectedNotes();
/// BLANK SPACES DRAWING:
private:
- QValueList<QRect> m_blankAreas;
+ TQValueList<TQRect> m_blankAreas;
void recomputeBlankRects();
- QWidget *m_cornerWidget;
+ TQWidget *m_cornerWidget;
/// COMMUNICATION WITH ITS CONTAINER:
signals:
- void postMessage(const QString &message); /// << Post a temporar message in the statusBar.
- void setStatusBarText(const QString &message); /// << Set the permanent statusBar text or reset it if message isEmpty().
+ void postMessage(const TQString &message); /// << Post a temporar message in the statusBar.
+ void setStatusBarText(const TQString &message); /// << Set the permanent statusBar text or reset it if message isEmpty().
void resetStatusBarText(); /// << Equivalent to setStatusBarText("").
void propertiesChanged(Basket *basket);
void countsChanged(Basket *basket);
@@ -466,7 +470,7 @@ public slots:
void linkLookChanged();
void signalCountsChanged();
private:
- QTimer m_timerCountsChanged;
+ TQTimer m_timerCountsChanged;
private slots:
void countsChangedTimeOut();
@@ -485,20 +489,20 @@ public slots:
/// PROPERTIES:
public:
- QString basketName() { return m_basketName; }
- QString icon() { return m_icon; }
- QString folderName() { return m_folderName; }
- QString fullPath();
- QString fullPathForFileName(const QString &fileName); // Full path of an [existing or not] note in this basket
- static QString fullPathForFolderName(const QString &folderName);
+ TQString basketName() { return m_basketName; }
+ TQString icon() { return m_icon; }
+ TQString folderName() { return m_folderName; }
+ TQString fullPath();
+ TQString fullPathForFileName(const TQString &fileName); // Full path of an [existing or not] note in this basket
+ static TQString fullPathForFolderName(const TQString &folderName);
private:
- QString m_basketName;
- QString m_icon;
- QString m_folderName;
+ TQString m_basketName;
+ TQString m_icon;
+ TQString m_folderName;
/// ACTIONS ON SELECTED NOTES FROM THE INTERFACE:
public slots:
- void noteEdit(Note *note = 0L, bool justAdded = false, const QPoint &clickedPoint = QPoint());
+ void noteEdit(Note *note = 0L, bool justAdded = false, const TQPoint &clickedPoint = TQPoint());
void showEditedNoteWhileFiltering();
void noteDelete();
void noteDeleteWithoutConfirmation(bool deleteFilesToo = true);
@@ -525,13 +529,13 @@ public slots:
/// NOTES EDITION:
private:
NoteEditor *m_editor;
- //QWidget *m_rightEditorBorder;
+ //TQWidget *m_rightEditorBorder;
TransparentWidget *m_leftEditorBorder;
TransparentWidget *m_rightEditorBorder;
bool m_redirectEditActions;
int m_editorWidth;
int m_editorHeight;
- QTimer m_inactivityAutoSaveTimer;
+ TQTimer m_inactivityAutoSaveTimer;
bool m_doNotCloseEditor;
int m_editParagraph;
int m_editIndex;
@@ -573,29 +577,29 @@ public slots:
/// DRAG AND DROP:
private:
bool m_isDuringDrag;
- QValueList<Note*> m_draggedNotes;
+ TQValueList<Note*> m_draggedNotes;
public:
- static void acceptDropEvent(QDropEvent *event, bool preCond = true);
- void contentsDropEvent(QDropEvent *event);
- void blindDrop(QDropEvent* event);
+ static void acceptDropEvent(TQDropEvent *event, bool preCond = true);
+ void contentsDropEvent(TQDropEvent *event);
+ void blindDrop(TQDropEvent* event);
bool isDuringDrag() { return m_isDuringDrag; }
- QValueList<Note*> draggedNotes() { return m_draggedNotes; }
+ TQValueList<Note*> draggedNotes() { return m_draggedNotes; }
protected:
- void contentsDragEnterEvent(QDragEnterEvent*);
- void contentsDragMoveEvent(QDragMoveEvent *event);
- void contentsDragLeaveEvent(QDragLeaveEvent*);
+ void contentsDragEnterEvent(TQDragEnterEvent*);
+ void contentsDragMoveEvent(TQDragMoveEvent *event);
+ void contentsDragLeaveEvent(TQDragLeaveEvent*);
public slots:
void slotCopyingDone2(KIO::Job *job);
public:
- Note* noteForFullPath(const QString &path);
+ Note* noteForFullPath(const TQString &path);
/// EXPORTATION:
public:
- QValueList<State*> usedStates();
- static QString saveGradientBackground(const QColor &color, const QFont &font, const QString &folder);
+ TQValueList<State*> usedStates();
+ static TQString saveGradientBackground(const TQColor &color, const TQFont &font, const TQString &folder);
public:
- void listUsedTags(QValueList<Tag*> &list);
+ void listUsedTags(TQValueList<Tag*> &list);
/// MANAGE FOCUS:
private:
@@ -614,10 +618,10 @@ public slots:
Note* lastNoteShownInStack();
void selectRange(Note *start, Note *end, bool unselectOthers = true); /// FIXME: Not really a focus related method!
void ensureNoteVisible(Note *note);
- virtual void keyPressEvent(QKeyEvent *event);
- virtual void focusInEvent(QFocusEvent*);
- virtual void focusOutEvent(QFocusEvent*);
- QRect noteVisibleRect(Note *note); // clipped global (desktop as origin) rectangle
+ virtual void keyPressEvent(TQKeyEvent *event);
+ virtual void focusInEvent(TQFocusEvent*);
+ virtual void focusOutEvent(TQFocusEvent*);
+ TQRect noteVisibleRect(Note *note); // clipped global (desktop as origin) rectangle
Note* firstNoteInGroup();
Note *noteOnHome();
Note *noteOnEnd();
@@ -632,7 +636,7 @@ public slots:
public:
- void wheelEvent(QWheelEvent *event);
+ void wheelEvent(TQWheelEvent *event);
@@ -643,14 +647,14 @@ public slots:
/// THE NEW FILE WATCHER:
private:
KDirWatch *m_watcher;
- QTimer m_watcherTimer;
- QValueList<QString> m_modifiedFiles;
+ TQTimer m_watcherTimer;
+ TQValueList<TQString> m_modifiedFiles;
public:
- void addWatchedFile(const QString &fullPath);
- void removeWatchedFile(const QString &fullPath);
+ void addWatchedFile(const TQString &fullPath);
+ void removeWatchedFile(const TQString &fullPath);
private slots:
- void watchedFileModified(const QString &fullPath);
- void watchedFileDeleted(const QString &fullPath);
+ void watchedFileModified(const TQString &fullPath);
+ void watchedFileDeleted(const TQString &fullPath);
void updateModifiedNotes();
@@ -661,7 +665,7 @@ public slots:
void showFrameInsertTo() {}
void resetInsertTo() {}
- void computeInsertPlace(const QPoint &/*cursorPosition*/) { }
+ void computeInsertPlace(const TQPoint &/*cursorPosition*/) { }
public:
friend class SystemTray;
@@ -669,7 +673,7 @@ public slots:
/// SPEED OPTIMIZATION
private:
bool m_finishLoadOnFirstShow;
- bool m_relayoutOnNextShow;
+ bool m_retqlayoutOnNextShow;
public:
void aboutToBeActivated();
};
@@ -684,27 +688,27 @@ public slots:
#if 0
-#include <qwidget.h>
-#include <qscrollview.h>
-#include <qclipboard.h>
-#include <qptrlist.h>
-#include <qtimer.h>
+#include <tqwidget.h>
+#include <tqscrollview.h>
+#include <tqclipboard.h>
+#include <tqptrlist.h>
+#include <tqtimer.h>
#include <kio/job.h>
-#include <qcolor.h>
+#include <tqcolor.h>
#include "filter.h"
-class QFrame;
-class QVBoxLayout;
-class QCheckBox;
-class QString;
-class QColor;
-class QPixmap;
-class QAction;
-class QStringList;
-class QRect;
+class TQFrame;
+class TQVBoxLayout;
+class TQCheckBox;
+class TQString;
+class TQColor;
+class TQPixmap;
+class TQAction;
+class TQStringList;
+class TQRect;
-class QDomElement;
+class TQDomElement;
class KDirWatch;
@@ -722,45 +726,46 @@ class FileEvent
{
public:
enum Event { Modified = 1, Created, Deleted, Renamed };
- FileEvent(Event evt, const QString &path)
+ FileEvent(Event evt, const TQString &path)
: event(evt), filePath(path)
{ }
public: // Because it must be fast and theire is no need to be private
Event event;
- QString filePath;
+ TQString filePath;
};
/** Basket that contain some Notes.
* @author S�astien Laot
*/
-clas s Bas ket : public QScrollView
+clas s Bas ket : public TQScrollView
{
Q_OBJECT
+ TQ_OBJECT
public:
/** Construtor and destructor */
- Bask et(QWidget *parent, const QString &folderName, const char *name = "", WFlags fl = 0);
+ Bask et(TQWidget *tqparent, const TQString &folderName, const char *name = "", WFlags fl = 0);
public:
protected:
- virtual void contentsContextMenuEvent(QContextMenuEvent *event);
- virtual void contentsMousePressEvent(QMouseEvent *event); // For redirected event !!
- virtual void showEvent(QShowEvent *);
+ virtual void contentsContextMenuEvent(TQContextMenuEvent *event);
+ virtual void contentsMousePressEvent(TQMouseEvent *event); // For redirected event !!
+ virtual void showEvent(TQShowEvent *);
/** Drag and drop functions */
- virtual void dragEnterEvent(QDragEnterEvent*);
- virtual void dragMoveEvent(QDragMoveEvent* event);
- virtual void dragLeaveEvent(QDragLeaveEvent*);
+ virtual void dragEnterEvent(TQDragEnterEvent*);
+ virtual void dragMoveEvent(TQDragMoveEvent* event);
+ virtual void dragLeaveEvent(TQDragLeaveEvent*);
public:
- virtual void dropEvent(QDropEvent *event);
- static void acceptDropEvent(QDropEvent *event, bool preCond = true);
+ virtual void dropEvent(TQDropEvent *event);
+ static void acceptDropEvent(TQDropEvent *event, bool preCond = true);
bool canDragNote() { return !isEmpty(); }
- void computeInsertPlace(const QPoint &cursorPosition);
- Note* noteAtPosition(const QPoint &pos);
+ void computeInsertPlace(const TQPoint &cursorPosition);
+ Note* noteAtPosition(const TQPoint &pos);
Note* duplicatedOf(Note *note);
void checkClipboard();
- void processActionAsYouType(QKeyEvent *event);
+ void processActionAsYouType(TQKeyEvent *event);
void exportToHTML();
signals:
- void nameChanged(Basket *basket, const QString &name);
- void iconChanged(Basket *basket, const QString &icon);
+ void nameChanged(Basket *basket, const TQString &name);
+ void iconChanged(Basket *basket, const TQString &icon);
void notesNumberChanged(Basket *basket);
public slots:
void linkLookChanged();
@@ -769,7 +774,7 @@ clas s Bas ket : public QScrollView
void insertNote(Note *note);
void delNote(Note *note, bool askForMirroredFile = true);
void changeNotePlace(Note *note);
- void pasteNote(QClipboard::Mode mode = QClipboard::Clipboard);
+ void pasteNote(TQClipboard::Mode mode = TQClipboard::Clipboard);
void recolorizeNotes();
void reloadMirroredFolder();
void showMirrorOnlyOnceInfo();
@@ -783,7 +788,7 @@ clas s Bas ket : public QScrollView
void setFocusedNote(Note *note);
void focusANote();
void ensureVisibleNote(Note *note);
- QRect noteRect(Note *note); // clipped global (desktop as origin) rectangle
+ TQRect noteRect(Note *note); // clipped global (desktop as origin) rectangle
/** Travel the list to find the next shown note, or the previous if step == -1, or the next after 10 if step == 10... */
Note* nextShownNoteFrom(Note *note, int step);
/** Actions on (selected) notes */
@@ -800,34 +805,34 @@ clas s Bas ket : public QScrollView
void moveNoteUp();
void moveNoteDown();
public:
- void dontCareOfCreation(const QString &path);
- QString copyIcon(const QString &iconName, int size, const QString &destFolder);
- QString copyFile(const QString &srcPath, const QString &destFolder, bool createIt = false);
+ void dontCareOfCreation(const TQString &path);
+ TQString copyIcon(const TQString &iconName, int size, const TQString &destFolder);
+ TQString copyFile(const TQString &srcPath, const TQString &destFolder, bool createIt = false);
protected slots:
- void slotModifiedFile(const QString &path);
- void slotCreatedFile(const QString &path);
- void slotDeletedFile(const QString &path);
+ void slotModifiedFile(const TQString &path);
+ void slotCreatedFile(const TQString &path);
+ void slotDeletedFile(const TQString &path);
void slotUpdateNotes();
void placeEditor();
void closeEditor(bool save = true);
void clipboardChanged(bool selectionMode = false);
void selectionChanged();
private:
- QTimer m_updateTimer;
- QPtrList<FileEvent> m_updateQueue;
- QStringList m_dontCare;
+ TQTimer m_updateTimer;
+ TQPtrList<FileEvent> m_updateQueue;
+ TQStringList m_dontCare;
static const int c_updateTime;
private:
void load(); // Load is performed only once, during contructor
- void loadNotes(const QDomElement &notes);
- bool importLauncher(const QString &type, const QDomElement &content, const QString &runCommand,
- const QString &annotations/*, bool checked*/);
+ void loadNotes(const TQDomElement &notes);
+ bool importLauncher(const TQString &type, const TQDomElement &content, const TQString &runCommand,
+ const TQString &annotations/*, bool checked*/);
void computeShownNotes();
private:
KDirWatch *m_watcher;
NoteEditorBase *m_editor;
- QKeyEvent *m_stackedKeyEvent;
+ TQKeyEvent *m_stackedKeyEvent;
};
#endif // #if 0
diff --git a/src/basket_part.cpp b/src/basket_part.cpp
index 0ba1e50..7c51696 100644
--- a/src/basket_part.cpp
+++ b/src/basket_part.cpp
@@ -35,19 +35,19 @@
typedef KParts::GenericFactory< BasketPart > BasketFactory;
K_EXPORT_COMPONENT_FACTORY( libbasketpart, BasketFactory )
-BasketPart::BasketPart( QWidget *parentWidget, const char *,
- QObject *parent, const char *name, const QStringList & )
- : KParts::ReadWritePart(parent, name)
+BasketPart::BasketPart( TQWidget *tqparentWidget, const char *,
+ TQObject *tqparent, const char *name, const TQStringList & )
+ : KParts::ReadWritePart(tqparent, name)
{
// we need an instance
setInstance( BasketFactory::instance() );
BasketStatusBar* bar = new BasketStatusBar(new KParts::StatusBarExtension(this));
// this should be your custom internal widget
- m_view = new BNPView(parentWidget, "BNPViewPart", this, actionCollection(), bar);
- connect(m_view, SIGNAL(setWindowCaption(const QString &)), this, SLOT(setCaption(const QString &)));
- connect(m_view, SIGNAL(showPart()), this, SIGNAL(showPart()));
- m_view->setFocusPolicy(QWidget::ClickFocus);
+ m_view = new BNPView(tqparentWidget, "BNPViewPart", this, actionCollection(), bar);
+ connect(m_view, TQT_SIGNAL(setWindowCaption(const TQString &)), this, TQT_SLOT(setCaption(const TQString &)));
+ connect(m_view, TQT_SIGNAL(showPart()), this, TQT_SIGNAL(showPart()));
+ m_view->setFocusPolicy(TQ_ClickFocus);
// notify the part that this is our internal widget
setWidget(m_view);
@@ -73,7 +73,7 @@ void BasketPart::setReadWrite(bool rw)
void BasketPart::setModified(bool modified)
{
- // in any event, we want our parent to do it's thing
+ // in any event, we want our tqparent to do it's thing
ReadWritePart::setModified(modified);
}
@@ -94,7 +94,7 @@ KAboutData *BasketPart::createAboutData()
return new AboutData();
}
-void BasketPart::setCaption(const QString &caption)
+void BasketPart::setCaption(const TQString &caption)
{
emit setWindowCaption(caption);
}
diff --git a/src/basket_part.h b/src/basket_part.h
index 6d9dc70..9cfbb76 100644
--- a/src/basket_part.h
+++ b/src/basket_part.h
@@ -24,10 +24,10 @@
#include <kparts/part.h>
#include <kparts/factory.h>
-class QWidget;
-class QPainter;
+class TQWidget;
+class TQPainter;
class KURL;
-class QMultiLineEdit;
+class TQMultiLineEdit;
class BNPView;
/**
@@ -41,12 +41,13 @@ class BNPView;
class BasketPart : public KParts::ReadWritePart
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Default constructor
*/
- BasketPart(QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name, const QStringList &);
+ BasketPart(TQWidget *tqparentWidget, const char *widgetName,
+ TQObject *tqparent, const char *name, const TQStringList &);
/**
* Destructor
@@ -82,7 +83,7 @@ public:
virtual bool saveFile();
protected slots:
- void setCaption(const QString &caption);
+ void setCaption(const TQString &caption);
private:
BNPView *m_view;
diff --git a/src/basketfactory.cpp b/src/basketfactory.cpp
index 4006fbb..1873047 100644
--- a/src/basketfactory.cpp
+++ b/src/basketfactory.cpp
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qdir.h>
+#include <tqdir.h>
#include <klocale.h>
#include <kmessagebox.h>
@@ -33,16 +33,16 @@
// TODO: Don't create a basket with a name that already exists!
-QString BasketFactory::newFolderName()
+TQString BasketFactory::newFolderName()
{
- QString folderName;
- QString fullPath;
- QDir dir;
+ TQString folderName;
+ TQString fullPath;
+ TQDir dir;
for (int i = 1; ; ++i) {
- folderName = "basket" + QString::number(i) + "/";
+ folderName = "basket" + TQString::number(i) + "/";
fullPath = Global::basketsFolder() + folderName;
- dir = QDir(fullPath);
+ dir = TQDir(fullPath);
if ( ! dir.exists() ) // OK : The folder do not yet exists :
break; // We've found one !
}
@@ -50,85 +50,85 @@ QString BasketFactory::newFolderName()
return folderName;
}
-QString BasketFactory::unpackTemplate(const QString &templateName)
+TQString BasketFactory::unpackTemplate(const TQString &templateName)
{
// Find a name for a new folder and create it:
- QString folderName = newFolderName();
- QString fullPath = Global::basketsFolder() + folderName;
- QDir dir;
+ TQString folderName = newFolderName();
+ TQString fullPath = Global::basketsFolder() + folderName;
+ TQDir dir;
if (!dir.mkdir(fullPath)) {
- KMessageBox::error(/*parent=*/0, i18n("Sorry, but the folder creation for this new basket has failed."), i18n("Basket Creation Failed"));
+ KMessageBox::error(/*tqparent=*/0, i18n("Sorry, but the folder creation for this new basket has failed."), i18n("Basket Creation Failed"));
return "";
}
// Unpack the template file to that folder:
// TODO: REALLY unpack (this hand-creation is temporary, or it could be used in case the template can't be found)
- QFile file(fullPath + "/.basket");
+ TQFile file(fullPath + "/.basket");
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
int nbColumns = (templateName == "mindmap" || templateName == "free" ? 0 : templateName.left(1).toInt());
Basket *currentBasket = Global::bnpView->currentBasket();
int columnWidth = (currentBasket && nbColumns > 0 ? (currentBasket->visibleWidth() - (nbColumns-1)*Note::RESIZER_WIDTH) / nbColumns : 0);
- stream << QString( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
+ stream << TQString( "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
"<!DOCTYPE basket>\n"
"<basket>\n"
" <properties>\n"
" <disposition mindMap=\"%1\" columnCount=\"%2\" free=\"%3\" />\n"
" </properties>\n"
- " <notes>\n" ).arg( (templateName == "mindmap" ? "true" : "false"),
- QString::number(nbColumns),
+ " <notes>\n" ).tqarg( (templateName == "mindmap" ? "true" : "false"),
+ TQString::number(nbColumns),
(templateName == "free" || templateName == "mindmap" ? "true" : "false") );
if (nbColumns > 0)
for (int i = 0; i < nbColumns; ++i)
- stream << QString(" <group width=\"%1\"></group>\n").arg(columnWidth);
+ stream << TQString(" <group width=\"%1\"></group>\n").tqarg(columnWidth);
stream << " </notes>\n"
"</basket>\n";
file.close();
return folderName;
} else {
- KMessageBox::error(/*parent=*/0, i18n("Sorry, but the template copying for this new basket has failed."), i18n("Basket Creation Failed"));
+ KMessageBox::error(/*tqparent=*/0, i18n("Sorry, but the template copying for this new basket has failed."), i18n("Basket Creation Failed"));
return "";
}
}
-void BasketFactory::newBasket(const QString &icon,
- const QString &name,
- const QString &backgroundImage,
- const QColor &backgroundColor,
- const QColor &textColor,
- const QString &templateName,
- Basket *parent)
+void BasketFactory::newBasket(const TQString &icon,
+ const TQString &name,
+ const TQString &backgroundImage,
+ const TQColor &backgroundColor,
+ const TQColor &textColor,
+ const TQString &templateName,
+ Basket *tqparent)
{
// Unpack the templateName file to a new basket folder:
- QString folderName = unpackTemplate(templateName);
+ TQString folderName = unpackTemplate(templateName);
if (folderName.isEmpty())
return;
// Read the properties, change those that should be customized and save the result:
- QDomDocument *document = XMLWork::openFile("basket", Global::basketsFolder() + folderName + "/.basket");
+ TQDomDocument *document = XMLWork::openFile("basket", Global::basketsFolder() + folderName + "/.basket");
if (!document) {
- KMessageBox::error(/*parent=*/0, i18n("Sorry, but the template customization for this new basket has failed."), i18n("Basket Creation Failed"));
+ KMessageBox::error(/*tqparent=*/0, i18n("Sorry, but the template customization for this new basket has failed."), i18n("Basket Creation Failed"));
return;
}
- QDomElement properties = XMLWork::getElement(document->documentElement(), "properties");
+ TQDomElement properties = XMLWork::getElement(document->documentElement(), "properties");
if (!icon.isEmpty()) {
- QDomElement iconElement = XMLWork::getElement(properties, "icon");
+ TQDomElement iconElement = XMLWork::getElement(properties, "icon");
if (!iconElement.tagName().isEmpty()) // If there is already an icon, remove it since we will add our own value below
iconElement.removeChild(iconElement.firstChild());
XMLWork::addElement(*document, properties, "icon", icon);
}
if (!name.isEmpty()) {
- QDomElement nameElement = XMLWork::getElement(properties, "name");
+ TQDomElement nameElement = XMLWork::getElement(properties, "name");
if (!nameElement.tagName().isEmpty()) // If there is already a name, remove it since we will add our own value below
nameElement.removeChild(nameElement.firstChild());
XMLWork::addElement(*document, properties, "name", name);
}
if (backgroundColor.isValid()) {
- QDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
+ TQDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
appearanceElement = document->createElement("appearance");
properties.appendChild(appearanceElement);
@@ -137,7 +137,7 @@ void BasketFactory::newBasket(const QString &icon,
}
if (!backgroundImage.isEmpty()) {
- QDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
+ TQDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
appearanceElement = document->createElement("appearance");
properties.appendChild(appearanceElement);
@@ -146,7 +146,7 @@ void BasketFactory::newBasket(const QString &icon,
}
if (textColor.isValid()) {
- QDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
+ TQDomElement appearanceElement = XMLWork::getElement(properties, "appearance");
if (appearanceElement.tagName().isEmpty()) { // If there is not already an appearance tag, add it since we will access it below
appearanceElement = document->createElement("appearance");
properties.appendChild(appearanceElement);
@@ -154,6 +154,6 @@ void BasketFactory::newBasket(const QString &icon,
appearanceElement.setAttribute("textColor", textColor.name());
}
- // Load it in the parent basket (it will save the tree and switch to this new basket):
- Global::bnpView->loadNewBasket(folderName, properties, parent);
+ // Load it in the tqparent basket (it will save the tree and switch to this new basket):
+ Global::bnpView->loadNewBasket(folderName, properties, tqparent);
}
diff --git a/src/basketfactory.h b/src/basketfactory.h
index 26ae8ed..4620c32 100644
--- a/src/basketfactory.h
+++ b/src/basketfactory.h
@@ -21,7 +21,7 @@
#ifndef BASKETFACTORY_H
#define BASKETFACTORY_H
-class QString;
+class TQString;
class Basket;
@@ -31,16 +31,16 @@ class Basket;
namespace BasketFactory
{
/** You should use this method to create a new basket: */
- void newBasket(const QString &icon,
- const QString &name,
- const QString &backgroundImage,
- const QColor &backgroundColor,
- const QColor &textColor,
- const QString &templateName,
- Basket *parent);
+ void newBasket(const TQString &icon,
+ const TQString &name,
+ const TQString &backgroundImage,
+ const TQColor &backgroundColor,
+ const TQColor &textColor,
+ const TQString &templateName,
+ Basket *tqparent);
/** Internal tool methods to process the method above: */
- QString newFolderName();
- QString unpackTemplate(const QString &templateName);
+ TQString newFolderName();
+ TQString unpackTemplate(const TQString &templateName);
}
#endif // BASKETFACTORY_H
diff --git a/src/basketlistview.cpp b/src/basketlistview.cpp
index 51b9747..3d0ed71 100644
--- a/src/basketlistview.cpp
+++ b/src/basketlistview.cpp
@@ -19,15 +19,15 @@
***************************************************************************/
#include "basketlistview.h"
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kglobalsettings.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kstringhandler.h>
-#include <qpainter.h>
-#include <qbitmap.h>
-#include <qpixmapcache.h>
-#include <qtooltip.h>
+#include <tqpainter.h>
+#include <tqbitmap.h>
+#include <tqpixmapcache.h>
+#include <tqtooltip.h>
#include <iostream>
#include <kdebug.h>
#include "global.h"
@@ -39,32 +39,32 @@
/** class BasketListViewItem: */
-BasketListViewItem::BasketListViewItem(QListView *parent, Basket *basket)
- : QListViewItem(parent), m_basket(basket)
+BasketListViewItem::BasketListViewItem(TQListView *tqparent, Basket *basket)
+ : TQListViewItem(tqparent), m_basket(basket)
, m_isUnderDrag(false)
, m_isAbbreviated(false)
{
setDropEnabled(true);
}
-BasketListViewItem::BasketListViewItem(QListViewItem *parent, Basket *basket)
- : QListViewItem(parent), m_basket(basket)
+BasketListViewItem::BasketListViewItem(TQListViewItem *tqparent, Basket *basket)
+ : TQListViewItem(tqparent), m_basket(basket)
, m_isUnderDrag(false)
, m_isAbbreviated(false)
{
setDropEnabled(true);
}
-BasketListViewItem::BasketListViewItem(QListView *parent, QListViewItem *after, Basket *basket)
- : QListViewItem(parent, after), m_basket(basket)
+BasketListViewItem::BasketListViewItem(TQListView *tqparent, TQListViewItem *after, Basket *basket)
+ : TQListViewItem(tqparent, after), m_basket(basket)
, m_isUnderDrag(false)
, m_isAbbreviated(false)
{
setDropEnabled(true);
}
-BasketListViewItem::BasketListViewItem(QListViewItem *parent, QListViewItem *after, Basket *basket)
- : QListViewItem(parent, after), m_basket(basket)
+BasketListViewItem::BasketListViewItem(TQListViewItem *tqparent, TQListViewItem *after, Basket *basket)
+ : TQListViewItem(tqparent, after), m_basket(basket)
, m_isUnderDrag(false)
, m_isAbbreviated(false)
{
@@ -75,48 +75,48 @@ BasketListViewItem::~BasketListViewItem()
{
}
-bool BasketListViewItem::acceptDrop(const QMimeSource *) const
+bool BasketListViewItem::acceptDrop(const TQMimeSource *) const
{
std::cout << "accept" << std::endl;
return true;
}
-void BasketListViewItem::dropped(QDropEvent *event)
+void BasketListViewItem::dropped(TQDropEvent *event)
{
std::cout << "Dropping into basket " << m_basket->name() << std::endl;
m_basket->contentsDropEvent(event);
//Global::bnpView->currentBasket()->contentsDropEvent(event); // FIXME
}
-int BasketListViewItem::width(const QFontMetrics &/* fontMetrics */, const QListView */*listView*/, int /* column */) const
+int BasketListViewItem::width(const TQFontMetrics &/* fontMetrics */, const TQListView */*listView*/, int /* column */) const
{
return listView()->visibleWidth() + 100;
/*
int BASKET_ICON_SIZE = 16;
int MARGIN = 1;
- QRect textRect = fontMetrics.boundingRect(0, 0, / *width=* /1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(column));
+ TQRect textRect = fontMetrics.boundingRect(0, 0, / *width=* /1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::ShowPrefix, text(column));
return MARGIN + BASKET_ICON_SIZE + MARGIN + textRect.width() + BASKET_ICON_SIZE/2 + MARGIN;
*/
}
-QString BasketListViewItem::escapedName(const QString &string)
+TQString BasketListViewItem::escapedName(const TQString &string)
{
// Underlining the Alt+Letter shortcut (and escape all other '&' characters), if any:
- QString basketName = string;
- basketName.replace('&', "&&"); // First escape all the amperstamp
- QString letter; // Find the letter
- QString altKey = /*i18n(*/"Alt"/*)*/; //i18n("The [Alt] key, as shown in shortcuts like Alt+C...", "Alt");
- QString shiftKey = /*i18n(*/"Shift"/*)*/; //i18n("The [Shift] key, as shown in shortcuts like Alt+Shift+1...", "Shift");
- QRegExp altLetterExp( QString("^%1\\+(.)$").arg(altKey) );
- QRegExp altShiftLetterExp( QString("^%1\\+%2\\+(.)$").arg(altKey, shiftKey) );
+ TQString basketName = string;
+ basketName.tqreplace('&', "&&"); // First escape all the amperstamp
+ TQString letter; // Find the letter
+ TQString altKey = /*i18n(*/"Alt"/*)*/; //i18n("The [Alt] key, as shown in shortcuts like Alt+C...", "Alt");
+ TQString shiftKey = /*i18n(*/"Shift"/*)*/; //i18n("The [Shift] key, as shown in shortcuts like Alt+Shift+1...", "Shift");
+ TQRegExp altLetterExp( TQString("^%1\\+(.)$").tqarg(altKey) );
+ TQRegExp altShiftLetterExp( TQString("^%1\\+%2\\+(.)$").tqarg(altKey, shiftKey) );
if (altLetterExp.search(m_basket->shortcut().toStringInternal()) != -1)
letter = altLetterExp.cap(1);
if (letter.isEmpty() && altShiftLetterExp.search(m_basket->shortcut().toStringInternal()) != -1)
letter = altShiftLetterExp.cap(1);
if (!letter.isEmpty()) {
- int index = basketName.find(letter, /*index=*/0, /*caseSensitive=*/false);
+ int index = basketName.tqfind(letter, /*index=*/0, /*caseSensitive=*/false);
if (index != -1)
basketName.insert(index, '&');
}
@@ -131,21 +131,21 @@ void BasketListViewItem::setup()
setText(/*column=*/0, escapedName(m_basket->basketName()));
widthChanged();
- QRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
+ TQRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::ShowPrefix, text(/*column=*/0));
- int height = MARGIN + QMAX(BASKET_ICON_SIZE, textRect.height()) + MARGIN;
+ int height = MARGIN + TQMAX(BASKET_ICON_SIZE, textRect.height()) + MARGIN;
setHeight(height);
- QPixmap icon = kapp->iconLoader()->loadIcon(m_basket->icon(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
+ TQPixmap icon = kapp->iconLoader()->loadIcon(m_basket->icon(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
setPixmap(/*column=*/0, icon);
- repaint();
+ tqrepaint();
}
BasketListViewItem* BasketListViewItem::lastChild()
{
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
while (child) {
if (child->nextSibling())
child = child->nextSibling();
@@ -188,21 +188,21 @@ BasketListViewItem* BasketListViewItem::shownItemBelow()
return 0;
}
-QStringList BasketListViewItem::childNamesTree(int deep)
+TQStringList BasketListViewItem::childNamesTree(int deep)
{
- QStringList result;
- for (QListViewItem *child = firstChild(); child; child = child->nextSibling()) {
+ TQStringList result;
+ for (TQListViewItem *child = firstChild(); child; child = child->nextSibling()) {
BasketListViewItem *item = (BasketListViewItem*)child;
// Compute indentation spaces:
- QString spaces;
+ TQString spaces;
for (int i = 0; i < deep; ++i)
spaces += " ";
// Append the name:
result.append(spaces + item->basket()->basketName());
// Append the childs:
if (child->firstChild()) {
- QStringList childs = item->childNamesTree(deep + 1);
- for (QStringList::iterator it = childs.begin(); it != childs.end(); ++it)
+ TQStringList childs = item->childNamesTree(deep + 1);
+ for (TQStringList::iterator it = childs.begin(); it != childs.end(); ++it)
result.append(*it);
}
}
@@ -211,14 +211,14 @@ QStringList BasketListViewItem::childNamesTree(int deep)
void BasketListViewItem::moveChildsBaskets()
{
- QListViewItem *insertAfterThis = this;
- QListViewItem *nextOne;
- for (QListViewItem *child = firstChild(); child; child = nextOne) {
+ TQListViewItem *insertAfterThis = this;
+ TQListViewItem *nextOne;
+ for (TQListViewItem *child = firstChild(); child; child = nextOne) {
nextOne = child->nextSibling();
- // Re-insert the item with the good parent:
+ // Re-insert the item with the good tqparent:
takeItem(child);
- if (parent())
- parent()->insertItem(child);
+ if (tqparent())
+ tqparent()->insertItem(child);
else
listView()->insertItem(child);
// And move it at the good place:
@@ -230,19 +230,19 @@ void BasketListViewItem::moveChildsBaskets()
void BasketListViewItem::ensureVisible()
{
BasketListViewItem *item = this;
- while (item->parent()) {
- item = (BasketListViewItem*)(item->parent());
+ while (item->tqparent()) {
+ item = (BasketListViewItem*)(item->tqparent());
item->setOpen(true);
}
}
bool BasketListViewItem::isShown()
{
- QListViewItem *item = parent();
+ TQListViewItem *item = tqparent();
while (item) {
if (!item->isOpen())
return false;
- item = item->parent();
+ item = item->tqparent();
}
return true;
}
@@ -253,31 +253,31 @@ bool BasketListViewItem::isCurrentBasket()
}
// TODO: Move this function from item.cpp to class Tools:
-extern void drawGradient( QPainter *p, const QColor &colorTop, const QColor & colorBottom,
+extern void drawGradient( TQPainter *p, const TQColor &colorTop, const TQColor & colorBottom,
int x, int y, int w, int h,
bool sunken, bool horz, bool flat ); /*const*/
-QPixmap BasketListViewItem::circledTextPixmap(const QString &text, int height, const QFont &font, const QColor &color)
+TQPixmap BasketListViewItem::circledTextPixmap(const TQString &text, int height, const TQFont &font, const TQColor &color)
{
- QString key = QString("BLI-%1.%2.%3.%4")
- .arg(text).arg(height).arg(font.toString()).arg(color.rgb());
- if (QPixmap* cached=QPixmapCache::find(key)) {
+ TQString key = TQString("BLI-%1.%2.%3.%4")
+ .tqarg(text).tqarg(height).tqarg(font.toString()).tqarg(color.rgb());
+ if (TQPixmap* cached=TQPixmapCache::tqfind(key)) {
return *cached;
}
// Compute the sizes of the image components:
- QRect textRect = QFontMetrics(font).boundingRect(0, 0, /*width=*/1, height, Qt::AlignAuto | Qt::AlignTop, text);
+ TQRect textRect = TQFontMetrics(font).boundingRect(0, 0, /*width=*/1, height, TQt::AlignAuto | TQt::AlignTop, text);
int xMargin = height / 6;
int width = xMargin + textRect.width() + xMargin;
// Create the gradient image:
- QPixmap gradient(3 * width, 3 * height); // We double the size to be able to smooth scale down it (== antialiased curves)
- QPainter gradientPainter(&gradient);
+ TQPixmap gradient(3 * width, 3 * height); // We double the size to be able to smooth scale down it (== antialiased curves)
+ TQPainter gradientPainter(&gradient);
#if 1 // Enable the new look of the gradient:
- QColor topColor = KGlobalSettings::highlightColor().light(130); //120
- QColor topMidColor = KGlobalSettings::highlightColor().light(105); //105
- QColor bottomMidColor = KGlobalSettings::highlightColor().dark(130); //120
- QColor bottomColor = KGlobalSettings::highlightColor();
+ TQColor topColor = KGlobalSettings::highlightColor().light(130); //120
+ TQColor topMidColor = KGlobalSettings::highlightColor().light(105); //105
+ TQColor bottomMidColor = KGlobalSettings::highlightColor().dark(130); //120
+ TQColor bottomColor = KGlobalSettings::highlightColor();
drawGradient(&gradientPainter, topColor, topMidColor,
0, 0, gradient.width(), gradient.height() / 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
drawGradient(&gradientPainter, bottomMidColor, bottomColor,
@@ -290,11 +290,11 @@ QPixmap BasketListViewItem::circledTextPixmap(const QString &text, int height, c
gradientPainter.end();
// Draw the curved rectangle:
- QBitmap curvedRectangle(3 * width, 3 * height);
- curvedRectangle.fill(Qt::color0);
- QPainter curvePainter(&curvedRectangle);
- curvePainter.setPen(Qt::color1);
- curvePainter.setBrush(Qt::color1);
+ TQBitmap curvedRectangle(3 * width, 3 * height);
+ curvedRectangle.fill(TQt::color0);
+ TQPainter curvePainter(&curvedRectangle);
+ curvePainter.setPen(TQt::color1);
+ curvePainter.setBrush(TQt::color1);
curvePainter.setClipRect(0, 0, 3*(height / 5), 3*(height)); // If the width is small, don't fill the right part of the pixmap
curvePainter.drawEllipse(0, 3*(-height / 4), 3*(height), 3*(height * 3 / 2)); // Don't forget we double the sizes
curvePainter.setClipRect(3*(width - height / 5), 0, 3*(height / 5), 3*(height));
@@ -303,48 +303,48 @@ QPixmap BasketListViewItem::circledTextPixmap(const QString &text, int height, c
curvePainter.fillRect(3*(height / 6), 0, 3*(width - 2 * height / 6), 3*(height), curvePainter.brush());
curvePainter.end();
- // Apply the curved rectangle as the mask of the gradient:
+ // Apply the curved rectangle as the tqmask of the gradient:
gradient.setMask(curvedRectangle);
- QImage resultImage = gradient.convertToImage();
+ TQImage resultImage = gradient.convertToImage();
resultImage.setAlphaBuffer(true);
// Scale down the image smoothly to get anti-aliasing:
- QPixmap pmScaled;
+ TQPixmap pmScaled;
pmScaled.convertFromImage(resultImage.smoothScale(width, height));
// Draw the text, and return the result:
- QPainter painter(&pmScaled);
+ TQPainter painter(&pmScaled);
painter.setPen(color);
painter.setFont(font);
- painter.drawText(0+1, 0, width, height, Qt::AlignHCenter | Qt::AlignVCenter, text);
+ painter.drawText(0+1, 0, width, height, TQt::AlignHCenter | TQt::AlignVCenter, text);
painter.end();
- QPixmapCache::insert(key, pmScaled);
+ TQPixmapCache::insert(key, pmScaled);
return pmScaled;
}
-QPixmap BasketListViewItem::foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &font, int height)
+TQPixmap BasketListViewItem::foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const TQFont &font, int height)
{
if (isLoading)
- return QPixmap();
+ return TQPixmap();
- QFont boldFont(font);
+ TQFont boldFont(font);
boldFont.setBold(true);
- QString text;
+ TQString text;
if (childsAreLoading) {
if (countChildsFound > 0)
- text = i18n("%1+%2+").arg(QString::number(countFound), QString::number(countChildsFound));
+ text = i18n("%1+%2+").tqarg(TQString::number(countFound), TQString::number(countChildsFound));
else
- text = i18n("%1+").arg(QString::number(countFound));
+ text = i18n("%1+").tqarg(TQString::number(countFound));
} else {
if (countChildsFound > 0)
- text = i18n("%1+%2").arg(QString::number(countFound), QString::number(countChildsFound));
+ text = i18n("%1+%2").tqarg(TQString::number(countFound), TQString::number(countChildsFound));
else if (countFound > 0)
- text = QString::number(countFound);
+ text = TQString::number(countFound);
else
- return QPixmap();
+ return TQPixmap();
}
return circledTextPixmap(text, height, boldFont, KGlobalSettings::highlightedTextColor());
@@ -352,7 +352,7 @@ QPixmap BasketListViewItem::foundCountPixmap(bool isLoading, int countFound, boo
bool BasketListViewItem::haveChildsLoading()
{
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
while (child) {
BasketListViewItem *childItem = (BasketListViewItem*)child;
if (!childItem->basket()->isLoaded() && !childItem->basket()->isLocked())
@@ -373,7 +373,7 @@ bool BasketListViewItem::haveHiddenChildsLoading()
bool BasketListViewItem::haveChildsLocked()
{
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
while (child) {
BasketListViewItem *childItem = (BasketListViewItem*)child;
if (/*!*/childItem->basket()->isLocked())
@@ -395,7 +395,7 @@ bool BasketListViewItem::haveHiddenChildsLocked()
int BasketListViewItem::countChildsFound()
{
int count = 0;
- QListViewItem *child = firstChild();
+ TQListViewItem *child = firstChild();
while (child) {
BasketListViewItem *childItem = (BasketListViewItem*)child;
count += childItem->basket()->countFounds();
@@ -412,11 +412,11 @@ int BasketListViewItem::countHiddenChildsFound()
return countChildsFound();
}
-void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*colorGroup*/, int /*column*/, int width, int /*align*/)
+void BasketListViewItem::paintCell(TQPainter *painter, const TQColorGroup &/*tqcolorGroup*/, int /*column*/, int width, int /*align*/)
{
- // Workaround a Qt bug:
+ // Workaround a TQt bug:
// When the splitter is moved to hide the tree view and then the application is restarted,
- // Qt try to draw items with a negative size!
+ // TQt try to draw items with a negative size!
if (width <= 0) {
std::cout << "width <= 0" << std::endl;
return;
@@ -429,7 +429,7 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
// If we are filtering all baskets, and are effectively filtering on something:
bool showLoadingIcon = false;
bool showEncryptedIcon = false;
- QPixmap countPixmap;
+ TQPixmap countPixmap;
bool showCountPixmap = Global::bnpView->isFilteringAllBaskets() &&
Global::bnpView->currentBasket()->decoration()->filterBar()->filterData().isFiltering;
if (showCountPixmap) {
@@ -444,59 +444,59 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
bool drawRoundRect = m_basket->backgroundColorSetting().isValid() || m_basket->textColorSetting().isValid();
- QColor textColor = (drawRoundRect ? m_basket->textColor() : (isCurrentBasket() ? KGlobalSettings::highlightedTextColor() : KGlobalSettings::textColor()));
+ TQColor textColor = (drawRoundRect ? m_basket->textColor() : (isCurrentBasket() ? KGlobalSettings::highlightedTextColor() : KGlobalSettings::textColor()));
BasketListViewItem *shownAbove = shownItemAbove();
BasketListViewItem *shownBelow = shownItemBelow();
// Don't forget to update the key computation if parameters
// affecting the rendering logic change
- QString key = QString("BLVI::pC-%1.%2.%3.%4.%5.%6.%7.%8.%9.%10.%11.%12.%13.%14.%15")
- .arg(effectiveWidth)
- .arg(drawRoundRect)
- .arg(textColor.rgb())
- .arg(m_basket->backgroundColor().rgb())
- .arg(isCurrentBasket())
- .arg(shownBelow && shownBelow->isCurrentBasket())
- .arg(shownAbove && shownAbove->isCurrentBasket())
- .arg(showLoadingIcon)
- .arg(showEncryptedIcon)
- .arg(showCountPixmap)
- .arg(m_basket->countFounds())
- .arg(countHiddenChildsFound())
- .arg(m_isUnderDrag)
- .arg(m_basket->basketName())
- .arg(m_basket->icon());
- if (QPixmap* cached = QPixmapCache::find(key)) {
- // Qt's documentation recommends copying the pointer
- // into a QPixmap immediately
- QPixmap cachedBuffer = *cached;
+ TQString key = TQString("BLVI::pC-%1.%2.%3.%4.%5.%6.%7.%8.%9.%10.%11.%12.%13.%14.%15")
+ .tqarg(effectiveWidth)
+ .tqarg(drawRoundRect)
+ .tqarg(textColor.rgb())
+ .tqarg(m_basket->backgroundColor().rgb())
+ .tqarg(isCurrentBasket())
+ .tqarg(shownBelow && shownBelow->isCurrentBasket())
+ .tqarg(shownAbove && shownAbove->isCurrentBasket())
+ .tqarg(showLoadingIcon)
+ .tqarg(showEncryptedIcon)
+ .tqarg(showCountPixmap)
+ .tqarg(m_basket->countFounds())
+ .tqarg(countHiddenChildsFound())
+ .tqarg(m_isUnderDrag)
+ .tqarg(m_basket->basketName())
+ .tqarg(m_basket->icon());
+ if (TQPixmap* cached = TQPixmapCache::tqfind(key)) {
+ // TQt's documentation recommends copying the pointer
+ // into a TQPixmap immediately
+ TQPixmap cachedBuffer = *cached;
painter->drawPixmap(0, 0, cachedBuffer);
return;
}
// Bufferize the drawing of items (otherwize, resizing the splitter make the tree act like a Christmas Tree ;-D ):
- QPixmap theBuffer(width, height());
- QPainter thePainter(&theBuffer);
+ TQPixmap theBuffer(width, height());
+ TQPainter thePainter(&theBuffer);
// Fill with the basket background color:
- QColor background = (isCurrentBasket() ? KGlobalSettings::highlightColor() : listView()->paletteBackgroundColor());
+ TQColor background = (isCurrentBasket() ? KGlobalSettings::highlightColor() : listView()->paletteBackgroundColor());
thePainter.fillRect(0, 0, width, height(), background);
int textWidth = effectiveWidth - MARGIN - BASKET_ICON_SIZE - MARGIN - MARGIN;
// Draw the rounded rectangle:
if (drawRoundRect) {
- QRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::ShowPrefix, text(/*column=*/0));
+ TQRect textRect = listView()->fontMetrics().boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::ShowPrefix, text(/*column=*/0));
int xRound = MARGIN;
int yRound = MARGIN;
int hRound = height() - 2 * MARGIN;
- int wRound = QMIN(BASKET_ICON_SIZE + MARGIN + textRect.width() + hRound/2, effectiveWidth - MARGIN - MARGIN);
+ int wRound = TQMIN(BASKET_ICON_SIZE + MARGIN + textRect.width() + hRound/2, effectiveWidth - MARGIN - MARGIN);
if (wRound > 0) { // Do not crash if there is no space anymore to draw the rounded rectangle:
- QPixmap buffer(wRound * 2, hRound * 2);
+ TQPixmap buffer(wRound * 2, hRound * 2);
buffer.fill(background);
- QPainter pBuffer(&buffer);
- QColor colorRound = m_basket->backgroundColor();
+ TQPainter pBuffer(&buffer);
+ TQColor colorRound = m_basket->backgroundColor();
pBuffer.setPen(colorRound);
pBuffer.setBrush(colorRound);
if (wRound > hRound) { // If the rectangle is smaller in width than in height, don't overlap ellipses...
@@ -506,17 +506,17 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
} else
pBuffer.drawEllipse(0, 0, wRound * 2, hRound * 2);
pBuffer.end();
- QImage imageToScale = buffer.convertToImage();
- QPixmap pmScaled;
+ TQImage imageToScale = buffer.convertToImage();
+ TQPixmap pmScaled;
pmScaled.convertFromImage(imageToScale.smoothScale(wRound, hRound));
thePainter.drawPixmap(xRound, yRound, pmScaled);
textWidth -= hRound/2;
}
}
- QColor bgColor = listView()->paletteBackgroundColor();
- QColor selColor = KGlobalSettings::highlightColor();
- QColor midColor = Tools::mixColor(bgColor, selColor);
+ TQColor bgColor = listView()->paletteBackgroundColor();
+ TQColor selColor = KGlobalSettings::highlightColor();
+ TQColor midColor = Tools::mixColor(bgColor, selColor);
// Draw the left selection roundings:
if (isCurrentBasket()) {
thePainter.setPen(bgColor);
@@ -561,7 +561,7 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
thePainter.setPen(textColor);
if (textWidth > 0) { // IF there is space left to draw the text:
int xText = MARGIN + BASKET_ICON_SIZE + MARGIN;
- QString theText = m_basket->basketName();
+ TQString theText = m_basket->basketName();
if (painter->fontMetrics().width(theText) > textWidth) {
theText = KStringHandler::rPixelSqueeze(theText, painter->fontMetrics(), textWidth);
m_isAbbreviated = true;
@@ -570,7 +570,7 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
m_isAbbreviated = false;
}
theText = escapedName(theText);
- thePainter.drawText(xText, 0, textWidth, height(), Qt::AlignAuto | Qt::AlignVCenter | Qt::ShowPrefix, theText);
+ thePainter.drawText(xText, 0, textWidth, height(), TQt::AlignAuto | TQt::AlignVCenter | TQt::ShowPrefix, theText);
}
// If we are filtering all baskets, and are effectively filtering on something:
@@ -580,12 +580,12 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
effectiveWidth += countPixmap.width() + MARGIN;
}
if (showLoadingIcon) {
- QPixmap icon = kapp->iconLoader()->loadIcon("find", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
+ TQPixmap icon = kapp->iconLoader()->loadIcon("tqfind", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
thePainter.drawPixmap(effectiveWidth, 0, icon);
effectiveWidth += BASKET_ICON_SIZE + MARGIN;
}
if (showEncryptedIcon && !showLoadingIcon) {
- QPixmap icon = kapp->iconLoader()->loadIcon("encrypted", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
+ TQPixmap icon = kapp->iconLoader()->loadIcon("encrypted", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
thePainter.drawPixmap(effectiveWidth, 0, icon);
}
@@ -594,7 +594,7 @@ void BasketListViewItem::paintCell(QPainter *painter, const QColorGroup &/*color
}
thePainter.end();
- QPixmapCache::insert(key, theBuffer);
+ TQPixmapCache::insert(key, theBuffer);
// Apply the buffer:
painter->drawPixmap(0, 0, theBuffer);
}
@@ -611,19 +611,19 @@ bool BasketListViewItem::isAbbreviated()
/** class BasketListViewToolTip: */
-class BasketTreeListView_ToolTip : public QToolTip {
+class BasketTreeListView_ToolTip : public TQToolTip {
public:
BasketTreeListView_ToolTip(BasketTreeListView* basketView)
- : QToolTip(basketView->viewport())
+ : TQToolTip(basketView->viewport())
, m_basketView(basketView)
{}
public:
- void maybeTip(const QPoint& pos)
+ void maybeTip(const TQPoint& pos)
{
- QListViewItem *item = m_basketView->itemAt(m_basketView->contentsToViewport(pos));
+ TQListViewItem *item = m_basketView->itemAt(m_basketView->contentsToViewport(pos));
BasketListViewItem* bitem = dynamic_cast<BasketListViewItem*>(item);
if (bitem && bitem->isAbbreviated()) {
- tip(m_basketView->itemRect(bitem), bitem->basket()->basketName());
+ tip(m_basketView->tqitemRect(bitem), bitem->basket()->basketName());
}
}
private:
@@ -632,30 +632,30 @@ private:
/** class BasketTreeListView: */
-BasketTreeListView::BasketTreeListView(QWidget *parent, const char *name)
- : KListView(parent, name), m_autoOpenItem(0)
+BasketTreeListView::BasketTreeListView(TQWidget *tqparent, const char *name)
+ : KListView(tqparent, name), m_autoOpenItem(0)
, m_itemUnderDrag(0)
{
- setWFlags(Qt::WStaticContents | WNoAutoErase);
- clearWFlags(Qt::WStaticContents | WNoAutoErase);
- //viewport()->clearWFlags(Qt::WStaticContents);
- connect( &m_autoOpenTimer, SIGNAL(timeout()), this, SLOT(autoOpen()) );
+ setWFlags(TQt::WStaticContents | WNoAutoErase);
+ clearWFlags(TQt::WStaticContents | WNoAutoErase);
+ //viewport()->clearWFlags(TQt::WStaticContents);
+ connect( &m_autoOpenTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoOpen()) );
new BasketTreeListView_ToolTip(this);
}
-void BasketTreeListView::viewportResizeEvent(QResizeEvent *event)
+void BasketTreeListView::viewportResizeEvent(TQResizeEvent *event)
{
KListView::viewportResizeEvent(event);
triggerUpdate();
}
-void BasketTreeListView::contentsDragEnterEvent(QDragEnterEvent *event)
+void BasketTreeListView::contentsDragEnterEvent(TQDragEnterEvent *event)
{
if (event->provides("application/x-qlistviewitem")) {
- QListViewItemIterator it(this); // TODO: Don't show expanders if it's not a basket drag...
+ TQListViewItemIterator it(this); // TODO: Don't show expanders if it's not a basket drag...
while (it.current()) {
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
if (!item->firstChild()) {
item->setExpandable(true);
item->setOpen(true);
@@ -670,9 +670,9 @@ void BasketTreeListView::contentsDragEnterEvent(QDragEnterEvent *event)
void BasketTreeListView::removeExpands()
{
- QListViewItemIterator it(this);
+ TQListViewItemIterator it(this);
while (it.current()) {
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
if (!item->firstChild())
item->setExpandable(false);
++it;
@@ -680,7 +680,7 @@ void BasketTreeListView::removeExpands()
viewport()->update();
}
-void BasketTreeListView::contentsDragLeaveEvent(QDragLeaveEvent *event)
+void BasketTreeListView::contentsDragLeaveEvent(TQDragLeaveEvent *event)
{
std::cout << "BasketTreeListView::contentsDragLeaveEvent" << std::endl;
m_autoOpenItem = 0;
@@ -690,7 +690,7 @@ void BasketTreeListView::contentsDragLeaveEvent(QDragLeaveEvent *event)
KListView::contentsDragLeaveEvent(event);
}
-void BasketTreeListView::contentsDropEvent(QDropEvent *event)
+void BasketTreeListView::contentsDropEvent(TQDropEvent *event)
{
std::cout << "BasketTreeListView::contentsDropEvent()" << std::endl;
if (event->provides("application/x-qlistviewitem"))
@@ -699,7 +699,7 @@ void BasketTreeListView::contentsDropEvent(QDropEvent *event)
}
else {
std::cout << "Forwarding dropped data to the basket" << std::endl;
- QListViewItem *item = itemAt(contentsToViewport(event->pos()));
+ TQListViewItem *item = itemAt(contentsToViewport(event->pos()));
BasketListViewItem* bitem = dynamic_cast<BasketListViewItem*>(item);
if (bitem) {
bitem->basket()->blindDrop(event);
@@ -717,13 +717,13 @@ void BasketTreeListView::contentsDropEvent(QDropEvent *event)
Global::bnpView->save(); // TODO: Don't save if it was not a basket drop...
}
-void BasketTreeListView::contentsDragMoveEvent(QDragMoveEvent *event)
+void BasketTreeListView::contentsDragMoveEvent(TQDragMoveEvent *event)
{
std::cout << "BasketTreeListView::contentsDragMoveEvent" << std::endl;
if (event->provides("application/x-qlistviewitem"))
KListView::contentsDragMoveEvent(event);
else {
- QListViewItem *item = itemAt(contentsToViewport(event->pos()));
+ TQListViewItem *item = itemAt(contentsToViewport(event->pos()));
BasketListViewItem* bitem = dynamic_cast<BasketListViewItem*>(item);
if (m_autoOpenItem != item) {
m_autoOpenItem = item;
@@ -745,7 +745,7 @@ void BasketTreeListView::setItemUnderDrag(BasketListViewItem* item)
if (m_itemUnderDrag) {
// Remove drag status from the old item
m_itemUnderDrag->setUnderDrag(false);
- repaintItem(m_itemUnderDrag);
+ tqrepaintItem(m_itemUnderDrag);
}
m_itemUnderDrag = item;
@@ -753,7 +753,7 @@ void BasketTreeListView::setItemUnderDrag(BasketListViewItem* item)
if (m_itemUnderDrag) {
// add drag status to the new item
m_itemUnderDrag->setUnderDrag(true);
- repaintItem(m_itemUnderDrag);
+ tqrepaintItem(m_itemUnderDrag);
}
}
}
@@ -765,23 +765,23 @@ void BasketTreeListView::autoOpen()
Global::bnpView->setCurrentBasket(item->basket());
}
-void BasketTreeListView::resizeEvent(QResizeEvent *event)
+void BasketTreeListView::resizeEvent(TQResizeEvent *event)
{
KListView::resizeEvent(event);
}
-void BasketTreeListView::paintEmptyArea(QPainter *painter, const QRect &rect)
+void BasketTreeListView::paintEmptyArea(TQPainter *painter, const TQRect &rect)
{
- QListView::paintEmptyArea(painter, rect);
+ TQListView::paintEmptyArea(painter, rect);
BasketListViewItem *last = Global::bnpView->lastListViewItem();
if (last && !last->isShown())
last = last->shownItemAbove();
if (last && last->isCurrentBasket()) {
int y = last->itemPos() + last->height();
- QColor bgColor = paletteBackgroundColor();
- QColor selColor = KGlobalSettings::highlightColor();
- QColor midColor = Tools::mixColor(bgColor, selColor);
+ TQColor bgColor = paletteBackgroundColor();
+ TQColor selColor = KGlobalSettings::highlightColor();
+ TQColor midColor = Tools::mixColor(bgColor, selColor);
painter->setPen(selColor);
painter->drawPoint(visibleWidth() - 1, y);
painter->drawPoint(visibleWidth() - 2, y);
@@ -792,11 +792,11 @@ void BasketTreeListView::paintEmptyArea(QPainter *painter, const QRect &rect)
}
}
-/** We should NEVER get focus (because of QWidget::NoFocus focusPolicy())
+/** We should NEVER get focus (because of TQ_NoFocus focusPolicy())
* but KListView can programatically give us the focus.
* So we give it to the basket.
*/
-void BasketTreeListView::focusInEvent(QFocusEvent*)
+void BasketTreeListView::focusInEvent(TQFocusEvent*)
{
//KListView::focusInEvent(event);
Basket *basket = Global::bnpView->currentBasket();
diff --git a/src/basketlistview.h b/src/basketlistview.h
index 9a6a918..722ace3 100644
--- a/src/basketlistview.h
+++ b/src/basketlistview.h
@@ -22,39 +22,39 @@
#define BASKETLISTVIEW_H
#include <klistview.h>
-#include <qtimer.h>
+#include <tqtimer.h>
class Basket;
-class BasketListViewItem : public QListViewItem
+class BasketListViewItem : public TQListViewItem
{
public:
/// CONSTRUCTOR AND DESTRUCTOR:
- BasketListViewItem(QListView *parent, Basket *basket);
- BasketListViewItem(QListViewItem *parent, Basket *basket);
- BasketListViewItem(QListView *parent, QListViewItem *after, Basket *basket);
- BasketListViewItem(QListViewItem *parent, QListViewItem *after, Basket *basket);
+ BasketListViewItem(TQListView *tqparent, Basket *basket);
+ BasketListViewItem(TQListViewItem *tqparent, Basket *basket);
+ BasketListViewItem(TQListView *tqparent, TQListViewItem *after, Basket *basket);
+ BasketListViewItem(TQListViewItem *tqparent, TQListViewItem *after, Basket *basket);
~BasketListViewItem();
///
- bool acceptDrop(const QMimeSource *mime) const;
- void dropped(QDropEvent *event);
+ bool acceptDrop(const TQMimeSource *mime) const;
+ void dropped(TQDropEvent *event);
Basket *basket() { return m_basket; }
void setup();
- int width(const QFontMetrics &fontMetrics, const QListView *listView, int column) const;
+ int width(const TQFontMetrics &fontMetrics, const TQListView *listView, int column) const;
BasketListViewItem* lastChild();
BasketListViewItem* prevSibling();
BasketListViewItem* shownItemAbove();
BasketListViewItem* shownItemBelow();
- QStringList childNamesTree(int deep = 0);
+ TQStringList childNamesTree(int deep = 0);
void moveChildsBaskets();
void ensureVisible();
bool isShown();
bool isCurrentBasket();
- void paintCell(QPainter *painter, const QColorGroup &colorGroup, int column, int width, int align);
- QString escapedName(const QString &string);
+ void paintCell(TQPainter *painter, const TQColorGroup &tqcolorGroup, int column, int width, int align);
+ TQString escapedName(const TQString &string);
///
- QPixmap circledTextPixmap(const QString &text, int height, const QFont &font, const QColor &color);
- QPixmap foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const QFont &font, int height);
+ TQPixmap circledTextPixmap(const TQString &text, int height, const TQFont &font, const TQColor &color);
+ TQPixmap foundCountPixmap(bool isLoading, int countFound, bool childsAreLoading, int countChildsFound, const TQFont &font, int height);
bool haveChildsLoading();
bool haveHiddenChildsLoading();
bool haveChildsLocked();
@@ -65,8 +65,8 @@ class BasketListViewItem : public QListViewItem
void setUnderDrag(bool);
bool isAbbreviated();
///
-// QDragObject* dragObject();
-// bool acceptDrop ( const QMimeSource * mime ) const;
+// TQDragObject* dragObject();
+// bool acceptDrop ( const TQMimeSource * mime ) const;
private:
Basket *m_basket;
int m_width;
@@ -77,21 +77,22 @@ class BasketListViewItem : public QListViewItem
class BasketTreeListView : public KListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- BasketTreeListView(QWidget *parent = 0, const char *name = 0);
- void contentsDragEnterEvent(QDragEnterEvent *event);
+ BasketTreeListView(TQWidget *tqparent = 0, const char *name = 0);
+ void contentsDragEnterEvent(TQDragEnterEvent *event);
void removeExpands();
- void contentsDragLeaveEvent(QDragLeaveEvent *event);
- void contentsDragMoveEvent(QDragMoveEvent *event);
- void contentsDropEvent(QDropEvent *event);
- void resizeEvent(QResizeEvent *event);
- void paintEmptyArea(QPainter *painter, const QRect &rect);
+ void contentsDragLeaveEvent(TQDragLeaveEvent *event);
+ void contentsDragMoveEvent(TQDragMoveEvent *event);
+ void contentsDropEvent(TQDropEvent *event);
+ void resizeEvent(TQResizeEvent *event);
+ void paintEmptyArea(TQPainter *painter, const TQRect &rect);
protected:
- void focusInEvent(QFocusEvent*);
- void viewportResizeEvent(QResizeEvent *event);
+ void focusInEvent(TQFocusEvent*);
+ void viewportResizeEvent(TQResizeEvent *event);
private:
- QTimer m_autoOpenTimer;
- QListViewItem *m_autoOpenItem;
+ TQTimer m_autoOpenTimer;
+ TQListViewItem *m_autoOpenItem;
private slots:
void autoOpen();
private:
diff --git a/src/basketproperties.cpp b/src/basketproperties.cpp
index 911be2a..28a0381 100644
--- a/src/basketproperties.cpp
+++ b/src/basketproperties.cpp
@@ -19,18 +19,18 @@
***************************************************************************/
#include <kicondialog.h>
-#include <qlineedit.h>
-#include <qcombobox.h>
-#include <qvbuttongroup.h>
+#include <tqlineedit.h>
+#include <tqcombobox.h>
+#include <tqvbuttongroup.h>
#include <knuminput.h>
#include <kkeybutton.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qstringlist.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqstringlist.h>
#include <klocale.h>
-#include <qstyle.h>
+#include <tqstyle.h>
#include <kapplication.h>
#include <kiconloader.h>
#include <kglobalsettings.h>
@@ -42,54 +42,54 @@
#include "global.h"
#include "backgroundmanager.h"
-BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
+BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, i18n("Basket Properties"), KDialogBase::Ok | KDialogBase::Apply | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"BasketProperties", /*modal=*/true, /*separator=*/false),
+ KDialogBase::Ok, tqparent, /*name=*/"BasketProperties", /*modal=*/true, /*separator=*/false),
m_basket(basket)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
// Icon and Name:
- QHBoxLayout *nameLayout = new QHBoxLayout(0, marginHint()*2/3, spacingHint());
+ TQHBoxLayout *nameLayout = new TQHBoxLayout(0, marginHint()*2/3, spacingHint());
m_icon = new KIconButton(page);
m_icon->setIconType(KIcon::NoGroup, KIcon::Action);
m_icon->setIconSize(16);
m_icon->setIcon(m_basket->icon());
- int size = QMAX(m_icon->sizeHint().width(), m_icon->sizeHint().height());
+ int size = TQMAX(m_icon->tqsizeHint().width(), m_icon->tqsizeHint().height());
m_icon->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_icon, i18n("Icon"));
- m_name = new QLineEdit(m_basket->basketName(), page);
+ TQToolTip::add(m_icon, i18n("Icon"));
+ m_name = new TQLineEdit(m_basket->basketName(), page);
m_name->setMinimumWidth(m_name->fontMetrics().maxWidth()*20);
- QToolTip::add(m_name, i18n("Name"));
+ TQToolTip::add(m_name, i18n("Name"));
nameLayout->addWidget(m_icon);
nameLayout->addWidget(m_name);
topLayout->addLayout(nameLayout);
// Appearance:
- QGroupBox *appearance = new QGroupBox(1, Qt::Horizontal, i18n("Appearance"), page);
- QWidget *appearanceWidget = new QWidget(appearance);
- QGridLayout *grid = new QGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
- m_backgroundImage = new QComboBox(appearanceWidget);
+ TQGroupBox *appearance = new TQGroupBox(1, Qt::Horizontal, i18n("Appearance"), page);
+ TQWidget *appearanceWidget = new TQWidget(appearance);
+ TQGridLayout *grid = new TQGridLayout(appearanceWidget, /*nRows=*/3, /*nCols=*/2, /*margin=*/0, spacingHint());
+ m_backgroundImage = new TQComboBox(appearanceWidget);
m_backgroundColor = new KColorCombo2(m_basket->backgroundColorSetting(), KGlobalSettings::baseColor(), appearanceWidget);
m_textColor = new KColorCombo2(m_basket->textColorSetting(), KGlobalSettings::textColor(), appearanceWidget);
- QLabel *label1 = new QLabel(m_backgroundImage, i18n("Background &image:"), appearanceWidget);
- QLabel *label2 = new QLabel(m_backgroundColor, i18n("&Background color:"), appearanceWidget);
- QLabel *label3 = new QLabel(m_textColor, i18n("&Text color:"), appearanceWidget);
- grid->addWidget(label1, 0, 0, Qt::AlignVCenter);
- grid->addWidget(label2, 1, 0, Qt::AlignVCenter);
- grid->addWidget(label3, 2, 0, Qt::AlignVCenter);
- grid->addWidget(m_backgroundImage, 0, 1, Qt::AlignVCenter);
- grid->addWidget(m_backgroundColor, 1, 1, Qt::AlignVCenter);
- grid->addWidget(m_textColor, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_backgroundImage, i18n("Background &image:"), appearanceWidget);
+ TQLabel *label2 = new TQLabel(m_backgroundColor, i18n("&Background color:"), appearanceWidget);
+ TQLabel *label3 = new TQLabel(m_textColor, i18n("&Text color:"), appearanceWidget);
+ grid->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ grid->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ grid->addWidget(label3, 2, 0, TQt::AlignVCenter);
+ grid->addWidget(m_backgroundImage, 0, 1, TQt::AlignVCenter);
+ grid->addWidget(m_backgroundColor, 1, 1, TQt::AlignVCenter);
+ grid->addWidget(m_textColor, 2, 1, TQt::AlignVCenter);
topLayout->addWidget(appearance);
m_backgroundImage->insertItem(i18n("(None)"), 0);
m_backgroundImagesMap.insert(0, "");
- QStringList backgrounds = Global::backgroundManager->imageNames();
+ TQStringList backgrounds = Global::backgroundManager->imageNames();
int index = 1;
- for (QStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
- QPixmap *preview = Global::backgroundManager->preview(*it);
+ for (TQStringList::Iterator it = backgrounds.begin(); it != backgrounds.end(); ++it) {
+ TQPixmap *preview = Global::backgroundManager->preview(*it);
if (preview) {
m_backgroundImagesMap.insert(index, *it);
m_backgroundImage->insertItem(*preview, index);
@@ -99,37 +99,37 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
}
}
// m_backgroundImage->insertItem(i18n("Other..."), -1);
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
- m_backgroundImage->setSizeLimit(50/*75 * 6 / m_backgroundImage->sizeHint().height()*/);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
+ m_backgroundImage->setSizeLimit(50/*75 * 6 / m_backgroundImage->tqsizeHint().height()*/);
m_backgroundImage->setMinimumHeight(75 + 2 * BUTTON_MARGIN);
// Disposition:
- m_disposition = new QVButtonGroup(i18n("Disposition"), page);
- QWidget *columnsWidget = new QWidget(m_disposition);
- QHBoxLayout *dispoLayout = new QHBoxLayout(columnsWidget, /*margin=*/0, spacingHint());
- QRadioButton *radio = new QRadioButton(i18n("Col&umns:"), columnsWidget);
+ m_disposition = new TQVButtonGroup(i18n("Disposition"), page);
+ TQWidget *columnsWidget = new TQWidget(m_disposition);
+ TQHBoxLayout *dispoLayout = new TQHBoxLayout(columnsWidget, /*margin=*/0, spacingHint());
+ TQRadioButton *radio = new TQRadioButton(i18n("Col&umns:"), columnsWidget);
m_columnCount = new KIntNumInput(m_basket->columnsCount(), columnsWidget);
m_columnCount->setRange(1, 20, /*step=*/1, /*slider=*/false);
m_columnCount->setValue(m_basket->columnsCount());
- connect( m_columnCount, SIGNAL(valueChanged(int)), this, SLOT(selectColumnsLayout()) );
+ connect( m_columnCount, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(selectColumnsLayout()) );
dispoLayout->addWidget(radio);
dispoLayout->addWidget(m_columnCount);
m_disposition->insert(radio);
- new QRadioButton(i18n("&Free-form"), m_disposition);
- QRadioButton *mindMap = new QRadioButton(i18n("&Mind map"), m_disposition); // TODO: "Learn more..."
- int height = QMAX(mindMap->sizeHint().height(), m_columnCount->sizeHint().height()); // Make all radioButtons vertically equaly-spaced!
- mindMap->setMinimumSize(mindMap->sizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
+ new TQRadioButton(i18n("&Free-form"), m_disposition);
+ TQRadioButton *mindMap = new TQRadioButton(i18n("&Mind map"), m_disposition); // TODO: "Learn more..."
+ int height = TQMAX(mindMap->tqsizeHint().height(), m_columnCount->tqsizeHint().height()); // Make all radioButtons vertically equaly-spaced!
+ mindMap->setMinimumSize(mindMap->tqsizeHint().width(), height); // Because the m_columnCount can be heigher, and make radio1 and radio2 more spaced than radio2 and radio3.
m_disposition->setButton(m_basket->isFreeLayout() ? (m_basket->isMindMap() ? 2 : 1) : 0);
topLayout->addWidget(m_disposition);
mindMap->hide();
// Keyboard Shortcut:
- m_shortcutRole = new QVButtonGroup(i18n("&Keyboard Shortcut"), page);
- QWidget *shortcutWidget = new QWidget(m_shortcutRole);
- QHBoxLayout *shortcutLayout = new QHBoxLayout(shortcutWidget, /*margin=*/0, spacingHint());
+ m_shortcutRole = new TQVButtonGroup(i18n("&Keyboard Shortcut"), page);
+ TQWidget *shortcutWidget = new TQWidget(m_shortcutRole);
+ TQHBoxLayout *shortcutLayout = new TQHBoxLayout(shortcutWidget, /*margin=*/0, spacingHint());
m_shortcut = new KKeyButton(shortcutWidget);
- m_shortcut->setShortcut(m_basket->shortcut(), /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(m_basket->shortcut(), /*bTQtShortcut=*/true);
HelpLabel *helpLabel = new HelpLabel(i18n("Learn some tips..."), i18n(
"<p><strong>Easily Remember your Shortcuts</strong>:<br>"
"With the first option, giving the basket a shortcut of the form <strong>Alt+Letter</strong> will underline that letter in the basket tree.<br>"
@@ -145,10 +145,10 @@ BasketPropertiesDialog::BasketPropertiesDialog(Basket *basket, QWidget *parent)
shortcutLayout->addWidget(m_shortcut);
shortcutLayout->addStretch();
shortcutLayout->addWidget(helpLabel);
- connect( m_shortcut, SIGNAL(capturedShortcut(const KShortcut&)), this, SLOT(capturedShortcut(const KShortcut&)) );
- new QRadioButton(i18n("S&how this basket"), m_shortcutRole);
- new QRadioButton(i18n("Show this basket (&global shortcut)"), m_shortcutRole);
- new QRadioButton(i18n("S&witch to this basket (global shortcut)"), m_shortcutRole);
+ connect( m_shortcut, TQT_SIGNAL(capturedShortcut(const KShortcut&)), this, TQT_SLOT(capturedShortcut(const KShortcut&)) );
+ new TQRadioButton(i18n("S&how this basket"), m_shortcutRole);
+ new TQRadioButton(i18n("Show this basket (&global shortcut)"), m_shortcutRole);
+ new TQRadioButton(i18n("S&witch to this basket (global shortcut)"), m_shortcutRole);
m_shortcutRole->setButton(m_basket->shortcutAction()/* + 1*/); // Id 0 is the KKeyButton!
topLayout->addWidget(m_shortcutRole);
@@ -192,7 +192,7 @@ void BasketPropertiesDialog::slotOk()
void BasketPropertiesDialog::capturedShortcut(const KShortcut &shortcut)
{
// TODO: Validate it!
- m_shortcut->setShortcut(shortcut, /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(shortcut, /*bTQtShortcut=*/true);
}
void BasketPropertiesDialog::selectColumnsLayout()
diff --git a/src/basketproperties.h b/src/basketproperties.h
index 033aff9..521b6e9 100644
--- a/src/basketproperties.h
+++ b/src/basketproperties.h
@@ -22,13 +22,13 @@
#define BASKETPROPERTIES_H
#include <kdialogbase.h>
-#include <qmap.h>
-#include <qstring.h>
+#include <tqmap.h>
+#include <tqstring.h>
class KIconButton;
-class QLineEdit;
-class QComboBox;
-class QVButtonGroup;
+class TQLineEdit;
+class TQComboBox;
+class TQVButtonGroup;
class KIntNumInput;
class KKeyButton;
class KShortcut;
@@ -42,8 +42,9 @@ class KColorCombo2;
class BasketPropertiesDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- BasketPropertiesDialog(Basket *basket, QWidget *parent = 0);
+ BasketPropertiesDialog(Basket *basket, TQWidget *tqparent = 0);
~BasketPropertiesDialog();
void polish();
void applyChanges();
@@ -55,15 +56,15 @@ class BasketPropertiesDialog : public KDialogBase
private:
Basket *m_basket;
KIconButton *m_icon;
- QLineEdit *m_name;
- QComboBox *m_backgroundImage;
+ TQLineEdit *m_name;
+ TQComboBox *m_backgroundImage;
KColorCombo2 *m_backgroundColor;
KColorCombo2 *m_textColor;
- QVButtonGroup *m_disposition;
+ TQVButtonGroup *m_disposition;
KIntNumInput *m_columnCount;
KKeyButton *m_shortcut;
- QVButtonGroup *m_shortcutRole;
- QMap<int, QString> m_backgroundImagesMap;
+ TQVButtonGroup *m_shortcutRole;
+ TQMap<int, TQString> m_backgroundImagesMap;
};
#endif // BASKETPROPERTIES_H
diff --git a/src/basketstatusbar.cpp b/src/basketstatusbar.cpp
index 02e18f5..72e706b 100644
--- a/src/basketstatusbar.cpp
+++ b/src/basketstatusbar.cpp
@@ -22,8 +22,8 @@
#include <kstatusbar.h>
#include <klocale.h>
#include <kdebug.h>
-#include <qlabel.h>
-#include <qobjectlist.h>
+#include <tqlabel.h>
+#include <tqobjectlist.h>
#include "basketstatusbar.h"
#include "clickablelabel.h"
#include "global.h"
@@ -31,15 +31,15 @@
#include "basket.h"
#include "tools.h"
#include <kiconloader.h>
-#include <qtooltip.h>
+#include <tqtooltip.h>
BasketStatusBar::BasketStatusBar(KStatusBar *bar)
- : m_bar(bar), m_extension(0), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
+ : m_bar(bar), m_extension(0), m_selectiontqStatus(0), m_locktqStatus(0), m_baskettqStatus(0), m_savedtqStatus(0)
{
}
BasketStatusBar::BasketStatusBar(KParts::StatusBarExtension *extension)
- : m_bar(0), m_extension(extension), m_selectionStatus(0), m_lockStatus(0), m_basketStatus(0), m_savedStatus(0)
+ : m_bar(0), m_extension(extension), m_selectiontqStatus(0), m_locktqStatus(0), m_baskettqStatus(0), m_savedtqStatus(0)
{
}
@@ -56,7 +56,7 @@ KStatusBar *BasketStatusBar::statusBar () const
return m_bar;
}
-void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent)
+void BasketStatusBar::addWidget(TQWidget * widget, int stretch, bool permanent)
{
if(m_extension)
m_extension->addStatusBarItem(widget, stretch, permanent);
@@ -66,53 +66,53 @@ void BasketStatusBar::addWidget(QWidget * widget, int stretch, bool permanent)
void BasketStatusBar::setupStatusBar()
{
- QWidget* parent = statusBar();
- QObjectList* lst = parent->queryList("KRSqueezedTextLabel");
+ TQWidget* tqparent = statusBar();
+ TQObjectList* lst = tqparent->queryList("KRSqueezedTextLabel");
- //Tools::printChildren(parent);
+ //Tools::printChildren(tqparent);
if(lst->count() == 0)
{
- m_basketStatus = new QLabel(parent);
- m_basketStatus->setSizePolicy( QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored, 0, 0, false) );
- addWidget( m_basketStatus, 1, false ); // Fit all extra space and is hiddable
+ m_baskettqStatus = new TQLabel(tqparent);
+ m_baskettqStatus->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Ignored, TQSizePolicy::Ignored, 0, 0, false) );
+ addWidget( m_baskettqStatus, 1, false ); // Fit all extra space and is hiddable
}
else
- m_basketStatus = static_cast<QLabel*>(lst->at(0));
+ m_baskettqStatus = static_cast<TQLabel*>(TQT_TQWIDGET(lst->at(0)));
delete lst;
- m_selectionStatus = new QLabel(i18n("Loading..."), parent);
- addWidget( m_selectionStatus, 0, true );
+ m_selectiontqStatus = new TQLabel(i18n("Loading..."), tqparent);
+ addWidget( m_selectiontqStatus, 0, true );
- m_lockStatus = new ClickableLabel(0/*this*/);
- m_lockStatus->setMinimumSize(18, 18);
- m_lockStatus->setAlignment(Qt::AlignCenter);
-// addWidget( m_lockStatus, 0, true );
- connect( m_lockStatus, SIGNAL(clicked()), Global::bnpView, SLOT(lockBasket()) );
+ m_locktqStatus = new ClickableLabel(0/*this*/);
+ m_locktqStatus->setMinimumSize(18, 18);
+ m_locktqStatus->tqsetAlignment(TQt::AlignCenter);
+// addWidget( m_locktqStatus, 0, true );
+ connect( m_locktqStatus, TQT_SIGNAL(clicked()), Global::bnpView, TQT_SLOT(lockBasket()) );
m_savedStatusPixmap = SmallIcon("filesave");
- m_savedStatus = new QLabel(parent);
- m_savedStatus->setPixmap(m_savedStatusPixmap);
- m_savedStatus->setFixedSize(m_savedStatus->sizeHint());
- m_savedStatus->clear();
- //m_savedStatus->setPixmap(m_savedStatusIconSet.pixmap(QIconSet::Small, QIconSet::Disabled));
- //m_savedStatus->setEnabled(false);
- addWidget( m_savedStatus, 0, true );
- QToolTip::add(m_savedStatus, "<p>" + i18n("Shows if there are changes that have not yet been saved."));
+ m_savedtqStatus = new TQLabel(tqparent);
+ m_savedtqStatus->setPixmap(m_savedStatusPixmap);
+ m_savedtqStatus->setFixedSize(m_savedtqStatus->tqsizeHint());
+ m_savedtqStatus->clear();
+ //m_savedtqStatus->setPixmap(m_savedStatusIconSet.pixmap(TQIconSet::Small, TQIconSet::Disabled));
+ //m_savedtqStatus->setEnabled(false);
+ addWidget( m_savedtqStatus, 0, true );
+ TQToolTip::add(m_savedtqStatus, "<p>" + i18n("Shows if there are changes that have not yet been saved."));
}
-void BasketStatusBar::postStatusbarMessage(const QString& text)
+void BasketStatusBar::postStatusbarMessage(const TQString& text)
{
if(statusBar())
statusBar()->message(text, 2000);
}
-void BasketStatusBar::setStatusText(const QString &txt)
+void BasketStatusBar::setStatusText(const TQString &txt)
{
- if(m_basketStatus && m_basketStatus->text() != txt)
- m_basketStatus->setText(txt);
+ if(m_baskettqStatus && m_baskettqStatus->text() != txt)
+ m_baskettqStatus->setText(txt);
}
-void BasketStatusBar::setStatusBarHint(const QString &hint)
+void BasketStatusBar::setStatusBarHint(const TQString &hint)
{
if (hint.isEmpty())
updateStatusBarHint();
@@ -122,7 +122,7 @@ void BasketStatusBar::setStatusBarHint(const QString &hint)
void BasketStatusBar::updateStatusBarHint()
{
- QString message = "";
+ TQString message = "";
if (Global::bnpView->currentBasket()->isDuringDrag())
message = i18n("Ctrl+drop: copy, Shift+drop: move, Shift+Ctrl+drop: link.");
@@ -137,40 +137,40 @@ void BasketStatusBar::updateStatusBarHint()
setStatusText(message);
}
-void BasketStatusBar::setLockStatus(bool isLocked)
+void BasketStatusBar::setLocktqStatus(bool isLocked)
{
- if(!m_lockStatus)
+ if(!m_locktqStatus)
return;
if (isLocked) {
- m_lockStatus->setPixmap(SmallIcon("encrypted.png"));
- QToolTip::add(m_lockStatus, i18n(
- "<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").replace(" ", "&nbsp;") );
-// QToolTip::add(m_lockStatus, i18n("This basket is locked.\nClick to unlock it."));
+ m_locktqStatus->setPixmap(SmallIcon("encrypted.png"));
+ TQToolTip::add(m_locktqStatus, i18n(
+ "<p>This basket is <b>locked</b>.<br>Click to unlock it.</p>").tqreplace(" ", "&nbsp;") );
+// TQToolTip::add(m_locktqStatus, i18n("This basket is locked.\nClick to unlock it."));
} else {
- m_lockStatus->clear();
- QToolTip::add(m_lockStatus, i18n(
- "<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").replace(" ", "&nbsp;") );
-// QToolTip::add(m_lockStatus, i18n("This basket is unlocked.\nClick to lock it."));
+ m_locktqStatus->clear();
+ TQToolTip::add(m_locktqStatus, i18n(
+ "<p>This basket is <b>unlocked</b>.<br>Click to lock it.</p>").tqreplace(" ", "&nbsp;") );
+// TQToolTip::add(m_locktqStatus, i18n("This basket is unlocked.\nClick to lock it."));
}
}
-void BasketStatusBar::setSelectionStatus(const QString &s)
+void BasketStatusBar::setSelectiontqStatus(const TQString &s)
{
- if (m_selectionStatus)
- m_selectionStatus->setText(s);
+ if (m_selectiontqStatus)
+ m_selectiontqStatus->setText(s);
}
-void BasketStatusBar::setUnsavedStatus(bool isUnsaved)
+void BasketStatusBar::setUnsavedtqStatus(bool isUnsaved)
{
- if (!m_savedStatus)
+ if (!m_savedtqStatus)
return;
if (isUnsaved) {
- if (m_savedStatus->pixmap() == 0)
- m_savedStatus->setPixmap(m_savedStatusPixmap);
+ if (m_savedtqStatus->pixmap() == 0)
+ m_savedtqStatus->setPixmap(m_savedStatusPixmap);
} else
- m_savedStatus->clear();
+ m_savedtqStatus->clear();
}
#include "basketstatusbar.moc"
diff --git a/src/basketstatusbar.h b/src/basketstatusbar.h
index f9d8714..cb165e4 100644
--- a/src/basketstatusbar.h
+++ b/src/basketstatusbar.h
@@ -20,21 +20,22 @@
#ifndef BASKETSTATUSBAR_H
#define BASKETSTATUSBAR_H
-#include <qobject.h>
-#include <qpixmap.h>
+#include <tqobject.h>
+#include <tqpixmap.h>
class KStatusBar;
namespace KParts { class StatusBarExtension; }
-class QWidget;
-class QLabel;
+class TQWidget;
+class TQLabel;
class ClickableLabel;
/**
@author Sébastien Laoût <slaout@linux62.org>
*/
-class BasketStatusBar : public QObject
+class BasketStatusBar : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
BasketStatusBar(KStatusBar *bar);
BasketStatusBar(KParts::StatusBarExtension *extension);
@@ -42,27 +43,27 @@ class BasketStatusBar : public QObject
public slots:
/** GUI Main Window actions **/
- void setStatusBarHint(const QString &hint); /// << Set a specific message or update if hint is empty
+ void setStatusBarHint(const TQString &hint); /// << Set a specific message or update if hint is empty
void updateStatusBarHint(); /// << Display the current state message (dragging, editing) or reset the startsbar message
- void postStatusbarMessage(const QString &text);
- void setSelectionStatus(const QString &s);
- void setLockStatus(bool isLocked);
+ void postStatusbarMessage(const TQString &text);
+ void setSelectiontqStatus(const TQString &s);
+ void setLocktqStatus(bool isLocked);
void setupStatusBar();
- void setUnsavedStatus(bool isUnsaved);
+ void setUnsavedtqStatus(bool isUnsaved);
protected:
KStatusBar *statusBar () const;
- void addWidget(QWidget * widget, int stretch = 0, bool permanent = false);
- void setStatusText(const QString &txt);
+ void addWidget(TQWidget * widget, int stretch = 0, bool permanent = false);
+ void setStatusText(const TQString &txt);
private:
KStatusBar *m_bar;
KParts::StatusBarExtension *m_extension;
- QLabel *m_selectionStatus;
- ClickableLabel *m_lockStatus;
- QLabel *m_basketStatus;
- QLabel *m_savedStatus;
- QPixmap m_savedStatusPixmap;
+ TQLabel *m_selectiontqStatus;
+ ClickableLabel *m_locktqStatus;
+ TQLabel *m_baskettqStatus;
+ TQLabel *m_savedtqStatus;
+ TQPixmap m_savedStatusPixmap;
};
#endif
diff --git a/src/bnpview.cpp b/src/bnpview.cpp
index b0d83f7..61843b1 100644
--- a/src/bnpview.cpp
+++ b/src/bnpview.cpp
@@ -20,16 +20,16 @@
/// NEW:
-#include <qwidgetstack.h>
-#include <qregexp.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qimage.h>
-#include <qbitmap.h>
-#include <qwhatsthis.h>
+#include <tqwidgetstack.h>
+#include <tqregexp.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <tqbitmap.h>
+#include <tqwhatsthis.h>
#include <kpopupmenu.h>
-#include <qsignalmapper.h>
-#include <qdir.h>
+#include <tqsignalmapper.h>
+#include <tqdir.h>
#include <kicontheme.h>
#include <kiconloader.h>
#include <klocale.h>
@@ -80,9 +80,9 @@
const int BNPView::c_delayTooltipTime = 275;
-BNPView::BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
+BNPView::BNPView(TQWidget *tqparent, const char *name, KXMLGUIClient *aGUIClient,
KActionCollection *actionCollection, BasketStatusBar *bar)
- : DCOPObject("BasketIface"), QSplitter(Qt::Horizontal, parent, name), m_actLockBasket(0), m_actPassBasket(0),
+ : DCOPObject("BasketIface"), TQSplitter(Qt::Horizontal, tqparent, name), m_actLockBasket(0), m_actPassBasket(0),
m_loading(true), m_newBasketPopup(false), m_firstShow(true),
m_regionGrabber(0), m_passiveDroppedSelection(0), m_passivePopup(0), m_actionCollection(actionCollection),
m_guiClient(aGUIClient), m_statusbar(bar), m_tryHideTimer(0), m_hideTimer(0)
@@ -93,12 +93,12 @@ BNPView::BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
Global::bnpView = this;
// Needed when loading the baskets:
- Global::globalAccel = new KGlobalAccel(this); // FIXME: might be null (KPart case)!
+ Global::globalAccel = new KGlobalAccel(TQT_TQOBJECT(this)); // FIXME: might be null (KPart case)!
Global::backgroundManager = new BackgroundManager();
setupGlobalShortcuts();
initialize();
- QTimer::singleShot(0, this, SLOT(lateInit()));
+ TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(lateInit()));
}
BNPView::~BNPView()
@@ -152,7 +152,7 @@ void BNPView::lateInit()
/* System tray icon */
Global::systemTray = new SystemTray(Global::mainWindow());
- connect( Global::systemTray, SIGNAL(showPart()), this, SIGNAL(showPart()) );
+ connect( Global::systemTray, TQT_SIGNAL(showPart()), this, TQT_SIGNAL(showPart()) );
if (Settings::useSystray())
Global::systemTray->show();
@@ -165,7 +165,7 @@ void BNPView::lateInit()
// If no basket has been found, try to import from an older version,
if (!firstListViewItem()) {
- QDir dir;
+ TQDir dir;
dir.mkdir(Global::basketsFolder());
if (FormatImporter::shouldImportBaskets()) {
FormatImporter::importBaskets();
@@ -173,7 +173,7 @@ void BNPView::lateInit()
}
if (!firstListViewItem()) {
// Create first basket:
- BasketFactory::newBasket(/*icon=*/"", /*name=*/i18n("General"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"", /*name=*/i18n("General"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
}
}
@@ -184,14 +184,14 @@ void BNPView::lateInit()
Settings::saveConfig();
}
- m_tryHideTimer = new QTimer(this);
- m_hideTimer = new QTimer(this);
- connect( m_tryHideTimer, SIGNAL(timeout()), this, SLOT(timeoutTryHide()) );
- connect( m_hideTimer, SIGNAL(timeout()), this, SLOT(timeoutHide()) );
+ m_tryHideTimer = new TQTimer(this);
+ m_hideTimer = new TQTimer(this);
+ connect( m_tryHideTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(timeoutTryHide()) );
+ connect( m_hideTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(timeoutHide()) );
// Preload every baskets for instant filtering:
/*StopWatch::start(100);
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
item->basket()->load();
@@ -204,17 +204,17 @@ StopWatch::check(100);*/
void BNPView::addWelcomeBaskets()
{
// Possible paths where to find the welcome basket archive, trying the translated one, and falling back to the English one:
- QStringList possiblePaths;
- if (QString(KGlobal::locale()->encoding()) == QString("UTF-8")) { // Welcome baskets are encoded in UTF-8. If the system is not, then use the English version:
+ TQStringList possiblePaths;
+ if (TQString(KGlobal::locale()->encoding()) == TQString("UTF-8")) { // Welcome baskets are encoded in UTF-8. If the system is not, then use the English version:
possiblePaths.append(KGlobal::dirs()->findResource("data", "basket/welcome/Welcome_" + KGlobal::locale()->language() + ".baskets"));
- possiblePaths.append(KGlobal::dirs()->findResource("data", "basket/welcome/Welcome_" + QStringList::split("_", KGlobal::locale()->language())[0] + ".baskets"));
+ possiblePaths.append(KGlobal::dirs()->findResource("data", "basket/welcome/Welcome_" + TQStringList::split("_", KGlobal::locale()->language())[0] + ".baskets"));
}
possiblePaths.append(KGlobal::dirs()->findResource("data", "basket/welcome/Welcome_en_US.baskets"));
// Take the first EXISTING basket archive found:
- QDir dir;
- QString path;
- for (QStringList::Iterator it = possiblePaths.begin(); it != possiblePaths.end(); ++it) {
+ TQDir dir;
+ TQString path;
+ for (TQStringList::Iterator it = possiblePaths.begin(); it != possiblePaths.end(); ++it) {
if (dir.exists(*it)) {
path = *it;
break;
@@ -232,7 +232,7 @@ void BNPView::onFirstShow()
/* LikeBack */
/* Global::likeBack = new LikeBack(LikeBack::AllButtons, / *showBarByDefault=* /true, Global::config(), Global::about());
Global::likeBack->setServer("basket.linux62.org", "/likeback/send.php");
- Global:likeBack->setAcceptedLanguages(QStringList::split(";", "en;fr"), i18n("Only english and french languages are accepted."));
+ Global:likeBack->setAcceptedLanguages(TQStringList::split(";", "en;fr"), i18n("Only english and french languages are accepted."));
if (isPart())
Global::likeBack->disableBar(); // See BNPView::shown() and BNPView::hide().
*/
@@ -257,7 +257,7 @@ void BNPView::onFirstShow()
int treeWidth = Settings::basketTreeWidth();
if (treeWidth < 0)
treeWidth = m_tree->fontMetrics().maxWidth() * 11;
- QValueList<int> splitterSizes;
+ TQValueList<int> splitterSizes;
splitterSizes.append(treeWidth);
setSizes(splitterSizes);
}
@@ -268,68 +268,68 @@ void BNPView::setupGlobalShortcuts()
KGlobalAccel *globalAccel = Global::globalAccel; // Better for the following lines
// Ctrl+Shift+W only works when started standalone:
- QWidget *basketMainWindow = (QWidget*) (Global::bnpView->parent()->inherits("MainWindow") ? Global::bnpView->parent() : 0);
+ TQWidget *basketMainWindow = (TQWidget*) (Global::bnpView->tqparent()->inherits("MainWindow") ? Global::bnpView->tqparent() : 0);
if (basketMainWindow) {
globalAccel->insert( "global_show_hide_main_window", i18n("Show/hide main window"),
i18n("Allows you to show main Window if it is hidden, and to hide it if it is shown."),
- Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_W, Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_W,
- basketMainWindow, SLOT(changeActive()), true, true );
+ TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_W, TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_W,
+ TQT_TQOBJECT(basketMainWindow), TQT_SLOT(changeActive()), true, true );
}
globalAccel->insert( "global_paste", i18n("Paste clipboard contents in current basket"),
i18n("Allows you to paste clipboard contents in the current basket without having to open the main window."),
- Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V, Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V,
- Global::bnpView, SLOT(globalPasteInCurrentBasket()), true, true );
+ TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_V, TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_V,
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(globalPasteInCurrentBasket()), true, true );
globalAccel->insert( "global_show_current_basket", i18n("Show current basket name"),
i18n("Allows you to know basket is current without opening the main window."),
"", "",
- Global::bnpView, SLOT(showPassiveContentForced()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(showPassiveContentForced()), true, true );
globalAccel->insert( "global_paste_selection", i18n("Paste selection in current basket"),
i18n("Allows you to paste clipboard selection in the current basket without having to open the main window."),
- Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S, Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S,
- Global::bnpView, SLOT(pasteSelInCurrentBasket()), true, true );
+ TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_S, TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_S,
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(pasteSelInCurrentBasket()), true, true );
globalAccel->insert( "global_new_basket", i18n("Create a new basket"),
i18n("Allows you to create a new basket without having to open the main window (you then can use the other global shortcuts to add a note, paste clipboard or paste selection in this new basket)."),
"", "",
- Global::bnpView, SLOT(askNewBasket()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(askNewBasket()), true, true );
globalAccel->insert( "global_previous_basket", i18n("Go to previous basket"),
i18n("Allows you to change current basket to the previous one without having to open the main window."),
"", "",
- Global::bnpView, SLOT(goToPreviousBasket()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(goToPreviousBasket()), true, true );
globalAccel->insert( "global_next_basket", i18n("Go to next basket"),
i18n("Allows you to change current basket to the next one without having to open the main window."),
"", "",
- Global::bnpView, SLOT(goToNextBasket()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(goToNextBasket()), true, true );
// globalAccel->insert( "global_note_add_text", i18n("Insert plain text note"),
// i18n("Add a plain text note to the current basket without having to open the main window."),
-// "", "", //Qt::CTRL+Qt::ALT+Qt::Key_T, Qt::CTRL+Qt::ALT+Qt::Key_T,
-// Global::bnpView, SLOT(addNoteText()), true, true );
+// "", "", //TQt::CTRL+TQt::ALT+TQt::Key_T, TQt::CTRL+TQt::ALT+TQt::Key_T,
+// TQT_TQOBJECT(Global::bnpView), TQT_SLOT(addNoteText()), true, true );
globalAccel->insert( "global_note_add_html", i18n("Insert text note"),
i18n("Add a text note to the current basket without having to open the main window."),
- Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_T, Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_T, //"", "",
- Global::bnpView, SLOT(addNoteHtml()), true, true );
+ TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_T, TQt::CTRL + TQt::ALT + TQt::SHIFT + TQt::Key_T, //"", "",
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(addNoteHtml()), true, true );
globalAccel->insert( "global_note_add_image", i18n("Insert image note"),
i18n("Add an image note to the current basket without having to open the main window."),
"", "",
- Global::bnpView, SLOT(addNoteImage()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(addNoteImage()), true, true );
globalAccel->insert( "global_note_add_link", i18n("Insert link note"),
i18n("Add a link note to the current basket without having to open the main window."),
"", "",
- Global::bnpView, SLOT(addNoteLink()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(addNoteLink()), true, true );
globalAccel->insert( "global_note_add_color", i18n("Insert color note"),
i18n("Add a color note to the current basket without having to open the main window."),
"", "",
- Global::bnpView, SLOT(addNoteColor()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(addNoteColor()), true, true );
globalAccel->insert( "global_note_pick_color", i18n("Pick color from screen"),
i18n("Add a color note picked from one pixel on screen to the current basket without "
"having to open the main window."),
"", "",
- Global::bnpView, SLOT(slotColorFromScreenGlobal()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(slotColorFromScreenGlobal()), true, true );
globalAccel->insert( "global_note_grab_screenshot", i18n("Grab screen zone"),
i18n("Grab a screen zone as an image in the current basket without "
"having to open the main window."),
"", "",
- Global::bnpView, SLOT(grabScreenshotGlobal()), true, true );
+ TQT_TQOBJECT(Global::bnpView), TQT_SLOT(grabScreenshotGlobal()), true, true );
globalAccel->readSettings();
globalAccel->updateConnections();
}
@@ -339,14 +339,14 @@ void BNPView::initialize()
/// Configure the List View Columns:
m_tree = new BasketTreeListView(this);
m_tree->addColumn(i18n("Baskets"));
- m_tree->setColumnWidthMode(0, QListView::Maximum);
+ m_tree->setColumnWidthMode(0, TQListView::Maximum);
m_tree->setFullWidth(true);
m_tree->setSorting(-1/*Disabled*/);
m_tree->setRootIsDecorated(true);
m_tree->setTreeStepSize(16);
m_tree->setLineWidth(1);
m_tree->setMidLineWidth(0);
- m_tree->setFocusPolicy(QWidget::NoFocus);
+ m_tree->setFocusPolicy(TQ_NoFocus);
/// Configure the List View Drag and Drop:
m_tree->setDragEnabled(true);
@@ -357,38 +357,38 @@ void BNPView::initialize()
m_tree->setDropHighlighter(true);
/// Configure the Splitter:
- m_stack = new QWidgetStack(this);
+ m_stack = new TQWidgetStack(this);
setOpaqueResize(true);
setCollapsible(m_tree, true);
setCollapsible(m_stack, false);
- setResizeMode(m_tree, QSplitter::KeepSize);
- setResizeMode(m_stack, QSplitter::Stretch);
+ setResizeMode(m_tree, TQSplitter::KeepSize);
+ setResizeMode(m_stack, TQSplitter::Stretch);
/// Configure the List View Signals:
- connect( m_tree, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(slotPressed(QListViewItem*)) );
- connect( m_tree, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotPressed(QListViewItem*)) );
- connect( m_tree, SIGNAL(pressed(QListViewItem*)), this, SLOT(slotPressed(QListViewItem*)) );
- connect( m_tree, SIGNAL(expanded(QListViewItem*)), this, SLOT(needSave(QListViewItem*)) );
- connect( m_tree, SIGNAL(collapsed(QListViewItem*)), this, SLOT(needSave(QListViewItem*)) );
- connect( m_tree, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) );
- connect( m_tree, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)), this, SLOT(slotMouseButtonPressed(int, QListViewItem*, const QPoint&, int)) );
- connect( m_tree, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)), this, SLOT(slotShowProperties(QListViewItem*, const QPoint&, int)) );
-
- connect( m_tree, SIGNAL(expanded(QListViewItem*)), this, SIGNAL(basketChanged()) );
- connect( m_tree, SIGNAL(collapsed(QListViewItem*)), this, SIGNAL(basketChanged()) );
- connect( this, SIGNAL(basketNumberChanged(int)), this, SIGNAL(basketChanged()) );
-
- connect( this, SIGNAL(basketNumberChanged(int)), this, SLOT(slotBasketNumberChanged(int)) );
- connect( this, SIGNAL(basketChanged()), this, SLOT(slotBasketChanged()) );
+ connect( m_tree, TQT_SIGNAL(returnPressed(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(slotPressed(TQListViewItem*)) );
+ connect( m_tree, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(slotPressed(TQListViewItem*)) );
+ connect( m_tree, TQT_SIGNAL(pressed(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(slotPressed(TQListViewItem*)) );
+ connect( m_tree, TQT_SIGNAL(expanded(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(needSave(TQListViewItem*)) );
+ connect( m_tree, TQT_SIGNAL(collapsed(TQListViewItem*)), TQT_TQOBJECT(this), TQT_SLOT(needSave(TQListViewItem*)) );
+ connect( m_tree, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)) );
+ connect( m_tree, TQT_SIGNAL(mouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)), TQT_TQOBJECT(this), TQT_SLOT(slotMouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)) );
+ connect( m_tree, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)), TQT_TQOBJECT(this), TQT_SLOT(slotShowProperties(TQListViewItem*, const TQPoint&, int)) );
+
+ connect( m_tree, TQT_SIGNAL(expanded(TQListViewItem*)), this, TQT_SIGNAL(basketChanged()) );
+ connect( m_tree, TQT_SIGNAL(collapsed(TQListViewItem*)), this, TQT_SIGNAL(basketChanged()) );
+ connect( this, TQT_SIGNAL(basketNumberChanged(int)), this, TQT_SIGNAL(basketChanged()) );
+
+ connect( this, TQT_SIGNAL(basketNumberChanged(int)), TQT_TQOBJECT(this), TQT_SLOT(slotBasketNumberChanged(int)) );
+ connect( this, TQT_SIGNAL(basketChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotBasketChanged()) );
/* LikeBack */
Global::likeBack = new LikeBack(LikeBack::AllButtons, /*showBarByDefault=*/false, Global::config(), Global::about());
Global::likeBack->setServer("basket.linux62.org", "/likeback/send.php");
// There are too much comments, and people reading comments are more and more international, so we accept only English:
-// Global::likeBack->setAcceptedLanguages(QStringList::split(";", "en;fr"), i18n("Please write in English or French."));
+// Global::likeBack->setAcceptedLanguages(TQStringList::split(";", "en;fr"), i18n("Please write in English or French."));
// if (isPart())
// Global::likeBack->disableBar(); // See BNPView::shown() and BNPView::hide().
@@ -397,7 +397,7 @@ void BNPView::initialize()
setupActions();
/// What's This Help for the tree:
- QWhatsThis::add(m_tree, i18n(
+ TQWhatsThis::add(m_tree, i18n(
"<h2>Basket Tree</h2>"
"Here is the list of your baskets. "
"You can organize your data by putting them in different baskets. "
@@ -410,91 +410,91 @@ void BNPView::initialize()
void BNPView::setupActions()
{
m_actSaveAsArchive = new KAction( i18n("&Basket Archive..."), "baskets", 0,
- this, SLOT(saveAsArchive()), actionCollection(), "basket_export_basket_archive" );
+ TQT_TQOBJECT(this), TQT_SLOT(saveAsArchive()), actionCollection(), "basket_export_basket_archive" );
m_actOpenArchive = new KAction( i18n("&Basket Archive..."), "baskets", 0,
- this, SLOT(openArchive()), actionCollection(), "basket_import_basket_archive" );
+ TQT_TQOBJECT(this), TQT_SLOT(openArchive()), actionCollection(), "basket_import_basket_archive" );
m_actHideWindow = new KAction( i18n("&Hide Window"), "", KStdAccel::shortcut(KStdAccel::Close),
- this, SLOT(hideOnEscape()), actionCollection(), "window_hide" );
+ TQT_TQOBJECT(this), TQT_SLOT(hideOnEscape()), actionCollection(), "window_hide" );
m_actHideWindow->setEnabled(Settings::useSystray()); // Init here !
m_actExportToHtml = new KAction( i18n("&HTML Web Page..."), "html", 0,
- this, SLOT(exportToHTML()), actionCollection(), "basket_export_html" );
+ TQT_TQOBJECT(this), TQT_SLOT(exportToHTML()), actionCollection(), "basket_export_html" );
new KAction( i18n("K&Notes"), "knotes", 0,
- this, SLOT(importKNotes()), actionCollection(), "basket_import_knotes" );
+ TQT_TQOBJECT(this), TQT_SLOT(importKNotes()), actionCollection(), "basket_import_knotes" );
new KAction( i18n("K&Jots"), "kjots", 0,
- this, SLOT(importKJots()), actionCollection(), "basket_import_kjots" );
+ TQT_TQOBJECT(this), TQT_SLOT(importKJots()), actionCollection(), "basket_import_kjots" );
new KAction( i18n("&KnowIt..."), "knowit", 0,
- this, SLOT(importKnowIt()), actionCollection(), "basket_import_knowit" );
+ TQT_TQOBJECT(this), TQT_SLOT(importKnowIt()), actionCollection(), "basket_import_knowit" );
new KAction( i18n("Tux&Cards..."), "tuxcards", 0,
- this, SLOT(importTuxCards()), actionCollection(), "basket_import_tuxcards" );
+ TQT_TQOBJECT(this), TQT_SLOT(importTuxCards()), actionCollection(), "basket_import_tuxcards" );
new KAction( i18n("&Sticky Notes"), "gnome", 0,
- this, SLOT(importStickyNotes()), actionCollection(), "basket_import_sticky_notes" );
+ TQT_TQOBJECT(this), TQT_SLOT(importStickyNotes()), actionCollection(), "basket_import_sticky_notes" );
new KAction( i18n("&Tomboy"), "tintin", 0,
- this, SLOT(importTomboy()), actionCollection(), "basket_import_tomboy" );
+ TQT_TQOBJECT(this), TQT_SLOT(importTomboy()), actionCollection(), "basket_import_tomboy" );
new KAction( i18n("Text &File..."), "txt", 0,
- this, SLOT(importTextFile()), actionCollection(), "basket_import_text_file" );
+ TQT_TQOBJECT(this), TQT_SLOT(importTextFile()), actionCollection(), "basket_import_text_file" );
new KAction( i18n("&Backup && Restore..."), "", 0,
- this, SLOT(backupRestore()), actionCollection(), "basket_backup_restore" );
+ TQT_TQOBJECT(this), TQT_SLOT(backupRestore()), actionCollection(), "basket_backup_restore" );
/** Note : ****************************************************************/
m_actDelNote = new KAction( i18n("D&elete"), "editdelete", "Delete",
- this, SLOT(delNote()), actionCollection(), "edit_delete" );
- m_actCutNote = KStdAction::cut( this, SLOT(cutNote()), actionCollection() );
- m_actCopyNote = KStdAction::copy( this, SLOT(copyNote()), actionCollection() );
+ TQT_TQOBJECT(this), TQT_SLOT(delNote()), actionCollection(), "edit_delete" );
+ m_actCutNote = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT(cutNote()), actionCollection() );
+ m_actCopyNote = KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT(copyNote()), actionCollection() );
- m_actSelectAll = KStdAction::selectAll( this, SLOT( slotSelectAll() ), actionCollection() );
+ m_actSelectAll = KStdAction::selectAll( TQT_TQOBJECT(this), TQT_SLOT( slotSelectAll() ), actionCollection() );
m_actSelectAll->setStatusText( i18n( "Selects all notes" ) );
- m_actUnselectAll = new KAction( i18n( "U&nselect All" ), "", this, SLOT( slotUnselectAll() ),
+ m_actUnselectAll = new KAction( i18n( "U&nselect All" ), "", TQT_TQOBJECT(this), TQT_SLOT( slotUnselectAll() ),
actionCollection(), "edit_unselect_all" );
m_actUnselectAll->setStatusText( i18n( "Unselects all selected notes" ) );
m_actInvertSelection = new KAction( i18n( "&Invert Selection" ), CTRL+Key_Asterisk,
- this, SLOT( slotInvertSelection() ),
+ TQT_TQOBJECT(this), TQT_SLOT( slotInvertSelection() ),
actionCollection(), "edit_invert_selection" );
m_actInvertSelection->setStatusText( i18n( "Inverts the current selection of notes" ) );
m_actEditNote = new KAction( i18n("Verb; not Menu", "&Edit..."), "edit", "Return",
- this, SLOT(editNote()), actionCollection(), "note_edit" );
+ TQT_TQOBJECT(this), TQT_SLOT(editNote()), actionCollection(), "note_edit" );
- m_actOpenNote = KStdAction::open( this, SLOT(openNote()), actionCollection(), "note_open" );
+ m_actOpenNote = KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT(openNote()), actionCollection(), "note_open" );
m_actOpenNote->setIcon("window_new");
m_actOpenNote->setText(i18n("&Open"));
m_actOpenNote->setShortcut("F9");
m_actOpenNoteWith = new KAction( i18n("Open &With..."), "", "Shift+F9",
- this, SLOT(openNoteWith()), actionCollection(), "note_open_with" );
- m_actSaveNoteAs = KStdAction::saveAs( this, SLOT(saveNoteAs()), actionCollection(), "note_save_to_file" );
+ TQT_TQOBJECT(this), TQT_SLOT(openNoteWith()), actionCollection(), "note_open_with" );
+ m_actSaveNoteAs = KStdAction::saveAs( TQT_TQOBJECT(this), TQT_SLOT(saveNoteAs()), actionCollection(), "note_save_to_file" );
m_actSaveNoteAs->setIcon("");
m_actSaveNoteAs->setText(i18n("&Save to File..."));
m_actSaveNoteAs->setShortcut("F10");
m_actGroup = new KAction( i18n("&Group"), "attach", "Ctrl+G",
- this, SLOT(noteGroup()), actionCollection(), "note_group" );
+ TQT_TQOBJECT(this), TQT_SLOT(noteGroup()), actionCollection(), "note_group" );
m_actUngroup = new KAction( i18n("U&ngroup"), "", "Ctrl+Shift+G",
- this, SLOT(noteUngroup()), actionCollection(), "note_ungroup" );
+ TQT_TQOBJECT(this), TQT_SLOT(noteUngroup()), actionCollection(), "note_ungroup" );
m_actMoveOnTop = new KAction( i18n("Move on &Top"), "2uparrow", "Ctrl+Shift+Home",
- this, SLOT(moveOnTop()), actionCollection(), "note_move_top" );
+ TQT_TQOBJECT(this), TQT_SLOT(moveOnTop()), actionCollection(), "note_move_top" );
m_actMoveNoteUp = new KAction( i18n("Move &Up"), "1uparrow", "Ctrl+Shift+Up",
- this, SLOT(moveNoteUp()), actionCollection(), "note_move_up" );
+ TQT_TQOBJECT(this), TQT_SLOT(moveNoteUp()), actionCollection(), "note_move_up" );
m_actMoveNoteDown = new KAction( i18n("Move &Down"), "1downarrow", "Ctrl+Shift+Down",
- this, SLOT(moveNoteDown()), actionCollection(), "note_move_down" );
+ TQT_TQOBJECT(this), TQT_SLOT(moveNoteDown()), actionCollection(), "note_move_down" );
m_actMoveOnBottom = new KAction( i18n("Move on &Bottom"), "2downarrow", "Ctrl+Shift+End",
- this, SLOT(moveOnBottom()), actionCollection(), "note_move_bottom" );
+ TQT_TQOBJECT(this), TQT_SLOT(moveOnBottom()), actionCollection(), "note_move_bottom" );
#if KDE_IS_VERSION( 3, 1, 90 ) // KDE 3.2.x
- m_actPaste = KStdAction::pasteText( this, SLOT(pasteInCurrentBasket()), actionCollection() );
+ m_actPaste = KStdAction::pasteText( TQT_TQOBJECT(this), TQT_SLOT(pasteInCurrentBasket()), actionCollection() );
#else
- m_actPaste = KStdAction::paste( this, SLOT(pasteInCurrentBasket()), actionCollection() );
+ m_actPaste = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT(pasteInCurrentBasket()), actionCollection() );
#endif
/** Insert : **************************************************************/
- QSignalMapper *insertEmptyMapper = new QSignalMapper(this);
- QSignalMapper *insertWizardMapper = new QSignalMapper(this);
- connect( insertEmptyMapper, SIGNAL(mapped(int)), this, SLOT(insertEmpty(int)) );
- connect( insertWizardMapper, SIGNAL(mapped(int)), this, SLOT(insertWizard(int)) );
+ TQSignalMapper *insertEmptyMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ TQSignalMapper *insertWizardMapper = new TQSignalMapper(TQT_TQOBJECT(this));
+ connect( insertEmptyMapper, TQT_SIGNAL(mapped(int)), TQT_TQOBJECT(this), TQT_SLOT(insertEmpty(int)) );
+ connect( insertWizardMapper, TQT_SIGNAL(mapped(int)), TQT_TQOBJECT(this), TQT_SLOT(insertWizard(int)) );
// m_actInsertText = new KAction( i18n("Plai&n Text"), "text", "Ctrl+T", actionCollection(), "insert_text" );
m_actInsertHtml = new KAction( i18n("&Text"), "html", "Insert", actionCollection(), "insert_html" );
@@ -507,12 +507,12 @@ void BNPView::setupActions()
m_actImportIcon = new KAction( i18n("Im&port Icon..."), "icons", "", actionCollection(), "insert_icon" );
m_actLoadFile = new KAction( i18n("Load From &File..."), "fileimport", "", actionCollection(), "insert_from_file" );
-// connect( m_actInsertText, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
- connect( m_actInsertHtml, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
- connect( m_actInsertImage, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
- connect( m_actInsertLink, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
- connect( m_actInsertColor, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
- connect( m_actInsertLauncher, SIGNAL(activated()), insertEmptyMapper, SLOT(map()) );
+// connect( m_actInsertText, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
+ connect( m_actInsertHtml, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
+ connect( m_actInsertImage, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
+ connect( m_actInsertLink, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
+ connect( m_actInsertColor, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
+ connect( m_actInsertLauncher, TQT_SIGNAL(activated()), insertEmptyMapper, TQT_SLOT(map()) );
// insertEmptyMapper->setMapping(m_actInsertText, NoteType::Text );
insertEmptyMapper->setMapping(m_actInsertHtml, NoteType::Html );
insertEmptyMapper->setMapping(m_actInsertImage, NoteType::Image );
@@ -520,23 +520,23 @@ void BNPView::setupActions()
insertEmptyMapper->setMapping(m_actInsertColor, NoteType::Color );
insertEmptyMapper->setMapping(m_actInsertLauncher, NoteType::Launcher);
- connect( m_actImportKMenu, SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
- connect( m_actImportIcon, SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
- connect( m_actLoadFile, SIGNAL(activated()), insertWizardMapper, SLOT(map()) );
+ connect( m_actImportKMenu, TQT_SIGNAL(activated()), insertWizardMapper, TQT_SLOT(map()) );
+ connect( m_actImportIcon, TQT_SIGNAL(activated()), insertWizardMapper, TQT_SLOT(map()) );
+ connect( m_actLoadFile, TQT_SIGNAL(activated()), insertWizardMapper, TQT_SLOT(map()) );
insertWizardMapper->setMapping(m_actImportKMenu, 1 );
insertWizardMapper->setMapping(m_actImportIcon, 2 );
insertWizardMapper->setMapping(m_actLoadFile, 3 );
m_colorPicker = new DesktopColorPicker();
m_actColorPicker = new KAction( i18n("C&olor from Screen"), "kcolorchooser", "",
- this, SLOT(slotColorFromScreen()), actionCollection(), "insert_screen_color" );
- connect( m_colorPicker, SIGNAL(pickedColor(const QColor&)), this, SLOT(colorPicked(const QColor&)) );
- connect( m_colorPicker, SIGNAL(canceledPick()), this, SLOT(colorPickingCanceled()) );
+ TQT_TQOBJECT(this), TQT_SLOT(slotColorFromScreen()), actionCollection(), "insert_screen_color" );
+ connect( m_colorPicker, TQT_SIGNAL(pickedColor(const TQColor&)), TQT_TQOBJECT(this), TQT_SLOT(colorPicked(const TQColor&)) );
+ connect( m_colorPicker, TQT_SIGNAL(canceledPick()), TQT_TQOBJECT(this), TQT_SLOT(colorPickingCanceled()) );
m_actGrabScreenshot = new KAction( i18n("Grab Screen &Zone"), "ksnapshot", "",
- this, SLOT(grabScreenshot()), actionCollection(), "insert_screen_capture" );
- //connect( m_actGrabScreenshot, SIGNAL(regionGrabbed(const QPixmap&)), this, SLOT(screenshotGrabbed(const QPixmap&)) );
- //connect( m_colorPicker, SIGNAL(canceledPick()), this, SLOT(colorPickingCanceled()) );
+ TQT_TQOBJECT(this), TQT_SLOT(grabScreenshot()), actionCollection(), "insert_screen_capture" );
+ //connect( m_actGrabScreenshot, TQT_SIGNAL(regionGrabbed(const TQPixmap&)), TQT_TQOBJECT(this), TQT_SLOT(screenshotGrabbed(const TQPixmap&)) );
+ //connect( m_colorPicker, TQT_SIGNAL(canceledPick()), TQT_TQOBJECT(this), TQT_SLOT(colorPickingCanceled()) );
// m_insertActions.append( m_actInsertText );
m_insertActions.append( m_actInsertHtml );
@@ -555,101 +555,101 @@ void BNPView::setupActions()
// At this stage, main.cpp has not set kapp->mainWidget(), so Global::runInsideKontact()
// returns true. We do it ourself:
bool runInsideKontact = true;
- QWidget *parentWidget = (QWidget*) parent();
- while (parentWidget) {
- if (parentWidget->inherits("MainWindow"))
+ TQWidget *tqparentWidget = (TQWidget*) tqparent();
+ while (tqparentWidget) {
+ if (tqparentWidget->inherits("MainWindow"))
runInsideKontact = false;
- parentWidget = (QWidget*) parentWidget->parent();
+ tqparentWidget = (TQWidget*) tqparentWidget->tqparent();
}
// Use the "basket" incon in Kontact so it is consistent with the Kontact "New..." icon
actNewBasket = new KAction( i18n("&New Basket..."), (runInsideKontact ? "basket" : "filenew"), KStdAccel::shortcut(KStdAccel::New),
- this, SLOT(askNewBasket()), actionCollection(), "basket_new" );
+ TQT_TQOBJECT(this), TQT_SLOT(askNewBasket()), actionCollection(), "basket_new" );
actNewSubBasket = new KAction( i18n("New &Sub-Basket..."), "", "Ctrl+Shift+N",
- this, SLOT(askNewSubBasket()), actionCollection(), "basket_new_sub" );
+ TQT_TQOBJECT(this), TQT_SLOT(askNewSubBasket()), actionCollection(), "basket_new_sub" );
actNewSiblingBasket = new KAction( i18n("New Si&bling Basket..."), "", "",
- this, SLOT(askNewSiblingBasket()), actionCollection(), "basket_new_sibling" );
+ TQT_TQOBJECT(this), TQT_SLOT(askNewSiblingBasket()), actionCollection(), "basket_new_sibling" );
KActionMenu *newBasketMenu = new KActionMenu(i18n("&New"), "filenew", actionCollection(), "basket_new_menu");
newBasketMenu->insert(actNewBasket);
newBasketMenu->insert(actNewSubBasket);
newBasketMenu->insert(actNewSiblingBasket);
- connect( newBasketMenu, SIGNAL(activated()), this, SLOT(askNewBasket()) );
+ connect( newBasketMenu, TQT_SIGNAL(activated()), TQT_TQOBJECT(this), TQT_SLOT(askNewBasket()) );
m_actPropBasket = new KAction( i18n("&Properties..."), "misc", "F2",
- this, SLOT(propBasket()), actionCollection(), "basket_properties" );
+ TQT_TQOBJECT(this), TQT_SLOT(propBasket()), actionCollection(), "basket_properties" );
m_actDelBasket = new KAction( i18n("Remove Basket", "&Remove"), "", 0,
- this, SLOT(delBasket()), actionCollection(), "basket_remove" );
+ TQT_TQOBJECT(this), TQT_SLOT(delBasket()), actionCollection(), "basket_remove" );
#ifdef HAVE_LIBGPGME
m_actPassBasket = new KAction( i18n("Password protection", "Pass&word..."), "", 0,
- this, SLOT(password()), actionCollection(), "basket_password" );
+ TQT_TQOBJECT(this), TQT_SLOT(password()), actionCollection(), "basket_password" );
m_actLockBasket = new KAction( i18n("Lock Basket", "&Lock"), "", "Ctrl+L",
- this, SLOT(lockBasket()), actionCollection(), "basket_lock" );
+ TQT_TQOBJECT(this), TQT_SLOT(lockBasket()), actionCollection(), "basket_lock" );
#endif
/** Edit : ****************************************************************/
- //m_actUndo = KStdAction::undo( this, SLOT(undo()), actionCollection() );
+ //m_actUndo = KStdAction::undo( TQT_TQOBJECT(this), TQT_SLOT(undo()), actionCollection() );
//m_actUndo->setEnabled(false); // Not yet implemented !
- //m_actRedo = KStdAction::redo( this, SLOT(redo()), actionCollection() );
+ //m_actRedo = KStdAction::redo( TQT_TQOBJECT(this), TQT_SLOT(redo()), actionCollection() );
//m_actRedo->setEnabled(false); // Not yet implemented !
m_actShowFilter = new KToggleAction( i18n("&Filter"), "filter", KStdAccel::shortcut(KStdAccel::Find),
actionCollection(), "edit_filter" );
- connect( m_actShowFilter, SIGNAL(toggled(bool)), this, SLOT(showHideFilterBar(bool)) );
+ connect( m_actShowFilter, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(showHideFilterBar(bool)) );
- m_actFilterAllBaskets = new KToggleAction( i18n("Filter all &Baskets"), "find", "Ctrl+Shift+F",
+ m_actFilterAllBaskets = new KToggleAction( i18n("Filter all &Baskets"), "tqfind", "Ctrl+Shift+F",
actionCollection(), "edit_filter_all_baskets" );
- connect( m_actFilterAllBaskets, SIGNAL(toggled(bool)), this, SLOT(toggleFilterAllBaskets(bool)) );
+ connect( m_actFilterAllBaskets, TQT_SIGNAL(toggled(bool)), TQT_TQOBJECT(this), TQT_SLOT(toggleFilterAllBaskets(bool)) );
m_actResetFilter = new KAction( i18n( "&Reset Filter" ), "locationbar_erase", "Ctrl+R",
- this, SLOT( slotResetFilter() ), actionCollection(), "edit_filter_reset" );
+ TQT_TQOBJECT(this), TQT_SLOT( slotResetFilter() ), actionCollection(), "edit_filter_reset" );
/** Go : ******************************************************************/
m_actPreviousBasket = new KAction( i18n( "&Previous Basket" ), "up", "Alt+Up",
- this, SLOT(goToPreviousBasket()), actionCollection(), "go_basket_previous" );
+ TQT_TQOBJECT(this), TQT_SLOT(goToPreviousBasket()), actionCollection(), "go_basket_previous" );
m_actNextBasket = new KAction( i18n( "&Next Basket" ), "down", "Alt+Down",
- this, SLOT(goToNextBasket()), actionCollection(), "go_basket_next" );
+ TQT_TQOBJECT(this), TQT_SLOT(goToNextBasket()), actionCollection(), "go_basket_next" );
m_actFoldBasket = new KAction( i18n( "&Fold Basket" ), "back", "Alt+Left",
- this, SLOT(foldBasket()), actionCollection(), "go_basket_fold" );
+ TQT_TQOBJECT(this), TQT_SLOT(foldBasket()), actionCollection(), "go_basket_fold" );
m_actExpandBasket = new KAction( i18n( "&Expand Basket" ), "forward", "Alt+Right",
- this, SLOT(expandBasket()), actionCollection(), "go_basket_expand" );
+ TQT_TQOBJECT(this), TQT_SLOT(expandBasket()), actionCollection(), "go_basket_expand" );
// FOR_BETA_PURPOSE:
// m_convertTexts = new KAction( i18n("Convert text notes to rich text notes"), "compfile", "",
-// this, SLOT(convertTexts()), actionCollection(), "beta_convert_texts" );
+// TQT_TQOBJECT(this), TQT_SLOT(convertTexts()), actionCollection(), "beta_convert_texts" );
InlineEditors::instance()->initToolBars(actionCollection());
- actConfigGlobalShortcuts = KStdAction::keyBindings(this, SLOT(showGlobalShortcutsSettingsDialog()),
+ actConfigGlobalShortcuts = KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(showGlobalShortcutsSettingsDialog()),
actionCollection(), "options_configure_global_keybinding");
actConfigGlobalShortcuts->setText(i18n("Configure &Global Shortcuts..."));
/** Help : ****************************************************************/
- new KAction( i18n("&Welcome Baskets"), "", "", this, SLOT(addWelcomeBaskets()), actionCollection(), "help_welcome_baskets" );
+ new KAction( i18n("&Welcome Baskets"), "", "", TQT_TQOBJECT(this), TQT_SLOT(addWelcomeBaskets()), actionCollection(), "help_welcome_baskets" );
}
-QListViewItem* BNPView::firstListViewItem()
+TQListViewItem* BNPView::firstListViewItem()
{
return m_tree->firstChild();
}
-void BNPView::slotShowProperties(QListViewItem *item, const QPoint&, int)
+void BNPView::slotShowProperties(TQListViewItem *item, const TQPoint&, int)
{
if (item)
propBasket();
}
-void BNPView::slotMouseButtonPressed(int button, QListViewItem *item, const QPoint &/*pos*/, int /*column*/)
+void BNPView::slotMouseButtonPressed(int button, TQListViewItem *item, const TQPoint &/*pos*/, int /*column*/)
{
if (item && (button & Qt::MidButton)) {
// TODO: Paste into ((BasketListViewItem*)listViewItem)->basket()
}
}
-void BNPView::slotContextMenu(KListView */*listView*/, QListViewItem *item, const QPoint &pos)
+void BNPView::slotContextMenu(KListView */*listView*/, TQListViewItem *item, const TQPoint &pos)
{
- QString menuName;
+ TQString menuName;
if (item) {
Basket* basket = ((BasketListViewItem*)item)->basket();
@@ -658,17 +658,17 @@ void BNPView::slotContextMenu(KListView */*listView*/, QListViewItem *item, cons
} else {
menuName = "tab_bar_popup";
/*
- * "File -> New" create a new basket with the same parent basket as the the current one.
+ * "File -> New" create a new basket with the same tqparent basket as the the current one.
* But when invoked when right-clicking the empty area at the bottom of the basket tree,
- * it is obvious the user want to create a new basket at the bottom of the tree (with no parent).
+ * it is obvious the user want to create a new basket at the bottom of the tree (with no tqparent).
* So we set a temporary variable during the time the popup menu is shown,
* so the slot askNewBasket() will do the right thing:
*/
setNewBasketPopup();
}
- QPopupMenu *menu = popupMenu(menuName);
- connect( menu, SIGNAL(aboutToHide()), this, SLOT(aboutToHideNewBasketPopup()) );
+ TQPopupMenu *menu = popupMenu(menuName);
+ connect( menu, TQT_SIGNAL(aboutToHide()), TQT_TQOBJECT(this), TQT_SLOT(aboutToHideNewBasketPopup()) );
menu->exec(pos);
}
@@ -677,8 +677,8 @@ void BNPView::save()
DEBUG_WIN << "Basket Tree: Saving...";
// Create Document:
- QDomDocument document("basketTree");
- QDomElement root = document.createElement("basketTree");
+ TQDomDocument document("basketTree");
+ TQDomElement root = document.createElement("basketTree");
document.appendChild(root);
// Save Basket Tree:
@@ -686,26 +686,26 @@ void BNPView::save()
// Write to Disk:
Basket::safelySaveToFile(Global::basketsFolder() + "baskets.xml", "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" + document.toString());
-// QFile file(Global::basketsFolder() + "baskets.xml");
+// TQFile file(Global::basketsFolder() + "baskets.xml");
// if (file.open(IO_WriteOnly)) {
-// QTextStream stream(&file);
-// stream.setEncoding(QTextStream::UnicodeUTF8);
-// QString xml = document.toString();
+// TQTextStream stream(&file);
+// stream.setEncoding(TQTextStream::UnicodeUTF8);
+// TQString xml = document.toString();
// stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
// stream << xml;
// file.close();
// }
}
-void BNPView::save(QListViewItem *firstItem, QDomDocument &document, QDomElement &parentElement)
+void BNPView::save(TQListViewItem *firstItem, TQDomDocument &document, TQDomElement &tqparentElement)
{
- QListViewItem *item = firstItem;
+ TQListViewItem *item = firstItem;
while (item) {
// Basket *basket = ((BasketListViewItem*)item)->basket();
- QDomElement basketElement = this->basketElement(item, document, parentElement);
+ TQDomElement basketElement = this->basketElement(item, document, tqparentElement);
/*
- QDomElement basketElement = document.createElement("basket");
- parentElement.appendChild(basketElement);
+ TQDomElement basketElement = document.createElement("basket");
+ tqparentElement.appendChild(basketElement);
// Save Attributes:
basketElement.setAttribute("folderName", basket->folderName());
if (item->firstChild()) // If it can be expanded/folded:
@@ -713,7 +713,7 @@ void BNPView::save(QListViewItem *firstItem, QDomDocument &document, QDomElement
if (((BasketListViewItem*)item)->isCurrentBasket())
basketElement.setAttribute("lastOpened", "true");
// Save Properties:
- QDomElement properties = document.createElement("properties");
+ TQDomElement properties = document.createElement("properties");
basketElement.appendChild(properties);
basket->saveProperties(document, properties);
*/
@@ -725,11 +725,11 @@ void BNPView::save(QListViewItem *firstItem, QDomDocument &document, QDomElement
}
}
-QDomElement BNPView::basketElement(QListViewItem *item, QDomDocument &document, QDomElement &parentElement)
+TQDomElement BNPView::basketElement(TQListViewItem *item, TQDomDocument &document, TQDomElement &tqparentElement)
{
Basket *basket = ((BasketListViewItem*)item)->basket();
- QDomElement basketElement = document.createElement("basket");
- parentElement.appendChild(basketElement);
+ TQDomElement basketElement = document.createElement("basket");
+ tqparentElement.appendChild(basketElement);
// Save Attributes:
basketElement.setAttribute("folderName", basket->folderName());
if (item->firstChild()) // If it can be expanded/folded:
@@ -737,40 +737,40 @@ QDomElement BNPView::basketElement(QListViewItem *item, QDomDocument &document,
if (((BasketListViewItem*)item)->isCurrentBasket())
basketElement.setAttribute("lastOpened", "true");
// Save Properties:
- QDomElement properties = document.createElement("properties");
+ TQDomElement properties = document.createElement("properties");
basketElement.appendChild(properties);
basket->saveProperties(document, properties);
return basketElement;
}
-void BNPView::saveSubHierarchy(QListViewItem *item, QDomDocument &document, QDomElement &parentElement, bool recursive)
+void BNPView::saveSubHierarchy(TQListViewItem *item, TQDomDocument &document, TQDomElement &tqparentElement, bool recursive)
{
- QDomElement element = basketElement(item, document, parentElement);
+ TQDomElement element = basketElement(item, document, tqparentElement);
if (recursive && item->firstChild())
save(item->firstChild(), document, element);
}
void BNPView::load()
{
- QDomDocument *doc = XMLWork::openFile("basketTree", Global::basketsFolder() + "baskets.xml");
+ TQDomDocument *doc = XMLWork::openFile("basketTree", Global::basketsFolder() + "baskets.xml");
//BEGIN Compatibility with 0.6.0 Pre-Alpha versions:
if (!doc)
doc = XMLWork::openFile("basketsTree", Global::basketsFolder() + "baskets.xml");
//END
if (doc != 0) {
- QDomElement docElem = doc->documentElement();
+ TQDomElement docElem = doc->documentElement();
load(m_tree, 0L, docElem);
}
m_loading = false;
}
-void BNPView::load(KListView */*listView*/, QListViewItem *item, const QDomElement &baskets)
+void BNPView::load(KListView */*listView*/, TQListViewItem *item, const TQDomElement &baskets)
{
- QDomNode n = baskets.firstChild();
+ TQDomNode n = baskets.firstChild();
while ( ! n.isNull() ) {
- QDomElement element = n.toElement();
+ TQDomElement element = n.toElement();
if ( (!element.isNull()) && element.tagName() == "basket" ) {
- QString folderName = element.attribute("folderName");
+ TQString folderName = element.attribute("folderName");
if (!folderName.isEmpty()) {
Basket *basket = loadBasket(folderName);
BasketListViewItem *basketItem = appendBasket(basket, item);
@@ -779,14 +779,14 @@ void BNPView::load(KListView */*listView*/, QListViewItem *item, const QDomEleme
if (XMLWork::trueOrFalse(element.attribute("lastOpened", element.attribute("lastOpenned", "false")), false)) // Compat with 0.6.0-Alphas
setCurrentBasket(basket);
// Load Sub-baskets:
- load(/*(QListView*)*/0L, basketItem, element);
+ load(/*(TQListView*)*/0L, basketItem, element);
}
}
n = n.nextSibling();
}
}
-Basket* BNPView::loadBasket(const QString &folderName)
+Basket* BNPView::loadBasket(const TQString &folderName)
{
if (folderName.isEmpty())
return 0;
@@ -794,20 +794,20 @@ Basket* BNPView::loadBasket(const QString &folderName)
DecoratedBasket *decoBasket = new DecoratedBasket(m_stack, folderName);
Basket *basket = decoBasket->basket();
m_stack->addWidget(decoBasket);
- connect( basket, SIGNAL(countsChanged(Basket*)), this, SLOT(countsChanged(Basket*)) );
+ connect( basket, TQT_SIGNAL(countsChanged(Basket*)), TQT_TQOBJECT(this), TQT_SLOT(countsChanged(Basket*)) );
// Important: Create listViewItem and connect signal BEFORE loadProperties(), so we get the listViewItem updated without extra work:
- connect( basket, SIGNAL(propertiesChanged(Basket*)), this, SLOT(updateBasketListViewItem(Basket*)) );
+ connect( basket, TQT_SIGNAL(propertiesChanged(Basket*)), TQT_TQOBJECT(this), TQT_SLOT(updateBasketListViewItem(Basket*)) );
- connect( basket->decoration()->filterBar(), SIGNAL(newFilter(const FilterData&)), this, SLOT(newFilterFromFilterBar()) );
+ connect( basket->decoration()->filterBar(), TQT_SIGNAL(newFilter(const FilterData&)), TQT_TQOBJECT(this), TQT_SLOT(newFilterFromFilterBar()) );
return basket;
}
-int BNPView::basketCount(QListViewItem *parent)
+int BNPView::basketCount(TQListViewItem *tqparent)
{
int count = 0;
- QListViewItem *item = (parent ? parent->firstChild() : m_tree->firstChild());
+ TQListViewItem *item = (tqparent ? tqparent->firstChild() : m_tree->firstChild());
while (item) {
count += 1 + basketCount(item);
item = item->nextSibling();
@@ -821,7 +821,7 @@ bool BNPView::canFold()
BasketListViewItem *item = listViewItemForBasket(currentBasket());
if (!item)
return false;
- return item->parent() || (item->firstChild() && item->isOpen());
+ return item->tqparent() || (item->firstChild() && item->isOpen());
}
bool BNPView::canExpand()
@@ -832,14 +832,14 @@ bool BNPView::canExpand()
return item->firstChild();
}
-BasketListViewItem* BNPView::appendBasket(Basket *basket, QListViewItem *parentItem)
+BasketListViewItem* BNPView::appendBasket(Basket *basket, TQListViewItem *tqparentItem)
{
BasketListViewItem *newBasketItem;
- if (parentItem)
- newBasketItem = new BasketListViewItem(parentItem, ((BasketListViewItem*)parentItem)->lastChild(), basket);
+ if (tqparentItem)
+ newBasketItem = new BasketListViewItem(tqparentItem, ((BasketListViewItem*)tqparentItem)->lastChild(), basket);
else {
- QListViewItem *child = m_tree->firstChild();
- QListViewItem *lastChild = 0;
+ TQListViewItem *child = m_tree->firstChild();
+ TQListViewItem *lastChild = 0;
while (child) {
lastChild = child;
child = child->nextSibling();
@@ -852,10 +852,10 @@ BasketListViewItem* BNPView::appendBasket(Basket *basket, QListViewItem *parentI
return newBasketItem;
}
-void BNPView::loadNewBasket(const QString &folderName, const QDomElement &properties, Basket *parent)
+void BNPView::loadNewBasket(const TQString &folderName, const TQDomElement &properties, Basket *tqparent)
{
Basket *basket = loadBasket(folderName);
- appendBasket(basket, (basket ? listViewItemForBasket(parent) : 0));
+ appendBasket(basket, (basket ? listViewItemForBasket(tqparent) : 0));
basket->loadProperties(properties);
setCurrentBasket(basket);
// save();
@@ -863,8 +863,8 @@ void BNPView::loadNewBasket(const QString &folderName, const QDomElement &proper
BasketListViewItem* BNPView::lastListViewItem()
{
- QListViewItem *child = m_tree->firstChild();
- QListViewItem *lastChild = 0;
+ TQListViewItem *child = m_tree->firstChild();
+ TQListViewItem *lastChild = 0;
// Set lastChild to the last primary child of the list view:
while (child) {
lastChild = child;
@@ -922,21 +922,21 @@ void BNPView::foldBasket()
{
BasketListViewItem *item = listViewItemForBasket(currentBasket());
if (item && !item->firstChild())
- item->setOpen(false); // If Alt+Left is hitted and there is nothing to close, make sure the focus will go to the parent basket
+ item->setOpen(false); // If Alt+Left is hitted and there is nothing to close, make sure the focus will go to the tqparent basket
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Left, 0, 0);
- QApplication::postEvent(m_tree, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Left, 0, 0);
+ TQApplication::postEvent(m_tree, keyEvent);
}
void BNPView::expandBasket()
{
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Right, 0, 0);
- QApplication::postEvent(m_tree, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Right, 0, 0);
+ TQApplication::postEvent(m_tree, keyEvent);
}
void BNPView::closeAllEditors()
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = (BasketListViewItem*)(it.current());
item->basket()->closeEditor();
@@ -948,7 +948,7 @@ bool BNPView::convertTexts()
{
bool convertedNotes = false;
KProgressDialog dialog(
- /*parent=*/0,
+ /*tqparent=*/0,
/*name=*/"",
/*caption=*/i18n("Plain Text Notes Conversion"),
/*text=*/i18n("Converting plain text notes to rich text ones..."),
@@ -956,7 +956,7 @@ bool BNPView::convertTexts()
dialog.progressBar()->setTotalSteps(basketCount());
dialog.show(); //setMinimumDuration(50/*ms*/);
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = (BasketListViewItem*)(it.current());
if (item->basket()->convertTexts())
@@ -987,7 +987,7 @@ void BNPView::toggleFilterAllBaskets(bool doFilter)
//currentBasket()->decoration()->filterBar()->setFilterAll(doFilter);
// Basket *current = currentBasket();
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
item->basket()->decoration()->filterBar()->setFilterAll(doFilter);
@@ -1026,7 +1026,7 @@ void BNPView::newFilter()
const FilterData &filterData = current->decoration()->filterBar()->filterData();
// Set the filter data for every other baskets, or reset the filter for every other baskets if we just disabled the filterInAllBaskets:
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
if (item->basket() != current)
@@ -1045,7 +1045,7 @@ void BNPView::newFilter()
// Load every baskets for filtering, if they are not already loaded, and if necessary:
if (filterData.isFiltering) {
Basket *current = currentBasket();
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
if (item->basket() != current) {
@@ -1076,7 +1076,7 @@ void BNPView::newFilter()
void BNPView::newFilterFromFilterBar()
{
if (isFilteringAllBaskets())
- QTimer::singleShot(0, this, SLOT(newFilter())); // Keep time for the QLineEdit to display the filtered character and refresh correctly!
+ TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(newFilter())); // Keep time for the TQLineEdit to display the filtered character and refresh correctly!
}
bool BNPView::isFilteringAllBaskets()
@@ -1087,7 +1087,7 @@ bool BNPView::isFilteringAllBaskets()
BasketListViewItem* BNPView::listViewItemForBasket(Basket *basket)
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
if (item->basket() == basket)
@@ -1106,9 +1106,9 @@ Basket* BNPView::currentBasket()
return 0;
}
-Basket* BNPView::parentBasketOf(Basket *basket)
+Basket* BNPView::tqparentBasketOf(Basket *basket)
{
- BasketListViewItem *item = (BasketListViewItem*)(listViewItemForBasket(basket)->parent());
+ BasketListViewItem *item = (BasketListViewItem*)(listViewItemForBasket(basket)->tqparent());
if (item)
return item->basket();
else
@@ -1134,7 +1134,7 @@ void BNPView::setCurrentBasket(Basket *basket)
// If the window has changed size, only the current basket receive the event,
// the others will receive ony one just before they are shown.
// But this triggers unwanted animations, so we eliminate it:
- basket->relayoutNotes(/*animate=*/false);
+ basket->retqlayoutNotes(/*animate=*/false);
basket->openBasket();
setCaption(item->basket()->basketName());
countsChanged(basket);
@@ -1155,13 +1155,13 @@ void BNPView::removeBasket(Basket *basket)
// Find a new basket to switch to and select it.
// Strategy: get the next sibling, or the previous one if not found.
- // If there is no such one, get the parent basket:
+ // If there is no such one, get the tqparent basket:
BasketListViewItem *basketItem = listViewItemForBasket(basket);
BasketListViewItem *nextBasketItem = (BasketListViewItem*)(basketItem->nextSibling());
if (!nextBasketItem)
nextBasketItem = basketItem->prevSibling();
if (!nextBasketItem)
- nextBasketItem = (BasketListViewItem*)(basketItem->parent());
+ nextBasketItem = (BasketListViewItem*)(basketItem->tqparent());
if (nextBasketItem)
setCurrentBasket(nextBasketItem->basket());
@@ -1175,7 +1175,7 @@ void BNPView::removeBasket(Basket *basket)
// If there is no basket anymore, add a new one:
if (!nextBasketItem)
- BasketFactory::newBasket(/*icon=*/"", /*name=*/i18n("General"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"", /*name=*/i18n("General"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
else // No need to save two times if we add a basket
save();
@@ -1189,36 +1189,36 @@ void BNPView::setTreePlacement(bool onLeft)
else
moveToLast(m_tree);
//updateGeometry();
- kapp->postEvent( this, new QResizeEvent(size(), size()) );
+ kapp->postEvent( this, new TQResizeEvent(size(), size()) );
}
-void BNPView::relayoutAllBaskets()
+void BNPView::retqlayoutAllBaskets()
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
//item->basket()->unbufferizeAll();
item->basket()->unsetNotesWidth();
- item->basket()->relayoutNotes(true);
+ item->basket()->retqlayoutNotes(true);
++it;
}
}
void BNPView::recomputeAllStyles()
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
item->basket()->recomputeAllStyles();
item->basket()->unsetNotesWidth();
- item->basket()->relayoutNotes(true);
+ item->basket()->retqlayoutNotes(true);
++it;
}
}
-void BNPView::removedStates(const QValueList<State*> &deletedStates)
+void BNPView::removedStates(const TQValueList<State*> &deletedStates)
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
item->basket()->removedStates(deletedStates);
@@ -1228,7 +1228,7 @@ void BNPView::removedStates(const QValueList<State*> &deletedStates)
void BNPView::linkLookChanged()
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = ((BasketListViewItem*)it.current());
item->basket()->linkLookChanged();
@@ -1238,10 +1238,10 @@ void BNPView::linkLookChanged()
void BNPView::filterPlacementChanged(bool onTop)
{
- QListViewItemIterator it(m_tree);
+ TQListViewItemIterator it(m_tree);
while (it.current()) {
BasketListViewItem *item = static_cast<BasketListViewItem*>(it.current());
- DecoratedBasket *decoration = static_cast<DecoratedBasket*>(item->basket()->parent());
+ DecoratedBasket *decoration = static_cast<DecoratedBasket*>(TQT_TQWIDGET(item->basket()->tqparent()));
decoration->setFilterBarPosition(onTop);
++it;
}
@@ -1264,14 +1264,14 @@ void BNPView::updateBasketListViewItem(Basket *basket)
save();
}
-void BNPView::needSave(QListViewItem*)
+void BNPView::needSave(TQListViewItem*)
{
if (!m_loading)
// A basket has been collapsed/expanded or a new one is select: this is not urgent:
- QTimer::singleShot(500/*ms*/, this, SLOT(save()));
+ TQTimer::singleShot(500/*ms*/, TQT_TQOBJECT(this), TQT_SLOT(save()));
}
-void BNPView::slotPressed(QListViewItem *item, const QPoint &/*pos*/, int /*column*/)
+void BNPView::slotPressed(TQListViewItem *item, const TQPoint &/*pos*/, int /*column*/)
{
Basket *basket = currentBasket();
if (basket == 0)
@@ -1342,19 +1342,19 @@ void BNPView::notesStateChanged()
// Update statusbar message :
if (currentBasket()->isLocked())
- setSelectionStatus(i18n("Locked"));
+ setSelectiontqStatus(i18n("Locked"));
else if (!basket->isLoaded())
- setSelectionStatus(i18n("Loading..."));
+ setSelectiontqStatus(i18n("Loading..."));
else if (basket->count() == 0)
- setSelectionStatus(i18n("No notes"));
+ setSelectiontqStatus(i18n("No notes"));
else {
- QString count = i18n("%n note", "%n notes", basket->count() );
- QString selecteds = i18n("%n selected", "%n selected", basket->countSelecteds());
- QString showns = (currentDecoratedBasket()->filterData().isFiltering ? i18n("all matches") : i18n("no filter"));
+ TQString count = i18n("%n note", "%n notes", basket->count() );
+ TQString selecteds = i18n("%n selected", "%n selected", basket->countSelecteds());
+ TQString showns = (currentDecoratedBasket()->filterData().isFiltering ? i18n("all matches") : i18n("no filter"));
if (basket->countFounds() != basket->count())
showns = i18n("%n match", "%n matches", basket->countFounds());
- setSelectionStatus(
- i18n("e.g. '18 notes, 10 matches, 5 selected'", "%1, %2, %3").arg(count, showns, selecteds) );
+ setSelectiontqStatus(
+ i18n("e.g. '18 notes, 10 matches, 5 selected'", "%1, %2, %3").tqarg(count, showns, selecteds) );
}
// If we added a note that match the global filter, update the count number in the tree:
@@ -1429,7 +1429,7 @@ void BNPView::updateNotesActions()
}
} else if (m_type != Color) {
popupMenu->insertSeparator();
- popupMenu->insertItem( SmallIconSet("filesaveas"), i18n("&Save a copy as..."), this, SLOT(slotSaveAs()), 0, 10 );
+ popupMenu->insertItem( SmallIconSet("filesaveas"), i18n("&Save a copy as..."), TQT_TQOBJECT(this), TQT_SLOT(slotSaveAs()), 0, 10 );
}*/
}
@@ -1451,7 +1451,7 @@ void BNPView::slotColorFromScreen(bool global)
/* m_gettingColorFromScreen = true;
kapp->processEvents();
- QTimer::singleShot( 100, this, SLOT(grabColorFromScreen()) );*/
+ TQTimer::singleShot( 100, TQT_TQOBJECT(this), TQT_SLOT(grabColorFromScreen()) );*/
}
void BNPView::slotColorFromScreenGlobal()
@@ -1459,7 +1459,7 @@ void BNPView::slotColorFromScreenGlobal()
slotColorFromScreen(true);
}
-void BNPView::colorPicked(const QColor &color)
+void BNPView::colorPicked(const TQColor &color)
{
if (!currentBasket()->isLoaded()) {
showPassiveLoading(currentBasket());
@@ -1513,9 +1513,9 @@ void BNPView::slotConvertTexts()
KMessageBox::information(this, i18n("There are no plain text notes to convert."), i18n("Conversion Finished"));
}
-QPopupMenu* BNPView::popupMenu(const QString &menuName)
+TQPopupMenu* BNPView::popupMenu(const TQString &menuName)
{
- QPopupMenu *menu = 0;
+ TQPopupMenu *menu = 0;
bool hack = false; // TODO fix this
// When running in kontact and likeback Information message is shown
// factory is 0. Don't show error then and don't crash either :-)
@@ -1525,7 +1525,7 @@ QPopupMenu* BNPView::popupMenu(const QString &menuName)
KXMLGUIFactory* factory = m_guiClient->factory();
if(factory)
{
- menu = (QPopupMenu *)factory->container(menuName, m_guiClient);
+ menu = (TQPopupMenu *)factory->container(menuName, m_guiClient);
}
else
hack = isPart();
@@ -1544,8 +1544,8 @@ QPopupMenu* BNPView::popupMenu(const QString &menuName)
"<p>As last ressort, if you are sure the application is correctly installed "
"but you had a preview version of it, try to remove the "
"file %5basketui.rc</p>")
- .arg(kapp->aboutData()->programName(), kapp->aboutData()->programName(),
- stdDirs.saveLocation("data", "basket/")).arg(stdDirs.saveLocation("data", "basket/"), stdDirs.saveLocation("data", "basket/")),
+ .tqarg(kapp->aboutData()->programName(), kapp->aboutData()->programName(),
+ stdDirs.saveLocation("data", "basket/")).tqarg(stdDirs.saveLocation("data", "basket/"), stdDirs.saveLocation("data", "basket/")),
i18n("Ressource not Found"), KMessageBox::AllowLink );
}
if(!isPart())
@@ -1594,7 +1594,7 @@ void BNPView::grabScreenshot(bool global)
}
// Delay before to take a screenshot because if we hide the main window OR the systray popup menu,
- // we should wait the windows below to be repainted!!!
+ // we should wait the windows below to be tqrepainted!!!
// A special case is where the action is triggered with the global keyboard shortcut.
// In this case, global is true, and we don't wait.
// In the future, if global is also defined for other cases, check for
@@ -1610,7 +1610,7 @@ void BNPView::grabScreenshot(bool global)
currentBasket()->saveInsertionData();
m_regionGrabber = new RegionGrabber(delay);
- connect( m_regionGrabber, SIGNAL(regionGrabbed(const QPixmap&)), this, SLOT(screenshotGrabbed(const QPixmap&)) );
+ connect( m_regionGrabber, TQT_SIGNAL(regionGrabbed(const TQPixmap&)), TQT_TQOBJECT(this), TQT_SLOT(screenshotGrabbed(const TQPixmap&)) );
}
void BNPView::grabScreenshotGlobal()
@@ -1618,7 +1618,7 @@ void BNPView::grabScreenshotGlobal()
grabScreenshot(true);
}
-void BNPView::screenshotGrabbed(const QPixmap &pixmap)
+void BNPView::screenshotGrabbed(const TQPixmap &pixmap)
{
delete m_regionGrabber;
m_regionGrabber = 0;
@@ -1643,9 +1643,9 @@ void BNPView::screenshotGrabbed(const QPixmap &pixmap)
showPassiveDropped(i18n("Grabbed screen zone to basket <i>%1</i>"));
}
-Basket* BNPView::basketForFolderName(const QString &/*folderName*/)
+Basket* BNPView::basketForFolderName(const TQString &/*folderName*/)
{
-/* QPtrList<Basket> basketsList = listBaskets();
+/* TQPtrList<Basket> basketsList = listBaskets();
Basket *basket;
for (basket = basketsList.first(); basket; basket = basketsList.next())
if (basket->folderName() == folderName)
@@ -1670,7 +1670,7 @@ void BNPView::redo()
// TODO
}
-void BNPView::pasteToBasket(int /*index*/, QClipboard::Mode /*mode*/)
+void BNPView::pasteToBasket(int /*index*/, TQClipboard::Mode /*mode*/)
{
//TODO: REMOVE!
//basketAt(index)->pasteNote(mode);
@@ -1693,21 +1693,21 @@ void BNPView::delBasket()
/*separator=*/false,
/*user1=*/KGuiItem(i18n("Delete Only that Basket")/*, icon=""*/),
/*user2=*/KGuiItem(i18n("Delete Note & Children")/*, icon=""*/) );
- QStringList basketsList;
+ TQStringList basketsList;
basketsList.append("Basket 1");
basketsList.append(" Basket 2");
basketsList.append(" Basket 3");
basketsList.append(" Basket 4");
KMessageBox::createKMessageBox(
- dialog, QMessageBox::Information,
+ dialog, TQMessageBox::Information,
i18n("<qt>Do you really want to remove the basket <b>%1</b> and its contents?</qt>")
- .arg(Tools::textToHTMLWithoutP(basket->basketName())),
- basketsList, /*ask=*/"", /*checkboxReturn=*/0, /*options=*/KMessageBox::Notify/*, const QString &details=QString::null*/);
+ .tqarg(Tools::textToHTMLWithoutP(basket->basketName())),
+ basketsList, /*ask=*/"", /*checkboxReturn=*/0, /*options=*/KMessageBox::Notify/*, const TQString &details=TQString()*/);
#endif
int really = KMessageBox::questionYesNo( this,
i18n("<qt>Do you really want to remove the basket <b>%1</b> and its contents?</qt>")
- .arg(Tools::textToHTMLWithoutP(basket->basketName())),
+ .tqarg(Tools::textToHTMLWithoutP(basket->basketName())),
i18n("Remove Basket")
#if KDE_IS_VERSION( 3, 2, 90 ) // KDE 3.3.x
, KGuiItem(i18n("&Remove Basket"), "editdelete"), KStdGuiItem::cancel());
@@ -1718,11 +1718,11 @@ void BNPView::delBasket()
if (really == KMessageBox::No)
return;
- QStringList basketsList = listViewItemForBasket(basket)->childNamesTree();
+ TQStringList basketsList = listViewItemForBasket(basket)->childNamesTree();
if (basketsList.count() > 0) {
int deleteChilds = KMessageBox::questionYesNoList( this,
- i18n("<qt><b>%1</b> have the following children baskets.<br>Do you want to remove them too?</qt>")
- .arg(Tools::textToHTMLWithoutP(basket->basketName())),
+ i18n("<qt><b>%1</b> have the following tqchildren baskets.<br>Do you want to remove them too?</qt>")
+ .tqarg(Tools::textToHTMLWithoutP(basket->basketName())),
basketsList,
i18n("Remove Children Baskets")
#if KDE_IS_VERSION( 3, 2, 90 ) // KDE 3.3.x
@@ -1745,9 +1745,9 @@ void BNPView::doBasketDeletion(Basket *basket)
{
basket->closeEditor();
- QListViewItem *basketItem = listViewItemForBasket(basket);
- QListViewItem *nextOne;
- for (QListViewItem *child = basketItem->firstChild(); child; child = nextOne) {
+ TQListViewItem *basketItem = listViewItemForBasket(basket);
+ TQListViewItem *nextOne;
+ for (TQListViewItem *child = basketItem->firstChild(); child; child = nextOne) {
nextOne = child->nextSibling();
// First delete the child baskets:
doBasketDeletion(((BasketListViewItem*)child)->basket());
@@ -1765,7 +1765,7 @@ void BNPView::doBasketDeletion(Basket *basket)
void BNPView::password()
{
#ifdef HAVE_LIBGPGME
- PasswordDlg dlg(kapp->activeWindow(), "Password");
+ PasswordDlg dlg(TQT_TQWIDGET(kapp->activeWindow()), "Password");
Basket *cur = currentBasket();
dlg.setType(cur->encryptionType());
@@ -1791,15 +1791,15 @@ void BNPView::saveAsArchive()
{
Basket *basket = currentBasket();
- QDir dir;
+ TQDir dir;
KConfig *config = KGlobal::config();
config->setGroup("Basket Archive");
- QString folder = config->readEntry("lastFolder", QDir::homeDirPath()) + "/";
- QString url = folder + QString(basket->basketName()).replace("/", "_") + ".baskets";
+ TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
+ TQString url = folder + TQString(basket->basketName()).tqreplace("/", "_") + ".baskets";
- QString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files");
- QString destination = url;
+ TQString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files");
+ TQString destination = url;
for (bool askAgain = true; askAgain; ) {
destination = KFileDialog::getSaveFileName(destination, filter, this, i18n("Save as Basket Archive"));
if (destination.isEmpty()) // User canceled
@@ -1808,7 +1808,7 @@ void BNPView::saveAsArchive()
int result = KMessageBox::questionYesNoCancel(
this,
"<qt>" + i18n("The file <b>%1</b> already exists. Do you really want to override it?")
- .arg(KURL(destination).fileName()),
+ .tqarg(KURL(destination).fileName()),
i18n("Override File?"),
KGuiItem(i18n("&Override"), "filesave")
);
@@ -1827,7 +1827,7 @@ void BNPView::saveAsArchive()
Archive::save(basket, withSubBaskets, destination);
}
-QString BNPView::s_fileToOpen = "";
+TQString BNPView::s_fileToOpen = "";
void BNPView::delayedOpenArchive()
{
@@ -1836,8 +1836,8 @@ void BNPView::delayedOpenArchive()
void BNPView::openArchive()
{
- QString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files");
- QString path = KFileDialog::getOpenFileName(QString::null, filter, this, i18n("Open Basket Archive"));
+ TQString filter = "*.baskets|" + i18n("Basket Archives") + "\n*|" + i18n("All Files");
+ TQString path = KFileDialog::getOpenFileName(TQString(), filter, this, i18n("Open Basket Archive"));
if (!path.isEmpty()) // User has not canceled
Archive::open(path);
}
@@ -1870,7 +1870,7 @@ void BNPView::isLockedChanged()
{
bool isLocked = currentBasket()->isLocked();
- setLockStatus(isLocked);
+ setLocktqStatus(isLocked);
// m_actLockBasket->setChecked(isLocked);
m_actPropBasket->setEnabled(!isLocked);
@@ -1883,7 +1883,7 @@ void BNPView::askNewBasket()
askNewBasket(0, 0);
}
-void BNPView::askNewBasket(Basket *parent, Basket *pickProperties)
+void BNPView::askNewBasket(Basket *tqparent, Basket *pickProperties)
{
NewBasketDefaultProperties properties;
if (pickProperties) {
@@ -1895,17 +1895,17 @@ void BNPView::askNewBasket(Basket *parent, Basket *pickProperties)
properties.columnCount = pickProperties->columnsCount();
}
- NewBasketDialog(parent, properties, this).exec();
+ NewBasketDialog(tqparent, properties, this).exec();
}
void BNPView::askNewSubBasket()
{
- askNewBasket( /*parent=*/currentBasket(), /*pickPropertiesOf=*/currentBasket() );
+ askNewBasket( /*tqparent=*/currentBasket(), /*pickPropertiesOf=*/currentBasket() );
}
void BNPView::askNewSiblingBasket()
{
- askNewBasket( /*parent=*/parentBasketOf(currentBasket()), /*pickPropertiesOf=*/currentBasket() );
+ askNewBasket( /*tqparent=*/tqparentBasketOf(currentBasket()), /*pickPropertiesOf=*/currentBasket() );
}
void BNPView::globalPasteInCurrentBasket()
@@ -1925,19 +1925,19 @@ void BNPView::pasteInCurrentBasket()
void BNPView::pasteSelInCurrentBasket()
{
- currentBasket()->pasteNote(QClipboard::Selection);
+ currentBasket()->pasteNote(TQClipboard::Selection);
if (Settings::usePassivePopup())
showPassiveDropped(i18n("Selection pasted to basket <i>%1</i>"));
}
-void BNPView::showPassiveDropped(const QString &title)
+void BNPView::showPassiveDropped(const TQString &title)
{
if ( ! currentBasket()->isLocked() ) {
// TODO: Keep basket, so that we show the message only if something was added to a NOT visible basket
m_passiveDroppedTitle = title;
m_passiveDroppedSelection = currentBasket()->selectedNotes();
- QTimer::singleShot( c_delayTooltipTime, this, SLOT(showPassiveDroppedDelayed()) );
+ TQTimer::singleShot( c_delayTooltipTime, TQT_TQOBJECT(this), TQT_SLOT(showPassiveDroppedDelayed()) );
// DELAY IT BELOW:
} else
showPassiveImpossible(i18n("No note was added."));
@@ -1948,27 +1948,27 @@ void BNPView::showPassiveDroppedDelayed()
if (isMainWindowActive() || m_passiveDroppedSelection == 0)
return;
- QString title = m_passiveDroppedTitle;
+ TQString title = m_passiveDroppedTitle;
delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
- m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : this);
- QPixmap contentsPixmap = NoteDrag::feedbackPixmap(m_passiveDroppedSelection);
- QMimeSourceFactory::defaultFactory()->setPixmap("_passivepopup_image_", contentsPixmap);
+ m_passivePopup = new KPassivePopup(Settings::useSystray() ? (TQWidget*)Global::systemTray : this);
+ TQPixmap contentsPixmap = NoteDrag::feedbackPixmap(m_passiveDroppedSelection);
+ TQMimeSourceFactory::defaultFactory()->setPixmap("_passivepopup_image_", contentsPixmap);
m_passivePopup->setView(
- title.arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
+ title.tqarg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
(contentsPixmap.isNull() ? "" : "<img src=\"_passivepopup_image_\">"),
kapp->iconLoader()->loadIcon(currentBasket()->icon(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true));
m_passivePopup->show();
}
-void BNPView::showPassiveImpossible(const QString &message)
+void BNPView::showPassiveImpossible(const TQString &message)
{
delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
- m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+ m_passivePopup = new KPassivePopup(Settings::useSystray() ? (TQWidget*)Global::systemTray : (TQWidget*)this);
m_passivePopup->setView(
- QString("<font color=red>%1</font>")
- .arg(i18n("Basket <i>%1</i> is locked"))
- .arg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
+ TQString("<font color=red>%1</font>")
+ .tqarg(i18n("Basket <i>%1</i> is locked"))
+ .tqarg(Tools::textToHTMLWithoutP(currentBasket()->basketName())),
message,
kapp->iconLoader()->loadIcon(currentBasket()->icon(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true));
m_passivePopup->show();
@@ -1985,14 +1985,14 @@ void BNPView::showPassiveContent(bool forceShow/* = false*/)
return;
// FIXME: Duplicate code (2 times)
- QString message;
+ TQString message;
delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
- m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+ m_passivePopup = new KPassivePopup(Settings::useSystray() ? (TQWidget*)Global::systemTray : (TQWidget*)this);
m_passivePopup->setView(
"<qt>" + kapp->makeStdCaption( currentBasket()->isLocked()
- ? QString("%1 <font color=gray30>%2</font>")
- .arg(Tools::textToHTMLWithoutP(currentBasket()->basketName()), i18n("(Locked)"))
+ ? TQString("%1 <font color=gray30>%2</font>")
+ .tqarg(Tools::textToHTMLWithoutP(currentBasket()->basketName()), i18n("(Locked)"))
: Tools::textToHTMLWithoutP(currentBasket()->basketName()) ),
message,
kapp->iconLoader()->loadIcon(currentBasket()->icon(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true));
@@ -2005,7 +2005,7 @@ void BNPView::showPassiveLoading(Basket *basket)
return;
delete m_passivePopup; // Delete previous one (if exists): it will then hide it (only one at a time)
- m_passivePopup = new KPassivePopup(Settings::useSystray() ? (QWidget*)Global::systemTray : (QWidget*)this);
+ m_passivePopup = new KPassivePopup(Settings::useSystray() ? (TQWidget*)Global::systemTray : (TQWidget*)this);
m_passivePopup->setView(
Tools::textToHTMLWithoutP(basket->basketName()),
i18n("Loading..."),
@@ -2021,7 +2021,7 @@ void BNPView::addNoteColor() { showMainWindow(); currentBasket()->insertEmptyNot
void BNPView::aboutToHideNewBasketPopup()
{
- QTimer::singleShot(0, this, SLOT(cancelNewBasketPopup()));
+ TQTimer::singleShot(0, TQT_TQOBJECT(this), TQT_SLOT(cancelNewBasketPopup()));
}
void BNPView::cancelNewBasketPopup()
@@ -2034,7 +2034,7 @@ void BNPView::setNewBasketPopup()
m_newBasketPopup = true;
}
-void BNPView::setCaption(QString s)
+void BNPView::setCaption(TQString s)
{
emit setWindowCaption(s);
}
@@ -2044,29 +2044,29 @@ void BNPView::updateStatusBarHint()
m_statusbar->updateStatusBarHint();
}
-void BNPView::setSelectionStatus(QString s)
+void BNPView::setSelectiontqStatus(TQString s)
{
- m_statusbar->setSelectionStatus(s);
+ m_statusbar->setSelectiontqStatus(s);
}
-void BNPView::setLockStatus(bool isLocked)
+void BNPView::setLocktqStatus(bool isLocked)
{
- m_statusbar->setLockStatus(isLocked);
+ m_statusbar->setLocktqStatus(isLocked);
}
-void BNPView::postStatusbarMessage(const QString& msg)
+void BNPView::postStatusbarMessage(const TQString& msg)
{
m_statusbar->postStatusbarMessage(msg);
}
-void BNPView::setStatusBarHint(const QString &hint)
+void BNPView::setStatusBarHint(const TQString &hint)
{
m_statusbar->setStatusBarHint(hint);
}
-void BNPView::setUnsavedStatus(bool isUnsaved)
+void BNPView::setUnsavedtqStatus(bool isUnsaved)
{
- m_statusbar->setUnsavedStatus(isUnsaved);
+ m_statusbar->setUnsavedtqStatus(isUnsaved);
}
void BNPView::setActive(bool active)
@@ -2087,7 +2087,7 @@ void BNPView::setActive(bool active)
if (active) {
win->show();
//raise() and show() should normaly deIconify the window. but it doesn't do here due
- // to a bug in Qt or in KDE (qt3.1.x or KDE 3.1.x) then, i have to call KWin's method
+ // to a bug in TQt or in KDE (qt3.1.x or KDE 3.1.x) then, i have to call KWin's method
if (win->isMinimized())
KWin::deIconifyWindow(winId());
@@ -2141,7 +2141,7 @@ void BNPView::handleCommandLine()
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
/* Custom data folder */
- QCString customDataFolder = args->getOption("data-folder");
+ TQCString customDataFolder = args->getOption("data-folder");
if (customDataFolder != 0 && !customDataFolder.isEmpty())
{
Global::setCustomSavesFolder(customDataFolder);
@@ -2181,7 +2181,7 @@ void BNPView::handleCommandLine()
* - Each menu trigger the leavEvent
*/
-void BNPView::enterEvent(QEvent*)
+void BNPView::enterEvent(TQEvent*)
{
if(m_tryHideTimer)
m_tryHideTimer->stop();
@@ -2189,7 +2189,7 @@ void BNPView::enterEvent(QEvent*)
m_hideTimer->stop();
}
-void BNPView::leaveEvent(QEvent*)
+void BNPView::leaveEvent(TQEvent*)
{
if (Settings::useSystray() && Settings::hideOnMouseOut() && m_tryHideTimer)
m_tryHideTimer->start(50);
@@ -2201,7 +2201,7 @@ void BNPView::timeoutTryHide()
if (kapp->activePopupWidget() != 0L)
return;
- if (kapp->widgetAt(QCursor::pos()) != 0L)
+ if (kapp->widgetAt(TQCursor::pos()) != 0L)
m_hideTimer->stop();
else if ( ! m_hideTimer->isActive() ) // Start only one time
m_hideTimer->start(Settings::timeToHideOnMouseOut() * 100, true);
@@ -2275,7 +2275,7 @@ void BNPView::populateTagsMenu()
populateTagsMenu(*menu, referenceNote);
m_lastOpenedTagsMenu = menu;
-// connect( menu, SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
+// connect( menu, TQT_SIGNAL(aboutToHide()), TQT_TQOBJECT(this), TQT_SLOT(disconnectTagsMenu()) );
}
void BNPView::populateTagsMenu(KPopupMenu &menu, Note *referenceNote)
@@ -2286,7 +2286,7 @@ void BNPView::populateTagsMenu(KPopupMenu &menu, Note *referenceNote)
currentBasket()->m_tagPopupNote = referenceNote;
bool enable = currentBasket()->countSelecteds() > 0;
- QValueList<Tag*>::iterator it;
+ TQValueList<Tag*>::iterator it;
Tag *currentTag;
State *currentState;
int i = 10;
@@ -2294,12 +2294,12 @@ void BNPView::populateTagsMenu(KPopupMenu &menu, Note *referenceNote)
// 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();
+ sequence = currentTag->shortcut().operator TQKeySequence();
menu.insertItem(StateMenuItem::checkBoxIconSet(
(referenceNote ? referenceNote->hasTag(currentTag) : false),
- menu.colorGroup()),
+ menu.tqcolorGroup()),
new StateMenuItem(currentState, sequence, true),
i
);
@@ -2323,15 +2323,15 @@ void BNPView::populateTagsMenu(KPopupMenu &menu, Note *referenceNote)
if (!currentBasket()->selectedNotesHaveTags())
menu.setItemEnabled(2, false);
- connect( &menu, SIGNAL(activated(int)), currentBasket(), SLOT(toggledTagInMenu(int)) );
- connect( &menu, SIGNAL(aboutToHide()), currentBasket(), SLOT(unlockHovering()) );
- connect( &menu, SIGNAL(aboutToHide()), currentBasket(), SLOT(disableNextClick()) );
+ connect( &menu, TQT_SIGNAL(activated(int)), currentBasket(), TQT_SLOT(toggledTagInMenu(int)) );
+ connect( &menu, TQT_SIGNAL(aboutToHide()), currentBasket(), TQT_SLOT(unlockHovering()) );
+ connect( &menu, TQT_SIGNAL(aboutToHide()), currentBasket(), TQT_SLOT(disableNextClick()) );
}
void BNPView::connectTagsMenu()
{
- connect( popupMenu("tags"), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu()) );
- connect( popupMenu("tags"), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
+ connect( popupMenu("tags"), TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(populateTagsMenu()) );
+ connect( popupMenu("tags"), TQT_SIGNAL(aboutToHide()), TQT_TQOBJECT(this), TQT_SLOT(disconnectTagsMenu()) );
}
/*
@@ -2343,10 +2343,10 @@ void BNPView::connectTagsMenu()
* So we disconnect at hide event to ensure only one connection: the next show event will not connects another time.
*/
-void BNPView::showEvent(QShowEvent*)
+void BNPView::showEvent(TQShowEvent*)
{
if (isPart())
- QTimer::singleShot( 0, this, SLOT(connectTagsMenu()) );
+ TQTimer::singleShot( 0, TQT_TQOBJECT(this), TQT_SLOT(connectTagsMenu()) );
if (m_firstShow) {
m_firstShow = false;
@@ -2357,11 +2357,11 @@ void BNPView::showEvent(QShowEvent*)
}
}
-void BNPView::hideEvent(QHideEvent*)
+void BNPView::hideEvent(TQHideEvent*)
{
if (isPart()) {
- disconnect( popupMenu("tags"), SIGNAL(aboutToShow()), this, SLOT(populateTagsMenu()) );
- disconnect( popupMenu("tags"), SIGNAL(aboutToHide()), this, SLOT(disconnectTagsMenu()) );
+ disconnect( popupMenu("tags"), TQT_SIGNAL(aboutToShow()), TQT_TQOBJECT(this), TQT_SLOT(populateTagsMenu()) );
+ disconnect( popupMenu("tags"), TQT_SIGNAL(aboutToHide()), TQT_TQOBJECT(this), TQT_SLOT(disconnectTagsMenu()) );
}
if (isPart())
@@ -2370,14 +2370,14 @@ void BNPView::hideEvent(QHideEvent*)
void BNPView::disconnectTagsMenu()
{
- QTimer::singleShot( 0, this, SLOT(disconnectTagsMenuDelayed()) );
+ TQTimer::singleShot( 0, TQT_TQOBJECT(this), TQT_SLOT(disconnectTagsMenuDelayed()) );
}
void BNPView::disconnectTagsMenuDelayed()
{
- disconnect( m_lastOpenedTagsMenu, SIGNAL(activated(int)), currentBasket(), SLOT(toggledTagInMenu(int)) );
- disconnect( m_lastOpenedTagsMenu, SIGNAL(aboutToHide()), currentBasket(), SLOT(unlockHovering()) );
- disconnect( m_lastOpenedTagsMenu, SIGNAL(aboutToHide()), currentBasket(), SLOT(disableNextClick()) );
+ disconnect( m_lastOpenedTagsMenu, TQT_SIGNAL(activated(int)), currentBasket(), TQT_SLOT(toggledTagInMenu(int)) );
+ disconnect( m_lastOpenedTagsMenu, TQT_SIGNAL(aboutToHide()), currentBasket(), TQT_SLOT(unlockHovering()) );
+ disconnect( m_lastOpenedTagsMenu, TQT_SIGNAL(aboutToHide()), currentBasket(), TQT_SLOT(disableNextClick()) );
}
void BNPView::showGlobalShortcutsSettingsDialog()
diff --git a/src/bnpview.h b/src/bnpview.h
index b7e99ef..f62441d 100644
--- a/src/bnpview.h
+++ b/src/bnpview.h
@@ -23,22 +23,22 @@
#include <klistview.h>
#include <kxmlguiclient.h>
-#include <qtimer.h>
-#include <qclipboard.h>
-#include <qsplitter.h>
-#include <qlistview.h>
+#include <tqtimer.h>
+#include <tqclipboard.h>
+#include <tqsplitter.h>
+#include <tqlistview.h>
#include <dcopref.h>
#include "global.h"
#include "basketdcopiface.h"
/// NEW:
-class QWidgetStack;
-class QDomDocument;
-class QDomElement;
+class TQWidgetStack;
+class TQDomDocument;
+class TQDomElement;
class KToggleAction;
class KPassivePopup;
-class QPopupMenu;
+class TQPopupMenu;
class KPopupMenu;
class KTar;
@@ -54,38 +54,39 @@ class Tag;
class State;
class Note;
-class BNPView : public QSplitter, virtual public BasketDcopInterface
+class BNPView : public TQSplitter, virtual public BasketDcopInterface
{
Q_OBJECT
+ TQ_OBJECT
public:
/// CONSTRUCTOR AND DESTRUCTOR:
- BNPView(QWidget *parent, const char *name, KXMLGUIClient *aGUIClient,
+ BNPView(TQWidget *tqparent, const char *name, KXMLGUIClient *aGUIClient,
KActionCollection *actionCollection, BasketStatusBar *bar);
~BNPView();
/// MANAGE CONFIGURATION EVENTS!:
void setTreePlacement(bool onLeft);
- void relayoutAllBaskets();
+ void retqlayoutAllBaskets();
void recomputeAllStyles();
- void removedStates(const QValueList<State*> &deletedStates);
+ void removedStates(const TQValueList<State*> &deletedStates);
void linkLookChanged();
void filterPlacementChanged(bool onTop);
/// MANAGE BASKETS:
BasketListViewItem* listViewItemForBasket(Basket *basket);
Basket* currentBasket();
- Basket* parentBasketOf(Basket *basket);
+ Basket* tqparentBasketOf(Basket *basket);
void setCurrentBasket(Basket *basket);
void removeBasket(Basket *basket);
/// For NewBasketDialog (and later some other classes):
- QListViewItem* firstListViewItem();
+ TQListViewItem* firstListViewItem();
///
BasketListViewItem* lastListViewItem();
- int basketCount(QListViewItem *parent = 0);
+ int basketCount(TQListViewItem *tqparent = 0);
bool canFold();
bool canExpand();
void enableActions();
private:
- QDomElement basketElement(QListViewItem *item, QDomDocument &document, QDomElement &parentElement);
+ TQDomElement basketElement(TQListViewItem *item, TQDomDocument &document, TQDomElement &tqparentElement);
public slots:
void countsChanged(Basket *basket);
void notesStateChanged();
@@ -93,11 +94,11 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void updateBasketListViewItem(Basket *basket);
void save();
- void save(QListViewItem *firstItem, QDomDocument &document, QDomElement &parentElement);
- void saveSubHierarchy(QListViewItem *item, QDomDocument &document, QDomElement &parentElement, bool recursive);
+ void save(TQListViewItem *firstItem, TQDomDocument &document, TQDomElement &tqparentElement);
+ void saveSubHierarchy(TQListViewItem *item, TQDomDocument &document, TQDomElement &tqparentElement, bool recursive);
void load();
- void load(KListView *listView, QListViewItem *item, const QDomElement &baskets);
- void loadNewBasket(const QString &folderName, const QDomElement &properties, Basket *parent);
+ void load(KListView *listView, TQListViewItem *item, const TQDomElement &baskets);
+ void loadNewBasket(const TQString &folderName, const TQDomElement &properties, Basket *tqparent);
void goToPreviousBasket();
void goToNextBasket();
void foldBasket();
@@ -141,7 +142,7 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void slotColorFromScreen(bool global = false);
void slotColorFromScreenGlobal();
- void colorPicked(const QColor &color);
+ void colorPicked(const TQColor &color);
void colorPickingCanceled();
void slotConvertTexts();
@@ -152,11 +153,11 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void addNoteLink();
void addNoteColor();
/** Passive Popups for Global Actions */
- void showPassiveDropped(const QString &title);
+ void showPassiveDropped(const TQString &title);
void showPassiveDroppedDelayed(); // Do showPassiveDropped(), but delayed
void showPassiveContent(bool forceShow = false);
void showPassiveContentForced();
- void showPassiveImpossible(const QString &message);
+ void showPassiveImpossible(const TQString &message);
void showPassiveLoading(Basket *basket);
// For GUI :
void setFiltering(bool filtering);
@@ -166,17 +167,17 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void globalPasteInCurrentBasket();
void pasteInCurrentBasket();
void pasteSelInCurrentBasket();
- void pasteToBasket(int index, QClipboard::Mode mode = QClipboard::Clipboard);
+ void pasteToBasket(int index, TQClipboard::Mode mode = TQClipboard::Clipboard);
void showHideFilterBar(bool show, bool switchFocus = true);
/** Insert **/
void insertEmpty(int type);
void insertWizard(int type);
void grabScreenshot(bool global = false);
void grabScreenshotGlobal();
- void screenshotGrabbed(const QPixmap &pixmap);
+ void screenshotGrabbed(const TQPixmap &pixmap);
/** Basket */
void askNewBasket();
- void askNewBasket(Basket *parent, Basket *pickProperties);
+ void askNewBasket(Basket *tqparent, Basket *pickProperties);
void askNewSubBasket();
void askNewSiblingBasket();
void aboutToHideNewBasketPopup();
@@ -197,7 +198,7 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void timeoutHide();
public:
- static QString s_fileToOpen;
+ static TQString s_fileToOpen;
public slots:
void addWelcomeBaskets();
@@ -260,7 +261,7 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
KAction *m_actInsertLauncher;
KAction *m_actImportIcon;
KAction *m_actLoadFile;
- QPtrList<KAction> m_insertActions;
+ TQPtrList<KAction> m_insertActions;
// Basket actions :
KToggleAction *m_actShowFilter;
KAction *m_actResetFilter;
@@ -277,11 +278,11 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
DecoratedBasket* currentDecoratedBasket();
public:
- Basket* loadBasket(const QString &folderName); // Public only for class Archive
- BasketListViewItem* appendBasket(Basket *basket, QListViewItem *parentItem); // Public only for class Archive
+ Basket* loadBasket(const TQString &folderName); // Public only for class Archive
+ BasketListViewItem* appendBasket(Basket *basket, TQListViewItem *tqparentItem); // Public only for class Archive
- Basket* basketForFolderName(const QString &folderName);
- QPopupMenu* popupMenu(const QString &menuName);
+ Basket* basketForFolderName(const TQString &folderName);
+ TQPopupMenu* popupMenu(const TQString &menuName);
bool isPart();
bool isMainWindowActive();
void showMainWindow();
@@ -291,13 +292,13 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
virtual void handleCommandLine();
public slots:
- void setCaption(QString s);
+ void setCaption(TQString s);
void updateStatusBarHint();
- void setSelectionStatus(QString s);
- void setLockStatus(bool isLocked);
- void postStatusbarMessage(const QString&);
- void setStatusBarHint(const QString&);
- void setUnsavedStatus(bool isUnsaved);
+ void setSelectiontqStatus(TQString s);
+ void setLocktqStatus(bool isLocked);
+ void postStatusbarMessage(const TQString&);
+ void setStatusBarHint(const TQString&);
+ void setUnsavedtqStatus(bool isUnsaved);
void setActive(bool active = true);
KActionCollection *actionCollection() { return m_actionCollection; };
@@ -307,32 +308,32 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
void disconnectTagsMenu();
void disconnectTagsMenuDelayed();
protected:
- void showEvent(QShowEvent*);
- void hideEvent(QHideEvent*);
+ void showEvent(TQShowEvent*);
+ void hideEvent(TQHideEvent*);
private:
KPopupMenu *m_lastOpenedTagsMenu;
private slots:
- void slotPressed(QListViewItem *item, const QPoint &/*pos*/ = QPoint(), int /*column*/ = 0);
- void needSave(QListViewItem*);
- void slotContextMenu(KListView *listView, QListViewItem *item, const QPoint &pos);
- void slotMouseButtonPressed(int button, QListViewItem *item, const QPoint &pos, int column);
- void slotShowProperties(QListViewItem *item, const QPoint&, int);
+ void slotPressed(TQListViewItem *item, const TQPoint &/*pos*/ = TQPoint(), int /*column*/ = 0);
+ void needSave(TQListViewItem*);
+ void slotContextMenu(KListView *listView, TQListViewItem *item, const TQPoint &pos);
+ void slotMouseButtonPressed(int button, TQListViewItem *item, const TQPoint &pos, int column);
+ void slotShowProperties(TQListViewItem *item, const TQPoint&, int);
void initialize();
signals:
void basketNumberChanged(int number);
void basketChanged();
- void setWindowCaption(const QString &s);
+ void setWindowCaption(const TQString &s);
void showPart();
protected:
- void enterEvent(QEvent*);
- void leaveEvent(QEvent*);
+ void enterEvent(TQEvent*);
+ void leaveEvent(TQEvent*);
private:
KListView *m_tree;
- QWidgetStack *m_stack;
+ TQWidgetStack *m_stack;
bool m_loading;
bool m_newBasketPopup;
bool m_firstShow;
@@ -340,15 +341,15 @@ class BNPView : public QSplitter, virtual public BasketDcopInterface
bool m_colorPickWasShown;
bool m_colorPickWasGlobal;
RegionGrabber *m_regionGrabber;
- QString m_passiveDroppedTitle;
+ TQString m_passiveDroppedTitle;
NoteSelection *m_passiveDroppedSelection;
KPassivePopup *m_passivePopup;
static const int c_delayTooltipTime;
KActionCollection *m_actionCollection;
KXMLGUIClient *m_guiClient;
BasketStatusBar *m_statusbar;
- QTimer *m_tryHideTimer;
- QTimer *m_hideTimer;
+ TQTimer *m_tryHideTimer;
+ TQTimer *m_hideTimer;
};
#endif // BNPVIEW_H
diff --git a/src/clickablelabel.cpp b/src/clickablelabel.cpp
index 11a5ce9..8d98ef0 100644
--- a/src/clickablelabel.cpp
+++ b/src/clickablelabel.cpp
@@ -20,7 +20,7 @@
#include "clickablelabel.h"
-void ClickableLabel::mousePressEvent(QMouseEvent *event)
+void ClickableLabel::mousePressEvent(TQMouseEvent *event)
{
if (event->button() & Qt::LeftButton)
emit clicked();
diff --git a/src/clickablelabel.h b/src/clickablelabel.h
index 0198974..c65c001 100644
--- a/src/clickablelabel.h
+++ b/src/clickablelabel.h
@@ -21,23 +21,24 @@
#ifndef CLICKABLELABEL_H
#define CLICKABLELABEL_H
-#include <qlabel.h>
+#include <tqlabel.h>
-/** This class is a QLabel that can emit a clicked() signal when clicked !
+/** This class is a TQLabel that can emit a clicked() signal when clicked !
* @author S�astien Laot
*/
-class ClickableLabel : public QLabel
+class ClickableLabel : public TQLabel
{
Q_OBJECT
+ TQ_OBJECT
public:
/** Construtor, initializer and destructor */
- ClickableLabel(QWidget *parent = 0, const char *name = 0)
- : QLabel(parent, name) {}
+ ClickableLabel(TQWidget *tqparent = 0, const char *name = 0)
+ : TQLabel(tqparent, name) {}
~ClickableLabel() {}
signals:
void clicked();
protected:
- virtual void mousePressEvent(QMouseEvent *event);
+ virtual void mousePressEvent(TQMouseEvent *event);
};
#endif // CLICKABLELABEL_H
diff --git a/src/colorpicker.cpp b/src/colorpicker.cpp
index 37049bb..52fe4c5 100644
--- a/src/colorpicker.cpp
+++ b/src/colorpicker.cpp
@@ -19,14 +19,14 @@
***************************************************************************/
#include "colorpicker.h"
-#include "qtimer.h"
+#include "tqtimer.h"
#include <kcolordialog.h>
/// ///
/** DektopColorPicker */
-/* From Qt documentation:
+/* From TQt documentation:
* " Note that only visible widgets can grab mouse input.
* If isVisible() returns FALSE for a widget, that widget cannot call grabMouse(). "
* So, we should use an always visible widget to be able to pick a color from screen,
@@ -35,9 +35,9 @@
*/
DesktopColorPicker::DesktopColorPicker()
- : QDesktopWidget()
+ : TQDesktopWidget()
{
- setName("DesktopColorPicker");
+ TQT_TQWIDGET(this)->setName("DesktopColorPicker");
m_gettingColorFromScreen = false;
}
@@ -49,14 +49,14 @@ void DesktopColorPicker::pickColor()
{
m_gettingColorFromScreen = true;
// Global::mainContainer->setActive(false);
- QTimer::singleShot( 50, this, SLOT(slotDelayedPick()) );
+ TQTimer::singleShot( 50, this, TQT_SLOT(slotDelayedPick()) );
}
/* When firered from basket context menu, and not from menu, grabMouse doesn't work!
* It's perhapse because context menu call slotColorFromScreen() and then
* ungrab the mouse (since menus grab the mouse).
* But why isn't there such bug with normal menus?...
- * By calling this method with a QTimer::singleShot, we are sure context menu code is
+ * By calling this method with a TQTimer::singleShot, we are sure context menu code is
* finished and we can grab the mouse without loosing the grab:
*/
void DesktopColorPicker::slotDelayedPick()
@@ -67,30 +67,30 @@ void DesktopColorPicker::slotDelayedPick()
/* Validate the color
*/
-void DesktopColorPicker::mouseReleaseEvent(QMouseEvent *event)
+void DesktopColorPicker::mouseReleaseEvent(TQMouseEvent *event)
{
if (m_gettingColorFromScreen) {
m_gettingColorFromScreen = false;
releaseMouse();
releaseKeyboard();
- QColor color = KColorDialog::grabColor(event->globalPos());
+ TQColor color = KColorDialog::grabColor(event->globalPos());
emit pickedColor(color);
} else
- QDesktopWidget::mouseReleaseEvent(event);
+ TQDesktopWidget::mouseReleaseEvent(event);
}
/* Cancel the mode
*/
-void DesktopColorPicker::keyPressEvent(QKeyEvent *event)
+void DesktopColorPicker::keyPressEvent(TQKeyEvent *event)
{
if (m_gettingColorFromScreen)
- if (event->key() == Qt::Key_Escape) {
+ if (event->key() == TQt::Key_Escape) {
m_gettingColorFromScreen = false;
releaseMouse();
releaseKeyboard();
emit canceledPick();
}
- QDesktopWidget::keyPressEvent(event);
+ TQDesktopWidget::keyPressEvent(event);
}
#include "colorpicker.moc"
diff --git a/src/colorpicker.h b/src/colorpicker.h
index 1f109fa..45463ca 100644
--- a/src/colorpicker.h
+++ b/src/colorpicker.h
@@ -21,14 +21,15 @@
#ifndef COLORPICKER_H
#define COLORPICKER_H
-#include <qdesktopwidget.h>
+#include <tqdesktopwidget.h>
/** Class to pick a color on the screen
* @author S�astien Laot
*/
-class DesktopColorPicker : public QDesktopWidget
+class DesktopColorPicker : public TQDesktopWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
/** Construtor, initializer and destructor */
DesktopColorPicker();
@@ -42,15 +43,15 @@ class DesktopColorPicker : public QDesktopWidget
signals:
/** When user picked a color, this signal is emitted.
*/
- void pickedColor(const QColor &color);
+ void pickedColor(const TQColor &color);
/** When user cancel a picking (by pressing Escape), this signal is emitted.
*/
void canceledPick();
protected slots:
void slotDelayedPick();
protected:
- void mouseReleaseEvent(QMouseEvent *event);
- void keyPressEvent(QKeyEvent *event);
+ void mouseReleaseEvent(TQMouseEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
bool m_gettingColorFromScreen;
};
diff --git a/src/crashhandler.cpp b/src/crashhandler.cpp
index 64e745b..56ddec8 100644
--- a/src/crashhandler.cpp
+++ b/src/crashhandler.cpp
@@ -22,9 +22,9 @@
#include <klocale.h>
#include <ktempfile.h>
-#include <qfile.h>
-#include <qregexp.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqtextstream.h>
#include <cstdio> //popen, fread
#include <iostream>
@@ -48,8 +48,8 @@
};
#endif
- static QString
- runCommand( const QCString &command )
+ static TQString
+ runCommand( const TQCString &command )
{
static const uint SIZE = 40960; //40 KiB
static char stdoutBuf[ SIZE ];
@@ -60,7 +60,7 @@
stdoutBuf[ std::fread( static_cast<void*>( stdoutBuf ), sizeof(char), SIZE-1, process ) ] = '\0';
::pclose( process );
- return QString::fromLocal8Bit( stdoutBuf );
+ return TQString::fromLocal8Bit( stdoutBuf );
}
void
@@ -75,14 +75,14 @@
// we are the child process (the result of the fork)
// debug() << "amaroK is crashing...\n";
- QString subject = "[basket-crash] " VERSION " ";
- QString body = i18n(
+ TQString subject = "[basket-crash] " VERSION " ";
+ TQString body = i18n(
"%1 has crashed! We're sorry about this.\n"
"\n"
"But, all is not lost! You could potentially help us fix the crash. "
"Information describing the crash is below, so just click send, "
"or if you have time, write a brief description of how the crash happened first.\n\n"
- "Many thanks." ).arg(kapp->aboutData()->programName()) + "\n\n";
+ "Many thanks." ).tqarg(kapp->aboutData()->programName()) + "\n\n";
body += "\n\n\n\n\n\n" + i18n(
"The information below is to help the developers identify the problem, "
"please do not modify it." ) + "\n\n\n\n";
@@ -96,9 +96,9 @@
;// "TagLib: %2.%3.%4\n";
/* body = body
- .arg( TAGLIB_MAJOR_VERSION )
- .arg( TAGLIB_MINOR_VERSION )
- .arg( TAGLIB_PATCH_VERSION );*/
+ .tqarg( TAGLIB_MAJOR_VERSION )
+ .tqarg( TAGLIB_MINOR_VERSION )
+ .tqarg( TAGLIB_PATCH_VERSION );*/
#ifdef NDEBUG
body += "NDEBUG: true";
@@ -112,13 +112,13 @@
const int handle = temp.handle();
-// QCString gdb_command_string =
+// TQCString gdb_command_string =
// "file amarokapp\n"
-// "attach " + QCString().setNum( ::getppid() ) + "\n"
+// "attach " + TQCString().setNum( ::getppid() ) + "\n"
// "bt\n" "echo \\n\n"
// "thread apply all bt\n";
- const QCString gdb_batch =
+ const TQCString gdb_batch =
"bt\n"
"echo \\n\\n\n"
"bt full\n"
@@ -133,48 +133,48 @@
::dup2( fileno( stdout ), fileno( stderr ) );
- QCString gdb;
+ TQCString gdb;
gdb = "gdb --nw -n --batch -x ";
gdb += temp.name().latin1();
gdb += " basket ";
- gdb += QCString().setNum( ::getppid() );
+ gdb += TQCString().setNum( ::getppid() );
- QString bt = runCommand( gdb );
+ TQString bt = runCommand( gdb );
/// clean up
bt.remove( "(no debugging symbols found)..." );
bt.remove( "(no debugging symbols found)\n" );
- bt.replace( QRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters
+ bt.tqreplace( TQRegExp("\n{2,}"), "\n" ); //clean up multiple \n characters
bt.stripWhiteSpace();
/// analyze usefulness
bool useful = true;
- const QString fileCommandOutput = runCommand( "file `which basket`" );
+ const TQString fileCommandOutput = runCommand( "file `which basket`" );
- if( fileCommandOutput.find( "not stripped", false ) == -1 )
+ if( fileCommandOutput.tqfind( "not stripped", false ) == -1 )
subject += "[___stripped]"; //same length as below
else
subject += "[NOTstripped]";
if( !bt.isEmpty() ) {
- const int invalidFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") );
- const int validFrames = bt.contains( QRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") );
+ const int invalidFrames = bt.tqcontains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in \\?\\?") );
+ const int validFrames = bt.tqcontains( TQRegExp("\n#[0-9]+\\s+0x[0-9A-Fa-f]+ in [^?]") );
const int totalFrames = invalidFrames + validFrames;
if( totalFrames > 0 ) {
const double validity = double(validFrames) / totalFrames;
- subject += QString("[validity: %1]").arg( validity, 0, 'f', 2 );
+ subject += TQString("[validity: %1]").tqarg( validity, 0, 'f', 2 );
if( validity <= 0.5 ) useful = false;
}
- subject += QString("[frames: %1]").arg( totalFrames, 3 /*padding*/ );
+ subject += TQString("[frames: %1]").tqarg( totalFrames, 3 /*padding*/ );
- if( bt.find( QRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 )
+ if( bt.tqfind( TQRegExp(" at \\w*\\.cpp:\\d+\n") ) >= 0 )
subject += "[line numbers]";
}
else
useful = false;
-// subject += QString("[%1]").arg( AmarokConfig::soundSystem().remove( QRegExp("-?engine") ) );
+// subject += TQString("[%1]").tqarg( AmarokConfig::soundSystem().remove( TQRegExp("-?engine") ) );
// debug() << subject << endl;
@@ -194,19 +194,19 @@
//TODO startup notification
kapp->invokeMailer(
/*to*/ "kelvie@ieee.org",
- /*cc*/ QString(),
- /*bcc*/ QString(),
+ /*cc*/ TQString(),
+ /*bcc*/ TQString(),
/*subject*/ subject,
/*body*/ body,
- /*messageFile*/ QString(),
- /*attachURLs*/ QStringList(),
+ /*messageFile*/ TQString(),
+ /*attachURLs*/ TQStringList(),
/*startup_id*/ "" );
}
else {
- std::cout << "\n" + i18n( "%1 has crashed! We're sorry about this.\n\n"
+ std::cout << ("\n" + i18n( "%1 has crashed! We're sorry about this.\n\n"
"But, all is not lost! Perhaps an upgrade is already available "
"which fixes the problem. Please check your distribution's software repository." )
- .arg(kapp->aboutData()->programName()).local8Bit() << std::endl;
+ .tqarg(kapp->aboutData()->programName())).local8Bit().data() << std::endl;
}
//_exit() exits immediately, otherwise this
diff --git a/src/debugwindow.cpp b/src/debugwindow.cpp
index 7df259e..d6e5b0e 100644
--- a/src/debugwindow.cpp
+++ b/src/debugwindow.cpp
@@ -18,42 +18,42 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlayout.h>
-#include <qtextbrowser.h>
-#include <qstring.h>
-#include <qevent.h>
+#include <tqlayout.h>
+#include <tqtextbrowser.h>
+#include <tqstring.h>
+#include <tqevent.h>
#include <klocale.h>
#include "global.h"
#include "debugwindow.h"
-DebugWindow::DebugWindow(QWidget *parent, const char *name )
- : QWidget(parent, name != 0 ? name : "DebugWindow")
+DebugWindow::DebugWindow(TQWidget *tqparent, const char *name )
+ : TQWidget(tqparent, name != 0 ? name : "DebugWindow")
{
Global::debugWindow = this;
setCaption(i18n("Debug Window"));
- layout = new QVBoxLayout(this);
- textBrowser = new QTextBrowser(this);
+ tqlayout = new TQVBoxLayout(this);
+ textBrowser = new TQTextBrowser(this);
- textBrowser->setWordWrap(QTextBrowser::NoWrap);
+ textBrowser->setWordWrap(TQTextBrowser::NoWrap);
- layout->addWidget(textBrowser);
+ tqlayout->addWidget(textBrowser);
textBrowser->show();
}
DebugWindow::~DebugWindow()
{
delete textBrowser;
- delete layout;
+ delete tqlayout;
}
-void DebugWindow::postMessage(const QString msg)
+void DebugWindow::postMessage(const TQString msg)
{
textBrowser->append(msg);
}
-DebugWindow& DebugWindow::operator<<(const QString msg)
+DebugWindow& DebugWindow::operator<<(const TQString msg)
{
textBrowser->append(msg);
return *this;
@@ -64,10 +64,10 @@ void DebugWindow::insertHLine()
textBrowser->append("<hr>");
}
-void DebugWindow::closeEvent(QCloseEvent *event)
+void DebugWindow::closeEvent(TQCloseEvent *event)
{
Global::debugWindow = 0L;
- QWidget::closeEvent(event);
+ TQWidget::closeEvent(event);
}
#include "debugwindow.moc"
diff --git a/src/debugwindow.h b/src/debugwindow.h
index c078aec..2ab099e 100644
--- a/src/debugwindow.h
+++ b/src/debugwindow.h
@@ -21,32 +21,33 @@
#ifndef DEBUGWINDOW_H
#define DEBUGWINDOW_H
-#include <qwidget.h>
+#include <tqwidget.h>
-class QVBoxLayout;
-class QTextBrowser;
-class QString;
-class QCloseEvent;
+class TQVBoxLayout;
+class TQTextBrowser;
+class TQString;
+class TQCloseEvent;
/**A simple window that display text through debuging messages.
*@author Sébastien Laoût
*/
-class DebugWindow : public QWidget {
+class DebugWindow : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
/** Construtor and destructor */
- DebugWindow(QWidget *parent = 0, const char *name = 0);
+ DebugWindow(TQWidget *tqparent = 0, const char *name = 0);
~DebugWindow();
/** Methods to post a message to the debug window */
- void postMessage(const QString msg);
- DebugWindow& operator<<(const QString msg);
+ void postMessage(const TQString msg);
+ DebugWindow& operator<<(const TQString msg);
void insertHLine();
protected:
- virtual void closeEvent(QCloseEvent *event);
+ virtual void closeEvent(TQCloseEvent *event);
private:
- QVBoxLayout *layout;
- QTextBrowser *textBrowser;
+ TQVBoxLayout *tqlayout;
+ TQTextBrowser *textBrowser;
};
#define DEBUG_WIN if (Global::debugWindow) *Global::debugWindow
diff --git a/src/exporterdialog.cpp b/src/exporterdialog.cpp
index 569baf7..8bf2e2d 100644
--- a/src/exporterdialog.cpp
+++ b/src/exporterdialog.cpp
@@ -21,38 +21,38 @@
#include <kurlrequester.h>
#include <klineedit.h>
#include <kfiledialog.h>
-#include <qcheckbox.h>
-#include <qdir.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqcheckbox.h>
+#include <tqdir.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <klocale.h>
#include <kconfig.h>
#include "exporterdialog.h"
#include "basket.h"
-ExporterDialog::ExporterDialog(Basket *basket, QWidget *parent, const char *name)
- : KDialogBase(parent, name, /*modal=*/true, i18n("Export Basket to HTML"),
+ExporterDialog::ExporterDialog(Basket *basket, TQWidget *tqparent, const char *name)
+ : KDialogBase(tqparent, name, /*modal=*/true, i18n("Export Basket to HTML"),
KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, /*separator=*/true),
m_basket(basket)
{
- QVBox *page = makeVBoxMainWidget();
+ TQVBox *page = makeVBoxMainWidget();
- QWidget *wid = new QWidget(page);
- QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, KDialogBase::spacingHint());
+ TQWidget *wid = new TQWidget(page);
+ TQHBoxLayout *hLay = new TQHBoxLayout(wid, /*margin=*/0, KDialogBase::spacingHint());
m_url = new KURLRequester("", wid);
m_url->setCaption(i18n("HTML Page Filename"));
m_url->setFilter("text/html");
m_url->fileDialog()->setOperationMode(KFileDialog::Saving);
- hLay->addWidget( new QLabel(m_url, i18n("&Filename:"), wid) );
+ hLay->addWidget( new TQLabel(m_url, i18n("&Filename:"), wid) );
hLay->addWidget( m_url );
- m_embedLinkedFiles = new QCheckBox(i18n("&Embed linked local files"), page);
- m_embedLinkedFolders = new QCheckBox(i18n("Embed &linked local folders"), page);
- m_erasePreviousFiles = new QCheckBox(i18n("Erase &previous files in target folder"), page);
- m_formatForImpression = new QCheckBox(i18n("For&mat for impression"), page);
+ m_embedLinkedFiles = new TQCheckBox(i18n("&Embed linked local files"), page);
+ m_embedLinkedFolders = new TQCheckBox(i18n("Embed &linked local folders"), page);
+ m_erasePreviousFiles = new TQCheckBox(i18n("Erase &previous files in target folder"), page);
+ m_formatForImpression = new TQCheckBox(i18n("For&mat for impression"), page);
m_formatForImpression->hide();
load();
@@ -60,12 +60,12 @@ ExporterDialog::ExporterDialog(Basket *basket, QWidget *parent, const char *name
showTile(true);
// Add a stretch at the bottom:
- // Duplicated code from AddBasketWizard::addStretch(QWidget *parent):
- (new QWidget(page))->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ // Duplicated code from AddBasketWizard::addStretch(TQWidget *tqparent):
+ (new TQWidget(page))->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
// Double the width, because the filename should be visible
- QSize size(sizeHint());
- resize(QSize(size.width() * 2, size.height()));
+ TQSize size(tqsizeHint());
+ resize(TQSize(size.width() * 2, size.height()));
/*
==========================
+ [00000000000 ] Progress bar!
@@ -81,9 +81,9 @@ void ExporterDialog::show()
{
KDialogBase::show();
- QString lineEditText = m_url->lineEdit()->text();
- int selectionStart = lineEditText.findRev("/") + 1;
- m_url->lineEdit()->setSelection(selectionStart, lineEditText.length() - selectionStart - QString(".html").length());
+ TQString lineEditText = m_url->lineEdit()->text();
+ int selectionStart = lineEditText.tqfindRev("/") + 1;
+ m_url->lineEdit()->setSelection(selectionStart, lineEditText.length() - selectionStart - TQString(".html").length());
}
void ExporterDialog::load()
@@ -91,8 +91,8 @@ void ExporterDialog::load()
KConfig *config = KGlobal::config();
config->setGroup("HTML Export");
- QString folder = config->readEntry("lastFolder", QDir::homeDirPath()) + "/";
- QString url = folder + QString(m_basket->basketName()).replace("/", "_") + ".html";
+ TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
+ TQString url = folder + TQString(m_basket->basketName()).tqreplace("/", "_") + ".html";
m_url->setURL(url);
m_embedLinkedFiles->setChecked( config->readBoolEntry("embedLinkedFiles", true) );
@@ -106,7 +106,7 @@ void ExporterDialog::save()
KConfig *config = KGlobal::config();
config->setGroup("HTML Export");
- QString folder = KURL(m_url->url()).directory();
+ TQString folder = KURL(m_url->url()).directory();
config->writeEntry( "lastFolder", folder );
config->writeEntry( "embedLinkedFiles", m_embedLinkedFiles->isChecked() );
config->writeEntry( "embedLinkedFolders", m_embedLinkedFolders->isChecked() );
@@ -120,7 +120,7 @@ void ExporterDialog::slotOk()
KDialogBase::slotOk();
}
-QString ExporterDialog::filePath()
+TQString ExporterDialog::filePath()
{
return m_url->url();
}
diff --git a/src/exporterdialog.h b/src/exporterdialog.h
index af2e0cd..3fbcd12 100644
--- a/src/exporterdialog.h
+++ b/src/exporterdialog.h
@@ -24,8 +24,8 @@
#include <kdialogbase.h>
class KURLRequester;
-class QCheckBox;
-class QString;
+class TQCheckBox;
+class TQString;
class Basket;
@@ -35,10 +35,11 @@ class Basket;
class ExporterDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- ExporterDialog(Basket *basket, QWidget *parent = 0, const char *name = 0);
+ ExporterDialog(Basket *basket, TQWidget *tqparent = 0, const char *name = 0);
~ExporterDialog();
- QString filePath();
+ TQString filePath();
bool embedLinkedFiles();
bool embedLinkedFolders();
bool erasePreviousFiles();
@@ -51,10 +52,10 @@ class ExporterDialog : public KDialogBase
private:
Basket *m_basket;
KURLRequester *m_url;
- QCheckBox *m_embedLinkedFiles;
- QCheckBox *m_embedLinkedFolders;
- QCheckBox *m_erasePreviousFiles;
- QCheckBox *m_formatForImpression;
+ TQCheckBox *m_embedLinkedFiles;
+ TQCheckBox *m_embedLinkedFolders;
+ TQCheckBox *m_erasePreviousFiles;
+ TQCheckBox *m_formatForImpression;
};
#endif // EXPORTERDIALOG_H
diff --git a/src/filter.cpp b/src/filter.cpp
index 57aa4ae..9d4a74c 100644
--- a/src/filter.cpp
+++ b/src/filter.cpp
@@ -18,21 +18,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlayout.h>
+#include <tqlayout.h>
//#include <ktoolbarbutton.h>
-#include <qtoolbutton.h>
-#include <qlabel.h>
-//#include <qcombobox.h>
+#include <tqtoolbutton.h>
+#include <tqlabel.h>
+//#include <tqcombobox.h>
//#include <klineedit.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kglobalsettings.h>
#include <kapplication.h>
#include <kiconloader.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qpainter.h>
-#include <qbitmap.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqpainter.h>
+#include <tqbitmap.h>
#include <kdialogbase.h>
#include "filter.h"
@@ -45,28 +45,28 @@
/** FilterBar */
-FilterBar::FilterBar(QWidget *parent, const char *name)
- : QWidget(parent, name)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
+FilterBar::FilterBar(TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name)/*, m_blinkTimer(this), m_blinkedTimes(0)*/
{
- QHBoxLayout *hBox = new QHBoxLayout(this, /*margin*/0, /*spacing*/0);
+ TQHBoxLayout *hBox = new TQHBoxLayout(this, /*margin*/0, /*spacing*/0);
// Create every widgets:
- QIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar);
- QIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("find", KIcon::Toolbar);
+ TQIconSet resetIconSet = kapp->iconLoader()->loadIconSet("locationbar_erase", KIcon::Toolbar);
+ TQIconSet inAllIconSet = kapp->iconLoader()->loadIconSet("tqfind", KIcon::Toolbar);
- m_resetButton = new QToolButton(this);
+ m_resetButton = new TQToolButton(this);
m_resetButton->setIconSet(resetIconSet);
- m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, SLOT(reset()), 0);
+ m_resetButton->setTextLabel(i18n("Reset Filter"));//, /*groupText=*/"", this, TQT_SLOT(reset()), 0);
m_resetButton->setAutoRaise(true);
//new KToolBarButton("locationbar_erase", /*id=*/1230, this, /*name=*/0, i18n("Reset Filter"));
m_lineEdit = new FocusedLineEdit(this);
- QLabel *label = new QLabel(m_lineEdit, i18n("&Filter: "), this);
+ TQLabel *label = new TQLabel(m_lineEdit, i18n("&Filter: "), this);
m_tagsBox = new FocusedComboBox(this);
- QLabel *label2 = new QLabel(m_tagsBox, i18n("T&ag: "), this);
- m_inAllBasketsButton = new QToolButton(this);
+ TQLabel *label2 = new TQLabel(m_tagsBox, i18n("T&ag: "), this);
+ m_inAllBasketsButton = new TQToolButton(this);
m_inAllBasketsButton->setIconSet(inAllIconSet);
- m_inAllBasketsButton->setTextLabel(i18n("Filter all Baskets"));//, /*groupText=*/"", this, SLOT(inAllBaskets()), 0);
+ m_inAllBasketsButton->setTextLabel(i18n("Filter all Baskets"));//, /*groupText=*/"", this, TQT_SLOT(inAllBaskets()), 0);
m_inAllBasketsButton->setAutoRaise(true);
// Configure the Reset button:
@@ -96,18 +96,18 @@ FilterBar::FilterBar(QWidget *parent, const char *name)
m_data = new FilterData(); // TODO: Not a pointer! and return a const & !!
-// connect( &m_blinkTimer, SIGNAL(timeout()), this, SLOT(blinkBar()) );
- connect( m_resetButton, SIGNAL(clicked()), this, SLOT(reset()) );
- connect( m_lineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(textChanged(const QString&)) );
- connect( m_tagsBox, SIGNAL(activated(int)), this, SLOT(tagChanged(int)) );
+// connect( &m_blinkTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(blinkBar()) );
+ connect( m_resetButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reset()) );
+ connect( m_lineEdit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(textChanged(const TQString&)) );
+ connect( m_tagsBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(tagChanged(int)) );
-// connect( m_inAllBasketsButton, SIGNAL(clicked()), this, SLOT(inAllBaskets()) );
- connect( m_inAllBasketsButton, SIGNAL(toggled(bool)), Global::bnpView, SLOT(toggleFilterAllBaskets(bool)) );
+// connect( m_inAllBasketsButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(inAllBaskets()) );
+ connect( m_inAllBasketsButton, TQT_SIGNAL(toggled(bool)), Global::bnpView, TQT_SLOT(toggleFilterAllBaskets(bool)) );
- connect( m_lineEdit, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) );
- connect( m_lineEdit, SIGNAL(returnPressed()), this, SIGNAL(returnPressed()) );
- connect( m_tagsBox, SIGNAL(escapePressed()), this, SIGNAL(escapePressed()) );
- connect( m_tagsBox, SIGNAL(returnPressed2()), this, SIGNAL(returnPressed()) );
+ connect( m_lineEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(escapePressed()) );
+ connect( m_lineEdit, TQT_SIGNAL(returnPressed()), this, TQT_SIGNAL(returnPressed()) );
+ connect( m_tagsBox, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(escapePressed()) );
+ connect( m_tagsBox, TQT_SIGNAL(returnPressed2()), this, TQT_SIGNAL(returnPressed()) );
}
FilterBar::~FilterBar()
@@ -154,9 +154,9 @@ void FilterBar::repopulateTagsComnbo()
int index = 3;
Tag *tag;
State *state;
- QString icon;
- QString text;
- QPixmap emblem;
+ TQString icon;
+ TQString text;
+ TQPixmap emblem;
for (Tag::List::iterator it = Tag::all.begin(); it != Tag::all.end(); ++it) {
tag = *it;
state = tag->states().first();
@@ -206,7 +206,7 @@ void FilterBar::filterTag(Tag *tag)
{
int index = 0;
- for (QMap<int, Tag*>::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it)
+ for (TQMap<int, Tag*>::Iterator it = m_tagsMap.begin(); it != m_tagsMap.end(); ++it)
if (it.data() == tag) {
index = it.key();
break;
@@ -224,7 +224,7 @@ void FilterBar::filterState(State *state)
{
int index = 0;
- for (QMap<int, State*>::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it)
+ for (TQMap<int, State*>::Iterator it = m_statesMap.begin(); it != m_statesMap.end(); ++it)
if (it.data() == state) {
index = it.key();
break;
@@ -258,7 +258,7 @@ const FilterData& FilterBar::filterData()
return *m_data;
}
-void FilterBar::textChanged(const QString &text)
+void FilterBar::textChanged(const TQString &text)
{
m_data->string = text;
m_data->isFiltering = (!m_data->string.isEmpty() || m_data->tagFilterType != FilterData::DontCareTagsFilter);
@@ -282,13 +282,13 @@ void FilterBar::tagChanged(int index)
break;
default:
// Try to find if we are filtering a tag:
- QMapIterator<int, Tag*> it = m_tagsMap.find(index);
+ TQMapIterator<int, Tag*> it = m_tagsMap.tqfind(index);
if (it != m_tagsMap.end()) {
m_data->tagFilterType = FilterData::TagFilter;
m_data->tag = *it;
} else {
// If not, try to find if we are filtering a state:
- QMapIterator<int, State*> it2 = m_statesMap.find(index);
+ TQMapIterator<int, State*> it2 = m_statesMap.tqfind(index);
if (it2 != m_statesMap.end()) {
m_data->tagFilterType = FilterData::StateFilter;
m_data->state = *it2;
diff --git a/src/filter.h b/src/filter.h
index 56bea49..d826c50 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -21,12 +21,12 @@
#ifndef FILTER_H
#define FILTER_H
-#include <qwidget.h>
-#include <qmap.h>
+#include <tqwidget.h>
+#include <tqmap.h>
#include "focusedwidgets.h"
-class QToolButton;
+class TQToolButton;
class Tag;
class State;
@@ -43,21 +43,22 @@ class FilterData
FilterData() { isFiltering = false; tagFilterType = DontCareTagsFilter; tag = 0; state = 0; }
~FilterData() {}
// Filter data:
- QString string;
+ TQString string;
int tagFilterType;
Tag *tag;
State *state;
bool isFiltering;
};
-/** A QWidget that allow user to enter terms to filter in a Basket.
+/** A TQWidget that allow user to enter terms to filter in a Basket.
* @author Sébastien Laoût
*/
-class FilterBar : public QWidget
+class FilterBar : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- FilterBar(QWidget *parent = 0, const char *name = 0);
+ FilterBar(TQWidget *tqparent = 0, const char *name = 0);
~FilterBar();
const FilterData& filterData();
signals:
@@ -77,17 +78,17 @@ class FilterBar : public QWidget
bool hasEditFocus();
KLineEdit* lineEdit() { return m_lineEdit; }
private slots:
- void textChanged(const QString &text);
+ void textChanged(const TQString &text);
void tagChanged(int index);
private:
FilterData *m_data;
FocusedLineEdit *m_lineEdit;
- QToolButton *m_resetButton;
+ TQToolButton *m_resetButton;
FocusedComboBox *m_tagsBox;
- QToolButton *m_inAllBasketsButton;
+ TQToolButton *m_inAllBasketsButton;
- QMap<int, Tag*> m_tagsMap;
- QMap<int, State*> m_statesMap;
+ TQMap<int, Tag*> m_tagsMap;
+ TQMap<int, State*> m_statesMap;
};
#endif // FILTER_H
diff --git a/src/focusedwidgets.cpp b/src/focusedwidgets.cpp
index 05c8b84..429d260 100644
--- a/src/focusedwidgets.cpp
+++ b/src/focusedwidgets.cpp
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <klocale.h>
#include <iostream>
@@ -31,15 +31,15 @@
#ifdef KeyPress
#undef KeyPress
#endif
-#include <qevent.h>
+#include <tqevent.h>
/** class FocusedTextEdit */
-FocusedTextEdit::FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent, const char *name)
- : KTextEdit(parent, name),
+FocusedTextEdit::FocusedTextEdit(bool disableUpdatesOnKeyPress, TQWidget *tqparent, const char *name)
+ : KTextEdit(tqparent, name),
m_disableUpdatesOnKeyPress(disableUpdatesOnKeyPress)
{
- setWFlags(Qt::WNoAutoErase); // Does not work, we still need the disableUpdatesOnKeyPress hack!
+ setWFlags(TQt::WNoAutoErase); // Does not work, we still need the disableUpdatesOnKeyPress hack!
}
FocusedTextEdit::~FocusedTextEdit()
@@ -56,8 +56,8 @@ FocusedTextEdit::~FocusedTextEdit()
*/
void FocusedTextEdit::paste()
{
- adaptClipboardText(QClipboard::Selection);
- adaptClipboardText(QClipboard::Clipboard);
+ adaptClipboardText(TQClipboard::Selection);
+ adaptClipboardText(TQClipboard::Clipboard);
// If we paste a application/x-qrichtext content starting with a "-" or a "*",
// then auto-bulletting will crash.
@@ -67,14 +67,14 @@ void FocusedTextEdit::paste()
// uint oldAutoFormating = autoFormatting();
// setAutoFormatting(AutoNone);
- QClipboard *clipboard = QApplication::clipboard();
+ TQClipboard *clipboard = TQApplication::tqclipboard();
int paragraph;
int index;
getCursorPosition(&paragraph, &index);
bool preventAutoBullet = (index == 0) &&
- (clipboard->data(QClipboard::Selection)->provides("application/x-qrichtext") ||
- clipboard->data(QClipboard::Clipboard)->provides("application/x-qrichtext") );
+ (clipboard->data(TQClipboard::Selection)->provides("application/x-qrichtext") ||
+ clipboard->data(TQClipboard::Clipboard)->provides("application/x-qrichtext") );
if (preventAutoBullet)
insert(" ");
@@ -105,49 +105,49 @@ void FocusedTextEdit::paste()
* specified 'mode' -, replaces all '\n' within that text and writes
* it back to the clipboard.
*/
-void FocusedTextEdit::adaptClipboardText(QClipboard::Mode mode)
+void FocusedTextEdit::adaptClipboardText(TQClipboard::Mode mode)
{
- QClipboard *clipboard = QApplication::clipboard();
+ TQClipboard *clipboard = TQApplication::tqclipboard();
if (!clipboard)
return;
- if ( (textFormat() == Qt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) {
- QString text = clipboard->text(mode);
+ if ( (textFormat() == TQt::RichText) && (!clipboard->data(mode)->provides("application/x-qrichtext")) ) {
+ TQString text = clipboard->text(mode);
if (text) {
- text = text.replace("\n", QChar(0x2028));
+ text = text.tqreplace("\n", TQChar(0x2028));
clipboard->setText(text, mode);
}
}
}
-QTextCursor* FocusedTextEdit::textCursor() const
+TQTextCursor* FocusedTextEdit::textCursor() const
{
return KTextEdit::textCursor();
}
-void FocusedTextEdit::keyPressEvent(QKeyEvent *event)
+void FocusedTextEdit::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape) {
+ if (event->key() == TQt::Key_Escape) {
emit escapePressed();
return;
// In RichTextFormat mode, [Return] create a new paragraphe.
// To keep consistency with TextFormat mode (new line on [Return]),
// we redirect [Return] to simulate [Ctrl+Return] (create a new line in both modes).
// Create new paragraphes still possible in RichTextFormat mode with [Shift+Enter].
- } else if (event->key() == Qt::Key_Return && event->state() == 0)
- event = new QKeyEvent(QEvent::KeyPress, event->key(), event->ascii(), Qt::ControlButton,
+ } else if (event->key() == TQt::Key_Return && event->state() == 0)
+ event = new TQKeyEvent(TQEvent::KeyPress, event->key(), event->ascii(), TQt::ControlButton,
event->text(), event->isAutoRepeat(), event->count() );
- else if (event->key() == Qt::Key_Return && event->state() & Qt::ControlButton)
- event = new QKeyEvent(QEvent::KeyPress, event->key(), event->ascii(), Qt::ShiftButton,
+ else if (event->key() == TQt::Key_Return && event->state() & TQt::ControlButton)
+ event = new TQKeyEvent(TQEvent::KeyPress, event->key(), event->ascii(), TQt::ShiftButton,
event->text(), event->isAutoRepeat(), event->count() );
if (m_disableUpdatesOnKeyPress)
setUpdatesEnabled(false);
KTextEdit::keyPressEvent(event);
// Workarround (for ensuring the cursor to be visible): signal not emited when pressing those keys:
- if (event->key() == Qt::Key_Home || event->key() == Qt::Key_End || event->key() == Qt::Key_PageUp || event->key() == Qt::Key_PageDown) {
+ if (event->key() == TQt::Key_Home || event->key() == TQt::Key_End || event->key() == TQt::Key_PageUp || event->key() == TQt::Key_PageDown) {
int para;
int index;
getCursorPosition(&para, &index);
@@ -163,7 +163,7 @@ void FocusedTextEdit::keyPressEvent(QKeyEvent *event)
}
}
-void FocusedTextEdit::wheelEvent(QWheelEvent *event)
+void FocusedTextEdit::wheelEvent(TQWheelEvent *event)
{
if (event->delta() > 0 && contentsY() > 0) {
KTextEdit::wheelEvent(event);
@@ -175,15 +175,15 @@ void FocusedTextEdit::wheelEvent(QWheelEvent *event)
Global::bnpView->currentBasket()->wheelEvent(event);
}
-void FocusedTextEdit::enterEvent(QEvent *event)
+void FocusedTextEdit::enterEvent(TQEvent *event)
{
emit mouseEntered();
KTextEdit::enterEvent(event);
}
-QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos)
+TQPopupMenu* FocusedTextEdit::createPopupMenu(const TQPoint &pos)
{
- QPopupMenu *menu = KTextEdit::createPopupMenu(pos);
+ TQPopupMenu *menu = KTextEdit::createPopupMenu(pos);
int index = 0;
int id = 0;
@@ -192,7 +192,7 @@ QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos)
if (id == -1)
break;
// Disable Spell Check for rich text editors, because it doesn't work anyway:
- if (textFormat() == Qt::RichText && (menu->text(id) == i18n("Auto Spell Check") || menu->text(id) == i18n("Check Spelling...")))
+ if (textFormat() == TQt::RichText && (menu->text(id) == i18n("Auto Spell Check") || menu->text(id) == i18n("Check Spelling...")))
menu->setItemEnabled(id, false);
// Always enable tabulations!:
if (menu->text(id) == i18n("Allow Tabulations"))
@@ -206,8 +206,8 @@ QPopupMenu* FocusedTextEdit::createPopupMenu(const QPoint &pos)
/** class FocusedColorCombo: */
-FocusedColorCombo::FocusedColorCombo(QWidget *parent, const char *name)
- : KColorCombo(parent, name)
+FocusedColorCombo::FocusedColorCombo(TQWidget *tqparent, const char *name)
+ : KColorCombo(tqparent, name)
{
}
@@ -215,11 +215,11 @@ FocusedColorCombo::~FocusedColorCombo()
{
}
-void FocusedColorCombo::keyPressEvent(QKeyEvent *event)
+void FocusedColorCombo::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape)
+ if (event->key() == TQt::Key_Escape)
emit escapePressed();
- else if (event->key() == Qt::Key_Return)
+ else if (event->key() == TQt::Key_Return)
emit returnPressed2();
else
KColorCombo::keyPressEvent(event);
@@ -227,8 +227,8 @@ void FocusedColorCombo::keyPressEvent(QKeyEvent *event)
/** class FocusedFontCombo: */
-FocusedFontCombo::FocusedFontCombo(QWidget *parent, const char *name)
- : KFontCombo(parent, name)
+FocusedFontCombo::FocusedFontCombo(TQWidget *tqparent, const char *name)
+ : KFontCombo(tqparent, name)
{
}
@@ -236,11 +236,11 @@ FocusedFontCombo::~FocusedFontCombo()
{
}
-void FocusedFontCombo::keyPressEvent(QKeyEvent *event)
+void FocusedFontCombo::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape)
+ if (event->key() == TQt::Key_Escape)
emit escapePressed();
- else if (event->key() == Qt::Key_Return)
+ else if (event->key() == TQt::Key_Return)
emit returnPressed2();
else
KFontCombo::keyPressEvent(event);
@@ -248,8 +248,8 @@ void FocusedFontCombo::keyPressEvent(QKeyEvent *event)
/** class FocusedComboBox: */
-FocusedComboBox::FocusedComboBox(QWidget *parent, const char *name)
- : KComboBox(parent, name)
+FocusedComboBox::FocusedComboBox(TQWidget *tqparent, const char *name)
+ : KComboBox(tqparent, name)
{
}
@@ -257,11 +257,11 @@ FocusedComboBox::~FocusedComboBox()
{
}
-void FocusedComboBox::keyPressEvent(QKeyEvent *event)
+void FocusedComboBox::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape)
+ if (event->key() == TQt::Key_Escape)
emit escapePressed();
- else if (event->key() == Qt::Key_Return)
+ else if (event->key() == TQt::Key_Return)
emit returnPressed2();
else
KComboBox::keyPressEvent(event);
@@ -269,8 +269,8 @@ void FocusedComboBox::keyPressEvent(QKeyEvent *event)
/** class FocusedLineEdit: */
-FocusedLineEdit::FocusedLineEdit(QWidget *parent, const char *name)
- : KLineEdit(parent, name)
+FocusedLineEdit::FocusedLineEdit(TQWidget *tqparent, const char *name)
+ : KLineEdit(tqparent, name)
{
}
@@ -278,15 +278,15 @@ FocusedLineEdit::~FocusedLineEdit()
{
}
-void FocusedLineEdit::keyPressEvent(QKeyEvent *event)
+void FocusedLineEdit::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape)
+ if (event->key() == TQt::Key_Escape)
emit escapePressed();
else
KLineEdit::keyPressEvent(event);
}
-void FocusedLineEdit::enterEvent(QEvent *event)
+void FocusedLineEdit::enterEvent(TQEvent *event)
{
emit mouseEntered();
KLineEdit::enterEvent(event);
diff --git a/src/focusedwidgets.h b/src/focusedwidgets.h
index 4d1bfcb..dc188e5 100644
--- a/src/focusedwidgets.h
+++ b/src/focusedwidgets.h
@@ -27,22 +27,23 @@
#include <kcombobox.h>
#include <klineedit.h>
#include <kapplication.h>
-#include <qclipboard.h>
+#include <tqclipboard.h>
class FocusedTextEdit : public KTextEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
- FocusedTextEdit(bool disableUpdatesOnKeyPress, QWidget *parent = 0, const char *name = 0);
+ FocusedTextEdit(bool disableUpdatesOnKeyPress, TQWidget *tqparent = 0, const char *name = 0);
~FocusedTextEdit();
void paste();
- QTextCursor* textCursor() const;
+ TQTextCursor* textCursor() const;
protected:
- void adaptClipboardText(QClipboard::Mode mode);
- void keyPressEvent(QKeyEvent *event);
- void wheelEvent(QWheelEvent *event);
- void enterEvent(QEvent *event);
- QPopupMenu* createPopupMenu(const QPoint &pos);
+ void adaptClipboardText(TQClipboard::Mode mode);
+ void keyPressEvent(TQKeyEvent *event);
+ void wheelEvent(TQWheelEvent *event);
+ void enterEvent(TQEvent *event);
+ TQPopupMenu* createPopupMenu(const TQPoint &pos);
signals:
void escapePressed();
void mouseEntered();
@@ -54,11 +55,12 @@ class FocusedTextEdit : public KTextEdit
class FocusedColorCombo : public KColorCombo
{
Q_OBJECT
+ TQ_OBJECT
public:
- FocusedColorCombo(QWidget *parent = 0, const char *name = 0);
+ FocusedColorCombo(TQWidget *tqparent = 0, const char *name = 0);
~FocusedColorCombo();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
signals:
void escapePressed();
void returnPressed2();
@@ -68,11 +70,12 @@ class FocusedColorCombo : public KColorCombo
class FocusedFontCombo : public KFontCombo
{
Q_OBJECT
+ TQ_OBJECT
public:
- FocusedFontCombo(QWidget *parent = 0, const char *name = 0);
+ FocusedFontCombo(TQWidget *tqparent = 0, const char *name = 0);
~FocusedFontCombo();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
signals:
void escapePressed();
void returnPressed2();
@@ -82,11 +85,12 @@ class FocusedFontCombo : public KFontCombo
class FocusedComboBox : public KComboBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- FocusedComboBox(QWidget *parent = 0, const char *name = 0);
+ FocusedComboBox(TQWidget *tqparent = 0, const char *name = 0);
~FocusedComboBox();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
signals:
void escapePressed();
void returnPressed2();
@@ -96,12 +100,13 @@ class FocusedComboBox : public KComboBox
class FocusedLineEdit : public KLineEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
- FocusedLineEdit(QWidget *parent = 0, const char *name = 0);
+ FocusedLineEdit(TQWidget *tqparent = 0, const char *name = 0);
~FocusedLineEdit();
protected:
- void keyPressEvent(QKeyEvent *event);
- void enterEvent(QEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
+ void enterEvent(TQEvent *event);
signals:
void escapePressed();
void mouseEntered();
diff --git a/src/formatimporter.cpp b/src/formatimporter.cpp
index c98ad38..1d203ca 100644
--- a/src/formatimporter.cpp
+++ b/src/formatimporter.cpp
@@ -18,11 +18,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qdom.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqdom.h>
#include <kglobalsettings.h>
#include <kmessagebox.h>
#include <klocale.h>
@@ -46,29 +46,29 @@ bool FormatImporter::shouldImportBaskets()
return false;
// ... And there is at least one folder in the save folder, with a ".basket" file inside that folder.
- QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
- QStringList list = dir.entryList();
- for (QStringList::Iterator it = list.begin(); it != list.end(); ++it)
+ TQDir dir(Global::savesFolder(), TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Dirs | TQDir::NoSymLinks);
+ TQStringList list = dir.entryList();
+ for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it)
if (*it != "." && *it != ".." && dir.exists(Global::savesFolder() + *it + "/.basket"))
return true;
return false;
}
-void FormatImporter::copyFolder(const QString &folder, const QString &newFolder)
+void FormatImporter::copyFolder(const TQString &folder, const TQString &newFolder)
{
copyFinished = false;
KIO::CopyJob *copyJob = KIO::copyAs(KURL(folder), KURL(newFolder), /*showProgressInfo=*/false);
- connect( copyJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotCopyingDone(KIO::Job*)) );
+ connect( copyJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotCopyingDone(KIO::Job*)) );
while (!copyFinished)
kapp->processEvents();
}
-void FormatImporter::moveFolder(const QString &folder, const QString &newFolder)
+void FormatImporter::moveFolder(const TQString &folder, const TQString &newFolder)
{
copyFinished = false;
KIO::CopyJob *copyJob = KIO::moveAs(KURL(folder), KURL(newFolder), /*showProgressInfo=*/false);
- connect( copyJob, SIGNAL(result(KIO::Job*)), this, SLOT(slotCopyingDone(KIO::Job*)) );
+ connect( copyJob, TQT_SIGNAL(result(KIO::Job*)), this, TQT_SLOT(slotCopyingDone(KIO::Job*)) );
while (!copyFinished)
kapp->processEvents();
}
@@ -84,24 +84,24 @@ void FormatImporter::importBaskets()
std::cout << "Import Baskets: Preparing..." << std::endl;
// Some preliminary preparations (create the destination folders and the basket tree file):
- QDir dirPrep;
+ TQDir dirPrep;
dirPrep.mkdir(Global::savesFolder());
dirPrep.mkdir(Global::basketsFolder());
- QDomDocument document("basketTree");
- QDomElement root = document.createElement("basketTree");
+ TQDomDocument document("basketTree");
+ TQDomElement root = document.createElement("basketTree");
document.appendChild(root);
// First up, establish a list of every baskets, ensure the old order (if any), and count them.
- QStringList baskets;
+ TQStringList baskets;
// Read the 0.5.0 baskets order:
- QDomDocument *doc = XMLWork::openFile("container", Global::savesFolder() + "container.baskets");
+ TQDomDocument *doc = XMLWork::openFile("container", Global::savesFolder() + "container.baskets");
if (doc != 0) {
- QDomElement docElem = doc->documentElement();
- QDomElement basketsElem = XMLWork::getElement(docElem, "baskets");
- QDomNode n = basketsElem.firstChild();
+ TQDomElement docElem = doc->documentElement();
+ TQDomElement basketsElem = XMLWork::getElement(docElem, "baskets");
+ TQDomNode n = basketsElem.firstChild();
while (!n.isNull()) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if ((!e.isNull()) && e.tagName() == "basket")
baskets.append(e.text());
n = n.nextSibling();
@@ -109,35 +109,35 @@ void FormatImporter::importBaskets()
}
// Then load the baskets that weren't loaded (import < 0.5.0 ones):
- QDir dir(Global::savesFolder(), QString::null, QDir::Name | QDir::IgnoreCase, QDir::Dirs | QDir::NoSymLinks);
- QStringList list = dir.entryList();
+ TQDir dir(Global::savesFolder(), TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Dirs | TQDir::NoSymLinks);
+ TQStringList list = dir.entryList();
if (list.count() > 2) // Pass "." and ".."
- for (QStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder
+ for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it) // For each folder
if (*it != "." && *it != ".." && dir.exists(Global::savesFolder() + *it + "/.basket")) // If it can be a basket folder
- if ( baskets.find((*it) + "/") == baskets.end() &&
- baskets.find(*it) == baskets.end() ) // And if it is not already in the imported baskets list
+ if ( baskets.tqfind((*it) + "/") == baskets.end() &&
+ baskets.tqfind(*it) == baskets.end() ) // And if it is not already in the imported baskets list
baskets.append(*it);
std::cout << "Import Baskets: Found " << baskets.count() << " baskets to import." << std::endl;
// Import every baskets:
int i = 0;
- for (QStringList::iterator it = baskets.begin(); it != baskets.end(); ++it) {
+ for (TQStringList::iterator it = baskets.begin(); it != baskets.end(); ++it) {
++i;
std::cout << "Import Baskets: Importing basket " << i << " of " << baskets.count() << "..." << std::endl;
// Move the folder to the new repository (normal basket) or copy the folder (mirorred folder):
- QString folderName = *it;
+ TQString folderName = *it;
if (folderName.startsWith("/")) { // It was a folder mirror:
KMessageBox::information(0, i18n("<p>Folder mirroring is not possible anymore (see <a href='http://basket.kde.org/'>basket.kde.org</a> for more information).</p>"
"<p>The folder <b>%1</b> has been copied for the basket needs. You can either delete this folder or delete the basket, or use both. But remember that "
- "modifying one will not modify the other anymore as they are now separate entities.</p>").arg(folderName), i18n("Folder Mirror Import"),
+ "modifying one will not modify the other anymore as they are now separate entities.</p>").tqarg(folderName), i18n("Folder Mirror Import"),
"", KMessageBox::AllowLink);
// Also modify folderName to be only the folder name and not the full path anymore:
- QString newFolderName = folderName;
+ TQString newFolderName = folderName;
if (newFolderName.endsWith("/"))
newFolderName = newFolderName.left(newFolderName.length() - 1);
- newFolderName = newFolderName.mid(newFolderName.findRev('/') + 1);
+ newFolderName = newFolderName.mid(newFolderName.tqfindRev('/') + 1);
newFolderName = Tools::fileNameForNewFile(newFolderName, Global::basketsFolder());
FormatImporter f;
f.copyFolder(folderName, Global::basketsFolder() + newFolderName);
@@ -146,10 +146,10 @@ void FormatImporter::importBaskets()
dir.rename(Global::savesFolder() + folderName, Global::basketsFolder() + folderName); // Move the folder
// Import the basket structure file and get the properties (to add them in the tree basket-properties cache):
- QDomElement properties = importBasket(folderName);
+ TQDomElement properties = importBasket(folderName);
// Add it to the XML document:
- QDomElement basketElement = document.createElement("basket");
+ TQDomElement basketElement = document.createElement("basket");
root.appendChild(basketElement);
basketElement.setAttribute("folderName", folderName);
basketElement.appendChild(properties);
@@ -158,11 +158,11 @@ void FormatImporter::importBaskets()
// Finalize (write to disk and delete now useless files):
std::cout << "Import Baskets: Finalizing..." << std::endl;
- QFile file(Global::basketsFolder() + "baskets.xml");
+ TQFile file(Global::basketsFolder() + "baskets.xml");
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
- QString xml = document.toString();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString xml = document.toString();
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
stream << xml;
file.close();
@@ -174,68 +174,68 @@ void FormatImporter::importBaskets()
std::cout << "Import Baskets: Finished." << std::endl;
}
-QDomElement FormatImporter::importBasket(const QString &folderName)
+TQDomElement FormatImporter::importBasket(const TQString &folderName)
{
// Load the XML file:
- QDomDocument *document = XMLWork::openFile("basket", Global::basketsFolder() + folderName + "/.basket");
+ TQDomDocument *document = XMLWork::openFile("basket", Global::basketsFolder() + folderName + "/.basket");
if (!document) {
std::cout << "Import Baskets: Failed to read the basket file!" << std::endl;
- return QDomElement();
+ return TQDomElement();
}
- QDomElement docElem = document->documentElement();
+ TQDomElement docElem = document->documentElement();
// Import properties (change <background color=""> to <appearance backgroundColor="">, and figure out if is a checklist or not):
- QDomElement properties = XMLWork::getElement(docElem, "properties");
- QDomElement background = XMLWork::getElement(properties, "background");
- QColor backgroundColor = QColor(background.attribute("color"));
+ TQDomElement properties = XMLWork::getElement(docElem, "properties");
+ TQDomElement background = XMLWork::getElement(properties, "background");
+ TQColor backgroundColor = TQColor(background.attribute("color"));
if (backgroundColor.isValid() && (backgroundColor != KGlobalSettings::baseColor())) { // Use the default color if it was already that color:
- QDomElement appearance = document->createElement("appearance");
+ TQDomElement appearance = document->createElement("appearance");
appearance.setAttribute("backgroundColor", backgroundColor.name());
properties.appendChild(appearance);
}
- QDomElement disposition = document->createElement("disposition");
+ TQDomElement disposition = document->createElement("disposition");
disposition.setAttribute("mindMap", "false");
disposition.setAttribute("columnCount", "1");
disposition.setAttribute("free", "false");
bool isCheckList = XMLWork::trueOrFalse( XMLWork::getElementText(properties, "showCheckBoxes", false) );
// Insert all notes in a group (column): 1/ rename "items" to "group", 2/ add "notes" to root, 3/ move "group" into "notes"
- QDomElement column = XMLWork::getElement(docElem, "items");
+ TQDomElement column = XMLWork::getElement(docElem, "items");
column.setTagName("group");
- QDomElement notes = document->createElement("notes");
+ TQDomElement notes = document->createElement("notes");
notes.appendChild(column);
docElem.appendChild(notes);
// Import notes from older representations:
- QDomNode n = column.firstChild();
+ TQDomNode n = column.firstChild();
while ( ! n.isNull() ) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
if (!e.isNull()) {
e.setTagName("note");
- QDomElement content = XMLWork::getElement(e, "content");
+ TQDomElement content = XMLWork::getElement(e, "content");
// Add Check tag:
if (isCheckList) {
bool isChecked = XMLWork::trueOrFalse(e.attribute("checked", "false"));
XMLWork::addElement(*document, e, "tags", (isChecked ? "todo_done" : "todo_unchecked"));
}
// Import annotations as folded groups:
- QDomElement parentE = column;
- QString annotations = XMLWork::getElementText(e, "annotations", "");
+ TQDomElement tqparentE = column;
+ TQString annotations = XMLWork::getElementText(e, "annotations", "");
if (!annotations.isEmpty()) {
- QDomElement annotGroup = document->createElement("group");
+ TQDomElement annotGroup = document->createElement("group");
column.insertBefore(annotGroup, e);
annotGroup.setAttribute("folded", "true");
annotGroup.appendChild(e);
- parentE = annotGroup;
+ tqparentE = annotGroup;
// Create the text note and add it to the DOM tree:
- QDomElement annotNote = document->createElement("note");
+ TQDomElement annotNote = document->createElement("note");
annotNote.setAttribute("type", "text");
annotGroup.appendChild(annotNote);
- QString annotFileName = Tools::fileNameForNewFile("annotations1.txt", Basket::fullPathForFolderName(folderName));
- QString annotFullPath = Basket::fullPathForFolderName(folderName) + "/" + annotFileName;
- QFile file(annotFullPath);
+ TQString annotFileName = Tools::fileNameForNewFile("annotations1.txt", Basket::fullPathForFolderName(folderName));
+ TQString annotFullPath = Basket::fullPathForFolderName(folderName) + "/" + annotFileName;
+ TQFile file(annotFullPath);
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
+ TQTextStream stream(&file);
stream << annotations;
file.close();
}
@@ -243,35 +243,35 @@ QDomElement FormatImporter::importBasket(const QString &folderName)
n = annotGroup;
}
// Import Launchers from 0.3.x, 0.4.0 and 0.5.0-alphas:
- QString runCommand = e.attribute("runcommand"); // Keep compatibility with 0.4.0 and 0.5.0-alphas versions
+ TQString runCommand = e.attribute("runcommand"); // Keep compatibility with 0.4.0 and 0.5.0-alphas versions
runCommand = XMLWork::getElementText(e, "action", runCommand); // Keep compatibility with 0.3.x versions
if ( ! runCommand.isEmpty() ) { // An import should be done
// Prepare the launcher note:
- QString title = content.attribute("title", "");
- QString icon = content.attribute("icon", "");
+ TQString title = content.attribute("title", "");
+ TQString icon = content.attribute("icon", "");
if (title.isEmpty()) title = runCommand;
if (icon.isEmpty()) icon = NoteFactory::iconForCommand(runCommand);
// Import the launcher note:
- // Adapted version of "QString launcherName = NoteFactory::createNoteLauncherFile(runCommand, title, icon, this)":
- QString launcherContent = QString(
+ // Adapted version of "TQString launcherName = NoteFactory::createNoteLauncherFile(runCommand, title, icon, this)":
+ TQString launcherContent = TQString(
"[Desktop Entry]\n"
"Exec=%1\n"
"Name=%2\n"
"Icon=%3\n"
"Encoding=UTF-8\n"
- "Type=Application\n").arg(runCommand, title, icon.isEmpty() ? QString("exec") : icon);
- QString launcherFileName = Tools::fileNameForNewFile("launcher.desktop", Global::basketsFolder() + folderName /*+ "/"*/);
- QString launcherFullPath = Global::basketsFolder() + folderName /*+ "/"*/ + launcherFileName;
- QFile file(launcherFullPath);
+ "Type=Application\n").tqarg(runCommand, title, icon.isEmpty() ? TQString("exec") : icon);
+ TQString launcherFileName = Tools::fileNameForNewFile("launcher.desktop", Global::basketsFolder() + folderName /*+ "/"*/);
+ TQString launcherFullPath = Global::basketsFolder() + folderName /*+ "/"*/ + launcherFileName;
+ TQFile file(launcherFullPath);
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << launcherContent;
file.close();
}
// Add the element to the DOM:
- QDomElement launcherElem = document->createElement("note");
- parentE.insertBefore(launcherElem, e);
+ TQDomElement launcherElem = document->createElement("note");
+ tqparentE.insertBefore(launcherElem, e);
launcherElem.setAttribute("type", "launcher");
XMLWork::addElement(*document, launcherElem, "content", launcherFileName);
}
@@ -288,11 +288,11 @@ QDomElement FormatImporter::importBasket(const QString &folderName)
}
// Save the resulting XML file:
- QFile file(Global::basketsFolder() + folderName + "/.basket");
+ TQFile file(Global::basketsFolder() + folderName + "/.basket");
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
-// QString xml = document->toString();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+// TQString xml = document->toString();
// stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
// stream << xml;
stream << document->toString(); // Document is ALREADY using UTF-8
diff --git a/src/formatimporter.h b/src/formatimporter.h
index 18c8af8..fffda7a 100644
--- a/src/formatimporter.h
+++ b/src/formatimporter.h
@@ -21,9 +21,9 @@
#ifndef FORMATIMPORTER_H
#define FORMATIMPORTER_H
-#include <qobject.h>
-//#include <qwidget.h>
-#include <qdom.h>
+#include <tqobject.h>
+//#include <tqwidget.h>
+#include <tqdom.h>
namespace KIO {
class Job;
@@ -32,16 +32,17 @@ namespace KIO {
/**
* @author S�astien Laot
*/
-class FormatImporter : QObject
+class FormatImporter : TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
static bool shouldImportBaskets();
static void importBaskets();
- static QDomElement importBasket(const QString &folderName);
+ static TQDomElement importBasket(const TQString &folderName);
- void copyFolder(const QString &folder, const QString &newFolder);
- void moveFolder(const QString &folder, const QString &newFolder);
+ void copyFolder(const TQString &folder, const TQString &newFolder);
+ void moveFolder(const TQString &folder, const TQString &newFolder);
private slots:
void slotCopyingDone(KIO::Job*);
private:
diff --git a/src/global.cpp b/src/global.cpp
index 7645248..f8b6f74 100644
--- a/src/global.cpp
+++ b/src/global.cpp
@@ -20,11 +20,11 @@
#include <kglobal.h>
#include <kstandarddirs.h>
-#include <qstring.h>
+#include <tqstring.h>
#include <kaction.h>
#include <kapplication.h>
#include <kmainwindow.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kdebug.h>
#include <kconfig.h>
@@ -34,7 +34,7 @@
/** Define initial values for global variables : */
-QString Global::s_customSavesFolder = "";
+TQString Global::s_customSavesFolder = "";
LikeBack *Global::likeBack = 0L;
DebugWindow *Global::debugWindow = 0L;
BackgroundManager *Global::backgroundManager = 0L;
@@ -44,46 +44,46 @@ KGlobalAccel *Global::globalAccel = 0L;
KConfig *Global::basketConfig = 0L;
AboutData Global::basketAbout;
-void Global::setCustomSavesFolder(const QString &folder)
+void Global::setCustomSavesFolder(const TQString &folder)
{
s_customSavesFolder = folder;
}
#include <iostream>
-QString Global::savesFolder()
+TQString Global::savesFolder()
{
- static QString *folder = 0L; // Memorize the folder to do not have to re-compute it each time it's needed
+ static TQString *folder = 0L; // Memorize the folder to do not have to re-compute it each time it's needed
if (folder == 0L) { // Initialize it if not yet done
if (!s_customSavesFolder.isEmpty()) { // Passed by command line (for development & debug purpose)
- QDir dir;
+ TQDir dir;
dir.mkdir(s_customSavesFolder);
- folder = new QString(s_customSavesFolder.endsWith("/") ? s_customSavesFolder : s_customSavesFolder + "/");
+ folder = new TQString(s_customSavesFolder.endsWith("/") ? s_customSavesFolder : s_customSavesFolder + "/");
} else if (!Settings::dataFolder().isEmpty()) { // Set by config option (in Basket -> Backup & Restore)
- QDir dir;
+ TQDir dir;
dir.mkdir(s_customSavesFolder);
- folder = new QString(Settings::dataFolder().endsWith("/") ? Settings::dataFolder() : Settings::dataFolder() + "/");
+ folder = new TQString(Settings::dataFolder().endsWith("/") ? Settings::dataFolder() : Settings::dataFolder() + "/");
} else { // The default path (should be that for most computers)
- folder = new QString(KGlobal::dirs()->saveLocation("data", "basket/"));
+ folder = new TQString(KGlobal::dirs()->saveLocation("data", "basket/"));
}
}
return *folder;
}
-QString Global::basketsFolder() { return savesFolder() + "baskets/"; }
-QString Global::backgroundsFolder() { return savesFolder() + "backgrounds/"; }
-QString Global::templatesFolder() { return savesFolder() + "templates/"; }
-QString Global::tempCutFolder() { return savesFolder() + "temp-cut/"; }
+TQString Global::basketsFolder() { return savesFolder() + "baskets/"; }
+TQString Global::backgroundsFolder() { return savesFolder() + "backgrounds/"; }
+TQString Global::templatesFolder() { return savesFolder() + "templates/"; }
+TQString Global::tempCutFolder() { return savesFolder() + "temp-cut/"; }
-QString Global::openNoteIcon() // FIXME: Now an edit icon
+TQString Global::openNoteIcon() // FIXME: Now an edit icon
{
return Global::bnpView->m_actEditNote->icon();
}
KMainWindow* Global::mainWindow()
{
- QWidget* res = kapp->mainWidget();
+ TQWidget* res = kapp->mainWidget();
if(res && res->inherits("KMainWindow"))
{
diff --git a/src/global.h b/src/global.h
index 6337358..805836b 100644
--- a/src/global.h
+++ b/src/global.h
@@ -21,7 +21,7 @@
#ifndef GLOBAL_H
#define GLOBAL_H
-#include <qstring.h>
+#include <tqstring.h>
#include "aboutdata.h"
class LikeBack;
@@ -41,7 +41,7 @@ class KAboutData;
class Global
{
private:
- static QString s_customSavesFolder;
+ static TQString s_customSavesFolder;
public:
// Global Variables:
static LikeBack *likeBack;
@@ -54,15 +54,15 @@ class Global
static AboutData basketAbout;
// Application Folders:
- static void setCustomSavesFolder(const QString &folder);
- static QString savesFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/".
- static QString basketsFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/baskets/".
- static QString backgroundsFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/backgrounds/".
- static QString templatesFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/templates/".
- static QString tempCutFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/temp-cut/". (was ".tmp/")
+ static void setCustomSavesFolder(const TQString &folder);
+ static TQString savesFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/".
+ static TQString basketsFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/baskets/".
+ static TQString backgroundsFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/backgrounds/".
+ static TQString templatesFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/templates/".
+ static TQString tempCutFolder(); /// << @return e.g. "/home/username/.kde/share/apps/basket/temp-cut/". (was ".tmp/")
// Various Things:
- static QString openNoteIcon(); /// << @return the icon used for the "Open" action on notes.
+ static TQString openNoteIcon(); /// << @return the icon used for the "Open" action on notes.
static KMainWindow* mainWindow();
static KConfig* config();
static KAboutData* about() { return &basketAbout; };
diff --git a/src/htmlexporter.cpp b/src/htmlexporter.cpp
index 9e41d35..4936454 100644
--- a/src/htmlexporter.cpp
+++ b/src/htmlexporter.cpp
@@ -33,25 +33,25 @@
#include <kiconloader.h>
#include <kfiledialog.h>
#include <kmessagebox.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qpainter.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqpainter.h>
#include <kglobalsettings.h>
#include <kprogress.h>
HTMLExporter::HTMLExporter(Basket *basket)
{
- QDir dir;
+ TQDir dir;
// Compute a default file name & path:
KConfig *config = KGlobal::config();
config->setGroup("Export to HTML");
- QString folder = config->readEntry("lastFolder", QDir::homeDirPath()) + "/";
- QString url = folder + QString(basket->basketName()).replace("/", "_") + ".html";
+ TQString folder = config->readEntry("lastFolder", TQDir::homeDirPath()) + "/";
+ TQString url = folder + TQString(basket->basketName()).tqreplace("/", "_") + ".html";
// Ask a file name & path to the user:
- QString filter = "*.html *.htm|" + i18n("HTML Documents") + "\n*|" + i18n("All Files");
- QString destination = url;
+ TQString filter = "*.html *.htm|" + i18n("HTML Documents") + "\n*|" + i18n("All Files");
+ TQString destination = url;
for (bool askAgain = true; askAgain; ) {
// Ask:
destination = KFileDialog::getSaveFileName(destination, filter, 0, i18n("Export to HTML"));
@@ -63,7 +63,7 @@ HTMLExporter::HTMLExporter(Basket *basket)
int result = KMessageBox::questionYesNoCancel(
0,
"<qt>" + i18n("The file <b>%1</b> already exists. Do you really want to override it?")
- .arg(KURL(destination).fileName()),
+ .tqarg(KURL(destination).fileName()),
i18n("Override File?"),
KGuiItem(i18n("&Override"), "filesave")
);
@@ -96,7 +96,7 @@ HTMLExporter::~HTMLExporter()
{
}
-void HTMLExporter::prepareExport(Basket *basket, const QString &fullPath)
+void HTMLExporter::prepareExport(Basket *basket, const TQString &fullPath)
{
progress->setTotalSteps(/*Preparation:*/1 + /*Finishing:*/1 + /*Basket:*/1 + /*SubBaskets:*/Global::bnpView->basketCount(Global::bnpView->listViewItemForBasket(basket)));
progress->setValue(0);
@@ -111,9 +111,9 @@ void HTMLExporter::prepareExport(Basket *basket, const QString &fullPath)
withBasketTree = (item->firstChild() != 0);
// Create and empty the files folder:
- QString filesFolderPath = i18n("HTML export folder (files)", "%1_files").arg(filePath) + "/"; // eg.: "/home/seb/foo.html_files/"
+ TQString filesFolderPath = i18n("HTML export folder (files)", "%1_files").tqarg(filePath) + "/"; // eg.: "/home/seb/foo.html_files/"
Tools::deleteRecursively(filesFolderPath);
- QDir dir;
+ TQDir dir;
dir.mkdir(filesFolderPath);
// Create sub-folders:
@@ -136,7 +136,7 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
}
// Compute the absolute & relative paths for this basket:
- filesFolderPath = i18n("HTML export folder (files)", "%1_files").arg(filePath) + "/";
+ filesFolderPath = i18n("HTML export folder (files)", "%1_files").tqarg(filePath) + "/";
if (isSubBasket) {
basketFilePath = basketsFolderPath + basket->folderName().left(basket->folderName().length() - 1) + ".html";
filesFolderName = "../";
@@ -145,7 +145,7 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
basketsFolderName = "";
} else {
basketFilePath = filePath;
- filesFolderName = i18n("HTML export folder (files)", "%1_files").arg(KURL(filePath).fileName()) + "/";
+ filesFolderName = i18n("HTML export folder (files)", "%1_files").tqarg(KURL(filePath).fileName()) + "/";
dataFolderName = filesFolderName + i18n("HTML export folder (data)", "data") + "/";
dataFolderPath = filesFolderPath + i18n("HTML export folder (data)", "data") + "/";
basketsFolderName = filesFolderName + i18n("HTML export folder (baskets)", "baskets") + "/";
@@ -168,25 +168,25 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
std::cout << " basketsFolderName:" << basketsFolderName << std::endl;
// Create the data folder for this basket:
- QDir dir;
+ TQDir dir;
dir.mkdir(dataFolderPath);
- backgroundColorName = basket->backgroundColor().name().lower().mid(1);
+ backgroundColorName = TQString(basket->backgroundColor().name()).lower().mid(1);
// Generate basket icons:
- QString basketIcon16 = iconsFolderName + copyIcon(basket->icon(), 16);
- QString basketIcon32 = iconsFolderName + copyIcon(basket->icon(), 32);
+ TQString basketIcon16 = iconsFolderName + copyIcon(basket->icon(), 16);
+ TQString basketIcon32 = iconsFolderName + copyIcon(basket->icon(), 32);
// Generate the [+] image for groups:
- QPixmap expandGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
+ TQPixmap expandGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
expandGroup.fill(basket->backgroundColor());
- QPainter painter(&expandGroup);
+ TQPainter painter(&expandGroup);
Note::drawExpander(&painter, 0, 0, basket->backgroundColor(), /*expand=*/true, basket);
painter.end();
expandGroup.save(imagesFolderPath + "expand_group_" + backgroundColorName + ".png", "PNG");
// Generate the [-] image for groups:
- QPixmap foldGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
+ TQPixmap foldGroup(Note::EXPANDER_WIDTH, Note::EXPANDER_HEIGHT);
foldGroup.fill(basket->backgroundColor());
painter.begin(&foldGroup);
Note::drawExpander(&painter, 0, 0, basket->backgroundColor(), /*expand=*/false, basket);
@@ -194,21 +194,21 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
foldGroup.save(imagesFolderPath + "fold_group_" + backgroundColorName + ".png", "PNG");
// Open the file to write:
- QFile file(basketFilePath);
+ TQFile file(basketFilePath);
if (!file.open(IO_WriteOnly))
return;
- stream.setDevice(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ stream.setDevice(TQT_TQIODEVICE(&file));
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
// Compute the colors to draw dragient for notes:
- QColor topBgColor;
- QColor bottomBgColor;
+ TQColor topBgColor;
+ TQColor bottomBgColor;
Note::getGradientColors(basket->backgroundColor(), &topBgColor, &bottomBgColor);
// Compute the gradient image for notes:
- QString gradientImageFileName = Basket::saveGradientBackground(basket->backgroundColor(), basket->QScrollView::font(), imagesFolderPath);
+ TQString gradientImageFileName = Basket::saveGradientBackground(basket->backgroundColor(), basket->TQScrollView::font(), imagesFolderPath);
// Output the header:
- QString borderColor = Tools::mixColor(basket->backgroundColor(), basket->textColor()).name();
+ TQString borderColor = Tools::mixColor(basket->backgroundColor(), basket->textColor()).name();
stream <<
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n"
"<html>\n"
@@ -238,7 +238,7 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
}
stream <<
" .basket { background-color: " << basket->backgroundColor().name() << "; border: solid " << borderColor << " 1px; "
- "font: " << Tools::cssFontDefinition(basket->QScrollView::font()) << "; color: " << basket->textColor().name() << "; padding: 1px; width: 100%; }\n"
+ "font: " << Tools::cssFontDefinition(basket->TQScrollView::font()) << "; color: " << basket->textColor().name() << "; padding: 1px; width: 100%; }\n"
" table.basket { border-collapse: collapse; }\n"
" .basket * { padding: 0; margin: 0; }\n"
" .basket table { width: 100%; border-spacing: 0; _border-collapse: collapse; }\n"
@@ -259,10 +259,10 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
<< LinkLook::launcherLook->toCSS("launcher", basket->textColor())
<<
" .unknown { margin: 1px 2px; border: 1px solid " << borderColor << "; -moz-border-radius: 4px; }\n";
- QValueList<State*> states = basket->usedStates();
- QString statesCss;
+ TQValueList<State*> states = basket->usedStates();
+ TQString statesCss;
for (State::List::Iterator it = states.begin(); it != states.end(); ++it)
- statesCss += (*it)->toCSS(imagesFolderPath, imagesFolderName, basket->QScrollView::font());
+ statesCss += (*it)->toCSS(imagesFolderPath, imagesFolderName, basket->TQScrollView::font());
stream <<
statesCss <<
" .credits { text-align: right; margin: 3px 0 0 0; _margin-top: -17px; font-size: 80%; color: " << borderColor << "; }\n"
@@ -270,7 +270,7 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
" <title>" << Tools::textToHTMLWithoutP(basket->basketName()) << "</title>\n"
" <link rel=\"shortcut icon\" type=\"image/png\" href=\"" << basketIcon16 << "\">\n";
// Create the column handle image:
- QPixmap columnHandle(Note::RESIZER_WIDTH, 50);
+ TQPixmap columnHandle(Note::RESIZER_WIDTH, 50);
painter.begin(&columnHandle);
Note::drawInactiveResizer(&painter, 0, 0, columnHandle.height(), basket->backgroundColor(), /*column=*/true);
painter.end();
@@ -289,7 +289,7 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
// TODO: Make sure only filtered notes are exported!
// if (decoration()->filterData().isFiltering)
// stream <<
-// " <p>" << i18n("Notes matching the filter &quot;%1&quot;:").arg(Tools::textToHTMLWithoutP(decoration()->filterData().string)) << "</p>\n";
+// " <p>" << i18n("Notes matching the filter &quot;%1&quot;:").tqarg(Tools::textToHTMLWithoutP(decoration()->filterData().string)) << "</p>\n";
stream <<
" <div class=\"basketSurrounder\">\n";
@@ -313,18 +313,18 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
else
stream <<
" </div>\n";
- stream << QString(
+ stream << TQString(
" </div>\n"
- " <p class=\"credits\">%1</p>\n").arg(
+ " <p class=\"credits\">%1</p>\n").tqarg(
i18n("Made with %1, a KDE tool to take notes and keep information at hand.")
- .arg("<a href=\"http://basket.kde.org/\">%1</a> %2")
- .arg(kapp->aboutData()->programName(), VERSION));
+ .tqarg("<a href=\"http://basket.kde.org/\">%1</a> %2")
+ .tqarg(kapp->aboutData()->programName(), VERSION));
// Copy a transparent GIF image in the folder, needed for the JavaScript hack:
- QString gifFileName = "spacer.gif";
- QFile transGIF(imagesFolderPath + gifFileName);
+ TQString gifFileName = "spacer.gif";
+ TQFile transGIF(imagesFolderPath + gifFileName);
if (!transGIF.exists() && transGIF.open(IO_WriteOnly)) {
- QDataStream streamGIF(&transGIF);
+ TQDataStream streamGIF(&transGIF);
// This is a 1px*1px transparent GIF image:
const uchar blankGIF[] = {
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x0a, 0x00, 0x0a, 0x00,
@@ -375,10 +375,10 @@ void HTMLExporter::exportBasket(Basket *basket, bool isSubBasket)
void HTMLExporter::exportNote(Note *note, int indent)
{
- QString spaces;
+ TQString spaces;
if (note->isColumn()) {
- QString width = "";
+ TQString width = "";
if (false/*TODO: DEBUG AND REENABLE: hasResizer()*/) {
// As we cannot be precise in CSS (say eg. "width: 50%-40px;"),
// we output a percentage that is approximatively correct.
@@ -396,7 +396,7 @@ void HTMLExporter::exportNote(Note *note, int indent)
widthValue = 1;
if (widthValue > 100)
widthValue = 100;
- width = QString(" width=\"%1%\"").arg(QString::number(widthValue));
+ width = TQString(" width=\"%1%\"").tqarg(TQString::number(widthValue));
}
stream << spaces.fill(' ', indent) << "<td class=\"column\"" << width << ">\n";
@@ -413,9 +413,9 @@ void HTMLExporter::exportNote(Note *note, int indent)
return;
}
- QString freeStyle;
+ TQString freeStyle;
if (note->isFree())
- freeStyle = " style=\"position: absolute; left: " + QString::number(note->x()) + "px; top: " + QString::number(note->y()) + "px; width: " + QString::number(note->groupWidth()) + "px\"";
+ freeStyle = " style=\"position: absolute; left: " + TQString::number(note->x()) + "px; top: " + TQString::number(note->y()) + "px; width: " + TQString::number(note->groupWidth()) + "px\"";
if (note->isGroup()) {
stream << '\n' << spaces.fill(' ', indent) << "<table" << freeStyle << ">\n"; // Note content is expected to be on the same HTML line, but NOT groups
@@ -438,7 +438,7 @@ void HTMLExporter::exportNote(Note *note, int indent)
stream << '\n' << spaces.fill(' ', indent) << "</table>\n" /*<< spaces.fill(' ', indent - 1)*/;
} else {
// Additionnal class for the content (link, netword, color...):
- QString additionnalClasses = note->content()->cssClass();
+ TQString additionnalClasses = note->content()->cssClass();
if (!additionnalClasses.isEmpty())
additionnalClasses = " " + additionnalClasses;
// Assign the style of each associted tags:
@@ -451,7 +451,7 @@ void HTMLExporter::exportNote(Note *note, int indent)
for (State::List::Iterator it = note->states().begin(); it != note->states().end(); ++it)
if (!(*it)->emblem().isEmpty()) {
int emblemSize = 16;
- QString iconFileName = copyIcon((*it)->emblem(), emblemSize);
+ TQString iconFileName = copyIcon((*it)->emblem(), emblemSize);
stream << "<img src=\"" << iconsFolderName << iconFileName
<< "\" width=\"" << emblemSize << "\" height=\"" << emblemSize
<< "\" alt=\"" << (*it)->textEquivalent() << "\" title=\"" << (*it)->fullName() << "\">";
@@ -474,9 +474,9 @@ void HTMLExporter::writeBasketTree(Basket *currentBasket)
void HTMLExporter::writeBasketTree(Basket *currentBasket, Basket *basket, int indent)
{
// Compute variable HTML code:
- QString spaces;
- QString cssClass = (basket == currentBasket ? " class=\"current\"" : "");
- QString link = "#";
+ TQString spaces;
+ TQString cssClass = (basket == currentBasket ? " class=\"current\"" : "");
+ TQString link = "#";
if (currentBasket != basket) {
if (currentBasket == exportedBasket) {
link = basketsFolderName + basket->folderName().left(basket->folderName().length() - 1) + ".html";
@@ -486,7 +486,7 @@ void HTMLExporter::writeBasketTree(Basket *currentBasket, Basket *basket, int in
link = basket->folderName().left(basket->folderName().length() - 1) + ".html";
}
}
- QString spanStyle = "";
+ TQString spanStyle = "";
if (basket->backgroundColorSetting().isValid() || basket->textColorSetting().isValid()) {
spanStyle = " style=\"background-color: " + basket->backgroundColor().name() + "; color: " + basket->textColor().name() + "\"";
}
@@ -519,16 +519,16 @@ void HTMLExporter::writeBasketTree(Basket *currentBasket, Basket *basket, int in
* It is optimized so that you can have an empty folder receiving the icons
* and call copyIcon() each time you encounter one during export process.
*/
-QString HTMLExporter::copyIcon(const QString &iconName, int size)
+TQString HTMLExporter::copyIcon(const TQString &iconName, int size)
{
if (iconName.isEmpty())
return "";
// Sometimes icon can be "favicons/www.kde.org", we replace the '/' with a '_'
- QString fileName = iconName; // QString::replace() isn't const, so I must copy the string before
- fileName = "ico" + QString::number(size) + "_" + fileName.replace("/", "_") + ".png";
- QString fullPath = iconsFolderPath + fileName;
- if (!QFile::exists(fullPath))
+ TQString fileName = iconName; // TQString::tqreplace() isn't const, so I must copy the string before
+ fileName = "ico" + TQString::number(size) + "_" + fileName.tqreplace("/", "_") + ".png";
+ TQString fullPath = iconsFolderPath + fileName;
+ if (!TQFile::exists(fullPath))
DesktopIcon(iconName, size).save(fullPath, "PNG");
return fileName;
}
@@ -539,14 +539,14 @@ QString HTMLExporter::copyIcon(const QString &iconName, int size)
* The first copy isn't yet started, so the dest file isn't created and this method
* returns the same filename !!!!!!!!!!!!!!!!!!!!
*/
-QString HTMLExporter::copyFile(const QString &srcPath, bool createIt)
+TQString HTMLExporter::copyFile(const TQString &srcPath, bool createIt)
{
- QString fileName = Tools::fileNameForNewFile(KURL(srcPath).fileName(), dataFolderPath);
- QString fullPath = dataFolderPath + fileName;
+ TQString fileName = Tools::fileNameForNewFile(KURL(srcPath).fileName(), dataFolderPath);
+ TQString fullPath = dataFolderPath + fileName;
if (createIt) {
// We create the file to be sure another very near call to copyFile() willn't choose the same name:
- QFile file(KURL(fullPath).path());
+ TQFile file(KURL(fullPath).path());
if (file.open(IO_WriteOnly))
file.close();
// And then we copy the file AND overwriting the file we juste created:
diff --git a/src/htmlexporter.h b/src/htmlexporter.h
index 5b75ab6..86b72fd 100644
--- a/src/htmlexporter.h
+++ b/src/htmlexporter.h
@@ -21,8 +21,8 @@
#ifndef HTMLEXPORTER_H
#define HTMLEXPORTER_H
-#include <qstring.h>
-#include <qtextstream.h>
+#include <tqstring.h>
+#include <tqtextstream.h>
class KProgress;
@@ -38,39 +38,39 @@ class HTMLExporter
HTMLExporter(Basket *basket);
~HTMLExporter();
private:
- void prepareExport(Basket *basket, const QString &fullPath);
+ void prepareExport(Basket *basket, const TQString &fullPath);
void exportBasket(Basket *basket, bool isSubBasket);
void exportNote(Note *note, int indent);
void writeBasketTree(Basket *currentBasket);
void writeBasketTree(Basket *currentBasket, Basket *basket, int indent);
public:
- QString copyIcon(const QString &iconName, int size);
- QString copyFile(const QString &srcPath, bool createIt);
+ TQString copyIcon(const TQString &iconName, int size);
+ TQString copyFile(const TQString &srcPath, bool createIt);
public:
// Absolute path of the file name the user choosen:
- QString filePath; // eg.: "/home/seb/foo.html"
- QString fileName; // eg.: "foo.html"
+ TQString filePath; // eg.: "/home/seb/foo.html"
+ TQString fileName; // eg.: "foo.html"
// Absolute & relative paths for the current basket to be exported:
- QString basketFilePath; // eg.: "/home/seb/foo.html" or "/home/seb/foo.html_files/baskets/basketN.html"
- QString filesFolderPath; // eg.: "/home/seb/foo.html_files/"
- QString filesFolderName; // eg.: "foo.html_files/" or "../"
- QString iconsFolderPath; // eg.: "/home/seb/foo.html_files/icons/"
- QString iconsFolderName; // eg.: "foo.html_files/icons/" or "../icons/"
- QString imagesFolderPath; // eg.: "/home/seb/foo.html_files/images/"
- QString imagesFolderName; // eg.: "foo.html_files/images/" or "../images/"
- QString dataFolderPath; // eg.: "/home/seb/foo.html_files/data/" or "/home/seb/foo.html_files/baskets/basketN-data/"
- QString dataFolderName; // eg.: "foo.html_files/data/" or "basketN-data/"
- QString basketsFolderPath; // eg.: "/home/seb/foo.html_files/baskets/"
- QString basketsFolderName; // eg.: "foo.html_files/baskets/" or ""
+ TQString basketFilePath; // eg.: "/home/seb/foo.html" or "/home/seb/foo.html_files/baskets/basketN.html"
+ TQString filesFolderPath; // eg.: "/home/seb/foo.html_files/"
+ TQString filesFolderName; // eg.: "foo.html_files/" or "../"
+ TQString iconsFolderPath; // eg.: "/home/seb/foo.html_files/icons/"
+ TQString iconsFolderName; // eg.: "foo.html_files/icons/" or "../icons/"
+ TQString imagesFolderPath; // eg.: "/home/seb/foo.html_files/images/"
+ TQString imagesFolderName; // eg.: "foo.html_files/images/" or "../images/"
+ TQString dataFolderPath; // eg.: "/home/seb/foo.html_files/data/" or "/home/seb/foo.html_files/baskets/basketN-data/"
+ TQString dataFolderName; // eg.: "foo.html_files/data/" or "basketN-data/"
+ TQString basketsFolderPath; // eg.: "/home/seb/foo.html_files/baskets/"
+ TQString basketsFolderName; // eg.: "foo.html_files/baskets/" or ""
// Various properties of the currently exporting basket:
- QString backgroundColorName;
+ TQString backgroundColorName;
// Variables used by every export methods:
- QTextStream stream;
+ TQTextStream stream;
Basket *exportedBasket;
bool withBasketTree;
KProgress *progress;
diff --git a/src/kcm_basket.cpp b/src/kcm_basket.cpp
index 5c1efa6..c902d6b 100644
--- a/src/kcm_basket.cpp
+++ b/src/kcm_basket.cpp
@@ -28,45 +28,45 @@
//----------------------------
extern "C"
{
- KDE_EXPORT KCModule *create_basket_config_general(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_basket_config_general(TQWidget *tqparent, const char *)
{
- GeneralPage *page = new GeneralPage(parent, "kcmbasket_config_general");
+ GeneralPage *page = new GeneralPage(tqparent, "kcmbasket_config_general");
return page;
}
}
extern "C"
{
- KDE_EXPORT KCModule *create_basket_config_baskets(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_basket_config_baskets(TQWidget *tqparent, const char *)
{
- BasketsPage *page = new BasketsPage(parent, "kcmbasket_config_baskets");
+ BasketsPage *page = new BasketsPage(tqparent, "kcmbasket_config_baskets");
return page;
}
}
extern "C"
{
- KDE_EXPORT KCModule *create_basket_config_new_notes(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_basket_config_new_notes(TQWidget *tqparent, const char *)
{
- NewNotesPage *page = new NewNotesPage(parent, "kcmbasket_config_new_notes");
+ NewNotesPage *page = new NewNotesPage(tqparent, "kcmbasket_config_new_notes");
return page;
}
}
extern "C"
{
- KDE_EXPORT KCModule *create_basket_config_notes_appearance(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_basket_config_notes_appearance(TQWidget *tqparent, const char *)
{
- NotesAppearancePage *page = new NotesAppearancePage(parent, "kcmbasket_config_notes_appearance");
+ NotesAppearancePage *page = new NotesAppearancePage(tqparent, "kcmbasket_config_notes_appearance");
return page;
}
}
extern "C"
{
- KDE_EXPORT KCModule *create_basket_config_apps(QWidget *parent, const char *)
+ KDE_EXPORT KCModule *create_basket_config_apps(TQWidget *tqparent, const char *)
{
- ApplicationsPage *page = new ApplicationsPage(parent, "kcmbasket_config_apps");
+ ApplicationsPage *page = new ApplicationsPage(tqparent, "kcmbasket_config_apps");
return page;
}
}
diff --git a/src/kcolorcombo2.cpp b/src/kcolorcombo2.cpp
index b5ac1e3..e898e46 100644
--- a/src/kcolorcombo2.cpp
+++ b/src/kcolorcombo2.cpp
@@ -18,21 +18,21 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qapplication.h>
-#include <qpixmap.h>
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qlistbox.h>
+#include <tqapplication.h>
+#include <tqpixmap.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqlistbox.h>
#include <kglobalsettings.h>
#include <klocale.h>
#include <kcolordialog.h>
-#include <qclipboard.h>
+#include <tqclipboard.h>
#include <kstdaccel.h>
#include <kcolordrag.h>
#include "kcolorcombo2.h"
-//#include "qeffects.h"
+//#include "tqeffects.h"
//#define DEBUG_COLOR_ARRAY
//#define OUTPUT_GIMP_PALETTE
@@ -52,23 +52,23 @@ const int KColorPopup::MARGIN = 1;
const int KColorPopup::FRAME_WIDTH = 1;
-KColorPopup::KColorPopup(KColorCombo2 *parent)
- : QWidget(/*parent=*/0, /*name=*/0, WType_Popup | WNoAutoErase),
- m_selector(parent)
+KColorPopup::KColorPopup(KColorCombo2 *tqparent)
+ : TQWidget(/*tqparent=*/0, /*name=*/0, WType_Popup | WNoAutoErase),
+ m_selector(tqparent)
{
hide();
setMouseTracking(true);
//resize(20, 20);
- //setWFlags(Qt::WNoAutoErase);
+ //setWFlags(TQt::WNoAutoErase);
}
KColorPopup::~KColorPopup()
{
}
-#include <qcursor.h>
+#include <tqcursor.h>
-void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
+void KColorPopup::retqlayout() // FIXME: retqlayout should NOT redraw the pixmap!
{
int columnCount = m_selector->columnCount();
int rowCount = m_selector->rowCount();
@@ -83,14 +83,14 @@ void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
// Initialize the pixmap:
m_pixmap.resize(width, height);
- QPainter painter(&m_pixmap);
+ TQPainter painter(&m_pixmap);
painter.fillRect(0, 0, width, height, KGlobalSettings::baseColor());
painter.setPen(KGlobalSettings::textColor());
painter.drawRect(0, 0, width, height);
// Needed to draw:
int x, y;
- QRect selectionRect;
+ TQRect selectionRect;
// Draw the color array:
for (int i = 0; i < columnCount; ++i) {
@@ -98,7 +98,7 @@ void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
x = 1 + MARGIN + (colorWidth + MARGIN) * i;
y = 1 + MARGIN + (colorHeight + MARGIN) * j;
if (i == m_selectedColumn && j == m_selectedRow) {
- selectionRect = QRect(x - 2, y - 2, colorWidth + 4, colorHeight + 4);
+ selectionRect = TQRect(x - 2, y - 2, colorWidth + 4, colorHeight + 4);
painter.fillRect(selectionRect, KGlobalSettings::highlightColor());
}
m_selector->drawColorRect(painter, x, y, m_selector->colorAt(i, j), /*isDefault=*/false, colorWidth, colorHeight);
@@ -111,11 +111,11 @@ void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
// Draw the "(Default)" and "Other..." colors:
y = height - (colorHeight + MARGIN) - 1;
- QColor textColor;
+ TQColor textColor;
if (m_selector->defaultColor().isValid()) {
x = 1 + MARGIN;
if (m_selectedColumn < m_columnOther && rowCount == m_selectedRow) {
- selectionRect = QRect(x - 2, y - 2, defaultCellWidth, colorHeight + 4);
+ selectionRect = TQRect(x - 2, y - 2, defaultCellWidth, colorHeight + 4);
painter.fillRect(selectionRect, KGlobalSettings::highlightColor());
textColor = KGlobalSettings::highlightedTextColor();
} else
@@ -127,7 +127,7 @@ void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
}
x = 1 + MARGIN + m_columnOther * (colorWidth + MARGIN);
if (m_selectedColumn >= m_columnOther && rowCount == m_selectedRow) {
- selectionRect = QRect(x - 2, y - 2, otherCellWidth, colorHeight + 4);
+ selectionRect = TQRect(x - 2, y - 2, otherCellWidth, colorHeight + 4);
painter.fillRect(selectionRect, KGlobalSettings::highlightColor());
textColor = KGlobalSettings::highlightedTextColor();
} else
@@ -137,7 +137,7 @@ void KColorPopup::relayout() // FIXME: relayout should NOT redraw the pixmap!
painter.setPen(textColor);
painter.drawText(x + 2 + colorWidth, y, /*width=*/5000, colorHeight, AlignLeft | AlignVCenter | DontClip, i18n("Other..."));
-// QPoint pos = mapFromGlobal(QCursor::pos());
+// TQPoint pos = mapFromGlobal(TQCursor::pos());
// painter.drawRect(pos.x(), pos.y(), 5000, 5000);
}
@@ -163,7 +163,7 @@ void KColorPopup::updateCell(int column, int row)
void KColorPopup::doSelection()
{
- m_otherColor = QColor();
+ m_otherColor = TQColor();
// If the selected color is not the default one, try to find it in the array:
if (m_selector->color().isValid()) {
@@ -196,15 +196,15 @@ void KColorPopup::validate()
if (m_selectedRow != m_selector->rowCount()) // A normal row:
m_selector->setColor(m_selector->colorAt(m_selectedColumn, m_selectedRow));
else if (m_selectedColumn < m_columnOther) // The default color:
- m_selector->setColor(QColor());
+ m_selector->setColor(TQColor());
else { // The user want to choose one:
- QColor color = m_selector->effectiveColor();
- if (KColorDialog::getColor(color, this) == QDialog::Accepted)
+ TQColor color = m_selector->effectiveColor();
+ if (KColorDialog::getColor(color, this) == TQDialog::Accepted)
m_selector->setColor(color);
}
}
-void KColorPopup::mousePressEvent(QMouseEvent *event)
+void KColorPopup::mousePressEvent(TQMouseEvent *event)
{
int x = event->pos().x();
int y = event->pos().y();
@@ -217,15 +217,15 @@ void KColorPopup::mousePressEvent(QMouseEvent *event)
event->accept();
}
-void KColorPopup::paintEvent(QPaintEvent *event)
+void KColorPopup::paintEvent(TQPaintEvent *event)
{
- QPainter painter(this);
+ TQPainter painter(this);
painter.drawPixmap(0, 0, m_pixmap);
- painter.setPen(Qt::black);
+ painter.setPen(TQt::black);
painter.drawRect(event->rect());
}
-void KColorPopup::mouseMoveEvent(QMouseEvent *event)
+void KColorPopup::mouseMoveEvent(TQMouseEvent *event)
{
int x = event->pos().x();
int y = event->pos().y();
@@ -240,11 +240,11 @@ void KColorPopup::mouseMoveEvent(QMouseEvent *event)
m_selectedColumn = (x - FRAME_WIDTH - MARGIN + 2) / (colorWidth + MARGIN);
m_selectedRow = (y - FRAME_WIDTH - MARGIN + 2) / (colorHeight + MARGIN);
- relayout();
+ retqlayout();
update();
}
-void KColorPopup::keyPressEvent(QKeyEvent *event)
+void KColorPopup::keyPressEvent(TQKeyEvent *event)
{
int column = m_selectedColumn;
int row = m_selectedRow;
@@ -252,7 +252,7 @@ void KColorPopup::keyPressEvent(QKeyEvent *event)
int rowCount = m_selector->rowCount();
switch (event->key()) {
- case Qt::Key_Right:
+ case TQt::Key_Right:
if (m_selectedRow != rowCount) // A normal row:
column = (column + 1) % columnCount;
else {
@@ -261,7 +261,7 @@ void KColorPopup::keyPressEvent(QKeyEvent *event)
column = (m_selectedColumn < m_columnOther ? m_columnOther : 0);
}
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
if (m_selectedRow != rowCount) { // A normal row:
column = (column - 1);
if (column < 0)
@@ -272,32 +272,32 @@ void KColorPopup::keyPressEvent(QKeyEvent *event)
column = (m_selectedColumn < m_columnOther ? m_columnOther : 0);
}
break;
- case Qt::Key_Up: row = (row - 1); if (row < 0) row = rowCount; break;
- case Qt::Key_Down: row = (row + 1) % (rowCount+1); break;
- case Qt::Key_PageDown: row += 10; if (row > rowCount) row = rowCount; break;
- case Qt::Key_PageUp: row -= 10; if (row < 0) row = 0; break;
- case Qt::Key_Home: row = 0; column = 0; break;
- case Qt::Key_End: row = rowCount; column = columnCount - 1; break;
- case Qt::Key_Return:
+ case TQt::Key_Up: row = (row - 1); if (row < 0) row = rowCount; break;
+ case TQt::Key_Down: row = (row + 1) % (rowCount+1); break;
+ case TQt::Key_PageDown: row += 10; if (row > rowCount) row = rowCount; break;
+ case TQt::Key_PageUp: row -= 10; if (row < 0) row = 0; break;
+ case TQt::Key_Home: row = 0; column = 0; break;
+ case TQt::Key_End: row = rowCount; column = columnCount - 1; break;
+ case TQt::Key_Return:
validate();
break;
default:
- QWidget::keyPressEvent(event);
+ TQWidget::keyPressEvent(event);
}
if (row != m_selectedRow || column != m_selectedColumn) {
m_selectedRow = row;
m_selectedColumn = column;
- relayout();
+ retqlayout();
update();
}
}
/** Helper function: */
-QColor Tool_mixColors(const QColor &color1, const QColor &color2)
+TQColor Tool_mixColors(const TQColor &color1, const TQColor &color2)
{
- QColor mixedColor;
+ TQColor mixedColor;
mixedColor.setRgb( (color1.red() + color2.red()) / 2,
(color1.green() + color2.green()) / 2,
(color1.blue() + color2.blue()) / 2 );
@@ -318,15 +318,15 @@ class KColorCombo2::KColorCombo2Private
* Some other piece of code comes from KColorButton (in libkdeui) to enable color drag, drop, copy and paste.
*/
-KColorCombo2::KColorCombo2(const QColor &color, const QColor &defaultColor, QWidget *parent, const char *name)
- : QComboBox(/*editable=*/false, parent, name),
+KColorCombo2::KColorCombo2(const TQColor &color, const TQColor &defaultColor, TQWidget *tqparent, const char *name)
+ : TQComboBox(/*editable=*/false, tqparent, name),
m_color(color), m_defaultColor(defaultColor)
{
init();
}
-KColorCombo2::KColorCombo2(const QColor &color, QWidget *parent, const char *name)
- : QComboBox(/*editable=*/false, parent, name),
+KColorCombo2::KColorCombo2(const TQColor &color, TQWidget *tqparent, const char *name)
+ : TQComboBox(/*editable=*/false, tqparent, name),
m_color(color), m_defaultColor()
{
init();
@@ -358,7 +358,7 @@ KColorCombo2::~KColorCombo2()
deleteColorArray();
}
-void KColorCombo2::setColor(const QColor &color)
+void KColorCombo2::setColor(const TQColor &color)
{
// Do nothing if the color should be set to the default one and there is no such default color allowed:
if (!color.isValid() && !m_defaultColor.isValid()) {
@@ -373,12 +373,12 @@ void KColorCombo2::setColor(const QColor &color)
}
}
-QColor KColorCombo2::color() const
+TQColor KColorCombo2::color() const
{
return m_color;
}
-QColor KColorCombo2::effectiveColor() const
+TQColor KColorCombo2::effectiveColor() const
{
if (m_color.isValid())
return m_color;
@@ -407,14 +407,14 @@ void KColorCombo2::setRainbowPreset(int colorColumnCount, int lightRowCount, int
// With light colors:
for (int j = 1; j <= lightRowCount; ++j) { // Start to 1 because we don't want a row full of white!
int saturation = j * 255 / (lightRowCount + 1);
- setColorAt(i, j - 1, QColor(hue, saturation, 255, QColor::Hsv));
+ setColorAt(i, j - 1, TQColor(hue, saturation, 255, TQColor::Hsv));
}
// With pure colors:
- setColorAt(i, lightRowCount, QColor(hue, 255, 255, QColor::Hsv));
+ setColorAt(i, lightRowCount, TQColor(hue, 255, 255, TQColor::Hsv));
// With dark colors:
for (int j = 1; j <= darkRowCount; ++j) {
int value = 255 - j * 255 / (darkRowCount + 1);
- setColorAt(i, lightRowCount + j, QColor(hue, 255, value, QColor::Hsv));
+ setColorAt(i, lightRowCount + j, TQColor(hue, 255, value, TQColor::Hsv));
}
}
@@ -422,7 +422,7 @@ void KColorCombo2::setRainbowPreset(int colorColumnCount, int lightRowCount, int
if (withGray) {
for (int i = 0; i < rowCount; ++i) {
int gray = ( rowCount == 1 ? 128 : 255 - (i * 255 / (rowCount - 1)) );
- setColorAt(columnCount-1, i, QColor(gray, gray, gray));
+ setColorAt(columnCount-1, i, TQColor(gray, gray, gray));
}
}
@@ -458,18 +458,18 @@ int KColorCombo2::rowCount() const
return m_rowCount;
}
-QColor KColorCombo2::colorAt(int column, int row)/* const*/
+TQColor KColorCombo2::colorAt(int column, int row)/* const*/
{
if (!m_colorArray)
setRainbowPreset();
if (column < 0 || row < 0 || column >= m_columnCount || row >= m_rowCount)
- return QColor();
+ return TQColor();
return m_colorArray[column][row];
}
-QColor KColorCombo2::defaultColor() const
+TQColor KColorCombo2::defaultColor() const
{
return m_defaultColor;
}
@@ -487,14 +487,14 @@ void KColorCombo2::newColorArray(int columnCount, int rowCount)
// Create a new array of the wanted dimentions:
m_columnCount = columnCount;
m_rowCount = rowCount;
- m_colorArray = new QColor* [columnCount];
+ m_colorArray = new TQColor* [columnCount];
for (int i = 0; i < columnCount; ++i)
- m_colorArray[i] = new QColor[rowCount];
+ m_colorArray[i] = new TQColor[rowCount];
- m_popup->relayout();
+ m_popup->retqlayout();
}
-void KColorCombo2::setColorAt(int column, int row, const QColor &color)
+void KColorCombo2::setColorAt(int column, int row, const TQColor &color)
{
if (!m_colorArray)
setRainbowPreset();
@@ -507,40 +507,40 @@ void KColorCombo2::setColorAt(int column, int row, const QColor &color)
m_colorArray[column][row] = color;
}
-void KColorCombo2::setDefaultColor(const QColor &color)
+void KColorCombo2::setDefaultColor(const TQColor &color)
{
m_defaultColor = color;
if (!m_defaultColor.isValid() && !m_color.isValid())
- m_color = Qt::white; // FIXME: Use the first one.
+ m_color = TQt::white; // FIXME: Use the first one.
}
-QPixmap KColorCombo2::colorRectPixmap(const QColor &color, bool isDefault, int width, int height)
+TQPixmap KColorCombo2::colorRectPixmap(const TQColor &color, bool isDefault, int width, int height)
{
// Prepare to draw:
- QPixmap pixmap(width, height);
- QBitmap mask(width, height);
- QPainter painter(&pixmap);
- QPainter maskPainter(&mask);
+ TQPixmap pixmap(width, height);
+ TQBitmap tqmask(width, height);
+ TQPainter painter(&pixmap);
+ TQPainter tqmaskPainter(&tqmask);
// Draw pixmap:
drawColorRect(painter, 0, 0, color, isDefault, width, height);
- // Draw mask (make the four corners transparent):
- maskPainter.fillRect(0, 0, width, height, Qt::color1); // opaque
- maskPainter.setPen(Qt::color0); // transparent
- maskPainter.drawPoint(0, 0);
- maskPainter.drawPoint(0, height - 1);
- maskPainter.drawPoint(width - 1, height - 1);
- maskPainter.drawPoint(width - 1, 0);
+ // Draw tqmask (make the four corners transparent):
+ tqmaskPainter.fillRect(0, 0, width, height, TQt::color1); // opaque
+ tqmaskPainter.setPen(TQt::color0); // transparent
+ tqmaskPainter.drawPoint(0, 0);
+ tqmaskPainter.drawPoint(0, height - 1);
+ tqmaskPainter.drawPoint(width - 1, height - 1);
+ tqmaskPainter.drawPoint(width - 1, 0);
// Finish:
painter.end();
- maskPainter.end();
- pixmap.setMask(mask);
+ tqmaskPainter.end();
+ pixmap.setMask(tqmask);
return pixmap;
}
-void KColorCombo2::drawColorRect(QPainter &painter, int x, int y, const QColor &color, bool isDefault, int width, int height)
+void KColorCombo2::drawColorRect(TQPainter &painter, int x, int y, const TQColor &color, bool isDefault, int width, int height)
{
// Fill:
if (color.isValid())
@@ -552,7 +552,7 @@ void KColorCombo2::drawColorRect(QPainter &painter, int x, int y, const QColor &
int hue = i * 360 / (width-2);
for (int j = 0; j < height-2; ++j) {
int saturation = 255 - (j * 255 / (height-2));
- painter.setPen( QColor(hue, saturation, /*value=*/255, QColor::Hsv) );
+ painter.setPen( TQColor(hue, saturation, /*value=*/255, TQColor::Hsv) );
painter.drawPoint(x + i + 1, y + j + 1);
}
}
@@ -560,8 +560,8 @@ void KColorCombo2::drawColorRect(QPainter &painter, int x, int y, const QColor &
// Stroke:
int dontCare, value;
- color.getHsv(/*hue:*/dontCare, /*saturation:*/dontCare, value);
- QColor stroke = (color.isValid() ? color.dark(125) : KGlobalSettings::textColor());
+ color.getHsv(/*hue:*/&dontCare, /*saturation:*/&dontCare, &value);
+ TQColor stroke = (color.isValid() ? color.dark(125) : KGlobalSettings::textColor());
painter.setPen(/*color);//*/stroke);
painter.drawLine(x + 1, y, x + width - 2, y);
painter.drawLine(x, y + 1, x, y + height - 2);
@@ -569,7 +569,7 @@ void KColorCombo2::drawColorRect(QPainter &painter, int x, int y, const QColor &
painter.drawLine(x + width - 1, y + 1, x + width - 1, y + height - 2);
// Round corners:
- QColor antialiasing;
+ TQColor antialiasing;
if (color.isValid()) {
antialiasing = Tool_mixColors(color, stroke);
painter.setPen(antialiasing);
@@ -579,12 +579,12 @@ void KColorCombo2::drawColorRect(QPainter &painter, int x, int y, const QColor &
painter.drawPoint(x + width - 2, y + 1);
} else {
// The two top corners:
- antialiasing = Tool_mixColors(Qt::red, stroke);
+ antialiasing = Tool_mixColors(TQt::red, stroke);
painter.setPen(antialiasing);
painter.drawPoint(x + 1, y + 1);
painter.drawPoint(x + width - 2, y + 1);
// The two bottom ones:
- antialiasing = Tool_mixColors(Qt::white, stroke);
+ antialiasing = Tool_mixColors(TQt::white, stroke);
painter.setPen(antialiasing);
painter.drawPoint(x + 1, y + height - 2);
painter.drawPoint(x + width - 2, y + height - 2);
@@ -620,7 +620,7 @@ void KColorCombo2::deleteColorArray()
void KColorCombo2::updateComboBox()
{
int height = colorRectHeight()*2/3; // fontMetrics().boundingRect(i18n("(Default)")).height() + 2
- QPixmap pixmap = colorRectPixmap(effectiveColor(), !m_color.isValid(), colorRectWidthForHeight(height), height); // TODO: isDefaultColorSelected()
+ TQPixmap pixmap = colorRectPixmap(effectiveColor(), !m_color.isValid(), colorRectWidthForHeight(height), height); // TODO: isDefaultColorSelected()
changeItem(pixmap, (m_color.isValid() ? "" : i18n("(Default)")), /*index=*/0);
}
@@ -630,17 +630,17 @@ void KColorCombo2::popup()
setRainbowPreset();
// Compute where to show the popup:
- QRect desk = KGlobalSettings::desktopGeometry(this);
+ TQRect desk = KGlobalSettings::desktopGeometry(this);
- QPoint popupPoint = mapToGlobal(QPoint(0, 0));
+ TQPoint popupPoint = mapToGlobal(TQPoint(0, 0));
- int popupHeight = m_popup->sizeHint().height();
+ int popupHeight = m_popup->tqsizeHint().height();
if (popupPoint.y() + height() + popupHeight > desk.bottom())
popupPoint.setY(popupPoint.y() - popupHeight);
else
popupPoint.setY(popupPoint.y() + height());
- int popupWidth = m_popup->sizeHint().width();
+ int popupWidth = m_popup->tqsizeHint().width();
if (popupPoint.x() + popupWidth > desk.right())
popupPoint.setX(desk.right() - popupWidth);
@@ -654,12 +654,12 @@ void KColorCombo2::popup()
m_popup->move(popupPoint);
//m_popup->setColor(m_color);
m_popup->doSelection();
- m_popup->relayout(); // FIXME: In aboutToShow() ?
+ m_popup->retqlayout(); // FIXME: In aboutToShow() ?
#if 0
-//#ifndef QT_NO_EFFECTS
- if (QApplication::isEffectEnabled(UI_AnimateCombo)) {
- if (m_popup->y() < mapToGlobal(QPoint(0,0)).y())
- qScrollEffect(m_popup, QEffects::UpScroll);
+//#ifndef TQT_NO_EFFECTS
+ if (TQApplication::isEffectEnabled(UI_AnimateCombo)) {
+ if (m_popup->y() < mapToGlobal(TQPoint(0,0)).y())
+ qScrollEffect(m_popup, TQEffects::UpScroll);
else
qScrollEffect(m_popup);
} else
@@ -669,25 +669,25 @@ void KColorCombo2::popup()
// The combo box is now shown pressed. Make it show not pressed again
// by causing its (invisible) list box to emit a 'selected' signal.
// Simulate an Enter to unpress it:
- QListBox *lb = listBox();
+ TQListBox *lb = listBox();
if (lb) {
lb->setCurrentItem(0);
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Enter, 0, 0);
- QApplication::postEvent(lb, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Enter, 0, 0);
+ TQApplication::postEvent(lb, keyEvent);
}
}
-bool KColorCombo2::eventFilter(QObject */*object*/, QEvent *event)
+bool KColorCombo2::eventFilter(TQObject */*object*/, TQEvent *event)
{
- QMouseEvent *mouseEvent;
+ TQMouseEvent *mouseEvent;
switch (event->type()) {
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseButtonPress:
- mouseEvent = (QMouseEvent*)event;
- if ( !m_popup->rect().contains(mouseEvent->pos()) ) {
- QPoint globalPos = m_popup->mapToGlobal(mouseEvent->pos());
- if (QApplication::widgetAt(globalPos, /*child=*/true) == this) {
+ case TQEvent::MouseButtonDblClick:
+ case TQEvent::MouseButtonPress:
+ mouseEvent = (TQMouseEvent*)event;
+ if ( !TQT_TQRECT_OBJECT(m_popup->rect()).tqcontains(mouseEvent->pos()) ) {
+ TQPoint globalPos = m_popup->mapToGlobal(mouseEvent->pos());
+ if (TQApplication::widgetAt(globalPos, /*child=*/true) == this) {
// The popup is being closed by a click on the KColorCombo2 widget.
// Avoid popping it up again immediately:
m_discardNextMousePress = true;
@@ -702,24 +702,24 @@ bool KColorCombo2::eventFilter(QObject */*object*/, QEvent *event)
return false;
}
-void KColorCombo2::mousePressEvent(QMouseEvent *event)
+void KColorCombo2::mousePressEvent(TQMouseEvent *event)
{
m_dragStartPos = event->pos();
if (event->button() == Qt::LeftButton && m_discardNextMousePress)
m_discardNextMousePress = false;
else
- QComboBox::mousePressEvent(event);
+ TQComboBox::mousePressEvent(event);
}
-void KColorCombo2::mouseMoveEvent(QMouseEvent *event)
+void KColorCombo2::mouseMoveEvent(TQMouseEvent *event)
{
if( (event->state() & Qt::LeftButton) &&
(event->pos() - m_dragStartPos).manhattanLength() > KGlobalSettings::dndEventDelay() ) {
// Drag color object:
KColorDrag *colorDrag = new KColorDrag(effectiveColor(), this);
// Replace the drag pixmap with our own rounded one, at the same position and dimetions:
- QPixmap pixmap = colorDrag->pixmap();
+ TQPixmap pixmap = colorDrag->pixmap();
pixmap = colorRectPixmap(effectiveColor(), /*isDefault=*/false, pixmap.width(), pixmap.height());
colorDrag->setPixmap(pixmap, colorDrag->pixmapHotSpot());
colorDrag->dragCopy();
@@ -727,38 +727,38 @@ void KColorCombo2::mouseMoveEvent(QMouseEvent *event)
}
}
-void KColorCombo2::dragEnterEvent(QDragEnterEvent *event)
+void KColorCombo2::dragEnterEvent(TQDragEnterEvent *event)
{
event->accept(isEnabled() && KColorDrag::canDecode(event));
}
-void KColorCombo2::dropEvent(QDropEvent *event)
+void KColorCombo2::dropEvent(TQDropEvent *event)
{
- QColor color;
+ TQColor color;
if (KColorDrag::decode(event, color))
setColor(color);
}
-void KColorCombo2::keyPressEvent(QKeyEvent *event)
+void KColorCombo2::keyPressEvent(TQKeyEvent *event)
{
KKey key(event);
if (KStdAccel::copy().contains(key)) {
- QMimeSource *mime = new KColorDrag(effectiveColor());
- QApplication::clipboard()->setData(mime, QClipboard::Clipboard);
+ TQMimeSource *mime = new KColorDrag(effectiveColor());
+ TQApplication::tqclipboard()->setData(mime, TQClipboard::Clipboard);
} else if (KStdAccel::paste().contains(key)) {
- QColor color;
- KColorDrag::decode(QApplication::clipboard()->data(QClipboard::Clipboard), color);
+ TQColor color;
+ KColorDrag::decode(TQApplication::tqclipboard()->data(TQClipboard::Clipboard), color);
setColor(color);
} else
- QComboBox::keyPressEvent(event);
+ TQComboBox::keyPressEvent(event);
}
-void KColorCombo2::fontChange(const QFont &oldFont)
+void KColorCombo2::fontChange(const TQFont &oldFont)
{
// Since the color-rectangle is the same height of the text, we should resize it if the font change:
updateComboBox();
- QComboBox::fontChange(oldFont); // To update geometry.
+ TQComboBox::fontChange(oldFont); // To update tqgeometry.
}
void KColorCombo2::virtual_hook(int /*id*/, void */*data*/)
diff --git a/src/kcolorcombo2.h b/src/kcolorcombo2.h
index ec264fc..e671dad 100644
--- a/src/kcolorcombo2.h
+++ b/src/kcolorcombo2.h
@@ -21,9 +21,9 @@
#ifndef KCOLORCOMBO2_H
#define KCOLORCOMBO2_H
-#include <qcombobox.h>
-#include <qcolor.h>
-#include <qpixmap.h>
+#include <tqcombobox.h>
+#include <tqcolor.h>
+#include <tqpixmap.h>
class KColorPopup;
@@ -41,17 +41,17 @@ class KColorPopup;
* Just create a new KColorCombo2() with the initial color and eventually an allowed default color
* (eg. KGlobalSettings::baseColor() for a background color, KGlobalSettings::textColor()...).\n
* You will be noticed of the color the user selects with the signal changed(), or you can use color() to get the color at any moment.\n
- * Note that they can return an invalid color (see QColor::isValid()) if the user chosen the default color (if he can choose that).\n
+ * Note that they can return an invalid color (see TQColor::isValid()) if the user chosen the default color (if he can choose that).\n
* It's then easy to save in settings, but if you want the real color (even for the default), you can get it with effectiveColor().
*
* @par Notes about default color:
- * If you set a default color using Qt or KDE standard colors, the user can change them in the KDE Control Center,
+ * If you set a default color using TQt or KDE standard colors, the user can change them in the KDE Control Center,
* but this widget willn't be update and will still show the old one.\n
* To be noticed of such color change and then update the widget with the new standard color, you can use one of those two methods:
* @code
- * void QWidgetDerivate::paletteChange(const QPalette &oldPalette) { // QWidgetDerivate is a parent or near custom widget
+ * void TQWidgetDerivate::paletteChange(const TQPalette &oldPalette) { // TQWidgetDerivate is a tqparent or near custom widget
* theComboBox->setDefaultColor(theNewDefaultColor);
- * QWidget::paletteChange(oldPalette);
+ * TQWidget::paletteChange(oldPalette);
* }
* @endcode
* or connect the signal KApplication::kdisplayPaletteChanged() to a slot that will set the default color of this widget.
@@ -73,11 +73,12 @@ class KColorPopup;
*
* @image html commoncolorselector.png "Common Color Selector ComboBox"
*/
-class KColorCombo2 : public QComboBox
+class KColorCombo2 : public TQComboBox
{
Q_OBJECT
- Q_PROPERTY(QColor color READ color WRITE setColor)
- Q_PROPERTY(QColor defaultColor READ defaultColor WRITE setDefaultColor)
+ TQ_OBJECT
+ TQ_PROPERTY(TQColor color READ color WRITE setColor)
+ TQ_PROPERTY(TQColor defaultColor READ defaultColor WRITE setDefaultColor)
public slots:
/**
@@ -86,37 +87,37 @@ class KColorCombo2 : public QComboBox
* @param color The new selected color. Can be invalid to select the default one.\n
* If @p color is invalid and no default color is allowed, the function will keep the old one.
*/
- void setColor(const QColor &color);
+ void setColor(const TQColor &color);
/**
* Change the default color.
* @param color The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
* @see defaultColor() to get it.
*/
- void setDefaultColor(const QColor &color);
+ void setDefaultColor(const TQColor &color);
signals:
/**
* Emitted when the color of the widget is changed, either with setColor() or via user selection.
* @see color() to know the content of @p newColor.
*/
- void changed(const QColor &newColor);
+ void changed(const TQColor &newColor);
public:
/**
- * Constructs a color combobox with parent @p parent called @p name.
+ * Constructs a color combobox with tqparent @p tqparent called @p name.
* @param color The initial selected color. If it is not valid, the default one will then be selected.\n
* But if @p color is invalid and there is no default color, the result is undefined.
* @param defaultColor The color to return if the user choose the default one. If it is not valid, the user willn't be allowed to choose a default one.
*/
- KColorCombo2(const QColor &color, const QColor &defaultColor, QWidget *parent = 0, const char *name = 0);
+ KColorCombo2(const TQColor &color, const TQColor &defaultColor, TQWidget *tqparent = 0, const char *name = 0);
/**
- * Constructs a color combobox with parent @p parent called @p name.\n
+ * Constructs a color combobox with tqparent @p tqparent called @p name.\n
* The user is not allowed to choose a default color, unless you call setDefaultColor() later.
* @param color The initial selected color. If it is invalid, the result is undefined.
*/
- KColorCombo2(const QColor &color, QWidget *parent = 0L, const char *name = 0L);
+ KColorCombo2(const TQColor &color, TQWidget *tqparent = 0L, const char *name = 0L);
/**
* Destroys the combobox.
@@ -129,7 +130,7 @@ class KColorCombo2 : public QComboBox
* Ideal to store it in settings for later recall.
* @see effectiveColor() if you want the color to be always valid.
*/
- QColor color() const;
+ TQColor color() const;
/**
* Return the color chosen by the user.\n
@@ -137,13 +138,13 @@ class KColorCombo2 : public QComboBox
* Ideal to directly use to draw.
* @see color() if you want to be notified of a default color choice.
*/
- QColor effectiveColor() const;
+ TQColor effectiveColor() const;
/**
* Returns the default color or an invalid color if no default color is set (if the user isn't allowed to choose a default color).
* @see setDefaultColor() to change it.
*/
- QColor defaultColor() const;
+ TQColor defaultColor() const;
/**
* Allocate a new color array of the specified dimention.\n
@@ -176,7 +177,7 @@ class KColorCombo2 : public QComboBox
* @param row The y coordinate of the color to set or change.
* @param color The color to assign at this position.
*/
- void setColorAt(int column, int row, const QColor &color);
+ void setColorAt(int column, int row, const TQColor &color);
/**
* Get a color in the array that the user can see to choose.\n
@@ -185,7 +186,7 @@ class KColorCombo2 : public QComboBox
* @return The asked color, or an invalid color if the index is out of limit of the array.
* @see columnCount() and rowCount() to get the array dimentions.
*/
- QColor colorAt(int column, int row)/* const*/;
+ TQColor colorAt(int column, int row)/* const*/;
/**
* Fill the array of colors (that will be shown to the user in the popup that appears when he/she click the arrow) with a rainbow of different luminosity.\n
@@ -208,7 +209,7 @@ class KColorCombo2 : public QComboBox
* @p darkRowCount to a small one for a fewer choice of dark colors, but at least some ones.
*/
void setRainbowPreset(int colorColumnCount = 12, int lightRowCount = 4, int darkRowCount = 4, bool withGray = true);
- //void setHsvPreset(QColor hue[], QColor saturation[], QColor value[], bool withGray = true);
+ //void setHsvPreset(TQColor hue[], TQColor saturation[], TQColor value[], bool withGray = true);
/**
* Returns a pixmap of a colored rounded-rectangle. The four corners are transparent.\n
@@ -220,11 +221,11 @@ class KColorCombo2 : public QComboBox
*
* @see drawColorRect() if you need to draw it directly: it's faster.
*/
- static QPixmap colorRectPixmap(const QColor &color, bool isDefault, int width, int height);
+ static TQPixmap colorRectPixmap(const TQColor &color, bool isDefault, int width, int height);
/**
* Draw an image of a colored rounded-rectangle.\n
- * This is like colorRectPixmap() but significantly faster because there is nothing to copy, and no transparency mask to create and apply.
+ * This is like colorRectPixmap() but significantly faster because there is nothing to copy, and no transparency tqmask to create and apply.
* @param painter The painter where to draw the image.
* @param x The x coordinate on the @p painter where to draw the rectangle.
* @param y The y coordinate on the @p painter where to draw the rectangle.
@@ -235,7 +236,7 @@ class KColorCombo2 : public QComboBox
*
* @see colorRectPixmap() to get a transparent pixmap of the rectangle.
*/
- static void drawColorRect(QPainter &painter, int x, int y, const QColor &color, bool isDefault, int width, int height);
+ static void drawColorRect(TQPainter &painter, int x, int y, const TQColor &color, bool isDefault, int width, int height);
/**
* Get the height of a color rectangle for this combobox.\n
@@ -251,18 +252,18 @@ class KColorCombo2 : public QComboBox
protected:
virtual void popup();
- virtual void mousePressEvent(QMouseEvent *event);
- virtual void mouseMoveEvent(QMouseEvent *event);
- virtual bool eventFilter(QObject *object, QEvent *event);
- virtual void dragEnterEvent(QDragEnterEvent *event);
- virtual void dropEvent(QDropEvent *event);
- virtual void keyPressEvent(QKeyEvent *event);
- virtual void fontChange(const QFont &oldFont);
+ virtual void mousePressEvent(TQMouseEvent *event);
+ virtual void mouseMoveEvent(TQMouseEvent *event);
+ virtual bool eventFilter(TQObject *object, TQEvent *event);
+ virtual void dragEnterEvent(TQDragEnterEvent *event);
+ virtual void dropEvent(TQDropEvent *event);
+ virtual void keyPressEvent(TQKeyEvent *event);
+ virtual void fontChange(const TQFont &oldFont);
private:
/**
* Initialization routine common to every constructors.\n
- * Constructors just have to initialize the QComboBox, m_color and m_defaultColor
+ * Constructors just have to initialize the TQComboBox, m_color and m_defaultColor
* and this function do the rest to complete the creation of this widget.
*/
void init();
@@ -280,13 +281,13 @@ class KColorCombo2 : public QComboBox
void updateComboBox();
KColorPopup *m_popup;
- QColor m_color;
- QColor m_defaultColor;
+ TQColor m_color;
+ TQColor m_defaultColor;
bool m_discardNextMousePress;
- QColor **m_colorArray;
+ TQColor **m_colorArray;
int m_columnCount;
int m_rowCount;
- QPoint m_dragStartPos;
+ TQPoint m_dragStartPos;
protected:
/**
@@ -306,20 +307,21 @@ class KColorCombo2 : public QComboBox
-// TODO: setColorArray(QColor **, int, int) and use signals/slots ??
+// TODO: setColorArray(TQColor **, int, int) and use signals/slots ??
-class KColorPopup : public QWidget
+class KColorPopup : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KColorPopup(KColorCombo2 *parent);
+ KColorPopup(KColorCombo2 *tqparent);
~KColorPopup();
- void relayout(); // updateGeometry() ??
+ void retqlayout(); // updateGeometry() ??
protected:
- void paintEvent(QPaintEvent */*event*/);
- void mouseMoveEvent(QMouseEvent *event);
- void mousePressEvent(QMouseEvent *event);
- void keyPressEvent(QKeyEvent *event);
+ void paintEvent(TQPaintEvent */*event*/);
+ void mouseMoveEvent(TQMouseEvent *event);
+ void mousePressEvent(TQMouseEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
void doSelection();
void validate();
void updateCell(int column, int row);
@@ -328,11 +330,11 @@ class KColorPopup : public QWidget
private:
KColorCombo2 *m_selector;
- QPixmap m_pixmap;
+ TQPixmap m_pixmap;
int m_selectedRow;
int m_selectedColumn;
int m_columnOther;
- QColor m_otherColor;
+ TQColor m_otherColor;
static const int MARGIN;
static const int FRAME_WIDTH;
diff --git a/src/keyboard.cpp b/src/keyboard.cpp
index a7871b3..9bab590 100644
--- a/src/keyboard.cpp
+++ b/src/keyboard.cpp
@@ -18,7 +18,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <kapplication.h> // it define Q_WS_X11
+#include <kapplication.h> // it define TQ_WS_X11
#include "keyboard.h"
@@ -26,13 +26,13 @@
*/
// ShiftMask, ControlMask and Mod1Mask are defined in <X11/X.h>
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
#include <X11/Xlib.h> // schroder
#endif
void Keyboard::pressedKeys(bool &shiftPressed, bool &controlPressed)
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
Window root;
Window child;
int root_x, root_y, win_x, win_y;
@@ -49,7 +49,7 @@ void Keyboard::pressedKeys(bool &shiftPressed, bool &controlPressed)
*/
bool Keyboard::shiftPressed()
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
Window root;
Window child;
int root_x, root_y, win_x, win_y;
@@ -67,7 +67,7 @@ bool Keyboard::shiftPressed()
*/
bool Keyboard::controlPressed()
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
Window root;
Window child;
int root_x, root_y, win_x, win_y;
@@ -85,7 +85,7 @@ bool Keyboard::controlPressed()
*/
bool Keyboard::altPressed()
{
-#if defined Q_WS_X11 && ! defined K_WS_QTONLY
+#if defined TQ_WS_X11 && ! defined K_WS_TQTONLY
Window root;
Window child;
int root_x, root_y, win_x, win_y;
@@ -107,7 +107,7 @@ bool Keyboard::altPressed()
/ *
* Returns the currently pressed keyboard modifiers (e.g. shift, control, etc.)
* Usually you simply want to test for those in key events, in which case
- * QKeyEvent::state() does the job (or QKeyEvent::key() to
+ * TQKeyEvent::state() does the job (or TQKeyEvent::key() to
* notice when a modifier is pressed alone).
* But it can be useful to query for the status of the modifiers at another moment
* (e.g. some KDE apps do that upon a drop event).
diff --git a/src/keyboard.h b/src/keyboard.h
index 2be6297..84e0ea3 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -23,7 +23,7 @@
/**
* Methods to know if Shift and / or Ctrl keys are pressed.
- * Depend on X, but neither Qt not KDE provide this class / methods.
+ * Depend on X, but neither TQt not KDE provide this class / methods.
* @author Sébastien Laoût
*/
namespace Keyboard
diff --git a/src/kgpgme.cpp b/src/kgpgme.cpp
index 4aaeeeb..5f6d355 100644
--- a/src/kgpgme.cpp
+++ b/src/kgpgme.cpp
@@ -28,9 +28,9 @@
#include <kiconloader.h>
#include <klistview.h>
#include <kdebug.h>
-#include <qcheckbox.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqcheckbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <klocale.h>
#include <locale.h>
#include <errno.h>
@@ -46,15 +46,15 @@ class KGpgSelKey : public KDialogBase
public:
- KGpgSelKey(QWidget *parent, const char *name, QString preselected,
+ KGpgSelKey(TQWidget *tqparent, const char *name, TQString preselected,
const KGpgMe& gpg):
- KDialogBase( parent, name, true,i18n("Private Key List"),Ok | Cancel) {
- QString keyname;
- QVBoxLayout* vbox;
- QWidget* page = new QWidget(this);
- QLabel* labeltxt;
+ KDialogBase( tqparent, name, true,i18n("Private Key List"),Ok | Cancel) {
+ TQString keyname;
+ TQVBoxLayout* vbox;
+ TQWidget* page = new TQWidget(this);
+ TQLabel* labeltxt;
KIconLoader* loader = KGlobal::iconLoader();
- QPixmap keyPair = loader->loadIcon("kgpg_key2", KIcon::Small, 20);
+ TQPixmap keyPair = loader->loadIcon("kgpg_key2", KIcon::Small, 20);
setMinimumSize(350,100);
keysListpr = new KListView(page);
@@ -66,13 +66,13 @@ class KGpgSelKey : public KDialogBase
keysListpr->setFullWidth(true);
keysListpr->setAllColumnsShowFocus(true);
- labeltxt = new QLabel(i18n("Choose a secret key:"),page);
- vbox = new QVBoxLayout(page);
+ labeltxt = new TQLabel(i18n("Choose a secret key:"),page);
+ vbox = new TQVBoxLayout(page);
KGpgKeyList list = gpg.keys(true);
for(KGpgKeyList::iterator it = list.begin(); it != list.end(); ++it) {
- QString name = gpg.checkForUtf8((*it).name);
+ TQString name = gpg.checkForUtf8((*it).name);
KListViewItem *item = new
KListViewItem(keysListpr, name, (*it).email, (*it).id);
item->setPixmap(0,keyPair);
@@ -90,8 +90,8 @@ class KGpgSelKey : public KDialogBase
setMainWidget(page);
};
- QString key() {
- QListViewItem* item = keysListpr->selectedItem();
+ TQString key() {
+ TQListViewItem* item = keysListpr->selectedItem();
if(item)
return item->text(2);
@@ -138,12 +138,12 @@ void KGpgMe::init(gpgme_protocol_t proto)
err = gpgme_engine_check_version(proto);
if(err) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(gpgme_strsource(err)).arg(gpgme_strerror(err)));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(gpgme_strsource(err)).tqarg(gpgme_strerror(err)));
}
}
-QString KGpgMe::checkForUtf8(QString txt)
+TQString KGpgMe::checkForUtf8(TQString txt)
{
// code borrowed from KGpg which borrowed it from gpa
const char *s;
@@ -151,34 +151,34 @@ QString KGpgMe::checkForUtf8(QString txt)
// Make sure the encoding is UTF-8.
// Test structure suggested by Werner Koch
if(txt.isEmpty())
- return QString::null;
+ return TQString();
for(s = txt.ascii(); *s && !(*s & 0x80); s++)
;
- if (*s && !strchr (txt.ascii(), 0xc3) && (txt.find("\\x")==-1))
+ if (*s && !strchr (txt.ascii(), 0xc3) && (txt.tqfind("\\x")==-1))
return txt;
// The string is not in UTF-8
//if (strchr (txt.ascii(), 0xc3)) return (txt+" +++");
- if (txt.find("\\x")==-1)
- return QString::fromUtf8(txt.ascii());
- // if (!strchr (txt.ascii(), 0xc3) || (txt.find("\\x")!=-1)) {
- for(int idx = 0 ; (idx = txt.find( "\\x", idx )) >= 0 ; ++idx) {
+ if (txt.tqfind("\\x")==-1)
+ return TQString::fromUtf8(txt.ascii());
+ // if (!strchr (txt.ascii(), 0xc3) || (txt.tqfind("\\x")!=-1)) {
+ for(int idx = 0 ; (idx = txt.tqfind( "\\x", idx )) >= 0 ; ++idx) {
char str[2] = "x";
- str[0] = (char)QString(txt.mid(idx + 2, 2)).toShort(0, 16);
- txt.replace(idx, 4, str);
+ str[0] = (char)TQString(txt.mid(idx + 2, 2)).toShort(0, 16);
+ txt.tqreplace(idx, 4, str);
}
if (!strchr (txt.ascii(), 0xc3))
- return QString::fromUtf8(txt.ascii());
+ return TQString::fromUtf8(txt.ascii());
else
- return QString::fromUtf8(QString::fromUtf8(txt.ascii()).ascii());
+ return TQString::fromUtf8(TQString::fromUtf8(txt.ascii()).ascii());
// perform Utf8 twice, or some keys display badly
return txt;
}
-QString KGpgMe::selectKey(QString previous)
+TQString KGpgMe::selectKey(TQString previous)
{
- KGpgSelKey dlg(kapp->activeWindow(), "", previous, *this);
+ KGpgSelKey dlg(TQT_TQWIDGET(kapp->activeWindow()), "", previous, *this);
if(dlg.exec())
return dlg.key();
@@ -220,21 +220,21 @@ KGpgKeyList KGpgMe::keys(bool privateKeys /* = false */) const
}
if(err) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(gpgme_strsource(err)).arg(gpgme_strerror(err)));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(gpgme_strsource(err)).tqarg(gpgme_strerror(err)));
}
else {
result = gpgme_op_keylist_result(m_ctx);
if (result->truncated) {
- KMessageBox::error(kapp->activeWindow(),
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()),
i18n("Key listing unexpectedly truncated."));
}
}
return keys;
}
-bool KGpgMe::encrypt(const QByteArray& inBuffer, Q_ULONG length,
- QByteArray* outBuffer, QString keyid /* = QString::null */)
+bool KGpgMe::encrypt(const TQByteArray& inBuffer, TQ_ULONG length,
+ TQByteArray* outBuffer, TQString keyid /* = TQString() */)
{
gpgme_error_t err = 0;
gpgme_data_t in = 0, out = 0;
@@ -262,9 +262,9 @@ bool KGpgMe::encrypt(const QByteArray& inBuffer, Q_ULONG length,
if(!err) {
result = gpgme_op_encrypt_result(m_ctx);
if (result->invalid_recipients) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(i18n("That public key is not meant for encryption"))
- .arg(result->invalid_recipients->fpr));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(i18n("That public key is not meant for encryption"))
+ .tqarg(result->invalid_recipients->fpr));
}
else {
err = readToBuffer(out, outBuffer);
@@ -275,8 +275,8 @@ bool KGpgMe::encrypt(const QByteArray& inBuffer, Q_ULONG length,
}
}
if(err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(gpgme_strsource(err)).arg(gpgme_strerror(err)));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(gpgme_strsource(err)).tqarg(gpgme_strerror(err)));
}
if(err != GPG_ERR_NO_ERROR)
clearCache();
@@ -289,7 +289,7 @@ bool KGpgMe::encrypt(const QByteArray& inBuffer, Q_ULONG length,
return (err == GPG_ERR_NO_ERROR);
}
-bool KGpgMe::decrypt(const QByteArray& inBuffer, QByteArray* outBuffer)
+bool KGpgMe::decrypt(const TQByteArray& inBuffer, TQByteArray* outBuffer)
{
gpgme_error_t err = 0;
gpgme_data_t in = 0, out = 0;
@@ -305,9 +305,9 @@ bool KGpgMe::decrypt(const QByteArray& inBuffer, QByteArray* outBuffer)
if(!err) {
result = gpgme_op_decrypt_result(m_ctx);
if(result->unsupported_algorithm) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(i18n("Unsupported algorithm"))
- .arg(result->unsupported_algorithm));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(i18n("Unsupported algorithm"))
+ .tqarg(result->unsupported_algorithm));
}
else {
err = readToBuffer(out, outBuffer);
@@ -317,8 +317,8 @@ bool KGpgMe::decrypt(const QByteArray& inBuffer, QByteArray* outBuffer)
}
}
if(err != GPG_ERR_NO_ERROR && err != GPG_ERR_CANCELED) {
- KMessageBox::error(kapp->activeWindow(), QString("%1: %2")
- .arg(gpgme_strsource(err)).arg(gpgme_strerror(err)));
+ KMessageBox::error(TQT_TQWIDGET(kapp->activeWindow()), TQString("%1: %2")
+ .tqarg(gpgme_strsource(err)).tqarg(gpgme_strerror(err)));
}
if(err != GPG_ERR_NO_ERROR)
clearCache();
@@ -331,7 +331,7 @@ bool KGpgMe::decrypt(const QByteArray& inBuffer, QByteArray* outBuffer)
#define BUF_SIZE (32 * 1024)
-gpgme_error_t KGpgMe::readToBuffer(gpgme_data_t in, QByteArray* outBuffer) const
+gpgme_error_t KGpgMe::readToBuffer(gpgme_data_t in, TQByteArray* outBuffer) const
{
int ret;
gpgme_error_t err = GPG_ERR_NO_ERROR;
@@ -346,7 +346,7 @@ gpgme_error_t KGpgMe::readToBuffer(gpgme_data_t in, QByteArray* outBuffer) const
if(buf) {
while((ret = gpgme_data_read(in, buf, BUF_SIZE)) > 0) {
uint size = outBuffer->size();
- if(outBuffer->resize(size + ret))
+ if(outBuffer->tqresize(size + ret))
memcpy(outBuffer->data() + size, buf, ret);
}
if(ret < 0)
@@ -359,9 +359,9 @@ gpgme_error_t KGpgMe::readToBuffer(gpgme_data_t in, QByteArray* outBuffer) const
bool KGpgMe::isGnuPGAgentAvailable()
{
- QString agent_info = getenv("GPG_AGENT_INFO");
+ TQString agent_info = getenv("GPG_AGENT_INFO");
- if (agent_info.find(':') > 0)
+ if (agent_info.tqfind(':') > 0)
return true;
return false;
}
@@ -369,13 +369,13 @@ bool KGpgMe::isGnuPGAgentAvailable()
void KGpgMe::setPassphraseCb()
{
bool agent = false;
- QString agent_info;
+ TQString agent_info;
agent_info = getenv("GPG_AGENT_INFO");
if(m_useGnuPGAgent)
{
- if (agent_info.find(':'))
+ if (agent_info.tqfind(':'))
agent = true;
if(agent_info.startsWith("disable:"))
setenv("GPG_AGENT_INFO", agent_info.mid(8), 1);
@@ -404,8 +404,8 @@ gpgme_error_t KGpgMe::passphrase(const char* uid_hint,
int last_was_bad, int fd)
{
gpgme_error_t res = GPG_ERR_CANCELED;
- QString s;
- QString gpg_hint = checkForUtf8(uid_hint);
+ TQString s;
+ TQString gpg_hint = checkForUtf8(uid_hint);
int result;
if(last_was_bad){
@@ -420,7 +420,7 @@ gpgme_error_t KGpgMe::passphrase(const char* uid_hint,
s += gpg_hint;
if(m_cache.isEmpty()){
- QCString password;
+ TQCString password;
if(m_saving)
result = KPasswordDialog::getNewPassword(password, s);
diff --git a/src/kgpgme.h b/src/kgpgme.h
index 5493273..e514500 100644
--- a/src/kgpgme.h
+++ b/src/kgpgme.h
@@ -27,7 +27,7 @@
#ifdef HAVE_LIBGPGME
#include <gpgme.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
/**
@author Petri Damsten <damu@iki.fi>
@@ -36,12 +36,12 @@
class KGpgKey
{
public:
- QString id;
- QString name;
- QString email;
+ TQString id;
+ TQString name;
+ TQString email;
};
-typedef QValueList< KGpgKey > KGpgKeyList;
+typedef TQValueList< KGpgKey > KGpgKeyList;
class KGpgMe
{
@@ -49,30 +49,30 @@ class KGpgMe
KGpgMe();
~KGpgMe();
- QString selectKey(QString previous = QString::null);
+ TQString selectKey(TQString previous = TQString());
KGpgKeyList keys(bool privateKeys = false) const;
- void setText(QString text, bool saving) { m_text = text; m_saving = saving; };
+ void setText(TQString text, bool saving) { m_text = text; m_saving = saving; };
void setUseGnuPGAgent(bool use) { m_useGnuPGAgent = use; setPassphraseCb(); };
- QString text() const { return m_text; };
+ TQString text() const { return m_text; };
bool saving() const { return m_saving; };
void clearCache();
- bool encrypt(const QByteArray& inBuffer, Q_ULONG length,
- QByteArray* outBuffer, QString keyid = QString::null);
- bool decrypt(const QByteArray& inBuffer, QByteArray* outBuffer);
+ bool encrypt(const TQByteArray& inBuffer, TQ_ULONG length,
+ TQByteArray* outBuffer, TQString keyid = TQString());
+ bool decrypt(const TQByteArray& inBuffer, TQByteArray* outBuffer);
- static QString checkForUtf8(QString txt);
+ static TQString checkForUtf8(TQString txt);
static bool isGnuPGAgentAvailable();
private:
gpgme_ctx_t m_ctx;
- QString m_text;
+ TQString m_text;
bool m_saving;
bool m_useGnuPGAgent;
- QCString m_cache;
+ TQCString m_cache;
void init(gpgme_protocol_t proto);
- gpgme_error_t readToBuffer(gpgme_data_t in, QByteArray* outBuffer) const;
+ gpgme_error_t readToBuffer(gpgme_data_t in, TQByteArray* outBuffer) const;
void setPassphraseCb();
static gpgme_error_t passphraseCb(void *hook, const char *uid_hint,
const char *passphrase_info,
diff --git a/src/kiconcanvas.cpp b/src/kiconcanvas.cpp
index 13ec6ce..77ac537 100644
--- a/src/kiconcanvas.cpp
+++ b/src/kiconcanvas.cpp
@@ -30,12 +30,12 @@
#include <kurldrag.h>
#include <kmultipledrag.h>
-#include <qsortedlist.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qtimer.h>
-#include <qfileinfo.h>
-#include <qdragobject.h>
+#include <tqsortedlist.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqtimer.h>
+#include <tqfileinfo.h>
+#include <tqdragobject.h>
#include <cmath>
#include <math.h>
#include <algorithm>
@@ -45,13 +45,13 @@
#include <svgicons/ksvgiconpainter.h>
#endif
-class KIconCanvasItem : public QIconViewItem
+class KIconCanvasItem : public TQIconViewItem
{
public:
- KIconCanvasItem ( QIconView * parent, const QString & key, const QPixmap & pixmap )
- : QIconViewItem(parent)
+ KIconCanvasItem ( TQIconView * tqparent, const TQString & key, const TQPixmap & pixmap )
+ : TQIconViewItem(tqparent)
{
- setText(QFileInfo(key).baseName());
+ setText(TQFileInfo(key).baseName());
setKey(key);
setPixmap(pixmap);
setDragEnabled(true);
@@ -59,9 +59,9 @@ class KIconCanvasItem : public QIconViewItem
}
- int compare(QIconViewItem *rhs) const
+ int compare(TQIconViewItem *rhs) const
{
- return QString::localeAwareCompare(text().lower(), rhs->text().lower());
+ return TQString::localeAwareCompare(text().lower(), rhs->text().lower());
}
};
@@ -77,7 +77,7 @@ class KIconCanvas::KIconCanvasPrivate
{
}
bool m_bLoading;
- QString mSetCurrent;
+ TQString mSetCurrent;
int mSize;
#ifdef HAVE_LIBART
KSvgIconEngine mSvgEngine;
@@ -89,15 +89,15 @@ class KIconCanvas::KIconCanvasPrivate
* KIconCanvas: Iconview for the iconloader dialog.
*/
-KIconCanvas::KIconCanvas(QWidget *parent, const char *name)
- : KIconView(parent, name)
+KIconCanvas::KIconCanvas(TQWidget *tqparent, const char *name)
+ : KIconView(tqparent, name)
{
d = new KIconCanvasPrivate;
mpLoader = KGlobal::iconLoader();
- mpTimer = new QTimer(this);
- connect(mpTimer, SIGNAL(timeout()), SLOT(slotLoadFiles()));
- connect(this, SIGNAL(currentChanged(QIconViewItem *)),
- SLOT(slotCurrentChanged(QIconViewItem *)));
+ mpTimer = new TQTimer(this);
+ connect(mpTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotLoadFiles()));
+ connect(this, TQT_SIGNAL(currentChanged(TQIconViewItem *)),
+ TQT_SLOT(slotCurrentChanged(TQIconViewItem *)));
setAcceptDrops(false);
setShowToolTips(true);
setStrictIconSize(false);
@@ -114,12 +114,12 @@ void KIconCanvas::setIconLoader(KIconLoader *loader)
mpLoader = loader;
}
-void KIconCanvas::loadIcon(const QString &name)
+void KIconCanvas::loadIcon(const TQString &name)
{
- QImage img;
- QString path = mpLoader->iconPath(name,-d->mSize);
+ TQImage img;
+ TQString path = mpLoader->iconPath(name,-d->mSize);
// Use the extension as the format. Works for XPM and PNG, but not for SVG
- QString ext = path.right(3).upper();
+ TQString ext = path.right(3).upper();
int maxSize = std::min(d->mSize, 60);
if (ext != "SVG" && ext != "VGZ")
@@ -147,13 +147,13 @@ void KIconCanvas::loadIcon(const QString &name)
img = img.smoothScale(width, maxSize);
}
}
- QPixmap pm;
+ TQPixmap pm;
pm.convertFromImage(img);
(void) new KIconCanvasItem(this, name, pm);
}
-void KIconCanvas::loadFiles(const QStringList& files)
+void KIconCanvas::loadFiles(const TQStringList& files)
{
clear();
mFiles = files;
@@ -165,25 +165,25 @@ void KIconCanvas::loadFiles(const QStringList& files)
void KIconCanvas::slotLoadFiles()
{
setResizeMode(Fixed);
- QApplication::setOverrideCursor(waitCursor);
+ TQApplication::setOverrideCursor(waitCursor);
// disable updates to not trigger paint events when adding child items
setUpdatesEnabled( false );
d->m_bLoading = true;
int count;
- QStringList::ConstIterator it;
- QStringList::ConstIterator end(mFiles.end());
+ TQStringList::ConstIterator it;
+ TQStringList::ConstIterator end(mFiles.end());
for (it=mFiles.begin(), count=0; it!=end; ++it, count++)
{
loadIcon(*it);
// Calling kapp->processEvents() makes the iconview flicker like hell
- // (it's being repainted once for every new item), so we don't do this.
- // Instead, we directly repaint the progress bar without going through
+ // (it's being tqrepainted once for every new item), so we don't do this.
+ // Instead, we directly tqrepaint the progress bar without going through
// the event-loop. We do that just once for every 10th item so that
// the progress bar doesn't flicker in turn. (pfeiffer)
- // FIXME: Qt4 will have double buffering
+ // FIXME: TQt4 will have double buffering
if ( count % 10 == 0) {
emit progress(count);
}
@@ -195,14 +195,14 @@ void KIconCanvas::slotLoadFiles()
sort();
d->m_bLoading = false;
setUpdatesEnabled( true );
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
emit finished();
setResizeMode(Adjust);
}
-QString KIconCanvas::getCurrent() const
+TQString KIconCanvas::getCurrent() const
{
- return currentItem() ? currentItem()->key() : QString::null;
+ return currentItem() ? currentItem()->key() : TQString();
}
void KIconCanvas::stopLoading()
@@ -210,9 +210,9 @@ void KIconCanvas::stopLoading()
d->m_bLoading = false;
}
-void KIconCanvas::slotCurrentChanged(QIconViewItem *item)
+void KIconCanvas::slotCurrentChanged(TQIconViewItem *item)
{
- emit nameChanged((item != 0L) ? item->text() : QString::null);
+ emit nameChanged((item != 0L) ? item->text() : TQString());
}
void KIconCanvas::setGroupOrSize( int groupOrSize )
@@ -227,16 +227,16 @@ void KIconCanvas::setStrictIconSize( bool strictIconSize )
d->mStrictIconSize = strictIconSize;
}
-QDragObject *KIconCanvas::dragObject()
+TQDragObject *KIconCanvas::dragObject()
{
- // We use QImageDrag rather than KURLDrag so that the user can't drag an icon out of the theme!
+ // We use TQImageDrag rather than KURLDrag so that the user can't drag an icon out of the theme!
// TODO: support SVG?
- QPixmap *pixmap = currentItem()->pixmap();
- QPoint pos = viewportToContents( viewport()->mapFromGlobal( QCursor::pos() ) );
- QPoint hot;
+ TQPixmap *pixmap = currentItem()->pixmap();
+ TQPoint pos = viewportToContents( viewport()->mapFromGlobal( TQCursor::pos() ) );
+ TQPoint hot;
hot.setX(pos.x() - currentItem()->pos().x() - (currentItem()->width() - pixmap->width()) / 2);
hot.setY(pos.y() - currentItem()->pos().y() - (currentItem()->height() - pixmap->height()) / 2);
- QImageDrag *drag = new QImageDrag( pixmap->convertToImage(), this );
+ TQImageDrag *drag = new TQImageDrag( pixmap->convertToImage(), this );
drag->setPixmap(*pixmap, hot);
return drag;
}
diff --git a/src/kiconcanvas.h b/src/kiconcanvas.h
index fe8f58a..81c9572 100644
--- a/src/kiconcanvas.h
+++ b/src/kiconcanvas.h
@@ -16,14 +16,14 @@
#ifndef _KICONCANVAS_H_
#define _KICONCANVAS_H_
-#include <qstring.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
#include <kiconview.h>
-class QTimer;
+class TQTimer;
class KIconLoader;
-class QDragObject;
-class QIconLoader;
+class TQDragObject;
+class TQIconLoader;
/**
* Icon canvas for KIconDialog.
@@ -32,20 +32,21 @@ class KIO_EXPORT KIconCanvas: public KIconView
/* NOTE: Why export this? */
{
Q_OBJECT
+ TQ_OBJECT
public:
- KIconCanvas(QWidget *parent=0L, const char *name=0L);
+ KIconCanvas(TQWidget *tqparent=0L, const char *name=0L);
~KIconCanvas();
/**
* Load icons into the canvas.
*/
- void loadFiles(const QStringList& files);
+ void loadFiles(const TQStringList& files);
/**
* Returns the current icon.
*/
- QString getCurrent() const;
+ TQString getCurrent() const;
void setIconLoader(KIconLoader *loader);
@@ -60,8 +61,8 @@ signals:
/**
* Emitted when the current icon has changed.
*/
- void nameChanged(QString);
- /* KDE 4: Make it const QString */
+ void nameChanged(TQString);
+ /* KDE 4: Make it const TQString */
void startLoading(int);
void progress(int);
@@ -69,17 +70,17 @@ signals:
private slots:
void slotLoadFiles();
- void slotCurrentChanged(QIconViewItem *item);
+ void slotCurrentChanged(TQIconViewItem *item);
private:
- QStringList mFiles;
- QTimer *mpTimer;
+ TQStringList mFiles;
+ TQTimer *mpTimer;
KIconLoader *mpLoader;
protected:
virtual void virtual_hook( int id, void* data );
- virtual QDragObject *dragObject();
- void loadIcon(const QString &path);
+ virtual TQDragObject *dragObject();
+ void loadIcon(const TQString &path);
private:
class KIconCanvasPrivate;
diff --git a/src/kicondialog.cpp b/src/kicondialog.cpp
index e5bf262..d9317b9 100644
--- a/src/kicondialog.cpp
+++ b/src/kicondialog.cpp
@@ -34,21 +34,21 @@
#include <kpushbutton.h>
#include <kmessagebox.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qsortedlist.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qlabel.h>
-#include <qcombobox.h>
-#include <qtimer.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qfileinfo.h>
-#include <qtoolbutton.h>
-#include <qwhatsthis.h>
-#include <qhbuttongroup.h>
-#include <qdragobject.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqsortedlist.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqtimer.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqfileinfo.h>
+#include <tqtoolbutton.h>
+#include <tqwhatsthis.h>
+#include <tqhbuttongroup.h>
+#include <tqdragobject.h>
/* NOTE: Must be in the same order as listbox */
enum ExtendedContext
@@ -67,10 +67,10 @@ class KIconDialog::KIconDialogPrivate
}
~KIconDialogPrivate() {}
bool m_bStrictIconSize;
- QString custom;
- QString customLocation;
+ TQString custom;
+ TQString customLocation;
int recentMax;
- QStringList recentList;
+ TQStringList recentList;
ExtendedContext extendedContext;
KIconDialogUI *ui; /* FIXME: KDE4 probably move this to the main class */
};
@@ -80,18 +80,18 @@ class KIconDialog::KIconDialogPrivate
* specified icons can be chosen.
*/
-KIconDialog::KIconDialog(QWidget *parent, const char*)
- : KDialogBase(parent, "IconDialog", true, i18n("Select Icon"), Ok|Cancel, Ok)
+KIconDialog::KIconDialog(TQWidget *tqparent, const char*)
+ : KDialogBase(tqparent, "IconDialog", true, i18n("Select Icon"), Ok|Cancel, Ok)
{
d = new KIconDialogPrivate;
mpLoader = KGlobal::iconLoader();
init();
- resize(minimumSize());
+ resize(tqminimumSize());
}
-KIconDialog::KIconDialog(KIconLoader *loader, QWidget *parent,
+KIconDialog::KIconDialog(KIconLoader *loader, TQWidget *tqparent,
const char *name)
- : KDialogBase(parent, name, true, i18n("Select Icon"), Ok|Cancel, Ok)
+ : KDialogBase(tqparent, name, true, i18n("Select Icon"), Ok|Cancel, Ok)
{
d = new KIconDialogPrivate;
mpLoader = loader;
@@ -103,7 +103,7 @@ void KIconDialog::init()
mGroupOrSize = KIcon::Desktop;
d->extendedContext = ALL;
mType = 0;
- setCustomLocation(QString::null); // Initialize mFileList
+ setCustomLocation(TQString()); // Initialize mFileList
// Read configuration
KConfig *config = KGlobal::config();
@@ -120,14 +120,14 @@ void KIconDialog::init()
// Hack standard Gui item, as KDevDesigner won't let us
d->ui->browseButton->setText(i18n("&Browse..."));
- connect(d->ui->browseButton, SIGNAL(clicked()), SLOT(slotBrowse()));
- connect(d->ui->listBox, SIGNAL(highlighted(int)), SLOT(slotContext(int)));
- connect(d->ui->iconCanvas, SIGNAL(executed(QIconViewItem *)), SLOT(slotOk()));
- connect(d->ui->iconCanvas, SIGNAL(returnPressed(QIconViewItem *)), SLOT(slotOk()));
- connect(d->ui->iconCanvas, SIGNAL(startLoading(int)), SLOT(slotStartLoading(int)));
- connect(d->ui->iconCanvas, SIGNAL(progress(int)), SLOT(slotProgress(int)));
- connect(d->ui->iconCanvas, SIGNAL(finished()), SLOT(slotFinished()));
- connect(this, SIGNAL(hidden()), d->ui->iconCanvas, SLOT(stopLoading()));
+ connect(d->ui->browseButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotBrowse()));
+ connect(d->ui->listBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotContext(int)));
+ connect(d->ui->iconCanvas, TQT_SIGNAL(executed(TQIconViewItem *)), TQT_SLOT(slotOk()));
+ connect(d->ui->iconCanvas, TQT_SIGNAL(returnPressed(TQIconViewItem *)), TQT_SLOT(slotOk()));
+ connect(d->ui->iconCanvas, TQT_SIGNAL(startLoading(int)), TQT_SLOT(slotStartLoading(int)));
+ connect(d->ui->iconCanvas, TQT_SIGNAL(progress(int)), TQT_SLOT(slotProgress(int)));
+ connect(d->ui->iconCanvas, TQT_SIGNAL(finished()), TQT_SLOT(slotFinished()));
+ connect(this, TQT_SIGNAL(hidden()), d->ui->iconCanvas, TQT_SLOT(stopLoading()));
// NOTE: this must be consistent with the IconType enum (see above)
d->ui->listBox->insertItem(i18n("(All Icons)"));
@@ -159,7 +159,7 @@ void KIconDialog::slotAcceptIcons()
void KIconDialog::showIcons()
{
d->ui->iconCanvas->clear();
- QStringList filelist;
+ TQStringList filelist;
KIcon::Context context = static_cast<KIcon::Context>(d->extendedContext - 1);
switch (d->extendedContext)
@@ -175,21 +175,21 @@ void KIconDialog::showIcons()
context = KIcon::Any;
// ** Fallthrough to next case **
default:
- QStringList list;
+ TQStringList list;
if (d->m_bStrictIconSize)
list=mpLoader->queryIcons(mGroupOrSize, context);
else
list=mpLoader->queryIconsByContext(mGroupOrSize, context);
// Remove path & extension
- for ( QStringList::iterator it = list.begin(); it != list.end(); ++it)
- filelist.append(QFileInfo(*it).baseName());
+ for ( TQStringList::iterator it = list.begin(); it != list.end(); ++it)
+ filelist.append(TQFileInfo(*it).baseName());
}
- // Remove duplicate icons FIXME: Qt4 we can just use QSet
+ // Remove duplicate icons FIXME: TQt4 we can just use TQSet
filelist.sort();
- QString prev;
- for ( QStringList::iterator it = filelist.begin(); it != filelist.end(); )
+ TQString prev;
+ for ( TQStringList::iterator it = filelist.begin(); it != filelist.end(); )
{
if (*it == prev)
{
@@ -232,7 +232,7 @@ int KIconDialog::iconSize() const
}
#ifndef KDE_NO_COMPAT
-QString KIconDialog::selectIcon(KIcon::Group group, KIcon::Context context, bool user)
+TQString KIconDialog::selectIcon(KIcon::Group group, KIcon::Context context, bool user)
{
setup( group, context, false, 0, user );
return openDialog();
@@ -256,8 +256,8 @@ void KIconDialog::setup(KIcon::Group group, KIcon::Context context,
d->extendedContext = static_cast<ExtendedContext>( ( context == KIcon::Any ) ? ALL : context + 1 );
- // We cannot change layout because it is protected ;-(
- // FIXME: Qt4 we will be able to inherit from both QDialog and our GUI
+ // We cannot change tqlayout because it is protected ;-(
+ // FIXME: TQt4 we will be able to inherit from both TQDialog and our GUI
d->ui->listBox->setEnabled(!lockContext);
d->ui->browseButton->setEnabled(!lockBrowse);
d->ui->listBox->setHidden(lockContext && lockBrowse);
@@ -266,24 +266,24 @@ void KIconDialog::setup(KIcon::Group group, KIcon::Context context,
d->ui->listBox->setCurrentItem(d->extendedContext);
}
-const QString & KIconDialog::customLocation( ) const
+const TQString & KIconDialog::customLocation( ) const
{
return d->customLocation;
}
-void KIconDialog::setCustomLocation( const QString& location )
+void KIconDialog::setCustomLocation( const TQString& location )
{
d->customLocation = location;
if (location.isEmpty())
{
- mFileList = KGlobal::dirs()->findAllResources("appicon", QString::fromLatin1("*.png"));
+ mFileList = KGlobal::dirs()->findAllResources("appicon", TQString::tqfromLatin1("*.png"));
} else {
mFileList = mpLoader->queryIconsByDir(location);
}
}
-QString KIconDialog::openDialog()
+TQString KIconDialog::openDialog()
{
showIcons();
@@ -296,15 +296,15 @@ QString KIconDialog::openDialog()
}
else
{
- return QString::null;
+ return TQString();
}
}
void KIconDialog::showDialog()
{
- d->custom = QString::null;
+ d->custom = TQString();
- // Make it so minimumSize returns correct value
+ // Make it so tqminimumSize returns correct value
d->ui->filterLabel->hide();
d->ui->searchLine->hide();
d->ui->progressBar->show();
@@ -313,17 +313,17 @@ void KIconDialog::showDialog()
show();
// FIXME: this should be before show() but it doesn't work ;-(
- resize(minimumSize());
+ resize(tqminimumSize());
showIcons();
}
void KIconDialog::slotOk()
{
- QString key = !d->custom.isEmpty() ? d->custom : d->ui->iconCanvas->getCurrent();
+ TQString key = !d->custom.isEmpty() ? d->custom : d->ui->iconCanvas->getCurrent();
// Append to list of recent icons
- if (!d->recentList.contains(key))
+ if (!d->recentList.tqcontains(key))
{
d->recentList.push_back(key);
@@ -336,11 +336,11 @@ void KIconDialog::slotOk()
KDialogBase::slotOk();
}
-QString KIconDialog::getIcon(KIcon::Group group, KIcon::Context context,
+TQString KIconDialog::getIcon(KIcon::Group group, KIcon::Context context,
bool strictIconSize, int iconSize, bool user,
- QWidget *parent, const QString &caption)
+ TQWidget *tqparent, const TQString &caption)
{
- KIconDialog dlg(parent, "icon dialog");
+ KIconDialog dlg(tqparent, "icon dialog");
dlg.setup( group, context, strictIconSize, iconSize, user );
if (!caption.isNull())
dlg.setCaption(caption);
@@ -353,7 +353,7 @@ void KIconDialog::slotBrowse()
// Create a file dialog to select a PNG, XPM or SVG file,
// with the image previewer shown.
// KFileDialog::getImageOpenURL doesn't allow svg.
- KFileDialog dlg(QString::null, i18n("*.png *.xpm *.svg *.svgz|Icon Files (*.png *.xpm *.svg *.svgz)"),
+ KFileDialog dlg(TQString(), i18n("*.png *.xpm *.svg *.svgz|Icon Files (*.png *.xpm *.svg *.svgz)"),
this, "filedialog", true);
dlg.setOperationMode( KFileDialog::Opening );
dlg.setCaption( i18n("Open") );
@@ -362,12 +362,12 @@ void KIconDialog::slotBrowse()
dlg.setPreviewWidget( ip );
dlg.exec();
- QString file = dlg.selectedFile();
+ TQString file = dlg.selectedFile();
if (!file.isEmpty())
{
d->custom = file;
if ( mType == 1 )
- setCustomLocation(QFileInfo( file ).dirPath( true ));
+ setCustomLocation(TQFileInfo( file ).dirPath( true ));
slotOk();
}
}
@@ -423,15 +423,15 @@ class KIconButton::KIconButtonPrivate
* KIconButton: A "choose icon" pushbutton.
*/
-KIconButton::KIconButton(QWidget *parent, const char *name)
- : QPushButton(parent, name)
+KIconButton::KIconButton(TQWidget *tqparent, const char *name)
+ : TQPushButton(tqparent, name)
{
init( KGlobal::iconLoader() );
}
KIconButton::KIconButton(KIconLoader *loader,
- QWidget *parent, const char *name)
- : QPushButton(parent, name)
+ TQWidget *tqparent, const char *name)
+ : TQPushButton(tqparent, name)
{
init( loader );
}
@@ -445,7 +445,7 @@ void KIconButton::init( KIconLoader *loader )
mpLoader = loader;
mpDialog = 0L;
- connect(this, SIGNAL(clicked()), SLOT(slotChangeIcon()));
+ connect(this, TQT_SIGNAL(clicked()), TQT_SLOT(slotChangeIcon()));
}
KIconButton::~KIconButton()
@@ -492,7 +492,7 @@ void KIconButton::setIconType(KIcon::Group group, KIcon::Context context, bool u
d->lockCustom = lockCustom;
}
-void KIconButton::setIcon(const QString& icon)
+void KIconButton::setIcon(const TQString& icon)
{
mIcon = icon;
setIconSet(mpLoader->loadIconSet(mIcon, mGroup, d->iconSize));
@@ -500,21 +500,21 @@ void KIconButton::setIcon(const QString& icon)
if (!mpDialog)
{
mpDialog = new KIconDialog(mpLoader, this);
- connect(mpDialog, SIGNAL(newIconName(const QString&)), SLOT(newIconName(const QString&)));
+ connect(mpDialog, TQT_SIGNAL(newIconName(const TQString&)), TQT_SLOT(newIconName(const TQString&)));
}
}
-const QString & KIconButton::customLocation( ) const
+const TQString & KIconButton::customLocation( ) const
{
- return mpDialog ? mpDialog->customLocation() : QString::null;
+ return mpDialog ? mpDialog->customLocation() : TQString();
}
-void KIconButton::setCustomLocation(const QString &custom)
+void KIconButton::setCustomLocation(const TQString &custom)
{
if (!mpDialog)
{
mpDialog = new KIconDialog(mpLoader, this);
- connect(mpDialog, SIGNAL(newIconName(const QString&)), SLOT(newIconName(const QString&)));
+ connect(mpDialog, TQT_SIGNAL(newIconName(const TQString&)), TQT_SLOT(newIconName(const TQString&)));
}
mpDialog->setCustomLocation(custom);
@@ -522,8 +522,8 @@ void KIconButton::setCustomLocation(const QString &custom)
void KIconButton::resetIcon()
{
- mIcon = QString::null;
- setIconSet(QIconSet());
+ mIcon = TQString();
+ setIconSet(TQIconSet());
}
void KIconButton::slotChangeIcon()
@@ -531,19 +531,19 @@ void KIconButton::slotChangeIcon()
if (!mpDialog)
{
mpDialog = new KIconDialog(mpLoader, this);
- connect(mpDialog, SIGNAL(newIconName(const QString&)), SLOT(newIconName(const QString&)));
+ connect(mpDialog, TQT_SIGNAL(newIconName(const TQString&)), TQT_SLOT(newIconName(const TQString&)));
}
mpDialog->setup( mGroup, mContext, d->m_bStrictIconSize, d->iconSize, mbUser, d->lockUser, d->lockCustom );
mpDialog->showDialog();
}
-void KIconButton::newIconName(const QString& name)
+void KIconButton::newIconName(const TQString& name)
{
if (name.isEmpty())
return;
- QIconSet iconset = mpLoader->loadIconSet(name, mGroup, d->iconSize);
+ TQIconSet iconset = mpLoader->loadIconSet(name, mGroup, d->iconSize);
setIconSet(iconset);
mIcon = name;
diff --git a/src/kicondialog.h b/src/kicondialog.h
index 6b03bd4..3cd4866 100644
--- a/src/kicondialog.h
+++ b/src/kicondialog.h
@@ -16,9 +16,9 @@
#ifndef __KIconDialog_h__
#define __KIconDialog_h__
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qpushbutton.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqpushbutton.h>
#include <kicontheme.h>
#include <kdialogbase.h>
@@ -28,10 +28,10 @@
class KIconDialogUI;
-class QComboBox;
-class QTimer;
-class QKeyEvent;
-class QRadioButton;
+class TQComboBox;
+class TQTimer;
+class TQKeyEvent;
+class TQRadioButton;
class KProgress;
class KIconLoader;
@@ -44,16 +44,17 @@ class KIconLoader;
class KIO_EXPORT KIconDialog: public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Constructs an icon selection dialog using the global iconloader.
*/
- KIconDialog(QWidget *parent=0L, const char *name=0L);
+ KIconDialog(TQWidget *tqparent=0L, const char *name=0L);
/**
* Constructs an icon selection dialog using a specific iconloader.
*/
- KIconDialog(KIconLoader *loader, QWidget *parent=0,
+ KIconDialog(KIconLoader *loader, TQWidget *tqparent=0,
const char *name=0);
/**
* Destructs the dialog.
@@ -75,13 +76,13 @@ public:
/**
* gets the custom icon directory
*/
- const QString & customLocation() const;
+ const TQString & customLocation() const;
/**
* sets a custom icon directory
* @since 3.1
*/
- void setCustomLocation( const QString& location );
+ void setCustomLocation( const TQString& location );
/**
* Sets the size of the icons to be shown / selected.
@@ -100,7 +101,7 @@ public:
/**
* @deprecated in KDE 3.0, use the static method getIcon instead.
*/
- QString selectIcon(KIcon::Group group=KIcon::Desktop, KIcon::Context
+ TQString selectIcon(KIcon::Group group=KIcon::Desktop, KIcon::Context
context=KIcon::Application, bool user=false);
#endif
@@ -130,15 +131,15 @@ public:
/**
* exec()utes this modal dialog and returns the name of the selected icon,
- * or QString::null if the dialog was aborted.
+ * or TQString() if the dialog was aborted.
* @returns the name of the icon, suitable for loading with KIconLoader.
* @see getIcon
*/
- QString openDialog();
+ TQString openDialog();
/**
- * show()es this dialog and emits a newIcon(const QString&) signal when
- * successful. QString::null will be emitted if the dialog was aborted.
+ * show()es this dialog and emits a newIcon(const TQString&) signal when
+ * successful. TQString() will be emitted if the dialog was aborted.
*/
void showDialog();
@@ -156,19 +157,19 @@ public:
* @param iconSize the size of the icons -- the default of the icongroup
* if set to 0
* @param user Begin with the "user icons" instead of "system icons".
- * @param parent The parent widget of the dialog.
+ * @param tqparent The tqparent widget of the dialog.
* @param caption The caption to use for the dialog.
* @return The name of the icon, suitable for loading with KIconLoader.
* @version New in 3.0
*/
- static QString getIcon(KIcon::Group group=KIcon::Desktop,
+ static TQString getIcon(KIcon::Group group=KIcon::Desktop,
KIcon::Context context=KIcon::Application,
bool strictIconSize=false, int iconSize = 0,
- bool user=false, QWidget *parent=0,
- const QString &caption=QString::null);
+ bool user=false, TQWidget *tqparent=0,
+ const TQString &caption=TQString());
signals:
- void newIconName(const QString&);
+ void newIconName(const TQString&);
protected slots:
void slotOk();
@@ -188,12 +189,12 @@ private:
KIcon::Context mContext;
int mType;
- QStringList mFileList;
+ TQStringList mFileList;
// FIXME: the following fields are obsolete, remove in KDE4
- QComboBox *mpCombo;
- QPushButton *mpBrowseBut;
- QRadioButton *mpRb1, *mpRb2;
+ TQComboBox *mpCombo;
+ TQPushButton *mpBrowseBut;
+ TQRadioButton *mpRb1, *mpRb2;
KProgress *mpProgress;
KIconLoader *mpLoader;
@@ -215,24 +216,25 @@ private:
* @see KIconDialog
* @short A push button that allows selection of an icon.
*/
-class KIO_EXPORT KIconButton: public QPushButton
+class KIO_EXPORT KIconButton: public TQPushButton
{
Q_OBJECT
- Q_PROPERTY( QString icon READ icon WRITE setIcon RESET resetIcon )
- Q_PROPERTY( int iconSize READ iconSize WRITE setIconSize)
- Q_PROPERTY( bool strictIconSize READ strictIconSize WRITE setStrictIconSize )
- Q_PROPERTY( QString customLocation READ customLocation WRITE setCustomLocation )
+ TQ_OBJECT
+ TQ_PROPERTY( TQString icon READ icon WRITE setIcon RESET resetIcon )
+ TQ_PROPERTY( int iconSize READ iconSize WRITE setIconSize)
+ TQ_PROPERTY( bool strictIconSize READ strictIconSize WRITE setStrictIconSize )
+ TQ_PROPERTY( TQString customLocation READ customLocation WRITE setCustomLocation )
public:
/**
* Constructs a KIconButton using the global iconloader.
*/
- KIconButton(QWidget *parent=0L, const char *name=0L);
+ KIconButton(TQWidget *tqparent=0L, const char *name=0L);
/**
* Constructs a KIconButton using a specific KIconLoader.
*/
- KIconButton(KIconLoader *loader, QWidget *parent, const char *name=0L);
+ KIconButton(KIconLoader *loader, TQWidget *tqparent, const char *name=0L);
/**
* Destructs the button.
*/
@@ -265,17 +267,17 @@ public:
/**
* sets a custom icon directory
*/
- void setCustomLocation(const QString &custom);
+ void setCustomLocation(const TQString &custom);
/**
* get the custom icon directory
*/
- const QString & customLocation() const;
+ const TQString & customLocation() const;
/**
* Sets the button's initial icon.
*/
- void setIcon(const QString& icon);
+ void setIcon(const TQString& icon);
/**
* Resets the icon (reverts to an empty button).
@@ -285,7 +287,7 @@ public:
/**
* Returns the name of the selected icon.
*/
- QString icon() const { return mIcon; }
+ TQString icon() const { return mIcon; }
/**
* Sets the size of the icon to be shown / selected.
@@ -304,12 +306,12 @@ signals:
/**
* Emitted when the icon has changed.
*/
- void iconChanged(QString icon);
- /* FIXME: KDE4: Make it const QString & */
+ void iconChanged(TQString icon);
+ /* FIXME: KDE4: Make it const TQString & */
private slots:
void slotChangeIcon();
- void newIconName(const QString& name);
+ void newIconName(const TQString& name);
private:
void init( KIconLoader *loader );
@@ -318,7 +320,7 @@ private:
KIcon::Group mGroup;
KIcon::Context mContext;
- QString mIcon;
+ TQString mIcon;
KIconDialog *mpDialog;
KIconLoader *mpLoader;
class KIconButtonPrivate;
diff --git a/src/kicondialogui.ui b/src/kicondialogui.ui
index 9cd6587..ce53af9 100644
--- a/src/kicondialogui.ui
+++ b/src/kicondialogui.ui
@@ -1,11 +1,11 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>KIconDialogUI</class>
<author>Luke Sandell</author>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>KIconDialogUI</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -21,7 +21,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@@ -54,7 +54,7 @@
<property name="name">
<cstring>iconCanvas</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>370</width>
<height>290</height>
@@ -70,9 +70,9 @@
<bool>false</bool>
</property>
</widget>
- <widget class="QLayoutWidget" row="1" column="1">
+ <widget class="TQLayoutWidget" row="1" column="1">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>tqlayout4</cstring>
</property>
<vbox>
<property name="name">
@@ -81,15 +81,15 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>tqlayout3</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>filterLabel</cstring>
</property>
@@ -232,7 +232,7 @@
<tabstop>browseButton</tabstop>
<tabstop>searchLine</tabstop>
</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klistbox.h</includehint>
<includehint>kiconcanvas.h</includehint>
diff --git a/src/likeback.cpp b/src/likeback.cpp
index 5beafc8..d22e985 100644
--- a/src/likeback.cpp
+++ b/src/likeback.cpp
@@ -27,24 +27,24 @@
#include <klocale.h>
#include <kdebug.h>
#include <kmessagebox.h>
-#include <qlayout.h>
-#include <qtoolbutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
#include <kpushbutton.h>
-#include <qcheckbox.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qvgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqvgroupbox.h>
#include <kguiitem.h>
-#include <qpopupmenu.h>
-#include <qtextedit.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqpopupmenu.h>
+#include <tqtextedit.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <kdialogbase.h>
-#include <qhttp.h>
+#include <tqhttp.h>
#include <kurl.h>
#include <kinputdialog.h>
-#include <qvalidator.h>
-#include <qaction.h>
+#include <tqvalidator.h>
+#include <tqaction.h>
#include <kdebug.h>
#include <pwd.h>
@@ -59,45 +59,45 @@
/****************************************/
LikeBackBar::LikeBackBar(LikeBack *likeBack)
- : QWidget(0, "LikeBackBar", Qt::WX11BypassWM | Qt::WStyle_NoBorder | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop | Qt::WStyle_NoBorder | Qt::Qt::WGroupLeader)
+ : TQWidget(0, "LikeBackBar", TQt::WX11BypassWM | TQt::WStyle_NoBorder | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop | TQt::WStyle_NoBorder | TQt::TQt::WGroupLeader)
, m_likeBack(likeBack)
{
- QHBoxLayout *layout = new QHBoxLayout(this);
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(this);
- QIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small);
- QIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small);
- QIconSet bugIconSet = kapp->iconLoader()->loadIconSet("likeback_bug", KIcon::Small);
- QIconSet featureIconSet = kapp->iconLoader()->loadIconSet("likeback_feature", KIcon::Small);
+ TQIconSet likeIconSet = kapp->iconLoader()->loadIconSet("likeback_like", KIcon::Small);
+ TQIconSet dislikeIconSet = kapp->iconLoader()->loadIconSet("likeback_dislike", KIcon::Small);
+ TQIconSet bugIconSet = kapp->iconLoader()->loadIconSet("likeback_bug", KIcon::Small);
+ TQIconSet featureIconSet = kapp->iconLoader()->loadIconSet("likeback_feature", KIcon::Small);
- m_likeButton = new QToolButton(this, "likeback_like");
+ m_likeButton = new TQToolButton(this, "likeback_like");
m_likeButton->setIconSet(likeIconSet);
m_likeButton->setTextLabel("<p>" + i18n("Send application developers a comment about something you like"));
m_likeButton->setAutoRaise(true);
- connect( m_likeButton, SIGNAL(clicked()), this, SLOT(clickedLike()) );
- layout->add(m_likeButton);
+ connect( m_likeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedLike()) );
+ tqlayout->add(m_likeButton);
- m_dislikeButton = new QToolButton(this, "likeback_dislike");
+ m_dislikeButton = new TQToolButton(this, "likeback_dislike");
m_dislikeButton->setIconSet(dislikeIconSet);
m_dislikeButton->setTextLabel("<p>" + i18n("Send application developers a comment about something you dislike"));
m_dislikeButton->setAutoRaise(true);
- connect( m_dislikeButton, SIGNAL(clicked()), this, SLOT(clickedDislike()) );
- layout->add(m_dislikeButton);
+ connect( m_dislikeButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedDislike()) );
+ tqlayout->add(m_dislikeButton);
- m_bugButton = new QToolButton(this, "likeback_bug");
+ m_bugButton = new TQToolButton(this, "likeback_bug");
m_bugButton->setIconSet(bugIconSet);
m_bugButton->setTextLabel("<p>" + i18n("Send application developers a comment about an improper behavior of the application"));
m_bugButton->setAutoRaise(true);
- connect( m_bugButton, SIGNAL(clicked()), this, SLOT(clickedBug()) );
- layout->add(m_bugButton);
+ connect( m_bugButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedBug()) );
+ tqlayout->add(m_bugButton);
- m_featureButton = new QToolButton(this, "likeback_feature");
+ m_featureButton = new TQToolButton(this, "likeback_feature");
m_featureButton->setIconSet(featureIconSet);
m_featureButton->setTextLabel("<p>" + i18n("Send application developers a comment about a new feature you desire"));
m_featureButton->setAutoRaise(true);
- connect( m_featureButton, SIGNAL(clicked()), this, SLOT(clickedFeature()) );
- layout->add(m_featureButton);
+ connect( m_featureButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(clickedFeature()) );
+ tqlayout->add(m_featureButton);
- connect( &m_timer, SIGNAL(timeout()), this, SLOT(autoMove()) );
+ connect( &m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(autoMove()) );
LikeBack::Button buttons = likeBack->buttons();
m_likeButton->setShown( buttons & LikeBack::Like );
@@ -122,17 +122,17 @@ void LikeBackBar::stopTimer()
void LikeBackBar::autoMove()
{
- static QWidget *lastWindow = 0;
+ static TQWidget *lastWindow = 0;
- QWidget *window = kapp->activeWindow();
- // When a Kicker applet has the focus, like the Commandline QLineEdit,
+ TQWidget *window = TQT_TQWIDGET(kapp->activeWindow());
+ // When a Kicker applet has the focus, like the Commandline TQLineEdit,
// the systemtray icon indicates to be the current window and the LikeBack is shown next to the system tray icon.
// It's obviously bad ;-) :
bool shouldShow = (m_likeBack->userWantsToShowBar() && m_likeBack->enabledBar() && window && !window->inherits("KSystemTray"));
if (shouldShow) {
//move(window->x() + window->width() - 100 - width(), window->y());
- //move(window->x() + window->width() - 100 - width(), window->mapToGlobal(QPoint(0, 0)).y() - height());
- move(window->mapToGlobal(QPoint(0, 0)).x() + window->width() - width(), window->mapToGlobal(QPoint(0, 0)).y() + 1);
+ //move(window->x() + window->width() - 100 - width(), window->mapToGlobal(TQPoint(0, 0)).y() - height());
+ move(window->mapToGlobal(TQPoint(0, 0)).x() + window->width() - width(), window->mapToGlobal(TQPoint(0, 0)).y() + 1);
if (window != lastWindow && m_likeBack->windowNamesListing() != LikeBack::NoListing) {
if (qstricmp(window->name(), "") == 0 || qstricmp(window->name(), "unnamed") == 0) {
@@ -208,7 +208,7 @@ LikeBackPrivate::~LikeBackPrivate()
/*************************************/
LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const KAboutData *aboutData)
- : QObject()
+ : TQObject()
{
// Initialize properties (1/2):
d = new LikeBackPrivate();
@@ -232,7 +232,7 @@ LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const
// Initialize the button-bar:
d->bar = new LikeBackBar(this);
- d->bar->resize(d->bar->sizeHint());
+ d->bar->resize(d->bar->tqsizeHint());
// Show the information message if it is the first time, and if the button-bar is shown:
static const char *messageShown = "LikeBack_starting_information";
@@ -243,7 +243,7 @@ LikeBack::LikeBack(Button buttons, bool showBarByDefault, KConfig *config, const
// Show the bar if that's wanted by the developer or the user:
if (d->showBar)
- QTimer::singleShot( 0, d->bar, SLOT(startTimer()) );
+ TQTimer::singleShot( 0, d->bar, TQT_SLOT(startTimer()) );
#if 0
disableBar();
@@ -283,40 +283,40 @@ LikeBack::WindowListing LikeBack::windowNamesListing()
return d->windowListing;
}
-void LikeBack::setAcceptedLanguages(const QStringList &locales, const QString &message)
+void LikeBack::setAcceptedLanguages(const TQStringList &locales, const TQString &message)
{
d->acceptedLocales = locales;
d->acceptedLanguagesMessage = message;
}
-QStringList LikeBack::acceptedLocales()
+TQStringList LikeBack::acceptedLocales()
{
return d->acceptedLocales;
}
-QString LikeBack::acceptedLanguagesMessage()
+TQString LikeBack::acceptedLanguagesMessage()
{
return d->acceptedLanguagesMessage;
}
-void LikeBack::setServer(const QString &hostName, const QString &remotePath, Q_UINT16 hostPort)
+void LikeBack::setServer(const TQString &hostName, const TQString &remotePath, TQ_UINT16 hostPort)
{
d->hostName = hostName;
d->remotePath = remotePath;
d->hostPort = hostPort;
}
-QString LikeBack::hostName()
+TQString LikeBack::hostName()
{
return d->hostName;
}
-QString LikeBack::remotePath()
+TQString LikeBack::remotePath()
{
return d->remotePath;
}
-Q_UINT16 LikeBack::hostPort()
+TQ_UINT16 LikeBack::hostPort()
{
return d->hostPort;
}
@@ -345,7 +345,7 @@ bool LikeBack::enabledBar()
return d->disabledCount <= 0;
}
-void LikeBack::execCommentDialog(Button type, const QString &initialComment, const QString &windowPath, const QString &context)
+void LikeBack::execCommentDialog(Button type, const TQString &initialComment, const TQString &windowPath, const TQString &context)
{
disableBar();
LikeBackDialog dialog(type, initialComment, windowPath, context, this);
@@ -373,13 +373,13 @@ KConfig* LikeBack::config()
return d->config;
}
-KAction* LikeBack::sendACommentAction(KActionCollection *parent)
+KAction* LikeBack::sendACommentAction(KActionCollection *tqparent)
{
if (d->action == 0)
d->action = new KAction(
i18n("&Send a Comment to Developers"), /*icon=*/"mail_new", /*shortcut=*/"",
- this, SLOT(execCommentDialog()),
- parent, "likeback_send_a_comment"
+ this, TQT_SLOT(execCommentDialog()),
+ tqparent, "likeback_send_a_comment"
);
return d->action;
@@ -411,14 +411,14 @@ void LikeBack::setUserWantsToShowBar(bool showBar)
void LikeBack::showInformationMessage()
{
// Load and register the images needed by the message:
- QPixmap likeIcon = kapp->iconLoader()->loadIcon("likeback_like", KIcon::Small);
- QPixmap dislikeIcon = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::Small);
- QPixmap bugIcon = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::Small);
- QPixmap featureIcon = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::Small);
- QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_like", likeIcon);
- QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon);
- QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon);
- QMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_feature", featureIcon);
+ TQPixmap likeIcon = kapp->iconLoader()->loadIcon("likeback_like", KIcon::Small);
+ TQPixmap dislikeIcon = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::Small);
+ TQPixmap bugIcon = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::Small);
+ TQPixmap featureIcon = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::Small);
+ TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_like", likeIcon);
+ TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_dislike", dislikeIcon);
+ TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_bug", bugIcon);
+ TQMimeSourceFactory::defaultFactory()->setPixmap("likeback_icon_feature", featureIcon);
// Show a message reflecting the allowed types of comment:
Button buttons = d->buttons;
@@ -430,7 +430,7 @@ void LikeBack::showInformationMessage()
"<p><b>" + (isDevelopmentVersion(d->aboutData->version()) ?
i18n("Welcome to this testing version of %1.") :
i18n("Welcome to %1.")
- ).arg(d->aboutData->programName()) + "</b></p>"
+ ).tqarg(d->aboutData->programName()) + "</b></p>"
"<p>" + i18n("To help us improve it, your comments are important.") + "</p>"
"<p>" +
((buttons & LikeBack::Like) && (buttons & LikeBack::Dislike) ?
@@ -446,7 +446,7 @@ void LikeBack::showInformationMessage()
"please click the frowning face below the window title-bar, "
"briefly describe what you dislike and click Send.")
:
- QString()
+ TQString()
))) + "</p>" +
(buttons & LikeBack::Bug ?
"<p>" +
@@ -480,33 +480,33 @@ void LikeBack::showInformationMessage()
i18n("Help Improve the Application"));
// Reset the images from the factory:
- QMimeSourceFactory::defaultFactory()->setData("likeback_icon_like", 0L);
- QMimeSourceFactory::defaultFactory()->setData("likeback_icon_dislike", 0L);
- QMimeSourceFactory::defaultFactory()->setData("likeback_icon_bug", 0L);
- QMimeSourceFactory::defaultFactory()->setData("likeback_icon_feature", 0L);
+ TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_like", 0L);
+ TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_dislike", 0L);
+ TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_bug", 0L);
+ TQMimeSourceFactory::defaultFactory()->setData("likeback_icon_feature", 0L);
}
-QString LikeBack::activeWindowPath()
+TQString LikeBack::activeWindowPath()
{
// Compute the window hierarchy (from the latest to the oldest):
- QStringList windowNames;
- QWidget *window = kapp->activeWindow();
+ TQStringList windowNames;
+ TQWidget *window = TQT_TQWIDGET(kapp->activeWindow());
while (window) {
- QString name = window->name();
+ TQString name = window->name();
// Append the class name to the window name if it is unnamed:
if (name == "unnamed")
- name += QString(":") + window->className();
+ name += TQString(":") + window->className();
windowNames.append(name);
- window = dynamic_cast<QWidget*>(window->parent());
+ window = dynamic_cast<TQWidget*>(window->tqparent());
}
// Create the string of windows starting by the end (from the oldest to the latest):
- QString windowPath;
+ TQString windowPath;
for (int i = ((int)windowNames.count()) - 1; i >= 0; i--) {
if (windowPath.isEmpty())
windowPath = windowNames[i];
else
- windowPath += QString("~~") + windowNames[i];
+ windowPath += TQString("~~") + windowNames[i];
}
// Finally return the computed path:
@@ -519,7 +519,7 @@ bool LikeBack::emailAddressAlreadyProvided()
return d->config->readBoolEntry("emailAlreadyAsked", false);
}
-QString LikeBack::emailAddress()
+TQString LikeBack::emailAddress()
{
if (!emailAddressAlreadyProvided())
askEmailAddress();
@@ -528,7 +528,7 @@ QString LikeBack::emailAddress()
return d->config->readEntry("emailAddress", "");
}
-void LikeBack::setEmailAddress(const QString &address, bool userProvided)
+void LikeBack::setEmailAddress(const TQString &address, bool userProvided)
{
d->config->setGroup("LikeBack");
d->config->writeEntry("emailAddress", address);
@@ -540,25 +540,25 @@ void LikeBack::askEmailAddress()
{
d->config->setGroup("LikeBack");
- QString currentEmailAddress = d->config->readEntry("emailAddress", "");
+ TQString currentEmailAddress = d->config->readEntry("emailAddress", "");
if (!emailAddressAlreadyProvided() && !d->fetchedEmail.isEmpty())
currentEmailAddress = d->fetchedEmail;
bool ok;
- QString emailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+";
- //QString namedEmailExpString = "[.]*[ \\t]+<" + emailExpString + '>';
- //QRegExp emailExp("^(|" + emailExpString + '|' + namedEmailExpString + ")$");
- QRegExp emailExp("^(|" + emailExpString + ")$");
- QRegExpValidator emailValidator(emailExp, this);
+ TQString emailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+";
+ //TQString namedEmailExpString = "[.]*[ \\t]+<" + emailExpString + '>';
+ //TQRegExp emailExp("^(|" + emailExpString + '|' + namedEmailExpString + ")$");
+ TQRegExp emailExp("^(|" + emailExpString + ")$");
+ TQRegExpValidator emailValidator(emailExp, this);
disableBar();
- QString email = KInputDialog::getText(
+ TQString email = KInputDialog::getText(
i18n("Email Address"),
"<p><b>" + i18n("Please provide your email address.") + "</b></p>" +
"<p>" + i18n("It will only be used to contact you back if more information is needed about your comments, ask you how to reproduce the bugs you report, send bug corrections for you to test, etc.") + "</p>" +
"<p>" + i18n("The email address is optional. If you do not provide any, your comments will be sent anonymously.") + "</p>",
- currentEmailAddress, &ok, kapp->activeWindow(), /*name=*/(const char*)0, &emailValidator);
+ currentEmailAddress, &ok, TQT_TQWIDGET(kapp->activeWindow()), /*name=*/(const char*)0, &emailValidator);
enableBar();
if (ok)
@@ -566,13 +566,13 @@ void LikeBack::askEmailAddress()
}
// FIXME: Should be moved to KAboutData? Cigogne will also need it.
-bool LikeBack::isDevelopmentVersion(const QString &version)
+bool LikeBack::isDevelopmentVersion(const TQString &version)
{
- return version.find("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 ||
- version.find("beta", /*index=*/0, /*caseSensitive=*/false) != -1 ||
- version.find("rc", /*index=*/0, /*caseSensitive=*/false) != -1 ||
- version.find("svn", /*index=*/0, /*caseSensitive=*/false) != -1 ||
- version.find("cvs", /*index=*/0, /*caseSensitive=*/false) != -1;
+ return version.tqfind("alpha", /*index=*/0, /*caseSensitive=*/false) != -1 ||
+ version.tqfind("beta", /*index=*/0, /*caseSensitive=*/false) != -1 ||
+ version.tqfind("rc", /*index=*/0, /*caseSensitive=*/false) != -1 ||
+ version.tqfind("svn", /*index=*/0, /*caseSensitive=*/false) != -1 ||
+ version.tqfind("cvs", /*index=*/0, /*caseSensitive=*/false) != -1;
}
/**
@@ -583,8 +583,8 @@ bool LikeBack::isDevelopmentVersion(const QString &version)
if (m_process)
return;
m_process = new KProcess();
- *m_process << QString::fromLatin1("kcmshell") << QString::fromLatin1("kcm_useraccount");
- connect( m_process, SIGNAL(processExited(KProcess*)), SLOT(fetchUserEmail()) );
+ *m_process << TQString::tqfromLatin1("kcmshell") << TQString::tqfromLatin1("kcm_useraccount");
+ connect( m_process, TQT_SIGNAL(processExited(KProcess*)), TQT_SLOT(fetchUserEmail()) );
if (!m_process->start()) {
kdDebug() << "Couldn't start kcmshell.." << endl;
delete m_process;
@@ -604,23 +604,23 @@ void LikeBack::fetchUserEmail()
// m_configureEmail->setEnabled(true);
// ### KDE4: why oh why is KEmailSettings in kio?
- KConfig emailConf( QString::fromLatin1("emaildefaults") );
+ KConfig emailConf( TQString::tqfromLatin1("emaildefaults") );
// find out the default profile
- emailConf.setGroup(QString::fromLatin1("Defaults"));
- QString profile = QString::fromLatin1("PROFILE_");
- profile += emailConf.readEntry(QString::fromLatin1("Profile"), QString::fromLatin1("Default"));
+ emailConf.setGroup(TQString::tqfromLatin1("Defaults"));
+ TQString profile = TQString::tqfromLatin1("PROFILE_");
+ profile += emailConf.readEntry(TQString::tqfromLatin1("Profile"), TQString::tqfromLatin1("Default"));
emailConf.setGroup(profile);
- QString fromaddr = emailConf.readEntry(QString::fromLatin1("EmailAddress"));
+ TQString fromaddr = emailConf.readEntry(TQString::tqfromLatin1("EmailAddress"));
if (fromaddr.isEmpty()) {
struct passwd *p;
p = getpwuid(getuid());
- d->fetchedEmail = QString::fromLatin1(p->pw_name);
+ d->fetchedEmail = TQString::tqfromLatin1(p->pw_name);
} else {
- QString name = emailConf.readEntry(QString::fromLatin1("FullName"));
+ TQString name = emailConf.readEntry(TQString::tqfromLatin1("FullName"));
if (!name.isEmpty())
- d->fetchedEmail = /*name + QString::fromLatin1(" <") +*/ fromaddr /*+ QString::fromLatin1(">")*/;
+ d->fetchedEmail = /*name + TQString::tqfromLatin1(" <") +*/ fromaddr /*+ TQString::tqfromLatin1(">")*/;
}
// m_from->setText( fromaddr );
}
@@ -629,9 +629,9 @@ void LikeBack::fetchUserEmail()
/********** class LikeBackDialog: **********/
/*******************************************/
-LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialComment, const QString &windowPath, const QString &context, LikeBack *likeBack)
+LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const TQString &initialComment, const TQString &windowPath, const TQString &context, LikeBack *likeBack)
: KDialogBase(KDialogBase::Swallow, i18n("Send a Comment to Developers"), KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Default,
- KDialogBase::Ok, kapp->activeWindow(), /*name=*/"_likeback_feedback_window_", /*modal=*/true, /*separator=*/true)
+ KDialogBase::Ok, TQT_TQWIDGET(kapp->activeWindow()), /*name=*/"_likeback_feedback_window_", /*modal=*/true, /*separator=*/true)
, m_likeBack(likeBack)
, m_windowPath(windowPath)
, m_context(context)
@@ -651,57 +651,57 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialCo
if (m_windowPath.isEmpty())
m_windowPath = LikeBack::activeWindowPath();
- QWidget *page = new QWidget(this);
- QVBoxLayout *pageLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *pageLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
// The introduction message:
- QLabel *introduction = new QLabel(introductionText(), page);
+ TQLabel *introduction = new TQLabel(introductionText(), page);
pageLayout->addWidget(introduction);
// The comment group:
- m_group = new QButtonGroup(0);//i18n("Send Application Developers a Comment About:"), page);
- QVGroupBox *box = new QVGroupBox(i18n("Send Application Developers a Comment About:"), page);
+ m_group = new TQButtonGroup(0);//i18n("Send Application Developers a Comment About:"), page);
+ TQVGroupBox *box = new TQVGroupBox(i18n("Send Application Developers a Comment About:"), page);
pageLayout->addWidget(box);
// The radio buttons:
- QWidget *buttons = new QWidget(box);
- QGridLayout *buttonsGrid = new QGridLayout(buttons, /*nbRows=*/4, /*nbColumns=*/2, /*margin=*/0, spacingHint());
+ TQWidget *buttons = new TQWidget(box);
+ TQGridLayout *buttonsGrid = new TQGridLayout(buttons, /*nbRows=*/4, /*nbColumns=*/2, /*margin=*/0, spacingHint());
if (m_likeBack->buttons() & LikeBack::Like) {
- QPixmap likePixmap = kapp->iconLoader()->loadIcon("likeback_like", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
- QLabel *likeIcon = new QLabel(buttons);
+ TQPixmap likePixmap = kapp->iconLoader()->loadIcon("likeback_like", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
+ TQLabel *likeIcon = new TQLabel(buttons);
likeIcon->setPixmap(likePixmap);
- likeIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- QRadioButton *likeButton = new QRadioButton(i18n("Something you &like"), buttons);
+ likeIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
+ TQRadioButton *likeButton = new TQRadioButton(i18n("Something you &like"), buttons);
buttonsGrid->addWidget(likeIcon, /*row=*/0, /*column=*/0);
buttonsGrid->addWidget(likeButton, /*row=*/0, /*column=*/1);
m_group->insert(likeButton, LikeBack::Like);
}
if (m_likeBack->buttons() & LikeBack::Dislike) {
- QPixmap dislikePixmap = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
- QLabel *dislikeIcon = new QLabel(buttons);
+ TQPixmap dislikePixmap = kapp->iconLoader()->loadIcon("likeback_dislike", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
+ TQLabel *dislikeIcon = new TQLabel(buttons);
dislikeIcon->setPixmap(dislikePixmap);
- dislikeIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- QRadioButton *dislikeButton = new QRadioButton(i18n("Something you &dislike"), buttons);
+ dislikeIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
+ TQRadioButton *dislikeButton = new TQRadioButton(i18n("Something you &dislike"), buttons);
buttonsGrid->addWidget(dislikeIcon, /*row=*/1, /*column=*/0);
buttonsGrid->addWidget(dislikeButton, /*row=*/1, /*column=*/1);
m_group->insert(dislikeButton, LikeBack::Dislike);
}
if (m_likeBack->buttons() & LikeBack::Bug) {
- QPixmap bugPixmap = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
- QLabel *bugIcon = new QLabel(buttons);
+ TQPixmap bugPixmap = kapp->iconLoader()->loadIcon("likeback_bug", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
+ TQLabel *bugIcon = new TQLabel(buttons);
bugIcon->setPixmap(bugPixmap);
- bugIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- QRadioButton *bugButton = new QRadioButton(i18n("An improper &behavior of this application"), buttons);
+ bugIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
+ TQRadioButton *bugButton = new TQRadioButton(i18n("An improper &behavior of this application"), buttons);
buttonsGrid->addWidget(bugIcon, /*row=*/2, /*column=*/0);
buttonsGrid->addWidget(bugButton, /*row=*/2, /*column=*/1);
m_group->insert(bugButton, LikeBack::Bug);
}
if (m_likeBack->buttons() & LikeBack::Feature) {
- QPixmap featurePixmap = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
- QLabel *featureIcon = new QLabel(buttons);
+ TQPixmap featurePixmap = kapp->iconLoader()->loadIcon("likeback_feature", KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true);
+ TQLabel *featureIcon = new TQLabel(buttons);
featureIcon->setPixmap(featurePixmap);
- featureIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- QRadioButton *featureButton = new QRadioButton(i18n("A new &feature you desire"), buttons);
+ featureIcon->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
+ TQRadioButton *featureButton = new TQRadioButton(i18n("A new &feature you desire"), buttons);
buttonsGrid->addWidget(featureIcon, /*row=*/3, /*column=*/0);
buttonsGrid->addWidget(featureButton, /*row=*/3, /*column=*/1);
m_group->insert(featureButton, LikeBack::Feature);
@@ -709,27 +709,27 @@ LikeBackDialog::LikeBackDialog(LikeBack::Button reason, const QString &initialCo
m_group->setButton(reason);
// The comment text box:
- m_comment = new QTextEdit(box);
+ m_comment = new TQTextEdit(box);
m_comment->setTabChangesFocus(true);
- m_comment->setTextFormat(QTextEdit::PlainText);
+ m_comment->setTextFormat(TQTextEdit::PlainText);
m_comment->setText(initialComment);
- m_showButtons = new QCheckBox(i18n("Show comment buttons below &window titlebars"), page);
+ m_showButtons = new TQCheckBox(i18n("Show comment buttons below &window titlebars"), page);
m_showButtons->setChecked(m_likeBack->userWantsToShowBar());
pageLayout->addWidget(m_showButtons);
- connect( m_showButtons, SIGNAL(stateChanged(int)), this, SLOT(changeButtonBarVisible()) );
+ connect( m_showButtons, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changeButtonBarVisible()) );
setButtonOK(KGuiItem(i18n("&Send Comment"), "mail_send"));
enableButtonOK(false);
- connect( m_comment, SIGNAL(textChanged()), this, SLOT(commentChanged()) );
+ connect( m_comment, TQT_SIGNAL(textChanged()), this, TQT_SLOT(commentChanged()) );
setButtonGuiItem(Default, KGuiItem(i18n("&Email Address..."), "mail_generic"));
- resize(QSize(kapp->desktop()->width() * 1 / 2, kapp->desktop()->height() * 3 / 5).expandedTo(sizeHint()));
+ resize(TQSize(kapp->desktop()->width() * 1 / 2, kapp->desktop()->height() * 3 / 5).expandedTo(tqsizeHint()));
- QAction *sendShortcut = new QAction(this);
- sendShortcut->setAccel(QString("Ctrl+Return"));
- connect( sendShortcut, SIGNAL(activated()), actionButton(Ok), SLOT(animateClick()) );
+ TQAction *sendShortcut = new TQAction(this);
+ sendShortcut->setAccel(TQString("Ctrl+Return"));
+ connect( sendShortcut, TQT_SIGNAL(activated()), actionButton(Ok), TQT_SLOT(animateClick()) );
setMainWidget(page);
}
@@ -738,16 +738,16 @@ LikeBackDialog::~LikeBackDialog()
{
}
-QString LikeBackDialog::introductionText()
+TQString LikeBackDialog::introductionText()
{
- QString text = "<p>" + i18n("Please provide a brief description of your opinion of %1.").arg(m_likeBack->aboutData()->programName()) + " ";
+ TQString text = "<p>" + i18n("Please provide a brief description of your opinion of %1.").tqarg(m_likeBack->aboutData()->programName()) + " ";
- QString languagesMessage = "";
+ TQString languagesMessage = "";
if (!m_likeBack->acceptedLocales().isEmpty() && !m_likeBack->acceptedLanguagesMessage().isEmpty()) {
languagesMessage = m_likeBack->acceptedLanguagesMessage();
- QStringList locales = m_likeBack->acceptedLocales();
- for (QStringList::Iterator it = locales.begin(); it != locales.end(); ++it) {
- QString locale = *it;
+ TQStringList locales = m_likeBack->acceptedLocales();
+ for (TQStringList::Iterator it = locales.begin(); it != locales.end(); ++it) {
+ TQString locale = *it;
if (KGlobal::locale()->language().startsWith(locale))
languagesMessage = "";
}
@@ -760,7 +760,7 @@ QString LikeBackDialog::introductionText()
// TODO: Replace the URL with a localized one:
text += languagesMessage + " " +
i18n("You may be able to use an <a href=\"%1\">online translation tool</a>.")
- .arg("http://www.google.com/language_tools?hl=" + KGlobal::locale()->language())
+ .tqarg("http://www.google.com/language_tools?hl=" + KGlobal::locale()->language())
+ " ";
// If both "I Like" and "I Dislike" buttons are shown and one is clicked:
@@ -796,17 +796,17 @@ void LikeBackDialog::changeButtonBarVisible()
void LikeBackDialog::commentChanged()
{
- QPushButton *sendButton = actionButton(Ok);
+ TQPushButton *sendButton = actionButton(Ok);
sendButton->setEnabled(!m_comment->text().isEmpty());
}
void LikeBackDialog::send()
{
- QString emailAddress = m_likeBack->emailAddress();
+ TQString emailAddress = m_likeBack->emailAddress();
int reason = m_group->selectedId();
- QString type = (reason == LikeBack::Like ? "Like" : (reason == LikeBack::Dislike ? "Dislike" : (reason == LikeBack::Bug ? "Bug" : "Feature")));
- QString data =
+ TQString type = (reason == LikeBack::Like ? "Like" : (reason == LikeBack::Dislike ? "Dislike" : (reason == LikeBack::Bug ? "Bug" : "Feature")));
+ TQString data =
"protocol=" + KURL::encode_string("1.0") + '&' +
"type=" + KURL::encode_string(type) + '&' +
"version=" + KURL::encode_string(m_likeBack->aboutData()->version()) + '&' +
@@ -815,13 +815,13 @@ void LikeBackDialog::send()
"context=" + KURL::encode_string(m_context) + '&' +
"comment=" + KURL::encode_string(m_comment->text()) + '&' +
"email=" + KURL::encode_string(emailAddress);
- QHttp *http = new QHttp(m_likeBack->hostName(), m_likeBack->hostPort());
+ TQHttp *http = new TQHttp(m_likeBack->hostName(), m_likeBack->hostPort());
std::cout << "http://" << m_likeBack->hostName() << ":" << m_likeBack->hostPort() << m_likeBack->remotePath() << std::endl;
std::cout << data << std::endl;
- connect( http, SIGNAL(requestFinished(int, bool)), this, SLOT(requestFinished(int, bool)) );
+ connect( http, TQT_SIGNAL(requestFinished(int, bool)), this, TQT_SLOT(requestFinished(int, bool)) );
- QHttpRequestHeader header("POST", m_likeBack->remotePath());
+ TQHttpRequestHeader header("POST", m_likeBack->remotePath());
header.setValue("Host", m_likeBack->hostName());
header.setValue("Content-Type", "application/x-www-form-urlencoded");
http->setHost(m_likeBack->hostName());
diff --git a/src/likeback.h b/src/likeback.h
index 4b825a5..b8c4628 100644
--- a/src/likeback.h
+++ b/src/likeback.h
@@ -21,7 +21,7 @@
#ifndef LIKEBACK_H
#define LIKEBACK_H
-#include <qobject.h>
+#include <tqobject.h>
class KConfig;
class KAboutData;
@@ -59,7 +59,7 @@ class LikeBackDialog;
* // Instanciate the LikeBack system, and show the first-use information dialog if the button-bar is shown:
* LikeBack *likeBack = new LikeBack(LikeBack::AllButtons, LikeBack::isDevelopmentVersion(kapp->aboutData->version())); // Show button-bar only in beta-versions
* likeBack->setServer("myapp.kde.org", "/likeback/send.php");
- * likeBack->setAcceptedLanguages(QStringList::split(";", "en;fr"), i18n("Please write in English or French."));
+ * likeBack->setAcceptedLanguages(TQStringList::split(";", "en;fr"), i18n("Please write in English or French."));
*
* // Comment the following line once you are sure all your windows have a name:
* likeBack->setWindowNamesListing(LikeBack::WarnUnnamedWindows);
@@ -72,9 +72,10 @@ class LikeBackDialog;
* @see Visit http://basket.kde.org/likeback.php for more information, screenshots, a tutorial, hints, return of experiences, and to download the server-side developer interface...
* @author Sebastien Laout <slaout@linux62.org>
*/
-class LikeBack : public QObject
+class LikeBack : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Ids of every LikeBack buttons the button-bar can have.
@@ -160,25 +161,25 @@ class LikeBack : public QObject
* Passing an empty list and an empty string to the method will make LikeBack display the default message telling the user only English is accepted.
* Example of call you can quickly copy, paste and adapt:
* @code
- * likeBack->setAcceptedLanguages(QStringList::split(";", "en;fr"), i18n("Please write in English or French."));
+ * likeBack->setAcceptedLanguages(TQStringList::split(";", "en;fr"), i18n("Please write in English or French."));
* @endcode
* @Note During tests, if you do not see the sentence, it is because you are running the application with an "accepted language": do not be surprised ;-)
* @param locales The list of locales where the message does not need to be shown. See TODO TODO for a list of available locales for you to choose.
* @param message The message to displays to the user to tell him what languages are accepted to write his comments.
*/
- void setAcceptedLanguages(const QStringList &locales, const QString &message);
+ void setAcceptedLanguages(const TQStringList &locales, const TQString &message);
/**
* @Returns The list of accepted locales for the user to write comments.
* @see setAcceptedLanguages()
*/
- QStringList acceptedLocales();
+ TQStringList acceptedLocales();
/**
* @Returns The message displayed to users who are not running the application in an accepted locale.
* @see setAcceptedLanguages()
*/
- QString acceptedLanguagesMessage();
+ TQString acceptedLanguagesMessage();
/**
* Set the path where LikeBack should send every comments.
@@ -188,25 +189,25 @@ class LikeBack : public QObject
* @param remotePath The path to the send script on the server. For instance, "/likeback/send.php".
* @param hostPort Optionnal port used to contact the server using the HTTP protocol. By default, it is port 80.
*/
- void setServer(const QString &hostName, const QString &remotePath, Q_UINT16 hostPort = 80);
+ void setServer(const TQString &hostName, const TQString &remotePath, TQ_UINT16 hostPort = 80);
/**
* @Returns The server host name to contact when sending comments.
* @see setServer()
*/
- QString hostName();
+ TQString hostName();
/**
* @Returns The path to the send script on the server.
* @see setServer()
*/
- QString remotePath();
+ TQString remotePath();
/**
* @Returns The port used to contact the server using the HTTP protocol.
* @see setServer()
*/
- Q_UINT16 hostPort();
+ TQ_UINT16 hostPort();
/**
* Get the KAction letting user to show the comment dialog.
@@ -219,14 +220,14 @@ class LikeBack : public QObject
* <Action name="likeback_send_a_comment" />
* @endcode
*/
- KAction* sendACommentAction(KActionCollection *parent = 0);
+ KAction* sendACommentAction(KActionCollection *tqparent = 0);
/**
* @Returns The path of the currently active window. Each windows are separated with "~~".
* Normally, you should not need to call this method since it is used to send the window path.
* But if you call execCommentDialog(), you could need to use it.
*/
- static QString activeWindowPath();
+ static TQString activeWindowPath();
/**
* @Returns The combination of buttons that are shown in the comment dialog and the button-bar.
@@ -284,7 +285,7 @@ class LikeBack : public QObject
* is commenting a thing he found/thinked about in a sub-dialog.
* @param context Not used for the moment. Will allow more fine-grained application status report.
*/
- void execCommentDialog(Button type = AllButtons, const QString &initialComment = "", const QString &windowPath = "", const QString &context = "");
+ void execCommentDialog(Button type = AllButtons, const TQString &initialComment = "", const TQString &windowPath = "", const TQString &context = "");
/**
* Popups the dialog for the user to set his email address.
@@ -345,20 +346,20 @@ class LikeBack : public QObject
* @Returns The email user address, or ask it to the user if he have not provided or ignored it.
* @Returns An empty string if the user cancelled the request dialog.
*/
- QString emailAddress();
+ TQString emailAddress();
/**
* Define or re-define the user email address.
* LikeBack will not ask it again to the user, unless you set @p userProvided to false.
* Then, this call can be considered as setting the default email address, that the user should confirm later.
*/
- void setEmailAddress(const QString &address, bool userProvided = true);
+ void setEmailAddress(const TQString &address, bool userProvided = true);
/**
* @Returns true if @p version is an Alpha, Beta, RC, SVN or CVS version.
* You can use this static method in the constructor to enable the button-bar by default only during beta-releases.
*/
- static bool isDevelopmentVersion(const QString &version);
+ static bool isDevelopmentVersion(const TQString &version);
};
#endif // LIKEBACK_H
diff --git a/src/likeback_private.h b/src/likeback_private.h
index 37ed60f..e4258a5 100644
--- a/src/likeback_private.h
+++ b/src/likeback_private.h
@@ -22,14 +22,14 @@
#define LIKEBACK_PRIVATE_H
#include <kdialogbase.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include "likeback.h"
-class QToolButton;
-class QTextEdit;
-class QCheckBox;
-class QButtonGroup;
+class TQToolButton;
+class TQTextEdit;
+class TQCheckBox;
+class TQButtonGroup;
class Kaction;
class LikeBackPrivate
@@ -41,22 +41,23 @@ class LikeBackPrivate
KConfig *config;
const KAboutData *aboutData;
LikeBack::Button buttons;
- QString hostName;
- QString remotePath;
- Q_UINT16 hostPort;
- QStringList acceptedLocales;
- QString acceptedLanguagesMessage;
+ TQString hostName;
+ TQString remotePath;
+ TQ_UINT16 hostPort;
+ TQStringList acceptedLocales;
+ TQString acceptedLanguagesMessage;
LikeBack::WindowListing windowListing;
bool showBarByDefault;
bool showBar;
int disabledCount;
- QString fetchedEmail;
+ TQString fetchedEmail;
KAction *action;
};
-class LikeBackBar : public QWidget
+class LikeBackBar : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
LikeBackBar(LikeBack *likeBack);
~LikeBackBar();
@@ -71,27 +72,28 @@ class LikeBackBar : public QWidget
void clickedFeature();
private:
LikeBack *m_likeBack;
- QTimer m_timer;
- QToolButton *m_likeButton;
- QToolButton *m_dislikeButton;
- QToolButton *m_bugButton;
- QToolButton *m_featureButton;
+ TQTimer m_timer;
+ TQToolButton *m_likeButton;
+ TQToolButton *m_dislikeButton;
+ TQToolButton *m_bugButton;
+ TQToolButton *m_featureButton;
};
class LikeBackDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- LikeBackDialog(LikeBack::Button reason, const QString &initialComment, const QString &windowPath, const QString &context, LikeBack *likeBack);
+ LikeBackDialog(LikeBack::Button reason, const TQString &initialComment, const TQString &windowPath, const TQString &context, LikeBack *likeBack);
~LikeBackDialog();
private:
LikeBack *m_likeBack;
- QString m_windowPath;
- QString m_context;
- QButtonGroup *m_group;
- QTextEdit *m_comment;
- QCheckBox *m_showButtons;
- QString introductionText();
+ TQString m_windowPath;
+ TQString m_context;
+ TQButtonGroup *m_group;
+ TQTextEdit *m_comment;
+ TQCheckBox *m_showButtons;
+ TQString introductionText();
private slots:
void polish();
void slotDefault();
diff --git a/src/linklabel.cpp b/src/linklabel.cpp
index be6e2e2..61cba80 100644
--- a/src/linklabel.cpp
+++ b/src/linklabel.cpp
@@ -18,19 +18,19 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlabel.h>
+#include <tqlabel.h>
#include <kurl.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kiconloader.h>
-#include <qcursor.h>
+#include <tqcursor.h>
#include <klocale.h>
-#include <qpushbutton.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qhgroupbox.h>
-#include <qpainter.h>
+#include <tqpushbutton.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqhgroupbox.h>
+#include <tqpainter.h>
#include <kglobalsettings.h>
-#include <qstyle.h>
+#include <tqstyle.h>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kdialogbase.h>
@@ -69,7 +69,7 @@ LinkLook::LinkLook(const LinkLook &other)
}
void LinkLook::setLook(bool italic, bool bold, int underlining,
- QColor color, QColor hoverColor,
+ TQColor color, TQColor hoverColor,
int iconSize, int preview)
{
m_italic = italic;
@@ -95,7 +95,7 @@ int LinkLook::previewSize() const
return 0;
}
-QColor LinkLook::effectiveColor() const
+TQColor LinkLook::effectiveColor() const
{
if (m_color.isValid())
return m_color;
@@ -103,7 +103,7 @@ QColor LinkLook::effectiveColor() const
return defaultColor();
}
-QColor LinkLook::effectiveHoverColor() const
+TQColor LinkLook::effectiveHoverColor() const
{
if (m_hoverColor.isValid())
return m_hoverColor;
@@ -111,7 +111,7 @@ QColor LinkLook::effectiveHoverColor() const
return defaultHoverColor();
}
-QColor LinkLook::defaultColor() const
+TQColor LinkLook::defaultColor() const
{
if (m_useLinkColor)
return KGlobalSettings::linkColor();
@@ -119,9 +119,9 @@ QColor LinkLook::defaultColor() const
return KGlobalSettings::textColor();
}
-QColor LinkLook::defaultHoverColor() const
+TQColor LinkLook::defaultHoverColor() const
{
- return Qt::red;
+ return TQt::red;
}
LinkLook* LinkLook::lookForURL(const KURL &url)
@@ -129,10 +129,10 @@ LinkLook* LinkLook::lookForURL(const KURL &url)
return url.isLocalFile() ? localLinkLook : networkLinkLook;
}
-QString LinkLook::toCSS(const QString &cssClass, const QColor &defaultTextColor) const
+TQString LinkLook::toCSS(const TQString &cssClass, const TQColor &defaultTextColor) const
{
// Set the link class:
- QString css = QString(" .%1 a { display: block; width: 100%;").arg(cssClass);
+ TQString css = TQString(" .%1 a { display: block; width: 100%;").tqarg(cssClass);
if (underlineOutside())
css += " text-decoration: underline;";
else
@@ -141,11 +141,11 @@ QString LinkLook::toCSS(const QString &cssClass, const QColor &defaultTextColor)
css += " font-style: italic;";
if (m_bold == true)
css += " font-weight: bold;";
- QColor textColor = (color().isValid() || m_useLinkColor ? effectiveColor() : defaultTextColor);
- css += QString(" color: %1; }\n").arg(textColor.name());
+ TQColor textColor = (color().isValid() || m_useLinkColor ? effectiveColor() : defaultTextColor);
+ css += TQString(" color: %1; }\n").tqarg(textColor.name());
// Set the hover state class:
- QString hover;
+ TQString hover;
if (m_underlining == OnMouseHover)
hover = "text-decoration: underline;";
else if (m_underlining == OnMouseOutside)
@@ -153,27 +153,27 @@ QString LinkLook::toCSS(const QString &cssClass, const QColor &defaultTextColor)
if (effectiveHoverColor() != effectiveColor()) {
if (!hover.isEmpty())
hover += " ";
- hover += QString("color: %4;").arg(effectiveHoverColor().name());
+ hover += TQString("color: %4;").tqarg(effectiveHoverColor().name());
}
// But include it only if it contain a different style than non-hover state:
if (!hover.isEmpty())
- css += QString(" .%1 a:hover { %2 }\n").arg(cssClass, hover);
+ css += TQString(" .%1 a:hover { %2 }\n").tqarg(cssClass, hover);
return css;
}
/** LinkLabel */
-LinkLabel::LinkLabel(int hAlign, int vAlign, QWidget *parent, const char *name, WFlags f)
- : QFrame(parent, name, f), m_isSelected(false), m_isHovered(false), m_look(0)
+LinkLabel::LinkLabel(int hAlign, int vAlign, TQWidget *tqparent, const char *name, WFlags f)
+ : TQFrame(tqparent, name, f), m_isSelected(false), m_isHovered(false), m_look(0)
{
initLabel(hAlign, vAlign);
}
-LinkLabel::LinkLabel(const QString &title, const QString &icon, LinkLook *look, int hAlign, int vAlign,
- QWidget *parent, const char *name, WFlags f)
- : QFrame(parent, name, f), m_isSelected(false), m_isHovered(false), m_look(0)
+LinkLabel::LinkLabel(const TQString &title, const TQString &icon, LinkLook *look, int hAlign, int vAlign,
+ TQWidget *tqparent, const char *name, WFlags f)
+ : TQFrame(tqparent, name, f), m_isSelected(false), m_isHovered(false), m_look(0)
{
initLabel(hAlign, vAlign);
setLink(title, icon, look);
@@ -181,16 +181,16 @@ LinkLabel::LinkLabel(const QString &title, const QString &icon, LinkLook *look,
void LinkLabel::initLabel(int hAlign, int vAlign)
{
- m_layout = new QBoxLayout(this, QBoxLayout::LeftToRight);
- m_icon = new QLabel(this);
- m_title = new QLabel(this);
- m_spacer1 = new QSpacerItem(0, 0, QSizePolicy::Preferred/*Expanding*/, QSizePolicy::Preferred/*Expanding*/);
- m_spacer2 = new QSpacerItem(0, 0, QSizePolicy::Preferred/*Expanding*/, QSizePolicy::Preferred/*Expanding*/);
+ m_layout = new TQBoxLayout(this, TQBoxLayout::LeftToRight);
+ m_icon = new TQLabel(this);
+ m_title = new TQLabel(this);
+ m_spacer1 = new TQSpacerItem(0, 0, TQSizePolicy::Preferred/*Expanding*/, TQSizePolicy::Preferred/*Expanding*/);
+ m_spacer2 = new TQSpacerItem(0, 0, TQSizePolicy::Preferred/*Expanding*/, TQSizePolicy::Preferred/*Expanding*/);
m_hAlign = hAlign;
m_vAlign = vAlign;
- m_title->setTextFormat(Qt::PlainText);
+ m_title->setTextFormat(TQt::PlainText);
// DEGUB:
//m_icon->setPaletteBackgroundColor("lightblue");
@@ -201,7 +201,7 @@ LinkLabel::~LinkLabel()
{
}
-void LinkLabel::setLink(const QString &title, const QString &icon, LinkLook *look)
+void LinkLabel::setLink(const TQString &title, const TQString &icon, LinkLook *look)
{
if (look)
m_look = look; // Needed for icon size
@@ -212,7 +212,7 @@ void LinkLabel::setLink(const QString &title, const QString &icon, LinkLook *loo
if (icon.isEmpty())
m_icon->clear();
else {
- QPixmap pixmap = DesktopIcon(icon, m_look->iconSize(), m_look->iconSize(), kapp);
+ TQPixmap pixmap = DesktopIcon(icon, m_look->iconSize(), m_look->iconSize(), kapp);
if (!pixmap.isNull())
m_icon->setPixmap(pixmap);
}
@@ -226,12 +226,12 @@ void LinkLabel::setLook(LinkLook *look) // FIXME: called externaly (so, without
{
m_look = look;
- QFont font;
+ TQFont font;
font.setBold(look->bold());
font.setUnderline(look->underlineOutside());
font.setItalic(look->italic());
m_title->setFont(font);
- m_title->setPaletteForegroundColor( m_isSelected ? KApplication::palette().active().highlightedText() : look->effectiveColor() );
+ m_title->setPaletteForegroundColor( m_isSelected ? KApplication::tqpalette().active().highlightedText() : look->effectiveColor() );
m_icon->setShown( m_icon->pixmap() && ! m_icon->pixmap()->isNull() );
@@ -246,22 +246,22 @@ void LinkLabel::setAlign(int hAlign, int vAlign)
if (!m_look)
return;
- // Define alignment flags :
+ // Define tqalignment flags :
//FIXME TODO: Use directly flags !
int hFlag, vFlag, wBreak;
switch (hAlign) {
default:
- case 0: hFlag = Qt::AlignLeft; break;
- case 1: hFlag = Qt::AlignHCenter; break;
- case 2: hFlag = Qt::AlignRight; break;
+ case 0: hFlag = TQt::AlignLeft; break;
+ case 1: hFlag = TQt::AlignHCenter; break;
+ case 2: hFlag = TQt::AlignRight; break;
}
switch (vAlign) {
- case 0: vFlag = Qt::AlignTop; break;
+ case 0: vFlag = TQt::AlignTop; break;
default:
- case 1: vFlag = Qt::AlignVCenter; break;
- case 2: vFlag = Qt::AlignBottom; break;
+ case 1: vFlag = TQt::AlignVCenter; break;
+ case 2: vFlag = TQt::AlignBottom; break;
}
- wBreak = Qt::WordBreak * (hAlign != 1);
+ wBreak = TQt::WordBreak * (hAlign != 1);
// Clear the widget :
m_layout->removeItem(m_spacer1);
@@ -269,19 +269,19 @@ void LinkLabel::setAlign(int hAlign, int vAlign)
m_layout->remove(m_title);
m_layout->removeItem(m_spacer2);
- // Otherwise, minimumSize will be incoherent (last size ? )
- m_layout->setResizeMode(QLayout::Minimum);
+ // Otherwise, tqminimumSize will be incoherent (last size ? )
+ m_layout->setResizeMode(TQLayout::Minimum);
// And re-populate the widget with the appropriates things and order
bool addSpacers = hAlign == 1;
- m_layout->setDirection(QBoxLayout::LeftToRight);
- //m_title->setSizePolicy( QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Maximum/*Expanding*/, 0, 0, false) );
- m_icon->setSizePolicy( QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred/*Expanding*/, 0, 0, false) );
- m_spacer1->changeSize( 0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred/*Expanding*/ );
- m_spacer2->changeSize( 0, 0, QSizePolicy::Expanding, QSizePolicy::Preferred/*Expanding*/ );
-
- m_icon->setAlignment( hFlag | vFlag );
- m_title->setAlignment( hFlag | vFlag | wBreak );
+ m_layout->setDirection(TQBoxLayout::LeftToRight);
+ //m_title->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Maximum/*Expanding*/, 0, 0, false) );
+ m_icon->tqsetSizePolicy( TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred/*Expanding*/, 0, 0, false) );
+ m_spacer1->changeSize( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Preferred/*Expanding*/ );
+ m_spacer2->changeSize( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Preferred/*Expanding*/ );
+
+ m_icon->tqsetAlignment( hFlag | vFlag );
+ m_title->tqsetAlignment( hFlag | vFlag | wBreak );
if ( addSpacers && (vAlign != 0) ||
(m_title->text().isEmpty() && hAlign == 2) )
m_layout->addItem(m_spacer1);
@@ -297,24 +297,24 @@ void LinkLabel::setAlign(int hAlign, int vAlign)
m_layout->addItem(m_spacer2);
}
-void LinkLabel::enterEvent(QEvent*)
+void LinkLabel::enterEvent(TQEvent*)
{
m_isHovered = true;
if ( ! m_isSelected )
m_title->setPaletteForegroundColor(m_look->effectiveHoverColor());
- QFont font = m_title->font();
+ TQFont font = m_title->font();
font.setUnderline(m_look->underlineInside());
m_title->setFont(font);
}
-void LinkLabel::leaveEvent(QEvent*)
+void LinkLabel::leaveEvent(TQEvent*)
{
m_isHovered = false;
if ( ! m_isSelected )
m_title->setPaletteForegroundColor(m_look->effectiveColor());
- QFont font = m_title->font();
+ TQFont font = m_title->font();
font.setUnderline(m_look->underlineOutside());
m_title->setFont(font);
}
@@ -323,16 +323,16 @@ void LinkLabel::setSelected(bool selected)
{
m_isSelected = selected;
if (selected)
- m_title->setPaletteForegroundColor(KApplication::palette().active().highlightedText());
+ m_title->setPaletteForegroundColor(KApplication::tqpalette().active().highlightedText());
else if (m_isHovered)
m_title->setPaletteForegroundColor(m_look->effectiveHoverColor());
else
m_title->setPaletteForegroundColor(m_look->effectiveColor());
}
-void LinkLabel::setPaletteBackgroundColor(const QColor &color)
+void LinkLabel::setPaletteBackgroundColor(const TQColor &color)
{
- QFrame::setPaletteBackgroundColor(color);
+ TQFrame::setPaletteBackgroundColor(color);
m_title->setPaletteBackgroundColor(color);
}
@@ -345,10 +345,10 @@ int LinkLabel::heightForWidth(int w) const
return (titleH >= iconS) ? titleH : iconS; // No margin for the moment !
}
-QString LinkLabel::toHtml(const QString &imageName)
+TQString LinkLabel::toHtml(const TQString &imageName)
{
- QString begin = "<font color=" + m_look->effectiveColor().name() + ">";
- QString end = "</font>";
+ TQString begin = "<font color=" + m_look->effectiveColor().name() + ">";
+ TQString end = "</font>";
if (m_look->italic()) {
begin += "<i>";
end.prepend("</i>");
@@ -362,11 +362,11 @@ QString LinkLabel::toHtml(const QString &imageName)
end.prepend("</u>");
}
if (m_icon->pixmap()) {
- QPixmap icon(*m_icon->pixmap());
+ TQPixmap icon(*m_icon->pixmap());
begin.prepend("<img src=" + imageName + " style=\"vertical-align: middle\"> ");
- QMimeSourceFactory::defaultFactory()->setPixmap(imageName, icon);
+ TQMimeSourceFactory::defaultFactory()->setPixmap(imageName, icon);
} else
- QMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
+ TQMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
return begin + Tools::textToHTMLWithoutP(m_title->text()) + end;
}
@@ -378,12 +378,12 @@ LinkDisplay::LinkDisplay()
{
}
-void LinkDisplay::setLink(const QString &title, const QString &icon, LinkLook *look, const QFont &font)
+void LinkDisplay::setLink(const TQString &title, const TQString &icon, LinkLook *look, const TQFont &font)
{
setLink(title, icon, m_preview, look, font);
}
-void LinkDisplay::setLink(const QString &title, const QString &icon, const QPixmap &preview, LinkLook *look, const QFont &font)
+void LinkDisplay::setLink(const TQString &title, const TQString &icon, const TQPixmap &preview, LinkLook *look, const TQFont &font)
{
m_title = title;
m_icon = icon;
@@ -392,15 +392,15 @@ void LinkDisplay::setLink(const QString &title, const QString &icon, const QPixm
m_font = font;
// "Constants":
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
// Recompute m_minWidth:
- QRect textRect = QFontMetrics(labelFont(font, false)).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_title);
- int iconPreviewWidth = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
+ TQRect textRect = TQFontMetrics(labelFont(font, false)).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_title);
+ int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
m_minWidth = BUTTON_MARGIN - 1 + iconPreviewWidth + LINK_MARGIN + textRect.width();
// Recompute m_maxWidth:
- textRect = QFontMetrics(labelFont(font, false)).boundingRect(0, 0, /*width=*/50000000, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_title);
+ textRect = TQFontMetrics(labelFont(font, false)).boundingRect(0, 0, /*width=*/50000000, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_title);
m_maxWidth = BUTTON_MARGIN - 1 + iconPreviewWidth + LINK_MARGIN + textRect.width();
// Adjust m_width:
if (m_width < m_minWidth)
@@ -422,35 +422,35 @@ void LinkDisplay::setWidth(int width)
/** Paint on @p painter
* in (@p x, @p y, @p width, @p height)
- * using @p colorGroup for the button drawing (if @p isHovered)
+ * using @p tqcolorGroup for the button drawing (if @p isHovered)
* and the LinkLook color() for the text,
- * unless [the LinkLook !color.isValid() and it does not useLinkColor()] or [@p isDefaultColor is false]: in this case it will use @p colorGroup.text().
+ * unless [the LinkLook !color.isValid() and it does not useLinkColor()] or [@p isDefaultColor is false]: in this case it will use @p tqcolorGroup.text().
* It will draw the button if @p isIconButtonHovered.
*/
-void LinkDisplay::paint(QPainter *painter, int x, int y, int width, int height, const QColorGroup &colorGroup,
+void LinkDisplay::paint(TQPainter *painter, int x, int y, int width, int height, const TQColorGroup &tqcolorGroup,
bool isDefaultColor, bool isSelected, bool isHovered, bool isIconButtonHovered) const
{
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
- QPixmap pixmap;
+ TQPixmap pixmap;
// Load the preview...:
if (!isHovered && m_look->previewEnabled() && !m_preview.isNull())
pixmap = m_preview;
// ... Or the icon (if no preview or if the "Open" icon should be shown):
else {
int iconSize = m_look->iconSize();
- QString iconName = (isHovered ? Global::openNoteIcon() : m_icon);
+ TQString iconName = (isHovered ? Global::openNoteIcon() : m_icon);
KIcon::States iconState = (isIconButtonHovered ? KIcon::ActiveState : KIcon::DefaultState);
pixmap = kapp->iconLoader()->loadIcon(iconName, KIcon::Desktop, iconSize, iconState, 0L, /*canReturnNull=*/false);
}
- int iconPreviewWidth = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
+ int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
int pixmapX = (iconPreviewWidth - pixmap.width()) / 2;
int pixmapY = (height - pixmap.height()) / 2;
// Draw the button (if any) and the icon:
if (isHovered)
- kapp->style().drawPrimitive(QStyle::PE_ButtonCommand, painter, QRect(-1, -1, iconPreviewWidth + 2*BUTTON_MARGIN, height + 2),
- colorGroup, QStyle::Style_Enabled | (isIconButtonHovered ? QStyle::Style_MouseOver : 0));
+ kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_ButtonCommand, painter, TQRect(-1, -1, iconPreviewWidth + 2*BUTTON_MARGIN, height + 2),
+ tqcolorGroup, TQStyle::Style_Enabled | (isIconButtonHovered ? TQStyle::Style_MouseOver : 0));
painter->drawPixmap(x + BUTTON_MARGIN - 1 + pixmapX, y + pixmapY, pixmap);
// Figure out the text color:
@@ -459,47 +459,47 @@ void LinkDisplay::paint(QPainter *painter, int x, int y, int width, int height,
else if (isIconButtonHovered)
painter->setPen(m_look->effectiveHoverColor());
else if (!isDefaultColor || (!m_look->color().isValid() && !m_look->useLinkColor())) // If the color is FORCED or if the link color default to the text color:
- painter->setPen(colorGroup.text());
+ painter->setPen(tqcolorGroup.text());
else
painter->setPen(m_look->effectiveColor());
// Draw the text:
painter->setFont(labelFont(m_font, isIconButtonHovered));
painter->drawText(x + BUTTON_MARGIN - 1 + iconPreviewWidth + LINK_MARGIN, y, width - BUTTON_MARGIN + 1 - iconPreviewWidth - LINK_MARGIN, height,
- Qt::AlignAuto | Qt::AlignVCenter | Qt::WordBreak, m_title);
+ TQt::AlignAuto | TQt::AlignVCenter | TQt::WordBreak, m_title);
}
-QPixmap LinkDisplay::feedbackPixmap(int width, int height, const QColorGroup &colorGroup, bool isDefaultColor)
+TQPixmap LinkDisplay::feedbackPixmap(int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor)
{
- int theWidth = QMIN(width, maxWidth());
- int theHeight = QMIN(height, heightForWidth(theWidth));
- QPixmap pixmap(theWidth, theHeight);
- pixmap.fill(colorGroup.background());
- QPainter painter(&pixmap);
- paint(&painter, 0, 0, theWidth, theHeight, colorGroup, isDefaultColor,
+ int theWidth = TQMIN(width, maxWidth());
+ int theHeight = TQMIN(height, heightForWidth(theWidth));
+ TQPixmap pixmap(theWidth, theHeight);
+ pixmap.fill(tqcolorGroup.background());
+ TQPainter painter(&pixmap);
+ paint(&painter, 0, 0, theWidth, theHeight, tqcolorGroup, isDefaultColor,
/*isSelected=*/false, /*isHovered=*/false, /*isIconButtonHovered=*/false);
painter.end();
return pixmap;
}
-bool LinkDisplay::iconButtonAt(const QPoint &pos) const
+bool LinkDisplay::iconButtonAt(const TQPoint &pos) const
{
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
// int LINK_MARGIN = BUTTON_MARGIN + 2;
- int iconPreviewWidth = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
+ int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
return pos.x() <= BUTTON_MARGIN - 1 + iconPreviewWidth + BUTTON_MARGIN;
}
-QRect LinkDisplay::iconButtonRect() const
+TQRect LinkDisplay::iconButtonRect() const
{
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
// int LINK_MARGIN = BUTTON_MARGIN + 2;
- int iconPreviewWidth = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
+ int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
- return QRect(0, 0, BUTTON_MARGIN - 1 + iconPreviewWidth + BUTTON_MARGIN, m_height);
+ return TQRect(0, 0, BUTTON_MARGIN - 1 + iconPreviewWidth + BUTTON_MARGIN, m_height);
}
-QFont LinkDisplay::labelFont(QFont font, bool isIconButtonHovered) const
+TQFont LinkDisplay::labelFont(TQFont font, bool isIconButtonHovered) const
{
if (m_look->italic())
font.setItalic(true);
@@ -517,91 +517,91 @@ QFont LinkDisplay::labelFont(QFont font, bool isIconButtonHovered) const
int LinkDisplay::heightForWidth(int width) const
{
- int BUTTON_MARGIN = kapp->style().pixelMetric(QStyle::PM_ButtonMargin);
+ int BUTTON_MARGIN = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ButtonMargin);
int LINK_MARGIN = BUTTON_MARGIN + 2;
- int iconPreviewWidth = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
- int iconPreviewHeight = QMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.height() : 0));
+ int iconPreviewWidth = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.width() : 0));
+ int iconPreviewHeight = TQMAX(m_look->iconSize(), (m_look->previewEnabled() ? m_preview.height() : 0));
- QRect textRect = QFontMetrics(labelFont(m_font, false)).boundingRect(0, 0, width - BUTTON_MARGIN + 1 - iconPreviewWidth - LINK_MARGIN, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_title);
- return QMAX(textRect.height(), iconPreviewHeight + 2*BUTTON_MARGIN - 2);
+ TQRect textRect = TQFontMetrics(labelFont(m_font, false)).boundingRect(0, 0, width - BUTTON_MARGIN + 1 - iconPreviewWidth - LINK_MARGIN, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_title);
+ return TQMAX(textRect.height(), iconPreviewHeight + 2*BUTTON_MARGIN - 2);
}
-QString LinkDisplay::toHtml(const QString &/*imageName*/) const
+TQString LinkDisplay::toHtml(const TQString &/*imageName*/) const
{
// TODO
return "";
}
-QString LinkDisplay::toHtml(HTMLExporter *exporter, const KURL &url, const QString &title)
+TQString LinkDisplay::toHtml(HTMLExporter *exporter, const KURL &url, const TQString &title)
{
- QString linkIcon;
+ TQString linkIcon;
if (m_look->previewEnabled() && !m_preview.isNull()) {
- QString fileName = Tools::fileNameForNewFile("preview_" + url.fileName() + ".png", exporter->iconsFolderPath);
- QString fullPath = exporter->iconsFolderPath + fileName;
+ TQString fileName = Tools::fileNameForNewFile("preview_" + url.fileName() + ".png", exporter->iconsFolderPath);
+ TQString fullPath = exporter->iconsFolderPath + fileName;
m_preview.save(fullPath, "PNG");
- linkIcon = QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
- .arg(exporter->iconsFolderName + fileName, QString::number(m_preview.width()), QString::number(m_preview.height()));
+ linkIcon = TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
+ .tqarg(exporter->iconsFolderName + fileName, TQString::number(m_preview.width()), TQString::number(m_preview.height()));
} else {
linkIcon = exporter->iconsFolderName + exporter->copyIcon(m_icon, m_look->iconSize());
- linkIcon = QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
- .arg(linkIcon, QString::number(m_look->iconSize()), QString::number(m_look->iconSize()));
+ linkIcon = TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
+ .tqarg(linkIcon, TQString::number(m_look->iconSize()), TQString::number(m_look->iconSize()));
}
- QString linkTitle = Tools::textToHTMLWithoutP(title.isEmpty() ? m_title : title);
+ TQString linkTitle = Tools::textToHTMLWithoutP(title.isEmpty() ? m_title : title);
- return QString("<a href=\"%1\">%2 %3</a>").arg(url.prettyURL(), linkIcon, linkTitle);
+ return TQString("<a href=\"%1\">%2 %3</a>").tqarg(url.prettyURL(), linkIcon, linkTitle);
}
/** LinkLookEditWidget **/
-LinkLookEditWidget::LinkLookEditWidget(KCModule *module, const QString exTitle, const QString exIcon,
- QWidget *parent, const char *name, WFlags fl)
- : QWidget(parent, name, fl)
+LinkLookEditWidget::LinkLookEditWidget(KCModule *module, const TQString exTitle, const TQString exIcon,
+ TQWidget *tqparent, const char *name, WFlags fl)
+ : TQWidget(tqparent, name, fl)
{
- QLabel *label;
- QVBoxLayout *layout = new QVBoxLayout(this, KDialogBase::marginHint(), KDialogBase::spacingHint());
+ TQLabel *label;
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, KDialogBase::marginHint(), KDialogBase::spacingHint());
- m_italic = new QCheckBox(i18n("I&talic"), this);
- layout->addWidget(m_italic);
+ m_italic = new TQCheckBox(i18n("I&talic"), this);
+ tqlayout->addWidget(m_italic);
- m_bold = new QCheckBox(i18n("&Bold"), this);
- layout->addWidget(m_bold);
+ m_bold = new TQCheckBox(i18n("&Bold"), this);
+ tqlayout->addWidget(m_bold);
- QGridLayout *gl = new QGridLayout(layout, /*rows=*//*(look->canPreview() ? 5 : 4)*/5, /*columns=*//*3*/4);
- gl->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 1, /*2*/3);
+ TQGridLayout *gl = new TQGridLayout(tqlayout, /*rows=*//*(look->canPreview() ? 5 : 4)*/5, /*columns=*//*3*/4);
+ gl->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding), 1, /*2*/3);
- m_underlining = new QComboBox(false, this);
+ m_underlining = new TQComboBox(false, this);
m_underlining->insertItem(i18n("Always"));
m_underlining->insertItem(i18n("Never"));
m_underlining->insertItem(i18n("On mouse hovering"));
m_underlining->insertItem(i18n("When mouse is outside"));
- label = new QLabel(m_underlining, i18n("&Underline:"), this);
+ label = new TQLabel(m_underlining, i18n("&Underline:"), this);
gl->addWidget(label, 0, 0);
gl->addWidget(m_underlining, 0, 1);
- m_color = new KColorCombo2(QRgb(), this);
- label = new QLabel(m_color, i18n("Colo&r:"), this);
+ m_color = new KColorCombo2(TQRgb(), this);
+ label = new TQLabel(m_color, i18n("Colo&r:"), this);
gl->addWidget(label, 1, 0);
gl->addWidget(m_color, 1, 1);
- m_hoverColor = new KColorCombo2(QRgb(), this);
- label = new QLabel(m_hoverColor, i18n("&Mouse hover color:"), this);
+ m_hoverColor = new KColorCombo2(TQRgb(), this);
+ label = new TQLabel(m_hoverColor, i18n("&Mouse hover color:"), this);
gl->addWidget(label, 2, 0);
gl->addWidget(m_hoverColor, 2, 1);
- QHBoxLayout *icoLay = new QHBoxLayout(/*parent=*/0L, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *icoLay = new TQHBoxLayout(/*tqparent=*/0L, /*margin=*/0, KDialogBase::spacingHint());
m_iconSize = new IconSizeCombo(false, this);
icoLay->addWidget(m_iconSize);
- label = new QLabel(m_iconSize, i18n("&Icon size:"), this);
+ label = new TQLabel(m_iconSize, i18n("&Icon size:"), this);
gl->addWidget(label, 3, 0);
gl->addItem( icoLay, 3, 1);
- m_preview = new QComboBox(false, this);
+ m_preview = new TQComboBox(false, this);
m_preview->insertItem(i18n("None"));
m_preview->insertItem(i18n("Icon size"));
m_preview->insertItem(i18n("Twice the icon size"));
m_preview->insertItem(i18n("Three times the icon size"));
- m_label = new QLabel(m_preview, i18n("&Preview:"), this);
+ m_label = new TQLabel(m_preview, i18n("&Preview:"), this);
m_hLabel = new HelpLabel(
i18n("You disabled preview but still see images?"),
i18n("<p>This is normal because there are several type of notes.<br>"
@@ -614,36 +614,36 @@ LinkLookEditWidget::LinkLookEditWidget(KCModule *module, const QString exTitle,
"<p>If you do not want the application to create notes depending on the content of the files you drop, "
"go to the \"General\" page and uncheck \"Image or animation\" in the \"View Content of Added Files for the Following Types\" group.</p>")
// TODO: Note: you can resize down maximum size of images...
- .arg(kapp->aboutData()->programName(), kapp->aboutData()->programName()),
+ .tqarg(kapp->aboutData()->programName(), kapp->aboutData()->programName()),
this);
gl->addWidget(m_label, 4, 0);
gl->addWidget(m_preview, 4, 1);
gl->addMultiCellWidget(m_hLabel, /*fromRow=*/5, /*toRow=*/5, /*fromCol=*/1, /*toCol*/2);
- QGroupBox *gb = new QHGroupBox(i18n("Example"), this);
+ TQGroupBox *gb = new TQHGroupBox(i18n("Example"), this);
m_exLook = new LinkLook;
m_example = new LinkLabel(exTitle, exIcon, m_exLook, 1, 1, gb);
- m_example->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- m_example->setCursor(QCursor(Qt::PointingHandCursor));
- layout->addWidget(gb);
+ m_example->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
+ m_example->setCursor(TQCursor(TQt::PointingHandCursor));
+ tqlayout->addWidget(gb);
m_exTitle = exTitle;
m_exIcon = exIcon;
- connect( m_italic, SIGNAL(stateChanged(int)), this, SLOT(slotChangeLook()) );
- connect( m_bold, SIGNAL(stateChanged(int)), this, SLOT(slotChangeLook()) );
- connect( m_underlining, SIGNAL(activated(int)), this, SLOT(slotChangeLook()) );
- connect( m_color, SIGNAL(changed(const QColor&)), this, SLOT(slotChangeLook()) );
- connect( m_hoverColor, SIGNAL(changed(const QColor&)), this, SLOT(slotChangeLook()) );
- connect( m_iconSize, SIGNAL(activated(int)), this, SLOT(slotChangeLook()) );
- connect( m_preview, SIGNAL(activated(int)), this, SLOT(slotChangeLook()) );
-
- connect( m_italic, SIGNAL(stateChanged(int)), module, SLOT(changed()) );
- connect( m_bold, SIGNAL(stateChanged(int)), module, SLOT(changed()) );
- connect( m_underlining, SIGNAL(activated(int)), module, SLOT(changed()) );
- connect( m_color, SIGNAL(changed(const QColor&)), module, SLOT(changed()) );
- connect( m_hoverColor, SIGNAL(changed(const QColor&)), module, SLOT(changed()) );
- connect( m_iconSize, SIGNAL(activated(int)), module, SLOT(changed()) );
- connect( m_preview, SIGNAL(activated(int)), module, SLOT(changed()) );
+ connect( m_italic, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_bold, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_underlining, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_color, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_hoverColor, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_iconSize, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLook()) );
+ connect( m_preview, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotChangeLook()) );
+
+ connect( m_italic, TQT_SIGNAL(stateChanged(int)), module, TQT_SLOT(changed()) );
+ connect( m_bold, TQT_SIGNAL(stateChanged(int)), module, TQT_SLOT(changed()) );
+ connect( m_underlining, TQT_SIGNAL(activated(int)), module, TQT_SLOT(changed()) );
+ connect( m_color, TQT_SIGNAL(changed(const TQColor&)), module, TQT_SLOT(changed()) );
+ connect( m_hoverColor, TQT_SIGNAL(changed(const TQColor&)), module, TQT_SLOT(changed()) );
+ connect( m_iconSize, TQT_SIGNAL(activated(int)), module, TQT_SLOT(changed()) );
+ connect( m_preview, TQT_SIGNAL(activated(int)), module, TQT_SLOT(changed()) );
}
void LinkLookEditWidget::set(LinkLook *look)
diff --git a/src/linklabel.h b/src/linklabel.h
index 3e964c1..bee254c 100644
--- a/src/linklabel.h
+++ b/src/linklabel.h
@@ -21,17 +21,17 @@
#ifndef LINKLABEL_H
#define LINKLABEL_H
-#include <qframe.h>
+#include <tqframe.h>
-class QString;
+class TQString;
class KURL;
-class QColor;
-class QLabel;
-class QBoxLayout;
-class QSpacerItem;
-class QPushButton;
-class QCheckBox;
-class QComboBox;
+class TQColor;
+class TQLabel;
+class TQBoxLayout;
+class TQSpacerItem;
+class TQPushButton;
+class TQCheckBox;
+class TQComboBox;
class KColorCombo2;
class IconSizeCombo;
@@ -51,13 +51,13 @@ class LinkLook
LinkLook(bool useLinkColor = true, bool canPreview = true);
LinkLook(const LinkLook &other);
void setLook( bool italic, bool bold, int underlining,
- QColor color, QColor hoverColor,
+ TQColor color, TQColor hoverColor,
int iconSize, int preview /*= None*/ );
inline bool italic() const { return m_italic; }
inline bool bold() const { return m_bold; }
inline int underlining() const { return m_underlining; }
- inline QColor color() const { return m_color; }
- inline QColor hoverColor() const { return m_hoverColor; }
+ inline TQColor color() const { return m_color; }
+ inline TQColor hoverColor() const { return m_hoverColor; }
inline int iconSize() const { return m_iconSize; }
inline int preview() const { return m_preview; }
inline bool useLinkColor() const { return m_useLinkColor; }
@@ -67,17 +67,17 @@ class LinkLook
bool underlineInside() const { return underlining() == Always || underlining() == OnMouseHover; }
bool previewEnabled() const { return canPreview() && preview() > None; }
int previewSize() const;
- QColor effectiveColor() const;
- QColor effectiveHoverColor() const;
- QColor defaultColor() const;
- QColor defaultHoverColor() const;
- QString toCSS(const QString &cssClass, const QColor &defaultTextColor) const;
+ TQColor effectiveColor() const;
+ TQColor effectiveHoverColor() const;
+ TQColor defaultColor() const;
+ TQColor defaultHoverColor() const;
+ TQString toCSS(const TQString &cssClass, const TQColor &defaultTextColor) const;
private:
bool m_italic;
bool m_bold;
int m_underlining;
- QColor m_color;
- QColor m_hoverColor;
+ TQColor m_color;
+ TQColor m_hoverColor;
int m_iconSize;
int m_preview;
bool m_useLinkColor;
@@ -97,32 +97,33 @@ class LinkLook
* Note : This label will appear blank while LinkLook willn't be set
* @author S�astien Laot
*/
-class LinkLabel : public QFrame
+class LinkLabel : public TQFrame
{
Q_OBJECT
+ TQ_OBJECT
public:
- LinkLabel(int hAlign, int vAlign, QWidget *parent = 0, const char *name = 0, WFlags f = 0);
- LinkLabel(const QString &title, const QString &icon, LinkLook *look, int hAlign, int vAlign,
- QWidget *parent = 0, const char *name = 0, WFlags f = 0);
+ LinkLabel(int hAlign, int vAlign, TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0);
+ LinkLabel(const TQString &title, const TQString &icon, LinkLook *look, int hAlign, int vAlign,
+ TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0);
~LinkLabel();
public:
- void setLink(const QString &title, const QString &icon, LinkLook *look = 0);
+ void setLink(const TQString &title, const TQString &icon, LinkLook *look = 0);
void setLook(LinkLook *look);
void setAlign(int hAlign, int vAlign);
void setSelected(bool selected);
- void setPaletteBackgroundColor(const QColor &color);
+ void setPaletteBackgroundColor(const TQColor &color);
int heightForWidth(int w = -1) const;
- QString toHtml(const QString &imageName);
+ TQString toHtml(const TQString &imageName);
protected:
void initLabel(int hAlign, int vAlign);
- void enterEvent(QEvent*);
- void leaveEvent(QEvent*);
+ void enterEvent(TQEvent*);
+ void leaveEvent(TQEvent*);
private:
- QBoxLayout *m_layout;
- QLabel *m_icon;
- QLabel *m_title;
- QSpacerItem *m_spacer1;
- QSpacerItem *m_spacer2;
+ TQBoxLayout *m_layout;
+ TQLabel *m_icon;
+ TQLabel *m_title;
+ TQSpacerItem *m_spacer1;
+ TQSpacerItem *m_spacer2;
bool m_isSelected;
bool m_isHovered;
@@ -142,8 +143,8 @@ class LinkDisplay
public:
LinkDisplay(); /// << Create a new empty unselected LinkDisplay. Please then call setLink() to make sense.
// Configure the link displayer:
- void setLink(const QString &title, const QString &icon, LinkLook *look, const QFont &font); /// << Change the content and disposition. minWidth(), width() & height() can have changed. Keep the old preview (if any)
- void setLink(const QString &title, const QString &icon, const QPixmap &preview, LinkLook *look, const QFont &font); /// << Idem but change the preview too (or remove it if it is invalid)
+ void setLink(const TQString &title, const TQString &icon, LinkLook *look, const TQFont &font); /// << Change the content and disposition. minWidth(), width() & height() can have changed. Keep the old preview (if any)
+ void setLink(const TQString &title, const TQString &icon, const TQPixmap &preview, LinkLook *look, const TQFont &font); /// << Idem but change the preview too (or remove it if it is invalid)
void setWidth(int width); /// << Set a new width. @see height() that will be computed.
// Get its properties:
int minWidth() const { return m_minWidth; } /// << @return the minimum width to display this link.
@@ -151,22 +152,22 @@ class LinkDisplay
int width() const { return m_width; } /// << @return the width of the link. It is never less than minWidth()!
int height() const { return m_height; } /// << @return the height if the link after having set it a width.
// And finaly, use it:
- void paint(QPainter *painter, int x, int y, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered, bool isIconButtonHovered) const; /// << Draw the link on a painter. Set textColor to be !isValid() to use the LinkLook color. Otherwise it will use this color!
- QPixmap feedbackPixmap(int width, int height, const QColorGroup &colorGroup, bool isDefaultColor); /// << @return the pixmap to put under the cursor while dragging this object.
+ void paint(TQPainter *painter, int x, int y, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered, bool isIconButtonHovered) const; /// << Draw the link on a painter. Set textColor to be !isValid() to use the LinkLook color. Otherwise it will use this color!
+ TQPixmap feedbackPixmap(int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor); /// << @return the pixmap to put under the cursor while dragging this object.
// Eventually get some information about the link display:
- bool iconButtonAt(const QPoint &pos) const; /// << @return true if the icon button is under point @p pos.
- QRect iconButtonRect() const; /// << @return the rectangle of the icon button.
+ bool iconButtonAt(const TQPoint &pos) const; /// << @return true if the icon button is under point @p pos.
+ TQRect iconButtonRect() const; /// << @return the rectangle of the icon button.
// Utility function:
- QFont labelFont(QFont font, bool isIconButtonHovered) const; /// << @return the font for this link, according to parent font AND LinkLook!
+ TQFont labelFont(TQFont font, bool isIconButtonHovered) const; /// << @return the font for this link, according to tqparent font AND LinkLook!
int heightForWidth(int width) const; /// << @return the needed height to display the link in function of a width.
- QString toHtml(const QString &imageName) const; /// << Convert the link to HTML code, using the LinkLook to style it.
- QString toHtml(HTMLExporter *exporter, const KURL &url, const QString &title = "");
+ TQString toHtml(const TQString &imageName) const; /// << Convert the link to HTML code, using the LinkLook to style it.
+ TQString toHtml(HTMLExporter *exporter, const KURL &url, const TQString &title = "");
private:
- QString m_title;
- QString m_icon;
- QPixmap m_preview;
+ TQString m_title;
+ TQString m_icon;
+ TQPixmap m_preview;
LinkLook *m_look;
- QFont m_font;
+ TQFont m_font;
int m_minWidth;
int m_maxWidth;
int m_width;
@@ -176,12 +177,13 @@ class LinkDisplay
/** A widget to edit a LinkLook, showing a live example to the user.
* @author S�astien Laot
*/
-class LinkLookEditWidget : public QWidget
+class LinkLookEditWidget : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- LinkLookEditWidget(KCModule* module, const QString exTitle, const QString exIcon,
- QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
+ LinkLookEditWidget(KCModule* module, const TQString exTitle, const TQString exIcon,
+ TQWidget *tqparent = 0, const char *name = 0, WFlags fl = 0);
~LinkLookEditWidget();
void saveChanges();
void saveToLook(LinkLook *look);
@@ -190,19 +192,19 @@ class LinkLookEditWidget : public QWidget
void slotChangeLook();
protected:
LinkLook *m_look;
- QCheckBox *m_italic;
- QCheckBox *m_bold;
- QComboBox *m_underlining;
+ TQCheckBox *m_italic;
+ TQCheckBox *m_bold;
+ TQComboBox *m_underlining;
KColorCombo2 *m_color;
KColorCombo2 *m_hoverColor;
IconSizeCombo *m_iconSize;
- QComboBox *m_preview;
+ TQComboBox *m_preview;
LinkLook *m_exLook;
LinkLabel *m_example;
- QString m_exTitle;
- QString m_exIcon;
+ TQString m_exTitle;
+ TQString m_exIcon;
HelpLabel *m_hLabel;
- QLabel *m_label;
+ TQLabel *m_label;
};
#endif // LINKLABEL_H
diff --git a/src/main.cpp b/src/main.cpp
index 7a7d0c0..0e291ee 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,14 +23,14 @@
#include <kcmdlineargs.h>
#include <kaboutdata.h>
#include <kiconloader.h>
-#include <qpixmap.h>
+#include <tqpixmap.h>
#include <klocale.h>
#include <kglobalaccel.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
#include <kdebug.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <kconfig.h> // TMP IN ALPHA 1
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index ce8bf0f..16b3fe3 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -18,43 +18,43 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qtabwidget.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qcursor.h>
-#include <qwhatsthis.h>
-#include <qvaluelist.h>
-#include <qregexp.h>
-#include <qbuttongroup.h>
+#include <tqtabwidget.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqcursor.h>
+#include <tqwhatsthis.h>
+#include <tqvaluelist.h>
+#include <tqregexp.h>
+#include <tqbuttongroup.h>
#include <kstringhandler.h>
#include <ksqueezedtextlabel.h>
-#include <qpoint.h>
-#include <qpixmap.h>
-#include <qinputdialog.h>
+#include <tqpoint.h>
+#include <tqpixmap.h>
+#include <tqinputdialog.h>
#include <kpopupmenu.h>
#include <kiconloader.h>
#include <kiconeffect.h>
-#include <qiconset.h>
+#include <tqiconset.h>
#include <kaction.h>
#include <kapp.h>
#include <klocale.h>
#include <kmenubar.h>
#include <kedittoolbar.h>
#include <kdebug.h>
-#include <qsignalmapper.h>
-#include <qstringlist.h>
+#include <tqsignalmapper.h>
+#include <tqstringlist.h>
-#include <qpainter.h>
-#include <qstyle.h>
+#include <tqpainter.h>
+#include <tqstyle.h>
#include <kglobalsettings.h>
#include <kstandarddirs.h>
-#include <qdir.h>
-#include <qstringlist.h>
+#include <tqdir.h>
+#include <tqstringlist.h>
#include <kmessagebox.h>
#include <kstatusbar.h>
-#include <qtimer.h>
-#include <qaction.h>
+#include <tqtimer.h>
+#include <tqaction.h>
#include <kstdaccel.h>
#include <kglobalaccel.h>
#include <kkeydialog.h>
@@ -64,7 +64,7 @@
#include <kaboutdata.h>
#include <kdeversion.h>
-#include <qdesktopwidget.h>
+#include <tqdesktopwidget.h>
#include <kwin.h>
#include <kprogress.h>
@@ -100,8 +100,8 @@
/** Container */
-MainWindow::MainWindow(QWidget *parent, const char *name)
- : KMainWindow(parent, name != 0 ? name : "MainWindow"), m_settings(0), m_quit(false)
+MainWindow::MainWindow(TQWidget *tqparent, const char *name)
+ : KMainWindow(tqparent, name != 0 ? name : "MainWindow"), m_settings(0), m_quit(false)
{
BasketStatusBar* bar = new BasketStatusBar(statusBar());
m_baskets = new BNPView(this, "BNPViewApp", this, actionCollection(), bar);
@@ -111,11 +111,11 @@ MainWindow::MainWindow(QWidget *parent, const char *name)
statusBar()->show();
statusBar()->setSizeGripEnabled(true);
- setAutoSaveSettings(/*groupName=*/QString::fromLatin1("MainWindow"), /*saveWindowSize=*//*FIXME:false:Why was it false??*/true);
+ setAutoSaveSettings(/*groupName=*/TQString::tqfromLatin1("MainWindow"), /*saveWindowSize=*//*FIXME:false:Why was it false??*/true);
// m_actShowToolbar->setChecked( toolBar()->isShown() );
m_actShowStatusbar->setChecked( statusBar()->isShown() );
- connect( m_baskets, SIGNAL(setWindowCaption(const QString &)), this, SLOT(setCaption(const QString &)));
+ connect( m_baskets, TQT_SIGNAL(setWindowCaption(const TQString &)), this, TQT_SLOT(setCaption(const TQString &)));
// InlineEditors::instance()->richTextToolBar();
setStandardToolBarMenuEnabled(true);
@@ -132,23 +132,23 @@ MainWindow::~MainWindow()
void MainWindow::setupActions()
{
- actQuit = KStdAction::quit( this, SLOT(quit()), actionCollection() );
+ actQuit = KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection() );
new KAction(i18n("Minimize"), "", 0,
- this, SLOT(minimizeRestore()), actionCollection(), "minimizeRestore" );
+ TQT_TQOBJECT(this), TQT_SLOT(minimizeRestore()), actionCollection(), "minimizeRestore" );
/** Settings : ************************************************************/
-// m_actShowToolbar = KStdAction::showToolbar( this, SLOT(toggleToolBar()), actionCollection());
- m_actShowStatusbar = KStdAction::showStatusbar( this, SLOT(toggleStatusBar()), actionCollection());
+// m_actShowToolbar = KStdAction::showToolbar( TQT_TQOBJECT(this), TQT_SLOT(toggleToolBar()), actionCollection());
+ m_actShowStatusbar = KStdAction::showStatusbar( TQT_TQOBJECT(this), TQT_SLOT(toggleStatusBar()), actionCollection());
// m_actShowToolbar->setCheckedState( KGuiItem(i18n("Hide &Toolbar")) );
- (void) KStdAction::keyBindings( this, SLOT(showShortcutsSettingsDialog()), actionCollection() );
+ (void) KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT(showShortcutsSettingsDialog()), actionCollection() );
- (void) KStdAction::configureToolbars(this, SLOT(configureToolbars()), actionCollection() );
+ (void) KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configureToolbars()), actionCollection() );
- //KAction *actCfgNotifs = KStdAction::configureNotifications(this, SLOT(configureNotifications()), actionCollection() );
+ //KAction *actCfgNotifs = KStdAction::configureNotifications(this, TQT_SLOT(configureNotifications()), actionCollection() );
//actCfgNotifs->setEnabled(false); // Not yet implemented !
- actAppConfig = KStdAction::preferences( this, SLOT(showSettingsDialog()), actionCollection() );
+ actAppConfig = KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(showSettingsDialog()), actionCollection() );
}
/*void MainWindow::toggleToolBar()
@@ -176,7 +176,7 @@ void MainWindow::configureToolbars()
saveMainWindowSettings( KGlobal::config(), autoSaveGroup() );
KEditToolbar dlg(actionCollection());
- connect( &dlg, SIGNAL(newToolbarConfig()), this, SLOT(slotNewToolbarConfig()) );
+ connect( &dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(slotNewToolbarConfig()) );
dlg.exec();
}
@@ -193,14 +193,14 @@ void MainWindow::slotNewToolbarConfig() // This is called when OK or Apply is cl
createGUI("basketui.rc"); // TODO: Reconnect tags menu aboutToShow() ??
if (!Global::bnpView->isPart())
Global::bnpView->connectTagsMenu(); // The Tags menu was created again!
- plugActionList( QString::fromLatin1("go_baskets_list"), actBasketsList);
+ plugActionList( TQString::tqfromLatin1("go_baskets_list"), actBasketsList);
applyMainWindowSettings( KGlobal::config(), autoSaveGroup() );
}
void MainWindow::showSettingsDialog()
{
if(m_settings == 0)
- m_settings = new KSettings::Dialog(kapp->activeWindow());
+ m_settings = new KSettings::Dialog(TQT_TQWIDGET(kapp->activeWindow()));
if (Global::mainWindow()) {
m_settings->dialog()->showButton(KDialogBase::Help, false); // Not implemented!
m_settings->dialog()->showButton(KDialogBase::Default, false); // Not implemented!
@@ -221,13 +221,13 @@ void MainWindow::polish()
bool shouldSave = false;
// If position and size has never been set, set nice ones:
- // - Set size to sizeHint()
+ // - Set size to tqsizeHint()
// - Keep the window manager placing the window where it want and save this
if (Settings::mainWindowSize().isEmpty()) {
// std::cout << "Main Window Position: Initial Set in show()" << std::endl;
int defaultWidth = kapp->desktop()->width() * 5 / 6;
int defaultHeight = kapp->desktop()->height() * 5 / 6;
- resize(defaultWidth, defaultHeight); // sizeHint() is bad (too small) and we want the user to have a good default area size
+ resize(defaultWidth, defaultHeight); // tqsizeHint() is bad (too small) and we want the user to have a good default area size
shouldSave = true;
} else {
// std::cout << "Main Window Position: Recall in show(x="
@@ -251,7 +251,7 @@ void MainWindow::polish()
}
}
-void MainWindow::resizeEvent(QResizeEvent *event)
+void MainWindow::resizeEvent(TQResizeEvent *event)
{
// std::cout << "Main Window Position: Save size in resizeEvent(width=" << size().width() << ", height=" << size().height() << ") ; isMaximized="
// << (isMaximized() ? "true" : "false") << std::endl;
@@ -263,7 +263,7 @@ void MainWindow::resizeEvent(QResizeEvent *event)
KMainWindow::resizeEvent(event);
}
-void MainWindow::moveEvent(QMoveEvent *event)
+void MainWindow::moveEvent(TQMoveEvent *event)
{
// std::cout << "Main Window Position: Save position in moveEvent(x=" << pos().x() << ", y=" << pos().y() << ")" << std::endl;
Settings::setMainWindowPosition(pos());
@@ -307,7 +307,7 @@ bool MainWindow::queryClose()
bool MainWindow::askForQuit()
{
- QString message = i18n("<p>Do you really want to quit %1?</p>").arg(kapp->aboutData()->programName());
+ TQString message = i18n("<p>Do you really want to quit %1?</p>").tqarg(kapp->aboutData()->programName());
if (Settings::useSystray())
message += i18n("<p>Notice that you do not have to quit the application before ending your KDE session. "
"If you end your session while the application is still running, the application will be reloaded the next time you log in.</p>");
diff --git a/src/mainwindow.h b/src/mainwindow.h
index 4ea57a2..532d7be 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -22,27 +22,27 @@
#define CONTAINER_H
#include <kmainwindow.h>
-#include <qtabbar.h>
-#include <qtabwidget.h>
-#include <qlabel.h>
+#include <tqtabbar.h>
+#include <tqtabwidget.h>
+#include <tqlabel.h>
#include <ksystemtray.h>
-#include <qptrlist.h>
-#include <qpoint.h>
-#include <qclipboard.h>
+#include <tqptrlist.h>
+#include <tqpoint.h>
+#include <tqclipboard.h>
#include <kaction.h>
-#include <qpixmap.h>
-#include <qdesktopwidget.h>
-#include <qtimer.h>
-#include <qsplitter.h>
+#include <tqpixmap.h>
+#include <tqdesktopwidget.h>
+#include <tqtimer.h>
+#include <tqsplitter.h>
-class QWidget;
-class QPoint;
+class TQWidget;
+class TQPoint;
class KAction;
class KToggleAction;
-class QPopupMenu;
-class QSignalMapper;
-class QStringList;
-class QToolTipGroup;
+class TQPopupMenu;
+class TQSignalMapper;
+class TQStringList;
+class TQToolTipGroup;
class KPassivePopup;
class Basket;
class DecoratedBasket;
@@ -60,9 +60,10 @@ namespace KSettings { class Dialog; };
class MainWindow : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
/** Construtor, initializer and destructor */
- MainWindow(QWidget *parent = 0, const char *name = 0);
+ MainWindow(TQWidget *tqparent = 0, const char *name = 0);
~MainWindow();
private:
void setupActions();
@@ -83,8 +84,8 @@ class MainWindow : public KMainWindow
protected:
bool queryExit();
bool queryClose();
- virtual void resizeEvent(QResizeEvent*);
- virtual void moveEvent(QMoveEvent*);
+ virtual void resizeEvent(TQResizeEvent*);
+ virtual void moveEvent(TQMoveEvent*);
public:
void polish();
@@ -94,10 +95,10 @@ class MainWindow : public KMainWindow
KToggleAction *m_actShowStatusbar;
KAction *actQuit;
KAction *actAppConfig;
- QPtrList<KAction> actBasketsList;
+ TQPtrList<KAction> actBasketsList;
private:
- QVBoxLayout *m_layout;
+ TQVBoxLayout *m_layout;
BNPView *m_baskets;
bool m_startDocked;
KSettings::Dialog *m_settings;
diff --git a/src/newbasketdialog.cpp b/src/newbasketdialog.cpp
index 0d5bc44..b322e05 100644
--- a/src/newbasketdialog.cpp
+++ b/src/newbasketdialog.cpp
@@ -19,17 +19,17 @@
***************************************************************************/
#include <kicondialog.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
#include <kiconview.h>
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <klocale.h>
#include <kglobalsettings.h>
#include <kpushbutton.h>
#include <kguiitem.h>
#include <kmessagebox.h>
-#include <qsize.h>
-#include <qpainter.h>
+#include <tqsize.h>
+#include <tqpainter.h>
#include <kapplication.h>
#include <kiconloader.h>
#include <kmainwindow.h>
@@ -46,19 +46,19 @@
/** class SingleSelectionKIconView: */
-SingleSelectionKIconView::SingleSelectionKIconView(QWidget *parent, const char *name, WFlags f)
- : KIconView(parent, name, f), m_lastSelected(0)
+SingleSelectionKIconView::SingleSelectionKIconView(TQWidget *tqparent, const char *name, WFlags f)
+ : KIconView(tqparent, name, f), m_lastSelected(0)
{
- connect( this, SIGNAL(selectionChanged(QIconViewItem*)), this, SLOT(slotSelectionChanged(QIconViewItem*)) );
- connect( this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) );
+ connect( this, TQT_SIGNAL(selectionChanged(TQIconViewItem*)), this, TQT_SLOT(slotSelectionChanged(TQIconViewItem*)) );
+ connect( this, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()) );
}
-QDragObject* SingleSelectionKIconView::dragObject()
+TQDragObject* SingleSelectionKIconView::dragObject()
{
return 0;
}
-void SingleSelectionKIconView::slotSelectionChanged(QIconViewItem *item)
+void SingleSelectionKIconView::slotSelectionChanged(TQIconViewItem *item)
{
if (item)
m_lastSelected = item;
@@ -84,45 +84,45 @@ NewBasketDefaultProperties::NewBasketDefaultProperties()
/** class NewBasketDialog: */
-NewBasketDialog::NewBasketDialog(Basket *parentBasket, const NewBasketDefaultProperties &defaultProperties, QWidget *parent)
+NewBasketDialog::NewBasketDialog(Basket *tqparentBasket, const NewBasketDefaultProperties &defaultProperties, TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, i18n("New Basket"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"NewBasket", /*modal=*/true, /*separator=*/true)
+ KDialogBase::Ok, tqparent, /*name=*/"NewBasket", /*modal=*/true, /*separator=*/true)
, m_defaultProperties(defaultProperties)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
// Icon, Name and Background Color:
- QHBoxLayout *nameLayout = new QHBoxLayout(0, marginHint()*2/3, spacingHint());
+ TQHBoxLayout *nameLayout = new TQHBoxLayout(0, marginHint()*2/3, spacingHint());
m_icon = new KIconButton(page);
m_icon->setIconType(KIcon::NoGroup, KIcon::Action);
m_icon->setIconSize(16);
m_icon->setIcon(m_defaultProperties.icon.isEmpty() ? "basket" : m_defaultProperties.icon);
- int size = QMAX(m_icon->sizeHint().width(), m_icon->sizeHint().height());
+ int size = TQMAX(m_icon->tqsizeHint().width(), m_icon->tqsizeHint().height());
m_icon->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_icon, i18n("Icon"));
- m_name = new QLineEdit(/*i18n("Basket"), */page);
+ TQToolTip::add(m_icon, i18n("Icon"));
+ m_name = new TQLineEdit(/*i18n("Basket"), */page);
m_name->setMinimumWidth(m_name->fontMetrics().maxWidth()*20);
- connect( m_name, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)) );
+ connect( m_name, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(nameChanged(const TQString&)) );
enableButtonOK(false);
- QToolTip::add(m_name, i18n("Name"));
- m_backgroundColor = new KColorCombo2(QColor(), KGlobalSettings::baseColor(), page);
- m_backgroundColor->setColor(QColor());
- m_backgroundColor->setFixedSize(m_backgroundColor->sizeHint());
+ TQToolTip::add(m_name, i18n("Name"));
+ m_backgroundColor = new KColorCombo2(TQColor(), KGlobalSettings::baseColor(), page);
+ m_backgroundColor->setColor(TQColor());
+ m_backgroundColor->setFixedSize(m_backgroundColor->tqsizeHint());
m_backgroundColor->setColor(m_defaultProperties.backgroundColor);
- QToolTip::add(m_backgroundColor, i18n("Background color"));
+ TQToolTip::add(m_backgroundColor, i18n("Background color"));
nameLayout->addWidget(m_icon);
nameLayout->addWidget(m_name);
nameLayout->addWidget(m_backgroundColor);
topLayout->addLayout(nameLayout);
- QHBoxLayout *layout = new QHBoxLayout(/*parent=*/0, /*margin=*/0, spacingHint());
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(/*tqparent=*/0, /*margin=*/0, spacingHint());
KPushButton *button = new KPushButton( KGuiItem(i18n("&Manage Templates..."), "configure"), page );
- connect( button, SIGNAL(clicked()), this, SLOT(manageTemplates()) );
+ connect( button, TQT_SIGNAL(clicked()), this, TQT_SLOT(manageTemplates()) );
button->hide();
// Compute the right template to use as the default:
- QString defaultTemplate = "free";
+ TQString defaultTemplate = "free";
if (!m_defaultProperties.freeLayout) {
if (m_defaultProperties.columnCount == 1)
defaultTemplate = "1column";
@@ -145,9 +145,9 @@ NewBasketDialog::NewBasketDialog(Basket *parentBasket, const NewBasketDefaultPro
m_templates->setMode(KIconView::Select);
m_templates->setGridX(m_templates->maxItemWidth());
KIconViewItem *lastTemplate = 0;
- QPixmap icon(40, 53);
+ TQPixmap icon(40, 53);
- QPainter painter(&icon);
+ TQPainter painter(&icon);
painter.fillRect(0, 0, icon.width(), icon.height(), KGlobalSettings::baseColor());
painter.setPen(KGlobalSettings::textColor());
painter.drawRect(0, 0, icon.width(), icon.height());
@@ -200,43 +200,43 @@ NewBasketDialog::NewBasketDialog(Basket *parentBasket, const NewBasketDefaultPro
painter.end();
lastTemplate = new KIconViewItem(m_templates, lastTemplate, i18n("Mind map"), icon);*/
- m_templates->setMinimumHeight(topLayout->minimumSize().width() * 9 / 16);
+ m_templates->setMinimumHeight(topLayout->tqminimumSize().width() * 9 / 16);
- QLabel *label = new QLabel(m_templates, i18n("&Template:"), page);
- layout->addWidget(label, /*stretch=*/0, Qt::AlignBottom);
- layout->addStretch();
- layout->addWidget(button, /*stretch=*/0, Qt::AlignBottom);
- topLayout->addLayout(layout);
+ TQLabel *label = new TQLabel(m_templates, i18n("&Template:"), page);
+ tqlayout->addWidget(label, /*stretch=*/0, TQt::AlignBottom);
+ tqlayout->addStretch();
+ tqlayout->addWidget(button, /*stretch=*/0, TQt::AlignBottom);
+ topLayout->addLayout(tqlayout);
topLayout->addWidget(m_templates);
- layout = new QHBoxLayout(/*parent=*/0, /*margin=*/0, spacingHint());
- m_createIn = new QComboBox(page);
+ tqlayout = new TQHBoxLayout(/*tqparent=*/0, /*margin=*/0, spacingHint());
+ m_createIn = new TQComboBox(page);
m_createIn->insertItem(i18n("(Baskets)"));
- label = new QLabel(m_createIn, i18n("C&reate in:"), page);
+ label = new TQLabel(m_createIn, i18n("C&reate in:"), page);
HelpLabel *helpLabel = new HelpLabel(i18n("How is it useful?"), i18n(
"<p>Creating baskets inside of other baskets to form a hierarchy allows you to be more organized by eg.:</p><ul>"
"<li>Grouping baskets by themes or topics;</li>"
"<li>Grouping baskets in folders for different projects;</li>"
"<li>Making sections with sub-baskets representing chapters or pages;</li>"
"<li>Making a group of baskets to export together (to eg. email them to people).</li></ul>"), page);
- layout->addWidget(label);
- layout->addWidget(m_createIn);
- layout->addWidget(helpLabel);
- layout->addStretch();
- topLayout->addLayout(layout);
+ tqlayout->addWidget(label);
+ tqlayout->addWidget(m_createIn);
+ tqlayout->addWidget(helpLabel);
+ tqlayout->addStretch();
+ topLayout->addLayout(tqlayout);
m_basketsMap.clear();
m_basketsMap.insert(/*index=*/0, /*basket=*/0L);
populateBasketsList(Global::bnpView->firstListViewItem(), /*indent=*/1, /*index=*/1);
- connect( m_templates, SIGNAL(doubleClicked(QIconViewItem*)), this, SLOT(slotOk()) );
- connect( m_templates, SIGNAL(returnPressed(QIconViewItem*)), this, SLOT(returnPressed()) );
+ connect( m_templates, TQT_SIGNAL(doubleClicked(TQIconViewItem*)), this, TQT_SLOT(slotOk()) );
+ connect( m_templates, TQT_SIGNAL(returnPressed(TQIconViewItem*)), this, TQT_SLOT(returnPressed()) );
- if (parentBasket) {
+ if (tqparentBasket) {
int index = 0;
- for (QMap<int, Basket*>::Iterator it = m_basketsMap.begin(); it != m_basketsMap.end(); ++it)
- if (it.data() == parentBasket) {
+ for (TQMap<int, Basket*>::Iterator it = m_basketsMap.begin(); it != m_basketsMap.end(); ++it)
+ if (it.data() == tqparentBasket) {
index = it.key();
break;
}
@@ -255,14 +255,14 @@ void NewBasketDialog::returnPressed()
actionButton(KDialogBase::Ok)->animateClick();
}
-int NewBasketDialog::populateBasketsList(QListViewItem *item, int indent, int index)
+int NewBasketDialog::populateBasketsList(TQListViewItem *item, int indent, int index)
{
static const int ICON_SIZE = 16;
while (item) {
// Get the basket data:
Basket *basket = ((BasketListViewItem*)item)->basket();
- QPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::NoGroup, ICON_SIZE, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
+ TQPixmap icon = kapp->iconLoader()->loadIcon(basket->icon(), KIcon::NoGroup, ICON_SIZE, KIcon::DefaultState, 0L, /*canReturnNull=*/false);
icon = Tools::indentPixmap(icon, indent, 2 * ICON_SIZE / 3);
// Append item to the list:
@@ -290,15 +290,15 @@ void NewBasketDialog::polish()
m_name->setFocus();
}
-void NewBasketDialog::nameChanged(const QString &newName)
+void NewBasketDialog::nameChanged(const TQString &newName)
{
enableButtonOK(!newName.isEmpty());
}
void NewBasketDialog::slotOk()
{
- QIconViewItem *item = ((SingleSelectionKIconView*)m_templates)->selectedItem();
- QString templateName;
+ TQIconViewItem *item = ((SingleSelectionKIconView*)m_templates)->selectedItem();
+ TQString templateName;
if (item->text() == i18n("One column"))
templateName = "1column";
if (item->text() == i18n("Two columns"))
@@ -312,8 +312,8 @@ void NewBasketDialog::slotOk()
Global::bnpView->closeAllEditors();
- QString backgroundImage;
- QColor textColor;
+ TQString backgroundImage;
+ TQColor textColor;
if (m_backgroundColor->color() == m_defaultProperties.backgroundColor) {
backgroundImage = m_defaultProperties.backgroundImage;
textColor = m_defaultProperties.textColor;
diff --git a/src/newbasketdialog.h b/src/newbasketdialog.h
index 9e9477f..579077a 100644
--- a/src/newbasketdialog.h
+++ b/src/newbasketdialog.h
@@ -23,12 +23,12 @@
#include <kdialogbase.h>
#include <kiconview.h>
-#include <qmap.h>
+#include <tqmap.h>
class KIconButton;
-class QLineEdit;
-class QDragObject;
-class QListViewItem;
+class TQLineEdit;
+class TQDragObject;
+class TQListViewItem;
class Basket;
@@ -41,15 +41,16 @@ class KColorCombo2;
class SingleSelectionKIconView : public KIconView
{
Q_OBJECT
+ TQ_OBJECT
public:
- SingleSelectionKIconView(QWidget *parent = 0, const char *name = 0, WFlags f = 0);
- QDragObject* dragObject();
- QIconViewItem* selectedItem() { return m_lastSelected; }
+ SingleSelectionKIconView(TQWidget *tqparent = 0, const char *name = 0, WFlags f = 0);
+ TQDragObject* dragObject();
+ TQIconViewItem* selectedItem() { return m_lastSelected; }
private slots:
- void slotSelectionChanged(QIconViewItem *item);
+ void slotSelectionChanged(TQIconViewItem *item);
void slotSelectionChanged();
private:
- QIconViewItem *m_lastSelected;
+ TQIconViewItem *m_lastSelected;
};
/** Struct to store default properties of a new basket.
@@ -61,10 +62,10 @@ class SingleSelectionKIconView : public KIconView
*/
struct NewBasketDefaultProperties
{
- QString icon;
- QString backgroundImage;
- QColor backgroundColor;
- QColor textColor;
+ TQString icon;
+ TQString backgroundImage;
+ TQColor backgroundColor;
+ TQColor textColor;
bool freeLayout;
int columnCount;
@@ -77,24 +78,25 @@ struct NewBasketDefaultProperties
class NewBasketDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- NewBasketDialog(Basket *parentBasket, const NewBasketDefaultProperties &defaultProperties, QWidget *parent = 0);
+ NewBasketDialog(Basket *tqparentBasket, const NewBasketDefaultProperties &defaultProperties, TQWidget *tqparent = 0);
~NewBasketDialog();
void polish();
protected slots:
void slotOk();
void returnPressed();
void manageTemplates();
- void nameChanged(const QString &newName);
+ void nameChanged(const TQString &newName);
private:
- int populateBasketsList(QListViewItem *item, int indent, int index);
+ int populateBasketsList(TQListViewItem *item, int indent, int index);
NewBasketDefaultProperties m_defaultProperties;
KIconButton *m_icon;
- QLineEdit *m_name;
+ TQLineEdit *m_name;
KColorCombo2 *m_backgroundColor;
KIconView *m_templates;
- QComboBox *m_createIn;
- QMap<int, Basket*> m_basketsMap;
+ TQComboBox *m_createIn;
+ TQMap<int, Basket*> m_basketsMap;
};
#endif // NEWBASKETDIALOG_H
diff --git a/src/note.cpp b/src/note.cpp
index fd1fb34..54bb90d 100644
--- a/src/note.cpp
+++ b/src/note.cpp
@@ -18,19 +18,19 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qpainter.h>
+#include <tqpainter.h>
#include <kglobalsettings.h>
-#include <qstyle.h>
+#include <tqstyle.h>
#include <kapplication.h>
#include <kstyle.h>
-#include <qcursor.h>
+#include <tqcursor.h>
#include <kiconloader.h>
#include <kpixmapeffect.h>
#include <kpixmap.h>
#include <kglobal.h>
#include <klocale.h>
#include <kurifilter.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <stdlib.h> // rand() function
#include <math.h> // sqrt() and pow() functions
@@ -68,12 +68,12 @@ int Note::TAG_ARROW_WIDTH = 5;
int Note::EMBLEM_SIZE = 16;
int Note::MIN_HEIGHT = 2*NOTE_MARGIN + EMBLEM_SIZE;
-Note::Note(Basket *parent)
+Note::Note(Basket *tqparent)
: m_prev(0), m_next(0),
m_x(0), m_y(-1), m_width(-1), m_height(-1),
m_groupWidth(250),
m_isFolded(false), m_firstChild(0L), m_parentNote(0),
- m_basket(parent), m_content(0), m_addedDate(QDateTime::currentDateTime()), m_lastModificationDate(QDateTime::currentDateTime()),
+ m_basket(tqparent), m_content(0), m_addedDate(TQDateTime::tqcurrentDateTime()), m_lastModificationDate(TQDateTime::tqcurrentDateTime()),
m_computedAreas(false), m_onTop(false),
m_deltaX(0), m_deltaY(0), m_deltaHeight(0), m_collapseFinished(true), m_expandingFinished(true),
m_hovered(false), m_hoveredZone(Note::None), m_focused(false), m_selected(false), m_wasInLastSelectionRect(false),
@@ -88,27 +88,27 @@ Note::~Note()
deleteChilds();
}
-QString Note::addedStringDate()
+TQString Note::addedStringDate()
{
return KGlobal::locale()->formatDateTime(m_addedDate);
}
-QString Note::lastModificationStringDate()
+TQString Note::lastModificationStringDate()
{
return KGlobal::locale()->formatDateTime(m_lastModificationDate);
}
-QString Note::toText(const QString &cuttedFullPath)
+TQString Note::toText(const TQString &cuttedFullPath)
{
if (content()) {
// Convert note to text:
- QString text = content()->toText(cuttedFullPath);
+ TQString text = content()->toText(cuttedFullPath);
// If we should not export tags with the text, return immediatly:
if (!Settings::exportTextTags())
return text;
// Compute the text equivalent of the tag states:
- QString firstLine;
- QString otherLines;
+ TQString firstLine;
+ TQString otherLines;
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) {
if (!(*it)->textEquivalent().isEmpty()) {
firstLine += (*it)->textEquivalent() + " ";
@@ -121,8 +121,8 @@ QString Note::toText(const QString &cuttedFullPath)
return text;
if (otherLines.isEmpty())
return firstLine + text;
- QStringList lines = QStringList::split('\n', text, /*allowEmptyEntries=*/true);
- QString result = firstLine + lines[0] + (lines.count() > 1 ? "\n" : "");
+ TQStringList lines = TQStringList::split('\n', text, /*allowEmptyEntries=*/true);
+ TQString result = firstLine + lines[0] + (lines.count() > 1 ? "\n" : "");
for (uint i = 1/*Skip the first line*/; i < lines.count(); ++i)
result += otherLines + lines[i] + (i < lines.count() - 1 ? "\n" : "");
return result;
@@ -212,7 +212,7 @@ int Note::countDirectChilds()
return count;
}
-QString Note::fullPath()
+TQString Note::fullPath()
{
if (content())
return basket()->fullPath() + content()->fileName();
@@ -275,17 +275,17 @@ void Note::finishLazyLoad()
child->finishLazyLoad();
}
-void Note::selectIn(const QRect &rect, bool invertSelection, bool unselectOthers /*= true*/)
+void Note::selectIn(const TQRect &rect, bool invertSelection, bool unselectOthers /*= true*/)
{
-// QRect myRect(x(), y(), width(), height());
+// TQRect myRect(x(), y(), width(), height());
// bool intersects = myRect.intersects(rect);
// Only intersects with visible areas.
// If the note is not visible, the user don't think it will be selected while selecting the note(s) that hide this, so act like the user think:
bool intersects = false;
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &r = *it;
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &r = *it;
if (r.intersects(rect)) {
intersects = true;
break;
@@ -422,7 +422,7 @@ NoteSelection* Note::selectedNotes()
NoteSelection *reducedSelection = selection->firstChild;
// delete selection; // TODO: Cut all connexions of 'selection' before deleting it!
for (NoteSelection *node = reducedSelection; node; node = node->next)
- node->parent = 0;
+ node->tqparent = 0;
return reducedSelection;
}
} else {
@@ -445,7 +445,7 @@ bool Note::isAfter(Note *note)
return true;
}
-bool Note::contains(Note *note)
+bool Note::tqcontains(Note *note)
{
// if (this == note)
// return true;
@@ -454,10 +454,10 @@ bool Note::contains(Note *note)
if (note == this)
return true;
else
- note = note->parentNote();
+ note = note->tqparentNote();
// FOR_EACH_CHILD (child)
-// if (child->contains(note))
+// if (child->tqcontains(note))
// return true;
return false;
}
@@ -520,18 +520,18 @@ int Note::yExpander()
bool Note::isFree()
{
- return parentNote() == 0 && basket()->isFreeLayout();
+ return tqparentNote() == 0 && basket()->isFreeLayout();
}
bool Note::isColumn()
{
- return parentNote() == 0 && basket()->isColumnsLayout();
+ return tqparentNote() == 0 && basket()->isColumnsLayout();
}
bool Note::hasResizer()
{
// "isFree" || "isColmun but not the last"
- return parentNote() == 0 && (basket()->isFreeLayout() || m_next != 0L);
+ return tqparentNote() == 0 && (basket()->isFreeLayout() || m_next != 0L);
}
int Note::resizerHeight()
@@ -549,7 +549,7 @@ void Note::setHoveredZone(Zone zone) // TODO: Remove setHovered(bool) and assume
}
}
-Note::Zone Note::zoneAt(const QPoint &pos, bool toAdd)
+Note::Zone Note::zoneAt(const TQPoint &pos, bool toAdd)
{
// Keep the resizer highlighted when resizong, even if the cursor is over another note:
if (basket()->resizingNote() == this)
@@ -641,16 +641,16 @@ Note::Zone Note::zoneAt(const QPoint &pos, bool toAdd)
if (!linkAt(pos).isEmpty())
return Link;
- int customZone = content()->zoneAt(pos - QPoint(contentX(), NOTE_MARGIN));
+ int customZone = content()->zoneAt(pos - TQPoint(contentX(), NOTE_MARGIN));
if (customZone)
return (Note::Zone)customZone;
return Content;
}
-QString Note::linkAt(const QPoint &pos)
+TQString Note::linkAt(const TQPoint &pos)
{
- QString link = m_content->linkAt(pos - QPoint(contentX(), NOTE_MARGIN));
+ TQString link = m_content->linkAt(pos - TQPoint(contentX(), NOTE_MARGIN));
if (link.isEmpty())
return link;
else
@@ -662,10 +662,10 @@ int Note::contentX()
return HANDLE_WIDTH + NOTE_MARGIN + (EMBLEM_SIZE+NOTE_MARGIN)*m_emblemsCount + TAG_ARROW_WIDTH + NOTE_MARGIN;
}
-QRect Note::zoneRect(Note::Zone zone, const QPoint &pos)
+TQRect Note::zoneRect(Note::Zone zone, const TQPoint &pos)
{
if (zone >= Emblem0)
- return QRect(HANDLE_WIDTH + (NOTE_MARGIN+EMBLEM_SIZE)*(zone-Emblem0),
+ return TQRect(HANDLE_WIDTH + (NOTE_MARGIN+EMBLEM_SIZE)*(zone-Emblem0),
INSERTION_HEIGHT,
NOTE_MARGIN + EMBLEM_SIZE,
height() - 2*INSERTION_HEIGHT);
@@ -673,37 +673,37 @@ QRect Note::zoneRect(Note::Zone zone, const QPoint &pos)
int yExp;
int right;
int xGroup = (isFree() ? (isGroup() ? 0 : GROUP_WIDTH) : width() / 2);
- QRect rect;
+ TQRect rect;
int insertSplit = (Settings::groupOnInsertionLine() ? 2 : 1);
switch (zone) {
- case Note::Handle: return QRect(0, 0, HANDLE_WIDTH, height());
+ case Note::Handle: return TQRect(0, 0, HANDLE_WIDTH, height());
case Note::Group:
yExp = yExpander();
- if (pos.y() < yExp) return QRect(0, INSERTION_HEIGHT, width(), yExp - INSERTION_HEIGHT);
- if (pos.y() > yExp + EXPANDER_HEIGHT) return QRect(0, yExp + EXPANDER_HEIGHT, width(), height() - yExp - EXPANDER_HEIGHT - INSERTION_HEIGHT);
- if (pos.x() < NOTE_MARGIN) return QRect(0, 0, NOTE_MARGIN, height());
- else return QRect(width() - NOTE_MARGIN, 0, NOTE_MARGIN, height());
- case Note::TagsArrow: return QRect(HANDLE_WIDTH + (NOTE_MARGIN+EMBLEM_SIZE)*m_emblemsCount,
+ if (pos.y() < yExp) return TQRect(0, INSERTION_HEIGHT, width(), yExp - INSERTION_HEIGHT);
+ if (pos.y() > yExp + EXPANDER_HEIGHT) return TQRect(0, yExp + EXPANDER_HEIGHT, width(), height() - yExp - EXPANDER_HEIGHT - INSERTION_HEIGHT);
+ if (pos.x() < NOTE_MARGIN) return TQRect(0, 0, NOTE_MARGIN, height());
+ else return TQRect(width() - NOTE_MARGIN, 0, NOTE_MARGIN, height());
+ case Note::TagsArrow: return TQRect(HANDLE_WIDTH + (NOTE_MARGIN+EMBLEM_SIZE)*m_emblemsCount,
INSERTION_HEIGHT,
NOTE_MARGIN + TAG_ARROW_WIDTH + NOTE_MARGIN,
height() - 2*INSERTION_HEIGHT);
case Note::Custom0:
- case Note::Content: rect = content()->zoneRect(zone, pos - QPoint(contentX(), NOTE_MARGIN));
+ case Note::Content: rect = content()->zoneRect(zone, pos - TQPoint(contentX(), NOTE_MARGIN));
rect.moveBy(contentX(), NOTE_MARGIN);
- return rect.intersect( QRect(contentX(), INSERTION_HEIGHT, width() - contentX(), height() - 2*INSERTION_HEIGHT) ); // Only IN contentRect
- case Note::GroupExpander: return QRect(NOTE_MARGIN, yExpander(), EXPANDER_WIDTH, EXPANDER_HEIGHT);
+ return rect.intersect( TQRect(contentX(), INSERTION_HEIGHT, width() - contentX(), height() - 2*INSERTION_HEIGHT) ); // Only IN contentRect
+ case Note::GroupExpander: return TQRect(NOTE_MARGIN, yExpander(), EXPANDER_WIDTH, EXPANDER_HEIGHT);
case Note::Resizer: right = rightLimit();
- return QRect(right - x(), 0, RESIZER_WIDTH, resizerHeight());
+ return TQRect(right - x(), 0, RESIZER_WIDTH, resizerHeight());
case Note::Link:
- case Note::TopInsert: if (isGroup()) return QRect(0, 0, width(), INSERTION_HEIGHT);
- else return QRect(HANDLE_WIDTH, 0, width() / insertSplit - HANDLE_WIDTH, INSERTION_HEIGHT);
- case Note::TopGroup: return QRect(xGroup, 0, width() - xGroup, INSERTION_HEIGHT);
- case Note::BottomInsert: if (isGroup()) return QRect(0, height() - INSERTION_HEIGHT, width(), INSERTION_HEIGHT);
- else return QRect(HANDLE_WIDTH, height() - INSERTION_HEIGHT, width() / insertSplit - HANDLE_WIDTH, INSERTION_HEIGHT);
- case Note::BottomGroup: return QRect(xGroup, height() - INSERTION_HEIGHT, width() - xGroup, INSERTION_HEIGHT);
- case Note::BottomColumn: return QRect(0, height(), rightLimit() - x(), basket()->contentsHeight() - height());
- case Note::None: return QRect(/*0, 0, -1, -1*/);
- default: return QRect(/*0, 0, -1, -1*/);
+ case Note::TopInsert: if (isGroup()) return TQRect(0, 0, width(), INSERTION_HEIGHT);
+ else return TQRect(HANDLE_WIDTH, 0, width() / insertSplit - HANDLE_WIDTH, INSERTION_HEIGHT);
+ case Note::TopGroup: return TQRect(xGroup, 0, width() - xGroup, INSERTION_HEIGHT);
+ case Note::BottomInsert: if (isGroup()) return TQRect(0, height() - INSERTION_HEIGHT, width(), INSERTION_HEIGHT);
+ else return TQRect(HANDLE_WIDTH, height() - INSERTION_HEIGHT, width() / insertSplit - HANDLE_WIDTH, INSERTION_HEIGHT);
+ case Note::BottomGroup: return TQRect(xGroup, height() - INSERTION_HEIGHT, width() - xGroup, INSERTION_HEIGHT);
+ case Note::BottomColumn: return TQRect(0, height(), rightLimit() - x(), basket()->contentsHeight() - height());
+ case Note::None: return TQRect(/*0, 0, -1, -1*/);
+ default: return TQRect(/*0, 0, -1, -1*/);
}
}
@@ -711,30 +711,30 @@ void Note::setCursor(Zone zone)
{
switch (zone) {
case Note::Handle:
- case Note::Group: basket()->viewport()->setCursor(Qt::SizeAllCursor); break;
+ case Note::Group: basket()->viewport()->setCursor(TQt::SizeAllCursor); break;
case Note::Resizer: if (isColumn())
- basket()->viewport()->setCursor(Qt::SplitHCursor);
+ basket()->viewport()->setCursor(TQt::SplitHCursor);
else
- basket()->viewport()->setCursor(Qt::SizeHorCursor); break;
+ basket()->viewport()->setCursor(TQt::SizeHorCursor); break;
case Note::Custom0: content()->setCursor(basket()->viewport(), zone); break;
case Note::Link:
case Note::TagsArrow:
- case Note::GroupExpander: basket()->viewport()->setCursor(Qt::PointingHandCursor); break;
+ case Note::GroupExpander: basket()->viewport()->setCursor(TQt::PointingHandCursor); break;
- case Note::Content: basket()->viewport()->setCursor(Qt::IbeamCursor); break;
+ case Note::Content: basket()->viewport()->setCursor(TQt::IbeamCursor); break;
case Note::TopInsert:
case Note::TopGroup:
case Note::BottomInsert:
case Note::BottomGroup:
- case Note::BottomColumn: basket()->viewport()->setCursor(Qt::CrossCursor); break;
+ case Note::BottomColumn: basket()->viewport()->setCursor(TQt::CrossCursor); break;
case Note::None: basket()->viewport()->unsetCursor(); break;
default:
State *state = stateForEmblemNumber(zone - Emblem0);
- if (state && state->parentTag()->states().count() > 1)
- basket()->viewport()->setCursor(Qt::PointingHandCursor);
+ if (state && state->tqparentTag()->states().count() > 1)
+ basket()->viewport()->setCursor(TQt::PointingHandCursor);
else
basket()->viewport()->unsetCursor();
}
@@ -853,20 +853,20 @@ void Note::unsetWidth()
child->unsetWidth();
}
-void Note::requestRelayout()
+void Note::requestRetqlayout()
{
m_width = 0;
unbufferize();
- basket()->relayoutNotes(true); // TODO: A signal that will relayout ONCE and DELAYED if called several times
+ basket()->retqlayoutNotes(true); // TODO: A signal that will retqlayout ONCE and DELAYED if called several times
}
void Note::setWidth(int width) // TODO: inline ?
{
if (m_width != width)
- setWidthForceRelayout(width);
+ setWidthForceRetqlayout(width);
}
-void Note::setWidthForceRelayout(int width)
+void Note::setWidthForceRetqlayout(int width)
{
unbufferize();
m_width = (width < minWidth() ? minWidth() : width);
@@ -898,7 +898,7 @@ int Note::minRight()
bool first = true;
while (child) {
if ((showSubNotes() || first) && child->matching())
- right = QMAX(right, child->minRight());
+ right = TQMAX(right, child->minRight());
child = child->next();
first = false;
}
@@ -959,7 +959,7 @@ void Note::toggleFolded(bool animate)
{
// Close the editor if it was editing a note that we are about to hide after collapsing:
if (!m_isFolded && basket() && basket()->isDuringEdit()) {
- if (contains(basket()->editedNote()) && firstRealChild() != basket()->editedNote())
+ if (tqcontains(basket()->editedNote()) && firstRealChild() != basket()->editedNote())
basket()->closeEditor();
}
@@ -970,7 +970,7 @@ void Note::toggleFolded(bool animate)
if (animate) {
// We animate collapsing (so sub-notes fluidly go under the first note)
- // We don't animate expanding: we place sub-notes directly under the first note (and the next relayout will animate the expanding)
+ // We don't animate expanding: we place sub-notes directly under the first note (and the next retqlayout will animate the expanding)
// But if user quickly collapsed and then expand (while the collapsing animation isn't finished), we animate anyway
bool animateSetUnder = (m_isFolded || !m_collapseFinished);
// std::cout << "fold:" << m_isFolded << " collapseFinished:" << m_collapseFinished << " animateSetUnder:" << animateSetUnder << std::endl;
@@ -998,7 +998,7 @@ void Note::toggleFolded(bool animate)
if (basket()->isLoaded() && !m_isFolded) {
//basket()->setFocusedNote(this);
- basket()->relayoutNotes(true);
+ basket()->retqlayoutNotes(true);
basket()->ensureNoteVisible(this);
}
@@ -1029,9 +1029,9 @@ Note* Note::noteAt(int x, int y)
if ((x >= right) && (x < right + RESIZER_WIDTH) && (y >= m_y) && (y < m_y + resizerHeight())) {
if ( ! m_computedAreas )
recomputeAreas();
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &rect = *it;
- if (rect.contains(x, y))
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &rect = *it;
+ if (rect.tqcontains(x, y))
return this;
}
}
@@ -1041,9 +1041,9 @@ Note* Note::noteAt(int x, int y)
if ((x >= m_x) && (x < m_x + width()) && (y >= m_y) && (y < m_y + m_height)) {
if ( ! m_computedAreas )
recomputeAreas();
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &rect = *it;
- if (rect.contains(x, y))
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &rect = *it;
+ if (rect.tqcontains(x, y))
return this;
}
return NULL;
@@ -1063,9 +1063,9 @@ Note* Note::noteAt(int x, int y)
} else if (matching() && y >= m_y && y < m_y + m_height && x >= m_x && x < m_x + m_width) {
if ( ! m_computedAreas )
recomputeAreas();
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &rect = *it;
- if (rect.contains(x, y))
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &rect = *it;
+ if (rect.tqcontains(x, y))
return this;
}
return NULL;
@@ -1074,14 +1074,14 @@ Note* Note::noteAt(int x, int y)
return NULL;
}
-QRect Note::rect()
+TQRect Note::rect()
{
- return QRect(x(), y(), width(), height());
+ return TQRect(x(), y(), width(), height());
}
-QRect Note::resizerRect()
+TQRect Note::resizerRect()
{
- return QRect(rightLimit(), y(), RESIZER_WIDTH, resizerHeight());
+ return TQRect(rightLimit(), y(), RESIZER_WIDTH, resizerHeight());
}
@@ -1090,7 +1090,7 @@ bool Note::showSubNotes()
return !m_isFolded || !m_collapseFinished || basket()->isFiltering();
}
-void Note::relayoutAt(int x, int y, bool animate)
+void Note::retqlayoutAt(int x, int y, bool animate)
{
if (!matching())
return;
@@ -1098,7 +1098,7 @@ void Note::relayoutAt(int x, int y, bool animate)
m_computedAreas = false;
m_areas.clear();
- // Don't relayout free notes one under the other, because by definition they are freely positionned!
+ // Don't retqlayout free notes one under the other, because by definition they are freely positionned!
if (isFree()) {
x = finalX();
y = finalY();
@@ -1109,7 +1109,7 @@ void Note::relayoutAt(int x, int y, bool animate)
cancelAnimation();
setX(x);
setY(y);
- // But relayout others vertically if they are inside such primary groups or if it is a "normal" basket:
+ // But retqlayout others vertically if they are inside such primary groups or if it is a "normal" basket:
} else {
if (animate)
setFinalPosition(x, y);
@@ -1120,21 +1120,21 @@ void Note::relayoutAt(int x, int y, bool animate)
}
}
- // Then, relayout sub-notes (only the first, if the group is folded) and so, assign an height to the group:
+ // Then, retqlayout sub-notes (only the first, if the group is folded) and so, assign an height to the group:
if (isGroup()) {
int h = 0;
Note *child = firstChild();
bool first = true;
while (child) {
- if (child->matching() && (!m_isFolded || first || basket()->isFiltering())) { // Don't use showSubNotes() but use !m_isFolded because we don't want a relayout for the animated collapsing notes
- child->relayoutAt(x + width(), y+h, animate);
+ if (child->matching() && (!m_isFolded || first || basket()->isFiltering())) { // Don't use showSubNotes() but use !m_isFolded because we don't want a retqlayout for the animated collapsing notes
+ child->retqlayoutAt(x + width(), y+h, animate);
h += child->finalHeight();
} else // In case the user collapse a group, then move it and then expand it:
child->setXRecursivly(x + width()); // notes SHOULD have a good X coordonate, and not the old one!
// For future animation when re-match, but on bottom of already matched notes!
- // Find parent primary note and set the Y to THAT y:
+ // Find tqparent primary note and set the Y to THAT y:
if (!child->matching())
- child->setY(parentPrimaryNote()->y());
+ child->setY(tqparentPrimaryNote()->y());
child = child->next();
first = false;
}
@@ -1153,8 +1153,8 @@ void Note::relayoutAt(int x, int y, bool animate)
// and NEED RELAYOUT
}
- // Set the basket area limits (but not for child notes: no need, because they will look for theire parent note):
- if (!parentNote()) {
+ // Set the basket area limits (but not for child notes: no need, because they will look for theire tqparent note):
+ if (!tqparentNote()) {
if (basket()->tmpWidth < finalRightLimit() + (hasResizer() ? RESIZER_WIDTH : 0))
basket()->tmpWidth = finalRightLimit() + (hasResizer() ? RESIZER_WIDTH : 0);
if (basket()->tmpHeight < finalY() + finalHeight())
@@ -1202,9 +1202,9 @@ int Note::groupWidth()
int Note::rightLimit()
{
if (isColumn() && m_next == 0L) // The last column
- return QMAX(x() + minWidth(), basket()->visibleWidth());
- else if (parentNote())
- return parentNote()->rightLimit();
+ return TQMAX(x() + minWidth(), basket()->visibleWidth());
+ else if (tqparentNote())
+ return tqparentNote()->rightLimit();
else
return m_x + m_groupWidth;
}
@@ -1212,26 +1212,26 @@ int Note::rightLimit()
int Note::finalRightLimit()
{
if (isColumn() && m_next == 0L) // The last column
- return QMAX(finalX() + minWidth(), basket()->visibleWidth());
- else if (parentNote())
- return parentNote()->finalRightLimit();
+ return TQMAX(finalX() + minWidth(), basket()->visibleWidth());
+ else if (tqparentNote())
+ return tqparentNote()->finalRightLimit();
else
return finalX() + m_groupWidth;
}
/*
- * This code is derivated from drawMetalGradient() from the Qt documentation:
+ * This code is derivated from drawMetalGradient() from the TQt documentation:
*/
-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 ) /*const*/
{
- QColor highlight(colorBottom);
- QColor subh1(colorTop);
- QColor subh2(colorTop);
+ TQColor highlight(colorBottom);
+ TQColor subh1(colorTop);
+ TQColor subh2(colorTop);
- QColor topgrad(colorTop);
- QColor botgrad(colorBottom);
+ TQColor topgrad(colorTop);
+ TQColor botgrad(colorBottom);
if ( flat && !sunken )
@@ -1267,44 +1267,44 @@ void drawGradient( QPainter *p, const QColor &colorTop, const QColor & colorBott
if ( ng > 1 ) {
for ( int j =0; j < ng; j++ ) {
- p->setPen( QColor( h1 + ((h2-h1)*j)/(ng-1),
+ p->setPen( TQColor( h1 + ((h2-h1)*j)/(ng-1),
s1 + ((s2-s1)*j)/(ng-1),
- v1 + ((v2-v1)*j)/(ng-1), QColor::Hsv ) );
+ v1 + ((v2-v1)*j)/(ng-1), TQColor::Hsv ) );
DRAWLINE;
}
} else if ( ng == 1 ) {
- p->setPen( QColor((h1+h2)/2, (s1+s2)/2, (v1+v2)/2, QColor::Hsv) );
+ p->setPen( TQColor((h1+h2)/2, (s1+s2)/2, (v1+v2)/2, TQColor::Hsv) );
DRAWLINE;
}
}
}
-void Note::drawExpander(QPainter *painter, int x, int y, const QColor &background, bool expand, Basket *basket)
+void Note::drawExpander(TQPainter *painter, int x, int y, const TQColor &background, bool expand, Basket *basket)
{
// If the current style is a KStyle, use it to draw the expander (plus or minus):
- if (dynamic_cast<KStyle*>(&(kapp->style())) != NULL) {
+ if (dynamic_cast<KStyle*>(&(kapp->tqstyle())) != NULL) {
// Set the 4 rounded corners background to background color:
- QColorGroup cg(basket->colorGroup());
- cg.setColor(QColorGroup::Base, background);
+ TQColorGroup cg(basket->tqcolorGroup());
+ cg.setColor(TQColorGroup::Base, background);
// Fill the inside of the expander in white, typically:
- QBrush brush(KGlobalSettings::baseColor());
+ TQBrush brush(KGlobalSettings::baseColor());
painter->fillRect(x, y, 9, 9, brush);
// Draw it:
- ((KStyle&)(kapp->style())).drawKStylePrimitive( KStyle::KPE_ListViewExpander,
+ ((KStyle&)(kapp->tqstyle())).drawKStylePrimitive( KStyle::KPE_ListViewExpander,
painter,
basket->viewport(),
- QRect(x, y, 9, 9),
+ TQRect(x, y, 9, 9),
cg,
- (expand ? QStyle::Style_On : QStyle::Style_Off) );
- // Else, QStyle does not provide easy way to do so (if it's doable at all...)
+ (expand ? TQStyle::Style_On : TQStyle::Style_Off) );
+ // Else, TQStyle does not provide easy way to do so (if it's doable at all...)
// So, I'm drawing it myself my immitating Plastik (pretty style)...
- // After all, the note/group handles are all non-QStyle aware so that doesn't matter if the expander is a custom one too.
+ // After all, the note/group handles are all non-TQStyle aware so that doesn't matter if the expander is a custom one too.
} else {
int width = EXPANDER_WIDTH;
int height = EXPANDER_HEIGHT;
- const QColorGroup &cg = basket->colorGroup();
+ const TQColorGroup &cg = basket->tqcolorGroup();
// Fill white area:
painter->fillRect(x + 1, y + 1, width - 2, height - 2, cg.base());
@@ -1337,7 +1337,7 @@ void Note::drawExpander(QPainter *painter, int x, int y, const QColor &backgroun
}
}
-QColor expanderBackground(int height, int y, const QColor &foreground)
+TQColor expanderBackground(int height, int y, const TQColor &foreground)
{
// We will divide height per two, substract one and use that below a division bar:
// To avoid division by zero error, height should be bigger than 3.
@@ -1345,8 +1345,8 @@ QColor expanderBackground(int height, int y, const QColor &foreground)
if (height <= 3 || y <= 0 || y >= height - 1)
return foreground;
- QColor dark = foreground.dark(110); // 1/1.1 of brightness
- QColor light = foreground.light(150); // 50% brighter
+ TQColor dark = foreground.dark(110); // 1/1.1 of brightness
+ TQColor light = foreground.light(150); // 50% brighter
int h1, h2, s1, s2, v1, v2;
int ng;
@@ -1361,18 +1361,18 @@ QColor expanderBackground(int height, int y, const QColor &foreground)
ng = (height-2)-(height-2)/2;
y -= 1 + (height-2)/2;
}
- return QColor( h1 + ((h2-h1)*y)/(ng-1),
+ return TQColor( h1 + ((h2-h1)*y)/(ng-1),
s1 + ((s2-s1)*y)/(ng-1),
- v1 + ((v2-v1)*y)/(ng-1), QColor::Hsv );
+ v1 + ((v2-v1)*y)/(ng-1), TQColor::Hsv );
}
-void Note::drawHandle(QPainter *painter, int x, int y, int width, int height, const QColor &background, const QColor &foreground)
+void Note::drawHandle(TQPainter *painter, int x, int y, int width, int height, const TQColor &background, const TQColor &foreground)
{
- QPen backgroundPen(background);
- QPen foregroundPen(foreground);
+ TQPen backgroundPen(background);
+ TQPen foregroundPen(foreground);
- QColor dark = foreground.dark(110); // 1/1.1 of brightness
- QColor light = foreground.light(150); // 50% brighter
+ TQColor dark = foreground.dark(110); // 1/1.1 of brightness
+ TQColor light = foreground.light(150); // 50% brighter
// Draw the surrounding rectangle:
painter->setPen(foregroundPen);
@@ -1418,8 +1418,8 @@ void Note::drawHandle(QPainter *painter, int x, int y, int width, int height, co
if (nbGrips < 2)
nbGrips = 2;
int yGrips = (height + 1 - nbGrips * 6 - 3) / 2; // +1 to avoid rounding errors, -nbGrips*6-3 the size of the grips
- QColor darker = foreground.dark(130);
- QColor lighter = foreground.light(130);
+ TQColor darker = foreground.dark(130);
+ TQColor lighter = foreground.light(130);
for (int i = 0; i < nbGrips; ++i) {
/// Dark color:
painter->setPen(darker);
@@ -1448,14 +1448,14 @@ void Note::drawHandle(QPainter *painter, int x, int y, int width, int height, co
painter->drawPoint(xGrips + 1, yGrips + 1);
}
-void Note::drawResizer(QPainter *painter, int x, int y, int width, int height, const QColor &background, const QColor &foreground, bool rounded)
+void Note::drawResizer(TQPainter *painter, int x, int y, int width, int height, const TQColor &background, const TQColor &foreground, bool rounded)
{
- QPen backgroundPen(background);
- QPen foregroundPen(foreground);
+ TQPen backgroundPen(background);
+ TQPen foregroundPen(foreground);
- QColor dark = foreground.dark(110); // 1/1.1 of brightness
- QColor light = foreground.light(150); // 50% brighter
- QColor midLight = foreground.light(105); // 5% brighter
+ TQColor dark = foreground.dark(110); // 1/1.1 of brightness
+ TQColor light = foreground.light(150); // 50% brighter
+ TQColor midLight = foreground.light(105); // 5% brighter
// Draw the surrounding rectangle:
painter->setPen(foregroundPen);
@@ -1497,8 +1497,8 @@ void Note::drawResizer(QPainter *painter, int x, int y, int width, int height, c
int xArrow = 2;
int hMargin = 9;
int countArrows = (height >= hMargin*4 + 6*3 ? 3 : (height >= hMargin*3 + 6*2 ? 2 : 1));
- QColor darker = foreground.dark(130);
- QColor lighter = foreground.light(130);
+ TQColor darker = foreground.dark(130);
+ TQColor lighter = foreground.light(130);
for (int i = 0; i < countArrows; ++i) {
int yArrow;
switch (countArrows) {
@@ -1526,10 +1526,10 @@ void Note::drawResizer(QPainter *painter, int x, int y, int width, int height, c
}
}
-void Note::drawInactiveResizer(QPainter *painter, int x, int y, int height, const QColor &background, bool column)
+void Note::drawInactiveResizer(TQPainter *painter, int x, int y, int height, const TQColor &background, bool column)
{
// If background color is too dark, we compute a lighter color instead of a darker:
- QColor darkBgColor = (Tools::tooDark(background) ? background.light(120) : background.dark(105));
+ TQColor darkBgColor = (Tools::tooDark(background) ? background.light(120) : background.dark(105));
if (column) {
int halfWidth = RESIZER_WIDTH / 2;
drawGradient(painter, darkBgColor, background, x, y, halfWidth, height, /*sunken=*/false, /*horz=*/false, /*flat=*/false);
@@ -1539,7 +1539,7 @@ void Note::drawInactiveResizer(QPainter *painter, int x, int y, int height, cons
}
-#include <qimage.h>
+#include <tqimage.h>
#include <kimageeffect.h>
/* type: 1: topLeft
@@ -1551,7 +1551,7 @@ void Note::drawInactiveResizer(QPainter *painter, int x, int y, int height, cons
* (x,y) relate to the painter origin
* (width,height) only used for 5:fourCorners type
*/
-void Note::drawRoundings(QPainter *painter, int x, int y, int type, int width, int height)
+void Note::drawRoundings(TQPainter *painter, int x, int y, int type, int width, int height)
{
int right;
@@ -1559,36 +1559,36 @@ void Note::drawRoundings(QPainter *painter, int x, int y, int type, int width, i
case 1:
x += this->x();
y += this->y();
- basket()->blendBackground(*painter, QRect(x, y, 4, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + 1, 2, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + 2, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + 3, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y, 4, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + 1, 2, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + 2, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + 3, 1, 1), this->x(), this->y());
break;
case 2:
x += this->x();
y += this->y();
- basket()->blendBackground(*painter, QRect(x, y - 1, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + 1, 2, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + 2, 4, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y - 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + 1, 2, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + 2, 4, 1), this->x(), this->y());
break;
case 3:
right = rightLimit();
x += right;
y += this->y();
- basket()->blendBackground(*painter, QRect(x - 1, y, 4, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x + 1, y + 1, 2, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x + 2, y + 2, 1, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x + 2, y + 3, 1, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x - 1, y, 4, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 1, y + 1, 2, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 2, y + 2, 1, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 2, y + 3, 1, 1), right, this->y());
break;
case 4:
right = rightLimit();
x += right;
y += this->y();
- basket()->blendBackground(*painter, QRect(x + 2, y - 1, 1, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x + 2, y, 1, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x + 1, y + 1, 2, 1), right, this->y());
- basket()->blendBackground(*painter, QRect(x - 1, y + 2, 4, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 2, y - 1, 1, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 2, y, 1, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x + 1, y + 1, 2, 1), right, this->y());
+ basket()->blendBackground(*painter, TQRect(x - 1, y + 2, 4, 1), right, this->y());
break;
case 5:
// First make sure the corners are white (depending on the widget style):
@@ -1600,29 +1600,29 @@ void Note::drawRoundings(QPainter *painter, int x, int y, int type, int width, i
// And then blend corners:
x += this->x();
y += this->y();
- basket()->blendBackground(*painter, QRect(x, y, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 1, y, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 1, y + height - 1, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x, y + height - 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 1, y, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 1, y + height - 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x, y + height - 1, 1, 1), this->x(), this->y());
break;
case 6:
x += this->x();
y += this->y();
//if (!isSelected()) {
// Inside left corners:
- basket()->blendBackground(*painter, QRect(x + HANDLE_WIDTH + 1, y + 1, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + HANDLE_WIDTH, y + 2, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + HANDLE_WIDTH + 1, y + height - 2, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + HANDLE_WIDTH, y + height - 3, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + HANDLE_WIDTH + 1, y + 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + HANDLE_WIDTH, y + 2, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + HANDLE_WIDTH + 1, y + height - 2, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + HANDLE_WIDTH, y + height - 3, 1, 1), this->x(), this->y());
// Inside right corners:
- basket()->blendBackground(*painter, QRect(x + width - 4, y + 1, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 3, y + 2, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 4, y + height - 2, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 3, y + height - 3, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 4, y + 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 3, y + 2, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 4, y + height - 2, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 3, y + height - 3, 1, 1), this->x(), this->y());
//}
// Outside right corners:
- basket()->blendBackground(*painter, QRect(x + width - 1, y, 1, 1), this->x(), this->y());
- basket()->blendBackground(*painter, QRect(x + width - 1, y + height - 1, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 1, y, 1, 1), this->x(), this->y());
+ basket()->blendBackground(*painter, TQRect(x + width - 1, y + height - 1, 1, 1), this->x(), this->y());
break;
}
}
@@ -1640,34 +1640,34 @@ void Note::setOnTop(bool onTop)
}
}
-void substractRectOnAreas(const QRect &rectToSubstract, QValueList<QRect> &areas, bool andRemove)
+void substractRectOnAreas(const TQRect &rectToSubstract, TQValueList<TQRect> &areas, bool andRemove)
{
- for (QValueList<QRect>::iterator it = areas.begin(); it != areas.end(); ) {
- QRect &rect = *it;
+ for (TQValueList<TQRect>::iterator it = areas.begin(); it != areas.end(); ) {
+ TQRect &rect = *it;
// Split the rectangle if it intersects with rectToSubstract:
if (rect.intersects(rectToSubstract)) {
// Create the top rectangle:
if (rectToSubstract.top() > rect.top()) {
- areas.insert(it, QRect(rect.left(), rect.top(), rect.width(), rectToSubstract.top() - rect.top()));
+ areas.insert(it, TQRect(rect.left(), rect.top(), rect.width(), rectToSubstract.top() - rect.top()));
rect.setTop(rectToSubstract.top());
}
// Create the bottom rectangle:
if (rectToSubstract.bottom() < rect.bottom()) {
- areas.insert(it, QRect(rect.left(), rectToSubstract.bottom() + 1, rect.width(), rect.bottom() - rectToSubstract.bottom()));
+ areas.insert(it, TQRect(rect.left(), rectToSubstract.bottom() + 1, rect.width(), rect.bottom() - rectToSubstract.bottom()));
rect.setBottom(rectToSubstract.bottom());
}
// Create the left rectangle:
if (rectToSubstract.left() > rect.left()) {
- areas.insert(it, QRect(rect.left(), rect.top(), rectToSubstract.left() - rect.left(), rect.height()));
+ areas.insert(it, TQRect(rect.left(), rect.top(), rectToSubstract.left() - rect.left(), rect.height()));
rect.setLeft(rectToSubstract.left());
}
// Create the right rectangle:
if (rectToSubstract.right() < rect.right()) {
- areas.insert(it, QRect(rectToSubstract.right() + 1, rect.top(), rect.right() - rectToSubstract.right(), rect.height()));
+ areas.insert(it, TQRect(rectToSubstract.right() + 1, rect.top(), rect.right() - rectToSubstract.right(), rect.height()));
rect.setRight(rectToSubstract.right());
}
// Remove the rectangle if it's entirely contained:
- if (andRemove && rectToSubstract.contains(rect))
+ if (andRemove && rectToSubstract.tqcontains(rect))
it = areas.remove(it);
else
++it;
@@ -1727,7 +1727,7 @@ bool Note::isEditing()
return basket()->editedNote() == this;
}
-void Note::getGradientColors(const QColor &originalBackground, QColor *colorTop, QColor *colorBottom)
+void Note::getGradientColors(const TQColor &originalBackground, TQColor *colorTop, TQColor *colorBottom)
{
bool wasTooDark = Tools::tooDark(originalBackground);
if (wasTooDark) {
@@ -1747,7 +1747,7 @@ void Note::getGradientColors(const QColor &originalBackground, QColor *colorTop,
* - But as drawing the pixmap offscreen is little time consuming we can keep last visible notes buffered and then the redraw of the entire window is INSTANTANEOUS
* - We keep bufferized note/group draws BUT NOT the resizer: such objects are small and fast to draw, so we don't complexify code for that
*/
-void Note::draw(QPainter *painter, const QRect &clipRect)
+void Note::draw(TQPainter *painter, const TQRect &clipRect)
{
if (!matching())
return;
@@ -1764,19 +1764,19 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
}
}
- QRect myRect(x(), y(), width(), height());
+ TQRect myRect(x(), y(), width(), height());
/** Paint the resizer if needed: */
if (hasResizer()) {
int right = rightLimit();
- QRect resizerRect(right, y(), RESIZER_WIDTH, resizerHeight());
+ TQRect resizerRect(right, y(), RESIZER_WIDTH, resizerHeight());
if (resizerRect.intersects(clipRect)) {
// Prepare to draw the resizer:
- QPixmap pixmap(RESIZER_WIDTH, resizerHeight());
- QPainter painter2(&pixmap);
+ TQPixmap pixmap(RESIZER_WIDTH, resizerHeight());
+ TQPainter painter2(&pixmap);
// Draw gradient or resizer:
if (m_hovered && m_hoveredZone == Resizer) {
- QColor baseColor(basket()->backgroundColor());
- QColor highColor(KGlobalSettings::highlightColor());
+ TQColor baseColor(basket()->backgroundColor());
+ TQColor highColor(KGlobalSettings::highlightColor());
drawResizer(&painter2, 0, 0, RESIZER_WIDTH, resizerHeight(), baseColor, highColor, /*rounded=*/!isColumn());
if (!isColumn()) {
drawRoundings(&painter2, RESIZER_WIDTH - 3, 0, /*type=*/3);
@@ -1791,12 +1791,12 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
basket()->drawInserter(painter2, right, y());
// Draw selection rect:
if (basket()->isSelecting() && resizerRect.intersects(basket()->selectionRect())) {
- QRect selectionRect = basket()->selectionRect();
+ TQRect selectionRect = basket()->selectionRect();
selectionRect.moveBy(-right, -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 = basket()->selectionRectInsideColor();
- QColor darkInsideColor(insideColor.dark(105));
+ TQColor insideColor = basket()->selectionRectInsideColor();
+ TQColor darkInsideColor(insideColor.dark(105));
painter2.setClipRect(selectionRectInside);
if (isColumn()) {
int halfWidth = RESIZER_WIDTH / 2;
@@ -1823,8 +1823,8 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
recomputeAreas();
if (m_areas.isEmpty())
return;
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &rect = *it;
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &rect = *it;
painter->drawPixmap(rect.x(), rect.y(), pixmap, rect.x() - right, rect.y() - y(), rect.width(), rect.height());
}
}
@@ -1848,19 +1848,19 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
/** Initialise buffer painter: */
m_bufferedPixmap.resize(width(), height());
- QPainter painter2(&m_bufferedPixmap);
+ TQPainter painter2(&m_bufferedPixmap);
/** Initialise colors: */
- QColor baseColor(basket()->backgroundColor());
- QColor highColor(KGlobalSettings::highlightColor());
- QColor midColor = Tools::mixColor(baseColor, highColor);
+ TQColor baseColor(basket()->backgroundColor());
+ TQColor highColor(KGlobalSettings::highlightColor());
+ TQColor midColor = Tools::mixColor(baseColor, highColor);
/** Initialise brushs and pens: */
- QBrush baseBrush(baseColor);
- QBrush highBrush(highColor);
- QPen basePen(baseColor);
- QPen highPen(highColor);
- QPen midPen(midColor);
+ TQBrush baseBrush(baseColor);
+ TQBrush highBrush(highColor);
+ TQPen basePen(baseColor);
+ TQPen highPen(highColor);
+ TQPen midPen(midColor);
/** Figure out the state of the note: */
bool hovered = m_hovered && m_hoveredZone != TopInsert && m_hoveredZone != BottomInsert && m_hoveredZone != Resizer;
@@ -1882,8 +1882,8 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
drawExpander(&painter2, NOTE_MARGIN, yExp, (hovered ? expanderBackground(height(), yExp+EXPANDER_HEIGHT/2, highColor) : baseColor), m_isFolded, basket());
// Draw expander rounded edges:
if (hovered) {
- QColor color1 = expanderBackground(height(), yExp, highColor);
- QColor color2 = expanderBackground(height(), yExp + EXPANDER_HEIGHT - 1, highColor);
+ TQColor color1 = expanderBackground(height(), yExp, highColor);
+ TQColor color2 = expanderBackground(height(), yExp + EXPANDER_HEIGHT - 1, highColor);
painter2.setPen(color1);
painter2.drawPoint(NOTE_MARGIN, yExp);
painter2.drawPoint(NOTE_MARGIN + 9 - 1, yExp);
@@ -1901,7 +1901,7 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
/** Or draw the note: */
// What are the background colors:
- QColor background = basket()->backgroundColor();
+ TQColor background = basket()->backgroundColor();
if (isSelected())
if (m_computedState.backgroundColor().isValid())
background = Tools::mixColor(Tools::mixColor(m_computedState.backgroundColor(), KGlobalSettings::highlightColor()), KGlobalSettings::highlightColor());
@@ -1909,8 +1909,8 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
background = KGlobalSettings::highlightColor();
else if (m_computedState.backgroundColor().isValid())
background = m_computedState.backgroundColor();
- QColor bgColor;
- QColor darkBgColor;
+ TQColor bgColor;
+ TQColor darkBgColor;
getGradientColors(background, &darkBgColor, &bgColor);
// Draw background (color, gradient and pixmap):
drawGradient( &painter2, bgColor, darkBgColor, 0, 0, width(), height(), /*sunken=*/!hovered, /*horz=*/true, /*flat=*/false );
@@ -1934,10 +1934,10 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
painter2.drawPoint(HANDLE_WIDTH, 1);
painter2.drawPoint(HANDLE_WIDTH, height() - 2);
// Light handle top-right round corner:
- painter2.setPen(QPen(highColor.light(150)));
+ painter2.setPen(TQPen(highColor.light(150)));
painter2.drawPoint(HANDLE_WIDTH - 1, 1);
// Handle anti-aliased rounded handle-right-side corners:
- QColor insideMidColor = Tools::mixColor(bgColor, highColor);
+ TQColor insideMidColor = Tools::mixColor(bgColor, highColor);
painter2.setPen(insideMidColor);
// Left inside round corners:
painter2.drawPoint(HANDLE_WIDTH + 1, 1);
@@ -1963,7 +1963,7 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
}
if (isFocused()) {
- QRect focusRect(HANDLE_WIDTH, NOTE_MARGIN - 1, width() - HANDLE_WIDTH - 2, height() - 2*NOTE_MARGIN + 2);
+ TQRect focusRect(HANDLE_WIDTH, NOTE_MARGIN - 1, width() - HANDLE_WIDTH - 2, height() - 2*NOTE_MARGIN + 2);
painter2.drawWinFocusRect(focusRect);
}
@@ -1972,32 +1972,32 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
int xIcon = HANDLE_WIDTH + NOTE_MARGIN;
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) {
if (!(*it)->emblem().isEmpty()) {
- QPixmap stateEmblem = kapp->iconLoader()->loadIcon((*it)->emblem(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, false);
+ TQPixmap stateEmblem = kapp->iconLoader()->loadIcon((*it)->emblem(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, false);
painter2.drawPixmap(xIcon, yIcon, stateEmblem);
xIcon += NOTE_MARGIN + EMBLEM_SIZE;
}
}
// Determine the colors (for the richText drawing) and the text color (for the tags arrow too):
- QColorGroup cg(basket()->colorGroup());
- cg.setColor(QColorGroup::Text, (m_computedState.textColor().isValid() ? m_computedState.textColor() : basket()->textColor()) );
- cg.setColor(QColorGroup::Background, bgColor);
+ TQColorGroup cg(basket()->tqcolorGroup());
+ cg.setColor(TQColorGroup::Text, (m_computedState.textColor().isValid() ? m_computedState.textColor() : basket()->textColor()) );
+ cg.setColor(TQColorGroup::Background, bgColor);
if (isSelected())
- cg.setColor(QColorGroup::Text, KGlobalSettings::highlightedTextColor());
+ cg.setColor(TQColorGroup::Text, KGlobalSettings::highlightedTextColor());
// Draw the Tags Arrow:
if (hovered) {
- QColor textColor = cg.color(QColorGroup::Text);
- QColor light = Tools::mixColor(textColor, bgColor);
- QColor mid = Tools::mixColor(textColor, light);
- painter2.setPen(light);//QPen(basket()->colorGroup().dark().light(150)));
+ TQColor textColor = cg.color(TQColorGroup::Text);
+ TQColor light = Tools::mixColor(textColor, bgColor);
+ TQColor mid = Tools::mixColor(textColor, light);
+ painter2.setPen(light);//TQPen(basket()->tqcolorGroup().dark().light(150)));
painter2.drawLine(xIcon, yIcon + 6, xIcon + 4, yIcon + 6);
- painter2.setPen(mid);//QPen(basket()->colorGroup().dark()));
+ painter2.setPen(mid);//TQPen(basket()->tqcolorGroup().dark()));
painter2.drawLine(xIcon + 1, yIcon + 7, xIcon + 3, yIcon + 7);
- painter2.setPen(textColor);//QPen(basket()->colorGroup().foreground()));
+ painter2.setPen(textColor);//TQPen(basket()->tqcolorGroup().foreground()));
painter2.drawPoint(xIcon + 2, yIcon + 8);
} else if (m_haveInvisibleTags) {
- painter2.setPen(cg.color(QColorGroup::Text)/*QPen(basket()->colorGroup().foreground())*/);
+ painter2.setPen(cg.color(TQColorGroup::Text)/*TQPen(basket()->tqcolorGroup().foreground())*/);
painter2.drawPoint(xIcon, yIcon + 7);
painter2.drawPoint(xIcon + 2, yIcon + 7);
painter2.drawPoint(xIcon + 4, yIcon + 7);
@@ -2016,34 +2016,34 @@ void Note::draw(QPainter *painter, const QRect &clipRect)
drawBufferOnScreen(painter, m_bufferedPixmap);
}
-void Note::drawBufferOnScreen(QPainter *painter, const QPixmap &contentPixmap)
+void Note::drawBufferOnScreen(TQPainter *painter, const TQPixmap &contentPixmap)
{
- for (QValueList<QRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
- QRect &rect = *it;
+ for (TQValueList<TQRect>::iterator it = m_areas.begin(); it != m_areas.end(); ++it) {
+ TQRect &rect = *it;
if (rect.x() >= x() + width()) // It's a rect of the resizer, don't draw it!
continue;
// If the inserter is above the note, draw it, BUT NOT in the buffer pixmap,
// we copy the rectangle in a new pixmap, apply the inserter and then draw this new pixmap on screen:
if ( (basket()->inserterShown() && rect.intersects(basket()->inserterRect())) ||
(basket()->isSelecting() && rect.intersects(basket()->selectionRect())) ) {
- QPixmap pixmap3(rect.width(), rect.height());
- QPainter painter3(&pixmap3);
+ TQPixmap pixmap3(rect.width(), rect.height());
+ TQPainter painter3(&pixmap3);
painter3.drawPixmap(0, 0, contentPixmap, rect.x() - x(), rect.y() - y(), rect.width(), rect.height());
// Draw inserter:
if (basket()->inserterShown() && rect.intersects(basket()->inserterRect()))
basket()->drawInserter(painter3, rect.x(), rect.y());
// Draw selection rect:
if (basket()->isSelecting() && rect.intersects(basket()->selectionRect())) {
- QRect selectionRect = basket()->selectionRect();
+ TQRect selectionRect = basket()->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) {
bufferizeSelectionPixmap();
selectionRectInside.moveBy(rect.x(), rect.y());
- QRect rectToPaint = rect.intersect(selectionRectInside);
+ TQRect rectToPaint = rect.intersect(selectionRectInside);
rectToPaint.moveBy(-x(), -y());
- painter3.drawPixmap(rectToPaint.topLeft() + QPoint(x(), y()) - rect.topLeft(), m_bufferedSelectionPixmap, rectToPaint);
+ painter3.drawPixmap(rectToPaint.topLeft() + TQPoint(x(), y()) - rect.topLeft(), m_bufferedSelectionPixmap, rectToPaint);
//blendBackground(painter2, selectionRectInside, rect.x(), rect.y(), true, &m_selectedBackgroundPixmap);
}
@@ -2053,7 +2053,7 @@ void Note::drawBufferOnScreen(QPainter *painter, const QPixmap &contentPixmap)
painter3.setPen(Tools::mixColor(KGlobalSettings::highlightColor().dark(), basket()->backgroundColor()));
else {
// What are the background colors:
- QColor bgColor = basket()->backgroundColor();
+ TQColor bgColor = basket()->backgroundColor();
if (isSelected())
bgColor = (m_computedState.backgroundColor().isValid() ? Tools::mixColor(Tools::mixColor(m_computedState.backgroundColor(), KGlobalSettings::highlightColor()), KGlobalSettings::highlightColor()) : KGlobalSettings::highlightColor());
else if (m_computedState.backgroundColor().isValid())
@@ -2088,18 +2088,18 @@ void Note::addState(State *state, bool orReplace)
if (!content())
return;
- Tag *tag = state->parentTag();
+ Tag *tag = state->tqparentTag();
State::List::iterator itStates = m_states.begin();
// Browse all tags, see if the note has it, increment itSates if yes, and then insert the state at this position...
// For each existing tags:
for (Tag::List::iterator it = Tag::all.begin(); it != Tag::all.end(); ++it) {
// If the current tag isn't the one to assign or the current one on the note, go to the next tag:
- if (*it != tag && itStates != m_states.end() && *it != (*itStates)->parentTag())
+ if (*it != tag && itStates != m_states.end() && *it != (*itStates)->tqparentTag())
continue;
// We found the tag to insert:
if (*it == tag) {
// And the note already have the tag:
- if (itStates != m_states.end() && *it == (*itStates)->parentTag()) {
+ if (itStates != m_states.end() && *it == (*itStates)->tqparentTag()) {
// We replace the state if wanted:
if (orReplace) {
itStates = m_states.insert(itStates, state);
@@ -2114,17 +2114,17 @@ void Note::addState(State *state, bool orReplace)
return;
}
// The note has this tag:
- if (itStates != m_states.end() && *it == (*itStates)->parentTag())
+ if (itStates != m_states.end() && *it == (*itStates)->tqparentTag())
++itStates;
}
}
-QFont Note::font()
+TQFont Note::font()
{
- return m_computedState.font( basket()->QScrollView::font() );
+ return m_computedState.font( basket()->TQScrollView::font() );
}
-QColor Note::backgroundColor()
+TQColor Note::backgroundColor()
{
if (m_computedState.backgroundColor().isValid())
return m_computedState.backgroundColor();
@@ -2132,7 +2132,7 @@ QColor Note::backgroundColor()
return basket()->backgroundColor();
}
-QColor Note::textColor()
+TQColor Note::textColor()
{
if (m_computedState.textColor().isValid())
return m_computedState.textColor();
@@ -2146,7 +2146,7 @@ void Note::recomputeStyle()
// unsetWidth();
if (content())
content()->fontChanged();
-// requestRelayout(); // TODO!
+// requestRetqlayout(); // TODO!
}
void Note::recomputeAllStyles()
@@ -2159,12 +2159,12 @@ void Note::recomputeAllStyles()
child->recomputeAllStyles();
}
-bool Note::removedStates(const QValueList<State*> &deletedStates)
+bool Note::removedStates(const TQValueList<State*> &deletedStates)
{
bool modifiedBasket = false;
if (!states().isEmpty()) {
- for (QValueList<State*>::const_iterator it = deletedStates.begin(); it != deletedStates.end(); ++it)
+ for (TQValueList<State*>::const_iterator it = deletedStates.begin(); it != deletedStates.end(); ++it)
if (hasState(*it)) {
removeState(*it);
modifiedBasket = true;
@@ -2181,7 +2181,7 @@ bool Note::removedStates(const QValueList<State*> &deletedStates)
void Note::addTag(Tag *tag)
{
- addState(tag->states().first(), /*but do not replace:*/false);
+ addState(tag->states().first(), /*but do not tqreplace:*/false);
}
void Note::removeState(State *state)
@@ -2197,7 +2197,7 @@ void Note::removeState(State *state)
void Note::removeTag(Tag *tag)
{
for (State::List::iterator it = m_states.begin(); it != m_states.end(); ++it)
- if ((*it)->parentTag() == tag) {
+ if ((*it)->tqparentTag() == tag) {
m_states.remove(it);
recomputeStyle();
return;
@@ -2254,7 +2254,7 @@ void Note::addStateToSelectedNotes(State *state, bool orReplace)
void Note::changeStateOfSelectedNotes(State *state)
{
- if (content() && isSelected() && hasTag(state->parentTag()))
+ if (content() && isSelected() && hasTag(state->tqparentTag()))
addState(state);
FOR_EACH_CHILD (child)
@@ -2283,7 +2283,7 @@ bool Note::hasState(State *state)
bool Note::hasTag(Tag *tag)
{
for (State::List::iterator it = m_states.begin(); it != m_states.end(); ++it)
- if ((*it)->parentTag() == tag)
+ if ((*it)->tqparentTag() == tag)
return true;
return false;
}
@@ -2291,7 +2291,7 @@ bool Note::hasTag(Tag *tag)
State* Note::stateOfTag(Tag *tag)
{
for (State::List::iterator it = m_states.begin(); it != m_states.end(); ++it)
- if ((*it)->parentTag() == tag)
+ if ((*it)->tqparentTag() == tag)
return *it;
return 0;
}
@@ -2354,8 +2354,8 @@ void Note::inheritTagsOf(Note *note)
return;
for (State::List::iterator it = note->states().begin(); it != note->states().end(); ++it)
- if ((*it)->parentTag() && (*it)->parentTag()->inheritedBySiblings())
- addTag((*it)->parentTag());
+ if ((*it)->tqparentTag() && (*it)->tqparentTag()->inheritedBySiblings())
+ addTag((*it)->tqparentTag());
}
void Note::unbufferizeAll()
@@ -2374,38 +2374,38 @@ void Note::unbufferizeAll()
void Note::bufferizeSelectionPixmap()
{
if (m_bufferedSelectionPixmap.isNull()) {
- QColor insideColor = KGlobalSettings::highlightColor();
+ TQColor insideColor = KGlobalSettings::highlightColor();
KPixmap kpixmap(m_bufferedPixmap);
m_bufferedSelectionPixmap = KPixmapEffect::fade(kpixmap, 0.25, insideColor);
}
}
-QRect Note::visibleRect()
+TQRect Note::visibleRect()
{
- QValueList<QRect> areas;
+ TQValueList<TQRect> areas;
areas.append(rect());
- // When we are folding a parent group, if this note is bigger than the first real note of the group, cut the top of this:
- Note *parent = parentNote();
- while (parent) {
- if (parent->expandingOrCollapsing())
- substractRectOnAreas(QRect(x(), parent->y() - height(), width(), height()), areas, true);
- parent = parent->parentNote();
+ // When we are folding a tqparent group, if this note is bigger than the first real note of the group, cut the top of this:
+ Note *tqparent = tqparentNote();
+ while (tqparent) {
+ if (tqparent->expandingOrCollapsing())
+ substractRectOnAreas(TQRect(x(), tqparent->y() - height(), width(), height()), areas, true);
+ tqparent = tqparent->tqparentNote();
}
if (areas.count() > 0)
return areas[0];
else
- return QRect();
+ return TQRect();
}
-void Note::recomputeBlankRects(QValueList<QRect> &blankAreas)
+void Note::recomputeBlankRects(TQValueList<TQRect> &blankAreas)
{
if (!matching())
return;
- // visibleRect() instead of rect() because if we are folding/expanding a smaller parent group, then some part is hidden!
- // But anyway, a resizer is always a primary note and is never hidden by a parent group, so no visibleResizerRect() method!
+ // visibleRect() instead of rect() because if we are folding/expanding a smaller tqparent group, then some part is hidden!
+ // But anyway, a resizer is always a primary note and is never hidden by a tqparent group, so no visibleResizerRect() method!
substractRectOnAreas(visibleRect(), blankAreas, true);
if (hasResizer())
substractRectOnAreas(resizerRect(), blankAreas, true);
@@ -2434,7 +2434,7 @@ void Note::linkLookChanged()
content()->linkLookChanged();
}
-Note* Note::noteForFullPath(const QString &path)
+Note* Note::noteForFullPath(const TQString &path)
{
if (content() && fullPath() == path)
return this;
@@ -2450,11 +2450,11 @@ Note* Note::noteForFullPath(const QString &path)
return 0;
}
-void Note::listUsedTags(QValueList<Tag*> &list)
+void Note::listUsedTags(TQValueList<Tag*> &list)
{
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it) {
- Tag *tag = (*it)->parentTag();
- if (!list.contains(tag))
+ Tag *tag = (*it)->tqparentTag();
+ if (!list.tqcontains(tag))
list.append(tag);
}
@@ -2463,11 +2463,11 @@ void Note::listUsedTags(QValueList<Tag*> &list)
}
-void Note::usedStates(QValueList<State*> &states)
+void Note::usedStates(TQValueList<State*> &states)
{
if (content())
for (State::List::Iterator it = m_states.begin(); it != m_states.end(); ++it)
- if (!states.contains(*it))
+ if (!states.tqcontains(*it))
states.append(*it);
FOR_EACH_CHILD (child)
@@ -2490,8 +2490,8 @@ Note* Note::nextInStack()
else
return next()->nextInStack();
- // And finally, in the parent:
- Note *note = parentNote();
+ // And finally, in the tqparent:
+ Note *note = tqparentNote();
while (note)
if (note->next())
if (note->next()->content())
@@ -2499,7 +2499,7 @@ Note* Note::nextInStack()
else
return note->next()->nextInStack();
else
- note = note->parentNote();
+ note = note->tqparentNote();
// Not found:
return 0;
@@ -2518,8 +2518,8 @@ Note* Note::prevInStack()
return note;
}
- if (parentNote())
- return parentNote()->prevInStack();
+ if (tqparentNote())
+ return tqparentNote()->prevInStack();
else
return 0;
}
@@ -2554,20 +2554,20 @@ bool Note::isShown()
return true;
// So, here we go to the complexe case: if the note is inside a collapsed group:
- Note *group = parentNote();
+ Note *group = tqparentNote();
Note *child = this;
while (group) {
if (group->isFolded() && group->firstChild() != child)
return false;
child = group;
- group = group->parentNote();
+ group = group->tqparentNote();
}
return true;
}
void Note::debug()
{
- std::cout << "Note@" << (Q_UINT64)this;
+ std::cout << "Note@" << (TQ_UINT64)this;
if (!this) {
std::cout << std::endl;
return;
@@ -2631,7 +2631,7 @@ void Note::groupIn(Note *group)
if (allSelected() && !isColumn()) {
basket()->unplugNote(this);
- basket()->insertNote(this, group, Note::BottomColumn, QPoint(), /*animateNewPosition=*/true);
+ basket()->insertNote(this, group, Note::BottomColumn, TQPoint(), /*animateNewPosition=*/true);
} else {
Note *next;
Note *child = firstChild();
@@ -2645,40 +2645,40 @@ void Note::groupIn(Note *group)
bool Note::tryExpandParent()
{
- Note *parent = parentNote();
+ Note *tqparent = tqparentNote();
Note *child = this;
- while (parent) {
- if (parent->firstChild() != child)
+ while (tqparent) {
+ if (tqparent->firstChild() != child)
return false;
- if (parent->isColumn())
+ if (tqparent->isColumn())
return false;
- if (parent->isFolded()) {
- parent->toggleFolded(true);
- basket()->relayoutNotes(true);
+ if (tqparent->isFolded()) {
+ tqparent->toggleFolded(true);
+ basket()->retqlayoutNotes(true);
return true;
}
- child = parent;
- parent = parent->parentNote();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
return false;
}
bool Note::tryFoldParent() // TODO: withCtrl ? withShift ?
{
- Note *parent = parentNote();
+ Note *tqparent = tqparentNote();
Note *child = this;
- while (parent) {
- if (parent->firstChild() != child)
+ while (tqparent) {
+ if (tqparent->firstChild() != child)
return false;
- if (parent->isColumn())
+ if (tqparent->isColumn())
return false;
- if (!parent->isFolded()) {
- parent->toggleFolded(true);
- basket()->relayoutNotes(true);
+ if (!tqparent->isFolded()) {
+ tqparent->toggleFolded(true);
+ basket()->retqlayoutNotes(true);
return true;
}
- child = parent;
- parent = parent->parentNote();
+ child = tqparent;
+ tqparent = tqparent->tqparentNote();
}
return false;
}
@@ -2754,11 +2754,11 @@ int Note::distanceOnTopBottom(Note *note, int side)
return int(sqrt(pow(noteCenterX - thisCenterX, 2) + pow(noteCenterY - thisCenterY, 2)) + angle);
}
-Note* Note::parentPrimaryNote()
+Note* Note::tqparentPrimaryNote()
{
Note *primary = this;
- while (primary->parentNote())
- primary = primary->parentNote();
+ while (primary->tqparentNote())
+ primary = primary->tqparentNote();
return primary;
}
@@ -2794,8 +2794,8 @@ bool Note::convertTexts()
bool convertedNotes = false;
if (content() && content()->lowerTypeName() == "text") {
- QString text = ((TextContent*)content())->text();
- QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::textToHTMLWithoutP(text) + "</body></html>";
+ TQString text = ((TextContent*)content())->text();
+ TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::textToHTMLWithoutP(text) + "</body></html>";
basket()->saveToFile(fullPath(), html, /*isLocalEncoding=*/true);
setContent( new HtmlContent(this, content()->fileName()) );
convertedNotes = true;
@@ -2812,7 +2812,7 @@ bool Note::convertTexts()
/** Note */
-QString Note::toHtml(const QString &imageName)
+TQString Note::toHtml(const TQString &imageName)
{
switch (m_type) {
case Text:
@@ -2826,49 +2826,49 @@ QString Note::toHtml(const QString &imageName)
{
if ( (m_type == Image && pixmap() == 0L) ||
(m_type == Animation && movie() == 0L) ) {
- QMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
+ TQMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
return i18n("(Image)"); // Image or animation not yet loaded!!
}
- QImage image;
+ TQImage image;
if (m_type == Image)
image = pixmap()->convertToImage();
else
image = movie()->framePixmap().convertToImage();
- image = image.smoothScale(200, 150, QImage::ScaleMin);
- QPixmap pixmap = QPixmap(image);
- QMimeSourceFactory::defaultFactory()->setPixmap(imageName, pixmap);
+ image = image.smoothScale(200, 150, TQ_ScaleMin);
+ TQPixmap pixmap = TQPixmap(image);
+ TQMimeSourceFactory::defaultFactory()->setPixmap(imageName, pixmap);
return "<img src=" + imageName + ">"; ///
/* // FIXME: movie isn't loaded yet: CRASH!
return i18n("(Image)");
// Not executed, because don't work:
- QImage image;
+ TQImage image;
if (m_type == Image)
image = pixmap()->convertToImage();
else
image = movie()->framePixmap().convertToImage();
- image = image.smoothScale(200, 150, QImage::ScaleMin);
- QPixmap pixmap = QPixmap(image);
- QMimeSourceFactory::defaultFactory()->setPixmap(imageName, pixmap);
+ image = image.smoothScale(200, 150, TQ_ScaleMin);
+ TQPixmap pixmap = TQPixmap(image);
+ TQMimeSourceFactory::defaultFactory()->setPixmap(imageName, pixmap);
return "<img src=" + imageName + ">"; ///
- */ //TODO?: QMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
+ */ //TODO?: TQMimeSourceFactory::defaultFactory()->setData(imageName, 0L);
}
case Sound:
case File:
{
/// FIXME: Since fullPath() doesn't exist yet, the icon rely on the extension.
/// Bad if there isn't one or if it's a wrong one.
- /*QPixmap icon = DesktopIcon(
+ /*TQPixmap icon = DesktopIcon(
NoteFactory::iconForURL(fullPath()),
(m_type == Sound ? LinkLook::soundLook : LinkLook::fileLook)->iconSize());
- QMimeSourceFactory::defaultFactory()->setPixmap(imageName, icon);
+ TQMimeSourceFactory::defaultFactory()->setPixmap(imageName, icon);
return "<img src=" + imageName + "> " + fileName(); */ ///
return m_linkLabel->toHtml(imageName);
}
case Link:
{
- QString link = m_linkLabel->toHtml(imageName);
+ TQString link = m_linkLabel->toHtml(imageName);
if (!autoTitle() && title() != NoteFactory::titleForURL(url().prettyURL()))
link += "<br><i>" + url().prettyURL() + "</i>"; ///
return link;
@@ -2884,7 +2884,7 @@ QString Note::toHtml(const QString &imageName)
case Unknown:
return text();
}
- return QString();
+ return TQString();
}
#endif // #if 0
diff --git a/src/note.h b/src/note.h
index cb249ec..736a7e8 100644
--- a/src/note.h
+++ b/src/note.h
@@ -21,10 +21,10 @@
#ifndef NOTE_H
#define NOTE_H
-#include <qstring.h>
-#include <qpixmap.h>
+#include <tqstring.h>
+#include <tqpixmap.h>
#include <kpixmap.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include "notecontent.h"
#include "tag.h"
@@ -35,8 +35,8 @@ class HtmlExportData;
class NoteSelection;
-class QPainter;
-class QSimpleRichText;
+class TQPainter;
+class TQSimpleRichText;
/** Handle basket notes and groups!\n
* After creation, the note is a group. You should create a NoteContent with this Note
@@ -44,7 +44,7 @@ class QSimpleRichText;
* @code
* Note *note = new Note(basket); // note is a group!
* new TextContent(note, fileName); // note is now a note with a text content!
- * new ColorContent(note, Qt::red); // Should never be done!!!!! the old Content should be deleted...
+ * new ColorContent(note, TQt::red); // Should never be done!!!!! the old Content should be deleted...
* @endcode
* @author S�astien Laot
*/
@@ -52,7 +52,7 @@ class Note
{
/// CONSTRUCTOR AND DESTRUCTOR:
public:
- Note(Basket *parent);
+ Note(Basket *tqparent);
~Note();
/// DOUBLY LINKED LIST:
@@ -74,7 +74,7 @@ class Note
// int m_minContentWidth;
public:
void setWidth(int width);
- void setWidthForceRelayout(int width);
+ void setWidthForceRetqlayout(int width);
void setInitialHeight(int height) { m_height = height; } /// << Do NEVER use it unless you know what you do!
void setX(int x);
void setY(int y);
@@ -85,15 +85,15 @@ class Note
inline int width() { return (isGroup() ? (isColumn() ? 0 : GROUP_WIDTH) : m_width); }
inline int height() { return m_height; }
inline int bottom() { return m_y + m_height - 1; }
- QRect rect();
- QRect resizerRect();
- QRect visibleRect();
- void relayoutAt(int x, int y, bool animate);
+ TQRect rect();
+ TQRect resizerRect();
+ TQRect visibleRect();
+ void retqlayoutAt(int x, int y, bool animate);
int contentX();
int minWidth();
int minRight();
void unsetWidth();
- void requestRelayout();
+ void requestRetqlayout();
void setHeight(int height) { m_height = height; } /// << DO NEVER USE IT!!! Only available when moving notes, groups should be recreated with the exact same state as before!
/// FREE AND COLUMN LAYOUTS MANAGEMENT:
@@ -118,7 +118,7 @@ class Note
inline bool isGroup() { return m_content == 0L; }
inline bool isFolded() { return m_isFolded; }
inline Note* firstChild() { return m_firstChild; }
- inline Note* parentNote() { return m_parentNote; }
+ inline Note* tqparentNote() { return m_parentNote; }
/*inline*/ bool showSubNotes();// { return !m_isFolded || !m_collapseFinished; }
inline void setParentNote(Note *note) { m_parentNote = note; }
inline void setFirstChild(Note *note) { m_firstChild = note; }
@@ -131,25 +131,25 @@ class Note
Note* lastSibling();
int yExpander();
bool isAfter(Note *note);
- bool contains(Note *note);
+ bool tqcontains(Note *note);
/// NOTES VARIOUS PROPERTIES: // CONTENT MANAGEMENT?
private:
Basket *m_basket;
NoteContent *m_content;
- QDateTime m_addedDate;
- QDateTime m_lastModificationDate;
+ TQDateTime m_addedDate;
+ TQDateTime m_lastModificationDate;
public:
inline Basket* basket() { return m_basket; }
inline NoteContent* content() { return m_content; }
- inline void setAddedDate(const QDateTime &dateTime) { m_addedDate = dateTime; }
- inline void setLastModificationDate(const QDateTime &dateTime) { m_lastModificationDate = dateTime; }
+ inline void setAddedDate(const TQDateTime &dateTime) { m_addedDate = dateTime; }
+ inline void setLastModificationDate(const TQDateTime &dateTime) { m_lastModificationDate = dateTime; }
inline void setParentBasket(Basket *basket) { m_basket = basket; }
- QDateTime addedDate() { return m_addedDate; }
- QDateTime lastModificationDate() { return m_lastModificationDate; }
- QString addedStringDate();
- QString lastModificationStringDate();
- QString toText(const QString &cuttedFullPath);
+ TQDateTime addedDate() { return m_addedDate; }
+ TQDateTime lastModificationDate() { return m_lastModificationDate; }
+ TQString addedStringDate();
+ TQString lastModificationStringDate();
+ TQString toText(const TQString &cuttedFullPath);
bool saveAgain();
void deleteChilds();
@@ -160,26 +160,26 @@ class Note
/// DRAWING:
private:
- QPixmap m_bufferedPixmap;
+ TQPixmap m_bufferedPixmap;
KPixmap m_bufferedSelectionPixmap;
public:
- void draw(QPainter *painter, const QRect &clipRect);
- void drawBufferOnScreen(QPainter *painter, const QPixmap &contentPixmap);
- static void getGradientColors(const QColor &originalBackground, QColor *colorTop, QColor *colorBottom);
- static void drawExpander(QPainter *painter, int x, int y, const QColor &background, bool expand, Basket *basket);
- void drawHandle( QPainter *painter, int x, int y, int width, int height, const QColor &background, const QColor &foreground);
- void drawResizer( QPainter *painter, int x, int y, int width, int height, const QColor &background, const QColor &foreground, bool rounded);
- void drawRoundings(QPainter *painter, int x, int y, int type, int width = 0, int height = 0);
+ void draw(TQPainter *painter, const TQRect &clipRect);
+ void drawBufferOnScreen(TQPainter *painter, const TQPixmap &contentPixmap);
+ static void getGradientColors(const TQColor &originalBackground, TQColor *colorTop, TQColor *colorBottom);
+ static void drawExpander(TQPainter *painter, int x, int y, const TQColor &background, bool expand, Basket *basket);
+ void drawHandle( TQPainter *painter, int x, int y, int width, int height, const TQColor &background, const TQColor &foreground);
+ void drawResizer( TQPainter *painter, int x, int y, int width, int height, const TQColor &background, const TQColor &foreground, bool rounded);
+ void drawRoundings(TQPainter *painter, int x, int y, int type, int width = 0, int height = 0);
void unbufferizeAll();
void bufferizeSelectionPixmap();
inline void unbufferize() { m_bufferedPixmap.resize(0, 0); m_bufferedSelectionPixmap.resize(0, 0); }
inline bool isBufferized() { return !m_bufferedPixmap.isNull(); }
- void recomputeBlankRects(QValueList<QRect> &blankAreas);
- static void drawInactiveResizer(QPainter *painter, int x, int y, int height, const QColor &background, bool column);
+ void recomputeBlankRects(TQValueList<TQRect> &blankAreas);
+ static void drawInactiveResizer(TQPainter *painter, int x, int y, int height, const TQColor &background, bool column);
/// VISIBLE AREAS COMPUTATION:
private:
- QValueList<QRect> m_areas;
+ TQValueList<TQRect> m_areas;
bool m_computedAreas;
bool m_onTop;
void recomputeAreas();
@@ -224,10 +224,10 @@ class Note
void setHoveredZone(Zone zone);
inline bool hovered() { return m_hovered; }
inline Zone hoveredZone() { return m_hoveredZone; }
- Zone zoneAt(const QPoint &pos, bool toAdd = false);
- QRect zoneRect(Zone zone, const QPoint &pos);
+ Zone zoneAt(const TQPoint &pos, bool toAdd = false);
+ TQRect zoneRect(Zone zone, const TQPoint &pos);
void setCursor(Zone zone);
- QString linkAt(const QPoint &pos);
+ TQString linkAt(const TQPoint &pos);
private:
bool m_hovered;
Zone m_hoveredZone;
@@ -238,7 +238,7 @@ class Note
void setSelected(bool selected);
void setSelectedRecursivly(bool selected);
void invertSelectionRecursivly();
- void selectIn(const QRect &rect, bool invertSelection, bool unselectOthers = true);
+ void selectIn(const TQRect &rect, bool invertSelection, bool unselectOthers = true);
void setFocused(bool focused);
inline bool isFocused() { return m_focused; }
inline bool isSelected() { return m_selected; }
@@ -280,10 +280,10 @@ class Note
bool stateForTagFromSelectedNotes(Tag *tag, State **state);
void recomputeStyle();
void recomputeAllStyles();
- bool removedStates(const QValueList<State*> &deletedStates);
- QFont font(); // Computed!
- QColor backgroundColor(); // Computed!
- QColor textColor(); // Computed!
+ bool removedStates(const TQValueList<State*> &deletedStates);
+ TQFont font(); // Computed!
+ TQColor backgroundColor(); // Computed!
+ TQColor textColor(); // Computed!
/// FILTERING:
private:
@@ -299,15 +299,15 @@ class Note
int count();
int countDirectChilds();
- QString fullPath();
- Note* noteForFullPath(const QString &path);
+ TQString fullPath();
+ Note* noteForFullPath(const TQString &path);
void update();
void linkLookChanged();
- void usedStates(QValueList<State*> &states);
+ void usedStates(TQValueList<State*> &states);
- void listUsedTags(QValueList<Tag*> &list);
+ void listUsedTags(TQValueList<Tag*> &list);
Note* nextInStack();
@@ -315,7 +315,7 @@ class Note
Note* nextShownInStack();
Note* prevShownInStack();
- Note* parentPrimaryNote(); // TODO: There are places in the code where this methods is hand-copied / hand-inlined instead of called.
+ Note* tqparentPrimaryNote(); // TODO: There are places in the code where this methods is hand-copied / hand-inlined instead of called.
Note* firstSelected();
Note* lastSelected();
diff --git a/src/notecontent.cpp b/src/notecontent.cpp
index 39d4688..38f01cd 100644
--- a/src/notecontent.cpp
+++ b/src/notecontent.cpp
@@ -18,16 +18,16 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qfile.h>
-#include <qdir.h>
-#include <qdom.h>
-#include <qpainter.h>
-#include <qstylesheet.h>
-#include <qfontmetrics.h>
-#include <qwidget.h>
-#include <qcursor.h>
-#include <qstringlist.h>
-#include <qbuffer.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqdom.h>
+#include <tqpainter.h>
+#include <tqstylesheet.h>
+#include <tqfontmetrics.h>
+#include <tqwidget.h>
+#include <tqcursor.h>
+#include <tqstringlist.h>
+#include <tqbuffer.h>
#include <ktextedit.h>
#include <kservice.h>
#include <kcolordialog.h>
@@ -35,14 +35,14 @@
#include <klocale.h>
#include <kglobalsettings.h>
#include <kpixmapeffect.h>
-#include <qbitmap.h>
+#include <tqbitmap.h>
#include <kurifilter.h>
//#include <kstringhandler.h>
#include <kfilemetainfo.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include <kmultipledrag.h>
-#include <qfileinfo.h>
+#include <tqfileinfo.h>
//#include <kio/kfileitem.h>
#include <kfileitem.h>
#include <kio/previewjob.h>
@@ -80,27 +80,27 @@
const int NoteContent::FEEDBACK_DARKING = 105;
-NoteContent::NoteContent(Note *parent, const QString &fileName)
- : m_note(parent)
+NoteContent::NoteContent(Note *tqparent, const TQString &fileName)
+ : m_note(tqparent)
{
- parent->setContent(this);
+ tqparent->setContent(this);
setFileName(fileName);
}
-void NoteContent::saveToNode(QDomDocument &doc, QDomElement &content)
+void NoteContent::saveToNode(TQDomDocument &doc, TQDomElement &content)
{
if (useFile()) {
- QDomText textNode = doc.createTextNode(fileName());
+ TQDomText textNode = doc.createTextNode(fileName());
content.appendChild(textNode);
}
}
-QRect NoteContent::zoneRect(int zone, const QPoint &/*pos*/)
+TQRect NoteContent::zoneRect(int zone, const TQPoint &/*pos*/)
{
if (zone == Note::Content)
- return QRect(0, 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
+ return TQRect(0, 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
else
- return QRect();
+ return TQRect();
}
KURL NoteContent::urlToOpen(bool /*with*/)
@@ -108,16 +108,16 @@ KURL NoteContent::urlToOpen(bool /*with*/)
return (useFile() ? KURL(fullPath()) : KURL());
}
-void NoteContent::setFileName(const QString &fileName)
+void NoteContent::setFileName(const TQString &fileName)
{
m_fileName = fileName;
}
-bool NoteContent::trySetFileName(const QString &fileName)
+bool NoteContent::trySetFileName(const TQString &fileName)
{
if (useFile() && fileName != m_fileName) {
- QString newFileName = Tools::fileNameForNewFile(fileName, basket()->fullPath());
- QDir dir;
+ TQString newFileName = Tools::fileNameForNewFile(fileName, basket()->fullPath());
+ TQDir dir;
dir.rename(fullPath(), basket()->fullPathForFileName(newFileName));
return true;
}
@@ -125,7 +125,7 @@ bool NoteContent::trySetFileName(const QString &fileName)
return false; // !useFile() or unsuccesful rename
}
-QString NoteContent::fullPath()
+TQString NoteContent::fullPath()
{
if (note() && useFile())
return note()->fullPath();
@@ -138,7 +138,7 @@ void NoteContent::contentChanged(int newMinWidth)
m_minWidth = newMinWidth;
if (note()) {
// note()->unbufferize();
- note()->requestRelayout(); // TODO: It should re-set the width! m_width = 0 ? contentChanged: setWidth, geteight, if size havent changed, only repaint and not relayout
+ note()->requestRetqlayout(); // TODO: It should re-set the width! m_width = 0 ? contentChanged: setWidth, geteight, if size havent changed, only tqrepaint and not retqlayout
}
}
@@ -152,7 +152,7 @@ Basket* NoteContent::basket()
void NoteContent::setEdited()
{
- note()->setLastModificationDate(QDateTime::currentDateTime());
+ note()->setLastModificationDate(TQDateTime::tqcurrentDateTime());
basket()->save();
}
@@ -170,36 +170,36 @@ NoteType::Id LauncherContent::type() { return NoteType::Launcher; }
NoteType::Id ColorContent::type() { return NoteType::Color; }
NoteType::Id UnknownContent::type() { return NoteType::Unknown; }
-QString TextContent::typeName() { return i18n("Plain Text"); }
-QString HtmlContent::typeName() { return i18n("Text"); }
-QString ImageContent::typeName() { return i18n("Image"); }
-QString AnimationContent::typeName() { return i18n("Animation"); }
-QString SoundContent::typeName() { return i18n("Sound"); }
-QString FileContent::typeName() { return i18n("File"); }
-QString LinkContent::typeName() { return i18n("Link"); }
-QString LauncherContent::typeName() { return i18n("Launcher"); }
-QString ColorContent::typeName() { return i18n("Color"); }
-QString UnknownContent::typeName() { return i18n("Unknown"); }
-
-QString TextContent::lowerTypeName() { return "text"; }
-QString HtmlContent::lowerTypeName() { return "html"; }
-QString ImageContent::lowerTypeName() { return "image"; }
-QString AnimationContent::lowerTypeName() { return "animation"; }
-QString SoundContent::lowerTypeName() { return "sound"; }
-QString FileContent::lowerTypeName() { return "file"; }
-QString LinkContent::lowerTypeName() { return "link"; }
-QString LauncherContent::lowerTypeName() { return "launcher"; }
-QString ColorContent::lowerTypeName() { return "color"; }
-QString UnknownContent::lowerTypeName() { return "unknown"; }
-
-QString NoteContent::toText(const QString &cuttedFullPath)
+TQString TextContent::typeName() { return i18n("Plain Text"); }
+TQString HtmlContent::typeName() { return i18n("Text"); }
+TQString ImageContent::typeName() { return i18n("Image"); }
+TQString AnimationContent::typeName() { return i18n("Animation"); }
+TQString SoundContent::typeName() { return i18n("Sound"); }
+TQString FileContent::typeName() { return i18n("File"); }
+TQString LinkContent::typeName() { return i18n("Link"); }
+TQString LauncherContent::typeName() { return i18n("Launcher"); }
+TQString ColorContent::typeName() { return i18n("Color"); }
+TQString UnknownContent::typeName() { return i18n("Unknown"); }
+
+TQString TextContent::lowerTypeName() { return "text"; }
+TQString HtmlContent::lowerTypeName() { return "html"; }
+TQString ImageContent::lowerTypeName() { return "image"; }
+TQString AnimationContent::lowerTypeName() { return "animation"; }
+TQString SoundContent::lowerTypeName() { return "sound"; }
+TQString FileContent::lowerTypeName() { return "file"; }
+TQString LinkContent::lowerTypeName() { return "link"; }
+TQString LauncherContent::lowerTypeName() { return "launcher"; }
+TQString ColorContent::lowerTypeName() { return "color"; }
+TQString UnknownContent::lowerTypeName() { return "unknown"; }
+
+TQString NoteContent::toText(const TQString &cuttedFullPath)
{
return (cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath);
}
-QString TextContent::toText(const QString &/*cuttedFullPath*/) { return text(); }
-QString HtmlContent::toText(const QString &/*cuttedFullPath*/) { return Tools::htmlToText(html()); }
-QString LinkContent::toText(const QString &/*cuttedFullPath*/)
+TQString TextContent::toText(const TQString &/*cuttedFullPath*/) { return text(); }
+TQString HtmlContent::toText(const TQString &/*cuttedFullPath*/) { return Tools::htmlToText(html()); }
+TQString LinkContent::toText(const TQString &/*cuttedFullPath*/)
{
if (autoTitle())
return url().prettyURL();
@@ -210,70 +210,70 @@ QString LinkContent::toText(const QString &/*cuttedFullPath*/)
else if (title().isEmpty())
return url().prettyURL();
else
- return QString("%1 <%2>").arg(title(), url().prettyURL());
+ return TQString("%1 <%2>").tqarg(title(), url().prettyURL());
}
-QString ColorContent::toText(const QString &/*cuttedFullPath*/) { return color().name(); }
-QString UnknownContent::toText(const QString &/*cuttedFullPath*/) { return ""; }
+TQString ColorContent::toText(const TQString &/*cuttedFullPath*/) { return color().name(); }
+TQString UnknownContent::toText(const TQString &/*cuttedFullPath*/) { return ""; }
// TODO: If imageName.isEmpty() return fullPath() because it's for external use, else return fileName() because it's to display in a tooltip
-QString TextContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/)
+TQString TextContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/)
{ return Tools::textToHTMLWithoutP(text()); }
-QString HtmlContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/)
+TQString HtmlContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/)
{ return Tools::htmlToParagraph(html()); }
-QString ImageContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath)
-{ return QString("<img src=\"%1\">").arg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); }
+TQString ImageContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath)
+{ return TQString("<img src=\"%1\">").tqarg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); }
-QString AnimationContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath)
-{ return QString("<img src=\"%1\">").arg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); }
+TQString AnimationContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath)
+{ return TQString("<img src=\"%1\">").tqarg(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath); }
-QString SoundContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath)
-{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon?
+TQString SoundContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath)
+{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon?
-QString FileContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath)
-{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon?
+TQString FileContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath)
+{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), fileName()); } // With the icon?
-QString LinkContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/)
-{ return QString("<a href=\"%1\">%2</a>").arg(url().prettyURL(), title()); } // With the icon?
+TQString LinkContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/)
+{ return TQString("<a href=\"%1\">%2</a>").tqarg(url().prettyURL(), title()); } // With the icon?
-QString LauncherContent::toHtml(const QString &/*imageName*/, const QString &cuttedFullPath)
-{ return QString("<a href=\"%1\">%2</a>").arg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), name()); } // With the icon?
+TQString LauncherContent::toHtml(const TQString &/*imageName*/, const TQString &cuttedFullPath)
+{ return TQString("<a href=\"%1\">%2</a>").tqarg((cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath), name()); } // With the icon?
-QString ColorContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/)
-{ return QString("<span style=\"color: %1\">%2</span>").arg(color().name(), color().name()); }
+TQString ColorContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/)
+{ return TQString("<span style=\"color: %1\">%2</span>").tqarg(color().name(), color().name()); }
-QString UnknownContent::toHtml(const QString &/*imageName*/, const QString &/*cuttedFullPath*/)
+TQString UnknownContent::toHtml(const TQString &/*imageName*/, const TQString &/*cuttedFullPath*/)
{ return ""; }
-QPixmap ImageContent::toPixmap() { return pixmap(); }
-QPixmap AnimationContent::toPixmap() { return movie().framePixmap(); }
+TQPixmap ImageContent::toPixmap() { return pixmap(); }
+TQPixmap AnimationContent::toPixmap() { return movie().framePixmap(); }
-void NoteContent::toLink(KURL *url, QString *title, const QString &cuttedFullPath)
+void NoteContent::toLink(KURL *url, TQString *title, const TQString &cuttedFullPath)
{
if (useFile()) {
*url = KURL(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath);
*title = (cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath);
} else {
*url = KURL();
- *title = QString();
+ *title = TQString();
}
}
-void LinkContent::toLink(KURL *url, QString *title, const QString &/*cuttedFullPath*/)
+void LinkContent::toLink(KURL *url, TQString *title, const TQString &/*cuttedFullPath*/)
{
*url = this->url();
*title = this->title();
}
-void LauncherContent::toLink(KURL *url, QString *title, const QString &cuttedFullPath)
+void LauncherContent::toLink(KURL *url, TQString *title, const TQString &cuttedFullPath)
{
*url = KURL(cuttedFullPath.isEmpty() ? fullPath() : cuttedFullPath);
*title = name();
}
-void UnknownContent::toLink(KURL *url, QString *title, const QString &/*cuttedFullPath*/)
+void UnknownContent::toLink(KURL *url, TQString *title, const TQString &/*cuttedFullPath*/)
{
*url = KURL();
- *title = QString();
+ *title = TQString();
}
bool TextContent::useFile() { return true; }
@@ -298,49 +298,49 @@ bool LauncherContent::canBeSavedAs() { return true; }
bool ColorContent::canBeSavedAs() { return false; }
bool UnknownContent::canBeSavedAs() { return false; }
-QString TextContent::saveAsFilters() { return "text/plain"; }
-QString HtmlContent::saveAsFilters() { return "text/html"; }
-QString ImageContent::saveAsFilters() { return "image/png"; } // TODO: Offer more types
-QString AnimationContent::saveAsFilters() { return "image/gif"; } // TODO: MNG...
-QString SoundContent::saveAsFilters() { return "audio/x-mp3"; } // TODO: OGG...
-QString FileContent::saveAsFilters() { return "*"; } // TODO: Get MIME type of the url target
-QString LinkContent::saveAsFilters() { return "*"; } // TODO: idem File + If isDir(): return
-QString LauncherContent::saveAsFilters() { return "application/x-desktop"; }
-QString ColorContent::saveAsFilters() { return ""; }
-QString UnknownContent::saveAsFilters() { return ""; }
-
-bool TextContent::match(const FilterData &data) { return (text().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
-bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.find(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER
+TQString TextContent::saveAsFilters() { return "text/plain"; }
+TQString HtmlContent::saveAsFilters() { return "text/html"; }
+TQString ImageContent::saveAsFilters() { return "image/png"; } // TODO: Offer more types
+TQString AnimationContent::saveAsFilters() { return "image/gif"; } // TODO: MNG...
+TQString SoundContent::saveAsFilters() { return "audio/x-mp3"; } // TODO: OGG...
+TQString FileContent::saveAsFilters() { return "*"; } // TODO: Get MIME type of the url target
+TQString LinkContent::saveAsFilters() { return "*"; } // TODO: idem File + If isDir(): return
+TQString LauncherContent::saveAsFilters() { return "application/x-desktop"; }
+TQString ColorContent::saveAsFilters() { return ""; }
+TQString UnknownContent::saveAsFilters() { return ""; }
+
+bool TextContent::match(const FilterData &data) { return (text().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); }
+bool HtmlContent::match(const FilterData &data) { return (m_textEquivalent/*toText("")*/.tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); } //OPTIM_FILTER
bool ImageContent::match(const FilterData &/*data*/) { return false; }
bool AnimationContent::match(const FilterData &/*data*/) { return false; }
-bool SoundContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
-bool FileContent::match(const FilterData &data) { return (fileName().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
-bool LinkContent::match(const FilterData &data) { return (title().find(data.string, 0, false) != -1 || url().prettyURL().find(data.string, 0, false) != -1); }
-bool LauncherContent::match(const FilterData &data) { return (exec().find(data.string, 0, false) != -1 || name().find(data.string, 0, false) != -1); }
-bool ColorContent::match(const FilterData &data) { return (color().name().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
-bool UnknownContent::match(const FilterData &data) { return (mimeTypes().find(data.string, /*index=*/0, /*cs=*/false) != -1); }
-
-QString TextContent::editToolTipText() { return i18n("Edit this plain text"); }
-QString HtmlContent::editToolTipText() { return i18n("Edit this text"); }
-QString ImageContent::editToolTipText() { return i18n("Edit this image"); }
-QString AnimationContent::editToolTipText() { return i18n("Edit this animation"); }
-QString SoundContent::editToolTipText() { return i18n("Edit the file name of this sound"); }
-QString FileContent::editToolTipText() { return i18n("Edit the name of this file"); }
-QString LinkContent::editToolTipText() { return i18n("Edit this link"); }
-QString LauncherContent::editToolTipText() { return i18n("Edit this launcher"); }
-QString ColorContent::editToolTipText() { return i18n("Edit this color"); }
-QString UnknownContent::editToolTipText() { return i18n("Edit this unknown object"); }
-
-QString TextContent::cssClass() { return ""; }
-QString HtmlContent::cssClass() { return ""; }
-QString ImageContent::cssClass() { return ""; }
-QString AnimationContent::cssClass() { return ""; }
-QString SoundContent::cssClass() { return "sound"; }
-QString FileContent::cssClass() { return "file"; }
-QString LinkContent::cssClass() { return (LinkLook::lookForURL(m_url) == LinkLook::localLinkLook ? "local" : "network"); }
-QString LauncherContent::cssClass() { return "launcher"; }
-QString ColorContent::cssClass() { return "" ; }
-QString UnknownContent::cssClass() { return ""; }
+bool SoundContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); }
+bool FileContent::match(const FilterData &data) { return (fileName().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); }
+bool LinkContent::match(const FilterData &data) { return (title().tqfind(data.string, 0, false) != -1 || url().prettyURL().tqfind(data.string, 0, false) != -1); }
+bool LauncherContent::match(const FilterData &data) { return (exec().tqfind(data.string, 0, false) != -1 || name().tqfind(data.string, 0, false) != -1); }
+bool ColorContent::match(const FilterData &data) { return (TQString(color().name()).tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); }
+bool UnknownContent::match(const FilterData &data) { return (mimeTypes().tqfind(data.string, /*index=*/0, /*cs=*/false) != -1); }
+
+TQString TextContent::editToolTipText() { return i18n("Edit this plain text"); }
+TQString HtmlContent::editToolTipText() { return i18n("Edit this text"); }
+TQString ImageContent::editToolTipText() { return i18n("Edit this image"); }
+TQString AnimationContent::editToolTipText() { return i18n("Edit this animation"); }
+TQString SoundContent::editToolTipText() { return i18n("Edit the file name of this sound"); }
+TQString FileContent::editToolTipText() { return i18n("Edit the name of this file"); }
+TQString LinkContent::editToolTipText() { return i18n("Edit this link"); }
+TQString LauncherContent::editToolTipText() { return i18n("Edit this launcher"); }
+TQString ColorContent::editToolTipText() { return i18n("Edit this color"); }
+TQString UnknownContent::editToolTipText() { return i18n("Edit this unknown object"); }
+
+TQString TextContent::cssClass() { return ""; }
+TQString HtmlContent::cssClass() { return ""; }
+TQString ImageContent::cssClass() { return ""; }
+TQString AnimationContent::cssClass() { return ""; }
+TQString SoundContent::cssClass() { return "sound"; }
+TQString FileContent::cssClass() { return "file"; }
+TQString LinkContent::cssClass() { return (LinkLook::lookForURL(m_url) == LinkLook::localLinkLook ? "local" : "network"); }
+TQString LauncherContent::cssClass() { return "launcher"; }
+TQString ColorContent::cssClass() { return "" ; }
+TQString UnknownContent::cssClass() { return ""; }
void TextContent::fontChanged() { setText(text()); }
void HtmlContent::fontChanged() { setHtml(html()); }
@@ -352,64 +352,64 @@ void LauncherContent::fontChanged() { setLauncher(name(), icon(), exec());
void ColorContent::fontChanged() { setColor(color()); }
void UnknownContent::fontChanged() { loadFromFile(/*lazyLoad=*/false); } // TODO: Optimize: setMimeTypes()
-//QString TextContent::customOpenCommand() { return (Settings::isTextUseProg() && ! Settings::textProg().isEmpty() ? Settings::textProg() : QString()); }
-QString HtmlContent::customOpenCommand() { return (Settings::isHtmlUseProg() && ! Settings::htmlProg().isEmpty() ? Settings::htmlProg() : QString()); }
-QString ImageContent::customOpenCommand() { return (Settings::isImageUseProg() && ! Settings::imageProg().isEmpty() ? Settings::imageProg() : QString()); }
-QString AnimationContent::customOpenCommand() { return (Settings::isAnimationUseProg() && ! Settings::animationProg().isEmpty() ? Settings::animationProg() : QString()); }
-QString SoundContent::customOpenCommand() { return (Settings::isSoundUseProg() && ! Settings::soundProg().isEmpty() ? Settings::soundProg() : QString()); }
+//TQString TextContent::customOpenCommand() { return (Settings::isTextUseProg() && ! Settings::textProg().isEmpty() ? Settings::textProg() : TQString()); }
+TQString HtmlContent::customOpenCommand() { return (Settings::isHtmlUseProg() && ! Settings::htmlProg().isEmpty() ? Settings::htmlProg() : TQString()); }
+TQString ImageContent::customOpenCommand() { return (Settings::isImageUseProg() && ! Settings::imageProg().isEmpty() ? Settings::imageProg() : TQString()); }
+TQString AnimationContent::customOpenCommand() { return (Settings::isAnimationUseProg() && ! Settings::animationProg().isEmpty() ? Settings::animationProg() : TQString()); }
+TQString SoundContent::customOpenCommand() { return (Settings::isSoundUseProg() && ! Settings::soundProg().isEmpty() ? Settings::soundProg() : TQString()); }
-void LinkContent::serialize(QDataStream &stream) { stream << url() << title() << icon() << (Q_UINT64)autoTitle() << (Q_UINT64)autoIcon(); }
-void ColorContent::serialize(QDataStream &stream) { stream << color(); }
+void LinkContent::serialize(TQDataStream &stream) { stream << url() << title() << icon() << (TQ_UINT64)autoTitle() << (TQ_UINT64)autoIcon(); }
+void ColorContent::serialize(TQDataStream &stream) { stream << color(); }
-QPixmap TextContent::feedbackPixmap(int width, int height)
+TQPixmap TextContent::feedbackPixmap(int width, int height)
{
- QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, width, height, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, text());
- QPixmap pixmap( QMIN(width, textRect.width()), QMIN(height, textRect.height()) );
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, width, height, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, text());
+ TQPixmap pixmap( TQMIN(width, textRect.width()), TQMIN(height, textRect.height()) );
pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPainter painter(&pixmap);
+ TQPainter painter(&pixmap);
painter.setPen(note()->textColor());
painter.setFont(note()->font());
- painter.drawText(0, 0, pixmap.width(), pixmap.height(), Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, text());
+ painter.drawText(0, 0, pixmap.width(), pixmap.height(), TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, text());
painter.end();
return pixmap;
}
-QPixmap HtmlContent::feedbackPixmap(int width, int height)
+TQPixmap HtmlContent::feedbackPixmap(int width, int height)
{
- QSimpleRichText richText(html(), note()->font());
+ TQSimpleRichText richText(html(), note()->font());
richText.setWidth(width);
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPixmap pixmap( QMIN(width, richText.widthUsed()), QMIN(height, richText.height()) );
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ TQPixmap pixmap( TQMIN(width, richText.widthUsed()), TQMIN(height, richText.height()) );
pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPainter painter(&pixmap);
+ TQPainter painter(&pixmap);
painter.setPen(note()->textColor());
- richText.draw(&painter, 0, 0, QRect(0, 0, pixmap.width(), pixmap.height()), colorGroup);
+ richText.draw(&painter, 0, 0, TQRect(0, 0, pixmap.width(), pixmap.height()), tqcolorGroup);
painter.end();
return pixmap;
}
-QPixmap ImageContent::feedbackPixmap(int width, int height)
+TQPixmap ImageContent::feedbackPixmap(int width, int height)
{
if (width >= m_pixmap.width() && height >= m_pixmap.height()) { // Full size
if (m_pixmap.hasAlpha()) {
- QPixmap opaque(m_pixmap.width(), m_pixmap.height());
+ TQPixmap opaque(m_pixmap.width(), m_pixmap.height());
opaque.fill(note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPainter painter(&opaque);
+ TQPainter painter(&opaque);
painter.drawPixmap(0, 0, m_pixmap);
painter.end();
return opaque;
} else
return m_pixmap;
} else { // Scalled down
- QImage imageToScale = m_pixmap.convertToImage();
- QPixmap pmScaled;
- pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, QImage::ScaleMin));
+ TQImage imageToScale = m_pixmap.convertToImage();
+ TQPixmap pmScaled;
+ pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, TQ_ScaleMin));
if (pmScaled.hasAlpha()) {
- QPixmap opaque(pmScaled.width(), pmScaled.height());
+ TQPixmap opaque(pmScaled.width(), pmScaled.height());
opaque.fill(note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPainter painter(&opaque);
+ TQPainter painter(&opaque);
painter.drawPixmap(0, 0, pmScaled);
painter.end();
return opaque;
@@ -418,73 +418,73 @@ QPixmap ImageContent::feedbackPixmap(int width, int height)
}
}
-QPixmap AnimationContent::feedbackPixmap(int width, int height)
+TQPixmap AnimationContent::feedbackPixmap(int width, int height)
{
- QPixmap pixmap = m_movie.framePixmap();
+ TQPixmap pixmap = m_movie.framePixmap();
if (width >= pixmap.width() && height >= pixmap.height()) // Full size
return pixmap;
else { // Scalled down
- QImage imageToScale = pixmap.convertToImage();
- QPixmap pmScaled;
- pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, QImage::ScaleMin));
+ TQImage imageToScale = pixmap.convertToImage();
+ TQPixmap pmScaled;
+ pmScaled.convertFromImage(imageToScale./*smoothScale*/scale(width, height, TQ_ScaleMin));
return pmScaled;
}
}
-QPixmap LinkContent::feedbackPixmap(int width, int height)
+TQPixmap LinkContent::feedbackPixmap(int width, int height)
{
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
}
-QPixmap ColorContent::feedbackPixmap(int width, int height)
+TQPixmap ColorContent::feedbackPixmap(int width, int height)
{
// TODO: Duplicate code: make a rect() method!
- QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name());
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name());
int rectHeight = (textRect.height() + 2)*3/2;
int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers.
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPixmap pixmap( QMIN(width, rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN), QMIN(height, rectHeight) );
+ TQPixmap pixmap( TQMIN(width, rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN), TQMIN(height, rectHeight) );
pixmap.fill(note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPainter painter(&pixmap);
- paint(&painter, pixmap.width(), pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters.
+ TQPainter painter(&pixmap);
+ paint(&painter, pixmap.width(), pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters.
painter.end();
return pixmap;
}
-QPixmap FileContent::feedbackPixmap(int width, int height)
+TQPixmap FileContent::feedbackPixmap(int width, int height)
{
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
}
-QPixmap LauncherContent::feedbackPixmap(int width, int height)
+TQPixmap LauncherContent::feedbackPixmap(int width, int height)
{
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- return m_linkDisplay.feedbackPixmap(width, height, colorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ return m_linkDisplay.feedbackPixmap(width, height, tqcolorGroup, /*isDefaultColor=*/note()->textColor() == basket()->textColor());
}
-QPixmap UnknownContent::feedbackPixmap(int width, int height)
+TQPixmap UnknownContent::feedbackPixmap(int width, int height)
{
- QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes);
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes);
- QColorGroup colorGroup(basket()->colorGroup());
- colorGroup.setColor(QColorGroup::Text, note()->textColor());
- colorGroup.setColor(QColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
+ TQColorGroup tqcolorGroup(basket()->tqcolorGroup());
+ tqcolorGroup.setColor(TQColorGroup::Text, note()->textColor());
+ tqcolorGroup.setColor(TQColorGroup::Background, note()->backgroundColor().dark(FEEDBACK_DARKING));
- QPixmap pixmap( QMIN(width, DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN), QMIN(height, DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN) );
- QPainter painter(&pixmap);
- paint(&painter, pixmap.width() + 1, pixmap.height(), colorGroup, false, false, false); // We don't care of the three last boolean parameters.
+ TQPixmap pixmap( TQMIN(width, DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN), TQMIN(height, DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN) );
+ TQPainter painter(&pixmap);
+ paint(&painter, pixmap.width() + 1, pixmap.height(), tqcolorGroup, false, false, false); // We don't care of the three last boolean parameters.
painter.setPen(note()->backgroundColor().dark(FEEDBACK_DARKING));
painter.drawPoint(0, 0);
painter.drawPoint(pixmap.width() - 1, 0);
@@ -498,8 +498,8 @@ QPixmap UnknownContent::feedbackPixmap(int width, int height)
/** class TextContent:
*/
-TextContent::TextContent(Note *parent, const QString &fileName, bool lazyLoad)
- : NoteContent(parent, fileName), m_simpleRichText(0)
+TextContent::TextContent(Note *tqparent, const TQString &fileName, bool lazyLoad)
+ : NoteContent(tqparent, fileName), m_simpleRichText(0)
{
basket()->addWatchedFile(fullPath());
loadFromFile(lazyLoad);
@@ -520,11 +520,11 @@ int TextContent::setWidthAndGetHeight(int width)
return 10; // Lazy loaded
}
-void TextContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void TextContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
if (m_simpleRichText) {
width -= 1;
- m_simpleRichText->draw(painter, 0, 0, QRect(0, 0, width, height), colorGroup);
+ m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup);
}
}
@@ -532,7 +532,7 @@ bool TextContent::loadFromFile(bool lazyLoad)
{
DEBUG_WIN << "Loading TextContent From " + basket()->folderName() + fileName();
- QString content;
+ TQString content;
bool success = basket()->loadFromFile(fullPath(), &content, /*isLocalEncoding=*/true);
if (success)
@@ -540,7 +540,7 @@ bool TextContent::loadFromFile(bool lazyLoad)
else {
std::cout << "FAILED TO LOAD TextContent: " << fullPath() << std::endl;
setText("", lazyLoad);
- if (!QFile::exists(fullPath()))
+ if (!TQFile::exists(fullPath()))
saveToFile(); // Reserve the fileName so no new note will have the same name!
}
return success;
@@ -550,8 +550,8 @@ bool TextContent::finishLazyLoad()
{
int width = (m_simpleRichText ? m_simpleRichText->width() : 1);
delete m_simpleRichText;
- QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::tagURLs(Tools::textToHTML(m_text)); // Don't collapse multiple spaces!
- m_simpleRichText = new QSimpleRichText(html, note()->font());
+ TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::tagURLs(Tools::textToHTML(m_text)); // Don't collapse multiple spaces!
+ m_simpleRichText = new TQSimpleRichText(html, note()->font());
m_simpleRichText->setWidth(1); // We put a width of 1 pixel, so usedWidth() is egual to the minimum width
int minWidth = m_simpleRichText->widthUsed();
m_simpleRichText->setWidth(width);
@@ -565,7 +565,7 @@ bool TextContent::saveToFile()
return basket()->saveToFile(fullPath(), text(), /*isLocalEncoding=*/true);
}
-QString TextContent::linkAt(const QPoint &pos)
+TQString TextContent::linkAt(const TQPoint &pos)
{
if (m_simpleRichText)
return m_simpleRichText->anchorAt(pos);
@@ -574,7 +574,7 @@ QString TextContent::linkAt(const QPoint &pos)
}
-QString TextContent::messageWhenOpenning(OpenMessage where)
+TQString TextContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening plain text...");
@@ -587,7 +587,7 @@ QString TextContent::messageWhenOpenning(OpenMessage where)
}
}
-void TextContent::setText(const QString &text, bool lazyLoad)
+void TextContent::setText(const TQString &text, bool lazyLoad)
{
m_text = text;
if (!lazyLoad)
@@ -598,17 +598,17 @@ void TextContent::setText(const QString &text, bool lazyLoad)
void TextContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString spaces;
- QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" +
- Tools::tagURLs(Tools::textToHTMLWithoutP(text().replace("\t", " "))); // Don't collapse multiple spaces!
- exporter->stream << html.replace(" ", " &nbsp;").replace("\n", "\n" + spaces.fill(' ', indent + 1));
+ TQString spaces;
+ TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" +
+ Tools::tagURLs(Tools::textToHTMLWithoutP(text().tqreplace("\t", " "))); // Don't collapse multiple spaces!
+ exporter->stream << html.tqreplace(" ", " &nbsp;").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1));
}
/** class HtmlContent:
*/
-HtmlContent::HtmlContent(Note *parent, const QString &fileName, bool lazyLoad)
- : NoteContent(parent, fileName), m_simpleRichText(0)
+HtmlContent::HtmlContent(Note *tqparent, const TQString &fileName, bool lazyLoad)
+ : NoteContent(tqparent, fileName), m_simpleRichText(0)
{
basket()->addWatchedFile(fullPath());
loadFromFile(lazyLoad);
@@ -629,11 +629,11 @@ int HtmlContent::setWidthAndGetHeight(int width)
return 10; // Lazy loaded
}
-void HtmlContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void HtmlContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
if (m_simpleRichText) {
width -= 1;
- m_simpleRichText->draw(painter, 0, 0, QRect(0, 0, width, height), colorGroup);
+ m_simpleRichText->draw(painter, 0, 0, TQRect(0, 0, width, height), tqcolorGroup);
}
}
@@ -641,7 +641,7 @@ bool HtmlContent::loadFromFile(bool lazyLoad)
{
DEBUG_WIN << "Loading HtmlContent From " + basket()->folderName() + fileName();
- QString content;
+ TQString content;
bool success = basket()->loadFromFile(fullPath(), &content, /*isLocalEncoding=*/true);
if (success)
@@ -649,7 +649,7 @@ bool HtmlContent::loadFromFile(bool lazyLoad)
else {
std::cout << "FAILED TO LOAD HtmlContent: " << fullPath() << std::endl;
setHtml("", lazyLoad);
- if (!QFile::exists(fullPath()))
+ if (!TQFile::exists(fullPath()))
saveToFile(); // Reserve the fileName so no new note will have the same name!
}
return success;
@@ -659,7 +659,7 @@ bool HtmlContent::finishLazyLoad()
{
int width = (m_simpleRichText ? m_simpleRichText->width() : 1);
delete m_simpleRichText;
- m_simpleRichText = new QSimpleRichText(Tools::tagURLs(m_html), note()->font());
+ m_simpleRichText = new TQSimpleRichText(Tools::tagURLs(m_html), note()->font());
m_simpleRichText->setWidth(1); // We put a width of 1 pixel, so usedWidth() is egual to the minimum width
int minWidth = m_simpleRichText->widthUsed();
m_simpleRichText->setWidth(width);
@@ -673,7 +673,7 @@ bool HtmlContent::saveToFile()
return basket()->saveToFile(fullPath(), html(), /*isLocalEncoding=*/true);
}
-QString HtmlContent::linkAt(const QPoint &pos)
+TQString HtmlContent::linkAt(const TQPoint &pos)
{
if (m_simpleRichText)
return m_simpleRichText->anchorAt(pos);
@@ -682,7 +682,7 @@ QString HtmlContent::linkAt(const QPoint &pos)
}
-QString HtmlContent::messageWhenOpenning(OpenMessage where)
+TQString HtmlContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening text...");
@@ -695,7 +695,7 @@ QString HtmlContent::messageWhenOpenning(OpenMessage where)
}
}
-void HtmlContent::setHtml(const QString &html, bool lazyLoad)
+void HtmlContent::setHtml(const TQString &html, bool lazyLoad)
{
m_html = html;
m_textEquivalent = toText(""); //OPTIM_FILTER
@@ -707,17 +707,17 @@ void HtmlContent::setHtml(const QString &html, bool lazyLoad)
void HtmlContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString spaces;
- exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().replace("\t", " ")))
- .replace(" ", " &nbsp;")
- .replace("\n", "\n" + spaces.fill(' ', indent + 1));
+ TQString spaces;
+ exporter->stream << Tools::htmlToParagraph(Tools::tagURLs(html().tqreplace("\t", " ")))
+ .tqreplace(" ", " &nbsp;")
+ .tqreplace("\n", "\n" + spaces.fill(' ', indent + 1));
}
/** class ImageContent:
*/
-ImageContent::ImageContent(Note *parent, const QString &fileName, bool lazyLoad)
- : NoteContent(parent, fileName), m_format(0)
+ImageContent::ImageContent(Note *tqparent, const TQString &fileName, bool lazyLoad)
+ : NoteContent(tqparent, fileName), m_format(0)
{
basket()->addWatchedFile(fullPath());
loadFromFile(lazyLoad);
@@ -735,7 +735,7 @@ int ImageContent::setWidthAndGetHeight(int width)
}
}
-void ImageContent::paint(QPainter *painter, int width, int /*height*/, const QColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void ImageContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
width -= 1;
// KPixmap pixmap = m_pixmap;
@@ -763,14 +763,14 @@ bool ImageContent::finishLazyLoad()
{
DEBUG_WIN << "Loading ImageContent From " + basket()->folderName() + fileName();
- QByteArray content;
+ TQByteArray content;
if (basket()->loadFromFile(fullPath(), &content))
{
- QBuffer buffer(content);
+ TQBuffer buffer(content);
buffer.open(IO_ReadOnly);
- m_format = (char* /* from const char* */)QImageIO::imageFormat(&buffer); // See QImageIO to know what formats can be supported.
+ m_format = (char* /* from const char* */)TQImageIO::imageFormat(TQT_TQIODEVICE(&buffer)); // See TQImageIO to know what formats can be supported.
buffer.close();
if (m_format) {
m_pixmap.loadFromData(content);
@@ -785,15 +785,15 @@ bool ImageContent::finishLazyLoad()
m_pixmap.fill();
m_pixmap.setMask(m_pixmap.createHeuristicMask());
setPixmap(m_pixmap);
- if (!QFile::exists(fullPath()))
+ if (!TQFile::exists(fullPath()))
saveToFile(); // Reserve the fileName so no new note will have the same name!
return false;
}
bool ImageContent::saveToFile()
{
- QByteArray ba;
- QBuffer buffer(ba);
+ TQByteArray ba;
+ TQBuffer buffer(ba);
buffer.open(IO_WriteOnly);
m_pixmap.save(&buffer, m_format);
@@ -801,13 +801,13 @@ bool ImageContent::saveToFile()
}
-void ImageContent::toolTipInfos(QStringList *keys, QStringList *values)
+void ImageContent::toolTipInfos(TQStringList *keys, TQStringList *values)
{
keys->append(i18n("Size"));
- values->append(i18n("%1 by %2 pixels").arg(QString::number(m_pixmap.width()), QString::number(m_pixmap.height())));
+ values->append(i18n("%1 by %2 pixels").tqarg(TQString::number(m_pixmap.width()), TQString::number(m_pixmap.height())));
}
-QString ImageContent::messageWhenOpenning(OpenMessage where)
+TQString ImageContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening image...");
@@ -820,7 +820,7 @@ QString ImageContent::messageWhenOpenning(OpenMessage where)
}
}
-void ImageContent::setPixmap(const QPixmap &pixmap)
+void ImageContent::setPixmap(const TQPixmap &pixmap)
{
m_pixmap = pixmap;
// Since it's scalled, the height is always greater or equal to the size of the tag emblems (16)
@@ -833,7 +833,7 @@ void ImageContent::exportToHTML(HTMLExporter *exporter, int /*indent*/)
int height = m_pixmap.height();
int contentWidth = note()->width() - note()->contentX() - 1 - Note::NOTE_MARGIN;
- QString imageName = exporter->copyFile(fullPath(), /*createIt=*/true);
+ TQString imageName = exporter->copyFile(fullPath(), /*createIt=*/true);
if (contentWidth <= m_pixmap.width()) { // Scalled down
double scale = ((double)contentWidth) / m_pixmap.width();
@@ -854,8 +854,8 @@ void ImageContent::exportToHTML(HTMLExporter *exporter, int /*indent*/)
int AnimationContent::INVALID_STATUS = -100;
-AnimationContent::AnimationContent(Note *parent, const QString &fileName, bool lazyLoad)
- : NoteContent(parent, fileName), m_oldStatus(INVALID_STATUS)
+AnimationContent::AnimationContent(Note *tqparent, const TQString &fileName, bool lazyLoad)
+ : NoteContent(tqparent, fileName), m_oldtqStatus(INVALID_STATUS)
{
basket()->addWatchedFile(fullPath());
loadFromFile(lazyLoad);
@@ -867,11 +867,11 @@ int AnimationContent::setWidthAndGetHeight(int /*width*/)
return m_movie.framePixmap().height() ; // TODO!!!
}
-void AnimationContent::paint(QPainter *painter, int width, int /*height*/, const QColorGroup &/*colorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void AnimationContent::paint(TQPainter *painter, int width, int /*height*/, const TQColorGroup &/*tqcolorGroup*/, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
/*width -= 1*/;
// DEBUG_WIN << "AnimationContent::paint()";
- const QPixmap &frame = m_movie.framePixmap();
+ const TQPixmap &frame = m_movie.framePixmap();
if (width >= frame.width()) // Full size
painter->drawPixmap(0, 0, frame);
else // Scalled down
@@ -889,14 +889,14 @@ bool AnimationContent::loadFromFile(bool lazyLoad)
bool AnimationContent::finishLazyLoad()
{
DEBUG_WIN << "Loading MovieContent From " + basket()->folderName() + fileName();
-// return setMovie(QMovie(fullPath()));
+// return setMovie(TQMovie(fullPath()));
bool success = false;
- QByteArray content;
+ TQByteArray content;
if (basket()->loadFromFile(fullPath(), &content))
- success = setMovie(QMovie(content, content.size()));
+ success = setMovie(TQMovie(content, content.size()));
if (!success)
- setMovie(QMovie());
+ setMovie(TQMovie());
return success;
}
@@ -907,7 +907,7 @@ bool AnimationContent::saveToFile()
}
-QString AnimationContent::messageWhenOpenning(OpenMessage where)
+TQString AnimationContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening animation...");
@@ -920,79 +920,79 @@ QString AnimationContent::messageWhenOpenning(OpenMessage where)
}
}
-bool AnimationContent::setMovie(const QMovie &movie)
+bool AnimationContent::setMovie(const TQMovie &movie)
{
if (!m_movie.isNull()) {
// Disconnect?
return false;
}
m_movie = movie;
- m_movie.connectUpdate( this, SLOT(movieUpdated(const QRect&)) );
- m_movie.connectResize( this, SLOT(movieResized(const QSize&)) );
- m_movie.connectStatus( this, SLOT(movieStatus(int)) );
+ m_movie.connectUpdate( this, TQT_SLOT(movieUpdated(const TQRect&)) );
+ m_movie.connectResize( this, TQT_SLOT(movieResized(const TQSize&)) );
+ m_movie.connectStatus( this, TQT_SLOT(movietqStatus(int)) );
contentChanged( m_movie.framePixmap().width() + 1 ); // TODO
return true;
}
-void AnimationContent::movieUpdated(const QRect&)
+void AnimationContent::movieUpdated(const TQRect&)
{
note()->unbufferize();
note()->update();
}
-void AnimationContent::movieResized(const QSize&)
+void AnimationContent::movieResized(const TQSize&)
{
- note()->requestRelayout(); // ?
+ note()->requestRetqlayout(); // ?
}
/** When a user drop a .gif file, for instance, we don't know if it is an image
* or an animtion (gif file contain multiple images).
* To determin that, we assume this is an animation and count the number of images.
- * QMovie send, in this order:
- * - For a unique image: QMovie::EndOfFrame, QMovie::EndOfLoop, QMovie::EndOfMovie.
- * - For animation: QMovie::EndOfFrame... (for each image), QMovie::EndOfLoop,
+ * TQMovie send, in this order:
+ * - For a unique image: TQMovie::EndOfFrame, TQMovie::EndOfLoop, TQMovie::EndOfMovie.
+ * - For animation: TQMovie::EndOfFrame... (for each image), TQMovie::EndOfLoop,
* and it then restart that for each loop.
*/
-void AnimationContent::movieStatus(int status)
+void AnimationContent::movietqStatus(int status)
{
- DEBUG_WIN << "movieStatus()";
+ DEBUG_WIN << "movietqStatus()";
// At least two frames: it's an animation, everything is OK
- if (m_oldStatus == QMovie::EndOfFrame && status == QMovie::EndOfFrame) {
+ if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfFrame) {
movie().disconnectStatus(this);
- m_oldStatus = INVALID_STATUS;
+ m_oldtqStatus = INVALID_STATUS;
// if (note()->isFocused()) // When inserting a new note we ensure it visble
// basket()->ensureNoteVisible(note()); // But after loading it has certainly grown and if it was
}
// Only one image: it's an image, change note's type
- else if (m_oldStatus == QMovie::EndOfFrame && status == QMovie::EndOfLoop) {
+ else if (m_oldtqStatus == TQMovie::EndOfFrame && status == TQMovie::EndOfLoop) {
movie().disconnectStatus(this);
- m_oldStatus = INVALID_STATUS;
+ m_oldtqStatus = INVALID_STATUS;
note()->setContent(new ImageContent(note(), fileName()));
basket()->save();
//delete this; // CRASH, as always !!!!!!!!!
- //QTimer::singleShot(0, this, SLOT(loadContent())); // Delayed to avoid crash!
- //QTimer::singleShot(100, this, SLOT(saveProperties())); // We should save it's an image and not an animation
+ //TQTimer::singleShot(0, this, TQT_SLOT(loadContent())); // Delayed to avoid crash!
+ //TQTimer::singleShot(100, this, TQT_SLOT(saveProperties())); // We should save it's an image and not an animation
// if (note()->isFocused())
-// QTimer::singleShot(25, note(), SLOT(delayedEnsureVisible()));
+// TQTimer::singleShot(25, note(), TQT_SLOT(delayedEnsureVisible()));
}
else
- m_oldStatus = status;
+ m_oldtqStatus = status;
}
void AnimationContent::exportToHTML(HTMLExporter *exporter, int /*indent*/)
{
- exporter->stream << QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
- .arg( exporter->dataFolderName + exporter->copyFile(fullPath(), /*createIt=*/true),
- QString::number(movie().framePixmap().size().width()),
- QString::number(movie().framePixmap().size().height()) );
+ exporter->stream << TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
+ .tqarg( exporter->dataFolderName + exporter->copyFile(fullPath(), /*createIt=*/true),
+ TQString::number(movie().framePixmap().size().width()),
+ TQString::number(movie().framePixmap().size().height()) );
}
/** class FileContent:
*/
-FileContent::FileContent(Note *parent, const QString &fileName)
- : NoteContent(parent, fileName), m_previewJob(0)
+FileContent::FileContent(Note *tqparent, const TQString &fileName)
+ : NoteContent(tqparent, fileName), m_previewJob(0)
{
basket()->addWatchedFile(fullPath());
setFileName(fileName); // FIXME: TO THAT HERE BECAUSE NoteContent() constructor seems to don't be able to call virtual methods???
@@ -1004,9 +1004,9 @@ int FileContent::setWidthAndGetHeight(int width)
return m_linkDisplay.height();
}
-void FileContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
+void FileContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
{
- m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
+ m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
}
bool FileContent::loadFromFile(bool /*lazyLoad*/)
@@ -1015,11 +1015,11 @@ bool FileContent::loadFromFile(bool /*lazyLoad*/)
return true;
}
-void FileContent::toolTipInfos(QStringList *keys, QStringList *values)
+void FileContent::toolTipInfos(TQStringList *keys, TQStringList *values)
{
// Get the size of the file:
- uint size = QFileInfo(fullPath()).size();
- QString humanFileSize = KIO::convertSize((KIO::filesize_t)size);
+ uint size = TQFileInfo(fullPath()).size();
+ TQString humanFileSize = KIO::convertSize((KIO::filesize_t)size);
keys->append(i18n("Size"));
values->append(humanFileSize);
@@ -1032,9 +1032,9 @@ void FileContent::toolTipInfos(QStringList *keys, QStringList *values)
KFileMetaInfo infos = KFileMetaInfo(KURL(fullPath()));
if (infos.isValid() && !infos.isEmpty()) {
- QStringList groups = infos.preferredKeys();
+ TQStringList groups = infos.preferredKeys();
int i = 0;
- for (QStringList::Iterator it = groups.begin(); i < 6 && it != groups.end(); ++it) {
+ for (TQStringList::Iterator it = groups.begin(); i < 6 && it != groups.end(); ++it) {
KFileMetaInfoItem metaInfoItem = infos.item(*it);
if (!metaInfoItem.string().isEmpty()) {
keys->append(metaInfoItem.translatedKey());
@@ -1045,32 +1045,32 @@ void FileContent::toolTipInfos(QStringList *keys, QStringList *values)
}
}
-int FileContent::zoneAt(const QPoint &pos)
+int FileContent::zoneAt(const TQPoint &pos)
{
return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0);
}
-QRect FileContent::zoneRect(int zone, const QPoint &/*pos*/)
+TQRect FileContent::zoneRect(int zone, const TQPoint &/*pos*/)
{
- QRect linkRect = m_linkDisplay.iconButtonRect();
+ TQRect linkRect = m_linkDisplay.iconButtonRect();
if (zone == Note::Custom0)
- return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
+ return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
else if (zone == Note::Content)
return linkRect;
else
- return QRect();
+ return TQRect();
}
-QString FileContent::zoneTip(int zone)
+TQString FileContent::zoneTip(int zone)
{
- return (zone == Note::Custom0 ? i18n("Open this file") : QString());
+ return (zone == Note::Custom0 ? i18n("Open this file") : TQString());
}
-void FileContent::setCursor(QWidget *widget, int zone)
+void FileContent::setCursor(TQWidget *widget, int zone)
{
if (zone == Note::Custom0)
- widget->setCursor(Qt::PointingHandCursor);
+ widget->setCursor(TQt::PointingHandCursor);
}
@@ -1080,7 +1080,7 @@ int FileContent::xEditorIndent()
}
-QString FileContent::messageWhenOpenning(OpenMessage where)
+TQString FileContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening file...");
@@ -1093,14 +1093,14 @@ QString FileContent::messageWhenOpenning(OpenMessage where)
}
}
-void FileContent::setFileName(const QString &fileName)
+void FileContent::setFileName(const TQString &fileName)
{
NoteContent::setFileName(fileName);
KURL url = KURL(fullPath());
if (linkLook()->previewEnabled())
m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), linkLook(), note()->font()); // FIXME: move iconForURL outside of NoteFactory !!!!!
else
- m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), QPixmap(), linkLook(), note()->font());
+ m_linkDisplay.setLink(fileName, NoteFactory::iconForURL(url), TQPixmap(), linkLook(), note()->font());
startFetchingUrlPreview();
contentChanged(m_linkDisplay.minWidth());
}
@@ -1112,16 +1112,16 @@ void FileContent::linkLookChanged()
//startFetchingUrlPreview();
}
-void FileContent::newPreview(const KFileItem*, const QPixmap &preview)
+void FileContent::newPreview(const KFileItem*, const TQPixmap &preview)
{
LinkLook *linkLook = this->linkLook();
- m_linkDisplay.setLink(fileName(), NoteFactory::iconForURL(KURL(fullPath())), (linkLook->previewEnabled() ? preview : QPixmap()), linkLook, note()->font());
+ m_linkDisplay.setLink(fileName(), NoteFactory::iconForURL(KURL(fullPath())), (linkLook->previewEnabled() ? preview : TQPixmap()), linkLook, note()->font());
contentChanged(m_linkDisplay.minWidth());
}
void FileContent::removePreview(const KFileItem*)
{
- newPreview(0, QPixmap());
+ newPreview(0, TQPixmap());
}
void FileContent::startFetchingUrlPreview()
@@ -1135,31 +1135,31 @@ void FileContent::startFetchingUrlPreview()
KURL::List urlList;
urlList.append(filteredUrl);
m_previewJob = KIO::filePreview(urlList, linkLook->previewSize(), linkLook->previewSize(), linkLook->iconSize());
- connect( m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(newPreview(const KFileItem*, const QPixmap&)) );
- connect( m_previewJob, SIGNAL(failed(const KFileItem*)), this, SLOT(removePreview(const KFileItem*)) );
+ connect( m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), this, TQT_SLOT(newPreview(const KFileItem*, const TQPixmap&)) );
+ connect( m_previewJob, TQT_SIGNAL(failed(const KFileItem*)), this, TQT_SLOT(removePreview(const KFileItem*)) );
}
}
void FileContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString spaces;
- QString fileName = exporter->copyFile(fullPath(), true);
- exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1));
+ TQString spaces;
+ TQString fileName = exporter->copyFile(fullPath(), true);
+ exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1));
}
/** class SoundContent:
*/
-SoundContent::SoundContent(Note *parent, const QString &fileName)
- : FileContent(parent, fileName)
+SoundContent::SoundContent(Note *tqparent, const TQString &fileName)
+ : FileContent(tqparent, fileName)
{
setFileName(fileName); // FIXME: TO THAT HERE BECAUSE NoteContent() constructor seems to don't be able to call virtual methods???
}
-QString SoundContent::zoneTip(int zone)
+TQString SoundContent::zoneTip(int zone)
{
- return (zone == Note::Custom0 ? i18n("Open this sound") : QString());
+ return (zone == Note::Custom0 ? i18n("Open this sound") : TQString());
}
void SoundContent::setHoveredZone(int oldZone, int newZone)
@@ -1193,7 +1193,7 @@ void SoundContent::setHoveredZone(int oldZone, int newZone)
}
-QString SoundContent::messageWhenOpenning(OpenMessage where)
+TQString SoundContent::messageWhenOpenning(OpenMessage where)
{
switch (where) {
case OpenOne: return i18n("Opening sound...");
@@ -1209,8 +1209,8 @@ QString SoundContent::messageWhenOpenning(OpenMessage where)
/** class LinkContent:
*/
-LinkContent::LinkContent(Note *parent, const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon)
- : NoteContent(parent), m_previewJob(0)
+LinkContent::LinkContent(Note *tqparent, const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon)
+ : NoteContent(tqparent), m_previewJob(0)
{
setLink(url, title, icon, autoTitle, autoIcon);
}
@@ -1221,57 +1221,57 @@ int LinkContent::setWidthAndGetHeight(int width)
return m_linkDisplay.height();
}
-void LinkContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
+void LinkContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
{
- m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
+ m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
}
-void LinkContent::saveToNode(QDomDocument &doc, QDomElement &content)
+void LinkContent::saveToNode(TQDomDocument &doc, TQDomElement &content)
{
content.setAttribute("title", title() );
content.setAttribute("icon", icon() );
content.setAttribute("autoTitle", (autoTitle() ? "true" : "false"));
content.setAttribute("autoIcon", (autoIcon() ? "true" : "false"));
- QDomText textNode = doc.createTextNode(url().prettyURL());
+ TQDomText textNode = doc.createTextNode(url().prettyURL());
content.appendChild(textNode);
}
-void LinkContent::toolTipInfos(QStringList *keys, QStringList *values)
+void LinkContent::toolTipInfos(TQStringList *keys, TQStringList *values)
{
keys->append(i18n("Target"));
values->append(m_url.prettyURL());
}
-int LinkContent::zoneAt(const QPoint &pos)
+int LinkContent::zoneAt(const TQPoint &pos)
{
return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0);
}
-QRect LinkContent::zoneRect(int zone, const QPoint &/*pos*/)
+TQRect LinkContent::zoneRect(int zone, const TQPoint &/*pos*/)
{
- QRect linkRect = m_linkDisplay.iconButtonRect();
+ TQRect linkRect = m_linkDisplay.iconButtonRect();
if (zone == Note::Custom0)
- return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
+ return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
else if (zone == Note::Content)
return linkRect;
else
- return QRect();
+ return TQRect();
}
-QString LinkContent::zoneTip(int zone)
+TQString LinkContent::zoneTip(int zone)
{
- return (zone == Note::Custom0 ? i18n("Open this link") : QString());
+ return (zone == Note::Custom0 ? i18n("Open this link") : TQString());
}
-void LinkContent::setCursor(QWidget *widget, int zone)
+void LinkContent::setCursor(TQWidget *widget, int zone)
{
if (zone == Note::Custom0)
- widget->setCursor(Qt::PointingHandCursor);
+ widget->setCursor(TQt::PointingHandCursor);
}
-QString LinkContent::statusBarMessage(int zone)
+TQString LinkContent::statusBarMessage(int zone)
{
if (zone == Note::Custom0 || zone == Note::Content)
return m_url.prettyURL();
@@ -1285,7 +1285,7 @@ KURL LinkContent::urlToOpen(bool /*with*/)
return NoteFactory::filteredURL(url());//KURIFilter::self()->filteredURI(url());
}
-QString LinkContent::messageWhenOpenning(OpenMessage where)
+TQString LinkContent::messageWhenOpenning(OpenMessage where)
{
if (url().isEmpty())
return i18n("Link have no URL to open.");
@@ -1301,7 +1301,7 @@ QString LinkContent::messageWhenOpenning(OpenMessage where)
}
}
-void LinkContent::setLink(const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon)
+void LinkContent::setLink(const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon)
{
m_autoTitle = autoTitle;
m_autoIcon = autoIcon;
@@ -1313,7 +1313,7 @@ void LinkContent::setLink(const KURL &url, const QString &title, const QString &
if (look->previewEnabled())
m_linkDisplay.setLink(m_title, m_icon, look, note()->font());
else
- m_linkDisplay.setLink(m_title, m_icon, QPixmap(), look, note()->font());
+ m_linkDisplay.setLink(m_title, m_icon, TQPixmap(), look, note()->font());
startFetchingUrlPreview();
contentChanged(m_linkDisplay.minWidth());
}
@@ -1323,16 +1323,16 @@ void LinkContent::linkLookChanged()
fontChanged();
}
-void LinkContent::newPreview(const KFileItem*, const QPixmap &preview)
+void LinkContent::newPreview(const KFileItem*, const TQPixmap &preview)
{
LinkLook *linkLook = LinkLook::lookForURL(url());
- m_linkDisplay.setLink(title(), icon(), (linkLook->previewEnabled() ? preview : QPixmap()), linkLook, note()->font());
+ m_linkDisplay.setLink(title(), icon(), (linkLook->previewEnabled() ? preview : TQPixmap()), linkLook, note()->font());
contentChanged(m_linkDisplay.minWidth());
}
void LinkContent::removePreview(const KFileItem*)
{
- newPreview(0, QPixmap());
+ newPreview(0, TQPixmap());
}
// Code dupicated from FileContent::startFetchingUrlPreview()
@@ -1347,14 +1347,14 @@ void LinkContent::startFetchingUrlPreview()
KURL::List urlList;
urlList.append(filteredUrl);
m_previewJob = KIO::filePreview(urlList, linkLook->previewSize(), linkLook->previewSize(), linkLook->iconSize());
- connect( m_previewJob, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), this, SLOT(newPreview(const KFileItem*, const QPixmap&)) );
- connect( m_previewJob, SIGNAL(failed(const KFileItem*)), this, SLOT(removePreview(const KFileItem*)) );
+ connect( m_previewJob, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), this, TQT_SLOT(newPreview(const KFileItem*, const TQPixmap&)) );
+ connect( m_previewJob, TQT_SIGNAL(failed(const KFileItem*)), this, TQT_SLOT(removePreview(const KFileItem*)) );
}
}
void LinkContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString linkTitle = title();
+ TQString linkTitle = title();
// TODO:
// // Append address (useful for print version of the page/basket):
@@ -1369,10 +1369,10 @@ void LinkContent::exportToHTML(HTMLExporter *exporter, int indent)
KURL linkURL;
/*
- QFileInfo fInfo(url().path());
+ TQFileInfo fInfo(url().path());
// DEBUG_WIN << url().path()
-// << "IsFile:" + QString::number(fInfo.isFile())
-// << "IsDir:" + QString::number(fInfo.isDir());
+// << "IsFile:" + TQString::number(fInfo.isFile())
+// << "IsDir:" + TQString::number(fInfo.isDir());
if (exportData.embedLinkedFiles && fInfo.isFile()) {
// DEBUG_WIN << "Embed file";
linkURL = exportData.dataFolderName + Basket::copyFile(url().path(), exportData.dataFolderPath, true);
@@ -1387,15 +1387,15 @@ void LinkContent::exportToHTML(HTMLExporter *exporter, int indent)
}
*/
- QString spaces;
- exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).replace("\n", "\n" + spaces.fill(' ', indent + 1));
+ TQString spaces;
+ exporter->stream << m_linkDisplay.toHtml(exporter, linkURL, linkTitle).tqreplace("\n", "\n" + spaces.fill(' ', indent + 1));
}
/** class LauncherContent:
*/
-LauncherContent::LauncherContent(Note *parent, const QString &fileName)
- : NoteContent(parent, fileName)
+LauncherContent::LauncherContent(Note *tqparent, const TQString &fileName)
+ : NoteContent(tqparent, fileName)
{
basket()->addWatchedFile(fullPath());
loadFromFile(/*lazyLoad=*/false);
@@ -1407,9 +1407,9 @@ int LauncherContent::setWidthAndGetHeight(int width)
return m_linkDisplay.height();
}
-void LauncherContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
+void LauncherContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered)
{
- m_linkDisplay.paint(painter, 0, 0, width, height, colorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
+ m_linkDisplay.paint(painter, 0, 0, width, height, tqcolorGroup, isDefaultColor, isSelected, isHovered, isHovered && note()->hoveredZone() == Note::Custom0);
}
bool LauncherContent::loadFromFile(bool /*lazyLoad*/) // TODO: saveToFile() ?? Is it possible?
@@ -1421,13 +1421,13 @@ bool LauncherContent::loadFromFile(bool /*lazyLoad*/) // TODO: saveToFile() ?? I
}
-void LauncherContent::toolTipInfos(QStringList *keys, QStringList *values)
+void LauncherContent::toolTipInfos(TQStringList *keys, TQStringList *values)
{
KService service(fullPath());
- QString exec = service.exec();
+ TQString exec = service.exec();
if (service.terminal())
- exec = i18n("%1 <i>(run in terminal)</i>").arg(exec);
+ exec = i18n("%1 <i>(run in terminal)</i>").tqarg(exec);
if (!service.comment().isEmpty() && service.comment() != service.name()) {
keys->append(i18n("Comment"));
@@ -1438,32 +1438,32 @@ void LauncherContent::toolTipInfos(QStringList *keys, QStringList *values)
values->append(exec);
}
-int LauncherContent::zoneAt(const QPoint &pos)
+int LauncherContent::zoneAt(const TQPoint &pos)
{
return (m_linkDisplay.iconButtonAt(pos) ? 0 : Note::Custom0);
}
-QRect LauncherContent::zoneRect(int zone, const QPoint &/*pos*/)
+TQRect LauncherContent::zoneRect(int zone, const TQPoint &/*pos*/)
{
- QRect linkRect = m_linkDisplay.iconButtonRect();
+ TQRect linkRect = m_linkDisplay.iconButtonRect();
if (zone == Note::Custom0)
- return QRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
+ return TQRect(linkRect.width(), 0, note()->width(), note()->height()); // Too wide and height, but it will be clipped by Note::zoneRect()
else if (zone == Note::Content)
return linkRect;
else
- return QRect();
+ return TQRect();
}
-QString LauncherContent::zoneTip(int zone)
+TQString LauncherContent::zoneTip(int zone)
{
- return (zone == Note::Custom0 ? i18n("Launch this application") : QString());
+ return (zone == Note::Custom0 ? i18n("Launch this application") : TQString());
}
-void LauncherContent::setCursor(QWidget *widget, int zone)
+void LauncherContent::setCursor(TQWidget *widget, int zone)
{
if (zone == Note::Custom0)
- widget->setCursor(Qt::PointingHandCursor);
+ widget->setCursor(TQt::PointingHandCursor);
}
@@ -1475,7 +1475,7 @@ KURL LauncherContent::urlToOpen(bool with)
return (with ? KURL() : KURL(fullPath())); // Can open the appliation, but not with another application :-)
}
-QString LauncherContent::messageWhenOpenning(OpenMessage where)
+TQString LauncherContent::messageWhenOpenning(OpenMessage where)
{
if (KService(fullPath()).exec().isEmpty())
return i18n("The launcher have no command to run.");
@@ -1491,7 +1491,7 @@ QString LauncherContent::messageWhenOpenning(OpenMessage where)
}
}
-void LauncherContent::setLauncher(const QString &name, const QString &icon, const QString &exec)
+void LauncherContent::setLauncher(const TQString &name, const TQString &icon, const TQString &exec)
{
m_name = name;
m_icon = icon;
@@ -1503,9 +1503,9 @@ void LauncherContent::setLauncher(const QString &name, const QString &icon, cons
void LauncherContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString spaces;
- QString fileName = exporter->copyFile(fullPath(), /*createIt=*/true);
- exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").replace("\n", "\n" + spaces.fill(' ', indent + 1));
+ TQString spaces;
+ TQString fileName = exporter->copyFile(fullPath(), /*createIt=*/true);
+ exporter->stream << m_linkDisplay.toHtml(exporter, KURL(exporter->dataFolderName + fileName), "").tqreplace("\n", "\n" + spaces.fill(' ', indent + 1));
}
/** class ColorContent:
@@ -1513,8 +1513,8 @@ void LauncherContent::exportToHTML(HTMLExporter *exporter, int indent)
const int ColorContent::RECT_MARGIN = 2;
-ColorContent::ColorContent(Note *parent, const QColor &color)
- : NoteContent(parent)
+ColorContent::ColorContent(Note *tqparent, const TQColor &color)
+ : NoteContent(tqparent)
{
setColor(color);
}
@@ -1522,15 +1522,15 @@ ColorContent::ColorContent(Note *parent, const QColor &color)
int ColorContent::setWidthAndGetHeight(int /*width*/) // We do not need width because we can't word-break, and width is always >= minWidth()
{
// FIXME: Duplicate from setColor():
- QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name());
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name());
int rectHeight = (textRect.height() + 2)*3/2;
return rectHeight;
}
-void ColorContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void ColorContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
// FIXME: Duplicate from setColor():
- QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name());
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name());
int rectHeight = (textRect.height() + 2)*3/2;
int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers.
@@ -1538,7 +1538,7 @@ void ColorContent::paint(QPainter *painter, int width, int height, const QColorG
// Fill:
painter->fillRect(1, 1, rectWidth - 2, rectHeight - 2, color());
// Stroke:
- QColor stroke = color().dark(125);
+ TQColor stroke = color().dark(125);
painter->setPen(stroke);
painter->drawLine(1, 0, rectWidth - 2, 0);
painter->drawLine(0, 1, 0, rectHeight - 2);
@@ -1553,29 +1553,29 @@ void ColorContent::paint(QPainter *painter, int width, int height, const QColorG
// Draw the text:
painter->setFont(note()->font());
- painter->setPen(colorGroup.text());
- painter->drawText(rectWidth + RECT_MARGIN, 0, width - rectWidth - RECT_MARGIN, height, Qt::AlignAuto | Qt::AlignVCenter, color().name());
+ painter->setPen(tqcolorGroup.text());
+ painter->drawText(rectWidth + RECT_MARGIN, 0, width - rectWidth - RECT_MARGIN, height, TQt::AlignAuto | TQt::AlignVCenter, color().name());
}
-void ColorContent::saveToNode(QDomDocument &doc, QDomElement &content)
+void ColorContent::saveToNode(TQDomDocument &doc, TQDomElement &content)
{
- QDomText textNode = doc.createTextNode(color().name());
+ TQDomText textNode = doc.createTextNode(color().name());
content.appendChild(textNode);
}
-void ColorContent::toolTipInfos(QStringList *keys, QStringList *values)
+void ColorContent::toolTipInfos(TQStringList *keys, TQStringList *values)
{
int hue, saturation, value;
- m_color.getHsv(hue, saturation, value);
+ m_color.getHsv(&hue, &saturation, &value);
keys->append(i18n("RGB Colorspace: Red/Green/Blue", "RGB"));
- values->append(i18n("<i>Red</i>: %1, <i>Green</i>: %2, <i>Blue</i>: %3,").arg(QString::number(m_color.red()), QString::number(m_color.green()), QString::number(m_color.blue())));
+ values->append(i18n("<i>Red</i>: %1, <i>Green</i>: %2, <i>Blue</i>: %3,").tqarg(TQString::number(m_color.red()), TQString::number(m_color.green()), TQString::number(m_color.blue())));
keys->append(i18n("HSV Colorspace: Hue/Saturation/Value", "HSV"));
- values->append(i18n("<i>Hue</i>: %1, <i>Saturation</i>: %2, <i>Value</i>: %3,").arg(QString::number(hue), QString::number(saturation), QString::number(value)));
+ values->append(i18n("<i>Hue</i>: %1, <i>Saturation</i>: %2, <i>Value</i>: %3,").tqarg(TQString::number(hue), TQString::number(saturation), TQString::number(value)));
- static QString cssColors[] = {
+ static TQString cssColors[] = {
"aqua", "00ffff",
"black", "000000",
"blue", "0000ff",
@@ -1594,7 +1594,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values)
"yellow", "ffff00"
};
- static QString cssExtendedColors[] = {
+ static TQString cssExtendedColors[] = {
"aliceblue", "f0f8ff",
"antiquewhite", "faebd7",
"aquamarine", "7fffd4",
@@ -1680,7 +1680,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values)
"midnightblue", "191970",
"mintcream", "f5fffa",
"mistyrose", "ffe4e1",
- "moccasin", "ffe4b5",
+ "tqmoccasin", "ffe4b5",
"navajowhite", "ffdead",
"oldlace", "fdf5e6",
"olivedrab", "6b8e23",
@@ -1721,7 +1721,7 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values)
"yellowgreen", "9acd32"
};
- QString colorHex = color().name().mid(1); // Take the hexadecimal name of the color, without the '#'.
+ TQString colorHex = color().name().mid(1); // Take the hexadecimal name of the color, without the '#'.
bool cssColorFound = false;
for (int i = 0; i < 2*16; i += 2) {
@@ -1747,11 +1747,11 @@ void ColorContent::toolTipInfos(QStringList *keys, QStringList *values)
}
-void ColorContent::setColor(const QColor &color)
+void ColorContent::setColor(const TQColor &color)
{
m_color = color;
- QRect textRect = QFontMetrics(note()->font()).boundingRect(color.name());
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color.name());
int rectHeight = (textRect.height() + 2)*3/2;
int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers.
contentChanged(rectWidth + RECT_MARGIN + textRect.width() + RECT_MARGIN); // The second RECT_MARGIN is because textRect.width() is too short. I done a bug? Can't figure out.
@@ -1759,13 +1759,13 @@ void ColorContent::setColor(const QColor &color)
void ColorContent::addAlternateDragObjects(KMultipleDrag *dragObject)
{
- dragObject->addDragObject( new QColorDrag(color()) );
+ dragObject->addDragObject( new TQColorDrag(color()) );
// addDragObject(new KColorDrag( note->color(), 0 ));
-// addDragObject(new QTextDrag( note->color().name(), 0 ));
+// addDragObject(new TQTextDrag( note->color().name(), 0 ));
-/* // Creata and add the QDragObject:
- storedDrag = new QStoredDrag("application/x-color");
+/* // Creata and add the TQDragObject:
+ storedDrag = new TQStoredDrag("application/x-color");
storedDrag->setEncodedData(*array);
dragObject->addDragObject(storedDrag);
delete array;*/
@@ -1774,16 +1774,16 @@ void ColorContent::addAlternateDragObjects(KMultipleDrag *dragObject)
void ColorContent::exportToHTML(HTMLExporter *exporter, int /*indent*/)
{
// FIXME: Duplicate from setColor(): TODO: rectSize()
- QRect textRect = QFontMetrics(note()->font()).boundingRect(color().name());
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(color().name());
int rectHeight = (textRect.height() + 2)*3/2;
int rectWidth = rectHeight * 14 / 10; // 1.4 times the height, like A4 papers.
- QString fileName = /*Tools::fileNameForNewFile(*/QString("color_%1.png").arg(color().name().lower().mid(1))/*, exportData.iconsFolderPath)*/;
- QString fullPath = exporter->iconsFolderPath + fileName;
- QPixmap colorIcon = KColorCombo2::colorRectPixmap(color(), /*isDefault=*/false, rectWidth, rectHeight);
+ TQString fileName = /*Tools::fileNameForNewFile(*/TQString(TQString("color_%1.png").tqarg(color().name()).lower().mid(1))/*, exportData.iconsFolderPath)*/;
+ TQString fullPath = exporter->iconsFolderPath + fileName;
+ TQPixmap colorIcon = KColorCombo2::colorRectPixmap(color(), /*isDefault=*/false, rectWidth, rectHeight);
colorIcon.save(fullPath, "PNG");
- QString iconHtml = QString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
- .arg(exporter->iconsFolderName + fileName, QString::number(colorIcon.width()), QString::number(colorIcon.height()));
+ TQString iconHtml = TQString("<img src=\"%1\" width=\"%2\" height=\"%3\" alt=\"\">")
+ .tqarg(exporter->iconsFolderName + fileName, TQString::number(colorIcon.width()), TQString::number(colorIcon.height()));
exporter->stream << iconHtml + " " + color().name();
}
@@ -1795,8 +1795,8 @@ void ColorContent::exportToHTML(HTMLExporter *exporter, int /*indent*/)
const int UnknownContent::DECORATION_MARGIN = 2;
-UnknownContent::UnknownContent(Note *parent, const QString &fileName)
- : NoteContent(parent, fileName)
+UnknownContent::UnknownContent(Note *tqparent, const TQString &fileName)
+ : NoteContent(tqparent, fileName)
{
basket()->addWatchedFile(fullPath());
loadFromFile(/*lazyLoad=*/false);
@@ -1805,49 +1805,49 @@ UnknownContent::UnknownContent(Note *parent, const QString &fileName)
int UnknownContent::setWidthAndGetHeight(int width)
{
width -= 1;
- QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, width, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes);
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, width, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes);
return DECORATION_MARGIN + textRect.height() + DECORATION_MARGIN;
}
// TODO: Move this function from note.cpp to class Tools:
-extern void drawGradient( QPainter *p, const QColor &colorTop, const QColor & colorBottom,
+extern void drawGradient( TQPainter *p, const TQColor &colorTop, const TQColor & colorBottom,
int x, int y, int w, int h,
bool sunken, bool horz, bool flat ); /*const*/
-void UnknownContent::paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
+void UnknownContent::paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool /*isDefaultColor*/, bool /*isSelected*/, bool /*isHovered*/)
{
width -= 1;
- painter->setPen(colorGroup.text());
+ painter->setPen(tqcolorGroup.text());
// FIXME: Duplicate from ColorContent::paint() and CommonColorSelector::drawColorRect:
// Fill with gradient:
- drawGradient(painter, colorGroup.background(), colorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
+ drawGradient(painter, tqcolorGroup.background(), tqcolorGroup.background().dark(110), 1, 1, width - 2, height - 2, /*sunken=*/false, /*horz=*/true, /*flat=*/false);
// Stroke:
- QColor stroke = Tools::mixColor(colorGroup.background(), colorGroup.text());
+ TQColor stroke = Tools::mixColor(tqcolorGroup.background(), tqcolorGroup.text());
painter->setPen(stroke);
painter->drawLine(1, 0, width - 2, 0);
painter->drawLine(0, 1, 0, height - 2);
painter->drawLine(1, height - 1, width - 2, height - 1);
painter->drawLine(width - 1, 1, width - 1, height - 2);
// Round corners:
- painter->setPen(Tools::mixColor(colorGroup.background(), stroke));
+ painter->setPen(Tools::mixColor(tqcolorGroup.background(), stroke));
painter->drawPoint(1, 1);
painter->drawPoint(1, height - 2);
painter->drawPoint(width - 2, height - 2);
painter->drawPoint(width - 2, 1);
- painter->setPen(colorGroup.text());
+ painter->setPen(tqcolorGroup.text());
painter->drawText(DECORATION_MARGIN, DECORATION_MARGIN, width - 2*DECORATION_MARGIN, height - 2*DECORATION_MARGIN,
- Qt::AlignAuto | Qt::AlignVCenter | Qt::WordBreak, m_mimeTypes);
+ TQt::AlignAuto | TQt::AlignVCenter | TQt::WordBreak, m_mimeTypes);
}
bool UnknownContent::loadFromFile(bool /*lazyLoad*/)
{
DEBUG_WIN << "Loading UnknownContent From " + basket()->folderName() + fileName();
- QFile file(fullPath());
+ TQFile file(fullPath());
if (file.open(IO_ReadOnly)) {
- QDataStream stream(&file);
- QString line;
+ TQDataStream stream(&file);
+ TQString line;
m_mimeTypes = "";
// Get the MIME-types names:
do {
@@ -1857,26 +1857,26 @@ bool UnknownContent::loadFromFile(bool /*lazyLoad*/)
if (m_mimeTypes.isEmpty())
m_mimeTypes += line;
else
- m_mimeTypes += QString("\n") + line;
+ m_mimeTypes += TQString("\n") + line;
}
}
} while (!line.isEmpty() && !stream.atEnd());
file.close();
}
- QRect textRect = QFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop | Qt::WordBreak, m_mimeTypes);
+ TQRect textRect = TQFontMetrics(note()->font()).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop | TQt::WordBreak, m_mimeTypes);
contentChanged(DECORATION_MARGIN + textRect.width() + DECORATION_MARGIN + 1);
return true;
}
void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject)
{
- QFile file(fullPath());
+ TQFile file(fullPath());
if (file.open(IO_ReadOnly)) {
- QDataStream stream(&file);
+ TQDataStream stream(&file);
// Get the MIME types names:
- QValueList<QString> mimes;
- QString line;
+ TQValueList<TQString> mimes;
+ TQString line;
do {
if (!stream.atEnd()) {
stream >> line;
@@ -1885,17 +1885,17 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject)
}
} while (!line.isEmpty() && !stream.atEnd());
// Add the streams:
- Q_UINT64 size; // TODO: It was Q_UINT32 in version 0.5.0 !
- QByteArray *array;
- QStoredDrag *storedDrag;
+ TQ_UINT64 size; // TODO: It was TQ_UINT32 in version 0.5.0 !
+ TQByteArray *array;
+ TQStoredDrag *storedDrag;
for (uint i = 0; i < mimes.count(); ++i) {
// Get the size:
stream >> size;
// Allocate memory to retreive size bytes and store them:
- array = new QByteArray(size);
+ array = new TQByteArray(size);
stream.readRawBytes(array->data(), size);
- // Creata and add the QDragObject:
- storedDrag = new QStoredDrag(*(mimes.at(i)));
+ // Creata and add the TQDragObject:
+ storedDrag = new TQStoredDrag(*(mimes.at(i)));
storedDrag->setEncodedData(*array);
dragObject->addDragObject(storedDrag);
delete array; // FIXME: Should we?
@@ -1906,30 +1906,30 @@ void UnknownContent::addAlternateDragObjects(KMultipleDrag *dragObject)
void UnknownContent::exportToHTML(HTMLExporter *exporter, int indent)
{
- QString spaces;
- exporter->stream << "<div class=\"unknown\">" << mimeTypes().replace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>";
+ TQString spaces;
+ exporter->stream << "<div class=\"unknown\">" << mimeTypes().tqreplace("\n", "\n" + spaces.fill(' ', indent + 1 + 1)) << "</div>";
}
-void NoteFactory__loadNode(const QDomElement &content, const QString &lowerTypeName, Note *parent, bool lazyLoad)
+void NoteFactory__loadNode(const TQDomElement &content, const TQString &lowerTypeName, Note *tqparent, bool lazyLoad)
{
- if (lowerTypeName == "text") new TextContent( parent, content.text(), lazyLoad );
- else if (lowerTypeName == "html") new HtmlContent( parent, content.text(), lazyLoad );
- else if (lowerTypeName == "image") new ImageContent( parent, content.text(), lazyLoad );
- else if (lowerTypeName == "animation") new AnimationContent( parent, content.text(), lazyLoad );
- else if (lowerTypeName == "sound") new SoundContent( parent, content.text() );
- else if (lowerTypeName == "file") new FileContent( parent, content.text() );
+ if (lowerTypeName == "text") new TextContent( tqparent, content.text(), lazyLoad );
+ else if (lowerTypeName == "html") new HtmlContent( tqparent, content.text(), lazyLoad );
+ else if (lowerTypeName == "image") new ImageContent( tqparent, content.text(), lazyLoad );
+ else if (lowerTypeName == "animation") new AnimationContent( tqparent, content.text(), lazyLoad );
+ else if (lowerTypeName == "sound") new SoundContent( tqparent, content.text() );
+ else if (lowerTypeName == "file") new FileContent( tqparent, content.text() );
else if (lowerTypeName == "link") {
bool autoTitle = content.attribute("title") == content.text();
bool autoIcon = content.attribute("icon") == NoteFactory::iconForURL(KURL(content.text()));
autoTitle = XMLWork::trueOrFalse( content.attribute("autoTitle"), autoTitle);
autoIcon = XMLWork::trueOrFalse( content.attribute("autoIcon"), autoIcon );
- new LinkContent( parent, KURL(content.text()), content.attribute("title"), content.attribute("icon"), autoTitle, autoIcon );
- } else if (lowerTypeName == "launcher") new LauncherContent( parent, content.text() );
- else if (lowerTypeName == "color") new ColorContent( parent, QColor(content.text()) );
- else if (lowerTypeName == "unknown") new UnknownContent( parent, content.text() );
+ new LinkContent( tqparent, KURL(content.text()), content.attribute("title"), content.attribute("icon"), autoTitle, autoIcon );
+ } else if (lowerTypeName == "launcher") new LauncherContent( tqparent, content.text() );
+ else if (lowerTypeName == "color") new ColorContent( tqparent, TQColor(content.text()) );
+ else if (lowerTypeName == "unknown") new UnknownContent( tqparent, content.text() );
}
#include "notecontent.moc"
diff --git a/src/notecontent.h b/src/notecontent.h
index 08c3db4..bd17f5b 100644
--- a/src/notecontent.h
+++ b/src/notecontent.h
@@ -21,23 +21,23 @@
#ifndef NOTECONTENT_H
#define NOTECONTENT_H
-#include <qobject.h>
-#include <qstring.h>
-#include <qsimplerichtext.h>
-#include <qpixmap.h>
-#include <qmovie.h>
-#include <qcolor.h>
+#include <tqobject.h>
+#include <tqstring.h>
+#include <tqsimplerichtext.h>
+#include <tqpixmap.h>
+#include <tqmovie.h>
+#include <tqcolor.h>
#include <kurl.h>
#include "linklabel.h"
-class QDomDocument;
-class QDomElement;
-class QPainter;
-class QWidget;
-class QPoint;
-class QRect;
-class QStringList;
+class TQDomDocument;
+class TQDomElement;
+class TQPainter;
+class TQWidget;
+class TQPoint;
+class TQRect;
+class TQStringList;
class KMultipleDrag;
class KFileItem;
@@ -65,46 +65,46 @@ class NoteContent // TODO: Mark some methods as const! and some (lik
{
public:
// Constructor and destructor:
- NoteContent(Note *parent, const QString &fileName = ""); /// << Constructor. Inherited notes should call it to initialize the parent note.
+ NoteContent(Note *tqparent, const TQString &fileName = ""); /// << Constructor. Inherited notes should call it to initialize the tqparent note.
virtual ~NoteContent() {} /// << Virtual destructor. Reimplement it if you should destroy some data your custom types.
// Simple Abstract Generic Methods:
virtual NoteType::Id type() = 0; /// << @return the internal number that identify that note type.
- virtual QString typeName() = 0; /// << @return the translated type name to display in the user interface.
- virtual QString lowerTypeName() = 0; /// << @return the type name in lowercase without space, for eg. saving.
- virtual QString toText(const QString &cuttedFullPath); /// << @return a plain text equivalent of the content.
- virtual QString toHtml(const QString &imageName, const QString &cuttedFullPath) = 0; /// << @return an HTML text equivalent of the content. @param imageName Save image in this Qt ressource.
- virtual QPixmap toPixmap() { return QPixmap(); } /// << @return an image equivalent of the content.
- virtual void toLink(KURL *url, QString *title, const QString &cuttedFullPath); /// << Set the link to the content. By default, it set them to fullPath() if useFile().
+ virtual TQString typeName() = 0; /// << @return the translated type name to display in the user interface.
+ virtual TQString lowerTypeName() = 0; /// << @return the type name in lowercase without space, for eg. saving.
+ virtual TQString toText(const TQString &cuttedFullPath); /// << @return a plain text equivalent of the content.
+ virtual TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath) = 0; /// << @return an HTML text equivalent of the content. @param imageName Save image in this TQt ressource.
+ virtual TQPixmap toPixmap() { return TQPixmap(); } /// << @return an image equivalent of the content.
+ virtual void toLink(KURL *url, TQString *title, const TQString &cuttedFullPath); /// << Set the link to the content. By default, it set them to fullPath() if useFile().
virtual bool useFile() = 0; /// << @return true if it use a file to store the content.
virtual bool canBeSavedAs() = 0; /// << @return true if the content can be saved as a file by the user.
- virtual QString saveAsFilters() = 0; /// << @return the filters for the user to choose a file destination to save the note as.
+ virtual TQString saveAsFilters() = 0; /// << @return the filters for the user to choose a file destination to save the note as.
virtual bool match(const FilterData &data) = 0; /// << @return true if the content match the filter criterias.
// Complexe Abstract Generic Methods:
virtual void exportToHTML(HTMLExporter *exporter, int indent) = 0; /// << Export the note in an HTML file.
- virtual QString cssClass() = 0; /// << @return the CSS class of the note when exported to HTML
- virtual int setWidthAndGetHeight(int width) = 0; /// << Relayout content with @p width (never less than minWidth()). @return its new height.
- virtual void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered) = 0; /// << Paint the content on @p painter, at coordinate (0, 0) and with the size (@p width, @p height).
+ virtual TQString cssClass() = 0; /// << @return the CSS class of the note when exported to HTML
+ virtual int setWidthAndGetHeight(int width) = 0; /// << Retqlayout content with @p width (never less than minWidth()). @return its new height.
+ virtual void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered) = 0; /// << Paint the content on @p painter, at coordinate (0, 0) and with the size (@p width, @p height).
virtual bool loadFromFile(bool /*lazyLoad*/) { return false; } /// << Load the content from the file. The default implementation does nothing. @see fileName().
virtual bool finishLazyLoad() { return false; } /// << Load what was not loaded by loadFromFile() if it was lazy-loaded
virtual bool saveToFile() { return false; } /// << Save the content to the file. The default implementation does nothing. @see fileName().
- virtual QString linkAt(const QPoint &/*pos*/) { return ""; } /// << @return the link anchor at position @p pos or "" if there is no link.
- virtual void saveToNode(QDomDocument &doc, QDomElement &content); /// << Save the note in the basket XML file. By default it store the filename if a file is used.
+ virtual TQString linkAt(const TQPoint &/*pos*/) { return ""; } /// << @return the link anchor at position @p pos or "" if there is no link.
+ virtual void saveToNode(TQDomDocument &doc, TQDomElement &content); /// << Save the note in the basket XML file. By default it store the filename if a file is used.
virtual void fontChanged() = 0; /// << If your content display textual data, called when the font have changed (from tags or basket font)
virtual void linkLookChanged() {} /// << If your content use LinkDisplay with preview enabled, reload the preview (can have changed size)
- virtual QString editToolTipText() = 0; /// << @return "Edit this [text|image|...]" to put in the tooltip for the note's content zone.
- virtual void toolTipInfos(QStringList */*keys*/, QStringList */*values*/) {} /// << Get "key: value" couples to put in the tooltip for the note's content zone.
+ virtual TQString editToolTipText() = 0; /// << @return "Edit this [text|image|...]" to put in the tooltip for the note's content zone.
+ virtual void toolTipInfos(TQStringList */*keys*/, TQStringList */*values*/) {} /// << Get "key: value" couples to put in the tooltip for the note's content zone.
// Custom Zones: /// Implement this if you want to store custom data.
- virtual int zoneAt(const QPoint &/*pos*/) { return 0; } /// << If your note-type have custom zones, @return the zone at @p pos or 0 if it's not a custom zone!
- virtual QRect zoneRect(int zone, const QPoint &/*pos*/); /// << Idem, @return the rect of the custom zone
- virtual QString zoneTip(int /*zone*/) { return ""; } /// << Idem, @return the toolTip of the custom zone
- virtual void setCursor(QWidget */*widget*/, int /*zone*/) {} /// << Idem, set the mouse cursor for widget @p widget when it is over zone @p zone!
+ virtual int zoneAt(const TQPoint &/*pos*/) { return 0; } /// << If your note-type have custom zones, @return the zone at @p pos or 0 if it's not a custom zone!
+ virtual TQRect zoneRect(int zone, const TQPoint &/*pos*/); /// << Idem, @return the rect of the custom zone
+ virtual TQString zoneTip(int /*zone*/) { return ""; } /// << Idem, @return the toolTip of the custom zone
+ virtual void setCursor(TQWidget */*widget*/, int /*zone*/) {} /// << Idem, set the mouse cursor for widget @p widget when it is over zone @p zone!
virtual void setHoveredZone(int /*oldZone*/, int /*newZone*/) {} /// << If your note type need some feedback, you get notified of hovering changes here.
- virtual QString statusBarMessage(int /*zone*/) { return ""; } /// << @return the statusBar message to show for zone @p zone, or "" if nothing special have to be said.
+ virtual TQString statusBarMessage(int /*zone*/) { return ""; } /// << @return the statusBar message to show for zone @p zone, or "" if nothing special have to be said.
// Drag and Drop Content:
- virtual void serialize(QDataStream &/*stream*/) {} /// << Serialize the content in a QDragObject. If it consists of a file, it can be serialized for you.
+ virtual void serialize(TQDataStream &/*stream*/) {} /// << Serialize the content in a TQDragObject. If it consists of a file, it can be serialized for you.
virtual bool shouldSerializeFile() { return useFile(); } /// << @return true if the dragging process should serialize the filename (and move the file if cutting).
virtual void addAlternateDragObjects(KMultipleDrag*/*dragObj*/) {} /// << If you offer more than toText/Html/Image/Link(), this will be called if this is the only selected.
- virtual QPixmap feedbackPixmap(int width, int height) = 0; /// << @return the pixmap to put under the cursor while dragging this object.
+ virtual TQPixmap feedbackPixmap(int width, int height) = 0; /// << @return the pixmap to put under the cursor while dragging this object.
virtual bool needSpaceForFeedbackPixmap() { return false; } /// << @return true if a space must be inserted before and after the DND feedback pixmap.
// Content Edition:
virtual int xEditorIndent() { return 0; } /// << If the editor should be indented (eg. to not cover an icon), return the number of pixels.
@@ -118,23 +118,23 @@ class NoteContent // TODO: Mark some methods as const! and some (lik
OpenOneWithDialog, /// << Prompt-message of the "Open With..." dialog for this note.
OpenSeveralWithDialog /// << Prompt-message of the "Open With..." dialog for several notes of this type.
};
- virtual QString messageWhenOpenning(OpenMessage /*where*/) { return QString(); } /// << @return the message to display according to @p where or nothing if it can't be done. @see OpenMessage describing the nature of the message that should be returned... The default implementation return an empty string. NOTE: If urlToOpen() is invalid and messageWhenOpenning() is not empty, then the user will be prompted to edit the note (with the message returned by messageWhenOpenning()) for eg. being able to edit URL of a link if it's empty when opening it...
- virtual QString customOpenCommand() { return QString(); } /// << Reimplement this if your urlToOpen() should be opened with another application instead of the default KDE one. This choice should be left to the users in the setting (choice to use a custom app or not, and which app).
+ virtual TQString messageWhenOpenning(OpenMessage /*where*/) { return TQString(); } /// << @return the message to display according to @p where or nothing if it can't be done. @see OpenMessage describing the nature of the message that should be returned... The default implementation return an empty string. NOTE: If urlToOpen() is invalid and messageWhenOpenning() is not empty, then the user will be prompted to edit the note (with the message returned by messageWhenOpenning()) for eg. being able to edit URL of a link if it's empty when opening it...
+ virtual TQString customOpenCommand() { return TQString(); } /// << Reimplement this if your urlToOpen() should be opened with another application instead of the default KDE one. This choice should be left to the users in the setting (choice to use a custom app or not, and which app).
// Common File Management: /// (and do save changes) and optionnaly hide the toolbar.
- virtual void setFileName(const QString &fileName); /// << Set the filename. Reimplement it if you eg. want to update the view when the filename is changed.
- bool trySetFileName(const QString &fileName); /// << Set the new filename and return true. Can fail and return false if a file with this fileName already exists.
- QString fullPath(); /// << Get the absolute path of the file where this content is stored on disk.
- QString fileName() { return m_fileName; } /// << Get the file name where this content is stored (relative to the basket folder). @see fullPath().
+ virtual void setFileName(const TQString &fileName); /// << Set the filename. Reimplement it if you eg. want to update the view when the filename is changed.
+ bool trySetFileName(const TQString &fileName); /// << Set the new filename and return true. Can fail and return false if a file with this fileName already exists.
+ TQString fullPath(); /// << Get the absolute path of the file where this content is stored on disk.
+ TQString fileName() { return m_fileName; } /// << Get the file name where this content is stored (relative to the basket folder). @see fullPath().
int minWidth() { return m_minWidth; } /// << Get the minimum width for this content.
Note *note() { return m_note; } /// << Get the note managing this content.
Basket *basket(); /// << Get the basket containing the note managing this content.
public:
void setEdited(); /// << Mark the note as edited NOW: change the "last modification time and time" AND save the basket to XML file.
protected:
- void contentChanged(int newMinWidth); /// << When the content has changed, inherited classes should call this to specify its new minimum size and trigger a basket relayout.
+ void contentChanged(int newMinWidth); /// << When the content has changed, inherited classes should call this to specify its new minimum size and trigger a basket retqlayout.
private:
Note *m_note;
- QString m_fileName;
+ TQString m_fileName;
int m_minWidth;
public:
static const int FEEDBACK_DARKING;
@@ -147,40 +147,40 @@ class TextContent : public NoteContent
{
public:
// Constructor and destructor:
- TextContent(Note *parent, const QString &fileName, bool lazyLoad = false);
+ TextContent(Note *tqparent, const TQString &fileName, bool lazyLoad = false);
~TextContent();
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toText(const QString &/*cuttedFullPath*/);
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toText(const TQString &/*cuttedFullPath*/);
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool lazyLoad);
bool finishLazyLoad();
bool saveToFile();
- QString linkAt(const QPoint &pos);
+ TQString linkAt(const TQPoint &pos);
void fontChanged();
- QString editToolTipText();
+ TQString editToolTipText();
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
-// QString customOpenCommand();
+ TQString messageWhenOpenning(OpenMessage where);
+// TQString customOpenCommand();
// Content-Specific Methods:
- void setText(const QString &text, bool lazyLoad = false); /// << Change the text note-content and relayout the note.
- QString text() { return m_text; } /// << @return the text note-content.
+ void setText(const TQString &text, bool lazyLoad = false); /// << Change the text note-content and retqlayout the note.
+ TQString text() { return m_text; } /// << @return the text note-content.
protected:
- QString m_text;
- QSimpleRichText *m_simpleRichText;
+ TQString m_text;
+ TQSimpleRichText *m_simpleRichText;
};
/** Real implementation of rich text (HTML) notes:
@@ -190,41 +190,41 @@ class HtmlContent : public NoteContent
{
public:
// Constructor and destructor:
- HtmlContent(Note *parent, const QString &fileName, bool lazyLoad = false);
+ HtmlContent(Note *tqparent, const TQString &fileName, bool lazyLoad = false);
~HtmlContent();
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toText(const QString &/*cuttedFullPath*/);
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toText(const TQString &/*cuttedFullPath*/);
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool lazyLoad);
bool finishLazyLoad();
bool saveToFile();
- QString linkAt(const QPoint &pos);
+ TQString linkAt(const TQPoint &pos);
void fontChanged();
- QString editToolTipText();
+ TQString editToolTipText();
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
- QString customOpenCommand();
+ TQString messageWhenOpenning(OpenMessage where);
+ TQString customOpenCommand();
// Content-Specific Methods:
- void setHtml(const QString &html, bool lazyLoad = false); /// << Change the HTML note-content and relayout the note.
- QString html() { return m_html; } /// << @return the HTML note-content.
+ void setHtml(const TQString &html, bool lazyLoad = false); /// << Change the HTML note-content and retqlayout the note.
+ TQString html() { return m_html; } /// << @return the HTML note-content.
protected:
- QString m_html;
- QString m_textEquivalent; //OPTIM_FILTER
- QSimpleRichText *m_simpleRichText;
+ TQString m_html;
+ TQString m_textEquivalent; //OPTIM_FILTER
+ TQSimpleRichText *m_simpleRichText;
};
/** Real implementation of image notes:
@@ -234,137 +234,139 @@ class ImageContent : public NoteContent
{
public:
// Constructor and destructor:
- ImageContent(Note *parent, const QString &fileName, bool lazyLoad = false);
+ ImageContent(Note *tqparent, const TQString &fileName, bool lazyLoad = false);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
- QPixmap toPixmap();
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
+ TQPixmap toPixmap();
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool lazyLoad);
bool finishLazyLoad();
bool saveToFile();
void fontChanged();
- QString editToolTipText();
- void toolTipInfos(QStringList *keys, QStringList *values);
+ TQString editToolTipText();
+ void toolTipInfos(TQStringList *keys, TQStringList *values);
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
bool needSpaceForFeedbackPixmap() { return true; }
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
- QString customOpenCommand();
+ TQString messageWhenOpenning(OpenMessage where);
+ TQString customOpenCommand();
// Content-Specific Methods:
- void setPixmap(const QPixmap &pixmap); /// << Change the pixmap note-content and relayout the note.
- QPixmap pixmap() { return m_pixmap; } /// << @return the pixmap note-content.
+ void setPixmap(const TQPixmap &pixmap); /// << Change the pixmap note-content and retqlayout the note.
+ TQPixmap pixmap() { return m_pixmap; } /// << @return the pixmap note-content.
protected:
- QPixmap m_pixmap;
+ TQPixmap m_pixmap;
char *m_format;
};
/** Real implementation of animated image (GIF, MNG) notes:
* @author S�astien Laot
*/
-class AnimationContent : public QObject, public NoteContent // QObject to be able to receive QMovie signals
+class AnimationContent : public TQObject, public NoteContent // TQObject to be able to receive TQMovie signals
{
Q_OBJECT
+ TQ_OBJECT
public:
// Constructor and destructor:
- AnimationContent(Note *parent, const QString &fileName, bool lazyLoad = false);
+ AnimationContent(Note *tqparent, const TQString &fileName, bool lazyLoad = false);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
- QPixmap toPixmap();
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
+ TQPixmap toPixmap();
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
void fontChanged();
- QString editToolTipText();
+ TQString editToolTipText();
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
bool needSpaceForFeedbackPixmap() { return true; }
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool lazyLoad);
bool finishLazyLoad();
bool saveToFile();
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
- QString customOpenCommand();
+ TQString messageWhenOpenning(OpenMessage where);
+ TQString customOpenCommand();
// Content-Specific Methods:
- bool setMovie(const QMovie &movie); /// << Change the movie note-content and relayout the note.
- QMovie movie() { return m_movie; } /// << @return the movie note-content.
+ bool setMovie(const TQMovie &movie); /// << Change the movie note-content and retqlayout the note.
+ TQMovie movie() { return m_movie; } /// << @return the movie note-content.
protected slots:
- void movieUpdated(const QRect&);
- void movieResized(const QSize&);
- void movieStatus(int status);
+ void movieUpdated(const TQRect&);
+ void movieResized(const TQSize&);
+ void movietqStatus(int status);
protected:
- QMovie m_movie;
- int m_oldStatus;
+ TQMovie m_movie;
+ int m_oldtqStatus;
static int INVALID_STATUS;
};
/** Real implementation of file notes:
* @author S�astien Laot
*/
-class FileContent : public QObject, public NoteContent
+class FileContent : public TQObject, public NoteContent
{
Q_OBJECT
+ TQ_OBJECT
public:
// Constructor and destructor:
- FileContent(Note *parent, const QString &fileName);
+ FileContent(Note *tqparent, const TQString &fileName);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool /*lazyLoad*/);
void fontChanged();
void linkLookChanged();
- QString editToolTipText();
- void toolTipInfos(QStringList *keys, QStringList *values);
+ TQString editToolTipText();
+ void toolTipInfos(TQStringList *keys, TQStringList *values);
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
// Custom Zones:
- int zoneAt(const QPoint &pos);
- QRect zoneRect(int zone, const QPoint &/*pos*/);
- QString zoneTip(int zone);
- void setCursor(QWidget *widget, int zone);
+ int zoneAt(const TQPoint &pos);
+ TQRect zoneRect(int zone, const TQPoint &/*pos*/);
+ TQString zoneTip(int zone);
+ void setCursor(TQWidget *widget, int zone);
// Content Edition:
int xEditorIndent();
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
+ TQString messageWhenOpenning(OpenMessage where);
// Content-Specific Methods:
- void setFileName(const QString &fileName); /// << Reimplemented to be able to relayout the note.
+ void setFileName(const TQString &fileName); /// << Reimplemented to be able to retqlayout the note.
virtual LinkLook* linkLook() { return LinkLook::fileLook; }
protected:
LinkDisplay m_linkDisplay;
// File Preview Management:
protected slots:
- void newPreview(const KFileItem*, const QPixmap &preview);
+ void newPreview(const KFileItem*, const TQPixmap &preview);
void removePreview(const KFileItem*);
void startFetchingUrlPreview();
protected:
@@ -377,27 +379,28 @@ class FileContent : public QObject, public NoteContent
class SoundContent : public FileContent // A sound is a file with just a bit different user interaction
{
Q_OBJECT
+ TQ_OBJECT
public:
// Constructor and destructor:
- SoundContent(Note *parent, const QString &fileName);
+ SoundContent(Note *tqparent, const TQString &fileName);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
- QString editToolTipText();
+ TQString editToolTipText();
// Complexe Generic Methods:
- QString cssClass();
+ TQString cssClass();
// Custom Zones:
- QString zoneTip(int zone);
+ TQString zoneTip(int zone);
void setHoveredZone(int oldZone, int newZone);
// Open Content or File:
- QString messageWhenOpenning(OpenMessage where);
- QString customOpenCommand();
+ TQString messageWhenOpenning(OpenMessage where);
+ TQString customOpenCommand();
// Content-Specific Methods:
LinkLook* linkLook() { return LinkLook::soundLook; }
};
@@ -405,62 +408,63 @@ class SoundContent : public FileContent // A sound is a file with just a bit dif
/** Real implementation of link notes:
* @author S�astien Laot
*/
-class LinkContent : public QObject, public NoteContent
+class LinkContent : public TQObject, public NoteContent
{
Q_OBJECT
+ TQ_OBJECT
public:
// Constructor and destructor:
- LinkContent(Note *parent, const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon);
+ LinkContent(Note *tqparent, const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toText(const QString &/*cuttedFullPath*/);
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
- void toLink(KURL *url, QString *title, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toText(const TQString &/*cuttedFullPath*/);
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
+ void toLink(KURL *url, TQString *title, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
- void saveToNode(QDomDocument &doc, QDomElement &content);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void saveToNode(TQDomDocument &doc, TQDomElement &content);
void fontChanged();
void linkLookChanged();
- QString editToolTipText();
- void toolTipInfos(QStringList *keys, QStringList *values);
+ TQString editToolTipText();
+ void toolTipInfos(TQStringList *keys, TQStringList *values);
// Drag and Drop Content:
- void serialize(QDataStream &stream);
- QPixmap feedbackPixmap(int width, int height);
+ void serialize(TQDataStream &stream);
+ TQPixmap feedbackPixmap(int width, int height);
// Custom Zones:
- int zoneAt(const QPoint &pos);
- QRect zoneRect(int zone, const QPoint &/*pos*/);
- QString zoneTip(int zone);
- void setCursor(QWidget *widget, int zone);
- QString statusBarMessage(int zone);
+ int zoneAt(const TQPoint &pos);
+ TQRect zoneRect(int zone, const TQPoint &/*pos*/);
+ TQString zoneTip(int zone);
+ void setCursor(TQWidget *widget, int zone);
+ TQString statusBarMessage(int zone);
// Open Content or File:
KURL urlToOpen(bool /*with*/);
- QString messageWhenOpenning(OpenMessage where);
+ TQString messageWhenOpenning(OpenMessage where);
// Content-Specific Methods:
- void setLink(const KURL &url, const QString &title, const QString &icon, bool autoTitle, bool autoIcon); /// << Change the link and relayout the note.
+ void setLink(const KURL &url, const TQString &title, const TQString &icon, bool autoTitle, bool autoIcon); /// << Change the link and retqlayout the note.
KURL url() { return m_url; } /// << @return the URL of the link note-content.
- QString title() { return m_title; } /// << @return the displayed title of the link note-content.
- QString icon() { return m_icon; } /// << @return the displayed icon of the link note-content.
+ TQString title() { return m_title; } /// << @return the displayed title of the link note-content.
+ TQString icon() { return m_icon; } /// << @return the displayed icon of the link note-content.
bool autoTitle() { return m_autoTitle; } /// << @return if the title is auto-computed from the URL.
bool autoIcon() { return m_autoIcon; } /// << @return if the icon is auto-computed from the URL.
protected:
KURL m_url;
- QString m_title;
- QString m_icon;
+ TQString m_title;
+ TQString m_icon;
bool m_autoTitle;
bool m_autoIcon;
LinkDisplay m_linkDisplay;
// File Preview Management:
protected slots:
- void newPreview(const KFileItem*, const QPixmap &preview);
+ void newPreview(const KFileItem*, const TQPixmap &preview);
void removePreview(const KFileItem*);
void startFetchingUrlPreview();
protected:
@@ -474,46 +478,46 @@ class LauncherContent : public NoteContent
{
public:
// Constructor and destructor:
- LauncherContent(Note *parent, const QString &fileName);
+ LauncherContent(Note *tqparent, const TQString &fileName);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
- void toLink(KURL *url, QString *title, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
+ void toLink(KURL *url, TQString *title, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool /*lazyLoad*/);
void fontChanged();
- QString editToolTipText();
- void toolTipInfos(QStringList *keys, QStringList *values);
+ TQString editToolTipText();
+ void toolTipInfos(TQStringList *keys, TQStringList *values);
// Drag and Drop Content:
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
// Custom Zones:
- int zoneAt(const QPoint &pos);
- QRect zoneRect(int zone, const QPoint &/*pos*/);
- QString zoneTip(int zone);
- void setCursor(QWidget *widget, int zone);
+ int zoneAt(const TQPoint &pos);
+ TQRect zoneRect(int zone, const TQPoint &/*pos*/);
+ TQString zoneTip(int zone);
+ void setCursor(TQWidget *widget, int zone);
// Open Content or File:
KURL urlToOpen(bool with);
- QString messageWhenOpenning(OpenMessage where);
+ TQString messageWhenOpenning(OpenMessage where);
// Content-Specific Methods:
- void setLauncher(const QString &name, const QString &icon, const QString &exec); /// << Change the launcher note-content and relayout the note. Normally called by loadFromFile (no save done).
- QString name() { return m_name; } /// << @return the URL of the launcher note-content.
- QString icon() { return m_icon; } /// << @return the displayed icon of the launcher note-content.
- QString exec() { return m_exec; } /// << @return the execute command line of the launcher note-content.
+ void setLauncher(const TQString &name, const TQString &icon, const TQString &exec); /// << Change the launcher note-content and retqlayout the note. Normally called by loadFromFile (no save done).
+ TQString name() { return m_name; } /// << @return the URL of the launcher note-content.
+ TQString icon() { return m_icon; } /// << @return the displayed icon of the launcher note-content.
+ TQString exec() { return m_exec; } /// << @return the execute command line of the launcher note-content.
// TODO: KService *service() ??? And store everything in thta service ?
protected:
- QString m_name; // TODO: Store them in linkDisplay to gain place (idem for Link notes)
- QString m_icon;
- QString m_exec;
+ TQString m_name; // TODO: Store them in linkDisplay to gain place (idem for Link notes)
+ TQString m_icon;
+ TQString m_exec;
LinkDisplay m_linkDisplay;
};
@@ -524,36 +528,36 @@ class ColorContent : public NoteContent
{
public:
// Constructor and destructor:
- ColorContent(Note *parent, const QColor &color);
+ ColorContent(Note *tqparent, const TQColor &color);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toText(const QString &/*cuttedFullPath*/);
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toText(const TQString &/*cuttedFullPath*/);
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
- void saveToNode(QDomDocument &doc, QDomElement &content);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void saveToNode(TQDomDocument &doc, TQDomElement &content);
void fontChanged();
- QString editToolTipText();
- void toolTipInfos(QStringList *keys, QStringList *values);
+ TQString editToolTipText();
+ void toolTipInfos(TQStringList *keys, TQStringList *values);
// Drag and Drop Content:
- void serialize(QDataStream &stream);
- QPixmap feedbackPixmap(int width, int height);
+ void serialize(TQDataStream &stream);
+ TQPixmap feedbackPixmap(int width, int height);
bool needSpaceForFeedbackPixmap() { return true; }
void addAlternateDragObjects(KMultipleDrag *dragObject);
// Content-Specific Methods:
- void setColor(const QColor &color); /// << Change the color note-content and relayout the note.
- QColor color() { return m_color; } /// << @return the color note-content.
+ void setColor(const TQColor &color); /// << Change the color note-content and retqlayout the note.
+ TQColor color() { return m_color; } /// << @return the color note-content.
protected:
- QColor m_color;
+ TQColor m_color;
static const int RECT_MARGIN;
};
@@ -564,40 +568,40 @@ class UnknownContent : public NoteContent
{
public:
// Constructor and destructor:
- UnknownContent(Note *parent, const QString &fileName);
+ UnknownContent(Note *tqparent, const TQString &fileName);
// Simple Generic Methods:
NoteType::Id type();
- QString typeName();
- QString lowerTypeName();
- QString toText(const QString &/*cuttedFullPath*/);
- QString toHtml(const QString &imageName, const QString &cuttedFullPath);
- void toLink(KURL *url, QString *title, const QString &cuttedFullPath);
+ TQString typeName();
+ TQString lowerTypeName();
+ TQString toText(const TQString &/*cuttedFullPath*/);
+ TQString toHtml(const TQString &imageName, const TQString &cuttedFullPath);
+ void toLink(KURL *url, TQString *title, const TQString &cuttedFullPath);
bool useFile();
bool canBeSavedAs();
- QString saveAsFilters();
+ TQString saveAsFilters();
bool match(const FilterData &data);
// Complexe Generic Methods:
void exportToHTML(HTMLExporter *exporter, int indent);
- QString cssClass();
+ TQString cssClass();
int setWidthAndGetHeight(int width);
- void paint(QPainter *painter, int width, int height, const QColorGroup &colorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
+ void paint(TQPainter *painter, int width, int height, const TQColorGroup &tqcolorGroup, bool isDefaultColor, bool isSelected, bool isHovered);
bool loadFromFile(bool /*lazyLoad*/);
void fontChanged();
- QString editToolTipText();
+ TQString editToolTipText();
// Drag and Drop Content:
bool shouldSerializeFile() { return false; }
void addAlternateDragObjects(KMultipleDrag *dragObject);
- QPixmap feedbackPixmap(int width, int height);
+ TQPixmap feedbackPixmap(int width, int height);
bool needSpaceForFeedbackPixmap() { return true; }
// Open Content or File:
KURL urlToOpen(bool /*with*/) { return KURL(); }
// Content-Specific Methods:
- QString mimeTypes() { return m_mimeTypes; } /// << @return the list of MIME types this note-content contains.
+ TQString mimeTypes() { return m_mimeTypes; } /// << @return the list of MIME types this note-content tqcontains.
protected:
- QString m_mimeTypes;
+ TQString m_mimeTypes;
static const int DECORATION_MARGIN;
};
-void NoteFactory__loadNode(const QDomElement &content, const QString &lowerTypeName, Note *parent, bool lazyLoad);
+void NoteFactory__loadNode(const TQDomElement &content, const TQString &lowerTypeName, Note *tqparent, bool lazyLoad);
#endif // NOTECONTENT_H
diff --git a/src/notedrag.cpp b/src/notedrag.cpp
index 633dec2..7d3d80a 100644
--- a/src/notedrag.cpp
+++ b/src/notedrag.cpp
@@ -18,15 +18,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qdragobject.h>
-#include <qdir.h>
-#include <qpainter.h>
-#include <qtextcodec.h>
-#include <qbuffer.h>
+#include <tqdragobject.h>
+#include <tqdir.h>
+#include <tqpainter.h>
+#include <tqtextcodec.h>
+#include <tqbuffer.h>
#include <kurldrag.h>
#include <kdeversion.h>
#include <kapplication.h>
-#include <qdesktopwidget.h>
+#include <tqdesktopwidget.h>
#include "basket.h"
#include "notedrag.h"
@@ -43,11 +43,11 @@ const char * NoteDrag::NOTE_MIME_STRING = "application/x-basket-note";
void NoteDrag::createAndEmptyCuttingTmpFolder()
{
Tools::deleteRecursively(Global::tempCutFolder());
- QDir dir;
+ TQDir dir;
dir.mkdir(Global::tempCutFolder());
}
-QDragObject* NoteDrag::dragObject(NoteSelection *noteList, bool cutting, QWidget *source)
+TQDragObject* NoteDrag::dragObject(NoteSelection *noteList, bool cutting, TQWidget *source)
{
if (noteList->count() <= 0)
return 0;
@@ -60,23 +60,23 @@ QDragObject* NoteDrag::dragObject(NoteSelection *noteList, bool cutting, QWidget
createAndEmptyCuttingTmpFolder();
// The "Native Format" Serialization:
- QBuffer buffer;
+ TQBuffer buffer;
if (buffer.open(IO_WriteOnly)) {
- QDataStream stream(&buffer);
+ TQDataStream stream(&buffer);
// First append a pointer to the basket:
- stream << (Q_UINT64)(noteList->firstStacked()->note->basket());
- // Then a list of pointers to all notes, and parent groups:
+ stream << (TQ_UINT64)(noteList->firstStacked()->note->basket());
+ // Then a list of pointers to all notes, and tqparent groups:
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked())
- stream << (Q_UINT64)(node->note);
- QValueList<Note*> groups = noteList->parentGroups();
- for (QValueList<Note*>::iterator it = groups.begin(); it != groups.end(); ++it)
- stream << (Q_UINT64)(*it);
- stream << (Q_UINT64)0;
+ stream << (TQ_UINT64)(node->note);
+ TQValueList<Note*> groups = noteList->tqparentGroups();
+ for (TQValueList<Note*>::iterator it = groups.begin(); it != groups.end(); ++it)
+ stream << (TQ_UINT64)(*it);
+ stream << (TQ_UINT64)0;
// And finally the notes themselves:
serializeNotes(noteList, stream, cutting);
// Append the object:
buffer.close();
- QStoredDrag *dragObject = new QStoredDrag(NOTE_MIME_STRING, source);
+ TQStoredDrag *dragObject = new TQStoredDrag(NOTE_MIME_STRING, source);
dragObject->setEncodedData(buffer.buffer());
multipleDrag->addDragObject(dragObject);
}
@@ -98,58 +98,58 @@ QDragObject* NoteDrag::dragObject(NoteSelection *noteList, bool cutting, QWidget
return multipleDrag;
}
-void NoteDrag::serializeNotes(NoteSelection *noteList, QDataStream &stream, bool cutting)
+void NoteDrag::serializeNotes(NoteSelection *noteList, TQDataStream &stream, bool cutting)
{
for (NoteSelection *node = noteList; node; node = node->next) {
- stream << (Q_UINT64)(node->note);
+ stream << (TQ_UINT64)(node->note);
if (node->firstChild) {
- stream << (Q_UINT64)(NoteType::Group) << (Q_UINT64)(node->note->groupWidth()) << (Q_UINT64)(node->note->isFolded());
+ stream << (TQ_UINT64)(NoteType::Group) << (TQ_UINT64)(node->note->groupWidth()) << (TQ_UINT64)(node->note->isFolded());
serializeNotes(node->firstChild, stream, cutting);
} else {
NoteContent *content = node->note->content();
- stream << (Q_UINT64)(content->type()) << (Q_UINT64)(node->note->groupWidth());
+ stream << (TQ_UINT64)(content->type()) << (TQ_UINT64)(node->note->groupWidth());
// Serialize file name, and move the file to a temporary place if the note is to be cuttted.
// If note does not have file name, we append empty string to be able to easily decode the notes later:
stream << content->fileName();
if (content->shouldSerializeFile()) {
if (cutting) {
// Move file in a temporary place:
- QString fullPath = Global::tempCutFolder() + Tools::fileNameForNewFile(content->fileName(), Global::tempCutFolder());
+ TQString fullPath = Global::tempCutFolder() + Tools::fileNameForNewFile(content->fileName(), Global::tempCutFolder());
KIO::move(KURL(content->fullPath()), KURL(fullPath), /*showProgressInfo=*/false);
node->fullPath = fullPath;
stream << fullPath;
} else
stream << content->fullPath();
} else
- stream << QString("");
+ stream << TQString("");
stream << content->note()->addedDate() << content->note()->lastModificationDate();
content->serialize(stream);
State::List states = node->note->states();
for (State::List::Iterator it = states.begin(); it != states.end(); ++it)
- stream << (Q_UINT64)(*it);
- stream << (Q_UINT64)0;
+ stream << (TQ_UINT64)(*it);
+ stream << (TQ_UINT64)0;
}
}
- stream << (Q_UINT64)0; // Mark the end of the notes in this group/hierarchy.
+ stream << (TQ_UINT64)0; // Mark the end of the notes in this group/hierarchy.
}
void NoteDrag::serializeText(NoteSelection *noteList, KMultipleDrag *multipleDrag)
{
- QString textEquivalent;
- QString text;
+ TQString textEquivalent;
+ TQString text;
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked()) {
text = node->note->toText(node->fullPath); // note->toText() and not note->content()->toText() because the first one will also export the tags as text.
if (!text.isEmpty())
textEquivalent += (!textEquivalent.isEmpty() ? "\n" : "") + text;
}
if (!textEquivalent.isEmpty())
- multipleDrag->addDragObject( new QTextDrag(textEquivalent) );
+ multipleDrag->addDragObject( new TQTextDrag(textEquivalent) );
}
void NoteDrag::serializeHtml(NoteSelection *noteList, KMultipleDrag *multipleDrag)
{
- QString htmlEquivalent;
- QString html;
+ TQString htmlEquivalent;
+ TQString html;
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked()) {
html = node->note->content()->toHtml("", node->fullPath);
if (!html.isEmpty())
@@ -157,12 +157,12 @@ void NoteDrag::serializeHtml(NoteSelection *noteList, KMultipleDrag *multipleDra
}
if (!htmlEquivalent.isEmpty()) {
// Add HTML flavour:
- QTextDrag *htmlDrag = new QTextDrag(htmlEquivalent);
+ TQTextDrag *htmlDrag = new TQTextDrag(htmlEquivalent);
htmlDrag->setSubtype("html");
multipleDrag->addDragObject(htmlDrag);
- // But also QTextEdit flavour, to be able to paste several notes to a text edit:
- QByteArray byteArray = ("<!--StartFragment--><p>" + htmlEquivalent).local8Bit();
- QStoredDrag *richTextDrag = new QStoredDrag("application/x-qrichtext");
+ // But also TQTextEdit flavour, to be able to paste several notes to a text edit:
+ TQByteArray byteArray = ("<!--StartFragment--><p>" + htmlEquivalent).local8Bit();
+ TQStoredDrag *richTextDrag = new TQStoredDrag("application/x-qrichtext");
richTextDrag->setEncodedData(byteArray);
multipleDrag->addDragObject(richTextDrag);
}
@@ -170,37 +170,37 @@ void NoteDrag::serializeHtml(NoteSelection *noteList, KMultipleDrag *multipleDra
void NoteDrag::serializeImage(NoteSelection *noteList, KMultipleDrag *multipleDrag)
{
- QValueList<QPixmap> pixmaps;
- QPixmap pixmap;
+ TQValueList<TQPixmap> pixmaps;
+ TQPixmap pixmap;
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked()) {
pixmap = node->note->content()->toPixmap();
if (!pixmap.isNull())
pixmaps.append(pixmap);
}
if (!pixmaps.isEmpty()) {
- QPixmap pixmapEquivalent;
+ TQPixmap pixmapEquivalent;
if (pixmaps.count() == 1)
pixmapEquivalent = pixmaps[0];
else {
// Search the total size:
int height = 0;
int width = 0;
- for (QValueList<QPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
+ for (TQValueList<TQPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
height += (*it).height();
if ((*it).width() > width)
width = (*it).width();
}
// Create the image by painting all image into one big image:
pixmapEquivalent.resize(width, height);
- pixmapEquivalent.fill(Qt::white);
- QPainter painter(&pixmapEquivalent);
+ pixmapEquivalent.fill(TQt::white);
+ TQPainter painter(&pixmapEquivalent);
height = 0;
- for (QValueList<QPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
+ for (TQValueList<TQPixmap>::iterator it = pixmaps.begin(); it != pixmaps.end(); ++it) {
painter.drawPixmap(0, height, *it);
height += (*it).height();
}
}
- QImageDrag *imageDrag = new QImageDrag(pixmapEquivalent.convertToImage());
+ TQImageDrag *imageDrag = new TQImageDrag(pixmapEquivalent.convertToImage());
multipleDrag->addDragObject(imageDrag);
}
}
@@ -208,9 +208,9 @@ void NoteDrag::serializeImage(NoteSelection *noteList, KMultipleDrag *multipleDr
void NoteDrag::serializeLinks(NoteSelection *noteList, KMultipleDrag *multipleDrag, bool cutting)
{
KURL::List urls;
- QStringList titles;
+ TQStringList titles;
KURL url;
- QString title;
+ TQString title;
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked()) {
node->note->content()->toLink(&url, &title, node->fullPath);
if (!url.isEmpty()) {
@@ -227,8 +227,8 @@ void NoteDrag::serializeLinks(NoteSelection *noteList, KMultipleDrag *multipleDr
multipleDrag->addDragObject(urlsDrag);
#else
KURLDrag2 *urlsDrag = new KURLDrag2(urls);
- QByteArray byteArray = urlsDrag->encodedData2("text/uri-list");
- QStoredDrag *uriListDrag = new QStoredDrag("text/uri-list");
+ TQByteArray byteArray = urlsDrag->tqencodedData2("text/uri-list");
+ TQStoredDrag *uriListDrag = new TQStoredDrag("text/uri-list");
uriListDrag->setEncodedData(byteArray);
multipleDrag->addDragObject(uriListDrag);
delete urlsDrag;
@@ -237,22 +237,22 @@ void NoteDrag::serializeLinks(NoteSelection *noteList, KMultipleDrag *multipleDr
// A version for Mozilla applications (convert to "theUrl\ntheTitle", into UTF-16):
// FIXME: Does Mozilla support the drag of several URLs at once?
// FIXME: If no, only provide that if theire is only ONE URL.
- QString xMozUrl;
+ TQString xMozUrl;
for (uint i = 0; i < urls.count(); ++i)
xMozUrl += (xMozUrl.isEmpty() ? "" : "\n") + urls[i].prettyURL() + "\n" + titles[i];
/* Code for only one: ===============
xMozUrl = note->title() + "\n" + note->url().prettyURL();*/
- QByteArray baMozUrl;
- QTextStream stream(baMozUrl, IO_WriteOnly);
- stream.setEncoding(QTextStream::RawUnicode); // It's UTF16 (aka UCS2), but with the first two order bytes
+ TQByteArray baMozUrl;
+ TQTextStream stream(baMozUrl, IO_WriteOnly);
+ stream.setEncoding(TQTextStream::RawUnicode); // It's UTF16 (aka UCS2), but with the first two order bytes
stream << xMozUrl;
- QStoredDrag *xMozUrlDrag = new QStoredDrag("text/x-moz-url");
+ TQStoredDrag *xMozUrlDrag = new TQStoredDrag("text/x-moz-url");
xMozUrlDrag->setEncodedData(baMozUrl);
multipleDrag->addDragObject(xMozUrlDrag);
if (cutting) {
- QByteArray arrayCut(2);
- QStoredDrag *storedDragCut = new QStoredDrag("application/x-kde-cutselection");
+ TQByteArray arrayCut(2);
+ TQStoredDrag *storedDragCut = new TQStoredDrag("application/x-kde-cutselection");
arrayCut[0] = '1';
arrayCut[1] = 0;
storedDragCut->setEncodedData(arrayCut);
@@ -263,37 +263,37 @@ void NoteDrag::serializeLinks(NoteSelection *noteList, KMultipleDrag *multipleDr
void NoteDrag::setFeedbackPixmap(NoteSelection *noteList, KMultipleDrag *multipleDrag)
{
- QPixmap pixmap = feedbackPixmap(noteList);
+ TQPixmap pixmap = feedbackPixmap(noteList);
if (!pixmap.isNull())
- multipleDrag->setPixmap(pixmap, QPoint(-8, -8));
+ multipleDrag->setPixmap(pixmap, TQPoint(-8, -8));
}
-QPixmap NoteDrag::feedbackPixmap(NoteSelection *noteList)
+TQPixmap NoteDrag::feedbackPixmap(NoteSelection *noteList)
{
if (noteList == 0)
- return QPixmap();
+ return TQPixmap();
static const int MARGIN = 2;
static const int SPACING = 1;
- QColor textColor = noteList->firstStacked()->note->basket()->textColor();
- QColor backgroundColor = noteList->firstStacked()->note->basket()->backgroundColor().dark(NoteContent::FEEDBACK_DARKING);
+ TQColor textColor = noteList->firstStacked()->note->basket()->textColor();
+ TQColor backgroundColor = noteList->firstStacked()->note->basket()->backgroundColor().dark(NoteContent::FEEDBACK_DARKING);
- QValueList<QPixmap> pixmaps;
- QValueList<QColor> backgrounds;
- QValueList<bool> spaces;
- QPixmap pixmap;
+ TQValueList<TQPixmap> pixmaps;
+ TQValueList<TQColor> backgrounds;
+ TQValueList<bool> spaces;
+ TQPixmap pixmap;
int height = 0;
int width = 0;
int i = 0;
bool elipsisImage = false;
- QColor bgColor;
+ TQColor bgColor;
bool needSpace;
for (NoteSelection *node = noteList->firstStacked(); node; node = node->nextStacked(), ++i) {
if (elipsisImage) {
- pixmap = QPixmap(7, 2);
+ pixmap = TQPixmap(7, 2);
pixmap.fill(backgroundColor);
- QPainter painter(&pixmap);
+ TQPainter painter(&pixmap);
painter.setPen(textColor);
painter.drawPoint(1, 1);
painter.drawPoint(3, 1);
@@ -320,13 +320,13 @@ QPixmap NoteDrag::feedbackPixmap(NoteSelection *noteList)
}
}
if (!pixmaps.isEmpty()) {
- QPixmap result(MARGIN + width + MARGIN, MARGIN + height - SPACING + MARGIN - (spaces.last() ? 1 : 0));
- QPainter painter(&result);
+ TQPixmap result(MARGIN + width + MARGIN, MARGIN + height - SPACING + MARGIN - (spaces.last() ? 1 : 0));
+ TQPainter painter(&result);
// Draw all the images:
height = MARGIN;
- QValueList<QPixmap>::iterator it;
- QValueList<QColor>::iterator it2;
- QValueList<bool>::iterator it3;
+ TQValueList<TQPixmap>::iterator it;
+ TQValueList<TQColor>::iterator it2;
+ TQValueList<bool>::iterator it3;
int i = 0;
for (it = pixmaps.begin(), it2 = backgrounds.begin(), it3 = spaces.begin(); it != pixmaps.end(); ++it, ++it2, ++it3, ++i) {
if (i != 0 && (*it3)) {
@@ -362,41 +362,41 @@ QPixmap NoteDrag::feedbackPixmap(NoteSelection *noteList)
painter.drawLine(1, result.height() - 2, result.width() - 2, result.height() - 2);
painter.drawLine(result.width() - 2, 1, result.width() - 2, result.height() - 2);
// And assign the feedback pixmap to the drag object:
- //multipleDrag->setPixmap(result, QPoint(-8, -8));
+ //multipleDrag->setPixmap(result, TQPoint(-8, -8));
return result;
}
- return QPixmap();
+ return TQPixmap();
}
-bool NoteDrag::canDecode(QMimeSource *source)
+bool NoteDrag::canDecode(TQMimeSource *source)
{
return source->provides(NOTE_MIME_STRING);
}
-Basket* NoteDrag::basketOf(QMimeSource *source)
+Basket* NoteDrag::basketOf(TQMimeSource *source)
{
- QBuffer buffer(source->encodedData(NOTE_MIME_STRING));
+ TQBuffer buffer(source->tqencodedData(NOTE_MIME_STRING));
if (buffer.open(IO_ReadOnly)) {
- QDataStream stream(&buffer);
- // Get the parent basket:
- Q_UINT64 basketPointer;
- stream >> (Q_UINT64&)basketPointer;
+ TQDataStream stream(&buffer);
+ // Get the tqparent basket:
+ TQ_UINT64 basketPointer;
+ stream >> (TQ_UINT64&)basketPointer;
return (Basket*)basketPointer;
} else
return 0;
}
-QValueList<Note*> NoteDrag::notesOf(QMimeSource *source)
+TQValueList<Note*> NoteDrag::notesOf(TQMimeSource *source)
{
- QBuffer buffer(source->encodedData(NOTE_MIME_STRING));
+ TQBuffer buffer(source->tqencodedData(NOTE_MIME_STRING));
if (buffer.open(IO_ReadOnly)) {
- QDataStream stream(&buffer);
- // Get the parent basket:
- Q_UINT64 basketPointer;
- stream >> (Q_UINT64&)basketPointer;
+ TQDataStream stream(&buffer);
+ // Get the tqparent basket:
+ TQ_UINT64 basketPointer;
+ stream >> (TQ_UINT64&)basketPointer;
// Get the note list:
- Q_UINT64 notePointer;
- QValueList<Note*> notes;
+ TQ_UINT64 notePointer;
+ TQValueList<Note*> notes;
do {
stream >> notePointer;
if (notePointer != 0)
@@ -405,28 +405,28 @@ QValueList<Note*> NoteDrag::notesOf(QMimeSource *source)
// Done:
return notes;
} else
- return QValueList<Note*>();
+ return TQValueList<Note*>();
}
-Note* NoteDrag::decode(QMimeSource *source, Basket *parent, bool moveFiles, bool moveNotes)
+Note* NoteDrag::decode(TQMimeSource *source, Basket *tqparent, bool moveFiles, bool moveNotes)
{
- QBuffer buffer(source->encodedData(NOTE_MIME_STRING));
+ TQBuffer buffer(source->tqencodedData(NOTE_MIME_STRING));
if (buffer.open(IO_ReadOnly)) {
- QDataStream stream(&buffer);
- // Get the parent basket:
- Q_UINT64 basketPointer;
- stream >> (Q_UINT64&)basketPointer;
+ TQDataStream stream(&buffer);
+ // Get the tqparent basket:
+ TQ_UINT64 basketPointer;
+ stream >> (TQ_UINT64&)basketPointer;
Basket *basket = (Basket*)basketPointer;
// Get the note list:
- Q_UINT64 notePointer;
- QValueList<Note*> notes;
+ TQ_UINT64 notePointer;
+ TQValueList<Note*> notes;
do {
stream >> notePointer;
if (notePointer != 0)
notes.append((Note*)notePointer);
} while (notePointer);
// Decode the note hierarchy:
- Note *hierarchy = decodeHierarchy(stream, parent, moveFiles, moveNotes, basket);
+ Note *hierarchy = decodeHierarchy(stream, tqparent, moveFiles, moveNotes, basket);
// In case we moved notes from one basket to another, save the source basket where notes were removed:
basket->filterAgainDelayed(); // Delayed, because if a note is moved to the same basket, the note is not at its
basket->save(); // new position yet, and the call to ensureNoteVisible would make the interface flicker!!
@@ -435,14 +435,14 @@ Note* NoteDrag::decode(QMimeSource *source, Basket *parent, bool moveFiles, bool
return 0;
}
-Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFiles, bool moveNotes, Basket *originalBasket)
+Note* NoteDrag::decodeHierarchy(TQDataStream &stream, Basket *tqparent, bool moveFiles, bool moveNotes, Basket *originalBasket)
{
- Q_UINT64 notePointer;
- Q_UINT64 type;
- QString fileName;
- QString fullPath;
- QDateTime addedDate;
- QDateTime lastModificationDate;
+ TQ_UINT64 notePointer;
+ TQ_UINT64 type;
+ TQString fileName;
+ TQString fullPath;
+ TQDateTime addedDate;
+ TQDateTime lastModificationDate;
Note *firstNote = 0; // TODO: class NoteTreeChunk
Note *lastInserted = 0;
@@ -454,12 +454,12 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
Note *oldNote = (Note*)notePointer;
Note *note = 0;
- Q_UINT64 groupWidth;
+ TQ_UINT64 groupWidth;
stream >> type >> groupWidth;
if (type == NoteType::Group) {
- note = new Note(parent);
+ note = new Note(tqparent);
note->setGroupWidth(groupWidth);
- Q_UINT64 isFolded;
+ TQ_UINT64 isFolded;
stream >> isFolded;
if (isFolded)
note->toggleFolded(/*animate=*/false);
@@ -468,7 +468,7 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
note->setY(oldNote->y()); // We just set the position of the copied group so the animation seems as if the group is the same as (or a copy of) the old.
note->setHeight(oldNote->height()); // Idem: the only use of Note::setHeight()
}
- Note* childs = decodeHierarchy(stream, parent, moveFiles, moveNotes, originalBasket);
+ Note* childs = decodeHierarchy(stream, tqparent, moveFiles, moveNotes, originalBasket);
if (childs) {
for (Note *n = childs; n; n = n->next())
n->setParentNote(note);
@@ -479,21 +479,21 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
if (moveNotes) {
originalBasket->unplugNote(oldNote);
note = oldNote;
- if (note->basket() != parent) {
- QString newFileName = NoteFactory::createFileForNewNote(parent, "", fileName);
+ if (note->basket() != tqparent) {
+ TQString newFileName = NoteFactory::createFileForNewNote(tqparent, "", fileName);
note->content()->setFileName(newFileName);
- KIO::FileCopyJob *copyJob = KIO::file_move(KURL(fullPath), KURL(parent->fullPath() + newFileName),
+ KIO::FileCopyJob *copyJob = KIO::file_move(KURL(fullPath), KURL(tqparent->fullPath() + newFileName),
/*perms=*/-1, /*override=*/true, /*resume=*/false, /*showProgressInfo=*/false);
- parent->connect( copyJob, SIGNAL(result(KIO::Job *)),
- parent, SLOT(slotCopyingDone2(KIO::Job *)) );
+ tqparent->connect( copyJob, TQT_SIGNAL(result(KIO::Job *)),
+ tqparent, TQT_SLOT(slotCopyingDone2(KIO::Job *)) );
}
note->setGroupWidth(groupWidth);
note->setParentNote(0);
note->setPrev(0);
note->setNext(0);
- note->setParentBasket(parent);
+ note->setParentBasket(tqparent);
NoteFactory::consumeContent(stream, (NoteType::Id)type);
- } else if ( (note = NoteFactory::decodeContent(stream, (NoteType::Id)type, parent)) ) {
+ } else if ( (note = NoteFactory::decodeContent(stream, (NoteType::Id)type, tqparent)) ) {
note->setGroupWidth(groupWidth);
note->setAddedDate(addedDate);
note->setLastModificationDate(lastModificationDate);
@@ -501,17 +501,17 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
// Here we are CREATING a new EMPTY file, so the name is RESERVED
// (while dropping several files at once a filename cannot be used by two of them).
// Later on, file_copy/file_move will copy/move the file to the new location.
- QString newFileName = NoteFactory::createFileForNewNote(parent, "", fileName);
- note = NoteFactory::loadFile(newFileName, (NoteType::Id)type, parent);
+ TQString newFileName = NoteFactory::createFileForNewNote(tqparent, "", fileName);
+ note = NoteFactory::loadFile(newFileName, (NoteType::Id)type, tqparent);
KIO::FileCopyJob *copyJob;
if (moveFiles)
- copyJob = KIO::file_move(KURL(fullPath), KURL(parent->fullPath() + newFileName),
+ copyJob = KIO::file_move(KURL(fullPath), KURL(tqparent->fullPath() + newFileName),
/*perms=*/-1, /*override=*/true, /*resume=*/false, /*showProgressInfo=*/false);
else
- copyJob = KIO::file_copy(KURL(fullPath), KURL(parent->fullPath() + newFileName),
+ copyJob = KIO::file_copy(KURL(fullPath), KURL(tqparent->fullPath() + newFileName),
/*perms=*/-1, /*override=*/true, /*resume=*/false, /*showProgressInfo=*/false);
- parent->connect( copyJob, SIGNAL(result(KIO::Job *)),
- parent, SLOT(slotCopyingDone2(KIO::Job *)) );
+ tqparent->connect( copyJob, TQT_SIGNAL(result(KIO::Job *)),
+ tqparent, TQT_SLOT(slotCopyingDone2(KIO::Job *)) );
note->setGroupWidth(groupWidth);
note->setAddedDate(addedDate);
note->setLastModificationDate(lastModificationDate);
@@ -519,7 +519,7 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
}
// Retreive the states (tags) and assign them to the note:
if (note && note->content()) {
- Q_UINT64 statePointer;
+ TQ_UINT64 statePointer;
do {
stream >> statePointer;
if (statePointer)
@@ -544,22 +544,22 @@ Note* NoteDrag::decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFi
/** ExtendedTextDrag */
-bool ExtendedTextDrag::decode(const QMimeSource *e, QString &str)
+bool ExtendedTextDrag::decode(const TQMimeSource *e, TQString &str)
{
- QCString subtype("plain");
+ TQCString subtype("plain");
return decode(e, str, subtype);
}
-bool ExtendedTextDrag::decode(const QMimeSource *e, QString &str, QCString &subtype)
+bool ExtendedTextDrag::decode(const TQMimeSource *e, TQString &str, TQCString &subtype)
{
// Get the string:
- bool ok = QTextDrag::decode(e, str, subtype);
+ bool ok = TQTextDrag::decode(e, str, subtype);
// Test if it was a UTF-16 string (from eg. Mozilla):
if (str.length() >= 2) {
if ((str[0] == 0xFF && str[1] == 0xFE) || (str[0] == 0xFE && str[1] == 0xFF)) {
- QByteArray utf16 = e->encodedData(QString("text/" + subtype).local8Bit());
- str = QTextCodec::codecForName("utf16")->toUnicode(utf16);
+ TQByteArray utf16 = e->tqencodedData(TQString("text/" + subtype).local8Bit());
+ str = TQTextCodec::codecForName("utf16")->toUnicode(utf16);
return true;
}
}
@@ -567,23 +567,23 @@ bool ExtendedTextDrag::decode(const QMimeSource *e, QString &str, QCString &subt
// Test if it was empty (sometimes, from GNOME or Mozilla)
if (str.length() == 0 && subtype == "plain") {
if (e->provides("UTF8_STRING")) {
- QByteArray utf8 = e->encodedData("UTF8_STRING");
- str = QTextCodec::codecForName("utf8")->toUnicode(utf8);
+ TQByteArray utf8 = e->tqencodedData("UTF8_STRING");
+ str = TQTextCodec::codecForName("utf8")->toUnicode(utf8);
return true;
}
- if (e->provides("text/unicode")) { // FIXME: It's UTF-16 without order bytes!!!
- QByteArray utf16 = e->encodedData("text/unicode");
- str = QTextCodec::codecForName("utf16")->toUnicode(utf16);
+ if (e->provides("text/tqunicode")) { // FIXME: It's UTF-16 without order bytes!!!
+ TQByteArray utf16 = e->tqencodedData("text/tqunicode");
+ str = TQTextCodec::codecForName("utf16")->toUnicode(utf16);
return true;
}
if (e->provides("TEXT")) { // local encoding
- QByteArray text = e->encodedData("TEXT");
- str = QString(text);
+ TQByteArray text = e->tqencodedData("TEXT");
+ str = TQString(text);
return true;
}
if (e->provides("COMPOUND_TEXT")) { // local encoding
- QByteArray text = e->encodedData("COMPOUND_TEXT");
- str = QString(text);
+ TQByteArray text = e->tqencodedData("COMPOUND_TEXT");
+ str = TQString(text);
return true;
}
}
diff --git a/src/notedrag.h b/src/notedrag.h
index 6dd9c62..3482c01 100644
--- a/src/notedrag.h
+++ b/src/notedrag.h
@@ -21,14 +21,14 @@
#ifndef NOTEDRAG_H
#define NOTEDRAG_H
-#include <qstring.h>
-#include <qdragobject.h>
-#include <qdatastream.h>
-#include <qpixmap.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqdragobject.h>
+#include <tqdatastream.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
#include <kmultipledrag.h>
-class QDataStream;
+class TQDataStream;
class Basket;
class Note;
@@ -54,49 +54,51 @@ class NoteSelection;
class NoteDrag
{
protected:
- static void serializeNotes( NoteSelection *noteList, QDataStream &stream, bool cutting );
+ static void serializeNotes( NoteSelection *noteList, TQDataStream &stream, bool cutting );
static void serializeText( NoteSelection *noteList, KMultipleDrag *multipleDrag );
static void serializeHtml( NoteSelection *noteList, KMultipleDrag *multipleDrag );
static void serializeImage( NoteSelection *noteList, KMultipleDrag *multipleDrag );
static void serializeLinks( NoteSelection *noteList, KMultipleDrag *multipleDrag, bool cutting );
static void setFeedbackPixmap( NoteSelection *noteList, KMultipleDrag *multipleDrag );
- static Note* decodeHierarchy(QDataStream &stream, Basket *parent, bool moveFiles, bool moveNotes, Basket *originalBasket);
+ static Note* decodeHierarchy(TQDataStream &stream, Basket *tqparent, bool moveFiles, bool moveNotes, Basket *originalBasket);
public:
- static QPixmap feedbackPixmap(NoteSelection *noteList);
- static QDragObject* dragObject(NoteSelection *noteList, bool cutting, QWidget *source = 0);
- static bool canDecode(QMimeSource *source);
- static Note* decode(QMimeSource *source, Basket *parent, bool moveFiles, bool moveNotes);
- static Basket* basketOf(QMimeSource *source);
- static QValueList<Note*> notesOf(QMimeSource *source);
+ static TQPixmap feedbackPixmap(NoteSelection *noteList);
+ static TQDragObject* dragObject(NoteSelection *noteList, bool cutting, TQWidget *source = 0);
+ static bool canDecode(TQMimeSource *source);
+ static Note* decode(TQMimeSource *source, Basket *tqparent, bool moveFiles, bool moveNotes);
+ static Basket* basketOf(TQMimeSource *source);
+ static TQValueList<Note*> notesOf(TQMimeSource *source);
static void createAndEmptyCuttingTmpFolder();
static const char *NOTE_MIME_STRING;
};
-/** QTextDrag with capabilities to drop GNOME and Mozilla texts
+/** TQTextDrag with capabilities to drop GNOME and Mozilla texts
* as well as UTF-16 texts even if it was supposed to be encoded
* with local encoding!
* @author Sébastien Laoût
*/
-class ExtendedTextDrag : public QTextDrag
+class ExtendedTextDrag : public TQTextDrag
{
Q_OBJECT
+ TQ_OBJECT
public:
- static bool decode(const QMimeSource *e, QString &str);
- static bool decode(const QMimeSource *e, QString &str, QCString &subtype);
+ static bool decode(const TQMimeSource *e, TQString &str);
+ static bool decode(const TQMimeSource *e, TQString &str, TQCString &subtype);
};
-// Support KDE 3.3 and older PROTECTED KURLDrag::encodedData()!
+// Support KDE 3.3 and older PROTECTED KURLDrag::tqencodedData()!
#include <kurldrag.h>
class KURLDrag2 : public KURLDrag
{
Q_OBJECT
+ TQ_OBJECT
public:
KURLDrag2(const KURL::List &urls) : KURLDrag(urls) {}
- QByteArray encodedData2(const char *mime) const
+ TQByteArray tqencodedData2(const char *mime) const
{
- return encodedData(mime);
+ return tqencodedData(mime);
}
};
diff --git a/src/noteedit.cpp b/src/noteedit.cpp
index b2d25dd..1727164 100644
--- a/src/noteedit.cpp
+++ b/src/noteedit.cpp
@@ -18,9 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qlineedit.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <kicondialog.h>
@@ -67,48 +67,48 @@ Note* NoteEditor::note()
return m_noteContent->note();
}
-NoteEditor* NoteEditor::editNoteContent(NoteContent *noteContent, QWidget *parent)
+NoteEditor* NoteEditor::editNoteContent(NoteContent *noteContent, TQWidget *tqparent)
{
TextContent *textContent = dynamic_cast<TextContent*>(noteContent);
if (textContent)
- return new TextEditor(textContent, parent);
+ return new TextEditor(textContent, tqparent);
HtmlContent *htmlContent = dynamic_cast<HtmlContent*>(noteContent);
if (htmlContent)
- return new HtmlEditor(htmlContent, parent);
+ return new HtmlEditor(htmlContent, tqparent);
ImageContent *imageContent = dynamic_cast<ImageContent*>(noteContent);
if (imageContent)
- return new ImageEditor(imageContent, parent);
+ return new ImageEditor(imageContent, tqparent);
AnimationContent *animationContent = dynamic_cast<AnimationContent*>(noteContent);
if (animationContent)
- return new AnimationEditor(animationContent, parent);
+ return new AnimationEditor(animationContent, tqparent);
FileContent *fileContent = dynamic_cast<FileContent*>(noteContent); // Same for SoundContent
if (fileContent)
- return new FileEditor(fileContent, parent);
+ return new FileEditor(fileContent, tqparent);
LinkContent *linkContent = dynamic_cast<LinkContent*>(noteContent);
if (linkContent)
- return new LinkEditor(linkContent, parent);
+ return new LinkEditor(linkContent, tqparent);
LauncherContent *launcherContent = dynamic_cast<LauncherContent*>(noteContent);
if (launcherContent)
- return new LauncherEditor(launcherContent, parent);
+ return new LauncherEditor(launcherContent, tqparent);
ColorContent *colorContent = dynamic_cast<ColorContent*>(noteContent);
if (colorContent)
- return new ColorEditor(colorContent, parent);
+ return new ColorEditor(colorContent, tqparent);
UnknownContent *unknownContent = dynamic_cast<UnknownContent*>(noteContent);
if (unknownContent)
- return new UnknownEditor(unknownContent, parent);
+ return new UnknownEditor(unknownContent, tqparent);
return 0;
}
-void NoteEditor::setInlineEditor(QWidget *inlineEditor)
+void NoteEditor::setInlineEditor(TQWidget *inlineEditor)
{
m_widget = inlineEditor;
m_textEdit = 0;
@@ -118,7 +118,7 @@ void NoteEditor::setInlineEditor(QWidget *inlineEditor)
if (textEdit)
m_textEdit = textEdit;
else {
- QLineEdit *lineEdit = dynamic_cast<QLineEdit*>(inlineEditor);
+ TQLineEdit *lineEdit = dynamic_cast<TQLineEdit*>(inlineEditor);
if (lineEdit)
m_lineEdit = lineEdit;
}
@@ -128,29 +128,29 @@ void NoteEditor::setInlineEditor(QWidget *inlineEditor)
/** class TextEditor: */
-TextEditor::TextEditor(TextContent *textContent, QWidget *parent)
+TextEditor::TextEditor(TextContent *textContent, TQWidget *tqparent)
: NoteEditor(textContent), m_textContent(textContent)
{
- FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, parent);
+ FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, tqparent);
textEdit->setLineWidth(0);
textEdit->setMidLineWidth(0);
- textEdit->setTextFormat(Qt::PlainText);
+ textEdit->setTextFormat(TQt::PlainText);
textEdit->setPaletteBackgroundColor(note()->backgroundColor());
textEdit->setPaletteForegroundColor(note()->textColor());
textEdit->setFont(note()->font());
- textEdit->setHScrollBarMode(QScrollView::AlwaysOff);
+ textEdit->setHScrollBarMode(TQScrollView::AlwaysOff);
if (Settings::spellCheckTextNotes())
textEdit->setCheckSpellingEnabled(true);
textEdit->setText(m_textContent->text());
textEdit->moveCursor(KTextEdit::MoveEnd, false); // FIXME: Sometimes, the cursor flicker at ends before being positionned where clicked (because kapp->processEvents() I think)
- textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
+ textEdit->verticalScrollBar()->setCursor(TQt::ArrowCursor);
setInlineEditor(textEdit);
- connect( textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
- connect( textEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
+ connect( textEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( textEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), textContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), textContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
// In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
- QTimer::singleShot( 0, textContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ TQTimer::singleShot( 0, textContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
}
TextEditor::~TextEditor()
@@ -199,75 +199,75 @@ void TextEditor::validate()
/** class HtmlEditor: */
-HtmlEditor::HtmlEditor(HtmlContent *htmlContent, QWidget *parent)
+HtmlEditor::HtmlEditor(HtmlContent *htmlContent, TQWidget *tqparent)
: NoteEditor(htmlContent), m_htmlContent(htmlContent)
{
- FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, parent);
+ FocusedTextEdit *textEdit = new FocusedTextEdit(/*disableUpdatesOnKeyPress=*/true, tqparent);
textEdit->setLineWidth(0);
textEdit->setMidLineWidth(0);
- textEdit->setTextFormat(Qt::RichText);
- textEdit->setAutoFormatting(Settings::autoBullet() ? QTextEdit::AutoAll : QTextEdit::AutoNone);
+ textEdit->setTextFormat(TQt::RichText);
+ textEdit->setAutoFormatting(Settings::autoBullet() ? TQTextEdit::AutoAll : TQTextEdit::AutoNone);
textEdit->setPaletteBackgroundColor(note()->backgroundColor());
textEdit->setPaletteForegroundColor(note()->textColor());
textEdit->setFont(note()->font());
- textEdit->setHScrollBarMode(QScrollView::AlwaysOff);
+ textEdit->setHScrollBarMode(TQScrollView::AlwaysOff);
textEdit->setText(m_htmlContent->html());
textEdit->moveCursor(KTextEdit::MoveEnd, false);
- textEdit->verticalScrollBar()->setCursor(Qt::ArrowCursor);
+ textEdit->verticalScrollBar()->setCursor(TQt::ArrowCursor);
setInlineEditor(textEdit);
- connect( textEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
- connect( textEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
+ connect( textEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
+ connect( textEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(textChanged(const QString&)), textEdit, SLOT(setFamily(const QString&)) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(sizeChanged(int)), textEdit, SLOT(setPointSize(int)) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(activated(const QColor&)), textEdit, SLOT(setColor(const QColor&)) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(textChanged(const TQString&)), textEdit, TQT_SLOT(setFamily(const TQString&)) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(sizeChanged(int)), textEdit, TQT_SLOT(setPointSize(int)) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(activated(const TQColor&)), textEdit, TQT_SLOT(setColor(const TQColor&)) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFont, SIGNAL(activated(int)), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFont, TQT_SIGNAL(activated(int)), textEdit, TQT_SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextFontSize, SIGNAL(activated(int)), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextFontSize, TQT_SIGNAL(activated(int)), textEdit, TQT_SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(escapePressed()), textEdit, SLOT(setFocus()) );
- connect( InlineEditors::instance()->richTextColor, SIGNAL(returnPressed2()), textEdit, SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(escapePressed()), textEdit, TQT_SLOT(setFocus()) );
+ connect( InlineEditors::instance()->richTextColor, TQT_SIGNAL(returnPressed2()), textEdit, TQT_SLOT(setFocus()) );
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(cursorPositionChanged()) );
- connect( textEdit, SIGNAL(clicked(int, int)), this, SLOT(cursorPositionChanged()) );
- connect( textEdit, SIGNAL(currentFontChanged(const QFont&)), this, SLOT(fontChanged(const QFont&)) );
-// connect( textEdit, SIGNAL(currentVerticalAlignmentChanged(VerticalAlignment)), this, SLOT(slotVerticalAlignmentChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), this, TQT_SLOT(cursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(clicked(int, int)), this, TQT_SLOT(cursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(currentFontChanged(const TQFont&)), this, TQT_SLOT(fontChanged(const TQFont&)) );
+// connect( textEdit, TQT_SIGNAL(currentVerticalAlignmentChangedQt::VerticalAlignment)), this, TQT_SLOT(slotVerticalAlignmentChanged()) );
- connect( InlineEditors::instance()->richTextBold, SIGNAL(toggled(bool)), textEdit, SLOT(setBold(bool)) );
- connect( InlineEditors::instance()->richTextItalic, SIGNAL(toggled(bool)), textEdit, SLOT(setItalic(bool)) );
- connect( InlineEditors::instance()->richTextUnderline, SIGNAL(toggled(bool)), textEdit, SLOT(setUnderline(bool)) );
+ connect( InlineEditors::instance()->richTextBold, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setBold(bool)) );
+ connect( InlineEditors::instance()->richTextItalic, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setItalic(bool)) );
+ connect( InlineEditors::instance()->richTextUnderline, TQT_SIGNAL(toggled(bool)), textEdit, TQT_SLOT(setUnderline(bool)) );
//REMOVE:
- //connect( InlineEditors::instance()->richTextBold, SIGNAL(activated()), this, SLOT(setBold()) );
- //connect( InlineEditors::instance()->richTextItalic, SIGNAL(activated()), this, SLOT(setItalic()) );
- //connect( InlineEditors::instance()->richTextUnderline, SIGNAL(activated()), this, SLOT(setUnderline()) );
- connect( InlineEditors::instance()->richTextLeft, SIGNAL(activated()), this, SLOT(setLeft()) );
- connect( InlineEditors::instance()->richTextCenter, SIGNAL(activated()), this, SLOT(setCentered()) );
- connect( InlineEditors::instance()->richTextRight, SIGNAL(activated()), this, SLOT(setRight()) );
- connect( InlineEditors::instance()->richTextJustified, SIGNAL(activated()), this, SLOT(setBlock()) );
+ //connect( InlineEditors::instance()->richTextBold, TQT_SIGNAL(activated()), this, TQT_SLOT(setBold()) );
+ //connect( InlineEditors::instance()->richTextItalic, TQT_SIGNAL(activated()), this, TQT_SLOT(setItalic()) );
+ //connect( InlineEditors::instance()->richTextUnderline, TQT_SIGNAL(activated()), this, TQT_SLOT(setUnderline()) );
+ connect( InlineEditors::instance()->richTextLeft, TQT_SIGNAL(activated()), this, TQT_SLOT(setLeft()) );
+ connect( InlineEditors::instance()->richTextCenter, TQT_SIGNAL(activated()), this, TQT_SLOT(setCentered()) );
+ connect( InlineEditors::instance()->richTextRight, TQT_SIGNAL(activated()), this, TQT_SLOT(setRight()) );
+ connect( InlineEditors::instance()->richTextJustified, TQT_SIGNAL(activated()), this, TQT_SLOT(setBlock()) );
// InlineEditors::instance()->richTextToolBar()->show();
cursorPositionChanged();
fontChanged(textEdit->currentFont());
- //QTimer::singleShot( 0, this, SLOT(cursorPositionChanged()) );
+ //TQTimer::singleShot( 0, this, TQT_SLOT(cursorPositionChanged()) );
InlineEditors::instance()->enableRichTextToolBar();
- connect( InlineEditors::instance()->richTextUndo, SIGNAL(activated()), textEdit, SLOT(undo()) );
- connect( InlineEditors::instance()->richTextRedo, SIGNAL(activated()), textEdit, SLOT(redo()) );
- connect( textEdit, SIGNAL(undoAvailable(bool)), InlineEditors::instance()->richTextUndo, SLOT(setEnabled(bool)) );
- connect( textEdit, SIGNAL(redoAvailable(bool)), InlineEditors::instance()->richTextRedo, SLOT(setEnabled(bool)) );
- connect( textEdit, SIGNAL(textChanged()), this, SLOT(textChanged()));
+ connect( InlineEditors::instance()->richTextUndo, TQT_SIGNAL(activated()), textEdit, TQT_SLOT(undo()) );
+ connect( InlineEditors::instance()->richTextRedo, TQT_SIGNAL(activated()), textEdit, TQT_SLOT(redo()) );
+ connect( textEdit, TQT_SIGNAL(undoAvailable(bool)), InlineEditors::instance()->richTextUndo, TQT_SLOT(setEnabled(bool)) );
+ connect( textEdit, TQT_SIGNAL(redoAvailable(bool)), InlineEditors::instance()->richTextRedo, TQT_SLOT(setEnabled(bool)) );
+ connect( textEdit, TQT_SIGNAL(textChanged()), this, TQT_SLOT(textChanged()));
InlineEditors::instance()->richTextUndo->setEnabled(false);
InlineEditors::instance()->richTextRedo->setEnabled(false);
- connect( textEdit, SIGNAL(cursorPositionChanged(int, int)), htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ connect( textEdit, TQT_SIGNAL(cursorPositionChanged(int, int)), htmlContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
// In case it is a very big note, the top is displayed and Enter is pressed: the cursor is on bottom, we should enure it visible:
- QTimer::singleShot( 0, htmlContent->note()->basket(), SLOT(editorCursorPositionChanged()) );
+ TQTimer::singleShot( 0, htmlContent->note()->basket(), TQT_SLOT(editorCursorPositionChanged()) );
}
void HtmlEditor::cursorPositionChanged()
@@ -279,18 +279,18 @@ void HtmlEditor::cursorPositionChanged()
InlineEditors::instance()->richTextItalic->setChecked( textEdit()->italic() );
InlineEditors::instance()->richTextUnderline->setChecked( textEdit()->underline() );
- switch (textEdit()->alignment()) {
+ switch (textEdit()->tqalignment()) {
default:
- case 1/*Qt::AlignLeft*/: InlineEditors::instance()->richTextLeft->setChecked(true); break;
- case 4/*Qt::AlignCenter*/: InlineEditors::instance()->richTextCenter->setChecked(true); break;
- case 2/*Qt::AlignRight*/: InlineEditors::instance()->richTextRight->setChecked(true); break;
- case -8/*Qt::AlignJustify*/: InlineEditors::instance()->richTextJustified->setChecked(true); break;
+ case 1/*TQt::AlignLeft*/: InlineEditors::instance()->richTextLeft->setChecked(true); break;
+ case 4/*TQt::AlignCenter*/: InlineEditors::instance()->richTextCenter->setChecked(true); break;
+ case 2/*TQt::AlignRight*/: InlineEditors::instance()->richTextRight->setChecked(true); break;
+ case -8/*TQt::AlignJustify*/: InlineEditors::instance()->richTextJustified->setChecked(true); break;
}
}
void HtmlEditor::textChanged()
{
- // The following is a workaround for an apparent Qt bug.
+ // The following is a workaround for an aptqparent TQt bug.
// When I start typing in a textEdit, the undo&redo actions are not enabled until I click
// or move the cursor - probably, the signal undoAvailable() is not emitted.
// So, I had to intervene and do that manually.
@@ -298,14 +298,14 @@ void HtmlEditor::textChanged()
InlineEditors::instance()->richTextRedo->setEnabled(textEdit()->isRedoAvailable());
}
-void HtmlEditor::fontChanged(const QFont &font)
+void HtmlEditor::fontChanged(const TQFont &font)
{
InlineEditors::instance()->richTextFontSize->setFontSize(font.pointSize());
}
-/*void HtmlEditor::slotVe<rticalAlignmentChanged(QTextEdit::VerticalAlignment align)
+/*void HtmlEditor::slotVe<rticalAlignmentChanged(TQTextEdit::VerticalAlignment align)
{
- QTextEdit::VerticalAlignment align = textEdit()
+ TQTextEdit::VerticalAlignment align = textEdit()
switch (align) {
case KTextEdit::AlignSuperScript:
InlineEditors::instance()->richTextSuper->setChecked(true);
@@ -337,10 +337,10 @@ void HtmlEditor::fontChanged(const QFont &font)
//void HtmlEditor::setBold() { textEdit()->setBold( InlineEditors::instance()->richTextBold->isChecked() ); }
//void HtmlEditor::setItalic() { textEdit()->setItalic( InlineEditors::instance()->richTextItalic->isChecked() ); }
//void HtmlEditor::setUnderline() { textEdit()->setUnderline( InlineEditors::instance()->richTextUnderline->isChecked() ); }
-void HtmlEditor::setLeft() { textEdit()->setAlignment(Qt::AlignLeft); }
-void HtmlEditor::setCentered() { textEdit()->setAlignment(Qt::AlignCenter); }
-void HtmlEditor::setRight() { textEdit()->setAlignment(Qt::AlignRight); }
-void HtmlEditor::setBlock() { textEdit()->setAlignment(Qt::AlignJustify); }
+void HtmlEditor::setLeft() { textEdit()->tqsetAlignment(TQt::AlignLeft); }
+void HtmlEditor::setCentered() { textEdit()->tqsetAlignment(TQt::AlignCenter); }
+void HtmlEditor::setRight() { textEdit()->tqsetAlignment(TQt::AlignRight); }
+void HtmlEditor::setBlock() { textEdit()->tqsetAlignment(TQt::AlignJustify); }
HtmlEditor::~HtmlEditor()
{
@@ -378,10 +378,10 @@ void HtmlEditor::validate()
/** class ImageEditor: */
-ImageEditor::ImageEditor(ImageContent *imageContent, QWidget *parent)
+ImageEditor::ImageEditor(ImageContent *imageContent, TQWidget *tqparent)
: NoteEditor(imageContent)
{
- int choice = KMessageBox::questionYesNo(parent, i18n(
+ int choice = KMessageBox::questionYesNo(tqparent, i18n(
"Images can not be edited here at the moment (the next version of BasKet Note Pads will include an image editor).\n"
"Do you want to open it with an application that understand it?"),
i18n("Edit Image Note"),
@@ -394,10 +394,10 @@ ImageEditor::ImageEditor(ImageContent *imageContent, QWidget *parent)
/** class AnimationEditor: */
-AnimationEditor::AnimationEditor(AnimationContent *animationContent, QWidget *parent)
+AnimationEditor::AnimationEditor(AnimationContent *animationContent, TQWidget *tqparent)
: NoteEditor(animationContent)
{
- int choice = KMessageBox::questionYesNo(parent, i18n(
+ int choice = KMessageBox::questionYesNo(tqparent, i18n(
"This animated image can not be edited here.\n"
"Do you want to open it with an application that understands it?"),
i18n("Edit Animation Note"),
@@ -410,10 +410,10 @@ AnimationEditor::AnimationEditor(AnimationContent *animationContent, QWidget *pa
/** class FileEditor: */
-FileEditor::FileEditor(FileContent *fileContent, QWidget *parent)
+FileEditor::FileEditor(FileContent *fileContent, TQWidget *tqparent)
: NoteEditor(fileContent), m_fileContent(fileContent)
{
- FocusedLineEdit *lineEdit = new FocusedLineEdit(parent);
+ FocusedLineEdit *lineEdit = new FocusedLineEdit(tqparent);
lineEdit->setLineWidth(0);
lineEdit->setMidLineWidth(0);
lineEdit->setPaletteBackgroundColor(note()->backgroundColor());
@@ -422,9 +422,9 @@ FileEditor::FileEditor(FileContent *fileContent, QWidget *parent)
lineEdit->setText(m_fileContent->fileName());
lineEdit->selectAll();
setInlineEditor(lineEdit);
- connect( lineEdit, SIGNAL(returnPressed()), this, SIGNAL(askValidation()) );
- connect( lineEdit, SIGNAL(escapePressed()), this, SIGNAL(askValidation()) );
- connect( lineEdit, SIGNAL(mouseEntered()), this, SIGNAL(mouseEnteredEditorWidget()) );
+ connect( lineEdit, TQT_SIGNAL(returnPressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( lineEdit, TQT_SIGNAL(escapePressed()), this, TQT_SIGNAL(askValidation()) );
+ connect( lineEdit, TQT_SIGNAL(mouseEntered()), this, TQT_SIGNAL(mouseEnteredEditorWidget()) );
}
FileEditor::~FileEditor()
@@ -448,11 +448,11 @@ void FileEditor::validate()
/** class LinkEditor: */
-LinkEditor::LinkEditor(LinkContent *linkContent, QWidget *parent)
+LinkEditor::LinkEditor(LinkContent *linkContent, TQWidget *tqparent)
: NoteEditor(linkContent)
{
- LinkEditDialog dialog(linkContent, parent);
- if (dialog.exec() == QDialog::Rejected)
+ LinkEditDialog dialog(linkContent, tqparent);
+ if (dialog.exec() == TQDialog::Rejected)
cancel();
if (linkContent->url().isEmpty() && linkContent->title().isEmpty())
setEmpty();
@@ -460,11 +460,11 @@ LinkEditor::LinkEditor(LinkContent *linkContent, QWidget *parent)
/** class LauncherEditor: */
-LauncherEditor::LauncherEditor(LauncherContent *launcherContent, QWidget *parent)
+LauncherEditor::LauncherEditor(LauncherContent *launcherContent, TQWidget *tqparent)
: NoteEditor(launcherContent)
{
- LauncherEditDialog dialog(launcherContent, parent);
- if (dialog.exec() == QDialog::Rejected)
+ LauncherEditDialog dialog(launcherContent, tqparent);
+ if (dialog.exec() == TQDialog::Rejected)
cancel();
if (launcherContent->name().isEmpty() && launcherContent->exec().isEmpty())
setEmpty();
@@ -472,13 +472,13 @@ LauncherEditor::LauncherEditor(LauncherContent *launcherContent, QWidget *parent
/** class ColorEditor: */
-ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
+ColorEditor::ColorEditor(ColorContent *colorContent, TQWidget *tqparent)
: NoteEditor(colorContent)
{
- KColorDialog dialog(parent, /*name=*/"EditColor", /*modal=*/true);
+ KColorDialog dialog(tqparent, /*name=*/"EditColor", /*modal=*/true);
dialog.setColor(colorContent->color());
dialog.setCaption(i18n("Edit Color Note"));
- if (dialog.exec() == QDialog::Accepted) {
+ if (dialog.exec() == TQDialog::Accepted) {
if (dialog.color() != colorContent->color()) {
colorContent->setColor(dialog.color());
colorContent->setEdited();
@@ -487,8 +487,8 @@ ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
cancel();
/* This code don't allow to set a caption to the dialog:
- QColor color = colorContent()->color();
- if (KColorDialog::getColor(color, parent) == QDialog::Accepted && color != m_color) {
+ TQColor color = colorContent()->color();
+ if (KColorDialog::getColor(color, tqparent) == TQDialog::Accepted && color != m_color) {
colorContent()->setColor(color);
setEdited();
}*/
@@ -496,10 +496,10 @@ ColorEditor::ColorEditor(ColorContent *colorContent, QWidget *parent)
/** class UnknownEditor: */
-UnknownEditor::UnknownEditor(UnknownContent *unknownContent, QWidget *parent)
+UnknownEditor::UnknownEditor(UnknownContent *unknownContent, TQWidget *tqparent)
: NoteEditor(unknownContent)
{
- KMessageBox::information(parent, i18n(
+ KMessageBox::information(tqparent, i18n(
"The type of this note is unknown and can not be edited here.\n"
"You however can drag or copy the note into an application that understands it."),
i18n("Edit Unknown Note"));
@@ -510,8 +510,8 @@ UnknownEditor::UnknownEditor(UnknownContent *unknownContent, QWidget *parent)
/** class DebuggedLineEdit: */
-DebuggedLineEdit::DebuggedLineEdit(const QString &text, QWidget *parent)
- : QLineEdit(text, parent)
+DebuggedLineEdit::DebuggedLineEdit(const TQString &text, TQWidget *tqparent)
+ : TQLineEdit(text, tqparent)
{
}
@@ -519,10 +519,10 @@ DebuggedLineEdit::~DebuggedLineEdit()
{
}
-void DebuggedLineEdit::keyPressEvent(QKeyEvent *event)
+void DebuggedLineEdit::keyPressEvent(TQKeyEvent *event)
{
- QString oldText = text();
- QLineEdit::keyPressEvent(event);
+ TQString oldText = text();
+ TQLineEdit::keyPressEvent(event);
if (oldText != text())
emit textChanged(text());
}
@@ -530,41 +530,41 @@ void DebuggedLineEdit::keyPressEvent(QKeyEvent *event)
/** class LinkEditDialog: */
-LinkEditDialog::LinkEditDialog(LinkContent *contentNote, QWidget *parent/*, QKeyEvent *ke*/)
+LinkEditDialog::LinkEditDialog(LinkContent *contentNote, TQWidget *tqparent/*, TQKeyEvent *ke*/)
: KDialogBase(KDialogBase::Plain, i18n("Edit Link Note"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"EditLink", /*modal=*/true, /*separator=*/true),
+ KDialogBase::Ok, tqparent, /*name=*/"EditLink", /*modal=*/true, /*separator=*/true),
m_noteContent(contentNote)
{
- QWidget *page = plainPage();
- QGridLayout *layout = new QGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
+ TQWidget *page = plainPage();
+ TQGridLayout *tqlayout = new TQGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
m_url = new KURLRequester(m_noteContent->url().url(), page);
- QWidget *wid1 = new QWidget(page);
- QHBoxLayout *titleLay = new QHBoxLayout(wid1, /*margin=*/0, spacingHint());
+ TQWidget *wid1 = new TQWidget(page);
+ TQHBoxLayout *titleLay = new TQHBoxLayout(wid1, /*margin=*/0, spacingHint());
m_title = new DebuggedLineEdit(m_noteContent->title(), wid1);
- m_autoTitle = new QPushButton(i18n("Auto"), wid1);
+ m_autoTitle = new TQPushButton(i18n("Auto"), wid1);
m_autoTitle->setToggleButton(true);
m_autoTitle->setOn(m_noteContent->autoTitle());
titleLay->addWidget(m_title);
titleLay->addWidget(m_autoTitle);
- QWidget *wid = new QWidget(page);
- QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
+ TQWidget *wid = new TQWidget(page);
+ TQHBoxLayout *hLay = new TQHBoxLayout(wid, /*margin=*/0, spacingHint());
m_icon = new KIconButton(wid);
- QLabel *label3 = new QLabel(m_icon, i18n("&Icon:"), page);
+ TQLabel *label3 = new TQLabel(m_icon, i18n("&Icon:"), page);
KURL filteredURL = NoteFactory::filteredURL(KURL(m_url->lineEdit()->text()));//KURIFilter::self()->filteredURI(KURL(m_url->lineEdit()->text()));
m_icon->setIconType(KIcon::NoGroup, KIcon::MimeType);
m_icon->setIconSize(LinkLook::lookForURL(filteredURL)->iconSize());
- m_autoIcon = new QPushButton(i18n("Auto"), wid); // Create before to know size here:
+ m_autoIcon = new TQPushButton(i18n("Auto"), wid); // Create before to know size here:
/* Icon button: */
m_icon->setIcon(m_noteContent->icon());
- int minSize = m_autoIcon->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = m_autoIcon->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
/* Auto button: */
m_autoIcon->setToggleButton(true);
m_autoIcon->setOn(m_noteContent->autoIcon());
@@ -576,25 +576,25 @@ LinkEditDialog::LinkEditDialog(LinkContent *contentNote, QWidget *parent/*, QKey
m_title->setMinimumWidth(m_title->fontMetrics().maxWidth()*20);
//m_url->setShowLocalProtocol(true);
- QLabel *label1 = new QLabel(m_url, i18n("Ta&rget:"), page);
- QLabel *label2 = new QLabel(m_title, i18n("&Title:"), page);
- layout->addWidget(label1, 0, 0, Qt::AlignVCenter);
- layout->addWidget(label2, 1, 0, Qt::AlignVCenter);
- layout->addWidget(label3, 2, 0, Qt::AlignVCenter);
- layout->addWidget(m_url, 0, 1, Qt::AlignVCenter);
- layout->addWidget(wid1, 1, 1, Qt::AlignVCenter);
- layout->addWidget(wid, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_url, i18n("Ta&rget:"), page);
+ TQLabel *label2 = new TQLabel(m_title, i18n("&Title:"), page);
+ tqlayout->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label3, 2, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(m_url, 0, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid1, 1, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid, 2, 1, TQt::AlignVCenter);
m_isAutoModified = false;
- connect( m_url, SIGNAL(textChanged(const QString&)), this, SLOT(urlChanged(const QString&)) );
- connect( m_title, SIGNAL(textChanged(const QString&)), this, SLOT(doNotAutoTitle(const QString&)) );
- connect( m_icon, SIGNAL(iconChanged(QString)) , this, SLOT(doNotAutoIcon(QString)) );
- connect( m_autoTitle, SIGNAL(clicked()), this, SLOT(guessTitle()) );
- connect( m_autoIcon, SIGNAL(clicked()), this, SLOT(guessIcon()) );
+ connect( m_url, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(urlChanged(const TQString&)) );
+ connect( m_title, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(doNotAutoTitle(const TQString&)) );
+ connect( m_icon, TQT_SIGNAL(iconChanged(TQString)) , this, TQT_SLOT(doNotAutoIcon(TQString)) );
+ connect( m_autoTitle, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessTitle()) );
+ connect( m_autoIcon, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessIcon()) );
- QWidget *stretchWidget = new QWidget(page);
- stretchWidget->setSizePolicy(QSizePolicy(/*hor=*/QSizePolicy::Fixed, /*ver=*/QSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
- layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
+ TQWidget *stretchWidget = new TQWidget(page);
+ stretchWidget->tqsetSizePolicy(TQSizePolicy(/*hor=*/TQSizePolicy::Fixed, /*ver=*/TQSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
+ tqlayout->addWidget(stretchWidget, 3, 1, TQt::AlignVCenter);
urlChanged("");
@@ -620,7 +620,7 @@ void LinkEditDialog::polish()
}
-void LinkEditDialog::urlChanged(const QString&)
+void LinkEditDialog::urlChanged(const TQString&)
{
m_isAutoModified = true;
// guessTitle();
@@ -635,7 +635,7 @@ void LinkEditDialog::urlChanged(const QString&)
}
}
-void LinkEditDialog::doNotAutoTitle(const QString&)
+void LinkEditDialog::doNotAutoTitle(const TQString&)
{
if (m_isAutoModified)
m_isAutoModified = false;
@@ -643,7 +643,7 @@ void LinkEditDialog::doNotAutoTitle(const QString&)
m_autoTitle->setOn(false);
}
-void LinkEditDialog::doNotAutoIcon(QString)
+void LinkEditDialog::doNotAutoIcon(TQString)
{
m_autoIcon->setOn(false);
}
@@ -673,50 +673,50 @@ void LinkEditDialog::slotOk()
/* Change icon size if link look have changed */
LinkLook *linkLook = LinkLook::lookForURL(filteredURL);
- QString icon = m_icon->icon(); // When we change size, icon isn't changed and keep it's old size
- m_icon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); // Reset size policy
+ TQString icon = m_icon->icon(); // When we change size, icon isn't changed and keep it's old size
+ m_icon->tqsetSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Minimum); // Reset size policy
m_icon->setIconSize(linkLook->iconSize()); // So I store it's name and reload it after size change !
m_icon->setIcon(icon);
- int minSize = m_autoIcon->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = m_autoIcon->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
KDialogBase::slotOk();
}
/** class LauncherEditDialog: */
-LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, QWidget *parent)
+LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, TQWidget *tqparent)
: KDialogBase(KDialogBase::Plain, i18n("Edit Launcher Note"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"EditLauncher", /*modal=*/true, /*separator=*/true),
+ KDialogBase::Ok, tqparent, /*name=*/"EditLauncher", /*modal=*/true, /*separator=*/true),
m_noteContent(contentNote)
{
- QWidget *page = plainPage();
- QGridLayout *layout = new QGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
+ TQWidget *page = plainPage();
+ TQGridLayout *tqlayout = new TQGridLayout(page, /*nRows=*/4, /*nCols=*/2, /*margin=*/0, spacingHint());
KService service(contentNote->fullPath());
m_command = new RunCommandRequester(service.exec(), i18n("Choose a command to run:"), page);
- m_name = new QLineEdit(service.name(), page);
+ m_name = new TQLineEdit(service.name(), page);
- QWidget *wid = new QWidget(page);
- QHBoxLayout *hLay = new QHBoxLayout(wid, /*margin=*/0, spacingHint());
+ TQWidget *wid = new TQWidget(page);
+ TQHBoxLayout *hLay = new TQHBoxLayout(wid, /*margin=*/0, spacingHint());
m_icon = new KIconButton(wid);
- QLabel *label = new QLabel(m_icon, i18n("&Icon:"), page);
+ TQLabel *label = new TQLabel(m_icon, i18n("&Icon:"), page);
m_icon->setIconType(KIcon::NoGroup, KIcon::Application);
m_icon->setIconSize(LinkLook::launcherLook->iconSize());
- QPushButton *guessButton = new QPushButton(i18n("&Guess"), wid);
+ TQPushButton *guessButton = new TQPushButton(i18n("&Guess"), wid);
/* Icon button: */
m_icon->setIcon(service.icon());
- int minSize = guessButton->sizeHint().height();
- // Make the icon button at least the same heigh than the other buttons for a better alignment (nicer to the eyes):
- if (m_icon->sizeHint().height() < minSize)
+ int minSize = guessButton->tqsizeHint().height();
+ // Make the icon button at least the same heigh than the other buttons for a better tqalignment (nicer to the eyes):
+ if (m_icon->tqsizeHint().height() < minSize)
m_icon->setFixedSize(minSize, minSize);
else
- m_icon->setFixedSize(m_icon->sizeHint().height(), m_icon->sizeHint().height()); // Make it square
+ m_icon->setFixedSize(m_icon->tqsizeHint().height(), m_icon->tqsizeHint().height()); // Make it square
/* Guess button: */
hLay->addWidget(m_icon);
hLay->addWidget(guessButton);
@@ -724,20 +724,20 @@ LauncherEditDialog::LauncherEditDialog(LauncherContent *contentNote, QWidget *pa
m_command->lineEdit()->setMinimumWidth(m_command->lineEdit()->fontMetrics().maxWidth()*20);
- QLabel *label1 = new QLabel(m_command->lineEdit(), i18n("Comman&d:"), page);
- QLabel *label2 = new QLabel(m_name, i18n("&Name:"), page);
- layout->addWidget(label1, 0, 0, Qt::AlignVCenter);
- layout->addWidget(label2, 1, 0, Qt::AlignVCenter);
- layout->addWidget(label, 2, 0, Qt::AlignVCenter);
- layout->addWidget(m_command, 0, 1, Qt::AlignVCenter);
- layout->addWidget(m_name, 1, 1, Qt::AlignVCenter);
- layout->addWidget(wid, 2, 1, Qt::AlignVCenter);
+ TQLabel *label1 = new TQLabel(m_command->lineEdit(), i18n("Comman&d:"), page);
+ TQLabel *label2 = new TQLabel(m_name, i18n("&Name:"), page);
+ tqlayout->addWidget(label1, 0, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label2, 1, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(label, 2, 0, TQt::AlignVCenter);
+ tqlayout->addWidget(m_command, 0, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(m_name, 1, 1, TQt::AlignVCenter);
+ tqlayout->addWidget(wid, 2, 1, TQt::AlignVCenter);
- QWidget *stretchWidget = new QWidget(page);
- stretchWidget->setSizePolicy(QSizePolicy(/*hor=*/QSizePolicy::Fixed, /*ver=*/QSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
- layout->addWidget(stretchWidget, 3, 1, Qt::AlignVCenter);
+ TQWidget *stretchWidget = new TQWidget(page);
+ stretchWidget->tqsetSizePolicy(TQSizePolicy(/*hor=*/TQSizePolicy::Fixed, /*ver=*/TQSizePolicy::Expanding, /*hStretch=*/1, /*vStretch=*/255)); // Make it fill ALL vertical space
+ tqlayout->addWidget(stretchWidget, 3, 1, TQt::AlignVCenter);
- connect( guessButton, SIGNAL(clicked()), this, SLOT(guessIcon()) );
+ connect( guessButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(guessIcon()) );
}
LauncherEditDialog::~LauncherEditDialog()
@@ -798,27 +798,27 @@ InlineEditors* InlineEditors::instance()
void InlineEditors::initToolBars(KActionCollection *actionCollection)
{
- QFont defaultFont;
- QColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
+ TQFont defaultFont;
+ TQColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
Global::bnpView->currentBasket()->textColor() :
KGlobalSettings::textColor());
// Init the RichTextEditor Toolbar:
richTextFont = new FocusedFontCombo(Global::mainWindow());
- richTextFont->setFixedWidth(richTextFont->sizeHint().width() * 2 / 3);
+ richTextFont->setFixedWidth(richTextFont->tqsizeHint().width() * 2 / 3);
richTextFont->setCurrentFont(defaultFont.family());
- KWidgetAction *action = new KWidgetAction(richTextFont, i18n("Font"), Qt::Key_F6,
+ KWidgetAction *action = new KWidgetAction(richTextFont, i18n("Font"), TQt::Key_F6,
/*receiver=*/0, /*slot=*/"", actionCollection, "richtext_font");
richTextFontSize = new FontSizeCombo(/*rw=*/true, Global::mainWindow());
richTextFontSize->setFontSize(defaultFont.pointSize());
- action = new KWidgetAction(richTextFontSize, i18n("Font Size"), Qt::Key_F7,
+ action = new KWidgetAction(richTextFontSize, i18n("Font Size"), TQt::Key_F7,
/*receiver=*/0, /*slot=*/"", actionCollection, "richtext_font_size");
richTextColor = new FocusedColorCombo(Global::mainWindow());
- richTextColor->setFixedWidth(richTextColor->sizeHint().height() * 2);
+ richTextColor->setFixedWidth(richTextColor->tqsizeHint().height() * 2);
richTextColor->setColor(textColor);
- action = new KWidgetAction(richTextColor, i18n("Color"), KShortcut(), 0, SLOT(), actionCollection, "richtext_color");
+ action = new KWidgetAction(richTextColor, i18n("Color"), KShortcut(), 0, TQT_SLOT(), actionCollection, "richtext_color");
richTextBold = new KToggleAction( i18n("Bold"), "text_bold", "Ctrl+B", actionCollection, "richtext_bold" );
richTextItalic = new KToggleAction( i18n("Italic"), "text_italic", "Ctrl+I", actionCollection, "richtext_italic" );
@@ -897,8 +897,8 @@ void InlineEditors::disableRichTextToolBar()
richTextRedo->setEnabled(false);
// Return to a "proper" state:
- QFont defaultFont;
- QColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
+ TQFont defaultFont;
+ TQColor textColor = (Global::bnpView && Global::bnpView->currentBasket() ?
Global::bnpView->currentBasket()->textColor() :
KGlobalSettings::textColor());
richTextFont->setCurrentFont(defaultFont.family());
diff --git a/src/noteedit.h b/src/noteedit.h
index 1866034..f8cc4ef 100644
--- a/src/noteedit.h
+++ b/src/noteedit.h
@@ -22,12 +22,12 @@
#define NOTEEDIT_H
#include <kdialogbase.h>
-#include <qtextedit.h>
-#include <qlineedit.h>
+#include <tqtextedit.h>
+#include <tqlineedit.h>
-class QWidget;
-//class QLineEdit;
-class QPushButton;
+class TQWidget;
+//class TQLineEdit;
+class TQPushButton;
class KIconButton;
class KURLRequester;
class KTextEdit;
@@ -58,24 +58,25 @@ class FocusedColorCombo;
* If the user cleared the content OR if the user canceled the dialog whereas he/she
* JUST ADDED the note, then the note will be deleted by the Basket.
*/
-class NoteEditor : public QObject
+class NoteEditor : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
NoteEditor(NoteContent *noteContent);
bool isEmpty() { return m_isEmpty; }
bool canceled() { return m_canceled; }
bool isInline() { return m_widget != 0; }
- QWidget* widget() { return m_widget; }
+ TQWidget* widget() { return m_widget; }
KTextEdit* textEdit() { return m_textEdit; }
- QLineEdit* lineEdit() { return m_lineEdit; }
+ TQLineEdit* lineEdit() { return m_lineEdit; }
private:
bool m_isEmpty;
bool m_canceled;
- QWidget *m_widget;
+ TQWidget *m_widget;
KTextEdit *m_textEdit;
- QLineEdit *m_lineEdit;
+ TQLineEdit *m_lineEdit;
NoteContent *m_noteContent;
public:
@@ -84,7 +85,7 @@ class NoteEditor : public QObject
protected:
void setEmpty() { m_isEmpty = true; }
void cancel() { m_canceled = true; }
- void setInlineEditor(QWidget *inlineEditor);
+ void setInlineEditor(TQWidget *inlineEditor);
public:
virtual void validate() {}
virtual void autoSave(bool /*toFileToo*/) {} // Same as validate(), but does not precede editor close and is triggered either while the editor widget changed size or after 3 seconds of inactivity.
@@ -94,14 +95,15 @@ class NoteEditor : public QObject
void mouseEnteredEditorWidget();
public:
- static NoteEditor* editNoteContent(NoteContent *noteContent, QWidget *parent);
+ static NoteEditor* editNoteContent(NoteContent *noteContent, TQWidget *tqparent);
};
class TextEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- TextEditor(TextContent *textContent, QWidget *parent);
+ TextEditor(TextContent *textContent, TQWidget *tqparent);
~TextEditor();
void validate();
void autoSave(bool toFileToo);
@@ -112,8 +114,9 @@ class TextEditor : public NoteEditor
class HtmlEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- HtmlEditor(HtmlContent *htmlContent, QWidget *parent);
+ HtmlEditor(HtmlContent *htmlContent, TQWidget *tqparent);
~HtmlEditor();
void validate();
void autoSave(bool toFileToo);
@@ -122,9 +125,9 @@ class HtmlEditor : public NoteEditor
public slots:
void cursorPositionChanged();
void textChanged();
- void fontChanged(const QFont &font);
+ void fontChanged(const TQFont &font);
protected slots:
-// void slotVerticalAlignmentChanged(QTextEdit::VerticalAlignment align);
+// void slotVerticalAlignmentChanged(TQTextEdit::VerticalAlignment align);
// void setBold();
// void setItalic();
// void setUnderline();
@@ -137,22 +140,25 @@ class HtmlEditor : public NoteEditor
class ImageEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- ImageEditor(ImageContent *imageContent, QWidget *parent);
+ ImageEditor(ImageContent *imageContent, TQWidget *tqparent);
};
class AnimationEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- AnimationEditor(AnimationContent *animationContent, QWidget *parent);
+ AnimationEditor(AnimationContent *animationContent, TQWidget *tqparent);
};
class FileEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- FileEditor(FileContent *fileContent, QWidget *parent);
+ FileEditor(FileContent *fileContent, TQWidget *tqparent);
~FileEditor();
void validate();
void autoSave(bool toFileToo);
@@ -163,44 +169,49 @@ class FileEditor : public NoteEditor
class LinkEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- LinkEditor(LinkContent *linkContent, QWidget *parent);
+ LinkEditor(LinkContent *linkContent, TQWidget *tqparent);
};
class LauncherEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- LauncherEditor(LauncherContent *launcherContent, QWidget *parent);
+ LauncherEditor(LauncherContent *launcherContent, TQWidget *tqparent);
};
class ColorEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- ColorEditor(ColorContent *colorContent, QWidget *parent);
+ ColorEditor(ColorContent *colorContent, TQWidget *tqparent);
};
class UnknownEditor : public NoteEditor
{
Q_OBJECT
+ TQ_OBJECT
public:
- UnknownEditor(UnknownContent *unknownContent, QWidget *parent);
+ UnknownEditor(UnknownContent *unknownContent, TQWidget *tqparent);
};
-/** QLineEdit behavior:
- * Create a new QLineEdit with a text, then the user select a part of it and press ONE letter key.
+/** TQLineEdit behavior:
+ * Create a new TQLineEdit with a text, then the user select a part of it and press ONE letter key.
* The signal textChanged() is not emitted!
* This class correct that!
*/
-class DebuggedLineEdit : public QLineEdit
+class DebuggedLineEdit : public TQLineEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
- DebuggedLineEdit(const QString &text, QWidget *parent = 0);
+ DebuggedLineEdit(const TQString &text, TQWidget *tqparent = 0);
~DebuggedLineEdit();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
};
/** The dialog to edit Link Note content.
@@ -209,25 +220,26 @@ class DebuggedLineEdit : public QLineEdit
class LinkEditDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- LinkEditDialog(LinkContent *contentNote, QWidget *parent = 0);
+ LinkEditDialog(LinkContent *contentNote, TQWidget *tqparent = 0);
~LinkEditDialog();
void polish();
protected slots:
void slotOk();
- void urlChanged(const QString&);
- void doNotAutoTitle(const QString&);
- void doNotAutoIcon(QString);
+ void urlChanged(const TQString&);
+ void doNotAutoTitle(const TQString&);
+ void doNotAutoIcon(TQString);
void guessTitle();
void guessIcon();
private:
LinkContent *m_noteContent;
bool m_isAutoModified;
KURLRequester *m_url;
- QLineEdit *m_title;
+ TQLineEdit *m_title;
KIconButton *m_icon;
- QPushButton *m_autoTitle;
- QPushButton *m_autoIcon;
+ TQPushButton *m_autoTitle;
+ TQPushButton *m_autoIcon;
};
@@ -237,8 +249,9 @@ class LinkEditDialog : public KDialogBase
class LauncherEditDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- LauncherEditDialog(LauncherContent *contentNote, QWidget *parent = 0);
+ LauncherEditDialog(LauncherContent *contentNote, TQWidget *tqparent = 0);
~LauncherEditDialog();
void polish();
protected slots:
@@ -247,7 +260,7 @@ class LauncherEditDialog : public KDialogBase
private:
LauncherContent *m_noteContent;
RunCommandRequester *m_command;
- QLineEdit *m_name;
+ TQLineEdit *m_name;
KIconButton *m_icon;
};
@@ -256,9 +269,10 @@ class LauncherEditDialog : public KDialogBase
* then KXMLGUI can manage them and save theire state and position...
* @author S�astien Laot
*/
-class InlineEditors : public QObject
+class InlineEditors : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
InlineEditors();
~InlineEditors();
diff --git a/src/notefactory.cpp b/src/notefactory.cpp
index 30efc28..91b9a2a 100644
--- a/src/notefactory.cpp
+++ b/src/notefactory.cpp
@@ -18,30 +18,30 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
+#include <tqstring.h>
#include <kurl.h>
-#include <qpixmap.h>
-#include <qcolor.h>
-#include <qregexp.h>
+#include <tqpixmap.h>
+#include <tqcolor.h>
+#include <tqregexp.h>
#include <kcolordrag.h>
#include <kurldrag.h>
-#include <qstylesheet.h>
-#include <qdir.h>
+#include <tqstylesheet.h>
+#include <tqdir.h>
#include <kmimetype.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <kdesktopfile.h>
#include <kapplication.h>
#include <kaboutdata.h>
-#include <qfile.h>
+#include <tqfile.h>
#include <kfilemetainfo.h>
#include <kio/jobclasses.h>
-#include <qtextcodec.h>
+#include <tqtextcodec.h>
#include <kopenwith.h>
#include <kfiledialog.h>
#include <kicondialog.h>
#include <kiconloader.h>
-#include <qfileinfo.h>
+#include <tqfileinfo.h>
#include <kpopupmenu.h>
#include <kstandarddirs.h>
#include <kurifilter.h>
@@ -63,73 +63,73 @@
/** Create notes from scratch (just a content) */
-Note* NoteFactory::createNoteText(const QString &text, Basket *parent, bool reallyPlainText/* = false*/)
+Note* NoteFactory::createNoteText(const TQString &text, Basket *tqparent, bool reallyPlainText/* = false*/)
{
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
if (reallyPlainText) {
- TextContent *content = new TextContent(note, createFileForNewNote(parent, "txt"));
+ TextContent *content = new TextContent(note, createFileForNewNote(tqparent, "txt"));
content->setText(text);
content->saveToFile();
} else {
- HtmlContent *content = new HtmlContent(note, createFileForNewNote(parent, "html"));
- QString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::textToHTMLWithoutP(text) + "</body></html>";
+ HtmlContent *content = new HtmlContent(note, createFileForNewNote(tqparent, "html"));
+ TQString html = "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + Tools::textToHTMLWithoutP(text) + "</body></html>";
content->setHtml(html);
content->saveToFile();
}
return note;
}
-Note* NoteFactory::createNoteHtml(const QString &html, Basket *parent)
+Note* NoteFactory::createNoteHtml(const TQString &html, Basket *tqparent)
{
- Note *note = new Note(parent);
- HtmlContent *content = new HtmlContent(note, createFileForNewNote(parent, "html"));
+ Note *note = new Note(tqparent);
+ HtmlContent *content = new HtmlContent(note, createFileForNewNote(tqparent, "html"));
content->setHtml(html);
content->saveToFile();
return note;
}
-Note* NoteFactory::createNoteLink(const KURL &url, Basket *parent)
+Note* NoteFactory::createNoteLink(const KURL &url, Basket *tqparent)
{
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
new LinkContent(note, url, titleForURL(url), iconForURL(url), /*autoTitle=*/true, /*autoIcon=*/true);
return note;
}
-Note* NoteFactory::createNoteLink(const KURL &url, const QString &title, Basket *parent)
+Note* NoteFactory::createNoteLink(const KURL &url, const TQString &title, Basket *tqparent)
{
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
new LinkContent(note, url, title, iconForURL(url), /*autoTitle=*/false, /*autoIcon=*/true);
return note;
}
-Note* NoteFactory::createNoteImage(const QPixmap &image, Basket *parent)
+Note* NoteFactory::createNoteImage(const TQPixmap &image, Basket *tqparent)
{
- Note *note = new Note(parent);
- ImageContent *content = new ImageContent(note, createFileForNewNote(parent, "png"));
+ Note *note = new Note(tqparent);
+ ImageContent *content = new ImageContent(note, createFileForNewNote(tqparent, "png"));
content->setPixmap(image);
content->saveToFile();
return note;
}
-Note* NoteFactory::createNoteColor(const QColor &color, Basket *parent)
+Note* NoteFactory::createNoteColor(const TQColor &color, Basket *tqparent)
{
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
new ColorContent(note, color);
return note;
}
/** Return a string list containing {url1, title1, url2, title2, url3, title3...}
*/
-QStringList NoteFactory::textToURLList(const QString &text)
+TQStringList NoteFactory::textToURLList(const TQString &text)
{
// List to return:
- QStringList list;
+ TQStringList list;
// Split lines:
- QStringList texts = QStringList::split('\n', text);
+ TQStringList texts = TQStringList::split('\n', text);
// For each lines:
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = texts.begin(); it != texts.end(); ++it) {
// Strip white spaces:
(*it) = (*it).stripWhiteSpace();
@@ -139,11 +139,11 @@ QStringList NoteFactory::textToURLList(const QString &text)
continue;
// Compute lower case equivalent:
- QString ltext = (*it).lower();
+ TQString ltext = (*it).lower();
/* Search for mail address ("*@*.*" ; "*" can contain '_', '-', or '.') and add protocol to it */
- QString mailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+";
- QRegExp mailExp("^"+mailExpString+"$");
+ TQString mailExpString = "[\\w-\\.]+@[\\w-\\.]+\\.[\\w]+";
+ TQRegExp mailExp("^"+mailExpString+"$");
if (mailExp.search(ltext) != -1) {
ltext.insert(0, "mailto:");
(*it).insert(0, "mailto:");
@@ -153,11 +153,11 @@ QStringList NoteFactory::textToURLList(const QString &text)
// TODO: Replace " at " by "@" and " dot " by "." to look for e-mail addresses
/* Search for mail address like "Name <address@provider.net>" */
- QRegExp namedMailExp("^([\\w\\s]+)\\s<("+mailExpString+")>$");
+ TQRegExp namedMailExp("^([\\w\\s]+)\\s<("+mailExpString+")>$");
//namedMailExp.setCaseSensitive(true); // For the name to be keeped with uppercases // DOESN'T WORK !
if (namedMailExp.search(ltext) != -1) {
- QString name = namedMailExp.cap(1);
- QString address = "mailto:" + namedMailExp.cap(2);
+ TQString name = namedMailExp.cap(1);
+ TQString address = "mailto:" + namedMailExp.cap(2);
// Threat it NOW, as it's an exception (it have a title):
list.append(address);
list.append(name);
@@ -186,34 +186,34 @@ QStringList NoteFactory::textToURLList(const QString &text)
list.append(*it);
list.append(""); // We don't have any title
} else
- return QStringList(); // FAILED: treat the text as a text, and not as a URL list!
+ return TQStringList(); // FAILED: treat the text as a text, and not as a URL list!
}
return list;
}
-Note* NoteFactory::createNoteFromText(const QString &text, Basket *parent)
+Note* NoteFactory::createNoteFromText(const TQString &text, Basket *tqparent)
{
/* Search for a color (#RGB , #RRGGBB , #RRRGGGBBB , #RRRRGGGGBBBB) and create a color note */
- QRegExp exp("^#(?:[a-fA-F\\d]{3}){1,4}$");
+ TQRegExp exp("^#(?:[a-fA-F\\d]{3}){1,4}$");
if ( exp.search(text) != -1 )
- return createNoteColor(QColor(text), parent);
+ return createNoteColor(TQColor(text), tqparent);
/* Try to convert the text as a URL or a list of URLs */
- QStringList uriList = textToURLList(text);
+ TQStringList uriList = textToURLList(text);
if ( ! uriList.isEmpty() ) {
// TODO: This code is almost duplicated from fropURLs()!
Note *note;
Note *firstNote = 0;
Note *lastInserted = 0;
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = uriList.begin(); it != uriList.end(); ++it) {
- QString url = (*it);
+ TQString url = (*it);
++it;
- QString title = (*it);
+ TQString title = (*it);
if (title.isEmpty())
- note = createNoteLinkOrLauncher(KURL(url), parent);
+ note = createNoteLinkOrLauncher(KURL(url), tqparent);
else
- note = createNoteLink(KURL(url), title, parent);
+ note = createNoteLink(KURL(url), title, tqparent);
// If we got a new note, insert it in a linked list (we will return the first note of that list):
if (note) {
@@ -231,55 +231,55 @@ Note* NoteFactory::createNoteFromText(const QString &text, Basket *parent)
return firstNote; // It don't return ALL inserted notes !
}
- //QString newText = text.stripWhiteSpace(); // The text for a new note, without useless spaces
+ //TQString newText = text.stripWhiteSpace(); // The text for a new note, without useless spaces
/* Else, it's a text or an HTML note, so, create it */
- if (QStyleSheet::mightBeRichText(/*newT*/text))
- return createNoteHtml(/*newT*/text, parent);
+ if (TQStyleSheet::mightBeRichText(/*newT*/text))
+ return createNoteHtml(/*newT*/text, tqparent);
else
- return createNoteText(/*newT*/text, parent);
+ return createNoteText(/*newT*/text, tqparent);
}
-Note* NoteFactory::createNoteLauncher(const KURL &url, Basket *parent)
+Note* NoteFactory::createNoteLauncher(const KURL &url, Basket *tqparent)
{
if (url.isEmpty())
- return createNoteLauncher("", "", "", parent);
+ return createNoteLauncher("", "", "", tqparent);
else
- return copyFileAndLoad(url, parent);
+ return copyFileAndLoad(url, tqparent);
}
-Note* NoteFactory::createNoteLauncher(const QString &command, const QString &name, const QString &icon, Basket *parent)
+Note* NoteFactory::createNoteLauncher(const TQString &command, const TQString &name, const TQString &icon, Basket *tqparent)
{
- QString fileName = createNoteLauncherFile(command, name, icon, parent);
+ TQString fileName = createNoteLauncherFile(command, name, icon, tqparent);
if (fileName.isEmpty())
return 0L;
else
- return loadFile(fileName, parent);
+ return loadFile(fileName, tqparent);
}
-QString NoteFactory::createNoteLauncherFile(const QString &command, const QString &name, const QString &icon, Basket *parent)
+TQString NoteFactory::createNoteLauncherFile(const TQString &command, const TQString &name, const TQString &icon, Basket *tqparent)
{
- QString content = QString(
+ TQString content = TQString(
"[Desktop Entry]\n"
"Exec=%1\n"
"Name=%2\n"
"Icon=%3\n"
"Encoding=UTF-8\n"
- "Type=Application\n").arg(command, name, icon.isEmpty() ? QString("exec") : icon);
- QString fileName = fileNameForNewNote(parent, "launcher.desktop");
- QString fullPath = parent->fullPathForFileName(fileName);
-// parent->dontCareOfCreation(fullPath);
- QFile file(fullPath);
+ "Type=Application\n").tqarg(command, name, icon.isEmpty() ? TQString("exec") : icon);
+ TQString fileName = fileNameForNewNote(tqparent, "launcher.desktop");
+ TQString fullPath = tqparent->fullPathForFileName(fileName);
+// tqparent->dontCareOfCreation(fullPath);
+ TQFile file(fullPath);
if ( file.open(IO_WriteOnly) ) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << content;
file.close();
return fileName;
} else
- return QString();
+ return TQString();
}
-Note* NoteFactory::createNoteLinkOrLauncher(const KURL &url, Basket *parent)
+Note* NoteFactory::createNoteLinkOrLauncher(const KURL &url, Basket *tqparent)
{
// IMPORTANT: we create the service ONLY if the extension is ".desktop".
// Otherwise, KService take a long time to analyse all the file
@@ -292,23 +292,23 @@ Note* NoteFactory::createNoteLinkOrLauncher(const KURL &url, Basket *parent)
// If link point to a .desktop file then add a launcher, otherwise it's a link
if (service && service->isValid())
- return createNoteLauncher(url, parent);
+ return createNoteLauncher(url, tqparent);
else
- return createNoteLink(url, parent);
+ return createNoteLink(url, tqparent);
}
-#include <qstrlist.h>
-#include <qimage.h>
+#include <tqstrlist.h>
+#include <tqimage.h>
-bool NoteFactory::movingNotesInTheSameBasket(QMimeSource *source, Basket *parent, QDropEvent::Action action)
+bool NoteFactory::movingNotesInTheSameBasket(TQMimeSource *source, Basket *tqparent, TQDropEvent::Action action)
{
if (NoteDrag::canDecode(source))
- return action == QDropEvent::Move && NoteDrag::basketOf(source) == parent;
+ return action == TQDropEvent::Move && NoteDrag::basketOf(source) == tqparent;
else
return false;
}
-Note* NoteFactory::dropNote(QMimeSource *source, Basket *parent, bool fromDrop, QDropEvent::Action action, Note */*noteSource*/)
+Note* NoteFactory::dropNote(TQMimeSource *source, Basket *tqparent, bool fromDrop, TQDropEvent::Action action, Note */*noteSource*/)
{
Note *note = 0L;
@@ -316,7 +316,7 @@ Note* NoteFactory::dropNote(QMimeSource *source, Basket *parent, bool fromDrop,
if (source->format(0) == 0L) {
// TODO: add a parameter to say if it's from a clipboard paste, a selection paste, or a drop
// To be able to say "The clipboard/selection/drop is empty".
-// KMessageBox::error(parent, i18n("There is no data to insert."), i18n("No Data"));
+// KMessageBox::error(tqparent, i18n("There is no data to insert."), i18n("No Data"));
return 0;
}
@@ -325,45 +325,45 @@ Note* NoteFactory::dropNote(QMimeSource *source, Basket *parent, bool fromDrop,
*Global::debugWindow << "<b>Drop :</b>";
for (int i = 0; source->format(i); ++i)
if ( *(source->format(i)) )
- *Global::debugWindow << "\t[" + QString::number(i) + "] " + QString(source->format(i));
+ *Global::debugWindow << "\t[" + TQString::number(i) + "] " + TQString(source->format(i));
switch (action) { // The source want that we:
- case QDropEvent::Copy: *Global::debugWindow << ">> Drop action: Copy"; break;
- case QDropEvent::Move: *Global::debugWindow << ">> Drop action: Move"; break;
- case QDropEvent::Link: *Global::debugWindow << ">> Drop action: Link"; break;
- case QDropEvent::Private: *Global::debugWindow << ">> Drop action: Private"; break; // What is it? (Copy?)
- case QDropEvent::UserAction: *Global::debugWindow << ">> Drop action: UserAction"; break; // Not currently
- default: *Global::debugWindow << ">> Drop action: Unknown"; // supported by Qt!
+ case TQDropEvent::Copy: *Global::debugWindow << ">> Drop action: Copy"; break;
+ case TQDropEvent::Move: *Global::debugWindow << ">> Drop action: Move"; break;
+ case TQDropEvent::Link: *Global::debugWindow << ">> Drop action: Link"; break;
+ case TQDropEvent::Private: *Global::debugWindow << ">> Drop action: Private"; break; // What is it? (Copy?)
+ case TQDropEvent::UserAction: *Global::debugWindow << ">> Drop action: UserAction"; break; // Not currently
+ default: *Global::debugWindow << ">> Drop action: Unknown"; // supported by TQt!
}
}
/* Copy or move a Note */
if (NoteDrag::canDecode(source)) {
- bool moveFiles = fromDrop && action == QDropEvent::Move;
+ bool moveFiles = fromDrop && action == TQDropEvent::Move;
bool moveNotes = moveFiles;
- return NoteDrag::decode(source, parent, moveFiles, moveNotes); // Filename will be kept
+ return NoteDrag::decode(source, tqparent, moveFiles, moveNotes); // Filename will be kept
}
/* Else : Drop object to note */
- QPixmap pixmap;
- if ( QImageDrag::decode(source, pixmap) )
- return createNoteImage(pixmap, parent);
+ TQPixmap pixmap;
+ if ( TQImageDrag::decode(source, pixmap) )
+ return createNoteImage(pixmap, tqparent);
// KColorDrag::decode() is buggy and can trheat strings like "#include <foo.h>" as a black color
// The correct "ideal" code:
- /*QColor color;
+ /*TQColor color;
if ( KColorDrag::decode(source, color) ) {
- createNoteColor(color, parent);
+ createNoteColor(color, tqparent);
return;
}*/
// And then the hack (if provide color MIME type or a text that contains color), using createNote Color RegExp:
- QString hack;
- QRegExp exp("^#(?:[a-fA-F\\d]{3}){1,4}$");
- if (source->provides("application/x-color") || (QTextDrag::decode(source, hack) && (exp.search(hack) != -1)) ) {
- QColor color;
+ TQString hack;
+ TQRegExp exp("^#(?:[a-fA-F\\d]{3}){1,4}$");
+ if (source->provides("application/x-color") || (TQTextDrag::decode(source, hack) && (exp.search(hack) != -1)) ) {
+ TQColor color;
if (KColorDrag::decode(source, color))
- return createNoteColor(color, parent);
-// if ( (note = createNoteColor(color, parent)) )
+ return createNoteColor(color, tqparent);
+// if ( (note = createNoteColor(color, tqparent)) )
// return note;
// // Theorically it should be returned. If not, continue by dropping other things
}
@@ -372,8 +372,8 @@ Note* NoteFactory::dropNote(QMimeSource *source, Basket *parent, bool fromDrop,
if ( KURLDrag::decode(source, urls) ) {
// If it's a Paste, we should know if files should be copied (copy&paste) or moved (cut&paste):
if (!fromDrop && Tools::isAFileCut(source))
- action = QDropEvent::Move;
- return dropURLs(urls, parent, action, fromDrop);
+ action = TQDropEvent::Move;
+ return dropURLs(urls, tqparent, action, fromDrop);
}
// FIXME: use dropURLs() also from Mozilla?
@@ -398,72 +398,72 @@ Note* NoteFactory::dropNote(QMimeSource *source, Basket *parent, bool fromDrop,
* Thanks to Dave Cridland for having said me that.
*/
if (source->provides("text/x-moz-url")) { // FOR MOZILLA
- // Get the array and create a QChar array of 1/2 of the size
- QByteArray mozilla = source->encodedData("text/x-moz-url");
- QMemArray<QChar> chars( mozilla.count() / 2 );
+ // Get the array and create a TQChar array of 1/2 of the size
+ TQByteArray mozilla = source->tqencodedData("text/x-moz-url");
+ TQMemArray<TQChar> chars( mozilla.count() / 2 );
// A small debug work to know the value of each bytes
if (Global::debugWindow)
for (uint i = 0; i < mozilla.count(); i++)
- *Global::debugWindow << QString("'") + QChar(mozilla[i]) + "' " + QString::number(int(mozilla[i]));
+ *Global::debugWindow << TQString("'") + TQChar(mozilla[i]) + "' " + TQString::number(int(mozilla[i]));
// text/x-moz-url give the URL followed by the link title and separed by OxOA (10 decimal: new line?)
uint size = 0;
- QChar *name = 0L;
- // For each little endian mozilla chars, copy it to the array of QChars
+ TQChar *name = 0L;
+ // For each little endian mozilla chars, copy it to the array of TQChars
for (uint i = 0; i < mozilla.count(); i += 2) {
- chars[i/2] = QChar(mozilla[i], mozilla[i+1]);
+ chars[i/2] = TQChar(mozilla[i], mozilla[i+1]);
if (mozilla[i] == 0x0A) {
size = i/2;
name = &(chars[i/2+1]);
}
}
- // Create a QString that take the address of the first QChar and a length
+ // Create a TQString that take the address of the first TQChar and a length
if (name == 0L) { // We haven't found name (FIXME: Is it possible ?)
- QString normalHtml(&(chars[0]), chars.size());
- return createNoteLink(normalHtml, parent);
+ TQString normalHtml(&(chars[0]), chars.size());
+ return createNoteLink(normalHtml, tqparent);
} else {
- QString normalHtml( &(chars[0]), size );
- QString normalTitle( name, chars.size()-size-1);
- return createNoteLink(normalHtml, normalTitle, parent);
+ TQString normalHtml( &(chars[0]), size );
+ TQString normalTitle( name, chars.size()-size-1);
+ return createNoteLink(normalHtml, normalTitle, tqparent);
}
}
if (source->provides("text/html")) {
- QString html;
- QCString subtype("html");
+ TQString html;
+ TQCString subtype("html");
// If the text/html comes from Mozilla or GNOME it can be UTF-16 encoded: we need ExtendedTextDrag to check that
ExtendedTextDrag::decode(source, html, subtype);
- return createNoteHtml(html, parent);
+ return createNoteHtml(html, tqparent);
}
- QString text;
+ TQString text;
// If the text/plain comes from GEdit or GNOME it can be empty: we need ExtendedTextDrag to check other MIME types
if ( ExtendedTextDrag::decode(source, text) )
- return createNoteFromText(text, parent);
+ return createNoteFromText(text, tqparent);
/* Unsucceful drop */
- note = createNoteUnknown(source, parent);
- QString message = i18n("<p>%1 doesn't support the data you've dropped.<br>"
+ note = createNoteUnknown(source, tqparent);
+ TQString message = i18n("<p>%1 doesn't support the data you've dropped.<br>"
"It however created a generic note, allowing you to drag or copy it to an application that understand it.</p>"
"<p>If you want the support of these data, please contact developer or visit the "
- "<a href=\"http://basket.kde.org/dropdb.php\">BasKet Drop Database</a>.</p>").arg(kapp->aboutData()->programName());
- KMessageBox::information(parent, message, i18n("Unsupported MIME Type(s)"),
+ "<a href=\"http://basket.kde.org/dropdb.php\">BasKet Drop Database</a>.</p>").tqarg(kapp->aboutData()->programName());
+ KMessageBox::information(tqparent, message, i18n("Unsupported MIME Type(s)"),
"unsupportedDropInfo", KMessageBox::AllowLink);
return note;
}
-Note* NoteFactory::createNoteUnknown(QMimeSource *source, Basket *parent/*, const QString &annotations*/)
+Note* NoteFactory::createNoteUnknown(TQMimeSource *source, Basket *tqparent/*, const TQString &annotations*/)
{
// Save the MimeSource in a file: create and open the file:
- QString fileName = createFileForNewNote(parent, "unknown");
- QFile file(parent->fullPath() + fileName);
+ TQString fileName = createFileForNewNote(tqparent, "unknown");
+ TQFile file(tqparent->fullPath() + fileName);
if ( ! file.open(IO_WriteOnly) )
return 0L;
- QDataStream stream(&file);
+ TQDataStream stream(&file);
// Echo MIME types:
for (int i = 0; source->format(i); ++i)
if ( *(source->format(i)) )
- stream << QString(source->format(i)); // Output the '\0'-terminated format name string
+ stream << TQString(source->format(i)); // Output the '\0'-terminated format name string
// Echo end of MIME types list delimiter:
stream << "";
@@ -471,18 +471,18 @@ Note* NoteFactory::createNoteUnknown(QMimeSource *source, Basket *parent/*, cons
// Echo the length (in bytes) and then the data, and then same for next MIME type:
for (int i = 0; source->format(i); ++i)
if ( *(source->format(i)) ) {
- QByteArray data = source->encodedData(source->format(i));
- stream << (Q_UINT32)data.count();
+ TQByteArray data = source->tqencodedData(source->format(i));
+ stream << (TQ_UINT32)data.count();
stream.writeRawBytes(data.data(), data.count());
}
file.close();
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
new UnknownContent(note, fileName);
return note;
}
-Note* NoteFactory::dropURLs(KURL::List urls, Basket *parent, QDropEvent::Action action, bool fromDrop)
+Note* NoteFactory::dropURLs(KURL::List urls, Basket *tqparent, TQDropEvent::Action action, bool fromDrop)
{
int shouldAsk = 0; // shouldAsk==0: don't ask ; shouldAsk==1: ask for "file" ; shouldAsk>=2: ask for "files"
bool shiftPressed = Keyboard::shiftPressed();
@@ -499,17 +499,17 @@ Note* NoteFactory::dropURLs(KURL::List urls, Basket *parent, QDropEvent::Action
break;
}
if (shouldAsk) {
- KPopupMenu menu(parent);
+ KPopupMenu menu(tqparent);
menu.insertItem( SmallIconSet("goto"), i18n("&Move Here\tShift"), 0 );
menu.insertItem( SmallIconSet("editcopy"), i18n("&Copy Here\tCtrl"), 1 );
menu.insertItem( SmallIconSet("www"), i18n("&Link Here\tCtrl+Shift"), 2 );
menu.insertSeparator();
menu.insertItem( SmallIconSet("cancel"), i18n("C&ancel\tEscape"), 3 );
- int id = menu.exec(QCursor::pos());
+ int id = menu.exec(TQCursor::pos());
switch (id) {
- case 0: action = QDropEvent::Move; break;
- case 1: action = QDropEvent::Copy; break;
- case 2: action = QDropEvent::Link; break;
+ case 0: action = TQDropEvent::Move; break;
+ case 1: action = TQDropEvent::Copy; break;
+ case 2: action = TQDropEvent::Link; break;
default: return 0;
}
modified = true;
@@ -542,20 +542,20 @@ Note* NoteFactory::dropURLs(KURL::List urls, Basket *parent, QDropEvent::Action
Note *lastInserted = 0;
for (KURL::List::iterator it = urls.begin(); it != urls.end(); ++it) {
if ( ((*it).protocol() == "mailto") ||
- (action == QDropEvent::Link) )
- note = createNoteLinkOrLauncher(*it, parent);
+ (action == TQDropEvent::Link) )
+ note = createNoteLinkOrLauncher(*it, tqparent);
else if (!(*it).isLocalFile()) {
- if ( action != QDropEvent::Link && (maybeImageOrAnimation(*it)/* || maybeSound(*it)*/) )
- note = copyFileAndLoad(*it, parent);
+ if ( action != TQDropEvent::Link && (maybeImageOrAnimation(*it)/* || maybeSound(*it)*/) )
+ note = copyFileAndLoad(*it, tqparent);
else
- note = createNoteLinkOrLauncher(*it, parent);
+ note = createNoteLinkOrLauncher(*it, tqparent);
} else {
- if (action == QDropEvent::Copy)
- note = copyFileAndLoad(*it, parent);
- else if (action == QDropEvent::Move)
- note = moveFileAndLoad(*it, parent);
+ if (action == TQDropEvent::Copy)
+ note = copyFileAndLoad(*it, tqparent);
+ else if (action == TQDropEvent::Move)
+ note = moveFileAndLoad(*it, tqparent);
else
- note = createNoteLinkOrLauncher(*it, parent);
+ note = createNoteLinkOrLauncher(*it, tqparent);
}
// If we got a new note, insert it in a linked list (we will return the first note of that list):
@@ -573,49 +573,49 @@ Note* NoteFactory::dropURLs(KURL::List urls, Basket *parent, QDropEvent::Action
return firstNote;
}
-void NoteFactory::consumeContent(QDataStream &stream, NoteType::Id type)
+void NoteFactory::consumeContent(TQDataStream &stream, NoteType::Id type)
{
if (type == NoteType::Link) {
KURL url;
- QString title, icon;
- Q_UINT64 autoTitle64, autoIcon64;
+ TQString title, icon;
+ TQ_UINT64 autoTitle64, autoIcon64;
stream >> url >> title >> icon >> autoTitle64 >> autoIcon64;
} else if (type == NoteType::Color) {
- QColor color;
+ TQColor color;
stream >> color;
}
}
-Note* NoteFactory::decodeContent(QDataStream &stream, NoteType::Id type, Basket *parent)
+Note* NoteFactory::decodeContent(TQDataStream &stream, NoteType::Id type, Basket *tqparent)
{
/* if (type == NoteType::Text) {
- QString text;
+ TQString text;
stream >> text;
- return NoteFactory::createNoteText(text, parent);
+ return NoteFactory::createNoteText(text, tqparent);
} else if (type == NoteType::Html) {
- QString html;
+ TQString html;
stream >> html;
- return NoteFactory::createNoteHtml(html, parent);
+ return NoteFactory::createNoteHtml(html, tqparent);
} else if (type == NoteType::Image) {
- QPixmap pixmap;
+ TQPixmap pixmap;
stream >> pixmap;
- return NoteFactory::createNoteImage(pixmap, parent);
+ return NoteFactory::createNoteImage(pixmap, tqparent);
} else */
if (type == NoteType::Link) {
KURL url;
- QString title, icon;
- Q_UINT64 autoTitle64, autoIcon64;
+ TQString title, icon;
+ TQ_UINT64 autoTitle64, autoIcon64;
bool autoTitle, autoIcon;
stream >> url >> title >> icon >> autoTitle64 >> autoIcon64;
autoTitle = (bool)autoTitle64;
autoIcon = (bool)autoIcon64;
- Note *note = NoteFactory::createNoteLink(url, parent);
+ Note *note = NoteFactory::createNoteLink(url, tqparent);
((LinkContent*)(note->content()))->setLink(url, title, icon, autoTitle, autoIcon);
return note;
} else if (type == NoteType::Color) {
- QColor color;
+ TQColor color;
stream >> color;
- return NoteFactory::createNoteColor(color, parent);
+ return NoteFactory::createNoteColor(color, tqparent);
} else
return 0; // NoteFactory::loadFile() is sufficient
}
@@ -624,31 +624,31 @@ Note* NoteFactory::decodeContent(QDataStream &stream, NoteType::Id type, Basket
bool NoteFactory::maybeText(const KURL &url)
{
- QString path = url.url().lower();
+ TQString path = url.url().lower();
return path.endsWith(".txt");
}
bool NoteFactory::maybeHtml(const KURL &url)
{
- QString path = url.url().lower();
+ TQString path = url.url().lower();
return path.endsWith(".html") || path.endsWith(".htm");
}
bool NoteFactory::maybeImageOrAnimation(const KURL &url)
{
/* Examples on my machine:
- QImageDrag can understands
+ TQImageDrag can understands
{"image/png", "image/bmp", "image/jpeg", "image/pgm", "image/ppm", "image/xbm", "image/xpm"}
- QImageIO::inputFormats() returns
+ TQImageIO::inputFormats() returns
{"BMP", "GIF", "JPEG", "MNG", "PBM", "PGM", "PNG", "PPM", "XBM", "XPM"}
- QImageDecoder::inputFormats():
+ TQImageDecoder::inputFormats():
{"GIF", "MNG", "PNG"} */
- QStrList list = QImageIO::inputFormats();
- list.prepend("jpg"); // Since QImageDrag return only "JPEG" and extensions can be "JPG"; preprend for heuristic optim.
+ TQStrList list = TQImageIO::inputFormats();
+ list.prepend("jpg"); // Since TQImageDrag return only "JPEG" and extensions can be "JPG"; preprend for heuristic optim.
char *s;
- QString path = url.url().lower();
+ TQString path = url.url().lower();
for (s = list.first(); s; s = list.next())
- if (path.endsWith(QString(".") + QString(s).lower()))
+ if (path.endsWith(TQString(".") + TQString(s).lower()))
return true;
// TODO: Search real MIME type for local files?
return false;
@@ -656,94 +656,94 @@ bool NoteFactory::maybeImageOrAnimation(const KURL &url)
bool NoteFactory::maybeAnimation(const KURL &url)
{
- QString path = url.url().lower();
+ TQString path = url.url().lower();
return path.endsWith(".mng") || path.endsWith(".gif");
}
bool NoteFactory::maybeSound(const KURL &url)
{
- QString path = url.url().lower();
+ TQString path = url.url().lower();
return path.endsWith(".mp3") || path.endsWith(".ogg");
}
bool NoteFactory::maybeLauncher(const KURL &url)
{
- QString path = url.url().lower();
+ TQString path = url.url().lower();
return path.endsWith(".desktop");
}
////////////// NEW:
-Note* NoteFactory::copyFileAndLoad(const KURL &url, Basket *parent)
+Note* NoteFactory::copyFileAndLoad(const KURL &url, Basket *tqparent)
{
- QString fileName = fileNameForNewNote(parent, url.fileName());
- QString fullPath = parent->fullPathForFileName(fileName);
+ TQString fileName = fileNameForNewNote(tqparent, url.fileName());
+ TQString fullPath = tqparent->fullPathForFileName(fileName);
if (Global::debugWindow)
*Global::debugWindow << "copyFileAndLoad: " + url.prettyURL() + " to " + fullPath;
-// QString annotations = i18n("Original file: %1").arg(url.prettyURL());
-// parent->dontCareOfCreation(fullPath);
+// TQString annotations = i18n("Original file: %1").tqarg(url.prettyURL());
+// tqparent->dontCareOfCreation(fullPath);
// KIO::CopyJob *copyJob = KIO::copy(url, KURL(fullPath));
-// parent->connect( copyJob, SIGNAL(copyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)),
-// parent, SLOT(slotCopyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)) );
+// tqparent->connect( copyJob, TQT_SIGNAL(copyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)),
+// tqparent, TQT_SLOT(slotCopyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)) );
KIO::FileCopyJob *copyJob = new KIO::FileCopyJob(
url, KURL(fullPath), 0666, /*move=*/false,
/*overwrite=*/true, /*resume=*/true, /*showProgress=*/true );
- parent->connect( copyJob, SIGNAL(result(KIO::Job *)),
- parent, SLOT(slotCopyingDone2(KIO::Job *)) );
+ tqparent->connect( copyJob, TQT_SIGNAL(result(KIO::Job *)),
+ tqparent, TQT_SLOT(slotCopyingDone2(KIO::Job *)) );
- NoteType::Id type = typeForURL(url, parent); // Use the type of the original file because the target doesn't exist yet
- return loadFile(fileName, type, parent);
+ NoteType::Id type = typeForURL(url, tqparent); // Use the type of the original file because the target doesn't exist yet
+ return loadFile(fileName, type, tqparent);
}
-Note* NoteFactory::moveFileAndLoad(const KURL &url, Basket *parent)
+Note* NoteFactory::moveFileAndLoad(const KURL &url, Basket *tqparent)
{
// Globally the same as copyFileAndLoad() but move instead of copy (KIO::move())
- QString fileName = fileNameForNewNote(parent, url.fileName());
- QString fullPath = parent->fullPathForFileName(fileName);
+ TQString fileName = fileNameForNewNote(tqparent, url.fileName());
+ TQString fullPath = tqparent->fullPathForFileName(fileName);
if (Global::debugWindow)
*Global::debugWindow << "moveFileAndLoad: " + url.prettyURL() + " to " + fullPath;
-// QString annotations = i18n("Original file: %1").arg(url.prettyURL());
-// parent->dontCareOfCreation(fullPath);
+// TQString annotations = i18n("Original file: %1").tqarg(url.prettyURL());
+// tqparent->dontCareOfCreation(fullPath);
// KIO::CopyJob *copyJob = KIO::move(url, KURL(fullPath));
-// parent->connect( copyJob, SIGNAL(copyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)),
-// parent, SLOT(slotCopyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)) );
+// tqparent->connect( copyJob, TQT_SIGNAL(copyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)),
+// tqparent, TQT_SLOT(slotCopyingDone(KIO::Job *, const KURL &, const KURL &, bool, bool)) );
KIO::FileCopyJob *copyJob = new KIO::FileCopyJob(
url, KURL(fullPath), 0666, /*move=*/true,
/*overwrite=*/true, /*resume=*/true, /*showProgress=*/true );
- parent->connect( copyJob, SIGNAL(result(KIO::Job *)),
- parent, SLOT(slotCopyingDone2(KIO::Job *)) );
+ tqparent->connect( copyJob, TQT_SIGNAL(result(KIO::Job *)),
+ tqparent, TQT_SLOT(slotCopyingDone2(KIO::Job *)) );
- NoteType::Id type = typeForURL(url, parent); // Use the type of the original file because the target doesn't exist yet
- return loadFile(fileName, type, parent);
+ NoteType::Id type = typeForURL(url, tqparent); // Use the type of the original file because the target doesn't exist yet
+ return loadFile(fileName, type, tqparent);
}
-Note* NoteFactory::loadFile(const QString &fileName, Basket *parent)
+Note* NoteFactory::loadFile(const TQString &fileName, Basket *tqparent)
{
// The file MUST exists
- QFileInfo file( KURL(parent->fullPathForFileName(fileName)).path() );
+ TQFileInfo file( KURL(tqparent->fullPathForFileName(fileName)).path() );
if ( ! file.exists() )
return 0L;
- NoteType::Id type = typeForURL(parent->fullPathForFileName(fileName), parent);
- Note *note = loadFile(fileName, type, parent);
+ NoteType::Id type = typeForURL(tqparent->fullPathForFileName(fileName), tqparent);
+ Note *note = loadFile(fileName, type, tqparent);
return note;
}
-Note* NoteFactory::loadFile(const QString &fileName, NoteType::Id type, Basket *parent)
+Note* NoteFactory::loadFile(const TQString &fileName, NoteType::Id type, Basket *tqparent)
{
- Note *note = new Note(parent);
+ Note *note = new Note(tqparent);
switch (type) {
case NoteType::Text: new TextContent( note, fileName ); break;
case NoteType::Html: new HtmlContent( note, fileName ); break;
@@ -763,11 +763,11 @@ Note* NoteFactory::loadFile(const QString &fileName, NoteType::Id type, Basket *
return note;
}
-NoteType::Id NoteFactory::typeForURL(const KURL &url, Basket */*parent*/)
+NoteType::Id NoteFactory::typeForURL(const KURL &url, Basket */*tqparent*/)
{
/* KMimeType::Ptr kMimeType = KMimeType::findByURL(url);
if (Global::debugWindow)
- *Global::debugWindow << "typeForURL: " + kMimeType->parentMimeType();//property("MimeType").toString();*/
+ *Global::debugWindow << "typeForURL: " + kMimeType->tqparentMimeType();//property("MimeType").toString();*/
bool viewText = Settings::viewTextFileContent();
bool viewHTML = Settings::viewHtmlFileContent();
bool viewImage = Settings::viewImageFileContent();
@@ -779,13 +779,13 @@ NoteType::Id NoteFactory::typeForURL(const KURL &url, Basket */*parent*/)
if (metaInfo.isEmpty()) { // metaInfo is empty for GIF files on my machine !
if (viewText && maybeText(url)) return NoteType::Text;
else if (viewHTML && (maybeHtml(url))) return NoteType::Html;
- else if (viewImage && maybeAnimation(url)) return NoteType::Animation; // See Note::movieStatus(int)
+ else if (viewImage && maybeAnimation(url)) return NoteType::Animation; // See Note::movietqStatus(int)
else if (viewImage && maybeImageOrAnimation(url)) return NoteType::Image; // for more explanations
else if (viewSound && maybeSound(url)) return NoteType::Sound;
else if (maybeLauncher(url)) return NoteType::Launcher;
else return NoteType::File;
}
- QString mimeType = metaInfo.mimeType();
+ TQString mimeType = metaInfo.mimeType();
if (Global::debugWindow)
*Global::debugWindow << "typeForURL: " + url.prettyURL() + " ; MIME type = " + mimeType;
@@ -800,38 +800,38 @@ NoteType::Id NoteFactory::typeForURL(const KURL &url, Basket */*parent*/)
else return NoteType::File;
}
-QString NoteFactory::fileNameForNewNote(Basket *parent, const QString &wantedName)
+TQString NoteFactory::fileNameForNewNote(Basket *tqparent, const TQString &wantedName)
{
- return Tools::fileNameForNewFile(wantedName, parent->fullPath());
+ return Tools::fileNameForNewFile(wantedName, tqparent->fullPath());
}
-// Create a file to store a new note in Basket parent and with extension extension.
+// Create a file to store a new note in Basket tqparent and with extension extension.
// If wantedName is provided, the function will first try to use this file name, or derive it if it's impossible
// (extension willn't be used for that case)
-QString NoteFactory::createFileForNewNote(Basket *parent, const QString &extension, const QString &wantedName)
+TQString NoteFactory::createFileForNewNote(Basket *tqparent, const TQString &extension, const TQString &wantedName)
{
static int nb = 1;
- QString fileName;
- QString fullName;
+ TQString fileName;
+ TQString fullName;
- if (wantedName.isEmpty()) { // TODO: fileNameForNewNote(parent, "note1."+extension);
- QDir dir;
+ if (wantedName.isEmpty()) { // TODO: fileNameForNewNote(tqparent, "note1."+extension);
+ TQDir dir;
for (/*int nb = 1*/; ; ++nb) { // TODO: FIXME: If overflow ???
- fileName = "note" + QString::number(nb)/*.rightJustify(5, '0')*/ + "." + extension;
- fullName = parent->fullPath() + fileName;
- dir = QDir(fullName);
+ fileName = "note" + TQString::number(nb)/*.rightJustify(5, '0')*/ + "." + extension;
+ fullName = tqparent->fullPath() + fileName;
+ dir = TQDir(fullName);
if ( ! dir.exists(fullName) )
break;
}
} else {
- fileName = fileNameForNewNote(parent, wantedName);
- fullName = parent->fullPath() + fileName;
+ fileName = fileNameForNewNote(tqparent, wantedName);
+ fullName = tqparent->fullPath() + fileName;
}
// Create the file
-// parent->dontCareOfCreation(fullName);
- QFile file(fullName);
+// tqparent->dontCareOfCreation(fullName);
+ TQFile file(fullName);
file.open(IO_WriteOnly);
file.close();
@@ -844,7 +844,7 @@ KURL NoteFactory::filteredURL(const KURL &url)
// So, we don't use that function is that case:
bool isSlow = true;
for (uint i = 0; i < url.url().length(); ++i) {
- QChar c = url.url()[i];
+ TQChar c = url.url()[i];
if (!c.isLetterOrNumber() && c != '-' && c != '+') {
isSlow = false;
break;
@@ -856,10 +856,10 @@ KURL NoteFactory::filteredURL(const KURL &url)
return KURIFilter::self()->filteredURI(url);
}
-QString NoteFactory::titleForURL(const KURL &url)
+TQString NoteFactory::titleForURL(const KURL &url)
{
- QString title = url.prettyURL();
- QString home = "file:" + QDir::homeDirPath() + "/";
+ TQString title = url.prettyURL();
+ TQString home = "file:" + TQDir::homeDirPath() + "/";
if (title.startsWith("mailto:"))
return title.remove(0, 7);
@@ -868,31 +868,31 @@ QString NoteFactory::titleForURL(const KURL &url)
title = "~/" + title.remove(0, home.length());
if (title.startsWith("file://"))
- title = title.remove(0, 7); // 7 == QString("file://").length() - 1
+ title = title.remove(0, 7); // 7 == TQString("file://").length() - 1
else if (title.startsWith("file:"))
- title = title.remove(0, 5); // 5 == QString("file:").length() - 1
+ title = title.remove(0, 5); // 5 == TQString("file:").length() - 1
else if (title.startsWith("http://www."))
- title = title.remove(0, 11); // 11 == QString("http://www.").length() - 1
+ title = title.remove(0, 11); // 11 == TQString("http://www.").length() - 1
else if (title.startsWith("http://"))
- title = title.remove(0, 7); // 7 == QString("http://").length() - 1
+ title = title.remove(0, 7); // 7 == TQString("http://").length() - 1
if ( ! url.isLocalFile() ) {
if (title.endsWith("/index.html") && title.length() > 11)
- title.truncate(title.length() - 11); // 11 == QString("/index.html").length()
+ title.truncate(title.length() - 11); // 11 == TQString("/index.html").length()
else if (title.endsWith("/index.htm") && title.length() > 10)
- title.truncate(title.length() - 10); // 10 == QString("/index.htm").length()
+ title.truncate(title.length() - 10); // 10 == TQString("/index.htm").length()
else if (title.endsWith("/index.xhtml") && title.length() > 12)
- title.truncate(title.length() - 12); // 12 == QString("/index.xhtml").length()
+ title.truncate(title.length() - 12); // 12 == TQString("/index.xhtml").length()
else if (title.endsWith("/index.php") && title.length() > 10)
- title.truncate(title.length() - 10); // 10 == QString("/index.php").length()
+ title.truncate(title.length() - 10); // 10 == TQString("/index.php").length()
else if (title.endsWith("/index.asp") && title.length() > 10)
- title.truncate(title.length() - 10); // 10 == QString("/index.asp").length()
+ title.truncate(title.length() - 10); // 10 == TQString("/index.asp").length()
else if (title.endsWith("/index.php3") && title.length() > 11)
- title.truncate(title.length() - 11); // 11 == QString("/index.php3").length()
+ title.truncate(title.length() - 11); // 11 == TQString("/index.php3").length()
else if (title.endsWith("/index.php4") && title.length() > 11)
- title.truncate(title.length() - 11); // 11 == QString("/index.php4").length()
+ title.truncate(title.length() - 11); // 11 == TQString("/index.php4").length()
else if (title.endsWith("/index.php5") && title.length() > 11)
- title.truncate(title.length() - 11); // 11 == QString("/index.php5").length()
+ title.truncate(title.length() - 11); // 11 == TQString("/index.php5").length()
}
if (title.length() > 2 && title.endsWith("/")) // length > 2 because "/" and "~/" shouldn't be transformed to "" and "~"
@@ -901,9 +901,9 @@ QString NoteFactory::titleForURL(const KURL &url)
return title;
}
-QString NoteFactory::iconForURL(const KURL &url)
+TQString NoteFactory::iconForURL(const KURL &url)
{
- QString icon = KMimeType::iconForURL(url.url());
+ TQString icon = KMimeType::iconForURL(url.url());
if ( url.protocol() == "mailto" )
icon = "message";
return icon;
@@ -915,19 +915,19 @@ QString NoteFactory::iconForURL(const KURL &url)
* eg. "/usr/bin/kwrite-3.2 ~/myfile.txt /home/other/file.xml"
* will give the "kwrite" icon!
*/
-QString NoteFactory::iconForCommand(const QString &command)
+TQString NoteFactory::iconForCommand(const TQString &command)
{
- QString icon;
+ TQString icon;
// 1. Use first word as icon (typically the program without argument)
- icon = QStringList::split(' ', command).first();
+ icon = TQStringList::split(' ', command).first();
// 2. If the command is a full path, take only the program file name
- icon = icon.mid(icon.findRev('/') + 1); // strip path if given [But it doesn't care of such
+ icon = icon.mid(icon.tqfindRev('/') + 1); // strip path if given [But it doesn't care of such
// "myprogram /my/path/argument" -> return "argument". Would
// must first strip first word and then strip path... Useful ??
// 3. Use characters before any '-' (e.g. use "gimp" icon if run command is "gimp-1.3")
if ( ! isIconExist(icon) )
- icon = QStringList::split('-', icon).first();
+ icon = TQStringList::split('-', icon).first();
// 4. If the icon still not findable, use a generic icon
if ( ! isIconExist(icon) )
icon = "exec";
@@ -935,30 +935,30 @@ QString NoteFactory::iconForCommand(const QString &command)
return icon;
}
-bool NoteFactory::isIconExist(const QString &icon)
+bool NoteFactory::isIconExist(const TQString &icon)
{
return ! kapp->iconLoader()->loadIcon(icon, KIcon::NoGroup, 16, KIcon::DefaultState, 0L, true).isNull();
}
-Note* NoteFactory::createEmptyNote(NoteType::Id type, Basket *parent)
+Note* NoteFactory::createEmptyNote(NoteType::Id type, Basket *tqparent)
{
- QPixmap *pixmap;
+ TQPixmap *pixmap;
switch (type) {
case NoteType::Text:
- return NoteFactory::createNoteText("", parent, /*reallyPlainText=*/true);
+ return NoteFactory::createNoteText("", tqparent, /*reallyPlainText=*/true);
case NoteType::Html:
- return NoteFactory::createNoteHtml("", parent);
+ return NoteFactory::createNoteHtml("", tqparent);
case NoteType::Image:
- pixmap = new QPixmap( QSize(Settings::defImageX(), Settings::defImageY()) );
+ pixmap = new TQPixmap( TQSize(Settings::defImageX(), Settings::defImageY()) );
pixmap->fill();
pixmap->setMask(pixmap->createHeuristicMask());
- return NoteFactory::createNoteImage(*pixmap, parent);
+ return NoteFactory::createNoteImage(*pixmap, tqparent);
case NoteType::Link:
- return NoteFactory::createNoteLink(KURL(), parent);
+ return NoteFactory::createNoteLink(KURL(), tqparent);
case NoteType::Launcher:
- return NoteFactory::createNoteLauncher(KURL(), parent);
+ return NoteFactory::createNoteLauncher(KURL(), tqparent);
case NoteType::Color:
- return NoteFactory::createNoteColor(Qt::black, parent);
+ return NoteFactory::createNoteColor(TQt::black, tqparent);
default:
case NoteType::Animation:
case NoteType::Sound:
@@ -968,41 +968,41 @@ Note* NoteFactory::createEmptyNote(NoteType::Id type, Basket *parent)
}
}
-Note* NoteFactory::importKMenuLauncher(Basket *parent)
+Note* NoteFactory::importKMenuLauncher(Basket *tqparent)
{
- KOpenWithDlg dialog(parent);
+ KOpenWithDlg dialog(tqparent);
dialog.setSaveNewApplications(true); // To create temp file, needed by createNoteLauncher()
dialog.exec();
if (dialog.service()) {
// * locateLocal() return a local file even if it is a system wide one (local one doesn't exists)
// * desktopEntryPath() returns the full path for system wide ressources, but relative path if in home
- QString serviceUrl = dialog.service()->desktopEntryPath();
+ TQString serviceUrl = dialog.service()->desktopEntryPath();
if ( ! serviceUrl.startsWith("/") )
serviceUrl = dialog.service()->locateLocal(); //locateLocal("xdgdata-apps", serviceUrl);
- return createNoteLauncher(serviceUrl, parent);
+ return createNoteLauncher(serviceUrl, tqparent);
}
return 0;
}
-Note* NoteFactory::importIcon(Basket *parent)
+Note* NoteFactory::importIcon(Basket *tqparent)
{
- QString iconName = KIconDialog::getIcon( KIcon::Desktop, KIcon::Application, false, Settings::defIconSize() );
+ TQString iconName = KIconDialog::getIcon( KIcon::Desktop, KIcon::Application, false, Settings::defIconSize() );
if ( ! iconName.isEmpty() ) {
IconSizeDialog dialog(i18n("Import Icon as Image"), i18n("Choose the size of the icon to import as an image:"), iconName, Settings::defIconSize(), 0);
dialog.exec();
if (dialog.iconSize() > 0) {
Settings::setDefIconSize(dialog.iconSize());
Settings::saveConfig();
- return createNoteImage( DesktopIcon(iconName, dialog.iconSize()), parent ); // TODO: wantedName = iconName !
+ return createNoteImage( DesktopIcon(iconName, dialog.iconSize()), tqparent ); // TODO: wantedName = iconName !
}
}
return 0;
}
-Note* NoteFactory::importFileContent(Basket *parent)
+Note* NoteFactory::importFileContent(Basket *tqparent)
{
- KURL url = KFileDialog::getOpenURL( QString::null, QString::null, parent, i18n("Load File Content into a Note") );
+ KURL url = KFileDialog::getOpenURL( TQString(), TQString(), tqparent, i18n("Load File Content into a Note") );
if ( ! url.isEmpty() )
- return copyFileAndLoad(url, parent);
+ return copyFileAndLoad(url, tqparent);
return 0;
}
diff --git a/src/notefactory.h b/src/notefactory.h
index 3fee459..de48562 100644
--- a/src/notefactory.h
+++ b/src/notefactory.h
@@ -21,13 +21,13 @@
#ifndef NOTEFACTORY_H
#define NOTEFACTORY_H
-#include <qevent.h>
+#include <tqevent.h>
#include <kurl.h>
-#include <qstringlist.h>
+#include <tqstringlist.h>
-class QString;
-class QPixmap;
-class QColor;
+class TQString;
+class TQPixmap;
+class TQColor;
class Basket;
class Note;
@@ -45,52 +45,52 @@ namespace NoteFactory
* In some cases, the returned note can be a group containing several notes or the first note of a chained list.
* The method Basket::TODO() can insert several grouped or chained notes without problem.
*/
- Note* createNoteText( const QString &text, Basket *parent, bool reallyPlainText = false);
- Note* createNoteHtml( const QString &html, Basket *parent);
- Note* createNoteLink( const KURL &url, Basket *parent);
- Note* createNoteLink( const KURL &url, const QString &title, Basket *parent);
- Note* createNoteImage( const QPixmap &image, Basket *parent);
- Note* createNoteColor( const QColor &color, Basket *parent);
- Note* createNoteFromText( const QString &content, Basket *parent); // Find automatically the type from the text meaning // TODO: Return Note::List?
- Note* createNoteLauncher( const KURL &url, Basket *parent);
- Note* createNoteLauncher( const QString &command, const QString &name, const QString &icon, Basket *parent);
- Note* createNoteUnknown( QMimeSource *source, Basket *parent);
+ Note* createNoteText( const TQString &text, Basket *tqparent, bool reallyPlainText = false);
+ Note* createNoteHtml( const TQString &html, Basket *tqparent);
+ Note* createNoteLink( const KURL &url, Basket *tqparent);
+ Note* createNoteLink( const KURL &url, const TQString &title, Basket *tqparent);
+ Note* createNoteImage( const TQPixmap &image, Basket *tqparent);
+ Note* createNoteColor( const TQColor &color, Basket *tqparent);
+ Note* createNoteFromText( const TQString &content, Basket *tqparent); // Find automatically the type from the text meaning // TODO: Return Note::List?
+ Note* createNoteLauncher( const KURL &url, Basket *tqparent);
+ Note* createNoteLauncher( const TQString &command, const TQString &name, const TQString &icon, Basket *tqparent);
+ Note* createNoteUnknown( TQMimeSource *source, Basket *tqparent);
/** Functions to create derived notes from a content */
- Note* createNoteLinkOrLauncher( const KURL &url, Basket *parent);
- Note* copyFileAndLoad( const KURL &url, Basket *parent);
- Note* moveFileAndLoad( const KURL &url, Basket *parent);
- Note* loadFile( const QString &fileName, Basket *parent); /// << Determine the content of the file (the file SHOULD exists) and return a note of the good type.
- Note* loadFile( const QString &fileName, NoteType::Id type, Basket *parent ); /// << Create a note of type @p type. The file is not obliged to exist.
+ Note* createNoteLinkOrLauncher( const KURL &url, Basket *tqparent);
+ Note* copyFileAndLoad( const KURL &url, Basket *tqparent);
+ Note* moveFileAndLoad( const KURL &url, Basket *tqparent);
+ Note* loadFile( const TQString &fileName, Basket *tqparent); /// << Determine the content of the file (the file SHOULD exists) and return a note of the good type.
+ Note* loadFile( const TQString &fileName, NoteType::Id type, Basket *tqparent ); /// << Create a note of type @p type. The file is not obliged to exist.
/** Functions to create a new note from a drop or past event */
- Note* dropNote(QMimeSource *source, Basket *parent,
- bool fromDrop = false, QDropEvent::Action action = QDropEvent::Copy, Note *noteSource = 0);
- bool movingNotesInTheSameBasket(QMimeSource *source, Basket *parent, QDropEvent::Action action);
- Note* dropURLs(KURL::List urls, Basket *parent, QDropEvent::Action action, bool fromDrop);
- Note* decodeContent(QDataStream &stream, NoteType::Id type, Basket *parent); /// << Decode the @p stream to a note or return 0 if a general loadFile() is sufficient.
- void consumeContent(QDataStream &stream, NoteType::Id type); /// << Decode the @p stream to a note or return 0 if a general loadFile() is sufficient.
+ Note* dropNote(TQMimeSource *source, Basket *tqparent,
+ bool fromDrop = false, TQDropEvent::Action action = TQDropEvent::Copy, Note *noteSource = 0);
+ bool movingNotesInTheSameBasket(TQMimeSource *source, Basket *tqparent, TQDropEvent::Action action);
+ Note* dropURLs(KURL::List urls, Basket *tqparent, TQDropEvent::Action action, bool fromDrop);
+ Note* decodeContent(TQDataStream &stream, NoteType::Id type, Basket *tqparent); /// << Decode the @p stream to a note or return 0 if a general loadFile() is sufficient.
+ void consumeContent(TQDataStream &stream, NoteType::Id type); /// << Decode the @p stream to a note or return 0 if a general loadFile() is sufficient.
/** Functions to create a note file but not load it in a note object */
- QString createNoteLauncherFile(const QString &command, const QString &name, const QString &icon, Basket *parent);
+ TQString createNoteLauncherFile(const TQString &command, const TQString &name, const TQString &icon, Basket *tqparent);
/** Other useful functions */
- NoteType::Id typeForURL(const KURL &url, Basket *parent);
+ NoteType::Id typeForURL(const KURL &url, Basket *tqparent);
bool maybeText(const KURL &url);
bool maybeHtml(const KURL &url);
bool maybeImageOrAnimation(const KURL &url);
bool maybeAnimation(const KURL &url);
bool maybeSound(const KURL &url);
bool maybeLauncher(const KURL &url);
- QString fileNameForNewNote(Basket *parent, const QString &wantedName);
- QString createFileForNewNote(Basket *parent, const QString &extension, const QString &wantedName = "");
+ TQString fileNameForNewNote(Basket *tqparent, const TQString &wantedName);
+ TQString createFileForNewNote(Basket *tqparent, const TQString &extension, const TQString &wantedName = "");
KURL filteredURL(const KURL &url);
- QString titleForURL(const KURL &url);
- QString iconForURL(const KURL &url);
- QString iconForCommand(const QString &command);
- bool isIconExist(const QString &icon);
- QStringList textToURLList(const QString &text); // @Return { url1, title1, url2, title2, url3, title3... }
+ TQString titleForURL(const KURL &url);
+ TQString iconForURL(const KURL &url);
+ TQString iconForCommand(const TQString &command);
+ bool isIconExist(const TQString &icon);
+ TQStringList textToURLList(const TQString &text); // @Return { url1, title1, url2, title2, url3, title3... }
/** Insert GUI menu */
- Note* createEmptyNote( NoteType::Id type, Basket *parent ); // Insert empty if of type Note::Type
- Note* importKMenuLauncher(Basket *parent);
- Note* importIcon(Basket *parent);
- Note* importFileContent(Basket *parent);
+ Note* createEmptyNote( NoteType::Id type, Basket *tqparent ); // Insert empty if of type Note::Type
+ Note* importKMenuLauncher(Basket *tqparent);
+ Note* importIcon(Basket *tqparent);
+ Note* importFileContent(Basket *tqparent);
}
#endif // NOTEFACTORY_H
diff --git a/src/password.cpp b/src/password.cpp
index cbac314..ee48087 100644
--- a/src/password.cpp
+++ b/src/password.cpp
@@ -22,23 +22,23 @@
#ifdef HAVE_LIBGPGME
-#include <qlayout.h>
-#include <qtoolbutton.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kgpgme.h>
#include <basket.h>
-PasswordDlg::PasswordDlg(QWidget *parent, const char *name)
+PasswordDlg::PasswordDlg(TQWidget *tqparent, const char *name)
:KDialogBase(Plain, i18n("Password Protection"), Ok|Cancel, Ok,
- parent, name, /*modal=*/true, /*separator=*/true), w(0)
+ tqparent, name, /*modal=*/true, /*separator=*/true), w(0)
{
- QHBoxLayout* toplayout = new QHBoxLayout(plainPage(), 0, 0);
+ TQHBoxLayout* toptqlayout = new TQHBoxLayout(plainPage(), 0, 0);
w = new Password(plainPage());
- toplayout->addWidget(w, 1);
+ toptqlayout->addWidget(w, 1);
}
PasswordDlg::~PasswordDlg()
@@ -55,12 +55,12 @@ void PasswordDlg::slotOk()
KDialogBase::slotOk();
}
-QString PasswordDlg::key() const
+TQString PasswordDlg::key() const
{
- QString s = w->keyCombo->currentText();
+ TQString s = w->keyCombo->currentText();
if(s.length() < 16)
return "";
- int n = s.findRev(' ');
+ int n = s.tqfindRev(' ');
if(n < 0)
return "";
return s.mid(n+1);
@@ -71,11 +71,11 @@ int PasswordDlg::type() const
return w->buttonGroup->selectedId();
}
-void PasswordDlg::setKey(const QString& key)
+void PasswordDlg::setKey(const TQString& key)
{
for(int i = 0; i < w->keyCombo->count(); ++i)
{
- if(w->keyCombo->text(i).find(key) >= 0)
+ if(w->keyCombo->text(i).tqfind(key) >= 0)
{
w->keyCombo->setCurrentItem(i);
return;
@@ -88,16 +88,16 @@ void PasswordDlg::setType(int type)
w->buttonGroup->setButton(type);
}
-Password::Password(QWidget *parent, const char *name)
- : PasswordLayout(parent, name)
+Password::Password(TQWidget *tqparent, const char *name)
+ : PasswordLayout(tqparent, name)
{
KGpgMe gpg;
KGpgKeyList list = gpg.keys(true);
for(KGpgKeyList::iterator it = list.begin(); it != list.end(); ++it) {
- QString name = gpg.checkForUtf8((*it).name);
+ TQString name = gpg.checkForUtf8((*it).name);
- keyCombo->insertItem(QString("%1 <%2> %3").arg(name).arg((*it).email).arg((*it).id));
+ keyCombo->insertItem(TQString("%1 <%2> %3").tqarg(name).tqarg((*it).email).tqarg((*it).id));
}
publicPrivateRadioButton->setEnabled(keyCombo->count() > 0);
keyCombo->setEnabled(keyCombo->count() > 0);
diff --git a/src/password.h b/src/password.h
index 8df3e0e..01453bf 100644
--- a/src/password.h
+++ b/src/password.h
@@ -24,6 +24,10 @@
#include <config.h>
#endif
+#ifdef Q_MOC_RUN
+#define HAVE_LIBGPGME
+#endif
+
#ifdef HAVE_LIBGPGME
#include <passwordlayout.h>
@@ -35,21 +39,23 @@
class Password : public PasswordLayout
{
Q_OBJECT
+ TQ_OBJECT
public:
- Password(QWidget *parent, const char *name = 0);
+ Password(TQWidget *tqparent, const char *name = 0);
~Password();
};
class PasswordDlg : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- PasswordDlg(QWidget *parent, const char *name = 0);
+ PasswordDlg(TQWidget *tqparent, const char *name = 0);
~PasswordDlg();
- QString key() const;
+ TQString key() const;
int type() const;
- void setKey(const QString& key);
+ void setKey(const TQString& key);
void setType(int type);
protected slots:
diff --git a/src/passwordlayout.ui b/src/passwordlayout.ui
index 9cc630d..37be137 100644
--- a/src/passwordlayout.ui
+++ b/src/passwordlayout.ui
@@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PasswordLayout</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>PasswordLayout</cstring>
</property>
- <property name="geometry">
+ <property name="tqgeometry">
<rect>
<x>0</x>
<y>0</y>
@@ -19,7 +19,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QButtonGroup">
+ <widget class="TQButtonGroup">
<property name="name">
<cstring>buttonGroup</cstring>
</property>
@@ -36,7 +36,7 @@
<property name="margin">
<number>0</number>
</property>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>noPasswordRadioButton</cstring>
</property>
@@ -47,7 +47,7 @@
<string>Alt+N</string>
</property>
</widget>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>passwordRadioButton</cstring>
</property>
@@ -58,15 +58,15 @@
<string>Alt+P</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout2</cstring>
+ <cstring>tqlayout2</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QRadioButton">
+ <widget class="TQRadioButton">
<property name="name">
<cstring>publicPrivateRadioButton</cstring>
</property>
@@ -85,7 +85,7 @@
<string>Alt+K</string>
</property>
</widget>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<property name="name">
<cstring>keyCombo</cstring>
</property>
@@ -104,7 +104,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>6</height>
@@ -113,10 +113,10 @@
</spacer>
</vbox>
</widget>
-<slots>
+<Q_SLOTS>
<slot access="private">changeKey()</slot>
<slot access="private">clearKey()</slot>
-</slots>
-<layoutdefaults spacing="0" margin="0"/>
-<layoutfunctions spacing="KDialog::spacingHint"/>
+</Q_SLOTS>
+<tqlayoutdefaults spacing="0" margin="0"/>
+<tqlayoutfunctions spacing="KDialog::spacingHint"/>
</UI>
diff --git a/src/popupmenu.cpp b/src/popupmenu.cpp
index a73aa65..68085f3 100644
--- a/src/popupmenu.cpp
+++ b/src/popupmenu.cpp
@@ -19,9 +19,9 @@
***************************************************************************/
#include <kapplication.h>
-#include <qdesktopwidget.h>
-#include <qpopupmenu.h>
-#include <qrect.h>
+#include <tqdesktopwidget.h>
+#include <tqpopupmenu.h>
+#include <tqrect.h>
#include "popupmenu.h"
@@ -35,17 +35,17 @@
* expect to try to popup the menu first at bottom-right
* and not at bottom-left.
* NOTE 2 : This implementation do not support virtual desktop with more than
- * one screen. Pehrapse QPopupMenu solve it by itself but I can't
+ * one screen. Pehrapse TQPopupMenu solve it by itself but I can't
* try : I have only one screen.
- * => Have those methods directly in Qt (or KDE) would be a great benefits !
+ * => Have those methods directly in TQt (or KDE) would be a great benefits !
*/
-void PopupMenu::execAtRectCenter(QPopupMenu &menu, const QRect &rect)
+void PopupMenu::execAtRectCenter(TQPopupMenu &menu, const TQRect &rect)
{
// Compute point where to popup the menu that should be centered :
- QSize menuSize = menu.sizeHint();
- QSize menuHalfSize = menuSize / 2;
- QPoint point = rect.center() - QPoint(menuHalfSize.width(), menuHalfSize.height());
+ TQSize menuSize = menu.tqsizeHint();
+ TQSize menuHalfSize = menuSize / 2;
+ TQPoint point = rect.center() - TQPoint(menuHalfSize.width(), menuHalfSize.height());
// Very strange : menu.exec(point) do that clipping (but not when exec() by mouse !!! ) :
// If menu is partially out of the screen, move it :
@@ -57,95 +57,95 @@ void PopupMenu::execAtRectCenter(QPopupMenu &menu, const QRect &rect)
if (point.y() < 0) point.setY(0);*/
// And show the menu :
- menu.exec( point + QPoint(0, MENU_Y_OFFSET) ); // Stupid offset (Qt bug ?) : we should show the menus 2 pixels more bottom !
+ menu.exec( point + TQPoint(0, MENU_Y_OFFSET) ); // Stupid offset (TQt bug ?) : we should show the menus 2 pixels more bottom !
}
// Needed on debug to draw the passed global rectangle :
-//#include <qpainter.h>
-//#include <qpen.h>
+//#include <tqpainter.h>
+//#include <tqpen.h>
-void PopupMenu::execAtRectBottom(QPopupMenu &menu, const QRect &rect, bool centered)
+void PopupMenu::execAtRectBottom(TQPopupMenu &menu, const TQRect &rect, bool centered)
{
- QSize menuSize = menu.sizeHint() - QSize(1, 1); // A size is [1..n] => We want two lengths that are [0..(n-1)]
- int desktopWidth = kapp->desktop()->width(); // to be compared/added/substracted with QRects/QPoints...
+ TQSize menuSize = menu.tqsizeHint() - TQSize(1, 1); // A size is [1..n] => We want two lengths that are [0..(n-1)]
+ int desktopWidth = kapp->desktop()->width(); // to be compared/added/substracted with TQRects/TQPoints...
int desktopHeight = kapp->desktop()->height();
/** Paint the rect on the screen (desktop).
* For test purpose only (to be sure the passed rectangle is right).
* Comment this (and the qpainter and qpen includes) for a non-debug version.
*/
- /*QPainter paint(kapp->desktop(), kapp->desktop(), true);
- paint.setPen( QPen(Qt::black, 1) );
+ /*TQPainter paint(kapp->desktop(), kapp->desktop(), true);
+ paint.setPen( TQPen(TQt::black, 1) );
paint.drawRect(rect);
paint.end();*/
// rect.bottomLeft() and rect.bottomRight() must be VISIBLE :
// show the menu 1 pixel more BOTTOM (add 1 in Y) :
- QPoint point = rect.bottomLeft() + QPoint(0, 1);
+ TQPoint point = rect.bottomLeft() + TQPoint(0, 1);
if (point.y() + menuSize.height() < desktopHeight) { // First try at bottom
if (centered)
- point = QPoint( rect.center().x() - menuSize.width() / 2, point.y() );
+ point = TQPoint( rect.center().x() - menuSize.width() / 2, point.y() );
else if (point.x() + menuSize.width() < desktopWidth) // Then, try at bottom-left
/*point is already set*/;
else // Overwise, at bottom-right
- point = rect.bottomRight() - QPoint(menuSize.width(), - 1);
+ point = rect.bottomRight() - TQPoint(menuSize.width(), - 1);
// Idem : rect.topLeft() and rect.topRight() must be VISIBLE :
// show the menu 1 pixel more TOP (substract 1 in Y) :
} else { // Overwize, try at top
if (centered)
- point = QPoint( rect.center().x() - menuSize.width() / 2, rect.top() - menuSize.height() - 1 );
+ point = TQPoint( rect.center().x() - menuSize.width() / 2, rect.top() - menuSize.height() - 1 );
else if (point.x() + menuSize.width() < desktopWidth) // Then, try at top-left
- point = rect.topLeft() - QPoint(0, menuSize.height() + 1);
+ point = rect.topLeft() - TQPoint(0, menuSize.height() + 1);
else // Overwise, at top-right
- point = rect.topRight() - QPoint(menuSize.width(), menuSize.height() + 1);
+ point = rect.topRight() - TQPoint(menuSize.width(), menuSize.height() + 1);
}
// No need to clip : it will be done by menu.exec(...)
// And show the menu :
- menu.exec( point + QPoint(0, MENU_Y_OFFSET) ); // Stupid offset (Qt bug ?) : we should show the menus 2 pixels more bottom !
+ menu.exec( point + TQPoint(0, MENU_Y_OFFSET) ); // Stupid offset (TQt bug ?) : we should show the menus 2 pixels more bottom !
}
-void PopupMenu::execAtRectRight(QPopupMenu &menu, const QRect &rect, bool centered)
+void PopupMenu::execAtRectRight(TQPopupMenu &menu, const TQRect &rect, bool centered)
{
- QSize menuSize = menu.sizeHint() - QSize(1, 1); // A size is [1..n] => We want two lengths that are [0..(n-1)]
- int desktopWidth = kapp->desktop()->width(); // to be compared/added/substracted with QRects/QPoints...
+ TQSize menuSize = menu.tqsizeHint() - TQSize(1, 1); // A size is [1..n] => We want two lengths that are [0..(n-1)]
+ int desktopWidth = kapp->desktop()->width(); // to be compared/added/substracted with TQRects/TQPoints...
int desktopHeight = kapp->desktop()->height();
/** Paint the rect on the screen (desktop).
* For test purpose only (to be sure the passed rectangle is right).
* Comment this (and the qpainter and qpen includes) for a non-debug version.
*/
- /*QPainter paint(kapp->desktop(), kapp->desktop(), true);
- paint.setPen( QPen(Qt::black, 1) );
+ /*TQPainter paint(kapp->desktop(), kapp->desktop(), true);
+ paint.setPen( TQPen(TQt::black, 1) );
paint.drawRect(rect);
paint.end();*/
// rect.topRight() and rect.topLeft() must be VISIBLE :
// show the menu 1 pixel more RIGHT (add 1 in X) :
- QPoint point = rect.topRight() + QPoint(1, 0);
+ TQPoint point = rect.topRight() + TQPoint(1, 0);
if (point.x() + menuSize.width() < desktopWidth) { // First try at right
if (centered)
- point = QPoint( point.x(), rect.center().y() - menuSize.height() / 2 );
+ point = TQPoint( point.x(), rect.center().y() - menuSize.height() / 2 );
else if (point.y() + menuSize.height() < desktopHeight) // Then, try at top-right
/*point is already set*/;
else // Overwise, at top-left
- point = rect.bottomRight() - QPoint(-1, menuSize.height());
+ point = rect.bottomRight() - TQPoint(-1, menuSize.height());
// Idem : rect.topLeft() and rect.bottomLeft() must be VISIBLE :
// show the menu 1 pixel more LEFT (substract 1 in X) :
} else { // Overwize, try at top
if (centered)
- point = QPoint( rect.left() - menuSize.width() - 1, rect.center().y() - menuSize.height() / 2 );
+ point = TQPoint( rect.left() - menuSize.width() - 1, rect.center().y() - menuSize.height() / 2 );
else if (point.y() + menuSize.height() < desktopHeight) // Then, try at top-left
- point = rect.topLeft() - QPoint(menuSize.width() + 1, 0);
+ point = rect.topLeft() - TQPoint(menuSize.width() + 1, 0);
else // Overwise, at bottom-left
- point = rect.bottomLeft() - QPoint(menuSize.width() + 1, menuSize.height());
+ point = rect.bottomLeft() - TQPoint(menuSize.width() + 1, menuSize.height());
}
// No need to clip : it will be done by menu.exec(...)
// And show the menu :
- menu.exec( point + QPoint(0, MENU_Y_OFFSET) ); // Stupid offset (Qt bug ?) : we should show the menus 2 pixels more bottom !
+ menu.exec( point + TQPoint(0, MENU_Y_OFFSET) ); // Stupid offset (TQt bug ?) : we should show the menus 2 pixels more bottom !
}
// # i n c l u d e " p o p u p m e n u . m o c " // Comment this if you don't compile PopupMenuTest class
diff --git a/src/popupmenu.h b/src/popupmenu.h
index fa92f39..e9bdaae 100644
--- a/src/popupmenu.h
+++ b/src/popupmenu.h
@@ -21,10 +21,10 @@
#ifndef POPUPMENU_H
#define POPUPMENU_H
-class QPopupMenu;
-class QRect;
+class TQPopupMenu;
+class TQRect;
-/** QPopupMenu/KPopupMenu doesn't provide metod to exec a menu
+/** TQPopupMenu/KPopupMenu doesn't provide metod to exec a menu
* at a given rectangle !
* eg, popup at bottom of a rectangle, and at top if not possible...
* @author Sébastien Laoût
@@ -33,7 +33,7 @@ namespace PopupMenu
{
/** Show the popup menu centered into rect.
*/
- void execAtRectCenter(QPopupMenu &menu, const QRect &rect);
+ void execAtRectCenter(TQPopupMenu &menu, const TQRect &rect);
/** Show the popup menu at left-bottom of rect, or at right-bottom
* if not possible (not enought place).
@@ -42,7 +42,7 @@ namespace PopupMenu
* If center is true, it will try to horizontaly center the popup with
* rect, so it will try two positions : bottom center and then top center.
*/
- void execAtRectBottom(QPopupMenu &menu, const QRect &rect, bool centered = false);
+ void execAtRectBottom(TQPopupMenu &menu, const TQRect &rect, bool centered = false);
/** Idem execAtRectBottom but on the right or left sides,
* prior aligned with the top of the rect, and at the bottom
@@ -50,11 +50,11 @@ namespace PopupMenu
* If center is true, it will try to vertically center the popup with
* rect, so it will try two positions : right center and then left center.
*/
- void execAtRectRight(QPopupMenu &menu, const QRect &rect, bool centered = false);
+ void execAtRectRight(TQPopupMenu &menu, const TQRect &rect, bool centered = false);
}
/** Test window of PopupMenu methods.
- * Just include popupmenu.h in a main Qt application and call
+ * Just include popupmenu.h in a main TQt application and call
* new PopupMenuTest();
* Click the window for more explications.
* Resize it to test particular cases.
@@ -64,26 +64,26 @@ namespace PopupMenu
/*****
-#include <qwidget.h>
-#include <qpopupmenu.h>
-#include <qpainter.h>
-#include <qpen.h>
+#include <tqwidget.h>
+#include <tqpopupmenu.h>
+#include <tqpainter.h>
+#include <tqpen.h>
c l a s s P o p u p M e n u T e s t : p u b l i c Q W i d g e t
{
Q _ O B J E C T
p u b l i c:
PopupMenuTest()
- : QWidget(0)
+ : TQWidget(0)
{
setCaption("Click to test!");
show();
}
- void mousePressEvent(QMouseEvent *event)
+ void mousePressEvent(TQMouseEvent *event)
{
- QPopupMenu menu;
- QRect rect( mapToGlobal(QPoint(0,0)), size() );
+ TQPopupMenu menu;
+ TQRect rect( mapToGlobal(TQPoint(0,0)), size() );
menu.insertItem("A test of popup menu!");
menu.insertItem("This menu contain some items");
@@ -96,23 +96,23 @@ c l a s s P o p u p M e n u T e s t : p u b l i c Q W i d g e t
if (event->button() & Qt::LeftButton)
PopupMenu::execAtRectCenter(menu, rect);
- else if ((event->button() & Qt::RightButton) && (event->state() & Qt::ShiftButton))
+ else if ((event->button() & Qt::RightButton) && (event->state() & TQt::ShiftButton))
PopupMenu::execAtRectBottom(menu, rect, true);
else if (event->button() & Qt::RightButton)
PopupMenu::execAtRectBottom(menu, rect);
- else if ((event->button() & Qt::MidButton) && (event->state() & Qt::ShiftButton))
+ else if ((event->button() & TQt::MidButton) && (event->state() & TQt::ShiftButton))
PopupMenu::execAtRectRight(menu, rect, true);
- else if (event->button() & Qt::MidButton)
+ else if (event->button() & TQt::MidButton)
PopupMenu::execAtRectRight(menu, rect);
}
- void paintEvent(QPaintEvent*)
+ void paintEvent(TQPaintEvent*)
{
- QPainter paint(this);
+ TQPainter paint(this);
paint.setPen(paletteBackgroundColor());
paint.drawRect(rect());
paint.drawWinFocusRect(rect());
- paint.setPen( QPen(Qt::black, 1) );
+ paint.setPen( TQPen(TQt::black, 1) );
paint.drawLine( rect().topLeft(), rect().bottomRight() );
paint.drawLine( rect().topRight(), rect().bottomLeft() );
}
diff --git a/src/qeffects.cpp b/src/qeffects.cpp
index 4658373..45ff01d 100644
--- a/src/qeffects.cpp
+++ b/src/qeffects.cpp
@@ -1,8 +1,8 @@
#if 0
-// Note: this file has been copied from the Qt source.
-// Those classes are normally used internally in Qt
-// but we need them for immitate the roll-over effect of QComboBox.
+// Note: this file has been copied from the TQt source.
+// Those classes are normally used internally in TQt
+// but we need them for immitate the roll-over effect of TQComboBox.
//
// A portion of code has been added. It's underlined by "THIS CODE WAS ADDED:".
//
@@ -12,33 +12,33 @@
/****************************************************************************
** $Id: qt/qeffects.cpp 3.3.4 edited Dec 10 10:13 $
**
-** Implementation of QEffects functions
+** Implementation of TQEffects functions
**
** Created : 000621
**
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** This file is part of the widgets module of the Qt GUI Toolkit.
+** This file is part of the widgets module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -46,51 +46,51 @@
**
**********************************************************************/
-#include "qapplication.h"
-#ifndef QT_NO_EFFECTS
-#include "qwidget.h"
-#include "qeffects.h"
-#include "qpixmap.h"
-#include "qimage.h"
-#include "qtimer.h"
-#include "qdatetime.h"
-#include "qguardedptr.h"
-#include "qscrollview.h"
+#include "tqapplication.h"
+#ifndef TQT_NO_EFFECTS
+#include "tqwidget.h"
+#include "tqeffects.h"
+#include "tqpixmap.h"
+#include "tqimage.h"
+#include "tqtimer.h"
+#include "tqdatetime.h"
+#include "tqguardedptr.h"
+#include "tqscrollview.h"
/* REMOVED CLASS DEFINITION HERE (MOVED TO qeffects.h) */
-static QAlphaWidget* q_blend = 0;
+static TQAlphaWidget* q_blend = 0;
/*
- Constructs a QAlphaWidget.
+ Constructs a TQAlphaWidget.
*/
-QAlphaWidget::QAlphaWidget( QWidget* w, WFlags f )
- : QWidget( QApplication::desktop()->screen(QApplication::desktop()->screenNumber(w)),
+TQAlphaWidget::TQAlphaWidget( TQWidget* w, WFlags f )
+ : TQWidget( TQApplication::desktop()->screen(TQApplication::desktop()->screenNumber(w)),
"qt internal alpha effect widget", f )
{
-#if 1 //ndef Q_WS_WIN
+#if 1 //ndef TQ_WS_WIN
setEnabled( FALSE );
#endif
- pm.setOptimization( QPixmap::BestOptim );
+ pm.setOptimization( TQPixmap::BestOptim );
setBackgroundMode( NoBackground );
- widget = (QAccessWidget*)w;
+ widget = (TQAccessWidget*)w;
alpha = 0;
}
/*
\reimp
*/
-void QAlphaWidget::paintEvent( QPaintEvent* )
+void TQAlphaWidget::paintEvent( TQPaintEvent* )
{
- bitBlt( this, QPoint(0,0), &pm );
+ bitBlt( this, TQPoint(0,0), &pm );
}
/*
Starts the alphablending animation.
The animation will take about \a time ms
*/
-void QAlphaWidget::run( int time )
+void TQAlphaWidget::run( int time )
{
duration = time;
@@ -104,20 +104,20 @@ void QAlphaWidget::run( int time )
checkTime.start();
showWidget = TRUE;
- qApp->installEventFilter( this );
+ tqApp->installEventFilter( this );
widget->setWState( WState_Visible );
- move( widget->geometry().x(),widget->geometry().y() );
+ move( widget->tqgeometry().x(),widget->tqgeometry().y() );
resize( widget->size().width(), widget->size().height() );
- front = QImage( widget->size(), 32 );
- front = QPixmap::grabWidget( widget );
+ front = TQImage( widget->size(), 32 );
+ front = TQPixmap::grabWidget( widget );
- back = QImage( widget->size(), 32 );
- back = QPixmap::grabWindow( QApplication::desktop()->winId(),
- widget->geometry().x(), widget->geometry().y(),
- widget->geometry().width(), widget->geometry().height() );
+ back = TQImage( widget->size(), 32 );
+ back = TQPixmap::grabWindow( TQApplication::desktop()->winId(),
+ widget->tqgeometry().x(), widget->tqgeometry().y(),
+ widget->tqgeometry().width(), widget->tqgeometry().height() );
if ( !back.isNull() && checkTime.elapsed() < duration / 2 ) {
mixed = back.copy();
@@ -125,7 +125,7 @@ void QAlphaWidget::run( int time )
show();
setEnabled(FALSE);
- connect( &anim, SIGNAL(timeout()), this, SLOT(render()));
+ connect( &anim, TQT_SIGNAL(timeout()), this, TQT_SLOT(render()));
anim.start( 1 );
} else {
duration = 0;
@@ -136,32 +136,32 @@ void QAlphaWidget::run( int time )
/*
\reimp
*/
-bool QAlphaWidget::eventFilter( QObject* o, QEvent* e )
+bool TQAlphaWidget::eventFilter( TQObject* o, TQEvent* e )
{
switch ( e->type() ) {
- case QEvent::Move:
+ case TQEvent::Move:
if ( o != widget )
break;
- move( widget->geometry().x(),widget->geometry().y() );
+ move( widget->tqgeometry().x(),widget->tqgeometry().y() );
update();
break;
- case QEvent::Hide:
- case QEvent::Close:
+ case TQEvent::Hide:
+ case TQEvent::Close:
if ( o != widget )
break;
- case QEvent::MouseButtonPress:
-#ifndef QT_NO_SCROLLVIEW
- if ( ::qt_cast<QScrollView*>(o) )
+ case TQEvent::MouseButtonPress:
+#ifndef TQT_NO_SCROLLVIEW
+ if ( ::tqqt_cast<TQScrollView*>(o) )
break;
#endif
- case QEvent::MouseButtonDblClick:
+ case TQEvent::MouseButtonDblClick:
setEnabled(TRUE);
showWidget = FALSE;
render();
break;
- case QEvent::KeyPress:
+ case TQEvent::KeyPress:
{
- QKeyEvent *ke = (QKeyEvent*)e;
+ TQKeyEvent *ke = (TQKeyEvent*)e;
if ( ke->key() == Key_Escape )
showWidget = FALSE;
else
@@ -172,13 +172,13 @@ bool QAlphaWidget::eventFilter( QObject* o, QEvent* e )
default:
break;
}
- return QWidget::eventFilter( o, e );
+ return TQWidget::eventFilter( o, e );
}
/*
\reimp
*/
-void QAlphaWidget::closeEvent( QCloseEvent *e )
+void TQAlphaWidget::closeEvent( TQCloseEvent *e )
{
e->accept();
if ( !q_blend )
@@ -187,7 +187,7 @@ void QAlphaWidget::closeEvent( QCloseEvent *e )
showWidget = FALSE;
render();
- QWidget::closeEvent( e );
+ TQWidget::closeEvent( e );
}
/*
@@ -196,7 +196,7 @@ void QAlphaWidget::closeEvent( QCloseEvent *e )
Show the blended widget and free all allocated source
if the blending is finished.
*/
-void QAlphaWidget::render()
+void TQAlphaWidget::render()
{
int tempel = checkTime.elapsed();
if ( elapsed >= tempel )
@@ -210,11 +210,11 @@ void QAlphaWidget::render()
alpha = 1;
if ( alpha >= 1 || !showWidget) {
anim.stop();
- qApp->removeEventFilter( this );
+ tqApp->removeEventFilter( this );
if ( widget ) {
if ( !showWidget ) {
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
setEnabled(TRUE);
setFocus();
#endif
@@ -223,8 +223,8 @@ void QAlphaWidget::render()
widget->clearWState( WState_Visible );
} else if ( duration ) {
BackgroundMode bgm = widget->backgroundMode();
- QColor erc = widget->eraseColor();
- const QPixmap *erp = widget->erasePixmap();
+ TQColor erc = widget->eraseColor();
+ const TQPixmap *erp = widget->erasePixmap();
widget->clearWState( WState_Visible );
widget->setBackgroundMode( NoBackground );
@@ -251,14 +251,14 @@ void QAlphaWidget::render()
widget->clearWState( WState_ForceHide );
alphaBlend();
pm = mixed;
- repaint( FALSE );
+ tqrepaint( FALSE );
}
}
/*
Calculate an alphablended image.
*/
-void QAlphaWidget::alphaBlend()
+void TQAlphaWidget::alphaBlend()
{
const double ia = 1-alpha;
const int sw = front.width();
@@ -266,20 +266,20 @@ void QAlphaWidget::alphaBlend()
switch( front.depth() ) {
case 32:
{
- Q_UINT32** md = (Q_UINT32**)mixed.jumpTable();
- Q_UINT32** bd = (Q_UINT32**)back.jumpTable();
- Q_UINT32** fd = (Q_UINT32**)front.jumpTable();
+ TQ_UINT32** md = (TQ_UINT32**)mixed.jumpTable();
+ TQ_UINT32** bd = (TQ_UINT32**)back.jumpTable();
+ TQ_UINT32** fd = (TQ_UINT32**)front.jumpTable();
for (int sy = 0; sy < sh; sy++ ) {
- Q_UINT32* bl = ((Q_UINT32*)bd[sy]);
- Q_UINT32* fl = ((Q_UINT32*)fd[sy]);
+ TQ_UINT32* bl = ((TQ_UINT32*)bd[sy]);
+ TQ_UINT32* fl = ((TQ_UINT32*)fd[sy]);
for (int sx = 0; sx < sw; sx++ ) {
- Q_UINT32 bp = bl[sx];
- Q_UINT32 fp = fl[sx];
+ TQ_UINT32 bp = bl[sx];
+ TQ_UINT32 fp = fl[sx];
- ((Q_UINT32*)(md[sy]))[sx] = qRgb(int (qRed(bp)*ia + qRed(fp)*alpha),
- int (qGreen(bp)*ia + qGreen(fp)*alpha),
- int (qBlue(bp)*ia + qBlue(fp)*alpha) );
+ ((TQ_UINT32*)(md[sy]))[sx] = tqRgb(int (tqRed(bp)*ia + tqRed(fp)*alpha),
+ int (tqGreen(bp)*ia + tqGreen(fp)*alpha),
+ int (tqBlue(bp)*ia + tqBlue(fp)*alpha) );
}
}
}
@@ -290,19 +290,19 @@ void QAlphaWidget::alphaBlend()
/* REMOVED CLASS DEFINITION HERE (MOVED TO qeffects.h) */
-static QRollEffect* q_roll = 0;
+static TQRollEffect* q_roll = 0;
/*
- Construct a QRollEffect widget.
+ Construct a TQRollEffect widget.
*/
-QRollEffect::QRollEffect( QWidget* w, WFlags f, DirFlags orient )
- : QWidget( QApplication::desktop()->screen(QApplication::desktop()->screenNumber(w)),
+TQRollEffect::TQRollEffect( TQWidget* w, WFlags f, DirFlags orient )
+ : TQWidget( TQApplication::desktop()->screen(TQApplication::desktop()->screenNumber(w)),
"qt internal roll effect widget", f ), orientation(orient)
{
-#if 1 //ndef Q_WS_WIN
+#if 1 //ndef TQ_WS_WIN
setEnabled( FALSE );
#endif
- widget = (QAccessWidget*) w;
+ widget = (TQAccessWidget*) w;
Q_ASSERT( widget );
setBackgroundMode( NoBackground );
@@ -311,8 +311,8 @@ QRollEffect::QRollEffect( QWidget* w, WFlags f, DirFlags orient )
totalWidth = widget->width();
totalHeight = widget->height();
} else {
- totalWidth = widget->sizeHint().width();
- totalHeight = widget->sizeHint().height();
+ totalWidth = widget->tqsizeHint().width();
+ totalHeight = widget->tqsizeHint().height();
}
currentHeight = totalHeight;
@@ -323,17 +323,17 @@ QRollEffect::QRollEffect( QWidget* w, WFlags f, DirFlags orient )
if ( orientation & (DownScroll|UpScroll) )
currentHeight = 0;
- pm.setOptimization( QPixmap::BestOptim );
- pm = QPixmap::grabWidget( widget );
+ pm.setOptimization( TQPixmap::BestOptim );
+ pm = TQPixmap::grabWidget( widget );
}
/*
\reimp
*/
-void QRollEffect::paintEvent( QPaintEvent* )
+void TQRollEffect::paintEvent( TQPaintEvent* )
{
- int x = orientation & RightScroll ? QMIN(0, currentWidth - totalWidth) : 0;
- int y = orientation & DownScroll ? QMIN(0, currentHeight - totalHeight) : 0;
+ int x = orientation & RightScroll ? TQMIN(0, currentWidth - totalWidth) : 0;
+ int y = orientation & DownScroll ? TQMIN(0, currentHeight - totalHeight) : 0;
bitBlt( this, x, y, &pm,
0, 0, pm.width(), pm.height(), CopyROP, TRUE );
@@ -342,17 +342,17 @@ void QRollEffect::paintEvent( QPaintEvent* )
/*
\reimp
*/
-bool QRollEffect::eventFilter( QObject* o, QEvent* e )
+bool TQRollEffect::eventFilter( TQObject* o, TQEvent* e )
{
switch ( e->type() ) {
- case QEvent::Move:
+ case TQEvent::Move:
if ( o != widget )
break;
- move( widget->geometry().x(),widget->geometry().y() );
+ move( widget->tqgeometry().x(),widget->tqgeometry().y() );
update();
break;
- case QEvent::Hide:
- case QEvent::Close:
+ case TQEvent::Hide:
+ case TQEvent::Close:
if ( o != widget || done )
break;
setEnabled(TRUE);
@@ -360,12 +360,12 @@ bool QRollEffect::eventFilter( QObject* o, QEvent* e )
done = TRUE;
scroll();
break;
- case QEvent::MouseButtonPress:
-#ifndef QT_NO_SCROLLVIEW
- if ( ::qt_cast<QScrollView*>(o) )
+ case TQEvent::MouseButtonPress:
+#ifndef TQT_NO_SCROLLVIEW
+ if ( ::tqqt_cast<TQScrollView*>(o) )
break;
#endif
- case QEvent::MouseButtonDblClick:
+ case TQEvent::MouseButtonDblClick:
if ( done )
break;
setEnabled(TRUE);
@@ -373,13 +373,13 @@ bool QRollEffect::eventFilter( QObject* o, QEvent* e )
done = TRUE;
scroll();
break;
- case QEvent::KeyPress:
+ case TQEvent::KeyPress:
{
- QKeyEvent *ke = (QKeyEvent*)e;
+ TQKeyEvent *ke = (TQKeyEvent*)e;
/* THIS CODE WAS ADDED: ************** */
- if (ke->key() == Qt::Key_Enter) /*** Because we are simulating an Enter key press. */
+ if (ke->key() == TQt::Key_Enter) /*** Because we are simulating an Enter key press. */
break; /*** So we should not car about it and continue the animation. */
/************************************* */
@@ -393,13 +393,13 @@ bool QRollEffect::eventFilter( QObject* o, QEvent* e )
default:
break;
}
- return QWidget::eventFilter( o, e );
+ return TQWidget::eventFilter( o, e );
}
/*
\reimp
*/
-void QRollEffect::closeEvent( QCloseEvent *e )
+void TQRollEffect::closeEvent( TQCloseEvent *e )
{
e->accept();
if ( done )
@@ -408,7 +408,7 @@ void QRollEffect::closeEvent( QCloseEvent *e )
done = TRUE;
scroll();
- QWidget::closeEvent( e );
+ TQWidget::closeEvent( e );
}
/*
@@ -417,7 +417,7 @@ void QRollEffect::closeEvent( QCloseEvent *e )
The animation will take about \a time ms, or is
calculated if \a time is negative
*/
-void QRollEffect::run( int time )
+void TQRollEffect::run( int time )
{
if ( !widget )
return;
@@ -431,20 +431,20 @@ void QRollEffect::run( int time )
dist += totalWidth - currentWidth;
if ( orientation & (DownScroll|UpScroll) )
dist += totalHeight - currentHeight;
- duration = QMIN( QMAX( dist/3, 50 ), 120 );
+ duration = TQMIN( TQMAX( dist/3, 50 ), 120 );
}
- connect( &anim, SIGNAL(timeout()), this, SLOT(scroll()));
+ connect( &anim, TQT_SIGNAL(timeout()), this, TQT_SLOT(scroll()));
widget->setWState( WState_Visible );
- move( widget->geometry().x(),widget->geometry().y() );
- resize( QMIN( currentWidth, totalWidth ), QMIN( currentHeight, totalHeight ) );
+ move( widget->tqgeometry().x(),widget->tqgeometry().y() );
+ resize( TQMIN( currentWidth, totalWidth ), TQMIN( currentHeight, totalHeight ) );
show();
setEnabled(FALSE);
- qApp->installEventFilter( this );
+ tqApp->installEventFilter( this );
showWidget = TRUE;
done = FALSE;
@@ -455,7 +455,7 @@ void QRollEffect::run( int time )
/*
Roll according to the time elapsed.
*/
-void QRollEffect::scroll()
+void TQRollEffect::scroll()
{
if ( !done && widget) {
widget->clearWState( WState_ForceHide );
@@ -484,32 +484,32 @@ void QRollEffect::scroll()
int w = totalWidth;
int h = totalHeight;
- int x = widget->geometry().x();
- int y = widget->geometry().y();
+ int x = widget->tqgeometry().x();
+ int y = widget->tqgeometry().y();
if ( orientation & RightScroll || orientation & LeftScroll )
- w = QMIN( currentWidth, totalWidth );
+ w = TQMIN( currentWidth, totalWidth );
if ( orientation & DownScroll || orientation & UpScroll )
- h = QMIN( currentHeight, totalHeight );
+ h = TQMIN( currentHeight, totalHeight );
setUpdatesEnabled( FALSE );
if ( orientation & UpScroll )
- y = widget->geometry().y() + QMAX( 0, totalHeight - currentHeight );
+ y = widget->tqgeometry().y() + TQMAX( 0, totalHeight - currentHeight );
if ( orientation & LeftScroll )
- x = widget->geometry().x() + QMAX( 0, totalWidth - currentWidth );
+ x = widget->tqgeometry().x() + TQMAX( 0, totalWidth - currentWidth );
if ( orientation & UpScroll || orientation & LeftScroll )
move( x, y );
resize( w, h );
setUpdatesEnabled( TRUE );
- repaint( FALSE );
+ tqrepaint( FALSE );
}
if ( done ) {
anim.stop();
- qApp->removeEventFilter( this );
+ tqApp->removeEventFilter( this );
if ( widget ) {
if ( !showWidget ) {
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
setEnabled(TRUE);
setFocus();
#endif
@@ -518,8 +518,8 @@ void QRollEffect::scroll()
widget->clearWState( WState_Visible );
} else {
BackgroundMode bgm = widget->backgroundMode();
- QColor erc = widget->eraseColor();
- const QPixmap *erp = widget->erasePixmap();
+ TQColor erc = widget->eraseColor();
+ const TQPixmap *erp = widget->erasePixmap();
widget->clearWState( WState_Visible );
widget->setBackgroundMode( NoBackground );
@@ -551,52 +551,52 @@ void QRollEffect::scroll()
Scroll widget \a w in \a time ms. \a orient may be 1 (vertical), 2
(horizontal) or 3 (diagonal).
*/
-void qScrollEffect( QWidget* w, QEffects::DirFlags orient, int time )
+void qScrollEffect( TQWidget* w, TQEffects::DirFlags orient, int time )
{
if ( q_roll ) {
delete q_roll;
q_roll = 0;
}
- qApp->sendPostedEvents( w, QEvent::Move );
- qApp->sendPostedEvents( w, QEvent::Resize );
-#ifdef Q_WS_X11
- uint flags = Qt::WStyle_Customize | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop
- | (w->isPopup() ? Qt::WType_Popup : (Qt::WX11BypassWM | Qt::WStyle_Tool));
+ tqApp->sendPostedEvents( w, TQEvent::Move );
+ tqApp->sendPostedEvents( w, TQEvent::Resize );
+#ifdef TQ_WS_X11
+ uint flags = TQt::WStyle_Customize | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop
+ | (w->isPopup() ? TQt::WType_Popup : (TQt::WX11BypassWM | TQt::WStyle_Tool));
#else
- uint flags = Qt::WStyle_Customize | Qt::WType_Popup | Qt::WX11BypassWM | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop;
+ uint flags = TQt::WStyle_Customize | TQt::WType_Popup | TQt::WX11BypassWM | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop;
#endif
// those can popups - they would steal the focus, but are disabled
- q_roll = new QRollEffect( w, flags, orient );
+ q_roll = new TQRollEffect( w, flags, orient );
q_roll->run( time );
}
/*!
Fade in widget \a w in \a time ms.
*/
-void qFadeEffect( QWidget* w, int time )
+void qFadeEffect( TQWidget* w, int time )
{
if ( q_blend ) {
delete q_blend;
q_blend = 0;
}
- qApp->sendPostedEvents( w, QEvent::Move );
- qApp->sendPostedEvents( w, QEvent::Resize );
+ tqApp->sendPostedEvents( w, TQEvent::Move );
+ tqApp->sendPostedEvents( w, TQEvent::Resize );
-#ifdef Q_WS_X11
- uint flags = Qt::WStyle_Customize | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop
- | (w->isPopup() ? Qt::WType_Popup : (Qt::WX11BypassWM | Qt::WStyle_Tool));
+#ifdef TQ_WS_X11
+ uint flags = TQt::WStyle_Customize | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop
+ | (w->isPopup() ? TQt::WType_Popup : (TQt::WX11BypassWM | TQt::WStyle_Tool));
#else
- uint flags = Qt::WStyle_Customize | Qt::WType_Popup | Qt::WX11BypassWM | Qt::WNoAutoErase | Qt::WStyle_StaysOnTop;
+ uint flags = TQt::WStyle_Customize | TQt::WType_Popup | TQt::WX11BypassWM | TQt::WNoAutoErase | TQt::WStyle_StaysOnTop;
#endif
// those can popups - they would steal the focus, but are disabled
- q_blend = new QAlphaWidget( w, flags );
+ q_blend = new TQAlphaWidget( w, flags );
q_blend->run( time );
}
-#endif //QT_NO_EFFECTS
+#endif //TQT_NO_EFFECTS
#endif // #if 0
diff --git a/src/qeffects.h b/src/qeffects.h
index b898ad4..eb6f308 100644
--- a/src/qeffects.h
+++ b/src/qeffects.h
@@ -1,8 +1,8 @@
#if 0
-// Note: this file has been copied from the Qt source.
-// Those classes are normally used internally in Qt
-// but we need them for immitate the roll-over effect of QComboBox.
+// Note: this file has been copied from the TQt source.
+// Those classes are normally used internally in TQt
+// but we need them for immitate the roll-over effect of TQComboBox.
//
// Some class definitions have been moved from qeffects.cpp to this file.
// They are framed with the comment "MOVED FROM qeffect.cpp"
@@ -10,33 +10,33 @@
/****************************************************************************
** $Id: qt/qeffects_p.h 3.3.4 edited May 27 2003 $
**
-** Definition of QEffects functions
+** Definition of TQEffects functions
**
** Created : 000621
**
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** This file is part of the widgets module of the Qt GUI Toolkit.
+** This file is part of the widgets module of the TQt GUI Toolkit.
**
** This file may be distributed under the terms of the Q Public License
** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
+** LICENSE.TQPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
+** information about TQt Commercial License Agreements.
+** See http://www.trolltech.com/qpl/ for TQPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -44,15 +44,15 @@
**
**********************************************************************/
-#ifndef QEFFECTS_P_H
-#define QEFFECTS_P_H
+#ifndef TQEFFECTS_P_H
+#define TQEFFECTS_P_H
//
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
+// This file is not part of the TQt API. It exists for the convenience
// of qeffects.cpp, qcombobox.cpp, qpopupmenu.cpp and qtooltip.cpp.
// This header file may change from version to version without notice,
// or even be removed.
@@ -61,14 +61,14 @@
//
//
-#ifndef QT_H
-#include "qnamespace.h"
-#endif // QT_H
+#ifndef TQT_H
+#include "tqnamespace.h"
+#endif // TQT_H
-#ifndef QT_NO_EFFECTS
-class QWidget;
+#ifndef TQT_NO_EFFECTS
+class TQWidget;
-struct QEffects
+struct TQEffects
{
enum Direction {
LeftScroll = 0x0001,
@@ -80,94 +80,96 @@ struct QEffects
typedef uint DirFlags;
};
-extern void Q_EXPORT qScrollEffect( QWidget*, QEffects::DirFlags dir = QEffects::DownScroll, int time = -1 );
-extern void Q_EXPORT qFadeEffect( QWidget*, int time = -1 );
+extern void TQ_EXPORT qScrollEffect( TQWidget*, TQEffects::DirFlags dir = TQEffects::DownScroll, int time = -1 );
+extern void TQ_EXPORT qFadeEffect( TQWidget*, int time = -1 );
/******************* MOVED FROM qeffect.cpp: */
-#include "qguardedptr.h"
-#include "qdatetime.h"
-#include "qtimer.h"
-#include "qpixmap.h"
-#include "qimage.h"
+#include "tqguardedptr.h"
+#include "tqdatetime.h"
+#include "tqtimer.h"
+#include "tqpixmap.h"
+#include "tqimage.h"
/*
- Internal class to get access to protected QWidget-members
+ Internal class to get access to protected TQWidget-members
*/
-class QAccessWidget : public QWidget
+class TQAccessWidget : public TQWidget
{
- friend class QAlphaWidget;
- friend class QRollEffect;
+ friend class TQAlphaWidget;
+ friend class TQRollEffect;
public:
- QAccessWidget( QWidget* parent=0, const char* name=0, WFlags f = 0 )
- : QWidget( parent, name, f ) {}
+ TQAccessWidget( TQWidget* tqparent=0, const char* name=0, WFlags f = 0 )
+ : TQWidget( tqparent, name, f ) {}
};
/*
- Internal class QAlphaWidget.
+ Internal class TQAlphaWidget.
- The QAlphaWidget is shown while the animation lasts
+ The TQAlphaWidget is shown while the animation lasts
and displays the pixmap resulting from the alpha blending.
*/
-class QAlphaWidget: public QWidget, private QEffects
+class TQAlphaWidget: public TQWidget, private TQEffects
{
Q_OBJECT
+ TQ_OBJECT
public:
- QAlphaWidget( QWidget* w, WFlags f = 0 );
+ TQAlphaWidget( TQWidget* w, WFlags f = 0 );
void run( int time );
protected:
- void paintEvent( QPaintEvent* e );
- void closeEvent( QCloseEvent* );
- bool eventFilter( QObject* o, QEvent* e );
+ void paintEvent( TQPaintEvent* e );
+ void closeEvent( TQCloseEvent* );
+ bool eventFilter( TQObject* o, TQEvent* e );
void alphaBlend();
protected slots:
void render();
private:
- QPixmap pm;
+ TQPixmap pm;
double alpha;
- QImage back;
- QImage front;
- QImage mixed;
- QGuardedPtr<QAccessWidget> widget;
+ TQImage back;
+ TQImage front;
+ TQImage mixed;
+ TQGuardedPtr<TQAccessWidget> widget;
int duration;
int elapsed;
bool showWidget;
- QTimer anim;
- QTime checkTime;
+ TQTimer anim;
+ TQTime checkTime;
};
/*
- Internal class QRollEffect
+ Internal class TQRollEffect
- The QRollEffect widget is shown while the animation lasts
+ The TQRollEffect widget is shown while the animation lasts
and displays a scrolling pixmap.
*/
-class QRollEffect : public QWidget, private QEffects
+class TQRollEffect : public TQWidget, private TQEffects
{
Q_OBJECT
+ TQ_OBJECT
public:
- QRollEffect( QWidget* w, WFlags f, DirFlags orient );
+ TQRollEffect( TQWidget* w, WFlags f, DirFlags orient );
void run( int time );
protected:
- void paintEvent( QPaintEvent* );
- bool eventFilter( QObject*, QEvent* );
- void closeEvent( QCloseEvent* );
+ void paintEvent( TQPaintEvent* );
+ bool eventFilter( TQObject*, TQEvent* );
+ void closeEvent( TQCloseEvent* );
private slots:
void scroll();
private:
- QGuardedPtr<QAccessWidget> widget;
+ TQGuardedPtr<TQAccessWidget> widget;
int currentHeight;
int currentWidth;
@@ -180,16 +182,16 @@ class QRollEffect : public QWidget, private QEffects
bool showWidget;
int orientation;
- QTimer anim;
- QTime checkTime;
+ TQTimer anim;
+ TQTime checkTime;
- QPixmap pm;
+ TQPixmap pm;
};
/******************************/
-#endif // QT_NO_EFFECTS
+#endif // TQT_NO_EFFECTS
-#endif // QEFFECTS_P_H
+#endif // TQEFFECTS_P_H
#endif // #if 0
diff --git a/src/regiongrabber.cpp b/src/regiongrabber.cpp
index f7924e6..f7a1534 100644
--- a/src/regiongrabber.cpp
+++ b/src/regiongrabber.cpp
@@ -21,30 +21,30 @@
#include "regiongrabber.h"
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpalette.h>
-#include <qstyle.h>
-#include <qtimer.h>
-#include <qtooltip.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpalette.h>
+#include <tqstyle.h>
+#include <tqtimer.h>
+#include <tqtooltip.h>
#include <kglobalsettings.h>
-SizeTip::SizeTip( QWidget *parent, const char *name )
- : QLabel( parent, name, WStyle_Customize | WX11BypassWM |
+SizeTip::SizeTip( TQWidget *tqparent, const char *name )
+ : TQLabel( tqparent, name, WStyle_Customize | WX11BypassWM |
WStyle_StaysOnTop | WStyle_NoBorder | WStyle_Tool )
{
setMargin( 2 );
setIndent( 0 );
- setFrameStyle( QFrame::Plain | QFrame::Box );
+ setFrameStyle( TQFrame::Plain | TQFrame::Box );
- setPalette( QToolTip::palette() );
+ setPalette( TQToolTip::palette() );
}
-void SizeTip::setTip( const QRect &rect )
+void SizeTip::setTip( const TQRect &rect )
{
- QString tip = QString( "%1x%2" ).arg( rect.width() )
- .arg( rect.height() );
+ TQString tip = TQString( "%1x%2" ).tqarg( rect.width() )
+ .tqarg( rect.height() );
setText( tip );
adjustSize();
@@ -52,33 +52,33 @@ void SizeTip::setTip( const QRect &rect )
positionTip( rect );
}
-void SizeTip::positionTip( const QRect &rect )
+void SizeTip::positionTip( const TQRect &rect )
{
- QRect tipRect = geometry();
- tipRect.moveTopLeft( QPoint( 0, 0 ) );
+ TQRect tipRect = tqgeometry();
+ tipRect.moveTopLeft( TQPoint( 0, 0 ) );
if ( rect.intersects( tipRect ) )
{
- QRect deskR = KGlobalSettings::desktopGeometry( QPoint( 0, 0 ) );
+ TQRect deskR = KGlobalSettings::desktopGeometry( TQPoint( 0, 0 ) );
- tipRect.moveCenter( QPoint( deskR.width()/2, deskR.height()/2 ) );
- if ( !rect.contains( tipRect, true ) && rect.intersects( tipRect ) )
- tipRect.moveBottomRight( geometry().bottomRight() );
+ tipRect.moveCenter( TQPoint( deskR.width()/2, deskR.height()/2 ) );
+ if ( !rect.tqcontains( tipRect, true ) && rect.intersects( tipRect ) )
+ tipRect.moveBottomRight( tqgeometry().bottomRight() );
}
move( tipRect.topLeft() );
}
RegionGrabber::RegionGrabber(int delay)
- : QWidget( 0, 0 ),
+ : TQWidget( 0, 0 ),
mouseDown( false ), sizeTip( 0L )
{
- sizeTip = new SizeTip( ( QWidget * )0L );
+ sizeTip = new SizeTip( ( TQWidget * )0L );
- tipTimer = new QTimer( this );
- connect( tipTimer, SIGNAL( timeout() ), SLOT( updateSizeTip() ) );
+ tipTimer = new TQTimer( this );
+ connect( tipTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( updateSizeTip() ) );
- QTimer::singleShot( delay, this, SLOT( initGrabber() ) );
+ TQTimer::singleShot( delay, this, TQT_SLOT( initGrabber() ) );
}
RegionGrabber::~RegionGrabber()
@@ -88,33 +88,33 @@ RegionGrabber::~RegionGrabber()
void RegionGrabber::initGrabber()
{
- pixmap = QPixmap::grabWindow( qt_xrootwin() );
+ pixmap = TQPixmap::grabWindow( qt_xrootwin() );
setPaletteBackgroundPixmap( pixmap );
- QDesktopWidget desktopWidget;
- QRect desktopSize;
+ TQDesktopWidget desktopWidget;
+ TQRect desktopSize;
if ( desktopWidget.isVirtualDesktop() )
- desktopSize = desktopWidget.geometry();
+ desktopSize = desktopWidget.tqgeometry();
else
desktopSize = desktopWidget.screenGeometry( qt_xrootwin() );
setGeometry( desktopSize );
showFullScreen();
- QApplication::setOverrideCursor( crossCursor );
+ TQApplication::setOverrideCursor( crossCursor );
}
-void RegionGrabber::mousePressEvent( QMouseEvent *e )
+void RegionGrabber::mousePressEvent( TQMouseEvent *e )
{
- if ( e->button() == LeftButton )
+ if ( e->button() == Qt::LeftButton )
{
mouseDown = true;
- grabRect = QRect( e->pos(), e->pos() );
+ grabRect = TQRect( e->pos(), e->pos() );
drawRubber();
}
}
-void RegionGrabber::mouseMoveEvent( QMouseEvent *e )
+void RegionGrabber::mouseMoveEvent( TQMouseEvent *e )
{
if ( mouseDown )
{
@@ -127,7 +127,7 @@ void RegionGrabber::mouseMoveEvent( QMouseEvent *e )
}
}
-void RegionGrabber::mouseReleaseEvent( QMouseEvent *e )
+void RegionGrabber::mouseReleaseEvent( TQMouseEvent *e )
{
mouseDown = false;
drawRubber();
@@ -136,20 +136,20 @@ void RegionGrabber::mouseReleaseEvent( QMouseEvent *e )
grabRect.setBottomRight( e->pos() );
grabRect = grabRect.normalize();
- QPixmap region = QPixmap::grabWindow( winId(), grabRect.x(), grabRect.y(),
+ TQPixmap region = TQPixmap::grabWindow( winId(), grabRect.x(), grabRect.y(),
grabRect.width(), grabRect.height() );
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
emit regionGrabbed( region );
}
-void RegionGrabber::keyPressEvent( QKeyEvent *e )
+void RegionGrabber::keyPressEvent( TQKeyEvent *e )
{
if ( e->key() == Key_Escape )
{
- QApplication::restoreOverrideCursor();
- emit regionGrabbed( QPixmap() );
+ TQApplication::restoreOverrideCursor();
+ emit regionGrabbed( TQPixmap() );
}
else
e->ignore();
@@ -157,7 +157,7 @@ void RegionGrabber::keyPressEvent( QKeyEvent *e )
void RegionGrabber::updateSizeTip()
{
- QRect rect = grabRect.normalize();
+ TQRect rect = grabRect.normalize();
sizeTip->setTip( rect );
sizeTip->show();
@@ -165,14 +165,14 @@ void RegionGrabber::updateSizeTip()
void RegionGrabber::drawRubber()
{
- QPainter p;
+ TQPainter p;
p.begin( this );
p.setRasterOp( NotROP );
- p.setPen( QPen( color0, 1 ) );
+ p.setPen( TQPen( color0, 1 ) );
p.setBrush( NoBrush );
- style().drawPrimitive( QStyle::PE_FocusRect, &p, grabRect, colorGroup(),
- QStyle::Style_Default, QStyleOption( colorGroup().base() ) );
+ tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p, grabRect, tqcolorGroup(),
+ TQStyle::Style_Default, TQStyleOption( tqcolorGroup().base() ) );
p.end();
}
diff --git a/src/regiongrabber.h b/src/regiongrabber.h
index 528c4ff..4493011 100644
--- a/src/regiongrabber.h
+++ b/src/regiongrabber.h
@@ -22,24 +22,25 @@
#ifndef REGIONGRABBER_H
#define REGIONGRABBER_H
-#include <qlabel.h>
-#include <qpixmap.h>
+#include <tqlabel.h>
+#include <tqpixmap.h>
-class QTimer;
+class TQTimer;
-class SizeTip : public QLabel
+class SizeTip : public TQLabel
{
public:
- SizeTip( QWidget *parent, const char *name=0 );
+ SizeTip( TQWidget *tqparent, const char *name=0 );
~SizeTip() {}
- void setTip( const QRect &rect );
- void positionTip( const QRect &rect );
+ void setTip( const TQRect &rect );
+ void positionTip( const TQRect &rect );
};
-class RegionGrabber : public QWidget
+class RegionGrabber : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
RegionGrabber(int delay);
@@ -50,22 +51,22 @@ class RegionGrabber : public QWidget
void updateSizeTip();
signals:
- void regionGrabbed( const QPixmap & );
+ void regionGrabbed( const TQPixmap & );
protected:
- void mousePressEvent( QMouseEvent *e );
- void mouseReleaseEvent( QMouseEvent *e );
- void mouseMoveEvent( QMouseEvent *e );
- void keyPressEvent( QKeyEvent *e );
+ void mousePressEvent( TQMouseEvent *e );
+ void mouseReleaseEvent( TQMouseEvent *e );
+ void mouseMoveEvent( TQMouseEvent *e );
+ void keyPressEvent( TQKeyEvent *e );
void drawRubber();
bool mouseDown;
- QRect grabRect;
- QPixmap pixmap;
+ TQRect grabRect;
+ TQPixmap pixmap;
SizeTip *sizeTip;
- QTimer *tipTimer;
+ TQTimer *tipTimer;
};
#endif // REGIONGRABBER_H
diff --git a/src/settings.cpp b/src/settings.cpp
index 218dd0a..e9c1f0a 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -19,31 +19,31 @@
***************************************************************************/
#include <config.h>
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qtabwidget.h>
-#include <qgroupbox.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqtabwidget.h>
+#include <tqgroupbox.h>
+#include <tqlabel.h>
+#include <tqpushbutton.h>
#include <knuminput.h>
#include <kcolorcombo.h>
#include <kiconloader.h>
#include <kconfig.h>
#include <kglobal.h>
#include <klocale.h>
-#include <qwhatsthis.h>
-#include <qbuttongroup.h>
-#include <qradiobutton.h>
-#include <qvbuttongroup.h>
+#include <tqwhatsthis.h>
+#include <tqbuttongroup.h>
+#include <tqradiobutton.h>
+#include <tqvbuttongroup.h>
#include <kapplication.h>
#include <kaboutdata.h>
#include <kmimetype.h>
#include <kstandarddirs.h>
#include <kgpgme.h>
#include <kdebug.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include "basket.h"
#include "linklabel.h"
@@ -79,10 +79,10 @@ bool Settings::s_htmlUseProg = false; // TODO: RENAME: s_*App (with
bool Settings::s_imageUseProg = true;
bool Settings::s_animationUseProg = true;
bool Settings::s_soundUseProg = false;
-QString Settings::s_htmlProg = "quanta";
-QString Settings::s_imageProg = "kolourpaint";
-QString Settings::s_animationProg = "gimp";
-QString Settings::s_soundProg = "";
+TQString Settings::s_htmlProg = "quanta";
+TQString Settings::s_imageProg = "kolourpaint";
+TQString Settings::s_animationProg = "gimp";
+TQString Settings::s_soundProg = "";
// Addictive Features:
bool Settings::s_groupOnInsertionLine = false;
int Settings::s_middleAction = 0;
@@ -97,10 +97,10 @@ bool Settings::s_blinkedFilter = false;
bool Settings::s_startDocked = false;
int Settings::s_basketTreeWidth = -1;
bool Settings::s_welcomeBasketsAdded = false;
-QString Settings::s_dataFolder = "";
-QDate Settings::s_lastBackup = QDate();
-QPoint Settings::s_mainWindowPosition = QPoint();
-QSize Settings::s_mainWindowSize = QSize();
+TQString Settings::s_dataFolder = "";
+TQDate Settings::s_lastBackup = TQDate();
+TQPoint Settings::s_mainWindowPosition = TQPoint();
+TQSize Settings::s_mainWindowSize = TQSize();
bool Settings::s_showEmptyBasketInfo = true;
bool Settings::s_spellCheckTextNotes = true;
@@ -111,11 +111,11 @@ void Settings::loadConfig()
LinkLook defaultLocalLinkLook;
LinkLook defaultNetworkLinkLook;
LinkLook defaultLauncherLook; /* italic bold underlining color hoverColor iconSize preview */
- defaultSoundLook.setLook( false, false, LinkLook::Never, QColor(), QColor(), 32, LinkLook::None );
- defaultFileLook.setLook( false, false, LinkLook::Never, QColor(), QColor(), 32, LinkLook::TwiceIconSize );
- defaultLocalLinkLook.setLook( true, false, LinkLook::OnMouseHover, QColor(), QColor(), 22, LinkLook::TwiceIconSize );
- defaultNetworkLinkLook.setLook( false, false, LinkLook::OnMouseOutside, QColor(), QColor(), 16, LinkLook::None );
- defaultLauncherLook.setLook( false, true, LinkLook::Never, QColor(), QColor(), 48, LinkLook::None );
+ defaultSoundLook.setLook( false, false, LinkLook::Never, TQColor(), TQColor(), 32, LinkLook::None );
+ defaultFileLook.setLook( false, false, LinkLook::Never, TQColor(), TQColor(), 32, LinkLook::TwiceIconSize );
+ defaultLocalLinkLook.setLook( true, false, LinkLook::OnMouseHover, TQColor(), TQColor(), 22, LinkLook::TwiceIconSize );
+ defaultNetworkLinkLook.setLook( false, false, LinkLook::OnMouseOutside, TQColor(), TQColor(), 16, LinkLook::None );
+ defaultLauncherLook.setLook( false, true, LinkLook::Never, TQColor(), TQColor(), 48, LinkLook::None );
loadLinkLook(LinkLook::soundLook, "Sound Look", defaultSoundLook );
loadLinkLook(LinkLook::fileLook, "File Look", defaultFileLook );
@@ -151,7 +151,7 @@ void Settings::loadConfig()
setUsePassivePopup( config->readBoolEntry("usePassivePopup", true) );
setWelcomeBasketsAdded( config->readBoolEntry("welcomeBasketsAdded", false) );
setDataFolder( config->readPathEntry("dataFolder", "") );
- setLastBackup( config->readDateTimeEntry("lastBackup", new QDateTime()).date());
+ setLastBackup( config->readDateTimeEntry("lastBackup", new TQDateTime()).date());
setMainWindowPosition( config->readPointEntry("position" ) );
setMainWindowSize( config->readSizeEntry( "size" ) );
@@ -238,7 +238,7 @@ void Settings::saveConfig()
config->writeEntry( "usePassivePopup", usePassivePopup() );
config->writeEntry( "welcomeBasketsAdded", welcomeBasketsAdded() );
config->writePathEntry("dataFolder", dataFolder() );
- config->writeEntry( "lastBackup", QDateTime(lastBackup()));
+ config->writeEntry( "lastBackup", TQDateTime(lastBackup()));
config->writeEntry( "position", mainWindowPosition() );
config->writeEntry( "size", mainWindowSize() );
@@ -270,24 +270,24 @@ void Settings::saveConfig()
config->sync();
}
-void Settings::loadLinkLook(LinkLook *look, const QString &name, const LinkLook &defaultLook)
+void Settings::loadLinkLook(LinkLook *look, const TQString &name, const LinkLook &defaultLook)
{
KConfig* config = Global::config();
config->setGroup(name);
- QString underliningStrings[] = { "Always", "Never", "OnMouseHover", "OnMouseOutside" };
- QString defaultUnderliningString = underliningStrings[defaultLook.underlining()];
+ TQString underliningStrings[] = { "Always", "Never", "OnMouseHover", "OnMouseOutside" };
+ TQString defaultUnderliningString = underliningStrings[defaultLook.underlining()];
- QString previewStrings[] = { "None", "IconSize", "TwiceIconSize", "ThreeIconSize" };
- QString defaultPreviewString = previewStrings[defaultLook.preview()];
+ TQString previewStrings[] = { "None", "IconSize", "TwiceIconSize", "ThreeIconSize" };
+ TQString defaultPreviewString = previewStrings[defaultLook.preview()];
bool italic = config->readBoolEntry( "italic", defaultLook.italic() );
bool bold = config->readBoolEntry( "bold", defaultLook.bold() );
- QString underliningString = config->readEntry( "underlining", defaultUnderliningString );
- QColor color = config->readPropertyEntry( "color", defaultLook.color() ).asColor();
- QColor hoverColor = config->readPropertyEntry( "hoverColor", defaultLook.hoverColor() ).asColor();
+ TQString underliningString = config->readEntry( "underlining", defaultUnderliningString );
+ TQColor color = config->readPropertyEntry( "color", defaultLook.color() ).asColor();
+ TQColor hoverColor = config->readPropertyEntry( "hoverColor", defaultLook.hoverColor() ).asColor();
int iconSize = config->readNumEntry( "iconSize", defaultLook.iconSize() );
- QString previewString = config->readEntry( "preview", defaultPreviewString );
+ TQString previewString = config->readEntry( "preview", defaultPreviewString );
int underlining = 0;
if (underliningString == underliningStrings[1]) underlining = 1;
@@ -302,16 +302,16 @@ void Settings::loadLinkLook(LinkLook *look, const QString &name, const LinkLook
look->setLook(italic, bold, underlining, color, hoverColor, iconSize, preview);
}
-void Settings::saveLinkLook(LinkLook *look, const QString &name)
+void Settings::saveLinkLook(LinkLook *look, const TQString &name)
{
KConfig* config = Global::config();
config->setGroup(name);
- QString underliningStrings[] = { "Always", "Never", "OnMouseHover", "OnMouseOutside" };
- QString underliningString = underliningStrings[look->underlining()];
+ TQString underliningStrings[] = { "Always", "Never", "OnMouseHover", "OnMouseOutside" };
+ TQString underliningString = underliningStrings[look->underlining()];
- QString previewStrings[] = { "None", "IconSize", "TwiceIconSize", "ThreeIconSize" };
- QString previewString = previewStrings[look->preview()];
+ TQString previewStrings[] = { "None", "IconSize", "TwiceIconSize", "ThreeIconSize" };
+ TQString previewString = previewStrings[look->preview()];
config->writeEntry( "italic", look->italic() );
config->writeEntry( "bold", look->bold() );
@@ -341,7 +341,7 @@ void Settings::setBigNotes(bool big)
Note::MIN_HEIGHT = 2*Note::NOTE_MARGIN + Note::EMBLEM_SIZE;
if (Global::bnpView)
- Global::bnpView->relayoutAllBaskets();
+ Global::bnpView->retqlayoutAllBaskets();
}
void Settings::setAutoBullet(bool yes)
@@ -354,39 +354,39 @@ void Settings::setAutoBullet(bool yes)
/** GeneralPage */
-GeneralPage::GeneralPage(QWidget * parent, const char * name)
- : KCModule(parent, name)
+GeneralPage::GeneralPage(TQWidget * tqparent, const char * name)
+ : KCModule(tqparent, name)
{
- QVBoxLayout *layout = new QVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- QHBoxLayout *hLay;
- QLabel *label;
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLay;
+ TQLabel *label;
HelpLabel *hLabel;
- QGridLayout *gl = new QGridLayout(layout, /*nRows=*/3, /*nCols=*/3);
- gl->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 2);
+ TQGridLayout *gl = new TQGridLayout(tqlayout, /*nRows=*/3, /*nCols=*/3);
+ gl->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding), 0, 2);
// Basket Tree Position:
- m_treeOnLeft = new QComboBox(this);
+ m_treeOnLeft = new TQComboBox(this);
m_treeOnLeft->insertItem(i18n("On left"));
m_treeOnLeft->insertItem(i18n("On right"));
- label = new QLabel(m_treeOnLeft, i18n("&Basket tree position:"), this);
+ label = new TQLabel(m_treeOnLeft, i18n("&Basket tree position:"), this);
gl->addWidget(label, 0, 0);
gl->addWidget(m_treeOnLeft, 0, 1);
- connect( m_treeOnLeft, SIGNAL(activated(int)), this, SLOT(changed()) );
+ connect( m_treeOnLeft, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()) );
// Filter Bar Position:
- m_filterOnTop = new QComboBox(this);
+ m_filterOnTop = new TQComboBox(this);
m_filterOnTop->insertItem(i18n("On top"));
m_filterOnTop->insertItem(i18n("On bottom"));
- label = new QLabel(m_filterOnTop, i18n("&Filter bar position:"), this);
+ label = new TQLabel(m_filterOnTop, i18n("&Filter bar position:"), this);
gl->addWidget(label, 1, 0);
gl->addWidget(m_filterOnTop, 1, 1);
- connect( m_filterOnTop, SIGNAL(activated(int)), this, SLOT(changed()) );
+ connect( m_filterOnTop, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()) );
// Use Baloons to Report Results of Global Actions:
- hLay = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
- m_usePassivePopup = new QCheckBox(i18n("&Use balloons to report results of global actions"), this);
- connect( m_usePassivePopup, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ hLay = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ m_usePassivePopup = new TQCheckBox(i18n("&Use balloons to report results of global actions"), this);
+ connect( m_usePassivePopup, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
hLabel = new HelpLabel(
i18n("What are global actions?"),
("<p>" + i18n("You can configure global shortcuts to do some actions without having to show the main window. For instance, you can paste the clipboard content, take a color from "
@@ -394,63 +394,63 @@ GeneralPage::GeneralPage(QWidget * parent, const char * name)
"on that icon to paste the current selection.") + "</p>" +
"<p>" + i18n("When doing so, %1 pops up a little balloon message to inform you the action has been successfully done. You can disable that balloon.") + "</p>" +
"<p>" + i18n("Note that those messages are smart enough to not appear if the main window is visible. This is because you already see the result of your actions in the main window.") + "</p>")
- .arg(kapp->aboutData()->programName()),
+ .tqarg(kapp->aboutData()->programName()),
this);
hLay->addWidget(m_usePassivePopup);
hLay->addWidget(hLabel);
hLay->addStretch();
- layout->addLayout(hLay);
+ tqlayout->addLayout(hLay);
// System Tray Icon:
- QGroupBox *gbSys = new QGroupBox(3, Qt::Vertical, i18n("System Tray Icon"), this);
- layout->addWidget(gbSys);
- QVBoxLayout *sysLay = new QVBoxLayout(gbSys, /*margin=*/0, KDialogBase::spacingHint());
+ TQGroupBox *gbSys = new TQGroupBox(3, Qt::Vertical, i18n("System Tray Icon"), this);
+ tqlayout->addWidget(gbSys);
+ TQVBoxLayout *sysLay = new TQVBoxLayout(gbSys, /*margin=*/0, KDialogBase::spacingHint());
// Dock in System Tray:
- m_useSystray = new QCheckBox(i18n("&Dock in system tray"), gbSys);
+ m_useSystray = new TQCheckBox(i18n("&Dock in system tray"), gbSys);
sysLay->addWidget(m_useSystray);
- connect( m_useSystray, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ connect( m_useSystray, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- m_systray = new QWidget(gbSys);
- QVBoxLayout *subSysLay = new QVBoxLayout(m_systray, /*margin=*/0, KDialogBase::spacingHint());
+ m_systray = new TQWidget(gbSys);
+ TQVBoxLayout *subSysLay = new TQVBoxLayout(m_systray, /*margin=*/0, KDialogBase::spacingHint());
sysLay->addWidget(m_systray);
// Show Current Basket Icon in System Tray Icon:
- m_showIconInSystray = new QCheckBox(i18n("&Show current basket icon in system tray icon"), m_systray);
+ m_showIconInSystray = new TQCheckBox(i18n("&Show current basket icon in system tray icon"), m_systray);
subSysLay->addWidget(m_showIconInSystray);
- connect(m_showIconInSystray, SIGNAL(stateChanged(int)), this, SLOT(changed()));
+ connect(m_showIconInSystray, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
- QGridLayout *gs = new QGridLayout(0, /*nRows=*/2, /*nCols=*/3);
+ TQGridLayout *gs = new TQGridLayout(0, /*nRows=*/2, /*nCols=*/3);
subSysLay->addLayout(gs);
- gs->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 2);
+ gs->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding), 0, 2);
// Hide Main Window when Mouse Goes out of it for Some Time:
m_timeToHideOnMouseOut = new KIntNumInput(0, m_systray);
- m_hideOnMouseOut = new QCheckBox(i18n("&Hide main window when mouse leaves it for"), m_systray);
+ m_hideOnMouseOut = new TQCheckBox(i18n("&Hide main window when mouse leaves it for"), m_systray);
m_timeToHideOnMouseOut->setRange(0, 600, 1, false);
m_timeToHideOnMouseOut->setSuffix(i18n(" tenths of seconds"));
gs->addWidget(m_hideOnMouseOut, 0, 0);
gs->addWidget(m_timeToHideOnMouseOut, 0, 1);
- connect(m_hideOnMouseOut, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_timeToHideOnMouseOut, SIGNAL(valueChanged (int)), this, SLOT(changed()));
+ connect(m_hideOnMouseOut, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_timeToHideOnMouseOut, TQT_SIGNAL(valueChanged (int)), this, TQT_SLOT(changed()));
// subSysLay->addWidget(
// Show Main Window when Mouse Hovers over the System Tray Icon for Some Time:
m_timeToShowOnMouseIn = new KIntNumInput(0, m_systray);
- m_showOnMouseIn = new QCheckBox(i18n("Show &main window when mouse hovers over the system tray icon for"), m_systray);
+ m_showOnMouseIn = new TQCheckBox(i18n("Show &main window when mouse hovers over the system tray icon for"), m_systray);
m_timeToShowOnMouseIn->setRange(0, 600, 1, false);
m_timeToShowOnMouseIn->setSuffix(i18n(" tenths of seconds"));
gs->addWidget(m_showOnMouseIn, 1, 0);
gs->addWidget(m_timeToShowOnMouseIn, 1, 1);
- connect(m_showOnMouseIn, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_timeToShowOnMouseIn, SIGNAL(valueChanged (int)), this, SLOT(changed()));
+ connect(m_showOnMouseIn, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_timeToShowOnMouseIn, TQT_SIGNAL(valueChanged (int)), this, TQT_SLOT(changed()));
- connect( m_hideOnMouseOut, SIGNAL(toggled(bool)), m_timeToHideOnMouseOut, SLOT(setEnabled(bool)) );
- connect( m_showOnMouseIn, SIGNAL(toggled(bool)), m_timeToShowOnMouseIn, SLOT(setEnabled(bool)) );
+ connect( m_hideOnMouseOut, TQT_SIGNAL(toggled(bool)), m_timeToHideOnMouseOut, TQT_SLOT(setEnabled(bool)) );
+ connect( m_showOnMouseIn, TQT_SIGNAL(toggled(bool)), m_timeToShowOnMouseIn, TQT_SLOT(setEnabled(bool)) );
- connect( m_useSystray, SIGNAL(toggled(bool)), m_systray, SLOT(setEnabled(bool)) );
+ connect( m_useSystray, TQT_SIGNAL(toggled(bool)), m_systray, TQT_SLOT(setEnabled(bool)) );
- layout->insertStretch(-1);
+ tqlayout->insertStretch(-1);
load();
}
@@ -499,45 +499,45 @@ void GeneralPage::defaults()
/** BasketsPage */
-BasketsPage::BasketsPage(QWidget * parent, const char * name)
- : KCModule(parent, name)
+BasketsPage::BasketsPage(TQWidget * tqparent, const char * name)
+ : KCModule(tqparent, name)
{
- QVBoxLayout *layout = new QVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- QHBoxLayout *hLay;
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLay;
HelpLabel *hLabel;
// Appearance:
- QGroupBox *appearanceBox = new QGroupBox(3, Qt::Vertical, i18n("Appearance"), this);
- layout->addWidget(appearanceBox);
+ TQGroupBox *appearanceBox = new TQGroupBox(3, Qt::Vertical, i18n("Appearance"), this);
+ tqlayout->addWidget(appearanceBox);
- m_playAnimations = new QCheckBox(i18n("Ani&mate changes in baskets"), appearanceBox);
- connect( m_playAnimations, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ m_playAnimations = new TQCheckBox(i18n("Ani&mate changes in baskets"), appearanceBox);
+ connect( m_playAnimations, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- m_showNotesToolTip = new QCheckBox(i18n("&Show tooltips in baskets"), appearanceBox);
- connect( m_showNotesToolTip, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ m_showNotesToolTip = new TQCheckBox(i18n("&Show tooltips in baskets"), appearanceBox);
+ connect( m_showNotesToolTip, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- m_bigNotes = new QCheckBox(i18n("&Big notes"), appearanceBox);
- connect( m_bigNotes, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ m_bigNotes = new TQCheckBox(i18n("&Big notes"), appearanceBox);
+ connect( m_bigNotes, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
// Behavior:
- QGroupBox *behaviorBox = new QGroupBox(5, Qt::Vertical, i18n("Behavior"), this);
- layout->addWidget(behaviorBox);
+ TQGroupBox *behaviorBox = new TQGroupBox(5, Qt::Vertical, i18n("Behavior"), this);
+ tqlayout->addWidget(behaviorBox);
- m_autoBullet = new QCheckBox(i18n("&Transform lines starting with * or - to lists in text editors"), behaviorBox);
- connect( m_autoBullet, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ m_autoBullet = new TQCheckBox(i18n("&Transform lines starting with * or - to lists in text editors"), behaviorBox);
+ connect( m_autoBullet, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- m_confirmNoteDeletion = new QCheckBox(i18n("Ask confirmation before &deleting notes"), behaviorBox);
- connect( m_confirmNoteDeletion, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ m_confirmNoteDeletion = new TQCheckBox(i18n("Ask confirmation before &deleting notes"), behaviorBox);
+ connect( m_confirmNoteDeletion, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- QWidget *widget = new QWidget(behaviorBox);
- hLay = new QHBoxLayout(widget, /*margin=*/0, KDialogBase::spacingHint());
- m_exportTextTags = new QCheckBox(i18n("&Export tags in texts"), widget);
- connect( m_exportTextTags, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ TQWidget *widget = new TQWidget(behaviorBox);
+ hLay = new TQHBoxLayout(widget, /*margin=*/0, KDialogBase::spacingHint());
+ m_exportTextTags = new TQCheckBox(i18n("&Export tags in texts"), widget);
+ connect( m_exportTextTags, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
- QPixmap pixmapHelp(KGlobal::dirs()->findResource("data", "basket/images/tag_export_help.png"));
- QMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export.png", pixmapHelp);
+ TQPixmap pixmapHelp(KGlobal::dirs()->findResource("data", "basket/images/tag_export_help.png"));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export.png", pixmapHelp);
hLabel = new HelpLabel(
i18n("When does this apply?"),
"<p>" + i18n("It does apply when you copy and paste, or drag and drop notes to a text editor.") + "</p>" +
@@ -550,11 +550,11 @@ BasketsPage::BasketsPage(QWidget * parent, const char * name)
hLay->addWidget(hLabel);
hLay->addStretch();
- m_groupOnInsertionLineWidget = new QWidget(behaviorBox);
- QHBoxLayout *hLayV = new QHBoxLayout(m_groupOnInsertionLineWidget, /*margin=*/0, KDialogBase::spacingHint());
- m_groupOnInsertionLine = new QCheckBox(i18n("&Group a new note when clicking on the right of the insertion line"), m_groupOnInsertionLineWidget);
- QPixmap pixmap(KGlobal::dirs()->findResource("data", "basket/images/insertion_help.png"));
- QMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_insertion_line.png", pixmap);
+ m_groupOnInsertionLineWidget = new TQWidget(behaviorBox);
+ TQHBoxLayout *hLayV = new TQHBoxLayout(m_groupOnInsertionLineWidget, /*margin=*/0, KDialogBase::spacingHint());
+ m_groupOnInsertionLine = new TQCheckBox(i18n("&Group a new note when clicking on the right of the insertion line"), m_groupOnInsertionLineWidget);
+ TQPixmap pixmap(KGlobal::dirs()->findResource("data", "basket/images/insertion_help.png"));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_insertion_line.png", pixmap);
HelpLabel *helpV = new HelpLabel(
i18n("How to group a new note?"),
i18n("<p>When this option is enabled, the insertion-line not only allows you to insert notes at the cursor position, but also allows you to group a new note with the one under the cursor:</p>") +
@@ -566,14 +566,14 @@ BasketsPage::BasketsPage(QWidget * parent, const char * name)
hLayV->addWidget(m_groupOnInsertionLine);
hLayV->addWidget(helpV);
hLayV->insertStretch(-1);
- layout->addWidget(m_groupOnInsertionLineWidget);
- connect(m_groupOnInsertionLine, SIGNAL(stateChanged(int)), this, SLOT(changed()));
+ tqlayout->addWidget(m_groupOnInsertionLineWidget);
+ connect(m_groupOnInsertionLine, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
- widget = new QWidget(behaviorBox);
- QGridLayout *ga = new QGridLayout(widget, /*nRows=*/3, /*nCols=*/4, /*margin=*/0, KDialogBase::spacingHint());
- ga->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), 0, 3);
+ widget = new TQWidget(behaviorBox);
+ TQGridLayout *ga = new TQGridLayout(widget, /*nRows=*/3, /*nCols=*/4, /*margin=*/0, KDialogBase::spacingHint());
+ ga->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding), 0, 3);
- m_middleAction = new QComboBox(widget);
+ m_middleAction = new TQComboBox(widget);
m_middleAction->insertItem( i18n("Do nothing") );
m_middleAction->insertItem( i18n("Paste clipboard") );
m_middleAction->insertItem( i18n("Insert image note") );
@@ -585,41 +585,41 @@ BasketsPage::BasketsPage(QWidget * parent, const char * name)
m_middleAction->insertItem( i18n("Load note from file") );
m_middleAction->insertItem( i18n("Import Launcher from KDE Menu") );
m_middleAction->insertItem( i18n("Import icon") );
- QLabel *labelM = new QLabel(m_middleAction, i18n("&Shift+middle-click anywhere:"), widget);
+ TQLabel *labelM = new TQLabel(m_middleAction, i18n("&Shift+middle-click anywhere:"), widget);
ga->addWidget(labelM, 0, 0);
ga->addWidget(m_middleAction, 0, 1);
- ga->addWidget(new QLabel(i18n("at cursor position"), widget), 0, 2);
- connect( m_middleAction, SIGNAL(activated(int)), this, SLOT(changed()) );
+ ga->addWidget(new TQLabel(i18n("at cursor position"), widget), 0, 2);
+ connect( m_middleAction, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()) );
// Protection:
- QGroupBox *protectionBox = new QGroupBox(3, Qt::Vertical, i18n("Password Protection"), this);
- layout->addWidget(protectionBox);
- widget = new QWidget(protectionBox);
+ TQGroupBox *protectionBox = new TQGroupBox(3, Qt::Vertical, i18n("Password Protection"), this);
+ tqlayout->addWidget(protectionBox);
+ widget = new TQWidget(protectionBox);
// Re-Lock timeout configuration
- hLay = new QHBoxLayout(widget, /*margin=*/0, KDialogBase::spacingHint());
- m_enableReLockTimeoutMinutes = new QCheckBox(i18n("A&utomatically lock protected baskets when closed for"), widget);
+ hLay = new TQHBoxLayout(widget, /*margin=*/0, KDialogBase::spacingHint());
+ m_enableReLockTimeoutMinutes = new TQCheckBox(i18n("A&utomatically lock protected baskets when closed for"), widget);
hLay->addWidget(m_enableReLockTimeoutMinutes);
m_reLockTimeoutMinutes = new KIntNumInput(widget);
m_reLockTimeoutMinutes->setMinValue(0);
m_reLockTimeoutMinutes->setSuffix(i18n(" minutes"));
hLay->addWidget(m_reLockTimeoutMinutes);
- //label = new QLabel(i18n("minutes"), this);
+ //label = new TQLabel(i18n("minutes"), this);
//hLay->addWidget(label);
hLay->addStretch();
-// layout->addLayout(hLay);
- connect( m_enableReLockTimeoutMinutes, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
- connect( m_reLockTimeoutMinutes, SIGNAL(valueChanged(int)), this, SLOT(changed()) );
- connect( m_enableReLockTimeoutMinutes, SIGNAL(toggled(bool)), m_reLockTimeoutMinutes, SLOT(setEnabled(bool)) );
+// tqlayout->addLayout(hLay);
+ connect( m_enableReLockTimeoutMinutes, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
+ connect( m_reLockTimeoutMinutes, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()) );
+ connect( m_enableReLockTimeoutMinutes, TQT_SIGNAL(toggled(bool)), m_reLockTimeoutMinutes, TQT_SLOT(setEnabled(bool)) );
#ifdef HAVE_LIBGPGME
- m_useGnuPGAgent = new QCheckBox(i18n("Use GnuPG agent for &private/public key protected baskets"), protectionBox);
+ m_useGnuPGAgent = new TQCheckBox(i18n("Use GnuPG agent for &private/public key protected baskets"), protectionBox);
// hLay->addWidget(m_useGnuPGAgent);
- connect( m_useGnuPGAgent, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
+ connect( m_useGnuPGAgent, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
#endif
- layout->insertStretch(-1);
+ tqlayout->insertStretch(-1);
load();
}
@@ -679,70 +679,70 @@ void BasketsPage::defaults()
/** class NewNotesPage: */
-NewNotesPage::NewNotesPage(QWidget * parent, const char * name)
- : KCModule(parent, name)
+NewNotesPage::NewNotesPage(TQWidget * tqparent, const char * name)
+ : KCModule(tqparent, name)
{
- QVBoxLayout *layout = new QVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- QHBoxLayout *hLay;
- QLabel *label;
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLay;
+ TQLabel *label;
// Place of New Notes:
- hLay = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
- m_newNotesPlace = new QComboBox(this);
- label = new QLabel(m_newNotesPlace, i18n("&Place of new notes:"), this);
+ hLay = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ m_newNotesPlace = new TQComboBox(this);
+ label = new TQLabel(m_newNotesPlace, i18n("&Place of new notes:"), this);
m_newNotesPlace->insertItem(i18n("On top"));
m_newNotesPlace->insertItem(i18n("On bottom"));
m_newNotesPlace->insertItem(i18n("At current note"));
hLay->addWidget(label);
hLay->addWidget(m_newNotesPlace);
hLay->addStretch();
- //layout->addLayout(hLay);
+ //tqlayout->addLayout(hLay);
label->hide();
m_newNotesPlace->hide();
- connect( m_newNotesPlace, SIGNAL(textChanged(const QString &)), this, SLOT(changed()) );
+ connect( m_newNotesPlace, TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changed()) );
// New Images Size:
- hLay = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ hLay = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
m_imgSizeX = new KIntNumInput(this);
m_imgSizeX->setMinValue(1);
m_imgSizeX->setMaxValue(4096);
m_imgSizeX->setReferencePoint(100);
- connect( m_imgSizeX, SIGNAL(valueChanged(int)), this, SLOT(changed()) );
- label = new QLabel(m_imgSizeX, i18n("&New images size:"), this);
+ connect( m_imgSizeX, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()) );
+ label = new TQLabel(m_imgSizeX, i18n("&New images size:"), this);
hLay->addWidget(label);
hLay->addWidget(m_imgSizeX);
m_imgSizeY = new KIntNumInput(this);
m_imgSizeY->setMinValue(1);
m_imgSizeY->setMaxValue(4096);
m_imgSizeY->setReferencePoint(100);
- connect( m_imgSizeY, SIGNAL(valueChanged(int)), this, SLOT(changed()) );
- label = new QLabel(m_imgSizeY, i18n("&by"), this);
+ connect( m_imgSizeY, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()) );
+ label = new TQLabel(m_imgSizeY, i18n("&by"), this);
hLay->addWidget(label);
hLay->addWidget(m_imgSizeY);
- label = new QLabel(i18n("pixels"), this);
+ label = new TQLabel(i18n("pixels"), this);
hLay->addWidget(label);
- m_pushVisualize = new QPushButton(i18n("&Visualize..."), this);
+ m_pushVisualize = new TQPushButton(i18n("&Visualize..."), this);
hLay->addWidget(m_pushVisualize);
hLay->addStretch();
- layout->addLayout(hLay);
- connect( m_pushVisualize, SIGNAL(clicked()), this, SLOT(visualize()) );
+ tqlayout->addLayout(hLay);
+ connect( m_pushVisualize, TQT_SIGNAL(clicked()), this, TQT_SLOT(visualize()) );
// View File Content:
- QVButtonGroup *buttonGroup = new QVButtonGroup(i18n("View Content of Added Files for the Following Types"), this);
- m_viewTextFileContent = new QCheckBox( i18n("&Plain text"), buttonGroup );
- m_viewHtmlFileContent = new QCheckBox( i18n("&HTML page"), buttonGroup );
- m_viewImageFileContent = new QCheckBox( i18n("&Image or animation"), buttonGroup );
- m_viewSoundFileContent = new QCheckBox( i18n("&Sound"), buttonGroup );
- layout->addWidget(buttonGroup);
- connect( m_viewTextFileContent, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
- connect( m_viewHtmlFileContent, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
- connect( m_viewImageFileContent, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
- connect( m_viewSoundFileContent, SIGNAL(stateChanged(int)), this, SLOT(changed()) );
-
- layout->insertStretch(-1);
+ TQVButtonGroup *buttonGroup = new TQVButtonGroup(i18n("View Content of Added Files for the Following Types"), this);
+ m_viewTextFileContent = new TQCheckBox( i18n("&Plain text"), buttonGroup );
+ m_viewHtmlFileContent = new TQCheckBox( i18n("&HTML page"), buttonGroup );
+ m_viewImageFileContent = new TQCheckBox( i18n("&Image or animation"), buttonGroup );
+ m_viewSoundFileContent = new TQCheckBox( i18n("&Sound"), buttonGroup );
+ tqlayout->addWidget(buttonGroup);
+ connect( m_viewTextFileContent, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
+ connect( m_viewHtmlFileContent, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
+ connect( m_viewImageFileContent, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
+ connect( m_viewSoundFileContent, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()) );
+
+ tqlayout->insertStretch(-1);
load();
}
@@ -787,18 +787,18 @@ void NewNotesPage::visualize()
/** class NotesAppearancePage: */
-NotesAppearancePage::NotesAppearancePage(QWidget * parent, const char * name)
- : KCModule(parent, name)
+NotesAppearancePage::NotesAppearancePage(TQWidget * tqparent, const char * name)
+ : KCModule(tqparent, name)
{
- QVBoxLayout *layout = new QVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- QTabWidget *tabs = new QTabWidget(this);
- layout->addWidget(tabs);
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ TQTabWidget *tabs = new TQTabWidget(this);
+ tqlayout->addWidget(tabs);
m_soundLook = new LinkLookEditWidget(this, i18n("Conference audio record"), "sound", tabs);
m_fileLook = new LinkLookEditWidget(this, i18n("Annual report"), "document", tabs);
m_localLinkLook = new LinkLookEditWidget(this, i18n("Home folder"), "folder_home", tabs);
m_networkLinkLook = new LinkLookEditWidget(this, "www.kde.org", KMimeType::iconForURL("http://www.kde.org"), tabs);
- m_launcherLook = new LinkLookEditWidget(this, i18n("Launch %1").arg(kapp->aboutData()->programName()), "basket", tabs);
+ m_launcherLook = new LinkLookEditWidget(this, i18n("Launch %1").tqarg(kapp->aboutData()->programName()), "basket", tabs);
tabs->addTab(m_soundLook, i18n("&Sounds") );
tabs->addTab(m_fileLook, i18n("&Files") );
tabs->addTab(m_localLinkLook, i18n("&Local Links") );
@@ -834,74 +834,74 @@ void NotesAppearancePage::defaults()
/** class ApplicationsPage: */
-ApplicationsPage::ApplicationsPage(QWidget * parent, const char * name)
- : KCModule(parent, name)
+ApplicationsPage::ApplicationsPage(TQWidget * tqparent, const char * name)
+ : KCModule(tqparent, name)
{
/* Applications page */
- QVBoxLayout *layout = new QVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ TQVBoxLayout *tqlayout = new TQVBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- m_htmlUseProg = new QCheckBox(i18n("Open &text notes with a custom application:"), this);
+ m_htmlUseProg = new TQCheckBox(i18n("Open &text notes with a custom application:"), this);
m_htmlProg = new RunCommandRequester("", i18n("Open text notes with:"), this);
- QHBoxLayout *hLayH = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLayH = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
hLayH->insertSpacing(-1, 20);
hLayH->addWidget(m_htmlProg);
- connect(m_htmlUseProg, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_htmlProg->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(changed()));
+ connect(m_htmlUseProg, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_htmlProg->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changed()));
- m_imageUseProg = new QCheckBox(i18n("Open &image notes with a custom application:"), this);
+ m_imageUseProg = new TQCheckBox(i18n("Open &image notes with a custom application:"), this);
m_imageProg = new RunCommandRequester("", i18n("Open image notes with:"), this);
- QHBoxLayout *hLayI = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLayI = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
hLayI->insertSpacing(-1, 20);
hLayI->addWidget(m_imageProg);
- connect(m_imageUseProg, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_imageProg->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(changed()));
+ connect(m_imageUseProg, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_imageProg->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changed()));
- m_animationUseProg = new QCheckBox(i18n("Open a&nimation notes with a custom application:"), this);
+ m_animationUseProg = new TQCheckBox(i18n("Open a&nimation notes with a custom application:"), this);
m_animationProg = new RunCommandRequester("", i18n("Open animation notes with:"), this);
- QHBoxLayout *hLayA = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLayA = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
hLayA->insertSpacing(-1, 20);
hLayA->addWidget(m_animationProg);
- connect(m_animationUseProg, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_animationProg->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(changed()));
+ connect(m_animationUseProg, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_animationProg->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changed()));
- m_soundUseProg = new QCheckBox(i18n("Open so&und notes with a custom application:"), this);
+ m_soundUseProg = new TQCheckBox(i18n("Open so&und notes with a custom application:"), this);
m_soundProg = new RunCommandRequester("", i18n("Open sound notes with:"), this);
- QHBoxLayout *hLayS = new QHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
+ TQHBoxLayout *hLayS = new TQHBoxLayout(0L, /*margin=*/0, KDialogBase::spacingHint());
hLayS->insertSpacing(-1, 20);
hLayS->addWidget(m_soundProg);
- connect(m_soundUseProg, SIGNAL(stateChanged(int)), this, SLOT(changed()));
- connect(m_soundProg->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(changed()));
+ connect(m_soundUseProg, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(changed()));
+ connect(m_soundProg->lineEdit(), TQT_SIGNAL(textChanged(const TQString &)), this, TQT_SLOT(changed()));
- QString whatsthis = i18n(
+ TQString whatsthis = i18n(
"<p>If checked, the application defined below will be used when opening that type of note.</p>"
"<p>Otherwise, the application you've configured in Konqueror will be used.</p>");
- QWhatsThis::add(m_htmlUseProg, whatsthis);
- QWhatsThis::add(m_imageUseProg, whatsthis);
- QWhatsThis::add(m_animationUseProg, whatsthis);
- QWhatsThis::add(m_soundUseProg, whatsthis);
+ TQWhatsThis::add(m_htmlUseProg, whatsthis);
+ TQWhatsThis::add(m_imageUseProg, whatsthis);
+ TQWhatsThis::add(m_animationUseProg, whatsthis);
+ TQWhatsThis::add(m_soundUseProg, whatsthis);
whatsthis = i18n(
"<p>Define the application to use for opening that type of note instead of the "
"application configured in Konqueror.</p>");
- QWhatsThis::add(m_htmlProg, whatsthis);
- QWhatsThis::add(m_imageProg, whatsthis);
- QWhatsThis::add(m_animationProg, whatsthis);
- QWhatsThis::add(m_soundProg, whatsthis);
+ TQWhatsThis::add(m_htmlProg, whatsthis);
+ TQWhatsThis::add(m_imageProg, whatsthis);
+ TQWhatsThis::add(m_animationProg, whatsthis);
+ TQWhatsThis::add(m_soundProg, whatsthis);
- layout->addWidget(m_htmlUseProg);
- layout->addItem(hLayH);
- layout->addWidget(m_imageUseProg);
- layout->addItem(hLayI);
- layout->addWidget(m_animationUseProg);
- layout->addItem(hLayA);
- layout->addWidget(m_soundUseProg);
- layout->addItem(hLayS);
+ tqlayout->addWidget(m_htmlUseProg);
+ tqlayout->addItem(hLayH);
+ tqlayout->addWidget(m_imageUseProg);
+ tqlayout->addItem(hLayI);
+ tqlayout->addWidget(m_animationUseProg);
+ tqlayout->addItem(hLayA);
+ tqlayout->addWidget(m_soundUseProg);
+ tqlayout->addItem(hLayS);
- layout->addSpacing(KDialogBase::spacingHint());
+ tqlayout->addSpacing(KDialogBase::spacingHint());
- QHBoxLayout *hLay = new QHBoxLayout(0L, /*margin=*/0, /*spacing=*/0);
+ TQHBoxLayout *hLay = new TQHBoxLayout(0L, /*margin=*/0, /*spacing=*/0);
HelpLabel *hl1 = new HelpLabel(
i18n("How to change the application used to open Web links?"),
i18n("<p>When opening Web links, they are opened in different applications, depending on the content of the link "
@@ -918,9 +918,9 @@ ApplicationsPage::ApplicationsPage(QWidget * parent, const char * name)
this);
hLay->addWidget(hl1);
hLay->addStretch();
- layout->addLayout(hLay);
+ tqlayout->addLayout(hLay);
- hLay = new QHBoxLayout(0L, /*margin=*/0, /*spacing=*/0);
+ hLay = new TQHBoxLayout(0L, /*margin=*/0, /*spacing=*/0);
HelpLabel *hl2 = new HelpLabel(
i18n("How to change the applications used to open files and links?"),
i18n("<p>Here is how to set the application to be used for each type of file. "
@@ -938,14 +938,14 @@ ApplicationsPage::ApplicationsPage(QWidget * parent, const char * name)
this);
hLay->addWidget(hl2);
hLay->addStretch();
- layout->addLayout(hLay);
+ tqlayout->addLayout(hLay);
- connect( m_htmlUseProg, SIGNAL(toggled(bool)), m_htmlProg, SLOT(setEnabled(bool)) );
- connect( m_imageUseProg, SIGNAL(toggled(bool)), m_imageProg, SLOT(setEnabled(bool)) );
- connect( m_animationUseProg, SIGNAL(toggled(bool)), m_animationProg, SLOT(setEnabled(bool)) );
- connect( m_soundUseProg, SIGNAL(toggled(bool)), m_soundProg, SLOT(setEnabled(bool)) );
+ connect( m_htmlUseProg, TQT_SIGNAL(toggled(bool)), m_htmlProg, TQT_SLOT(setEnabled(bool)) );
+ connect( m_imageUseProg, TQT_SIGNAL(toggled(bool)), m_imageProg, TQT_SLOT(setEnabled(bool)) );
+ connect( m_animationUseProg, TQT_SIGNAL(toggled(bool)), m_animationProg, TQT_SLOT(setEnabled(bool)) );
+ connect( m_soundUseProg, TQT_SIGNAL(toggled(bool)), m_soundProg, TQT_SLOT(setEnabled(bool)) );
- layout->insertStretch(-1);
+ tqlayout->insertStretch(-1);
load();
}
diff --git a/src/settings.h b/src/settings.h
index e731262..7f66abd 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -21,29 +21,29 @@
#ifndef SETTINGS_H
#define SETTINGS_H
-#include <qstring.h>
+#include <tqstring.h>
#include <kdialogbase.h>
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qtooltip.h>
-#include <qcolor.h>
-#include <qpoint.h>
-#include <qsize.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqtooltip.h>
+#include <tqcolor.h>
+#include <tqpoint.h>
+#include <tqsize.h>
#include <kcmodule.h>
#include <kaction.h>
#include <kmainwindow.h>
-#include <qdatetime.h>
+#include <tqdatetime.h>
#include "global.h"
#include "bnpview.h"
#include "systemtray.h"
-class QGroupBox;
-class QButtonGroup;
+class TQGroupBox;
+class TQButtonGroup;
class KColorCombo;
class KIntNumInput;
class KGlobalAccel;
-class QLabel;
+class TQLabel;
class Container;
class SystemTray;
@@ -56,8 +56,9 @@ class IconSizeCombo;
class GeneralPage : public KCModule
{
Q_OBJECT
+ TQ_OBJECT
public:
- GeneralPage(QWidget * parent=0, const char * name=0);
+ GeneralPage(TQWidget * tqparent=0, const char * name=0);
GeneralPage() {};
virtual ~GeneralPage() {}
@@ -67,25 +68,26 @@ class GeneralPage : public KCModule
private:
// General
- QComboBox *m_treeOnLeft;
- QComboBox *m_filterOnTop;
- QCheckBox *m_usePassivePopup;
+ TQComboBox *m_treeOnLeft;
+ TQComboBox *m_filterOnTop;
+ TQCheckBox *m_usePassivePopup;
// System Tray Icon
- QCheckBox *m_useSystray;
- QWidget *m_systray;
- QCheckBox *m_showIconInSystray;
- QCheckBox *m_hideOnMouseOut;
+ TQCheckBox *m_useSystray;
+ TQWidget *m_systray;
+ TQCheckBox *m_showIconInSystray;
+ TQCheckBox *m_hideOnMouseOut;
KIntNumInput *m_timeToHideOnMouseOut;
- QCheckBox *m_showOnMouseIn;
+ TQCheckBox *m_showOnMouseIn;
KIntNumInput *m_timeToShowOnMouseIn;
};
class BasketsPage : public KCModule
{
Q_OBJECT
+ TQ_OBJECT
public:
- BasketsPage(QWidget * parent=0, const char * name=0);
+ BasketsPage(TQWidget * tqparent=0, const char * name=0);
BasketsPage() {};
virtual void load();
@@ -94,29 +96,30 @@ class BasketsPage : public KCModule
private:
// Appearance
- QCheckBox *m_playAnimations;
- QCheckBox *m_showNotesToolTip;
- QCheckBox *m_bigNotes;
+ TQCheckBox *m_playAnimations;
+ TQCheckBox *m_showNotesToolTip;
+ TQCheckBox *m_bigNotes;
// Behavior
- QCheckBox *m_autoBullet;
- QCheckBox *m_confirmNoteDeletion;
- QCheckBox *m_exportTextTags;
- QWidget *m_groupOnInsertionLineWidget;
- QCheckBox *m_groupOnInsertionLine;
- QComboBox *m_middleAction;
+ TQCheckBox *m_autoBullet;
+ TQCheckBox *m_confirmNoteDeletion;
+ TQCheckBox *m_exportTextTags;
+ TQWidget *m_groupOnInsertionLineWidget;
+ TQCheckBox *m_groupOnInsertionLine;
+ TQComboBox *m_middleAction;
// Protection
- QCheckBox *m_useGnuPGAgent;
- QCheckBox *m_enableReLockTimeoutMinutes;
+ TQCheckBox *m_useGnuPGAgent;
+ TQCheckBox *m_enableReLockTimeoutMinutes;
KIntNumInput *m_reLockTimeoutMinutes;
};
class NewNotesPage : public KCModule
{
Q_OBJECT
+ TQ_OBJECT
public:
- NewNotesPage(QWidget * parent=0, const char * name=0);
+ NewNotesPage(TQWidget * tqparent=0, const char * name=0);
NewNotesPage() {};
virtual void load();
@@ -130,21 +133,22 @@ class NewNotesPage : public KCModule
// Notes Image Size
KIntNumInput *m_imgSizeX;
KIntNumInput *m_imgSizeY;
- QPushButton *m_pushVisualize;
+ TQPushButton *m_pushVisualize;
// Note Addition
- QComboBox *m_newNotesPlace;
- QCheckBox *m_viewTextFileContent;
- QCheckBox *m_viewHtmlFileContent;
- QCheckBox *m_viewImageFileContent;
- QCheckBox *m_viewSoundFileContent;
+ TQComboBox *m_newNotesPlace;
+ TQCheckBox *m_viewTextFileContent;
+ TQCheckBox *m_viewHtmlFileContent;
+ TQCheckBox *m_viewImageFileContent;
+ TQCheckBox *m_viewSoundFileContent;
};
class NotesAppearancePage : public KCModule
{
Q_OBJECT
+ TQ_OBJECT
public:
- NotesAppearancePage(QWidget * parent=0, const char * name=0);
+ NotesAppearancePage(TQWidget * tqparent=0, const char * name=0);
NotesAppearancePage() {};
virtual void load();
@@ -163,8 +167,9 @@ class NotesAppearancePage : public KCModule
class ApplicationsPage : public KCModule
{
Q_OBJECT
+ TQ_OBJECT
public:
- ApplicationsPage(QWidget * parent=0, const char * name=0);
+ ApplicationsPage(TQWidget * tqparent=0, const char * name=0);
ApplicationsPage() {};
virtual void load();
@@ -173,10 +178,10 @@ class ApplicationsPage : public KCModule
private:
// Applications
- QCheckBox *m_htmlUseProg;
- QCheckBox *m_imageUseProg;
- QCheckBox *m_animationUseProg;
- QCheckBox *m_soundUseProg;
+ TQCheckBox *m_htmlUseProg;
+ TQCheckBox *m_imageUseProg;
+ TQCheckBox *m_animationUseProg;
+ TQCheckBox *m_soundUseProg;
RunCommandRequester *m_htmlProg;
RunCommandRequester *m_imageProg;
RunCommandRequester *m_animationProg;
@@ -205,10 +210,10 @@ class Settings // FIXME: Distaptch new config events ?
static bool s_spellCheckTextNotes;
static int s_basketTreeWidth;
static bool s_welcomeBasketsAdded;
- static QString s_dataFolder;
- static QDate s_lastBackup;
- static QPoint s_mainWindowPosition;
- static QSize s_mainWindowSize;
+ static TQString s_dataFolder;
+ static TQDate s_lastBackup;
+ static TQPoint s_mainWindowPosition;
+ static TQSize s_mainWindowSize;
static bool s_showEmptyBasketInfo;
static bool s_blinkedFilter;
static bool s_enableReLockTimeout;
@@ -232,10 +237,10 @@ class Settings // FIXME: Distaptch new config events ?
static bool s_imageUseProg;
static bool s_animationUseProg;
static bool s_soundUseProg;
- static QString s_htmlProg;
- static QString s_imageProg;
- static QString s_animationProg;
- static QString s_soundProg;
+ static TQString s_htmlProg;
+ static TQString s_imageProg;
+ static TQString s_animationProg;
+ static TQString s_soundProg;
/** Insert Note Default Values */
static int s_defImageX;
static int s_defImageY;
@@ -268,20 +273,20 @@ class Settings // FIXME: Distaptch new config events ?
static inline int dropTimeToShow() { return 7; } // TODO: 700 ; TODO: There is certainly a KGlobalConfig ???
static inline bool usePassivePopup() { return s_usePassivePopup; }
static inline bool welcomeBasketsAdded() { return s_welcomeBasketsAdded; }
- static inline QString dataFolder() { return s_dataFolder; }
- static inline QDate lastBackup() { return s_lastBackup; }
- static inline QPoint mainWindowPosition() { return s_mainWindowPosition; }
- static inline QSize mainWindowSize() { return s_mainWindowSize; }
+ static inline TQString dataFolder() { return s_dataFolder; }
+ static inline TQDate lastBackup() { return s_lastBackup; }
+ static inline TQPoint mainWindowPosition() { return s_mainWindowPosition; }
+ static inline TQSize mainWindowSize() { return s_mainWindowSize; }
static inline bool showEmptyBasketInfo() { return s_showEmptyBasketInfo; }
/** Programs */
static inline bool isHtmlUseProg() { return s_htmlUseProg; }
static inline bool isImageUseProg() { return s_imageUseProg; }
static inline bool isAnimationUseProg() { return s_animationUseProg; }
static inline bool isSoundUseProg() { return s_soundUseProg; }
- static inline QString htmlProg() { return s_htmlProg; }
- static inline QString imageProg() { return s_imageProg; }
- static inline QString animationProg() { return s_animationProg; }
- static inline QString soundProg() { return s_soundProg; }
+ static inline TQString htmlProg() { return s_htmlProg; }
+ static inline TQString imageProg() { return s_imageProg; }
+ static inline TQString animationProg() { return s_animationProg; }
+ static inline TQString soundProg() { return s_soundProg; }
/** Insert Note Default Values */
static inline int defImageX() { return s_defImageX; }
static inline int defImageY() { return s_defImageY; }
@@ -356,20 +361,20 @@ class Settings // FIXME: Distaptch new config events ?
static inline void setBasketTreeWidth(int width) { s_basketTreeWidth = width; }
static inline void setUsePassivePopup(bool enable) { s_usePassivePopup = enable; }
static inline void setWelcomeBasketsAdded(bool added) { s_welcomeBasketsAdded = added; }
- static inline void setDataFolder(const QString &folder) { s_dataFolder = folder; }
- static inline void setLastBackup(const QDate &date) { s_lastBackup = date; }
- static inline void setMainWindowPosition(const QPoint &pos) { s_mainWindowPosition = pos; }
- static inline void setMainWindowSize(const QSize &size) { s_mainWindowSize = size; }
+ static inline void setDataFolder(const TQString &folder) { s_dataFolder = folder; }
+ static inline void setLastBackup(const TQDate &date) { s_lastBackup = date; }
+ static inline void setMainWindowPosition(const TQPoint &pos) { s_mainWindowPosition = pos; }
+ static inline void setMainWindowSize(const TQSize &size) { s_mainWindowSize = size; }
static inline void setShowEmptyBasketInfo(bool show) { s_showEmptyBasketInfo = show; }
// Programs :
static inline void setIsHtmlUseProg(bool useProg) { s_htmlUseProg = useProg; }
static inline void setIsImageUseProg(bool useProg) { s_imageUseProg = useProg; }
static inline void setIsAnimationUseProg(bool useProg) { s_animationUseProg = useProg; }
static inline void setIsSoundUseProg(bool useProg) { s_soundUseProg = useProg; }
- static inline void setHtmlProg(const QString &prog) { s_htmlProg = prog; }
- static inline void setImageProg(const QString &prog) { s_imageProg = prog; }
- static inline void setAnimationProg(const QString &prog) { s_animationProg = prog; }
- static inline void setSoundProg(const QString &prog) { s_soundProg = prog; }
+ static inline void setHtmlProg(const TQString &prog) { s_htmlProg = prog; }
+ static inline void setImageProg(const TQString &prog) { s_imageProg = prog; }
+ static inline void setAnimationProg(const TQString &prog) { s_animationProg = prog; }
+ static inline void setSoundProg(const TQString &prog) { s_soundProg = prog; }
// Insert Note Default Values :
static inline void setDefImageX(int val) { s_defImageX = val; }
static inline void setDefImageY(int val) { s_defImageY = val; }
@@ -385,8 +390,8 @@ class Settings // FIXME: Distaptch new config events ?
static void loadConfig();
static void saveConfig();
protected:
- static void loadLinkLook(LinkLook *look, const QString &name, const LinkLook &defaultLook);
- static void saveLinkLook(LinkLook *look, const QString &name);
+ static void loadLinkLook(LinkLook *look, const TQString &name, const LinkLook &defaultLook);
+ static void saveLinkLook(LinkLook *look, const TQString &name);
};
#endif // SETTINGS_H
diff --git a/src/softwareimporters.cpp b/src/softwareimporters.cpp
index 9f276c7..2c9acb0 100644
--- a/src/softwareimporters.cpp
+++ b/src/softwareimporters.cpp
@@ -18,17 +18,17 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qdir.h>
+#include <tqstring.h>
+#include <tqdir.h>
#include <kstandarddirs.h>
#include <klocale.h>
#include <kfiledialog.h>
-#include <qptrstack.h>
-#include <qlayout.h>
-#include <qvbuttongroup.h>
-#include <qradiobutton.h>
+#include <tqptrstack.h>
+#include <tqlayout.h>
+#include <tqvbuttongroup.h>
+#include <tqradiobutton.h>
#include <kmessagebox.h>
-#include <qtextedit.h>
+#include <tqtextedit.h>
#include "softwareimporters.h"
#include "basket.h"
@@ -41,17 +41,17 @@
/** class TreeImportDialog: */
-TreeImportDialog::TreeImportDialog(QWidget *parent)
+TreeImportDialog::TreeImportDialog(TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, i18n("Import Hierarchy"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"ImportHierarchy", /*modal=*/true, /*separator=*/false)
+ KDialogBase::Ok, tqparent, /*name=*/"ImportHierarchy", /*modal=*/true, /*separator=*/false)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
- m_choices = new QVButtonGroup(i18n("How to Import the Notes?"), page);
- new QRadioButton(i18n("&Keep original hierarchy (all notes in separate baskets)"), m_choices);
- new QRadioButton(i18n("&First level notes in separate baskets"), m_choices);
- new QRadioButton(i18n("&All notes in one basket"), m_choices);
+ m_choices = new TQVButtonGroup(i18n("How to Import the Notes?"), page);
+ new TQRadioButton(i18n("&Keep original hierarchy (all notes in separate baskets)"), m_choices);
+ new TQRadioButton(i18n("&First level notes in separate baskets"), m_choices);
+ new TQRadioButton(i18n("&All notes in one basket"), m_choices);
m_choices->setButton(0);
topLayout->addWidget(m_choices);
topLayout->addStretch(10);
@@ -70,33 +70,33 @@ int TreeImportDialog::choice()
/** class TextFileImportDialog: */
-TextFileImportDialog::TextFileImportDialog(QWidget *parent)
+TextFileImportDialog::TextFileImportDialog(TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, i18n("Import Text File"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"ImportTextFile", /*modal=*/true, /*separator=*/false)
+ KDialogBase::Ok, tqparent, /*name=*/"ImportTextFile", /*modal=*/true, /*separator=*/false)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
-
- m_choices = new QVButtonGroup(i18n("Format of the Text File"), page);
- new QRadioButton(i18n("Notes separated by an &empty line"), m_choices);
- new QRadioButton(i18n("One &note per line"), m_choices);
- new QRadioButton(i18n("Notes begin with a &dash (-)"), m_choices);
- new QRadioButton(i18n("Notes begin with a &star (*)"), m_choices);
- m_anotherSeparator = new QRadioButton(i18n("&Use another separator:"), m_choices);
-
- QWidget *indentedTextEdit = new QWidget(m_choices);
- QHBoxLayout *hLayout = new QHBoxLayout(indentedTextEdit, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
+
+ m_choices = new TQVButtonGroup(i18n("Format of the Text File"), page);
+ new TQRadioButton(i18n("Notes separated by an &empty line"), m_choices);
+ new TQRadioButton(i18n("One &note per line"), m_choices);
+ new TQRadioButton(i18n("Notes begin with a &dash (-)"), m_choices);
+ new TQRadioButton(i18n("Notes begin with a &star (*)"), m_choices);
+ m_anotherSeparator = new TQRadioButton(i18n("&Use another separator:"), m_choices);
+
+ TQWidget *indentedTextEdit = new TQWidget(m_choices);
+ TQHBoxLayout *hLayout = new TQHBoxLayout(indentedTextEdit, /*margin=*/0, spacingHint());
hLayout->addSpacing(20);
- m_customSeparator = new QTextEdit(indentedTextEdit);
- m_customSeparator->setTextFormat(Qt::PlainText);
+ m_customSeparator = new TQTextEdit(indentedTextEdit);
+ m_customSeparator->setTextFormat(TQt::PlainText);
hLayout->addWidget(m_customSeparator);
- m_choices->insertChild(indentedTextEdit);
+ m_choices->insertChild(TQT_TQOBJECT(indentedTextEdit));
- new QRadioButton(i18n("&All in one note"), m_choices);
+ new TQRadioButton(i18n("&All in one note"), m_choices);
m_choices->setButton(0);
topLayout->addWidget(m_choices);
- connect( m_customSeparator, SIGNAL(textChanged()), this, SLOT(customSeparatorChanged()) );
+ connect( m_customSeparator, TQT_SIGNAL(textChanged()), this, TQT_SLOT(customSeparatorChanged()) );
setMainWidget(page);
}
@@ -105,7 +105,7 @@ TextFileImportDialog::~TextFileImportDialog()
{
}
-QString TextFileImportDialog::separator()
+TQString TextFileImportDialog::separator()
{
switch (m_choices->selectedId()) {
default:
@@ -126,21 +126,21 @@ void TextFileImportDialog::customSeparatorChanged()
/** namespace SoftwareImporters: */
-QString SoftwareImporters::fromICS(const QString &ics)
+TQString SoftwareImporters::fromICS(const TQString &ics)
{
- QString result = ics;
+ TQString result = ics;
// Remove escaped '\' characters and append the text to the body
int pos = 0;
- while ( (pos = result.find('\\', pos)) != -1 ) {
+ while ( (pos = result.tqfind('\\', pos)) != -1 ) {
if ((uint)pos == result.length() - 1) // End of string
break;
if (result[pos+1] == 'n') {
- result.replace(pos, 2, '\n');
+ result.tqreplace(pos, 2, '\n');
} else if (result[pos+1] == 'r') {
- result.replace(pos, 2, '\r');
+ result.tqreplace(pos, 2, '\r');
} else if (result[pos+1] == 't') {
- result.replace(pos, 2, '\t');
+ result.tqreplace(pos, 2, '\t');
} else if (result[pos] == '\\') {
result.remove(pos, 1); // Take care of "\\", "\,", "\;" and other escaped characters I haven't noticed
++pos;
@@ -150,60 +150,60 @@ QString SoftwareImporters::fromICS(const QString &ics)
return result;
}
-QString SoftwareImporters::fromTomboy(QString tomboy)
+TQString SoftwareImporters::fromTomboy(TQString tomboy)
{
// The first line is the note title, and we already have it, so we remove it (yes, that's pretty stupid to duplicate it in the content...):
- tomboy = tomboy.mid(tomboy.find("\n")).stripWhiteSpace();
+ tomboy = tomboy.mid(tomboy.tqfind("\n")).stripWhiteSpace();
// Font styles and decorations:
- tomboy.replace("<bold>", "<b>");
- tomboy.replace("</bold>", "</b>");
- tomboy.replace("<italic>", "<i>");
- tomboy.replace("</italic>", "</i>");
- tomboy.replace("<strikethrough>", "<span style='text-decoration: line-through'>");
- tomboy.replace("</strikethrough>", "</span>");
+ tomboy.tqreplace("<bold>", "<b>");
+ tomboy.tqreplace("</bold>", "</b>");
+ tomboy.tqreplace("<italic>", "<i>");
+ tomboy.tqreplace("</italic>", "</i>");
+ tomboy.tqreplace("<strikethrough>", "<span style='text-decoration: line-through'>");
+ tomboy.tqreplace("</strikethrough>", "</span>");
- // Highlight not supported by QTextEdit:
- tomboy.replace("<highlight>", "<span style='color:#ff0080'>");
- tomboy.replace("</highlight>", "</span>");
+ // Highlight not supported by TQTextEdit:
+ tomboy.tqreplace("<highlight>", "<span style='color:#ff0080'>");
+ tomboy.tqreplace("</highlight>", "</span>");
// Font sizes:
- tomboy.replace("<size:small>", "<span style='font-size: 7pt'>");
- tomboy.replace("</size:small>", "</span>");
- tomboy.replace("<size:large>", "<span style='font-size: 16pt'>");
- tomboy.replace("</size:large>", "</span>");
- tomboy.replace("<size:huge>", "<span style='font-size: 20pt'>");
- tomboy.replace("</size:huge>", "</span>");
+ tomboy.tqreplace("<size:small>", "<span style='font-size: 7pt'>");
+ tomboy.tqreplace("</size:small>", "</span>");
+ tomboy.tqreplace("<size:large>", "<span style='font-size: 16pt'>");
+ tomboy.tqreplace("</size:large>", "</span>");
+ tomboy.tqreplace("<size:huge>", "<span style='font-size: 20pt'>");
+ tomboy.tqreplace("</size:huge>", "</span>");
// Internal links to other notes aren't supported yet by BasKet Note Pads:
- tomboy.replace("<link:internal>", "");
- tomboy.replace("</link:internal>", "");
+ tomboy.tqreplace("<link:internal>", "");
+ tomboy.tqreplace("</link:internal>", "");
// In the Tomboy file, new lines are "\n" and not "<br>":
- tomboy.replace("\n", "<br>\n");
+ tomboy.tqreplace("\n", "<br>\n");
// Preserve consecutive spaces:
return "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>" + tomboy + "</body></html>";
}
-Note* SoftwareImporters::insertTitledNote(Basket *parent, const QString &title, const QString &content, Qt::TextFormat format/* = Qt::PlainText*/, Note *parentNote/* = 0*/)
+Note* SoftwareImporters::insertTitledNote(Basket *tqparent, const TQString &title, const TQString &content, TQt::TextFormat format/* = TQt::PlainText*/, Note *tqparentNote/* = 0*/)
{
- Note *nGroup = new Note(parent);
+ Note *nGroup = new Note(tqparent);
- Note *nTitle = NoteFactory::createNoteText(title, parent);
+ Note *nTitle = NoteFactory::createNoteText(title, tqparent);
nTitle->addState(Tag::stateForId("title"));
Note *nContent;
- if (format == Qt::PlainText)
- nContent = NoteFactory::createNoteText(content, parent);
+ if (format == TQt::PlainText)
+ nContent = NoteFactory::createNoteText(content, tqparent);
else
- nContent = NoteFactory::createNoteHtml(content, parent);
+ nContent = NoteFactory::createNoteHtml(content, tqparent);
- if (parentNote == 0)
- parentNote = parent->firstNote(); // In the first column!
- parent->insertNote(nGroup, parentNote, Note::BottomColumn, QPoint(), /*animate=*/false);
- parent->insertNote(nTitle, nGroup, Note::BottomColumn, QPoint(), /*animate=*/false);
- parent->insertNote(nContent, nTitle, Note::BottomInsert, QPoint(), /*animate=*/false);
+ if (tqparentNote == 0)
+ tqparentNote = tqparent->firstNote(); // In the first column!
+ tqparent->insertNote(nGroup, tqparentNote, Note::BottomColumn, TQPoint(), /*animate=*/false);
+ tqparent->insertNote(nTitle, nGroup, Note::BottomColumn, TQPoint(), /*animate=*/false);
+ tqparent->insertNote(nContent, nTitle, Note::BottomInsert, TQPoint(), /*animate=*/false);
return nGroup;
}
@@ -216,9 +216,9 @@ void SoftwareImporters::finishImport(Basket *basket)
// Focus the FIRST note (the last inserted note is currently focused!):
basket->setFocusedNote(basket->firstNoteShownInStack());
- // Relayout every notes at theire new place and simulate a load animation (because already loaded just after the creation).
- // Without a relayouting, notes on the bottom would comes from the top (because they were inserted on top) and clutter the animation load:
- basket->relayoutNotes(/*animate=*/false);
+ // Retqlayout every notes at theire new place and simulate a load animation (because already loaded just after the creation).
+ // Without a retqlayouting, notes on the bottom would comes from the top (because they were inserted on top) and clutter the animation load:
+ basket->retqlayoutNotes(/*animate=*/false);
basket->animateLoad();
basket->save();
}
@@ -227,32 +227,32 @@ void SoftwareImporters::finishImport(Basket *basket)
void SoftwareImporters::importKJots()
{
- QString dirPath = locateLocal("appdata","") + "/../kjots/"; // I think the assumption is good
- QDir dir(dirPath, QString::null, QDir::Name | QDir::IgnoreCase, QDir::Files | QDir::NoSymLinks);
+ TQString dirPath = locateLocal("appdata","") + "/../kjots/"; // I think the assumption is good
+ TQDir dir(dirPath, TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Files | TQDir::NoSymLinks);
- QStringList list = dir.entryList();
+ TQStringList list = dir.entryList();
if (list.isEmpty())
return;
- BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/i18n("From KJots"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/i18n("From KJots"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
Basket *kjotsBasket = Global::bnpView->currentBasket();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
- QFile file(dirPath + *it);
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
+ TQFile file(dirPath + *it);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::Locale);
- QString buf = stream.readLine();
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::Locale);
+ TQString buf = stream.readLine();
// IT IS A NOTEBOOK FILE, AT THE VERION 0.6.x and older:
if ( !buf.isNull() && buf.left(9) == "\\NewEntry") {
// First create a basket for it:
- BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/KURL(file.name()).fileName(), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/kjotsBasket);
+ BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/KURL(file.name()).fileName(), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/kjotsBasket);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
- QString title, body;
+ TQString title, body;
bool haveAnEntry = false;
while (1) {
if (buf.left(9) == "\\NewEntry") {
@@ -264,7 +264,7 @@ void SoftwareImporters::importKJots()
} else if (buf.left(3) != "\\ID") { // Don't care of the ID
// Remove escaped '\' characters and append the text to the body
int pos = 0;
- while ( (pos = buf.find('\\', pos)) != -1 )
+ while ( (pos = buf.tqfind('\\', pos)) != -1 )
if (buf[++pos] == '\\')
buf.remove(pos, 1);
body.append(buf + "\n");
@@ -281,20 +281,20 @@ void SoftwareImporters::importKJots()
// IT IS A NOTEBOOK XML FILE, AT THE VERION 0.7.0 and later:
} else if ( (*it).endsWith(".book") /*&& !buf.isNull() && (buf.left(2) == "<!" / *<!DOCTYPE...* / || buf.left(2) == "<?" / *<?xml...* /)*/) {
- QDomDocument *doc = XMLWork::openFile("KJots", dirPath + *it);
+ TQDomDocument *doc = XMLWork::openFile("KJots", dirPath + *it);
if (doc == 0)
continue;
- QString bookTitle = XMLWork::getElementText(doc->documentElement(), "KJotsBook/Title");
+ TQString bookTitle = XMLWork::getElementText(doc->documentElement(), "KJotsBook/Title");
// First create a basket for it:
- BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/bookTitle, /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/kjotsBasket);
+ BasketFactory::newBasket(/*icon=*/"kjots", /*name=*/bookTitle, /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/kjotsBasket);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
- QDomElement docElem = XMLWork::getElement(doc->documentElement(), "KJotsBook");
- for ( QDomNode n = docElem.firstChild(); !n.isNull(); n = n.nextSibling() ) {
- QDomElement e = n.toElement();
+ TQDomElement docElem = XMLWork::getElement(doc->documentElement(), "KJotsBook");
+ for ( TQDomNode n = docElem.firstChild(); !n.isNull(); n = n.nextSibling() ) {
+ TQDomElement e = n.toElement();
if ( (!e.isNull()) && e.tagName() == "KJotsPage" )
insertTitledNote(basket, XMLWork::getElementText(e, "Title"), XMLWork::getElementText(e, "Text"));
}
@@ -309,28 +309,28 @@ void SoftwareImporters::importKJots()
void SoftwareImporters::importKNotes()
{
- QString dirPath = locateLocal("appdata","") + "/../knotes/"; // I thing the assumption is good
- QDir dir(dirPath, QString::null, QDir::Name | QDir::IgnoreCase, QDir::Files | QDir::NoSymLinks);
+ TQString dirPath = locateLocal("appdata","") + "/../knotes/"; // I thing the assumption is good
+ TQDir dir(dirPath, TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Files | TQDir::NoSymLinks);
- QStringList list = dir.entryList();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
+ TQStringList list = dir.entryList();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
if ( ! (*it).endsWith(".ics") ) // Don't process *.ics~ and otehr files
continue;
- QFile file(dirPath + *it);
+ TQFile file(dirPath + *it);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
// First create a basket for it:
- BasketFactory::newBasket(/*icon=*/"knotes", /*name=*/i18n("From KNotes"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"knotes", /*name=*/i18n("From KNotes"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
bool inVJournal = false;
bool inDescription = false;
bool isRichText = false;
- QString title, body;
- QString buf;
+ TQString title, body;
+ TQString buf;
while (1) {
buf = stream.readLine();
if (buf.isNull()) // OEF
@@ -348,7 +348,7 @@ void SoftwareImporters::importKNotes()
} else if (buf.startsWith("X-KDE-KNotes-RichText:")) {
isRichText = XMLWork::trueOrFalse(buf.mid(22, buf.length() - 22).stripWhiteSpace(), "false");
} else if (buf == "END:VJOURNAL") {
- insertTitledNote(basket, fromICS(title), fromICS(body), (isRichText ? Qt::RichText : Qt::PlainText));
+ insertTitledNote(basket, fromICS(title), fromICS(body), (isRichText ? TQt::RichText : TQt::PlainText));
inVJournal = false;
inDescription = false;
isRichText = false;
@@ -361,7 +361,7 @@ void SoftwareImporters::importKNotes()
// Bouh : duplicate code
// In case of unvalide ICAL file!
if ( ! body.isEmpty() ) // Add the ending note
- insertTitledNote(basket, fromICS(title), fromICS(body), (isRichText ? Qt::RichText : Qt::PlainText));
+ insertTitledNote(basket, fromICS(title), fromICS(body), (isRichText ? TQt::RichText : TQt::PlainText));
file.close();
finishImport(basket);
}
@@ -373,33 +373,33 @@ void SoftwareImporters::importStickyNotes()
// Sticky Notes file is usually located in ~/.gnome2/stickynotes_applet
// We will search all directories in "~/" that contain "gnome" in the name,
// and will search for "stickynotes_applet" file (that should be XML file with <stickynotes> root.
- QDir dir(QDir::home().absPath(), QString::null, QDir::Name | QDir::IgnoreCase,
- QDir::Dirs | QDir::NoSymLinks | QDir::Hidden);
- QStringList founds;
-
- QStringList list = dir.entryList();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each folder
- if ( (*it).contains("gnome", false) ) {
- QString fullPath = QDir::home().absPath() + "/" + (*it) + "/stickynotes_applet";
+ TQDir dir(TQDir::home().absPath(), TQString(), TQDir::Name | TQDir::IgnoreCase,
+ TQDir::Dirs | TQDir::NoSymLinks | TQDir::Hidden);
+ TQStringList founds;
+
+ TQStringList list = dir.entryList();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each folder
+ if ( (*it).tqcontains("gnome", false) ) {
+ TQString fullPath = TQDir::home().absPath() + "/" + (*it) + "/stickynotes_applet";
if (dir.exists(fullPath))
founds += fullPath;
}
}
- for ( QStringList::Iterator it = founds.begin(); it != founds.end(); ++it ) { // For each file
- QFile file(*it);
- QDomDocument *doc = XMLWork::openFile("stickynotes", *it);
+ for ( TQStringList::Iterator it = founds.begin(); it != founds.end(); ++it ) { // For each file
+ TQFile file(*it);
+ TQDomDocument *doc = XMLWork::openFile("stickynotes", *it);
if (doc == 0)
continue;
// First create a basket for it:
- BasketFactory::newBasket(/*icon=*/"gnome", /*name=*/i18n("From Sticky Notes"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"gnome", /*name=*/i18n("From Sticky Notes"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
- QDomElement docElem = doc->documentElement();
- for ( QDomNode n = docElem.firstChild(); !n.isNull(); n = n.nextSibling() ) {
- QDomElement e = n.toElement();
+ TQDomElement docElem = doc->documentElement();
+ for ( TQDomNode n = docElem.firstChild(); !n.isNull(); n = n.nextSibling() ) {
+ TQDomElement e = n.toElement();
if ( (!e.isNull()) && e.tagName() == "note" )
insertTitledNote(basket, e.attribute("title"), e.text());
}
@@ -411,13 +411,13 @@ void SoftwareImporters::importStickyNotes()
// TODO: FIXME: Code duplicated from notecontent.cpp but with UTF-8 encoding.
// TODO: FIXME: Later, merge!
-QString loadUtf8FileToString(const QString &fileName)
+TQString loadUtf8FileToString(const TQString &fileName)
{
- QFile file(fileName);
+ TQFile file(fileName);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
- QString text;
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
+ TQString text;
text = stream.read();
file.close();
return text;
@@ -428,41 +428,41 @@ QString loadUtf8FileToString(const QString &fileName)
void SoftwareImporters::importTomboy()
{
- QString dirPath = QDir::home().absPath() + "/.tomboy/"; // I thing the assumption is good
- QDir dir(dirPath, QString::null, QDir::Name | QDir::IgnoreCase, QDir::Files | QDir::NoSymLinks);
+ TQString dirPath = TQDir::home().absPath() + "/.tomboy/"; // I thing the assumption is good
+ TQDir dir(dirPath, TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::Files | TQDir::NoSymLinks);
Basket *basket = 0; // Create the basket ONLY if we found at least one note to add!
- QStringList list = dir.entryList();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
+ TQStringList list = dir.entryList();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) { // For each file
if ( ! (*it).endsWith(".note") )
continue;
- QDomDocument *doc = XMLWork::openFile("note", dirPath + *it);
+ TQDomDocument *doc = XMLWork::openFile("note", dirPath + *it);
if (doc == 0)
continue;
if (basket == 0) {
// First create a basket for it:
- BasketFactory::newBasket(/*icon=*/"tomboy", /*name=*/i18n("From Tomboy"), /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ BasketFactory::newBasket(/*icon=*/"tomboy", /*name=*/i18n("From Tomboy"), /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
basket = Global::bnpView->currentBasket();
basket->load();
}
- QDomElement docElem = doc->documentElement();
- QString title = XMLWork::getElementText(docElem, "title");
+ TQDomElement docElem = doc->documentElement();
+ TQString title = XMLWork::getElementText(docElem, "title");
// DOES NOT REALLY WORKS:
- //QDomElement contentElement = XMLWork::getElement(docElem, "text/note-content");
- //QString content = XMLWork::innerXml(contentElement);
+ //TQDomElement contentElement = XMLWork::getElement(docElem, "text/note-content");
+ //TQString content = XMLWork::innerXml(contentElement);
// Isolate "<note-content version="0.1">CONTENT</note-content>"!
- QString xml = loadUtf8FileToString(dirPath + *it);
- xml = xml.mid(xml.find("<note-content "));
- xml = xml.mid(xml.find(">") + 1);
- xml = xml.mid(0, xml.find("</note-content>"));
+ TQString xml = loadUtf8FileToString(dirPath + *it);
+ xml = xml.mid(xml.tqfind("<note-content "));
+ xml = xml.mid(xml.tqfind(">") + 1);
+ xml = xml.mid(0, xml.tqfind("</note-content>"));
if (!title.isEmpty() && !/*content*/xml.isEmpty())
- insertTitledNote(basket, title, fromTomboy(xml/*content*/), Qt::RichText);
+ insertTitledNote(basket, title, fromTomboy(xml/*content*/), TQt::RichText);
}
if (basket)
@@ -471,35 +471,35 @@ void SoftwareImporters::importTomboy()
void SoftwareImporters::importTextFile()
{
- QString fileName = KFileDialog::getOpenFileName(":ImportTextFile", "*|All files");
+ TQString fileName = KFileDialog::getOpenFileName(":ImportTextFile", "*|All files");
if (fileName.isEmpty())
return;
TextFileImportDialog dialog;
- if (dialog.exec() == QDialog::Rejected)
+ if (dialog.exec() == TQDialog::Rejected)
return;
- QString separator = dialog.separator();
+ TQString separator = dialog.separator();
- QFile file(fileName);
+ TQFile file(fileName);
if (file.open(IO_ReadOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::Locale);
- QString content = stream.read();
- QStringList list = (separator.isEmpty()
- ? QStringList(content)
- : QStringList::split(separator, content, /*allowEmptyEntries=*/false)
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::Locale);
+ TQString content = stream.read();
+ TQStringList list = (separator.isEmpty()
+ ? TQStringList(content)
+ : TQStringList::split(separator, content, /*allowEmptyEntries=*/false)
);
// First create a basket for it:
- QString title = i18n("From TextFile.txt", "From %1").arg(KURL(fileName).fileName());
- BasketFactory::newBasket(/*icon=*/"txt", title, /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", /*createIn=*/0);
+ TQString title = i18n("From TextFile.txt", "From %1").tqarg(KURL(fileName).fileName());
+ BasketFactory::newBasket(/*icon=*/"txt", title, /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", /*createIn=*/0);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
// Import every notes:
- for (QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
+ for (TQStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
Note *note = NoteFactory::createNoteFromText((*it).stripWhiteSpace(), basket);
- basket->insertNote(note, basket->firstNote(), Note::BottomColumn, QPoint(), /*animate=*/false);
+ basket->insertNote(note, basket->firstNote(), Note::BottomColumn, TQPoint(), /*animate=*/false);
}
// Finish the export:
@@ -515,15 +515,15 @@ void SoftwareImporters::importKnowIt()
"*.kno|KnowIt files\n*|All files");
if (!url.isEmpty())
{
- QFile file(url.path());
- QFileInfo info(url.path());
+ TQFile file(url.path());
+ TQFileInfo info(url.path());
Basket* basket = 0;
- QPtrStack<Basket> baskets;
- QString text;
+ TQPtrStack<Basket> baskets;
+ TQString text;
int hierarchy = 0;
TreeImportDialog dialog;
- if (dialog.exec() == QDialog::Rejected)
+ if (dialog.exec() == TQDialog::Rejected)
return;
hierarchy = dialog.choice();
@@ -531,8 +531,8 @@ void SoftwareImporters::importKnowIt()
BasketFactory::newBasket(/*icon=*/"knowit",
/*name=*/info.baseName(),
/*backgroundImage=*/"",
- /*backgroundColor=*/QColor(),
- /*textColor=*/QColor(),
+ /*backgroundColor=*/TQColor(),
+ /*textColor=*/TQColor(),
/*templateName=*/"1column",
/*createIn=*/0);
basket = Global::bnpView->currentBasket();
@@ -541,14 +541,14 @@ void SoftwareImporters::importKnowIt()
if(file.open(IO_ReadOnly))
{
- QTextStream stream(&file);
+ TQTextStream stream(&file);
uint level = 0;
- QString name;
- QString line;
- QStringList links;
- QStringList descriptions;
+ TQString name;
+ TQString line;
+ TQStringList links;
+ TQStringList descriptions;
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
while(1)
{
line = stream.readLine();
@@ -569,8 +569,8 @@ void SoftwareImporters::importKnowIt()
BasketFactory::newBasket(/*icon=*/"knowit",
/*name=*/name,
/*backgroundImage=*/"",
- /*backgroundColor=*/QColor(),
- /*textColor=*/QColor(),
+ /*backgroundColor=*/TQColor(),
+ /*textColor=*/TQColor(),
/*templateName=*/"1column",
/*createIn=*/baskets.top());
basket = Global::bnpView->currentBasket();
@@ -581,7 +581,7 @@ void SoftwareImporters::importKnowIt()
hierarchy == 2 ||
(hierarchy == 1 && level > 0))
{
- insertTitledNote(basket, name, text, Qt::RichText);
+ insertTitledNote(basket, name, text, TQt::RichText);
}
for(uint j = 0; j < links.count(); ++j)
{
@@ -598,8 +598,8 @@ void SoftwareImporters::importKnowIt()
if(stream.atEnd())
break;
- int i = line.find("Entry") + 6;
- int n = line.find(' ', i);
+ int i = line.tqfind("Entry") + 6;
+ int n = line.tqfind(' ', i);
level = line.mid(i, n - i).toInt();
name = line.mid(n+1);
text = "";
@@ -628,39 +628,39 @@ void SoftwareImporters::importKnowIt()
void SoftwareImporters::importTuxCards()
{
- QString fileName = KFileDialog::getOpenFileName(":ImportTuxCards", "*|All files");
+ TQString fileName = KFileDialog::getOpenFileName(":ImportTuxCards", "*|All files");
if (fileName.isEmpty())
return;
TreeImportDialog dialog;
- if (dialog.exec() == QDialog::Rejected)
+ if (dialog.exec() == TQDialog::Rejected)
return;
int hierarchy = dialog.choice();
- QDomDocument *document = XMLWork::openFile("tuxcards_data_file"/*"InformationCollection"*/, fileName);
+ TQDomDocument *document = XMLWork::openFile("tuxcards_data_file"/*"InformationCollection"*/, fileName);
if (document == 0) {
KMessageBox::error(0, i18n("Can not import that file. It is either corrupted or not a TuxCards file."), i18n("Bad File Format"));
return;
}
- QDomElement collection = document->documentElement();
+ TQDomElement collection = document->documentElement();
int remainingHierarchy = (hierarchy == 0 ? 65000 : 3 - hierarchy);
- importTuxCardsNode(collection, /*parentBasket=*/0, /*parentNote=*/0, remainingHierarchy);
+ importTuxCardsNode(collection, /*tqparentBasket=*/0, /*tqparentNote=*/0, remainingHierarchy);
}
// TODO: <InformationElement isOpen="true" isEncripted="false"
-void SoftwareImporters::importTuxCardsNode(const QDomElement &element, Basket *parentBasket, Note *parentNote, int remainingHierarchy)
+void SoftwareImporters::importTuxCardsNode(const TQDomElement &element, Basket *tqparentBasket, Note *tqparentNote, int remainingHierarchy)
{
- for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling()) {
- QDomElement e = n.toElement();
+ for (TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ TQDomElement e = n.toElement();
if (e.isNull() || e.tagName() != "InformationElement") // Cannot handle that!
continue;
- QString icon = e.attribute("iconFileName");
- QString name = XMLWork::getElementText(e, "Description");
- QString content = XMLWork::getElementText(e, "Information");
+ TQString icon = e.attribute("iconFileName");
+ TQString name = XMLWork::getElementText(e, "Description");
+ TQString content = XMLWork::getElementText(e, "Information");
bool isRichText = (e.attribute("informationFormat") == "RTF");
bool isEncrypted = (e.attribute("isEncripted") == "true");
if (icon.isEmpty() || icon == "none")
@@ -674,7 +674,7 @@ void SoftwareImporters::importTuxCardsNode(const QDomElement &element, Basket *p
}
if (remainingHierarchy > 0) {
- BasketFactory::newBasket(icon, name, /*backgroundImage=*/"", /*backgroundColor=*/QColor(), /*textColor=*/QColor(), /*templateName=*/"1column", parentBasket);
+ BasketFactory::newBasket(icon, name, /*backgroundImage=*/"", /*backgroundColor=*/TQColor(), /*textColor=*/TQColor(), /*templateName=*/"1column", tqparentBasket);
Basket *basket = Global::bnpView->currentBasket();
basket->load();
@@ -682,13 +682,13 @@ void SoftwareImporters::importTuxCardsNode(const QDomElement &element, Basket *p
nContent = NoteFactory::createNoteHtml(content, basket);
else
nContent = NoteFactory::createNoteText(content, basket);
- basket->insertNote(nContent, basket->firstNote(), Note::BottomColumn, QPoint(), /*animate=*/false);
+ basket->insertNote(nContent, basket->firstNote(), Note::BottomColumn, TQPoint(), /*animate=*/false);
importTuxCardsNode(e, basket, 0, remainingHierarchy - 1);
finishImport(basket);
} else {
- Note *nGroup = insertTitledNote(parentBasket, name, content, (isRichText ? Qt::RichText : Qt::PlainText), parentNote);
- importTuxCardsNode(e, parentBasket, nGroup, remainingHierarchy - 1);
+ Note *nGroup = insertTitledNote(tqparentBasket, name, content, (isRichText ? TQt::RichText : TQt::PlainText), tqparentNote);
+ importTuxCardsNode(e, tqparentBasket, nGroup, remainingHierarchy - 1);
}
}
}
diff --git a/src/softwareimporters.h b/src/softwareimporters.h
index 05df6f8..2d7394f 100644
--- a/src/softwareimporters.h
+++ b/src/softwareimporters.h
@@ -21,12 +21,12 @@
#ifndef SOFTWAREIMPORTERS_H
#define SOFTWAREIMPORTERS_H
-#include <qnamespace.h>
+#include <tqnamespace.h>
#include <kdialogbase.h>
-class QString;
-class QVButtonGroup;
-class QDomElement;
+class TQString;
+class TQVButtonGroup;
+class TQDomElement;
class KTextEdit;
class Basket;
@@ -38,12 +38,13 @@ class Note;
class TreeImportDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- TreeImportDialog(QWidget *parent = 0);
+ TreeImportDialog(TQWidget *tqparent = 0);
~TreeImportDialog();
int choice();
private:
- QVButtonGroup *m_choices;
+ TQVButtonGroup *m_choices;
};
/** The dialog to ask how to import text files.
@@ -52,16 +53,17 @@ class TreeImportDialog : public KDialogBase
class TextFileImportDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- TextFileImportDialog(QWidget *parent = 0);
+ TextFileImportDialog(TQWidget *tqparent = 0);
~TextFileImportDialog();
- QString separator();
+ TQString separator();
protected slots:
void customSeparatorChanged();
private:
- QVButtonGroup *m_choices;
- QRadioButton *m_anotherSeparator;
- QTextEdit *m_customSeparator;
+ TQVButtonGroup *m_choices;
+ TQRadioButton *m_anotherSeparator;
+ TQTextEdit *m_customSeparator;
};
/** Functions that import data from other softwares.
@@ -70,9 +72,9 @@ class TextFileImportDialog : public KDialogBase
namespace SoftwareImporters
{
// Useful methods to design importers:
- QString fromICS(const QString &ics);
- QString fromTomboy(QString tomboy);
- Note* insertTitledNote(Basket *parent, const QString &title, const QString &content, Qt::TextFormat format = Qt::PlainText, Note *parentNote = 0);
+ TQString fromICS(const TQString &ics);
+ TQString fromTomboy(TQString tomboy);
+ Note* insertTitledNote(Basket *tqparent, const TQString &title, const TQString &content, TQt::TextFormat format = TQt::PlainText, Note *tqparentNote = 0);
void finishImport(Basket *basket);
// The importers in themselves:
@@ -85,7 +87,7 @@ namespace SoftwareImporters
void importTextFile();
//
- void importTuxCardsNode(const QDomElement &element, Basket *parentBasket, Note *parentNote, int remainingHierarchy);
+ void importTuxCardsNode(const TQDomElement &element, Basket *tqparentBasket, Note *tqparentNote, int remainingHierarchy);
}
#endif // SOFTWAREIMPORTERS_H
diff --git a/src/systemtray.cpp b/src/systemtray.cpp
index d245a3a..3d65a36 100644
--- a/src/systemtray.cpp
+++ b/src/systemtray.cpp
@@ -21,17 +21,17 @@
/** KSystemTray2 */
// To draw the systray screenshot image:
-#include <qdockwindow.h>
-#include <qmovie.h>
-#include <qvariant.h>
+#include <tqdockwindow.h>
+#include <tqmovie.h>
+#include <tqvariant.h>
#include "linklabel.h"
#include "note.h"
-#include <qdesktopwidget.h>
-#include <qmime.h>
-#include <qpainter.h>
-#include <qpoint.h>
-#include <qpixmap.h>
+#include <tqdesktopwidget.h>
+#include <tqmime.h>
+#include <tqpainter.h>
+#include <tqpoint.h>
+#include <tqpixmap.h>
// To know the program name:
#include <kglobal.h>
#include <kinstance.h>
@@ -51,8 +51,8 @@
#include "global.h"
#include "tools.h"
-KSystemTray2::KSystemTray2(QWidget *parent, const char *name)
- : KSystemTray(parent, name)
+KSystemTray2::KSystemTray2(TQWidget *tqparent, const char *name)
+ : KSystemTray(tqparent, name)
{
}
@@ -60,11 +60,11 @@ KSystemTray2::~KSystemTray2()
{
}
-void KSystemTray2::displayCloseMessage(QString fileMenu)
+void KSystemTray2::displayCloseMessage(TQString fileMenu)
{
/* IDEAS OF IMPROVEMENTS:
* - Use queuedMessageBox() but it need a dontAskAgainName parameter
- * and image in QMimeSourceFactory shouldn't be removed.
+ * and image in TQMimeSourceFactory shouldn't be removed.
* - Sometimes the systray icon is covered (a passive popup...)
* Use XComposite extension, if available, to get the kicker pixmap.
* - Perhapse desaturate the area around the proper SysTray icon,
@@ -83,7 +83,7 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
fileMenu = i18n("File");
// Some values we need:
- QPoint g = mapToGlobal(pos());
+ TQPoint g = mapToGlobal(pos());
int desktopWidth = kapp->desktop()->width();
int desktopHeight = kapp->desktop()->height();
int tw = width();
@@ -94,21 +94,21 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
// we should not show that screenshot but only a text!
// 1. Determine if the user use a system tray area or not:
- QCString screenstr;
+ TQCString screenstr;
screenstr.setNum(qt_xscreen());
- QCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr;
- bool useSystray = (KSelectionWatcher(trayatom).owner() != 0L);
+ TQCString trayatom = "_NET_SYSTEM_TRAY_S" + screenstr;
+ bool useSystray = (KSelectionWatcher(trayatom.data()).owner() != 0L);
// 2. And then if the icon is visible too (eg. this->show() has been called):
useSystray = useSystray && isVisible();
- // 3. Kicker (or another systray manager) can be visible but masked out of
+ // 3. Kicker (or another systray manager) can be visible but tqmasked out of
// the screen (ie. on right or on left of it). We check if the icon isn't
// out of screen.
if (useSystray) {
- QRect deskRect(0, 0, desktopWidth, desktopHeight);
- if ( !deskRect.contains(g.x(), g.y()) ||
- !deskRect.contains(g.x() + tw, g.y() + th) )
+ TQRect deskRect(0, 0, desktopWidth, desktopHeight);
+ if ( !deskRect.tqcontains(g.x(), g.y()) ||
+ !deskRect.tqcontains(g.x() + tw, g.y() + th) )
useSystray = false;
}
@@ -118,10 +118,10 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
// We are testing if one of the corners is hidden, and if yes, we would enter
// a time consuming process (raise kicker and wait some time):
// if (kapp->widgetAt(g) != this ||
-// kapp->widgetAt(g + QPoint(tw-1, 0)) != this ||
-// kapp->widgetAt(g + QPoint(0, th-1)) != this ||
-// kapp->widgetAt(g + QPoint(tw-1, th-1)) != this) {
- int systrayManagerWinId = topLevelWidget()->winId();
+// kapp->widgetAt(g + TQPoint(tw-1, 0)) != this ||
+// kapp->widgetAt(g + TQPoint(0, th-1)) != this ||
+// kapp->widgetAt(g + TQPoint(tw-1, th-1)) != this) {
+ int systrayManagerWinId = tqtopLevelWidget()->winId();
KWin::forceActiveWindow(systrayManagerWinId);
kapp->processEvents(); // Because without it the systrayManager is raised only after the messageBox is displayed
// KWin::activateWindow(systrayManagerWinId);
@@ -133,13 +133,13 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
// }
}*/
-// KMessageBox::information(this, QString::number(g.x()) + ":" + QString::number(g.y()) + ":" +
-// QString::number((int)(kapp->widgetAt(g+QPoint(1,1)))));
+// KMessageBox::information(this, TQString::number(g.x()) + ":" + TQString::number(g.y()) + ":" +
+// TQString::number((int)(kapp->widgetAt(g+TQPoint(1,1)))));
- QString message = i18n(
+ TQString message = i18n(
"<p>Closing the main window will keep %1 running in the system tray. "
"Use <b>Quit</b> from the <b>Basket</b> menu to quit the application.</p>"
- ).arg(KGlobal::instance()->aboutData()->programName());
+ ).tqarg(KGlobal::instance()->aboutData()->programName());
// We are sure the systray icon is visible: ouf!
if (useSystray) {
// Compute size and position of the pixmap to be grabbed:
@@ -153,18 +153,18 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
if (y + h > desktopHeight) y = desktopHeight - h;
// Grab the desktop and draw a circle arround the icon:
- QPixmap shot = QPixmap::grabWindow(qt_xrootwin(), x, y, w, h);
- QPainter painter(&shot);
+ TQPixmap shot = TQPixmap::grabWindow(qt_xrootwin(), x, y, w, h);
+ TQPainter painter(&shot);
const int CIRCLE_MARGINS = 6;
const int CIRCLE_WIDTH = 3;
const int SHADOW_OFFSET = 1;
const int IMAGE_BORDER = 1;
int ax = g.x() - x - CIRCLE_MARGINS - 1;
int ay = g.y() - y - CIRCLE_MARGINS - 1;
- painter.setPen( QPen(KApplication::palette().active().dark(), CIRCLE_WIDTH) );
+ painter.setPen( TQPen(KApplication::tqpalette().active().dark(), CIRCLE_WIDTH) );
painter.drawArc(ax + SHADOW_OFFSET, ay + SHADOW_OFFSET,
tw + 2*CIRCLE_MARGINS, th + 2*CIRCLE_MARGINS, 0, 16*360);
- painter.setPen( QPen(Qt::red/*KApplication::palette().active().highlight()*/, CIRCLE_WIDTH) );
+ painter.setPen( TQPen(TQt::red/*KApplication::tqpalette().active().highlight()*/, CIRCLE_WIDTH) );
painter.drawArc(ax, ay, tw + 2*CIRCLE_MARGINS, th + 2*CIRCLE_MARGINS, 0, 16*360);
#if 1
// Draw the pixmap over the screenshot in case a window hide the icon:
@@ -173,20 +173,20 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
painter.end();
// Then, we add a border arround the image to make it more visible:
- QPixmap finalShot(w + 2*IMAGE_BORDER, h + 2*IMAGE_BORDER);
- finalShot.fill(KApplication::palette().active().foreground());
+ TQPixmap finalShot(w + 2*IMAGE_BORDER, h + 2*IMAGE_BORDER);
+ finalShot.fill(KApplication::tqpalette().active().foreground());
painter.begin(&finalShot);
painter.drawPixmap(IMAGE_BORDER, IMAGE_BORDER, shot);
painter.end();
// Associate source to image and show the dialog:
- QMimeSourceFactory::defaultFactory()->setPixmap("systray_shot", finalShot);
- KMessageBox::information(kapp->activeWindow(),
+ TQMimeSourceFactory::defaultFactory()->setPixmap("systray_shot", finalShot);
+ KMessageBox::information(TQT_TQWIDGET(kapp->activeWindow()),
message + "<p><center><img source=\"systray_shot\"></center></p>",
i18n("Docking in System Tray"), "hideOnCloseInfo");
- QMimeSourceFactory::defaultFactory()->setData("systray_shot", 0L);
+ TQMimeSourceFactory::defaultFactory()->setData("systray_shot", 0L);
} else {
- KMessageBox::information(kapp->activeWindow(),
+ KMessageBox::information(TQT_TQWIDGET(kapp->activeWindow()),
message,
i18n("Docking in System Tray"), "hideOnCloseInfo");
}
@@ -194,25 +194,25 @@ void KSystemTray2::displayCloseMessage(QString fileMenu)
/** SystemTray */
-SystemTray::SystemTray(QWidget *parent, const char *name)
- : KSystemTray2(parent, name != 0 ? name : "SystemTray"), m_showTimer(0), m_autoShowTimer(0)
+SystemTray::SystemTray(TQWidget *tqparent, const char *name)
+ : KSystemTray2(tqparent, name != 0 ? name : "SystemTray"), m_showTimer(0), m_autoShowTimer(0)
{
setAcceptDrops(true);
- m_showTimer = new QTimer(this);
- connect( m_showTimer, SIGNAL(timeout()), Global::bnpView, SLOT(setActive()) );
+ m_showTimer = new TQTimer(this);
+ connect( m_showTimer, TQT_SIGNAL(timeout()), Global::bnpView, TQT_SLOT(setActive()) );
- m_autoShowTimer = new QTimer(this);
- connect( m_autoShowTimer, SIGNAL(timeout()), Global::bnpView, SLOT(setActive()) );
+ m_autoShowTimer = new TQTimer(this);
+ connect( m_autoShowTimer, TQT_SIGNAL(timeout()), Global::bnpView, TQT_SLOT(setActive()) );
// Create pixmaps for the icon:
m_iconPixmap = loadIcon("basket");
// FIXME: When main window is shown at start, the icon is loaded 1 pixel too high
// and then reloaded instantly after at the right position.
// setPixmap(m_iconPixmap); // Load it the sooner as possible to avoid flicker
- QImage lockedIconImage = m_iconPixmap.convertToImage();
- QPixmap lockOverlayPixmap = loadIcon("lockoverlay");
- QImage lockOverlayImage = lockOverlayPixmap.convertToImage();
+ TQImage lockedIconImage = m_iconPixmap.convertToImage();
+ TQPixmap lockOverlayPixmap = loadIcon("lockoverlay");
+ TQImage lockOverlayImage = lockOverlayPixmap.convertToImage();
KIconEffect::overlay(lockedIconImage, lockOverlayImage);
m_lockedIconPixmap.convertFromImage(lockedIconImage);
@@ -223,7 +223,7 @@ SystemTray::~SystemTray()
{
}
-void SystemTray::mousePressEvent(QMouseEvent *event)
+void SystemTray::mousePressEvent(TQMouseEvent *event)
{
if (event->button() & Qt::LeftButton) { // Prepare drag
m_pressPos = event->globalPos();
@@ -231,7 +231,7 @@ void SystemTray::mousePressEvent(QMouseEvent *event)
event->accept();
} else if (event->button() & Qt::MidButton) { // Paste
Global::bnpView->currentBasket()->setInsertPopupMenu();
- Global::bnpView->currentBasket()->pasteNote(QClipboard::Selection);
+ Global::bnpView->currentBasket()->pasteNote(TQClipboard::Selection);
Global::bnpView->currentBasket()->cancelInsertPopupMenu();
if (Settings::usePassivePopup())
Global::bnpView->showPassiveDropped(i18n("Pasted selection to basket <i>%1</i>"));
@@ -281,23 +281,23 @@ void SystemTray::mousePressEvent(QMouseEvent *event)
}
Global::bnpView->currentBasket()->setInsertPopupMenu();
- connect( &menu, SIGNAL(aboutToHide()), Global::bnpView->currentBasket(), SLOT(delayedCancelInsertPopupMenu()) );
+ connect( &menu, TQT_SIGNAL(aboutToHide()), Global::bnpView->currentBasket(), TQT_SLOT(delayedCancelInsertPopupMenu()) );
menu.exec(event->globalPos());
event->accept();
} else
event->ignore();
}
-void SystemTray::mouseMoveEvent(QMouseEvent *event)
+void SystemTray::mouseMoveEvent(TQMouseEvent *event)
{
event->ignore();
}
-void SystemTray::mouseReleaseEvent(QMouseEvent *event)
+void SystemTray::mouseReleaseEvent(TQMouseEvent *event)
{
m_canDrag = false;
if (event->button() == Qt::LeftButton) // Show / hide main window
- if ( rect().contains(event->pos()) ) { // Accept only if released in systemTray
+ if ( TQT_TQRECT_OBJECT(rect()).tqcontains(event->pos()) ) { // Accept only if released in systemTray
toggleActive();
emit showPart();
event->accept();
@@ -305,7 +305,7 @@ void SystemTray::mouseReleaseEvent(QMouseEvent *event)
event->ignore();
}
-void SystemTray::dragEnterEvent(QDragEnterEvent *event)
+void SystemTray::dragEnterEvent(TQDragEnterEvent *event)
{
m_showTimer->start( Settings::dropTimeToShow() * 100, true );
Global::bnpView->currentBasket()->showFrameInsertTo();
@@ -313,12 +313,12 @@ void SystemTray::dragEnterEvent(QDragEnterEvent *event)
Basket::acceptDropEvent(event);
}
-void SystemTray::dragMoveEvent(QDragMoveEvent *event)
+void SystemTray::dragMoveEvent(TQDragMoveEvent *event)
{
Basket::acceptDropEvent(event);
}
-void SystemTray::dragLeaveEvent(QDragLeaveEvent*)
+void SystemTray::dragLeaveEvent(TQDragLeaveEvent*)
{
m_showTimer->stop();
m_canDrag = false;
@@ -328,7 +328,7 @@ void SystemTray::dragLeaveEvent(QDragLeaveEvent*)
#include <iostream>
-void SystemTray::dropEvent(QDropEvent *event)
+void SystemTray::dropEvent(TQDropEvent *event)
{
m_showTimer->stop();
@@ -350,10 +350,10 @@ void SystemTray::dropEvent(QDropEvent *event)
/*
* This function copies the entirety of src into dest, starting in
- * dest at x and y. This function exists because I was unable to find
- * a function like it in either QImage or kdefx
+ * dest at x and y. This function exists because I was unable to tqfind
+ * a function like it in either TQImage or kdefx
*/
-static bool copyImage(QImage &dest, QImage &src, int x, int y)
+static bool copyImage(TQImage &dest, TQImage &src, int x, int y)
{
if(dest.depth() != src.depth())
return false;
@@ -365,7 +365,7 @@ static bool copyImage(QImage &dest, QImage &src, int x, int y)
// We want to use KIconEffect::overlay to do this, since it handles
// alpha, but the images need to be the same size. We can handle that.
- QImage large_src(dest);
+ TQImage large_src(dest);
// It would perhaps be better to create large_src based on a size, but
// this is the easiest way to make a new image with the same depth, size,
@@ -405,12 +405,12 @@ void SystemTray::updateToolTip()
setPixmap(basket->isLocked() ? m_lockedIconPixmap : m_iconPixmap);
else {
// Code that comes from JuK:
- QPixmap bgPix = loadIcon("basket");
- QPixmap fgPix = SmallIcon(basket->icon());
+ TQPixmap bgPix = loadIcon("basket");
+ TQPixmap fgPix = SmallIcon(basket->icon());
- QImage bgImage = bgPix.convertToImage(); // Probably 22x22
- QImage fgImage = fgPix.convertToImage(); // Should be 16x16
- QImage lockOverlayImage = loadIcon("lockoverlay").convertToImage();
+ TQImage bgImage = bgPix.convertToImage(); // Probably 22x22
+ TQImage fgImage = fgPix.convertToImage(); // Should be 16x16
+ TQImage lockOverlayImage = loadIcon("lockoverlay").convertToImage();
KIconEffect::semiTransparent(bgImage);
copyImage(bgImage, fgImage, (bgImage.width() - fgImage.width()) / 2,
@@ -422,7 +422,7 @@ void SystemTray::updateToolTip()
setPixmap(bgPix);
}
- //QTimer::singleShot( Container::c_delayTooltipTime, this, SLOT(updateToolTipDelayed()) );
+ //TQTimer::singleShot( Container::c_delayTooltipTime, this, TQT_SLOT(updateToolTipDelayed()) );
// No need to delay: it's be called when notes are changed:
updateToolTipDelayed();
}
@@ -431,14 +431,14 @@ void SystemTray::updateToolTipDelayed()
{
Basket *basket = Global::bnpView->currentBasket();
- QString tip = "<p><nobr>" + ( basket->isLocked() ? kapp->makeStdCaption(i18n("%1 (Locked)"))
+ TQString tip = "<p><nobr>" + ( basket->isLocked() ? kapp->makeStdCaption(i18n("%1 (Locked)"))
: kapp->makeStdCaption( "%1") )
- .arg(Tools::textToHTMLWithoutP(basket->basketName()));
+ .tqarg(Tools::textToHTMLWithoutP(basket->basketName()));
- QToolTip::add(this, tip);
+ TQToolTip::add(this, tip);
}
-void SystemTray::wheelEvent(QWheelEvent *event)
+void SystemTray::wheelEvent(TQWheelEvent *event)
{
if (event->delta() > 0)
Global::bnpView->goToPreviousBasket();
@@ -449,13 +449,13 @@ void SystemTray::wheelEvent(QWheelEvent *event)
Global::bnpView->showPassiveContent();
}
-void SystemTray::enterEvent(QEvent*)
+void SystemTray::enterEvent(TQEvent*)
{
if (Settings::showOnMouseIn())
m_autoShowTimer->start(Settings::timeToShowOnMouseIn() * 100, true );
}
-void SystemTray::leaveEvent(QEvent*)
+void SystemTray::leaveEvent(TQEvent*)
{
m_autoShowTimer->stop();
}
diff --git a/src/systemtray.h b/src/systemtray.h
index d36bd9b..4c97321 100644
--- a/src/systemtray.h
+++ b/src/systemtray.h
@@ -32,8 +32,9 @@ class MainWindow;
class KSystemTray2 : public KSystemTray
{
Q_OBJECT
+ TQ_OBJECT
public:
- KSystemTray2(QWidget *parent = 0, const char *name = 0);
+ KSystemTray2(TQWidget *tqparent = 0, const char *name = 0);
~KSystemTray2();
/**
* Call this method when the user clicked the close button of the window
@@ -44,7 +45,7 @@ class KSystemTray2 : public KSystemTray
*
* @since 3.4
*/
- void displayCloseMessage(QString fileMenu = "");
+ void displayCloseMessage(TQString fileMenu = "");
};
/** This class provide a personalized system tray icon.
@@ -53,20 +54,21 @@ class KSystemTray2 : public KSystemTray
class SystemTray : public KSystemTray2
{
Q_OBJECT
+ TQ_OBJECT
public:
- SystemTray(QWidget *parent = 0, const char *name = 0);
+ SystemTray(TQWidget *tqparent = 0, const char *name = 0);
~SystemTray();
protected:
- void mousePressEvent(QMouseEvent *event);
- void mouseMoveEvent(QMouseEvent *event);
- void mouseReleaseEvent(QMouseEvent *event);
- virtual void dragEnterEvent(QDragEnterEvent *event);
- virtual void dragMoveEvent(QDragMoveEvent* event);
- virtual void dragLeaveEvent(QDragLeaveEvent*);
- virtual void dropEvent(QDropEvent *event);
- void wheelEvent(QWheelEvent *event);
- void enterEvent(QEvent*);
- void leaveEvent(QEvent*);
+ void mousePressEvent(TQMouseEvent *event);
+ void mouseMoveEvent(TQMouseEvent *event);
+ void mouseReleaseEvent(TQMouseEvent *event);
+ virtual void dragEnterEvent(TQDragEnterEvent *event);
+ virtual void dragMoveEvent(TQDragMoveEvent* event);
+ virtual void dragLeaveEvent(TQDragLeaveEvent*);
+ virtual void dropEvent(TQDropEvent *event);
+ void wheelEvent(TQWheelEvent *event);
+ void enterEvent(TQEvent*);
+ void leaveEvent(TQEvent*);
public slots:
void updateToolTip();
protected slots:
@@ -74,12 +76,12 @@ class SystemTray : public KSystemTray2
signals:
void showPart();
private:
- QTimer *m_showTimer;
- QTimer *m_autoShowTimer;
+ TQTimer *m_showTimer;
+ TQTimer *m_autoShowTimer;
bool m_canDrag;
- QPoint m_pressPos;
- QPixmap m_iconPixmap;
- QPixmap m_lockedIconPixmap;
+ TQPoint m_pressPos;
+ TQPixmap m_iconPixmap;
+ TQPixmap m_lockedIconPixmap;
};
#endif // SYSTEMTRAY_H
diff --git a/src/tag.cpp b/src/tag.cpp
index a4ed7e6..0532d37 100644
--- a/src/tag.cpp
+++ b/src/tag.cpp
@@ -21,10 +21,10 @@
#include <kapplication.h>
#include <kstyle.h>
#include <kiconloader.h>
-#include <qpainter.h>
-#include <qfont.h>
-#include <qdom.h>
-#include <qdir.h>
+#include <tqpainter.h>
+#include <tqfont.h>
+#include <tqdom.h>
+#include <tqdir.h>
#include <kglobalsettings.h>
#include <klocale.h>
@@ -40,7 +40,7 @@
/** class State: */
-State::State(const QString &id, Tag *tag)
+State::State(const TQString &id, Tag *tag)
: m_id(id), m_name(), m_emblem(), m_bold(false), m_italic(false), m_underline(false), m_strikeOut(false),
m_textColor(), m_fontName(), m_fontSize(-1), m_backgroundColor(), m_textEquivalent(), m_onAllTextLines(false), m_parentTag(tag)
{
@@ -52,10 +52,10 @@ State::~State()
State* State::nextState(bool cycle /*= true*/)
{
- if (!parentTag())
+ if (!tqparentTag())
return 0;
- List states = parentTag()->states();
+ List states = tqparentTag()->states();
// The tag contains only one state:
if (states.count() == 1)
return 0;
@@ -73,14 +73,14 @@ State* State::nextState(bool cycle /*= true*/)
return 0;
}
-QString State::fullName()
+TQString State::fullName()
{
- if (!parentTag() || parentTag()->states().count() == 1)
- return (name().isEmpty() && parentTag() ? parentTag()->name() : name());
- return QString(i18n("%1: %2")).arg(parentTag()->name(), name());
+ if (!tqparentTag() || tqparentTag()->states().count() == 1)
+ return (name().isEmpty() && tqparentTag() ? tqparentTag()->name() : name());
+ return TQString(i18n("%1: %2")).tqarg(tqparentTag()->name(), name());
}
-QFont State::font(QFont base)
+TQFont State::font(TQFont base)
{
if (bold())
base.setBold(true);
@@ -97,9 +97,9 @@ QFont State::font(QFont base)
return base;
}
-QString State::toCSS(const QString &gradientFolderPath, const QString &gradientFolderName, const QFont &baseFont)
+TQString State::toCSS(const TQString &gradientFolderPath, const TQString &gradientFolderName, const TQFont &baseFont)
{
- QString css;
+ TQString css;
if (bold())
css += " font-weight: bold;";
if (italic())
@@ -113,18 +113,18 @@ QString State::toCSS(const QString &gradientFolderPath, const QString &gradientF
if (textColor().isValid())
css += " color: " + textColor().name() + ";";
if (!fontName().isEmpty()) {
- QString fontFamily = Tools::cssFontDefinition(fontName(), /*onlyFontFamily=*/true);
+ TQString fontFamily = Tools::cssFontDefinition(fontName(), /*onlyFontFamily=*/true);
css += " font-family: " + fontFamily + ";";
}
if (fontSize() > 0)
- css += " font-size: " + QString::number(fontSize()) + "px;";
+ css += " font-size: " + TQString::number(fontSize()) + "px;";
if (backgroundColor().isValid()) {
// Get the colors of the gradient and the border:
- QColor topBgColor;
- QColor bottomBgColor;
+ TQColor topBgColor;
+ TQColor bottomBgColor;
Note::getGradientColors(backgroundColor(), &topBgColor, &bottomBgColor);
// Produce the CSS code:
- QString gradientFileName = Basket::saveGradientBackground(backgroundColor(), font(baseFont), gradientFolderPath);
+ TQString gradientFileName = Basket::saveGradientBackground(backgroundColor(), font(baseFont), gradientFolderPath);
css += " background: " + bottomBgColor.name() + " url('" + gradientFolderName + gradientFileName + "') repeat-x;";
css += " border-top: solid " + topBgColor.name() + " 1px;";
css += " border-bottom: solid " + Tools::mixColor(topBgColor, bottomBgColor).name() + " 1px;";
@@ -136,7 +136,7 @@ QString State::toCSS(const QString &gradientFolderPath, const QString &gradientF
return " .tag_" + id() + " {" + css + " }\n";
}
-void State::merge(const List &states, State *result, int *emblemsCount, bool *haveInvisibleTags, const QColor &backgroundColor)
+void State::merge(const List &states, State *result, int *emblemsCount, bool *haveInvisibleTags, const TQColor &backgroundColor)
{
*result = State(); // Reset to default values.
*emblemsCount = 0;
@@ -222,8 +222,8 @@ Tag::Tag()
{
static int tagNumber = 0;
++tagNumber;
- QString sAction = "tag_shortcut_number_" + QString::number(tagNumber);
- m_action = new KAction("FAKE TEXT", "FAKE ICON", KShortcut(), Global::bnpView, SLOT(activatedTagShortcut()), Global::bnpView->actionCollection(), sAction);
+ TQString sAction = "tag_shortcut_number_" + TQString::number(tagNumber);
+ m_action = new KAction("FAKE TEXT", "FAKE ICON", KShortcut(), TQT_TQOBJECT(Global::bnpView), TQT_SLOT(activatedTagShortcut()), Global::bnpView->actionCollection(), sAction);
m_action->setShortcutConfigurable(false); // We do it in the tag properties dialog
m_inheritedBySiblings = false;
@@ -234,13 +234,13 @@ Tag::~Tag()
delete m_action;
}
-void Tag::setName(const QString &name)
+void Tag::setName(const TQString &name)
{
m_name = name;
m_action->setText("TAG SHORTCUT: " + name); // TODO: i18n (for debug purpose only by now).
}
-State* Tag::stateForId(const QString &id)
+State* Tag::stateForId(const TQString &id)
{
for (List::iterator it = all.begin(); it != all.end(); ++it)
for (State::List::iterator it2 = (*it)->states().begin(); it2 != (*it)->states().end(); ++it2)
@@ -257,15 +257,15 @@ Tag* Tag::tagForKAction(KAction *action)
return 0;
}
-QMap<QString, QString> Tag::loadTags(const QString &path/* = QString()*//*, bool merge = false*/)
+TQMap<TQString, TQString> Tag::loadTags(const TQString &path/* = TQString()*//*, bool merge = false*/)
{
- QMap<QString, QString> mergedStates;
+ TQMap<TQString, TQString> mergedStates;
bool merge = !path.isEmpty();
- QString fullPath = (merge ? path : Global::savesFolder() + "tags.xml");
- QString doctype = "basketTags";
+ TQString fullPath = (merge ? path : Global::savesFolder() + "tags.xml");
+ TQString doctype = "basketTags";
- QDir dir;
+ TQDir dir;
if (!dir.exists(fullPath)) {
if (merge)
return mergedStates;
@@ -273,50 +273,50 @@ QMap<QString, QString> Tag::loadTags(const QString &path/* = QString()*//*, bool
createDefaultTagsSet(fullPath);
}
- QDomDocument *document = XMLWork::openFile(doctype, fullPath);
+ TQDomDocument *document = XMLWork::openFile(doctype, fullPath);
if (!document) {
DEBUG_WIN << "<font color=red>FAILED to read the tags file</font>";
return mergedStates;
}
- QDomElement docElem = document->documentElement();
+ TQDomElement docElem = document->documentElement();
if (!merge)
- nextStateUid = docElem.attribute("nextStateUid", QString::number(nextStateUid)).toLong();
+ nextStateUid = docElem.attribute("nextStateUid", TQString::number(nextStateUid)).toLong();
- QDomNode node = docElem.firstChild();
+ TQDomNode node = docElem.firstChild();
while (!node.isNull()) {
- QDomElement element = node.toElement();
+ TQDomElement element = node.toElement();
if ( (!element.isNull()) && element.tagName() == "tag" ) {
Tag *tag = new Tag();
// Load properties:
- QString name = XMLWork::getElementText(element, "name");
- QString shortcut = XMLWork::getElementText(element, "shortcut");
- QString inherited = XMLWork::getElementText(element, "inherited", "false");
+ TQString name = XMLWork::getElementText(element, "name");
+ TQString shortcut = XMLWork::getElementText(element, "shortcut");
+ TQString inherited = XMLWork::getElementText(element, "inherited", "false");
tag->setName(name);
tag->setShortcut(KShortcut(shortcut));
tag->setInheritedBySiblings(XMLWork::trueOrFalse(inherited));
// Load states:
- QDomNode subNode = element.firstChild();
+ TQDomNode subNode = element.firstChild();
while (!subNode.isNull()) {
- QDomElement subElement = subNode.toElement();
+ TQDomElement subElement = subNode.toElement();
if ( (!subElement.isNull()) && subElement.tagName() == "state" ) {
State *state = new State(subElement.attribute("id"), tag);
state->setName( XMLWork::getElementText(subElement, "name") );
state->setEmblem( XMLWork::getElementText(subElement, "emblem") );
- QDomElement textElement = XMLWork::getElement(subElement, "text");
+ TQDomElement textElement = XMLWork::getElement(subElement, "text");
state->setBold( XMLWork::trueOrFalse(textElement.attribute("bold", "false")) );
state->setItalic( XMLWork::trueOrFalse(textElement.attribute("italic", "false")) );
state->setUnderline( XMLWork::trueOrFalse(textElement.attribute("underline", "false")) );
state->setStrikeOut( XMLWork::trueOrFalse(textElement.attribute("strikeOut", "false")) );
- QString textColor = textElement.attribute("color", "");
- state->setTextColor(textColor.isEmpty() ? QColor() : QColor(textColor));
- QDomElement fontElement = XMLWork::getElement(subElement, "font");
+ TQString textColor = textElement.attribute("color", "");
+ state->setTextColor(textColor.isEmpty() ? TQColor() : TQColor(textColor));
+ TQDomElement fontElement = XMLWork::getElement(subElement, "font");
state->setFontName(fontElement.attribute("name", ""));
- QString fontSize = fontElement.attribute("size", "");
+ TQString fontSize = fontElement.attribute("size", "");
state->setFontSize(fontSize.isEmpty() ? -1 : fontSize.toInt());
- QString backgroundColor = XMLWork::getElementText(subElement, "backgroundColor", "");
- state->setBackgroundColor(backgroundColor.isEmpty() ? QColor() : QColor(backgroundColor));
- QDomElement textEquivalentElement = XMLWork::getElement(subElement, "textEquivalent");
+ TQString backgroundColor = XMLWork::getElementText(subElement, "backgroundColor", "");
+ state->setBackgroundColor(backgroundColor.isEmpty() ? TQColor() : TQColor(backgroundColor));
+ TQDomElement textEquivalentElement = XMLWork::getElement(subElement, "textEquivalent");
state->setTextEquivalent( textEquivalentElement.attribute("string", "") );
state->setOnAllTextLines( XMLWork::trueOrFalse(textEquivalentElement.attribute("onAllTextLines", "false")) );
tag->appendState(state);
@@ -341,8 +341,8 @@ QMap<QString, QString> Tag::loadTags(const QString &path/* = QString()*//*, bool
// We are merging the new states, so we should choose new and unique (on that computer) ids for those states:
for (State::List::iterator it = tag->states().begin(); it != tag->states().end(); ++it) {
State *state = *it;
- QString uid = state->id();
- QString newUid = "tag_state_" + QString::number(getNextStateUid());
+ TQString uid = state->id();
+ TQString newUid = "tag_state_" + TQString::number(getNextStateUid());
state->setId(newUid);
mergedStates[uid] = newUid;
}
@@ -354,8 +354,8 @@ QMap<QString, QString> Tag::loadTags(const QString &path/* = QString()*//*, bool
for (State::List::iterator it = tag->states().begin(); it != tag->states().end(); ++it, ++it2) {
State *state = *it;
State *similarState = *it2;
- QString uid = state->id();
- QString newUid = similarState->id();
+ TQString uid = state->id();
+ TQString newUid = similarState->id();
if (uid != newUid)
mergedStates[uid] = newUid;
}
@@ -422,11 +422,11 @@ void Tag::saveTags()
saveTagsTo(all, Global::savesFolder() + "tags.xml");
}
-void Tag::saveTagsTo(QValueList<Tag*> &list, const QString &fullPath)
+void Tag::saveTagsTo(TQValueList<Tag*> &list, const TQString &fullPath)
{
// Create Document:
- QDomDocument document(/*doctype=*/"basketTags");
- QDomElement root = document.createElement("basketTags");
+ TQDomDocument document(/*doctype=*/"basketTags");
+ TQDomElement root = document.createElement("basketTags");
root.setAttribute("nextStateUid", nextStateUid);
document.appendChild(root);
@@ -434,7 +434,7 @@ void Tag::saveTagsTo(QValueList<Tag*> &list, const QString &fullPath)
for (List::iterator it = list.begin(); it != list.end(); ++it) {
Tag *tag = *it;
// Create tag node:
- QDomElement tagNode = document.createElement("tag");
+ TQDomElement tagNode = document.createElement("tag");
root.appendChild(tagNode);
// Save tag properties:
XMLWork::addElement( document, tagNode, "name", tag->name() );
@@ -444,27 +444,27 @@ void Tag::saveTagsTo(QValueList<Tag*> &list, const QString &fullPath)
for (State::List::iterator it2 = (*it)->states().begin(); it2 != (*it)->states().end(); ++it2) {
State *state = *it2;
// Create state node:
- QDomElement stateNode = document.createElement("state");
+ TQDomElement stateNode = document.createElement("state");
tagNode.appendChild(stateNode);
// Save state properties:
stateNode.setAttribute("id", state->id());
XMLWork::addElement( document, stateNode, "name", state->name() );
XMLWork::addElement( document, stateNode, "emblem", state->emblem() );
- QDomElement textNode = document.createElement("text");
+ TQDomElement textNode = document.createElement("text");
stateNode.appendChild(textNode);
- QString textColor = (state->textColor().isValid() ? state->textColor().name() : "");
+ TQString textColor = (state->textColor().isValid() ? state->textColor().name() : "");
textNode.setAttribute( "bold", XMLWork::trueOrFalse(state->bold()) );
textNode.setAttribute( "italic", XMLWork::trueOrFalse(state->italic()) );
textNode.setAttribute( "underline", XMLWork::trueOrFalse(state->underline()) );
textNode.setAttribute( "strikeOut", XMLWork::trueOrFalse(state->strikeOut()) );
textNode.setAttribute( "color", textColor );
- QDomElement fontNode = document.createElement("font");
+ TQDomElement fontNode = document.createElement("font");
stateNode.appendChild(fontNode);
fontNode.setAttribute( "name", state->fontName() );
fontNode.setAttribute( "size", state->fontSize() );
- QString backgroundColor = (state->backgroundColor().isValid() ? state->backgroundColor().name() : "");
+ TQString backgroundColor = (state->backgroundColor().isValid() ? state->backgroundColor().name() : "");
XMLWork::addElement( document, stateNode, "backgroundColor", backgroundColor );
- QDomElement textEquivalentNode = document.createElement("textEquivalent");
+ TQDomElement textEquivalentNode = document.createElement("textEquivalent");
stateNode.appendChild(textEquivalentNode);
textEquivalentNode.setAttribute( "string", state->textEquivalent() );
textEquivalentNode.setAttribute( "onAllTextLines", XMLWork::trueOrFalse(state->onAllTextLines()) );
@@ -483,9 +483,9 @@ void Tag::copyTo(Tag *other)
other->m_inheritedBySiblings = m_inheritedBySiblings;
}
-void Tag::createDefaultTagsSet(const QString &fullPath)
+void Tag::createDefaultTagsSet(const TQString &fullPath)
{
- QString xml = QString(
+ TQString xml = TQString(
"<!DOCTYPE basketTags>\n"
"<basketTags>\n"
" <tag>\n"
@@ -541,10 +541,10 @@ void Tag::createDefaultTagsSet(const QString &fullPath)
" </state>\n"
" </tag>\n"
"\n")
- .arg( i18n("To Do"), i18n("Unchecked"), i18n("Done") ) // %1 %2 %3
- .arg( i18n("Progress"), i18n("0 %"), i18n("25 %") ) // %4 %5 %6
- .arg( i18n("50 %"), i18n("75 %"), i18n("100 %") ) // %7 %8 %9
- + QString(
+ .tqarg( i18n("To Do"), i18n("Unchecked"), i18n("Done") ) // %1 %2 %3
+ .tqarg( i18n("Progress"), i18n("0 %"), i18n("25 %") ) // %4 %5 %6
+ .tqarg( i18n("50 %"), i18n("75 %"), i18n("100 %") ) // %7 %8 %9
+ + TQString(
" <tag>\n"
" <name>%1</name>\n" // "Priority"
" <shortcut>Ctrl+3</shortcut>\n"
@@ -596,10 +596,10 @@ void Tag::createDefaultTagsSet(const QString &fullPath)
" </state>\n"
" </tag>\n"
"\n")
- .arg( i18n("Priority"), i18n("Low"), i18n("Medium") ) // %1 %2 %3
- .arg( i18n("High"), i18n("Preference"), i18n("Bad") ) // %4 %5 %6
- .arg( i18n("Good"), i18n("Excellent"), i18n("Highlight") ) // %7 %8 %9
- + QString(
+ .tqarg( i18n("Priority"), i18n("Low"), i18n("Medium") ) // %1 %2 %3
+ .tqarg( i18n("High"), i18n("Preference"), i18n("Bad") ) // %4 %5 %6
+ .tqarg( i18n("Good"), i18n("Excellent"), i18n("Highlight") ) // %7 %8 %9
+ + TQString(
" <tag>\n"
" <name>%1</name>\n" // "Important"
" <shortcut>Ctrl+6</shortcut>\n"
@@ -664,10 +664,10 @@ void Tag::createDefaultTagsSet(const QString &fullPath)
" </state>\n"
" </tag>""\n"
"\n")
- .arg( i18n("Important"), i18n("Very Important"), i18n("Information") ) // %1 %2 %3
- .arg( i18n("Idea"), i18n("The initial of 'Idea'", "I."), i18n("Title") ) // %4 %5 %6
- .arg( i18n("Code"), i18n("Work"), i18n("The initial of 'Work'", "W.") ) // %7 %8 %9
- + QString(
+ .tqarg( i18n("Important"), i18n("Very Important"), i18n("Information") ) // %1 %2 %3
+ .tqarg( i18n("Idea"), i18n("The initial of 'Idea'", "I."), i18n("Title") ) // %4 %5 %6
+ .tqarg( i18n("Code"), i18n("Work"), i18n("The initial of 'Work'", "W.") ) // %7 %8 %9
+ + TQString(
" <tag>\n"
" <state id=\"personal\">\n"
" <name>%1</name>\n" // "Personal"
@@ -684,13 +684,13 @@ void Tag::createDefaultTagsSet(const QString &fullPath)
" </tag>\n"
"</basketTags>\n"
"")
- .arg( i18n("Personal"), i18n("The initial of 'Personal'", "P."), i18n("Funny") ); // %1 %2 %3
+ .tqarg( i18n("Personal"), i18n("The initial of 'Personal'", "P."), i18n("Funny") ); // %1 %2 %3
// Write to Disk:
- QFile file(fullPath);
+ TQFile file(fullPath);
if (file.open(IO_WriteOnly)) {
- QTextStream stream(&file);
- stream.setEncoding(QTextStream::UnicodeUTF8);
+ TQTextStream stream(&file);
+ stream.setEncoding(TQTextStream::UnicodeUTF8);
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
stream << xml;
file.close();
@@ -699,18 +699,18 @@ void Tag::createDefaultTagsSet(const QString &fullPath)
}
#include <kapplication.h>
-#include <qrect.h>
-#include <qstyle.h>
-#include <qcheckbox.h>
-#include <qbitmap.h>
+#include <tqrect.h>
+#include <tqstyle.h>
+#include <tqcheckbox.h>
+#include <tqbitmap.h>
#include <kglobalsettings.h>
-#include <qimage.h>
-#include <qradiobutton.h>
+#include <tqimage.h>
+#include <tqradiobutton.h>
#include <kiconeffect.h>
/** class IndentedMenuItem: */
-IndentedMenuItem::IndentedMenuItem(const QString &text, const QString &icon, const QString &shortcut)
+IndentedMenuItem::IndentedMenuItem(const TQString &text, const TQString &icon, const TQString &shortcut)
: m_text(text), m_icon(icon), m_shortcut(shortcut)
{
}
@@ -719,10 +719,10 @@ IndentedMenuItem::~IndentedMenuItem()
{
}
-void IndentedMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h)
+void IndentedMenuItem::paint(TQPainter *painter, const TQColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h)
{
- QPen pen = painter->pen();
- QFont font = painter->font();
+ TQPen pen = painter->pen();
+ TQFont font = painter->font();
int iconSize = KIcon::SizeSmall;
int iconMargin = StateMenuItem::iconMargin();
@@ -736,14 +736,14 @@ void IndentedMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool acti
*/
bool drawingEtchedText = !enabled && !active && painter->pen().color() != cg.mid()/*== cg.foreground()*/;
if (drawingEtchedText) {
- QString styleName = kapp->style().name();
+ TQString styleName = kapp->tqstyle().name();
if (styleName == "plastik" || styleName == "lipstik")
painter->setPen(cg.light());
drawingEtchedText = !enabled && !active && painter->pen().color() != cg.foreground();
} else
drawingEtchedText = !enabled && !active && painter->pen().color() == cg.light();
if (!m_icon.isEmpty() && !drawingEtchedText) {
- QPixmap icon = kapp->iconLoader()->loadIcon(m_icon, KIcon::Small, iconSize,
+ TQPixmap icon = kapp->iconLoader()->loadIcon(m_icon, KIcon::Small, iconSize,
(enabled ? (active ? KIcon::ActiveState : KIcon::DefaultState) : KIcon::DisabledState),
/*path_store=*/0L, /*canReturnNull=*/true);
painter->drawPixmap(x, y + (h-iconSize)/2, icon);
@@ -768,30 +768,30 @@ void IndentedMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool acti
}
}
-QSize IndentedMenuItem::sizeHint()
+TQSize IndentedMenuItem::tqsizeHint()
{
int iconSize = KIcon::SizeSmall;
int iconMargin = StateMenuItem::iconMargin();
- QSize textSize = QFontMetrics(KGlobalSettings::menuFont()).size( AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_text );
- return QSize(iconSize + iconMargin + textSize.width(), textSize.height());
+ TQSize textSize = TQFontMetrics(KGlobalSettings::menuFont()).size( AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_text );
+ return TQSize(iconSize + iconMargin + textSize.width(), textSize.height());
}
/** class StateMenuItem: */
-StateMenuItem::StateMenuItem(State *state, const QString &shortcut, bool withTagName)
+StateMenuItem::StateMenuItem(State *state, const TQString &shortcut, bool withTagName)
: m_state(state), m_shortcut(shortcut)
{
- m_name = (withTagName && m_state->parentTag() ? m_state->parentTag()->name() : m_state->name());
+ m_name = (withTagName && m_state->tqparentTag() ? m_state->tqparentTag()->name() : m_state->name());
}
StateMenuItem::~StateMenuItem()
{
}
-void StateMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h)
+void StateMenuItem::paint(TQPainter *painter, const TQColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h)
{
- QPen pen = painter->pen();
- QFont font = painter->font();
+ TQPen pen = painter->pen();
+ TQFont font = painter->font();
int iconSize = 16; // We use 16 instead of KIcon::SizeSmall (the size of icons in menus) because tags will always be 16*16 icons
@@ -806,14 +806,14 @@ void StateMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool active,
*/
bool drawingEtchedText = !enabled && !active && painter->pen().color() != cg.mid()/*== cg.foreground()*/;
if (drawingEtchedText) {
- QString styleName = kapp->style().name();
+ TQString styleName = kapp->tqstyle().name();
if (styleName == "plastik" || styleName == "lipstik")
painter->setPen(cg.light());
drawingEtchedText = !enabled && !active && painter->pen().color() != cg.foreground();
} else
drawingEtchedText = !enabled && !active && painter->pen().color() == cg.light();
if (!m_state->emblem().isEmpty() && !drawingEtchedText) {
- QPixmap icon = kapp->iconLoader()->loadIcon(m_state->emblem(), KIcon::Small, iconSize,
+ TQPixmap icon = kapp->iconLoader()->loadIcon(m_state->emblem(), KIcon::Small, iconSize,
(enabled ? (active ? KIcon::ActiveState : KIcon::DefaultState) : KIcon::DisabledState),
/*path_store=*/0L, /*canReturnNull=*/true);
painter->drawPixmap(x, y + (h-iconSize)/2, icon);
@@ -841,94 +841,94 @@ void StateMenuItem::paint(QPainter *painter, const QColorGroup &cg, bool active,
}
}
-QSize StateMenuItem::sizeHint()
+TQSize StateMenuItem::tqsizeHint()
{
int iconSize = 16; // We use 16 instead of KIcon::SizeSmall (the size of icons in menus) because tags will always be 16*16 icons
- QFont theFont = m_state->font(KGlobalSettings::menuFont());
- QSize textSize = QFontMetrics(theFont).size( AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_name );
- return QSize(iconSize + iconMargin() + textSize.width(), textSize.height());
+ TQFont theFont = m_state->font(KGlobalSettings::menuFont());
+ TQSize textSize = TQFontMetrics(theFont).size( AlignLeft | AlignVCenter | ShowPrefix | DontClip, m_name );
+ return TQSize(iconSize + iconMargin() + textSize.width(), textSize.height());
}
-QIconSet StateMenuItem::checkBoxIconSet(bool checked, QColorGroup cg)
+TQIconSet StateMenuItem::checkBoxIconSet(bool checked, TQColorGroup cg)
{
- int width = kapp->style().pixelMetric(QStyle::PM_IndicatorWidth, 0);
- int height = kapp->style().pixelMetric(QStyle::PM_IndicatorHeight, 0);
- QRect rect(0, 0, width, height);
+ int width = kapp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorWidth, 0);
+ int height = kapp->tqstyle().tqpixelMetric(TQStyle::PM_IndicatorHeight, 0);
+ TQRect rect(0, 0, width, height);
- QColor menuBackgroundColor = (dynamic_cast<KStyle*>(&(kapp->style())) == NULL ? cg.background() : cg.background().light(103));
+ TQColor menuBackgroundColor = (dynamic_cast<KStyle*>(&(kapp->tqstyle())) == NULL ? TQColor(cg.background()) : cg.background().light(103));
// Enabled, Not hovering
- QPixmap pixmap(width, height);
- pixmap.fill(menuBackgroundColor); // In case the pixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
- QPainter painter(&pixmap);
- int style = QStyle::Style_Enabled | QStyle::Style_Active | (checked ? QStyle::Style_On : QStyle::Style_Off);
- QColor background = cg.color(QColorGroup::Background);
- kapp->style().drawPrimitive(QStyle::PE_Indicator, &painter, rect, cg, style);
+ TQPixmap pixmap(width, height);
+ pixmap.fill(menuBackgroundColor); // In case the tqpixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
+ TQPainter painter(&pixmap);
+ int style = TQStyle::Style_Enabled | TQStyle::Style_Active | (checked ? TQStyle::Style_On : TQStyle::Style_Off);
+ TQColor background = cg.color(TQColorGroup::Background);
+ kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_Indicator, &painter, rect, cg, style);
painter.end();
// Enabled, Hovering
- QPixmap pixmapHover(width, height);
- pixmapHover.fill(menuBackgroundColor); // In case the pixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
+ TQPixmap pixmapHover(width, height);
+ pixmapHover.fill(menuBackgroundColor); // In case the tqpixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
painter.begin(&pixmapHover);
- style |= QStyle::Style_MouseOver;
- cg.setColor(QColorGroup::Background, KGlobalSettings::highlightColor());
- kapp->style().drawPrimitive(QStyle::PE_Indicator, &painter, rect, cg, style);
+ style |= TQStyle::Style_MouseOver;
+ cg.setColor(TQColorGroup::Background, KGlobalSettings::highlightColor());
+ kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_Indicator, &painter, rect, cg, style);
painter.end();
// Disabled
- QPixmap pixmapDisabled(width, height);
- pixmapDisabled.fill(menuBackgroundColor); // In case the pixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
+ TQPixmap pixmapDisabled(width, height);
+ pixmapDisabled.fill(menuBackgroundColor); // In case the tqpixelMetric() haven't returned a bigger rectangle than what drawPrimitive() draws
painter.begin(&pixmapDisabled);
- style = /*QStyle::Style_Enabled | */QStyle::Style_Active | (checked ? QStyle::Style_On : QStyle::Style_Off);
- cg.setColor(QColorGroup::Background, background);
- kapp->style().drawPrimitive(QStyle::PE_Indicator, &painter, rect, cg, style);
+ style = /*TQStyle::Style_Enabled | */TQStyle::Style_Active | (checked ? TQStyle::Style_On : TQStyle::Style_Off);
+ cg.setColor(TQColorGroup::Background, background);
+ kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_Indicator, &painter, rect, cg, style);
painter.end();
- QIconSet iconSet(pixmap);
- iconSet.setPixmap(pixmapHover, QIconSet::Automatic, QIconSet::Active);
- iconSet.setPixmap(pixmapDisabled, QIconSet::Automatic, QIconSet::Disabled);
+ TQIconSet iconSet(pixmap);
+ iconSet.setPixmap(pixmapHover, TQIconSet::Automatic, TQIconSet::Active);
+ iconSet.setPixmap(pixmapDisabled, TQIconSet::Automatic, TQIconSet::Disabled);
return iconSet;
}
-QIconSet StateMenuItem::radioButtonIconSet(bool checked, QColorGroup cg)
+TQIconSet StateMenuItem::radioButtonIconSet(bool checked, TQColorGroup cg)
{
- int width = kapp->style().pixelMetric(QStyle::PM_ExclusiveIndicatorWidth, 0);
- int height = kapp->style().pixelMetric(QStyle::PM_ExclusiveIndicatorHeight, 0);
- QRect rect(0, 0, width, height);
+ int width = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ExclusiveIndicatorWidth, 0);
+ int height = kapp->tqstyle().tqpixelMetric(TQStyle::PM_ExclusiveIndicatorHeight, 0);
+ TQRect rect(0, 0, width, height);
- int style = QStyle::Style_Default | QStyle::Style_Enabled | (checked ? QStyle::Style_On : QStyle::Style_Off);
+ int style = TQStyle::Style_Default | TQStyle::Style_Enabled | (checked ? TQStyle::Style_On : TQStyle::Style_Off);
- QPixmap pixmap(width, height);
- pixmap.fill(Qt::red);
- QPainter painter(&pixmap);
+ TQPixmap pixmap(width, height);
+ pixmap.fill(TQt::red);
+ TQPainter painter(&pixmap);
/* We can't use that line of code (like for checkboxes):
- * //kapp->style().drawPrimitive(QStyle::PE_ExclusiveIndicator, &painter, rect, cg, style);
- * because Plastik (and derived styles) don't care of the QStyle::Style_On flag and will ALWAYS draw an unchecked radiobutton.
+ * //kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_ExclusiveIndicator, &painter, rect, cg, style);
+ * because Plastik (and derived styles) don't care of the TQStyle::Style_On flag and will ALWAYS draw an unchecked radiobutton.
* So, we use another method:
*/
- QRadioButton rb(0);
+ TQRadioButton rb(0);
rb.setChecked(checked);
- kapp->style().drawControl(QStyle::CE_RadioButton, &painter, &rb, rect, cg, style);
+ kapp->tqstyle().tqdrawControl(TQStyle::CE_RadioButton, &painter, &rb, rect, cg, style);
painter.end();
- /* Some styles like Plastik (and derived ones) have QStyle::PE_ExclusiveIndicator drawing a radiobutton disc, as wanted,
- * and leave pixels ouside it untouched, BUT QStyle::PE_ExclusiveIndicatorMask is a fully black square.
- * So, we can't apply the mask to make the radiobutton circle transparent outside.
- * We're using an hack by filling the pixmap in Qt::red, drawing the radiobutton and then creating an heuristic mask.
- * The heuristic mask is created using the 4 edge pixels (that are red) and by making transparent every pixels that are of this color:
+ /* Some styles like Plastik (and derived ones) have TQStyle::PE_ExclusiveIndicator drawing a radiobutton disc, as wanted,
+ * and leave pixels ouside it untouched, BUT TQStyle::PE_ExclusiveIndicatorMask is a fully black square.
+ * So, we can't apply the tqmask to make the radiobutton circle transparent outside.
+ * We're using an hack by filling the pixmap in TQt::red, drawing the radiobutton and then creating an heuristic tqmask.
+ * The heuristic tqmask is created using the 4 edge pixels (that are red) and by making transparent every pixels that are of this color:
*/
pixmap.setMask(pixmap.createHeuristicMask());
- QPixmap pixmapHover(width, height);
- pixmapHover.fill(Qt::red);
+ TQPixmap pixmapHover(width, height);
+ pixmapHover.fill(TQt::red);
painter.begin(&pixmapHover);
- //kapp->style().drawPrimitive(QStyle::PE_ExclusiveIndicator, &painter, rect, cg, style);
- style |= QStyle::Style_MouseOver;
- cg.setColor(QColorGroup::Background, KGlobalSettings::highlightColor());
- kapp->style().drawControl(QStyle::CE_RadioButton, &painter, &rb, rect, cg, style);
+ //kapp->tqstyle().tqdrawPrimitive(TQStyle::PE_ExclusiveIndicator, &painter, rect, cg, style);
+ style |= TQStyle::Style_MouseOver;
+ cg.setColor(TQColorGroup::Background, KGlobalSettings::highlightColor());
+ kapp->tqstyle().tqdrawControl(TQStyle::CE_RadioButton, &painter, &rb, rect, cg, style);
painter.end();
pixmapHover.setMask(pixmapHover.createHeuristicMask());
- QIconSet iconSet(pixmap);
- iconSet.setPixmap(pixmapHover, QIconSet::Automatic, QIconSet::Active);
+ TQIconSet iconSet(pixmap);
+ iconSet.setPixmap(pixmapHover, TQIconSet::Automatic, TQIconSet::Active);
return iconSet;
}
diff --git a/src/tag.h b/src/tag.h
index 687e9d5..b1cc495 100644
--- a/src/tag.h
+++ b/src/tag.h
@@ -21,15 +21,15 @@
#ifndef TAG_H
#define TAG_H
-#include <qstring.h>
-#include <qcolor.h>
-#include <qfont.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqcolor.h>
+#include <tqfont.h>
+#include <tqvaluelist.h>
#include <kaction.h>
#include <kshortcut.h>
-class QPainter;
+class TQPainter;
class Tag;
@@ -40,63 +40,63 @@ class State
{
public:
/// LIST OF STATES:
- typedef QValueList<State*> List;
+ typedef TQValueList<State*> List;
public:
/// CONSTRUCTOR AND DESTRUCTOR:
- State(const QString &id = QString(), Tag *tag = 0);
+ State(const TQString &id = TQString(), Tag *tag = 0);
~State();
/// SET PROPERTIES:
- void setId(const QString &id) { m_id = id; }
- void setName(const QString &name) { m_name = name; }
- void setEmblem(const QString &emblem) { m_emblem = emblem; }
+ void setId(const TQString &id) { m_id = id; }
+ void setName(const TQString &name) { m_name = name; }
+ void setEmblem(const TQString &emblem) { m_emblem = emblem; }
void setBold(bool bold) { m_bold = bold; }
void setItalic(bool italic) { m_italic = italic; }
void setUnderline(bool underline) { m_underline = underline; }
void setStrikeOut(bool strikeOut) { m_strikeOut = strikeOut; }
- void setTextColor(const QColor &color) { m_textColor = color; }
- void setFontName(const QString &font) { m_fontName = font; }
+ void setTextColor(const TQColor &color) { m_textColor = color; }
+ void setFontName(const TQString &font) { m_fontName = font; }
void setFontSize(int size) { m_fontSize = size; }
- void setBackgroundColor(const QColor &color) { m_backgroundColor = color; }
- void setTextEquivalent(const QString &text) { m_textEquivalent = text; }
+ void setBackgroundColor(const TQColor &color) { m_backgroundColor = color; }
+ void setTextEquivalent(const TQString &text) { m_textEquivalent = text; }
void setOnAllTextLines(bool yes) { m_onAllTextLines = yes; }
void setParentTag(Tag *tag) { m_parentTag = tag; }
/// GET PROPERTIES:
- QString id() const { return m_id; }
- QString name() const { return m_name; }
- QString emblem() const { return m_emblem; }
+ TQString id() const { return m_id; }
+ TQString name() const { return m_name; }
+ TQString emblem() const { return m_emblem; }
bool bold() const { return m_bold; }
bool italic() const { return m_italic; }
bool underline() const { return m_underline; }
bool strikeOut() const { return m_strikeOut; }
- QColor textColor() const { return m_textColor; }
- QString fontName() const { return m_fontName; }
+ TQColor textColor() const { return m_textColor; }
+ TQString fontName() const { return m_fontName; }
int fontSize() const { return m_fontSize; }
- QColor backgroundColor() const { return m_backgroundColor; }
- QString textEquivalent() const { return m_textEquivalent; }
+ TQColor backgroundColor() const { return m_backgroundColor; }
+ TQString textEquivalent() const { return m_textEquivalent; }
bool onAllTextLines() const { return m_onAllTextLines; }
- Tag* parentTag() const { return m_parentTag; }
+ Tag* tqparentTag() const { return m_parentTag; }
/// HELPING FUNCTIONS:
State *nextState(bool cycle = true);
- QString fullName();
- QFont font(QFont base);
- QString toCSS(const QString &gradientFolderPath, const QString &gradientFolderName, const QFont &baseFont);
- static void merge(const List &states, State *result, int *emblemsCount, bool *haveInvisibleTags, const QColor &backgroundColor);
+ TQString fullName();
+ TQFont font(TQFont base);
+ TQString toCSS(const TQString &gradientFolderPath, const TQString &gradientFolderName, const TQFont &baseFont);
+ static void merge(const List &states, State *result, int *emblemsCount, bool *haveInvisibleTags, const TQColor &backgroundColor);
void copyTo(State *other);
private:
/// PROPERTIES:
- QString m_id;
- QString m_name;
- QString m_emblem;
+ TQString m_id;
+ TQString m_name;
+ TQString m_emblem;
bool m_bold;
bool m_italic;
bool m_underline;
bool m_strikeOut;
- QColor m_textColor;
- QString m_fontName;
+ TQColor m_textColor;
+ TQString m_fontName;
int m_fontSize;
- QColor m_backgroundColor;
- QString m_textEquivalent;
+ TQColor m_backgroundColor;
+ TQString m_textEquivalent;
bool m_onAllTextLines;
Tag *m_parentTag;
};
@@ -110,31 +110,31 @@ class Tag
{
public:
/// LIST OF ALL TAGS IN THE APPLICATION:
- typedef QValueList<Tag*> List;
+ typedef TQValueList<Tag*> List;
static Tag::List all;
- static State* stateForId(const QString &id);
+ static State* stateForId(const TQString &id);
static Tag* tagForKAction(KAction *action);
static Tag* tagSimilarTo(Tag *tagToTest);
- static QMap<QString, QString> loadTags(const QString &path = QString()/*, bool merge = false*/); /// << Load the tags contained in the XML file @p path or those in the application settings if @p path isEmpty(). If @p merge is true and a tag with the id of a tag that should be loaded already exist, the tag will get a new id. Otherwise, the tag will be dismissed.
+ static TQMap<TQString, TQString> loadTags(const TQString &path = TQString()/*, bool merge = false*/); /// << Load the tags contained in the XML file @p path or those in the application settings if @p path isEmpty(). If @p merge is true and a tag with the id of a tag that should be loaded already exist, the tag will get a new id. Otherwise, the tag will be dismissed.
static void saveTags();
- static void saveTagsTo(QValueList<Tag*> &list, const QString &fullPath);
- static void createDefaultTagsSet(const QString &file);
+ static void saveTagsTo(TQValueList<Tag*> &list, const TQString &fullPath);
+ static void createDefaultTagsSet(const TQString &file);
static long getNextStateUid();
private:
static long nextStateUid;
public:
/// CONSTRUCTOR AND DESTRUCTOR:
- Tag(/*State *firstState, const QString &name, bool inheritedBySiblings*/);
+ Tag(/*State *firstState, const TQString &name, bool inheritedBySiblings*/);
~Tag();
/// SET PROPERTIES:
- void setName(const QString &name);
+ void setName(const TQString &name);
void setShortcut(const KShortcut &shortcut) { m_action->setShortcut(shortcut); }
void setInheritedBySiblings(bool inherited) { m_inheritedBySiblings = inherited; }
void appendState(State *state) { m_states.append(state); state->setParentTag(this); }
void removeState(State *state) { m_states.remove(state); state->setParentTag(0); }
/// GET PROPERTIES:
- QString name() const { return m_name; }
+ TQString name() const { return m_name; }
KShortcut shortcut() const { return m_action->shortcut(); }
bool inheritedBySiblings() const { return m_inheritedBySiblings; }
State::List& states() const { return (State::List&)m_states; }
@@ -142,17 +142,17 @@ class Tag
void copyTo(Tag *other);
private:
/// PROPERTIES:
- QString m_name;
+ TQString m_name;
KAction *m_action;
bool m_inheritedBySiblings;
State::List m_states;
};
-#include <qiconset.h>
-#include <qmenudata.h>
-#include <qstring.h>
+#include <tqiconset.h>
+#include <tqmenudata.h>
+#include <tqstring.h>
-class QPainter;
+class TQPainter;
/** A menu item to indent icon and text (to keep place for a checkbox or a radiobutton on left).
* You should not set any icon when adding this entry to the menu.
@@ -160,38 +160,38 @@ class QPainter;
* Better suited to be used with StateMenuItem (or TagMenuItem).
* @author S�astien Laot
*/
-class IndentedMenuItem : public QCustomMenuItem
+class IndentedMenuItem : public TQCustomMenuItem
{
public:
- IndentedMenuItem(const QString &text, const QString &icon = "", const QString &shortcut = "");
+ IndentedMenuItem(const TQString &text, const TQString &icon = "", const TQString &shortcut = "");
~IndentedMenuItem();
- void paint(QPainter *painter, const QColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h);
- QSize sizeHint();
+ void paint(TQPainter *painter, const TQColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h);
+ TQSize tqsizeHint();
bool fullSpan() { return true; }
private:
- QString m_text;
- QString m_icon;
- QString m_shortcut;
+ TQString m_text;
+ TQString m_icon;
+ TQString m_shortcut;
};
/** A menu item representing a State or a Tag.
* @author S�astien Laot
*/
-class StateMenuItem : public QCustomMenuItem
+class StateMenuItem : public TQCustomMenuItem
{
public:
- StateMenuItem(State *state, const QString &shortcut, bool withTagName = false);
+ StateMenuItem(State *state, const TQString &shortcut, bool withTagName = false);
~StateMenuItem();
- void paint(QPainter *painter, const QColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h);
- QSize sizeHint();
+ void paint(TQPainter *painter, const TQColorGroup &cg, bool active, bool enabled, int x, int y, int w, int h);
+ TQSize tqsizeHint();
bool fullSpan() { return true; }
private:
State *m_state;
- QString m_name;
- QString m_shortcut;
+ TQString m_name;
+ TQString m_shortcut;
public:
- static QIconSet checkBoxIconSet(bool checked, QColorGroup cg);
- static QIconSet radioButtonIconSet(bool checked, QColorGroup cg);
+ static TQIconSet checkBoxIconSet(bool checked, TQColorGroup cg);
+ static TQIconSet radioButtonIconSet(bool checked, TQColorGroup cg);
static int iconMargin() { return 5; }
};
diff --git a/src/tagsedit.cpp b/src/tagsedit.cpp
index c327758..e4c6863 100644
--- a/src/tagsedit.cpp
+++ b/src/tagsedit.cpp
@@ -18,29 +18,29 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qtooltip.h>
-#include <qlabel.h>
-#include <qlineedit.h>
+#include <tqtooltip.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
#include <kfontcombo.h>
-#include <qlayout.h>
+#include <tqlayout.h>
#include <kkeybutton.h>
#include <kicondialog.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <kglobalsettings.h>
-#include <qcheckbox.h>
+#include <tqcheckbox.h>
#include <kpushbutton.h>
-#include <qgroupbox.h>
-#include <qheader.h>
-#include <qvaluelist.h>
+#include <tqgroupbox.h>
+#include <tqheader.h>
+#include <tqvaluelist.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kseparator.h>
#include <kstringhandler.h>
-#include <qpainter.h>
-#include <qaction.h>
+#include <tqpainter.h>
+#include <tqaction.h>
#include <kmessagebox.h>
-#include <qtimer.h>
+#include <tqtimer.h>
#include <iostream>
@@ -100,52 +100,52 @@ bool TagCopy::isMultiState()
/** class TagListViewItem: */
-TagListViewItem::TagListViewItem(QListView *parent, TagCopy *tagCopy)
- : QListViewItem(parent), m_tagCopy(tagCopy), m_stateCopy(0)
+TagListViewItem::TagListViewItem(TQListView *tqparent, TagCopy *tagCopy)
+ : TQListViewItem(tqparent), m_tagCopy(tagCopy), m_stateCopy(0)
{
setText(0, tagCopy->newTag->name());
}
-TagListViewItem::TagListViewItem(QListViewItem *parent, TagCopy *tagCopy)
- : QListViewItem(parent), m_tagCopy(tagCopy), m_stateCopy(0)
+TagListViewItem::TagListViewItem(TQListViewItem *tqparent, TagCopy *tagCopy)
+ : TQListViewItem(tqparent), m_tagCopy(tagCopy), m_stateCopy(0)
{
setText(0, tagCopy->newTag->name());
}
-TagListViewItem::TagListViewItem(QListView *parent, QListViewItem *after, TagCopy *tagCopy)
- : QListViewItem(parent, after), m_tagCopy(tagCopy), m_stateCopy(0)
+TagListViewItem::TagListViewItem(TQListView *tqparent, TQListViewItem *after, TagCopy *tagCopy)
+ : TQListViewItem(tqparent, after), m_tagCopy(tagCopy), m_stateCopy(0)
{
setText(0, tagCopy->newTag->name());
}
-TagListViewItem::TagListViewItem(QListViewItem *parent, QListViewItem *after, TagCopy *tagCopy)
- : QListViewItem(parent, after), m_tagCopy(tagCopy), m_stateCopy(0)
+TagListViewItem::TagListViewItem(TQListViewItem *tqparent, TQListViewItem *after, TagCopy *tagCopy)
+ : TQListViewItem(tqparent, after), m_tagCopy(tagCopy), m_stateCopy(0)
{
setText(0, tagCopy->newTag->name());
}
/* */
-TagListViewItem::TagListViewItem(QListView *parent, StateCopy *stateCopy)
- : QListViewItem(parent), m_tagCopy(0), m_stateCopy(stateCopy)
+TagListViewItem::TagListViewItem(TQListView *tqparent, StateCopy *stateCopy)
+ : TQListViewItem(tqparent), m_tagCopy(0), m_stateCopy(stateCopy)
{
setText(0, stateCopy->newState->name());
}
-TagListViewItem::TagListViewItem(QListViewItem *parent, StateCopy *stateCopy)
- : QListViewItem(parent), m_tagCopy(0), m_stateCopy(stateCopy)
+TagListViewItem::TagListViewItem(TQListViewItem *tqparent, StateCopy *stateCopy)
+ : TQListViewItem(tqparent), m_tagCopy(0), m_stateCopy(stateCopy)
{
setText(0, stateCopy->newState->name());
}
-TagListViewItem::TagListViewItem(QListView *parent, QListViewItem *after, StateCopy *stateCopy)
- : QListViewItem(parent, after), m_tagCopy(0), m_stateCopy(stateCopy)
+TagListViewItem::TagListViewItem(TQListView *tqparent, TQListViewItem *after, StateCopy *stateCopy)
+ : TQListViewItem(tqparent, after), m_tagCopy(0), m_stateCopy(stateCopy)
{
setText(0, stateCopy->newState->name());
}
-TagListViewItem::TagListViewItem(QListViewItem *parent, QListViewItem *after, StateCopy *stateCopy)
- : QListViewItem(parent, after), m_tagCopy(0), m_stateCopy(stateCopy)
+TagListViewItem::TagListViewItem(TQListViewItem *tqparent, TQListViewItem *after, StateCopy *stateCopy)
+ : TQListViewItem(tqparent, after), m_tagCopy(0), m_stateCopy(stateCopy)
{
setText(0, stateCopy->newState->name());
}
@@ -184,66 +184,66 @@ TagListViewItem* TagListViewItem::prevSibling()
return 0;
}
-TagListViewItem* TagListViewItem::parent() const
+TagListViewItem* TagListViewItem::tqparent() const
{
- return (TagListViewItem*) QListViewItem::parent();
+ return (TagListViewItem*) TQListViewItem::tqparent();
}
// TODO: TagListViewItem::
int TAG_ICON_SIZE = 16;
int TAG_MARGIN = 1;
-int TagListViewItem::width(const QFontMetrics &/* fontMetrics */, const QListView */*listView*/, int /* column */) const
+int TagListViewItem::width(const TQFontMetrics &/* fontMetrics */, const TQListView */*listView*/, int /* column */) const
{
return listView()->visibleWidth();
}
void TagListViewItem::setup()
{
- QString text = (m_tagCopy ? m_tagCopy->newTag->name() : m_stateCopy->newState->name());
+ TQString text = (m_tagCopy ? m_tagCopy->newTag->name() : m_stateCopy->newState->name());
State *state = (m_tagCopy ? m_tagCopy->stateCopies[0]->newState : m_stateCopy->newState);
if (m_tagCopy && !m_tagCopy->newTag->shortcut().isNull())
- text = i18n("Tag name (shortcut)", "%1 (%2)").arg(text, m_tagCopy->newTag->shortcut().toString());
+ text = i18n("Tag name (shortcut)", "%1 (%2)").tqarg(text, m_tagCopy->newTag->shortcut().toString());
- QFont font = state->font(listView()->font());
+ TQFont font = state->font(listView()->font());
- QRect textRect = QFontMetrics(font).boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop, text);
+ TQRect textRect = TQFontMetrics(font).boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop, text);
widthChanged();
- int height = TAG_MARGIN + QMAX(TAG_ICON_SIZE, textRect.height()) + TAG_MARGIN;
+ int height = TAG_MARGIN + TQMAX(TAG_ICON_SIZE, textRect.height()) + TAG_MARGIN;
setHeight(height);
- repaint();
+ tqrepaint();
}
-void TagListViewItem::paintCell(QPainter *painter, const QColorGroup &/*colorGroup*/, int /*column*/, int width, int /*align*/)
+void TagListViewItem::paintCell(TQPainter *painter, const TQColorGroup &/*tqcolorGroup*/, int /*column*/, int width, int /*align*/)
{
bool withIcon = m_stateCopy || (m_tagCopy && !m_tagCopy->isMultiState());
- QString text = (m_tagCopy ? m_tagCopy->newTag->name() : m_stateCopy->newState->name());
+ TQString text = (m_tagCopy ? m_tagCopy->newTag->name() : m_stateCopy->newState->name());
State *state = (m_tagCopy ? m_tagCopy->stateCopies[0]->newState : m_stateCopy->newState);
if (m_tagCopy && !m_tagCopy->newTag->shortcut().isNull())
- text = i18n("Tag name (shortcut)", "%1 (%2)").arg(text, m_tagCopy->newTag->shortcut().toString());
+ text = i18n("Tag name (shortcut)", "%1 (%2)").tqarg(text, m_tagCopy->newTag->shortcut().toString());
- QFont font = (withIcon ? state->font(listView()->font()) : listView()->font());
+ TQFont font = (withIcon ? state->font(listView()->font()) : listView()->font());
- QFontMetrics fontMetrics(font);
- QRect textRect = fontMetrics.boundingRect(0, 0, /*width=*/1, 500000, Qt::AlignAuto | Qt::AlignTop, text);
+ TQFontMetrics fontMetrics(font);
+ TQRect textRect = fontMetrics.boundingRect(0, 0, /*width=*/1, 500000, TQt::AlignAuto | TQt::AlignTop, text);
- QPixmap emblem = (withIcon ? kapp->iconLoader()->loadIcon(state->emblem(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true) : QPixmap());
+ TQPixmap emblem = (withIcon ? kapp->iconLoader()->loadIcon(state->emblem(), KIcon::NoGroup, 16, KIcon::DefaultState, 0L, /*canReturnNull=*/true) : TQPixmap());
- QColor backgroundColor = (isSelected() ? KGlobalSettings::highlightColor()
+ TQColor backgroundColor = (isSelected() ? KGlobalSettings::highlightColor()
: (withIcon && state->backgroundColor().isValid() ? state->backgroundColor()
: listView()->paletteBackgroundColor()));
- QColor textColor = (isSelected() ? KGlobalSettings::highlightedTextColor()
+ TQColor textColor = (isSelected() ? KGlobalSettings::highlightedTextColor()
: (withIcon && state->textColor().isValid() ? state->textColor()
: listView()->paletteForegroundColor()));
// Bufferize the drawing of items (otherwize, resizing the splitter make the tree act like a Christmas Tree ;-D ):
- QPixmap theBuffer(width, height());
+ TQPixmap theBuffer(width, height());
theBuffer.fill(backgroundColor);
- QPainter thePainter(&theBuffer);
+ TQPainter thePainter(&theBuffer);
if (withIcon)
thePainter.drawPixmap(TAG_MARGIN, (height() - emblem.height()) / 2, emblem);
@@ -254,7 +254,7 @@ void TagListViewItem::paintCell(QPainter *painter, const QColorGroup &/*colorGro
int textWidth = width - xText;
if (thePainter.fontMetrics().width(text) > textWidth)
text = KStringHandler::rPixelSqueeze(text, fontMetrics, textWidth);
- thePainter.drawText(xText, 0, textWidth, height(), Qt::AlignAuto | Qt::AlignVCenter | Qt::ShowPrefix, text);
+ thePainter.drawText(xText, 0, textWidth, height(), TQt::AlignAuto | TQt::AlignVCenter | TQt::ShowPrefix, text);
// Apply the buffer:
thePainter.end();
@@ -263,8 +263,8 @@ void TagListViewItem::paintCell(QPainter *painter, const QColorGroup &/*colorGro
/** class TagListView: */
-TagListView::TagListView(QWidget *parent, const char *name, WFlags flags)
- : QListView(parent, name, flags)
+TagListView::TagListView(TQWidget *tqparent, const char *name, WFlags flags)
+ : TQListView(tqparent, name, flags)
{
}
@@ -272,16 +272,16 @@ TagListView::~TagListView()
{
}
-void TagListView::keyPressEvent(QKeyEvent *event)
+void TagListView::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Delete)
+ if (event->key() == TQt::Key_Delete)
emit deletePressed();
- else if (event->key() != Qt::Key_Left || (selectedItem() && selectedItem()->parent()))
+ else if (event->key() != TQt::Key_Left || (selectedItem() && selectedItem()->tqparent()))
// Do not allow to open/close first-level items
- QListView::keyPressEvent(event);
+ TQListView::keyPressEvent(event);
}
-void TagListView::contentsMouseDoubleClickEvent(QMouseEvent *event)
+void TagListView::contentsMouseDoubleClickEvent(TQMouseEvent *event)
{
// Ignore this event! Do not open/close first-level items!
@@ -290,103 +290,103 @@ void TagListView::contentsMouseDoubleClickEvent(QMouseEvent *event)
emit doubleClickedItem();
}
-void TagListView::contentsMousePressEvent(QMouseEvent *event)
+void TagListView::contentsMousePressEvent(TQMouseEvent *event)
{
- // When clicking on an empty space, QListView would unselect the current item! We forbid that!
+ // When clicking on an empty space, TQListView would unselect the current item! We forbid that!
if (itemAt(contentsToViewport(event->pos())) != 0)
- QListView::contentsMousePressEvent(event);
+ TQListView::contentsMousePressEvent(event);
}
-void TagListView::contentsMouseReleaseEvent(QMouseEvent *event)
+void TagListView::contentsMouseReleaseEvent(TQMouseEvent *event)
{
- // When clicking on an empty space, QListView would unselect the current item! We forbid that!
+ // When clicking on an empty space, TQListView would unselect the current item! We forbid that!
if (itemAt(contentsToViewport(event->pos())) != 0)
- QListView::contentsMouseReleaseEvent(event);
+ TQListView::contentsMouseReleaseEvent(event);
}
TagListViewItem* TagListView::currentItem() const
{
- return (TagListViewItem*) QListView::currentItem();
+ return (TagListViewItem*) TQListView::currentItem();
}
TagListViewItem* TagListView::firstChild() const
{
- return (TagListViewItem*) QListView::firstChild();
+ return (TagListViewItem*) TQListView::firstChild();
}
TagListViewItem* TagListView::lastItem() const
{
- return (TagListViewItem*) QListView::lastItem();
+ return (TagListViewItem*) TQListView::lastItem();
}
/** class TagsEditDialog: */
-TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewTag)
+TagsEditDialog::TagsEditDialog(TQWidget *tqparent, State *stateToEdit, bool addNewTag)
: KDialogBase(KDialogBase::Plain, i18n("Customize Tags"), KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/"CustomizeTags", /*modal=*/true, /*separator=*/true),
+ KDialogBase::Ok, tqparent, /*name=*/"CustomizeTags", /*modal=*/true, /*separator=*/true),
m_loading(false)
{
- QHBoxLayout *layout = new QHBoxLayout(plainPage(), /*margin=*/0, spacingHint());
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(plainPage(), /*margin=*/0, spacingHint());
/* Left part: */
- QPushButton *newTag = new QPushButton(i18n("Ne&w Tag"), plainPage());
- QPushButton *newState = new QPushButton(i18n("New St&ate"), plainPage());
+ TQPushButton *newTag = new TQPushButton(i18n("Ne&w Tag"), plainPage());
+ TQPushButton *newState = new TQPushButton(i18n("New St&ate"), plainPage());
- connect( newTag, SIGNAL(clicked()), this, SLOT(newTag()) );
- connect( newState, SIGNAL(clicked()), this, SLOT(newState()) );
+ connect( newTag, TQT_SIGNAL(clicked()), this, TQT_SLOT(newTag()) );
+ connect( newState, TQT_SIGNAL(clicked()), this, TQT_SLOT(newState()) );
m_tags = new TagListView(plainPage());
m_tags->header()->hide();
m_tags->setRootIsDecorated(false);
m_tags->addColumn("");
m_tags->setSorting(-1); // Sort column -1, so disabled sorting
- m_tags->setResizeMode(QListView::LastColumn);
+ m_tags->setResizeMode(TQListView::LastColumn);
m_moveUp = new KPushButton( KGuiItem("", "1uparrow"), plainPage() );
m_moveDown = new KPushButton( KGuiItem("", "1downarrow"), plainPage() );
m_deleteTag = new KPushButton( KGuiItem("", "editdelete"), plainPage() );
- QToolTip::add( m_moveUp, i18n("Move Up (Ctrl+Shift+Up)") );
- QToolTip::add( m_moveDown, i18n("Move Down (Ctrl+Shift+Down)") );
- QToolTip::add( m_deleteTag, i18n("Delete") );
+ TQToolTip::add( m_moveUp, i18n("Move Up (Ctrl+Shift+Up)") );
+ TQToolTip::add( m_moveDown, i18n("Move Down (Ctrl+Shift+Down)") );
+ TQToolTip::add( m_deleteTag, i18n("Delete") );
- connect( m_moveUp, SIGNAL(clicked()), this, SLOT(moveUp()) );
- connect( m_moveDown, SIGNAL(clicked()), this, SLOT(moveDown()) );
- connect( m_deleteTag, SIGNAL(clicked()), this, SLOT(deleteTag()) );
+ connect( m_moveUp, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveUp()) );
+ connect( m_moveDown, TQT_SIGNAL(clicked()), this, TQT_SLOT(moveDown()) );
+ connect( m_deleteTag, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteTag()) );
- QHBoxLayout *topLeftLayout = new QHBoxLayout(0, /*margin=*/0, spacingHint());
+ TQHBoxLayout *topLeftLayout = new TQHBoxLayout(0, /*margin=*/0, spacingHint());
topLeftLayout->addWidget(m_moveUp);
topLeftLayout->addWidget(m_moveDown);
topLeftLayout->addWidget(m_deleteTag);
- QVBoxLayout *leftLayout = new QVBoxLayout(0, /*margin=*/0, spacingHint());
+ TQVBoxLayout *leftLayout = new TQVBoxLayout(0, /*margin=*/0, spacingHint());
leftLayout->addWidget(newTag);
leftLayout->addWidget(newState);
leftLayout->addWidget(m_tags);
leftLayout->addLayout(topLeftLayout);
- layout->addLayout(leftLayout);
+ tqlayout->addLayout(leftLayout);
/* Right part: */
- QWidget *rightWidget = new QWidget(plainPage());
+ TQWidget *rightWidget = new TQWidget(plainPage());
- m_tagBox = new QGroupBox(1, Qt::Horizontal, i18n("Tag"), rightWidget);
- QWidget *tagWidget = new QWidget(m_tagBox);
+ m_tagBox = new TQGroupBox(1, Qt::Horizontal, i18n("Tag"), rightWidget);
+ TQWidget *tagWidget = new TQWidget(m_tagBox);
- m_tagName = new QLineEdit(tagWidget);
- QLabel *tagNameLabel = new QLabel(m_tagName, i18n("&Name:"), tagWidget);
+ m_tagName = new TQLineEdit(tagWidget);
+ TQLabel *tagNameLabel = new TQLabel(m_tagName, i18n("&Name:"), tagWidget);
m_shortcut = new KKeyButton(tagWidget);
- m_removeShortcut = new QPushButton(i18n("Remove tag shortcut", "&Remove"), tagWidget);
- QLabel *shortcutLabel = new QLabel(m_shortcut, i18n("S&hortcut:"), tagWidget);
- connect( m_shortcut, SIGNAL(capturedShortcut(const KShortcut&)), this, SLOT(capturedShortcut(const KShortcut&)) );
- connect( m_removeShortcut, SIGNAL(clicked()), this, SLOT(removeShortcut()) );
+ m_removeShortcut = new TQPushButton(i18n("Remove tag shortcut", "&Remove"), tagWidget);
+ TQLabel *shortcutLabel = new TQLabel(m_shortcut, i18n("S&hortcut:"), tagWidget);
+ connect( m_shortcut, TQT_SIGNAL(capturedShortcut(const KShortcut&)), this, TQT_SLOT(capturedShortcut(const KShortcut&)) );
+ connect( m_removeShortcut, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeShortcut()) );
- m_inherit = new QCheckBox(i18n("&Inherited by new sibling notes"), tagWidget);
+ m_inherit = new TQCheckBox(i18n("&Inherited by new sibling notes"), tagWidget);
- QGridLayout *tagGrid = new QGridLayout(tagWidget, /*rows=*/3, /*cols=*/4, /*border=*/0, /*spacing=*/spacingHint());
+ TQGridLayout *tagGrid = new TQGridLayout(tagWidget, /*rows=*/3, /*cols=*/4, /*border=*/0, /*spacing=*/spacingHint());
tagGrid->addWidget(tagNameLabel, 0, 0);
tagGrid->addMultiCellWidget(m_tagName, /*fromRow=*/0, /*toRow=*/0, /*fromCol=*/1, /*toCol=*/3);
tagGrid->addWidget(shortcutLabel, 1, 0);
@@ -395,92 +395,92 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
tagGrid->addMultiCellWidget(m_inherit, /*fromRow=*/2, /*toRow=*/2, /*fromCol=*/0, /*toCol=*/3);
tagGrid->setColStretch(/*col=*/3, /*stretch=*/255);
- m_stateBox = new QGroupBox(1, Qt::Horizontal, i18n("State"), rightWidget);
- QWidget *stateWidget = new QWidget(m_stateBox);
+ m_stateBox = new TQGroupBox(1, Qt::Horizontal, i18n("State"), rightWidget);
+ TQWidget *stateWidget = new TQWidget(m_stateBox);
- m_stateName = new QLineEdit(stateWidget);
- m_stateNameLabel = new QLabel(m_stateName, i18n("Na&me:"), stateWidget);
+ m_stateName = new TQLineEdit(stateWidget);
+ m_stateNameLabel = new TQLabel(m_stateName, i18n("Na&me:"), stateWidget);
- QWidget *emblemWidget = new QWidget(stateWidget);
+ TQWidget *emblemWidget = new TQWidget(stateWidget);
m_emblem = new KIconButton(emblemWidget);
m_emblem->setIconType(KIcon::NoGroup, KIcon::Action);
m_emblem->setIconSize(16);
m_emblem->setIcon("editdelete");
- m_removeEmblem = new QPushButton(i18n("Remove tag emblem", "Remo&ve"), emblemWidget);
- QLabel *emblemLabel = new QLabel(m_emblem, i18n("&Emblem:"), stateWidget);
- connect( m_removeEmblem, SIGNAL(clicked()), this, SLOT(removeEmblem()) ); // m_emblem.resetIcon() is not a slot!
+ m_removeEmblem = new TQPushButton(i18n("Remove tag emblem", "Remo&ve"), emblemWidget);
+ TQLabel *emblemLabel = new TQLabel(m_emblem, i18n("&Emblem:"), stateWidget);
+ connect( m_removeEmblem, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeEmblem()) ); // m_emblem.resetIcon() is not a slot!
// Make the icon button and the remove button the same height:
- int height = QMAX(m_emblem->sizeHint().width(), m_emblem->sizeHint().height());
- height = QMAX(height, m_removeEmblem->sizeHint().height());
+ int height = TQMAX(m_emblem->tqsizeHint().width(), m_emblem->tqsizeHint().height());
+ height = TQMAX(height, m_removeEmblem->tqsizeHint().height());
m_emblem->setFixedSize(height, height); // Make it square
m_removeEmblem->setFixedHeight(height);
m_emblem->resetIcon();
- QHBoxLayout *emblemLayout = new QHBoxLayout(emblemWidget, /*margin=*/0, spacingHint());
+ TQHBoxLayout *emblemLayout = new TQHBoxLayout(emblemWidget, /*margin=*/0, spacingHint());
emblemLayout->addWidget(m_emblem);
emblemLayout->addWidget(m_removeEmblem);
emblemLayout->addStretch();
- m_backgroundColor = new KColorCombo2(QColor(), KGlobalSettings::baseColor(), stateWidget);
- QLabel *backgroundColorLabel = new QLabel(m_backgroundColor, i18n("&Background:"), stateWidget);
+ m_backgroundColor = new KColorCombo2(TQColor(), KGlobalSettings::baseColor(), stateWidget);
+ TQLabel *backgroundColorLabel = new TQLabel(m_backgroundColor, i18n("&Background:"), stateWidget);
- QHBoxLayout *backgroundColorLayout = new QHBoxLayout(0, /*margin=*/0, spacingHint());
+ TQHBoxLayout *backgroundColorLayout = new TQHBoxLayout(0, /*margin=*/0, spacingHint());
backgroundColorLayout->addWidget(m_backgroundColor);
backgroundColorLayout->addStretch();
- QIconSet boldIconSet = kapp->iconLoader()->loadIconSet("text_bold", KIcon::Small);
- m_bold = new QPushButton(boldIconSet, "", stateWidget);
+ TQIconSet boldIconSet = kapp->iconLoader()->loadIconSet("text_bold", KIcon::Small);
+ m_bold = new TQPushButton(boldIconSet, "", stateWidget);
m_bold->setToggleButton(true);
- int size = QMAX(m_bold->sizeHint().width(), m_bold->sizeHint().height());
+ int size = TQMAX(m_bold->tqsizeHint().width(), m_bold->tqsizeHint().height());
m_bold->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_bold, i18n("Bold"));
+ TQToolTip::add(m_bold, i18n("Bold"));
- QIconSet underlineIconSet = kapp->iconLoader()->loadIconSet("text_under", KIcon::Small);
- m_underline = new QPushButton(underlineIconSet, "", stateWidget);
+ TQIconSet underlineIconSet = kapp->iconLoader()->loadIconSet("text_under", KIcon::Small);
+ m_underline = new TQPushButton(underlineIconSet, "", stateWidget);
m_underline->setToggleButton(true);
m_underline->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_underline, i18n("Underline"));
+ TQToolTip::add(m_underline, i18n("Underline"));
- QIconSet italicIconSet = kapp->iconLoader()->loadIconSet("text_italic", KIcon::Small);
- m_italic = new QPushButton(italicIconSet, "", stateWidget);
+ TQIconSet italicIconSet = kapp->iconLoader()->loadIconSet("text_italic", KIcon::Small);
+ m_italic = new TQPushButton(italicIconSet, "", stateWidget);
m_italic->setToggleButton(true);
m_italic->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_italic, i18n("Italic"));
+ TQToolTip::add(m_italic, i18n("Italic"));
- QIconSet strikeIconSet = kapp->iconLoader()->loadIconSet("text_strike", KIcon::Small);
- m_strike = new QPushButton(strikeIconSet, "", stateWidget);
+ TQIconSet strikeIconSet = kapp->iconLoader()->loadIconSet("text_strike", KIcon::Small);
+ m_strike = new TQPushButton(strikeIconSet, "", stateWidget);
m_strike->setToggleButton(true);
m_strike->setFixedSize(size, size); // Make it square!
- QToolTip::add(m_strike, i18n("Strike Through"));
+ TQToolTip::add(m_strike, i18n("Strike Through"));
- QLabel *textLabel = new QLabel(m_bold, i18n("&Text:"), stateWidget);
+ TQLabel *textLabel = new TQLabel(m_bold, i18n("&Text:"), stateWidget);
- QHBoxLayout *textLayout = new QHBoxLayout(0, /*margin=*/0, spacingHint());
+ TQHBoxLayout *textLayout = new TQHBoxLayout(0, /*margin=*/0, spacingHint());
textLayout->addWidget(m_bold);
textLayout->addWidget(m_underline);
textLayout->addWidget(m_italic);
textLayout->addWidget(m_strike);
textLayout->addStretch();
- m_textColor = new KColorCombo2(QColor(), KGlobalSettings::textColor(), stateWidget);
- QLabel *textColorLabel = new QLabel(m_textColor, i18n("Co&lor:"), stateWidget);
+ m_textColor = new KColorCombo2(TQColor(), KGlobalSettings::textColor(), stateWidget);
+ TQLabel *textColorLabel = new TQLabel(m_textColor, i18n("Co&lor:"), stateWidget);
m_font = new KFontCombo(stateWidget);
m_font->insertItem(i18n("(Default)"), 0);
- QLabel *fontLabel = new QLabel(m_font, i18n("&Font:"), stateWidget);
+ TQLabel *fontLabel = new TQLabel(m_font, i18n("&Font:"), stateWidget);
m_fontSize = new FontSizeCombo(/*rw=*/true, /*withDefault=*/true, stateWidget);
- QLabel *fontSizeLabel = new QLabel(m_fontSize, i18n("&Size:"), stateWidget);
+ TQLabel *fontSizeLabel = new TQLabel(m_fontSize, i18n("&Size:"), stateWidget);
- m_textEquivalent = new QLineEdit(stateWidget);
- QLabel *textEquivalentLabel = new QLabel(m_textEquivalent, i18n("Te&xt equivalent:"), stateWidget);
- QFont font = m_textEquivalent->font();
+ m_textEquivalent = new TQLineEdit(stateWidget);
+ TQLabel *textEquivalentLabel = new TQLabel(m_textEquivalent, i18n("Te&xt equivalent:"), stateWidget);
+ TQFont font = m_textEquivalent->font();
font.setFamily("monospace");
m_textEquivalent->setFont(font);
- QPixmap textEquivalentPixmap(KGlobal::dirs()->findResource("data", "basket/images/tag_export_help.png"));
- QMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export.png", textEquivalentPixmap);
+ TQPixmap textEquivalentPixmap(KGlobal::dirs()->findResource("data", "basket/images/tag_export_help.png"));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export.png", textEquivalentPixmap);
HelpLabel *textEquivalentHelp = new HelpLabel(
i18n("When does this apply?"),
"<p>" + i18n("It does apply when you copy and paste, or drag and drop notes to a text editor.") + "</p>" +
@@ -489,25 +489,25 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
"representing an empty checkbox and a checked box.") + "</p>" +
"<p align='center'><img src=\"__resource_help_tag_export.png\"></p>",
stateWidget);
- QHBoxLayout *textEquivalentHelpLayout = new QHBoxLayout((QWidget*)0, /*border=*/0, spacingHint());
+ TQHBoxLayout *textEquivalentHelpLayout = new TQHBoxLayout((TQWidget*)0, /*border=*/0, spacingHint());
textEquivalentHelpLayout->addWidget(textEquivalentHelp);
textEquivalentHelpLayout->addStretch(255);
- m_onEveryLines = new QCheckBox(i18n("On ever&y line"), stateWidget);
+ m_onEveryLines = new TQCheckBox(i18n("On ever&y line"), stateWidget);
- QPixmap onEveryLinesPixmap(KGlobal::dirs()->findResource("data", "basket/images/tag_export_on_every_lines_help.png"));
- QMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export_on_every_lines.png", onEveryLinesPixmap);
+ TQPixmap onEveryLinesPixmap(KGlobal::dirs()->findResource("data", "basket/images/tag_export_on_every_lines_help.png"));
+ TQMimeSourceFactory::defaultFactory()->setPixmap("__resource_help_tag_export_on_every_lines.png", onEveryLinesPixmap);
HelpLabel *onEveryLinesHelp = new HelpLabel(
i18n("What does it mean?"),
"<p>" + i18n("When a note has several lines, you can choose to export the tag or the state on the first line or on every line of the note.") + "</p>" +
"<p align='center'><img src=\"__resource_help_tag_export_on_every_lines.png\"></p>" +
"<p>" + i18n("In the example above, the tag of the top note is only exported on the first line, while the tag of the bottom note is exported on every line of the note."),
stateWidget);
- QHBoxLayout *onEveryLinesHelpLayout = new QHBoxLayout((QWidget*)0, /*border=*/0, spacingHint());
+ TQHBoxLayout *onEveryLinesHelpLayout = new TQHBoxLayout((TQWidget*)0, /*border=*/0, spacingHint());
onEveryLinesHelpLayout->addWidget(onEveryLinesHelp);
onEveryLinesHelpLayout->addStretch(255);
- QGridLayout *textEquivalentGrid = new QGridLayout(0, /*rows=*/2, /*cols=*/4, /*border=*/0, /*spacing=*/spacingHint());
+ TQGridLayout *textEquivalentGrid = new TQGridLayout(0, /*rows=*/2, /*cols=*/4, /*border=*/0, /*spacing=*/spacingHint());
textEquivalentGrid->addWidget(textEquivalentLabel, 0, 0);
textEquivalentGrid->addWidget(m_textEquivalent, 0, 1);
textEquivalentGrid->addLayout(textEquivalentHelpLayout, 0, 2);
@@ -517,7 +517,7 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
KSeparator *separator = new KSeparator(Qt::Horizontal, stateWidget);
- QGridLayout *stateGrid = new QGridLayout(stateWidget, /*rows=*/6, /*cols=*/7, /*border=*/0, /*spacing=*/spacingHint());
+ TQGridLayout *stateGrid = new TQGridLayout(stateWidget, /*rows=*/6, /*cols=*/7, /*border=*/0, /*spacing=*/spacingHint());
stateGrid->addWidget(m_stateNameLabel, 0, 0);
stateGrid->addMultiCellWidget(m_stateName, /*fromRow=*/0, /*toRow=*/0, /*fromCol=*/1, /*toCol=*/6);
stateGrid->addWidget(emblemLabel, 1, 0);
@@ -535,23 +535,23 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
stateGrid->addMultiCellWidget(separator, /*fromRow=*/4, /*toRow=*/4, /*fromCol=*/0, /*toCol=*/6);
stateGrid->addMultiCellLayout(textEquivalentGrid, /*fromRow=*/5, /*toRow=*/5, /*fromCol=*/0, /*toCol=*/6);
- QVBoxLayout *rightLayout = new QVBoxLayout(rightWidget, /*margin=*/0, spacingHint());
+ TQVBoxLayout *rightLayout = new TQVBoxLayout(rightWidget, /*margin=*/0, spacingHint());
rightLayout->addWidget(m_tagBox);
rightLayout->addWidget(m_stateBox);
rightLayout->addStretch();
- layout->addWidget(rightWidget);
- rightWidget->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Expanding);
+ tqlayout->addWidget(rightWidget);
+ rightWidget->tqsetSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Expanding);
// Equalize the width of the first column of the two grids:
- int maxWidth = tagNameLabel->sizeHint().width();
- maxWidth = QMAX(maxWidth, shortcutLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, m_stateNameLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, emblemLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, textLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, fontLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, backgroundColorLabel->sizeHint().width());
- maxWidth = QMAX(maxWidth, textEquivalentLabel->sizeHint().width());
+ int maxWidth = tagNameLabel->tqsizeHint().width();
+ maxWidth = TQMAX(maxWidth, shortcutLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, m_stateNameLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, emblemLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, textLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, fontLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, backgroundColorLabel->tqsizeHint().width());
+ maxWidth = TQMAX(maxWidth, textEquivalentLabel->tqsizeHint().width());
tagNameLabel->setFixedWidth(maxWidth);
m_stateNameLabel->setFixedWidth(maxWidth);
@@ -588,27 +588,27 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
}
// Connect Signals:
- connect( m_tagName, SIGNAL(textChanged(const QString&)), this, SLOT(modified()) );
- connect( m_shortcut, SIGNAL(capturedShortcut(const KShortcut&)), this, SLOT(modified()) );
- connect( m_inherit, SIGNAL(stateChanged(int)), this, SLOT(modified()) );
- connect( m_stateName, SIGNAL(textChanged(const QString&)), this, SLOT(modified()) );
- connect( m_emblem, SIGNAL(iconChanged(QString)), this, SLOT(modified()) );
- connect( m_backgroundColor, SIGNAL(changed(const QColor&)), this, SLOT(modified()) );
- connect( m_bold, SIGNAL(toggled(bool)), this, SLOT(modified()) );
- connect( m_underline, SIGNAL(toggled(bool)), this, SLOT(modified()) );
- connect( m_italic, SIGNAL(toggled(bool)), this, SLOT(modified()) );
- connect( m_strike, SIGNAL(toggled(bool)), this, SLOT(modified()) );
- connect( m_textColor, SIGNAL(changed(const QColor&)), this, SLOT(modified()) );
- connect( m_font, SIGNAL(textChanged(const QString&)), this, SLOT(modified()) );
- connect( m_fontSize, SIGNAL(textChanged(const QString&)), this, SLOT(modified()) );
- connect( m_textEquivalent, SIGNAL(textChanged(const QString&)), this, SLOT(modified()) );
- connect( m_onEveryLines, SIGNAL(stateChanged(int)), this, SLOT(modified()) );
-
- connect( m_tags, SIGNAL(currentChanged(QListViewItem*)), this, SLOT(currentItemChanged(QListViewItem*)) );
- connect( m_tags, SIGNAL(deletePressed()), this, SLOT(deleteTag()) );
- connect( m_tags, SIGNAL(doubleClickedItem()), this, SLOT(renameIt()) );
-
- QListViewItem *firstItem = m_tags->firstChild();
+ connect( m_tagName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(modified()) );
+ connect( m_shortcut, TQT_SIGNAL(capturedShortcut(const KShortcut&)), this, TQT_SLOT(modified()) );
+ connect( m_inherit, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(modified()) );
+ connect( m_stateName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(modified()) );
+ connect( m_emblem, TQT_SIGNAL(iconChanged(TQString)), this, TQT_SLOT(modified()) );
+ connect( m_backgroundColor, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(modified()) );
+ connect( m_bold, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(modified()) );
+ connect( m_underline, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(modified()) );
+ connect( m_italic, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(modified()) );
+ connect( m_strike, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(modified()) );
+ connect( m_textColor, TQT_SIGNAL(changed(const TQColor&)), this, TQT_SLOT(modified()) );
+ connect( m_font, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(modified()) );
+ connect( m_fontSize, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(modified()) );
+ connect( m_textEquivalent, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(modified()) );
+ connect( m_onEveryLines, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(modified()) );
+
+ connect( m_tags, TQT_SIGNAL(currentChanged(TQListViewItem*)), this, TQT_SLOT(currentItemChanged(TQListViewItem*)) );
+ connect( m_tags, TQT_SIGNAL(deletePressed()), this, TQT_SLOT(deleteTag()) );
+ connect( m_tags, TQT_SIGNAL(doubleClickedItem()), this, TQT_SLOT(renameIt()) );
+
+ TQListViewItem *firstItem = m_tags->firstChild();
if (stateToEdit != 0) {
TagListViewItem *item = itemForState(stateToEdit);
if (item)
@@ -635,44 +635,44 @@ TagsEditDialog::TagsEditDialog(QWidget *parent, State *stateToEdit, bool addNewT
// TODO: Disabled both boxes if no tag!!!
// Some keyboard shortcuts: // Ctrl+arrows instead of Alt+arrows (same as Go menu in the main window) because Alt+Down is for combo boxes
- QAction *selectAbove = new QAction(this);
- selectAbove->setAccel(QString("Ctrl+Up"));
- connect( selectAbove, SIGNAL(activated()), this, SLOT(selectUp()) );
+ TQAction *selectAbove = new TQAction(this);
+ selectAbove->setAccel(TQString("Ctrl+Up"));
+ connect( selectAbove, TQT_SIGNAL(activated()), this, TQT_SLOT(selectUp()) );
- QAction *selectBelow = new QAction(this);
- selectBelow->setAccel(QString("Ctrl+Down"));
- connect( selectBelow, SIGNAL(activated()), this, SLOT(selectDown()) );
+ TQAction *selectBelow = new TQAction(this);
+ selectBelow->setAccel(TQString("Ctrl+Down"));
+ connect( selectBelow, TQT_SIGNAL(activated()), this, TQT_SLOT(selectDown()) );
- QAction *selectLeft = new QAction(this);
- selectLeft->setAccel(QString("Ctrl+Left"));
- connect( selectLeft, SIGNAL(activated()), this, SLOT(selectLeft()) );
+ TQAction *selectLeft = new TQAction(this);
+ selectLeft->setAccel(TQString("Ctrl+Left"));
+ connect( selectLeft, TQT_SIGNAL(activated()), this, TQT_SLOT(selectLeft()) );
- QAction *selectRight = new QAction(this);
- selectRight->setAccel(QString("Ctrl+Right"));
- connect( selectRight, SIGNAL(activated()), this, SLOT(selectRight()) );
+ TQAction *selectRight = new TQAction(this);
+ selectRight->setAccel(TQString("Ctrl+Right"));
+ connect( selectRight, TQT_SIGNAL(activated()), this, TQT_SLOT(selectRight()) );
- QAction *moveAbove = new QAction(this);
- moveAbove->setAccel(QString("Ctrl+Shift+Up"));
- connect( moveAbove, SIGNAL(activated()), this, SLOT(moveUp()) );
+ TQAction *moveAbove = new TQAction(this);
+ moveAbove->setAccel(TQString("Ctrl+Shift+Up"));
+ connect( moveAbove, TQT_SIGNAL(activated()), this, TQT_SLOT(moveUp()) );
- QAction *moveBelow = new QAction(this);
- moveBelow->setAccel(QString("Ctrl+Shift+Down"));
- connect( moveBelow, SIGNAL(activated()), this, SLOT(moveDown()) );
+ TQAction *moveBelow = new TQAction(this);
+ moveBelow->setAccel(TQString("Ctrl+Shift+Down"));
+ connect( moveBelow, TQT_SIGNAL(activated()), this, TQT_SLOT(moveDown()) );
- QAction *rename = new QAction(this);
- rename->setAccel(QString("F2"));
- connect( rename, SIGNAL(activated()), this, SLOT(renameIt()) );
+ TQAction *rename = new TQAction(this);
+ rename->setAccel(TQString("F2"));
+ connect( rename, TQT_SIGNAL(activated()), this, TQT_SLOT(renameIt()) );
m_tags->setMinimumSize(
- m_tags->sizeHint().width() * 2,
- m_tagBox->sizeHint().height() + m_stateBox->sizeHint().height()
+ m_tags->tqsizeHint().width() * 2,
+ m_tagBox->tqsizeHint().height() + m_stateBox->tqsizeHint().height()
);
if (addNewTag)
- QTimer::singleShot(0, this, SLOT(newTag()) );
+ TQTimer::singleShot(0, this, TQT_SLOT(newTag()) );
else
// Once the window initial size is computed and the window show, allow the user to resize it down:
- QTimer::singleShot(0, this, SLOT(resetTreeSizeHint()) );
+ TQTimer::singleShot(0, this, TQT_SLOT(resetTreeSizeHint()) );
}
TagsEditDialog::~TagsEditDialog()
@@ -681,15 +681,15 @@ TagsEditDialog::~TagsEditDialog()
void TagsEditDialog::resetTreeSizeHint()
{
- m_tags->setMinimumSize(m_tags->sizeHint());
+ m_tags->setMinimumSize(m_tags->tqsizeHint());
}
TagListViewItem* TagsEditDialog::itemForState(State *state)
{
// Browse all tags:
- QListViewItemIterator it(m_tags);
+ TQListViewItemIterator it(m_tags);
while (it.current()) {
- QListViewItem *item = it.current();
+ TQListViewItem *item = it.current();
// Return if we found the tag item:
TagListViewItem *tagItem = (TagListViewItem*)item;
@@ -697,9 +697,9 @@ TagListViewItem* TagsEditDialog::itemForState(State *state)
return tagItem;
// Browser all sub-states:
- QListViewItemIterator it2(item);
+ TQListViewItemIterator it2(item);
while (it2.current()) {
- QListViewItem *subItem = it2.current();
+ TQListViewItem *subItem = it2.current();
// Return if we found the state item:
TagListViewItem *stateItem = (TagListViewItem*)subItem;
@@ -718,17 +718,17 @@ void TagsEditDialog::newTag()
{
// Add to the "model":
TagCopy *newTagCopy = new TagCopy();
- newTagCopy->stateCopies[0]->newState->setId("tag_state_" + QString::number( Tag::getNextStateUid() )); //TODO: Check if it's really unique
+ newTagCopy->stateCopies[0]->newState->setId("tag_state_" + TQString::number( Tag::getNextStateUid() )); //TODO: Check if it's really unique
m_tagCopies.append(newTagCopy);
m_addedStates.append(newTagCopy->stateCopies[0]->newState);
// Add to the "view":
TagListViewItem *item;
if (m_tags->firstChild()) {
- // QListView::lastItem is the last item in the tree. If we the last item is a state item, the new tag gets appended to the begin of the list.
+ // TQListView::lastItem is the last item in the tree. If we the last item is a state item, the new tag gets appended to the begin of the list.
TagListViewItem *last = m_tags->lastItem();
- if (last->parent())
- last = last->parent();
+ if (last->tqparent())
+ last = last->tqparent();
item = new TagListViewItem(m_tags, last, newTagCopy);
} else
item = new TagListViewItem(m_tags, newTagCopy);
@@ -746,8 +746,8 @@ void TagsEditDialog::newTag()
void TagsEditDialog::newState()
{
TagListViewItem *tagItem = m_tags->currentItem();
- if (tagItem->parent())
- tagItem = ((TagListViewItem*)(tagItem->parent()));
+ if (tagItem->tqparent())
+ tagItem = ((TagListViewItem*)(tagItem->tqparent()));
tagItem->setOpen(true); // Show sub-states if we're adding them for the first time!
State *firstState = tagItem->tagCopy()->stateCopies[0]->newState;
@@ -764,7 +764,7 @@ void TagsEditDialog::newState()
// Add to the "model":
StateCopy *newStateCopy = new StateCopy();
firstState->copyTo(newStateCopy->newState);
- newStateCopy->newState->setId("tag_state_" + QString::number( Tag::getNextStateUid() )); //TODO: Check if it's really unique
+ newStateCopy->newState->setId("tag_state_" + TQString::number( Tag::getNextStateUid() )); //TODO: Check if it's really unique
newStateCopy->newState->setName(""); // We copied it too but it's likely the name will not be the same
tagItem->tagCopy()->stateCopies.append(newStateCopy);
m_addedStates.append(newStateCopy->newState);
@@ -791,7 +791,7 @@ void TagsEditDialog::moveUp()
// Move in the value list:
if (tagItem->tagCopy()) {
- int pos = m_tagCopies.findIndex(tagItem->tagCopy());
+ int pos = m_tagCopies.tqfindIndex(tagItem->tagCopy());
m_tagCopies.remove(tagItem->tagCopy());
int i = 0;
for (TagCopy::List::iterator it = m_tagCopies.begin(); it != m_tagCopies.end(); ++it, ++i)
@@ -800,8 +800,8 @@ void TagsEditDialog::moveUp()
break;
}
} else {
- StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->parent() ))->tagCopy()->stateCopies;
- int pos = stateCopies.findIndex(tagItem->stateCopy());
+ StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies;
+ int pos = stateCopies.tqfindIndex(tagItem->stateCopy());
stateCopies.remove(tagItem->stateCopy());
int i = 0;
for (StateCopy::List::iterator it = stateCopies.begin(); it != stateCopies.end(); ++it, ++i)
@@ -829,7 +829,7 @@ void TagsEditDialog::moveDown()
// Move in the value list:
if (tagItem->tagCopy()) {
- uint pos = m_tagCopies.findIndex(tagItem->tagCopy());
+ uint pos = m_tagCopies.tqfindIndex(tagItem->tagCopy());
m_tagCopies.remove(tagItem->tagCopy());
if (pos == m_tagCopies.count() - 1) // Insert at end: iterator does not go there
m_tagCopies.append(tagItem->tagCopy());
@@ -842,8 +842,8 @@ void TagsEditDialog::moveDown()
}
}
} else {
- StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->parent() ))->tagCopy()->stateCopies;
- uint pos = stateCopies.findIndex(tagItem->stateCopy());
+ StateCopy::List &stateCopies = ((TagListViewItem*)( tagItem->tqparent() ))->tagCopy()->stateCopies;
+ uint pos = stateCopies.tqfindIndex(tagItem->stateCopy());
stateCopies.remove(tagItem->stateCopy());
if (pos == stateCopies.count() - 1) // Insert at end: iterator does not go there
stateCopies.append(tagItem->stateCopy());
@@ -865,26 +865,26 @@ void TagsEditDialog::moveDown()
void TagsEditDialog::selectUp()
{
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Up, 0, 0);
- QApplication::postEvent(m_tags, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Up, 0, 0);
+ TQApplication::postEvent(m_tags, keyEvent);
}
void TagsEditDialog::selectDown()
{
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Down, 0, 0);
- QApplication::postEvent(m_tags, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Down, 0, 0);
+ TQApplication::postEvent(m_tags, keyEvent);
}
void TagsEditDialog::selectLeft()
{
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Left, 0, 0);
- QApplication::postEvent(m_tags, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Left, 0, 0);
+ TQApplication::postEvent(m_tags, keyEvent);
}
void TagsEditDialog::selectRight()
{
- QKeyEvent* keyEvent = new QKeyEvent(QEvent::KeyPress, Qt::Key_Right, 0, 0);
- QApplication::postEvent(m_tags, keyEvent);
+ TQKeyEvent* keyEvent = new TQKeyEvent(TQEvent::KeyPress, TQt::Key_Right, 0, 0);
+ TQApplication::postEvent(m_tags, keyEvent);
}
void TagsEditDialog::deleteTag()
@@ -926,9 +926,9 @@ void TagsEditDialog::deleteTag()
// Remove the new tag, to avoid keyboard-shortcut clashes:
delete item->tagCopy()->newTag;
} else {
- TagListViewItem *parentItem = item->parent();
+ TagListViewItem *tqparentItem = item->tqparent();
// Remove the state:
- parentItem->tagCopy()->stateCopies.remove(item->stateCopy());
+ tqparentItem->tagCopy()->stateCopies.remove(item->stateCopy());
if (item->stateCopy()->oldState) {
m_deletedStates.append(item->stateCopy()->oldState);
m_addedStates.remove(item->stateCopy()->oldState);
@@ -937,9 +937,9 @@ void TagsEditDialog::deleteTag()
delete item;
item = 0;
// Transform to single-state tag if needed:
- if (parentItem->childCount() == 1) {
- delete parentItem->firstChild();
- m_tags->setCurrentItem(parentItem);
+ if (tqparentItem->childCount() == 1) {
+ delete tqparentItem->firstChild();
+ m_tags->setCurrentItem(tqparentItem);
}
}
@@ -965,12 +965,12 @@ void TagsEditDialog::renameIt()
void TagsEditDialog::capturedShortcut(const KShortcut &shortcut)
{
// TODO: Validate it!
- m_shortcut->setShortcut(shortcut, /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(shortcut, /*bTQtShortcut=*/true);
}
void TagsEditDialog::removeShortcut()
{
- m_shortcut->setShortcut(KShortcut(), /*bQtShortcut=*/true);
+ m_shortcut->setShortcut(KShortcut(), /*bTQtShortcut=*/true);
modified();
}
@@ -997,20 +997,20 @@ void TagsEditDialog::modified()
saveStateTo(tagItem->tagCopy()->stateCopies[0]->newState);
}
} else if (tagItem->stateCopy()) {
- saveTagTo(((TagListViewItem*)(tagItem->parent()))->tagCopy()->newTag);
+ saveTagTo(((TagListViewItem*)(tagItem->tqparent()))->tagCopy()->newTag);
saveStateTo(tagItem->stateCopy()->newState);
}
m_tags->currentItem()->setup();
- if (m_tags->currentItem()->parent())
- m_tags->currentItem()->parent()->setup();
+ if (m_tags->currentItem()->tqparent())
+ m_tags->currentItem()->tqparent()->setup();
m_removeShortcut->setEnabled(!m_shortcut->shortcut().isNull());
m_removeEmblem->setEnabled(!m_emblem->icon().isEmpty() && !m_tags->currentItem()->isEmblemObligatory());
m_onEveryLines->setEnabled(!m_textEquivalent->text().isEmpty());
}
-void TagsEditDialog::currentItemChanged(QListViewItem *item)
+void TagsEditDialog::currentItemChanged(TQListViewItem *item)
{
if (item == 0)
return;
@@ -1036,7 +1036,7 @@ void TagsEditDialog::currentItemChanged(QListViewItem *item)
m_stateName->setEnabled(false);
}
} else if (tagItem->stateCopy()) {
- loadTagFrom(((TagListViewItem*)(tagItem->parent()))->tagCopy()->newTag);
+ loadTagFrom(((TagListViewItem*)(tagItem->tqparent()))->tagCopy()->newTag);
loadStateFrom(tagItem->stateCopy()->newState);
m_stateBox->setEnabled(true);
m_stateBox->setTitle(i18n("State"));
@@ -1057,7 +1057,7 @@ void TagsEditDialog::ensureCurrentItemVisible()
// ensure the tag is still visible, even if the last states are not...
int y = m_tags->itemPos(tagItem);
int height = tagItem->totalHeight();
- int bottom = y + QMIN(height, m_tags->visibleHeight());
+ int bottom = y + TQMIN(height, m_tags->visibleHeight());
int xMiddle = m_tags->contentsX() + m_tags->visibleWidth() / 2;
m_tags->ensureVisible( xMiddle, bottom, 0,0 );
m_tags->ensureVisible( xMiddle, y, 0,0 );
@@ -1071,12 +1071,12 @@ void TagsEditDialog::loadBlankState()
m_stateName->setText("");
m_emblem->resetIcon();
m_removeEmblem->setEnabled(false);
- m_backgroundColor->setColor(QColor());
+ m_backgroundColor->setColor(TQColor());
m_bold->setOn(false);
m_underline->setOn(false);
m_italic->setOn(false);
m_strike->setOn(false);
- m_textColor->setColor(QColor());
+ m_textColor->setColor(TQColor());
m_font->setCurrentItem(0);
m_fontSize->setCurrentItem(0);
m_textEquivalent->setText("");
@@ -1108,13 +1108,13 @@ void TagsEditDialog::loadStateFrom(State *state)
if (state->fontSize() == -1)
m_fontSize->setCurrentItem(0);
else
- m_fontSize->setCurrentText(QString::number(state->fontSize()));
+ m_fontSize->setCurrentText(TQString::number(state->fontSize()));
}
void TagsEditDialog::loadTagFrom(Tag *tag)
{
m_tagName->setText(tag->name());
- m_shortcut->setShortcut(tag->shortcut(), /*bQtShortcut=*/false);
+ m_shortcut->setShortcut(tag->shortcut(), /*bTQtShortcut=*/false);
m_removeShortcut->setEnabled(!tag->shortcut().isNull());
m_inherit->setChecked(tag->inheritedBySiblings());
}
@@ -1154,7 +1154,7 @@ void TagsEditDialog::saveTagTo(Tag *tag)
void TagsEditDialog::slotCancel()
{
- // All copies of tag have a shortcut, that is stored as a QAction.
+ // All copies of tag have a shortcut, that is stored as a TQAction.
// So, shortcuts are duplicated, and if the user press one tag keyboard-shortcut in the main window, there is a conflict.
// We then should delete every copies:
for (TagCopy::List::iterator tagCopyIt = m_tagCopies.begin(); tagCopyIt != m_tagCopies.end(); ++tagCopyIt) {
@@ -1197,7 +1197,7 @@ void TagsEditDialog::slotOk()
Global::bnpView->removedStates(m_deletedStates);
// Update every note (change colors, size because of font change or added/removed emblems...):
- Global::bnpView->relayoutAllBaskets();
+ Global::bnpView->retqlayoutAllBaskets();
Global::bnpView->recomputeAllStyles();
KDialogBase::slotOk();
diff --git a/src/tagsedit.h b/src/tagsedit.h
index 0986bac..1d50d89 100644
--- a/src/tagsedit.h
+++ b/src/tagsedit.h
@@ -23,17 +23,17 @@
#include <kdialogbase.h>
#include <kcombobox.h>
-#include <qlistview.h>
-#include <qvaluelist.h>
+#include <tqlistview.h>
+#include <tqvaluelist.h>
-class QGroupBox;
-class QLineEdit;
-class QCheckBox;
+class TQGroupBox;
+class TQLineEdit;
+class TQCheckBox;
class KPushButton;
class KKeyButton;
class KIconButton;
class KFontCombo;
-class QLabel;
+class TQLabel;
class KShortcut;
class KColorCombo2;
@@ -46,7 +46,7 @@ class State;
class StateCopy
{
public:
- typedef QValueList<StateCopy*> List;
+ typedef TQValueList<StateCopy*> List;
StateCopy(State *old = 0);
~StateCopy();
State *oldState;
@@ -57,7 +57,7 @@ class StateCopy
class TagCopy
{
public:
- typedef QValueList<TagCopy*> List;
+ typedef TQValueList<TagCopy*> List;
TagCopy(Tag *old = 0);
~TagCopy();
Tag *oldTag;
@@ -67,43 +67,44 @@ class TagCopy
bool isMultiState();
};
-class TagListViewItem : public QListViewItem
+class TagListViewItem : public TQListViewItem
{
public:
- TagListViewItem(QListView *parent, TagCopy *tagCopy);
- TagListViewItem(QListViewItem *parent, TagCopy *tagCopy);
- TagListViewItem(QListView *parent, QListViewItem *after, TagCopy *tagCopy);
- TagListViewItem(QListViewItem *parent, QListViewItem *after, TagCopy *tagCopy);
- TagListViewItem(QListView *parent, StateCopy *stateCopy);
- TagListViewItem(QListViewItem *parent, StateCopy *stateCopy);
- TagListViewItem(QListView *parent, QListViewItem *after, StateCopy *stateCopy);
- TagListViewItem(QListViewItem *parent, QListViewItem *after, StateCopy *stateCopy);
+ TagListViewItem(TQListView *tqparent, TagCopy *tagCopy);
+ TagListViewItem(TQListViewItem *tqparent, TagCopy *tagCopy);
+ TagListViewItem(TQListView *tqparent, TQListViewItem *after, TagCopy *tagCopy);
+ TagListViewItem(TQListViewItem *tqparent, TQListViewItem *after, TagCopy *tagCopy);
+ TagListViewItem(TQListView *tqparent, StateCopy *stateCopy);
+ TagListViewItem(TQListViewItem *tqparent, StateCopy *stateCopy);
+ TagListViewItem(TQListView *tqparent, TQListViewItem *after, StateCopy *stateCopy);
+ TagListViewItem(TQListViewItem *tqparent, TQListViewItem *after, StateCopy *stateCopy);
~TagListViewItem();
TagCopy* tagCopy() { return m_tagCopy; }
StateCopy* stateCopy() { return m_stateCopy; }
bool isEmblemObligatory();
TagListViewItem* lastChild();
TagListViewItem* prevSibling();
- TagListViewItem* parent() const; // Reimplemented to cast the return value
- int width(const QFontMetrics &fontMetrics, const QListView *listView, int column) const;
+ TagListViewItem* tqparent() const; // Reimplemented to cast the return value
+ int width(const TQFontMetrics &fontMetrics, const TQListView *listView, int column) const;
void setup();
- void paintCell(QPainter *painter, const QColorGroup &colorGroup, int column, int width, int align);
+ void paintCell(TQPainter *painter, const TQColorGroup &tqcolorGroup, int column, int width, int align);
private:
TagCopy *m_tagCopy;
StateCopy *m_stateCopy;
};
-class TagListView : public QListView
+class TagListView : public TQListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- TagListView(QWidget *parent = 0, const char *name = 0, WFlags flags = 0);
+ TagListView(TQWidget *tqparent = 0, const char *name = 0, WFlags flags = 0);
~TagListView();
- void keyPressEvent(QKeyEvent *event);
- void contentsMouseDoubleClickEvent(QMouseEvent *event);
- void contentsMousePressEvent(QMouseEvent *event);
- void contentsMouseReleaseEvent(QMouseEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
+ void contentsMouseDoubleClickEvent(TQMouseEvent *event);
+ void contentsMousePressEvent(TQMouseEvent *event);
+ void contentsMouseReleaseEvent(TQMouseEvent *event);
TagListViewItem* currentItem() const; // Reimplemented to cast the return value
TagListViewItem* firstChild() const; // Reimplemented to cast the return value
TagListViewItem* lastItem() const; // Reimplemented to cast the return value
@@ -118,8 +119,9 @@ class TagListView : public QListView
class TagsEditDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- TagsEditDialog(QWidget *parent = 0, State *stateToEdit = 0, bool addNewTag = false);
+ TagsEditDialog(TQWidget *tqparent = 0, State *stateToEdit = 0, bool addNewTag = false);
~TagsEditDialog();
State::List deletedStates() { return m_deletedStates; }
State::List addedStates() { return m_addedStates; }
@@ -135,7 +137,7 @@ class TagsEditDialog : public KDialogBase
void removeShortcut();
void removeEmblem();
void modified();
- void currentItemChanged(QListViewItem *item);
+ void currentItemChanged(TQListViewItem *item);
void slotCancel();
void slotOk();
void selectUp();
@@ -154,26 +156,26 @@ class TagsEditDialog : public KDialogBase
KPushButton *m_moveUp;
KPushButton *m_moveDown;
KPushButton *m_deleteTag;
- QLineEdit *m_tagName;
+ TQLineEdit *m_tagName;
KKeyButton *m_shortcut;
- QPushButton *m_removeShortcut;
- QCheckBox *m_inherit;
- QGroupBox *m_tagBox;
- QGroupBox *m_stateBox;
- QLabel *m_stateNameLabel;
- QLineEdit *m_stateName;
+ TQPushButton *m_removeShortcut;
+ TQCheckBox *m_inherit;
+ TQGroupBox *m_tagBox;
+ TQGroupBox *m_stateBox;
+ TQLabel *m_stateNameLabel;
+ TQLineEdit *m_stateName;
KIconButton *m_emblem;
- QPushButton *m_removeEmblem;
- QPushButton *m_bold;
- QPushButton *m_underline;
- QPushButton *m_italic;
- QPushButton *m_strike;
+ TQPushButton *m_removeEmblem;
+ TQPushButton *m_bold;
+ TQPushButton *m_underline;
+ TQPushButton *m_italic;
+ TQPushButton *m_strike;
KColorCombo2 *m_textColor;
KFontCombo *m_font;
FontSizeCombo *m_fontSize;
KColorCombo2 *m_backgroundColor;
- QLineEdit *m_textEquivalent;
- QCheckBox *m_onEveryLines;
+ TQLineEdit *m_textEquivalent;
+ TQCheckBox *m_onEveryLines;
TagCopy::List m_tagCopies;
State::List m_deletedStates;
diff --git a/src/tools.cpp b/src/tools.cpp
index 9acbda7..2d3cce7 100644
--- a/src/tools.cpp
+++ b/src/tools.cpp
@@ -19,24 +19,24 @@
***************************************************************************/
#include <kdebug.h>
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qstylesheet.h>
-#include <qregexp.h>
-#include <qvaluestack.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qmime.h>
-#include <qfont.h>
-#include <qfontinfo.h>
-#include <qobjectlist.h>
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqstylesheet.h>
+#include <tqregexp.h>
+#include <tqvaluestack.h>
+#include <tqfileinfo.h>
+#include <tqdir.h>
+#include <tqmime.h>
+#include <tqfont.h>
+#include <tqfontinfo.h>
+#include <tqobjectlist.h>
#include "tools.h"
-QMemArray<QTime> StopWatch::starts;
-QMemArray<double> StopWatch::totals;
-QMemArray<uint> StopWatch::counts;
+TQMemArray<TQTime> StopWatch::starts;
+TQMemArray<double> StopWatch::totals;
+TQMemArray<uint> StopWatch::counts;
void StopWatch::start(uint id)
{
@@ -49,46 +49,46 @@ void StopWatch::start(uint id)
}
starts.resize(id + 1);
}
- starts[id] = QTime::currentTime();
+ starts[id] = TQTime::currentTime();
}
void StopWatch::check(uint id)
{
if (id >= starts.size())
return;
- double time = starts[id].msecsTo(QTime::currentTime()) / 1000.0;
+ double time = starts[id].msecsTo(TQTime::currentTime()) / 1000.0;
totals[id] += time;
counts[id]++;
kdDebug() << k_funcinfo << "Timer_" << id << ": " << time << " s [" << counts[id] << " times, total: " << totals[id] << " s, average: " << totals[id] / counts[id] << " s]" << endl;
}
-QString Tools::textToHTML(const QString &text)
+TQString Tools::textToHTML(const TQString &text)
{
if (text.isEmpty())
return "<p></p>";
if (/*text.isEmpty() ||*/ text == " " || text == "&nbsp;")
return "<p>&nbsp;</p>";
- // convertFromPlainText() replace "\n\n" by "</p>\n<p>": we don't want that
- QString htmlString = QStyleSheet::convertFromPlainText(text, QStyleSheetItem::WhiteSpaceNormal);
- return htmlString.replace("</p>\n", "<br>\n<br>\n").replace("\n<p>", "\n"); // Don't replace first and last tags
+ // convertFromPlainText() tqreplace "\n\n" by "</p>\n<p>": we don't want that
+ TQString htmlString = TQStyleSheet::convertFromPlainText(text, TQStyleSheetItem::WhiteSpaceNormal);
+ return htmlString.tqreplace("</p>\n", "<br>\n<br>\n").tqreplace("\n<p>", "\n"); // Don't replace first and last tags
}
-QString Tools::textToHTMLWithoutP(const QString &text)
+TQString Tools::textToHTMLWithoutP(const TQString &text)
{
// textToHTML(text) return "<p>HTMLizedText</p>". We remove the strating "<p>" and ending </p>"
- QString HTMLizedText = textToHTML(text);
+ TQString HTMLizedText = textToHTML(text);
return HTMLizedText.mid(3, HTMLizedText.length() - 3 - 4);
}
-QString Tools::htmlToParagraph(const QString &html)
+TQString Tools::htmlToParagraph(const TQString &html)
{
- QString result = html;
+ TQString result = html;
bool startedBySpan = false;
// Remove the <html> start tag, all the <head> and the <body> start
// Because <body> can contain style="..." parameter, we transform it to <span>
- int pos = result.find("<body");
+ int pos = result.tqfind("<body");
if (pos != -1) {
result = "<span" + result.mid(pos + 5);
startedBySpan = true;
@@ -96,76 +96,76 @@ QString Tools::htmlToParagraph(const QString &html)
// Remove the ending "</p>\n</body></html>", each tag can be separated by space characters (%s)
// "</p>" can be omitted (eg. if the HTML doesn't contain paragraph but tables), as well as "</body>" (optinal)
- pos = result.find(QRegExp("(?:(?:</p>[\\s\\n\\r\\t]*)*</body>[\\s\\n\\r\\t]*)*</html>", false)); // Case unsensitive
+ pos = result.tqfind(TQRegExp("(?:(?:</p>[\\s\\n\\r\\t]*)*</body>[\\s\\n\\r\\t]*)*</html>", false)); // Case unsensitive
if (pos != -1)
result = result.left(pos);
if (startedBySpan)
result += "</span>";
- return result.replace("</p>", "<br><br>").replace("<p>", "");
+ return result.tqreplace("</p>", "<br><br>").tqreplace("<p>", "");
}
// The following is adapted from KStringHanlder::tagURLs
// The adaptation lies in the change to urlEx
// Thanks to Richard Heck
-QString Tools::tagURLs(const QString &text)
+TQString Tools::tagURLs(const TQString &text)
{
- QRegExp urlEx("(www\\.(?!\\.)|([a-zA-z]+)://)[\\d\\w\\./,:_~\\?=&;#@\\-\\+\\%\\$]+[\\d\\w/]");
+ TQRegExp urlEx("(www\\.(?!\\.)|([a-zA-z]+)://)[\\d\\w\\./,:_~\\?=&;#@\\-\\+\\%\\$]+[\\d\\w/]");
- QString richText(text);
+ TQString richText(text);
int urlPos = 0;
int urlLen;
while ((urlPos = urlEx.search(richText, urlPos)) >= 0) {
urlLen = urlEx.matchedLength();
- QString href = richText.mid(urlPos, urlLen);
- // Qt doesn't support (?<=pattern) so we do it here
+ TQString href = richText.mid(urlPos, urlLen);
+ // TQt doesn't support (?<=pattern) so we do it here
if ((urlPos > 0) && richText[urlPos-1].isLetterOrNumber()) {
urlPos++;
continue;
}
- QString anchor = "<a href=\"" + href + "\">" + href + "</a>";
- richText.replace(urlPos, urlLen, anchor);
+ TQString anchor = "<a href=\"" + href + "\">" + href + "</a>";
+ richText.tqreplace(urlPos, urlLen, anchor);
urlPos += anchor.length();
}
return richText;
}
-QString Tools::htmlToText(const QString &html)
+TQString Tools::htmlToText(const TQString &html)
{
- QString text = htmlToParagraph(html);
+ TQString text = htmlToParagraph(html);
text.remove("\n");
- text.replace("</h1>", "\n");
- text.replace("</h2>", "\n");
- text.replace("</h3>", "\n");
- text.replace("</h4>", "\n");
- text.replace("</h5>", "\n");
- text.replace("</h6>", "\n");
- text.replace("</li>", "\n");
- text.replace("</dt>", "\n");
- text.replace("</dd>", "\n");
- text.replace("<dd>", " ");
- text.replace("</div>","\n");
- text.replace("</blockquote>","\n");
- text.replace("</caption>","\n");
- text.replace("</tr>", "\n");
- text.replace("</th>", " ");
- text.replace("</td>", " ");
- text.replace("<br>", "\n");
- text.replace("<br />","\n");
+ text.tqreplace("</h1>", "\n");
+ text.tqreplace("</h2>", "\n");
+ text.tqreplace("</h3>", "\n");
+ text.tqreplace("</h4>", "\n");
+ text.tqreplace("</h5>", "\n");
+ text.tqreplace("</h6>", "\n");
+ text.tqreplace("</li>", "\n");
+ text.tqreplace("</dt>", "\n");
+ text.tqreplace("</dd>", "\n");
+ text.tqreplace("<dd>", " ");
+ text.tqreplace("</div>","\n");
+ text.tqreplace("</blockquote>","\n");
+ text.tqreplace("</caption>","\n");
+ text.tqreplace("</tr>", "\n");
+ text.tqreplace("</th>", " ");
+ text.tqreplace("</td>", " ");
+ text.tqreplace("<br>", "\n");
+ text.tqreplace("<br />","\n");
// FIXME: Format <table> tags better, if possible
// TODO: Replace &eacute; and co. by theire equivalent!
// To manage tags:
int pos = 0;
int pos2;
- QString tag, tag3;
+ TQString tag, tag3;
// To manage lists:
int deep = 0; // The deep of the current line in imbriqued lists
- QValueStack<bool> ul; // true if current list is a <ul> one, false if it's an <ol> one
- QValueStack<int> lines; // The line number if it is an <ol> list
+ TQValueStack<bool> ul; // true if current list is a <ul> one, false if it's an <ol> one
+ TQValueStack<int> lines; // The line number if it is an <ol> list
// We're removing every other tags, or replace them in the case of li:
- while ( (pos = text.find("<"), pos) != -1 ) {
+ while ( (pos = text.tqfind("<"), pos) != -1 ) {
// What is the current tag?
tag = text.mid(pos + 1, 2);
tag3 = text.mid(pos + 1, 3);
@@ -184,21 +184,21 @@ QString Tools::htmlToText(const QString &html)
lines.pop();
}
// Where the tag closes?
- pos2 = text.find(">");
+ pos2 = text.tqfind(">");
if (pos2 != -1) {
// Remove the tag:
text.remove(pos, pos2 - pos + 1);
// And replace li with "* ", "x. "... without forbidding to indent that:
if (tag == "li") {
// How many spaces before the line (indentation):
- QString spaces = "";
+ TQString spaces = "";
for (int i = 1; i < deep; i++)
spaces += " ";
// The bullet or number of the line:
- QString bullet = "* ";
+ TQString bullet = "* ";
if (ul.top() == false) {
lines.push(lines.pop() + 1);
- bullet = QString::number(lines.top()) + ". ";
+ bullet = TQString::number(lines.top()) + ". ";
}
// Insertion:
text.insert(pos, spaces + bullet);
@@ -209,36 +209,36 @@ QString Tools::htmlToText(const QString &html)
++pos;
}
- text.replace("&gt;", ">");
- text.replace("&lt;", "<");
- text.replace("&quot;", "\"");
- text.replace("&nbsp;", " ");
- text.replace("&amp;", "&"); // CONVERT IN LAST!!
+ text.tqreplace("&gt;", ">");
+ text.tqreplace("&lt;", "<");
+ text.tqreplace("&quot;", "\"");
+ text.tqreplace("&nbsp;", " ");
+ text.tqreplace("&amp;", "&"); // CONVERT IN LAST!!
return text;
}
-QString Tools::cssFontDefinition(const QFont &font, bool onlyFontFamily)
+TQString Tools::cssFontDefinition(const TQFont &font, bool onlyFontFamily)
{
// The font definition:
- QString definition = QString(font.italic() ? "italic " : "") +
- QString(font.bold() ? "bold " : "") +
- QString::number(QFontInfo(font).pixelSize()) + "px ";
+ TQString definition = TQString(font.italic() ? "italic " : "") +
+ TQString(font.bold() ? "bold " : "") +
+ TQString::number(TQFontInfo(font).pixelSize()) + "px ";
// Then, try to match the font name with a standard CSS font family:
- QString genericFont = "";
- if (definition.contains("serif", false) || definition.contains("roman", false))
+ TQString genericFont = "";
+ if (definition.tqcontains("serif", false) || definition.tqcontains("roman", false))
genericFont = "serif";
// No "else if" because "sans serif" must be counted as "sans". So, the order between "serif" and "sans" is important
- if (definition.contains("sans", false) || definition.contains("arial", false) || definition.contains("helvetica", false))
+ if (definition.tqcontains("sans", false) || definition.tqcontains("arial", false) || definition.tqcontains("helvetica", false))
genericFont = "sans-serif";
- if (definition.contains("mono", false) || definition.contains("courier", false) ||
- definition.contains("typewriter", false) || definition.contains("console", false) ||
- definition.contains("terminal", false) || definition.contains("news", false))
+ if (definition.tqcontains("mono", false) || definition.tqcontains("courier", false) ||
+ definition.tqcontains("typewriter", false) || definition.tqcontains("console", false) ||
+ definition.tqcontains("terminal", false) || definition.tqcontains("news", false))
genericFont = "monospace";
// Eventually add the generic font family to the definition:
- QString fontDefinition = "\"" + font.family() + "\"";
+ TQString fontDefinition = "\"" + font.family() + "\"";
if (!genericFont.isEmpty())
fontDefinition += ", " + genericFont;
@@ -248,7 +248,7 @@ QString Tools::cssFontDefinition(const QFont &font, bool onlyFontFamily)
return definition + fontDefinition;
}
-QString Tools::stripEndWhiteSpaces(const QString &string)
+TQString Tools::stripEndWhiteSpaces(const TQString &string)
{
uint length = string.length();
uint i;
@@ -263,7 +263,7 @@ QString Tools::stripEndWhiteSpaces(const QString &string)
-bool Tools::isWebColor(const QColor &color)
+bool Tools::isWebColor(const TQColor &color)
{
int r = color.red(); // The 216 web colors are those colors whose RGB (Red, Green, Blue)
int g = color.green(); // values are all in the set (0, 51, 102, 153, 204, 255).
@@ -277,25 +277,25 @@ bool Tools::isWebColor(const QColor &color)
b == 153 || b == 204 || b == 255 ) );
}
-QColor Tools::mixColor(const QColor &color1, const QColor &color2)
+TQColor Tools::mixColor(const TQColor &color1, const TQColor &color2)
{
- QColor mixedColor;
+ TQColor mixedColor;
mixedColor.setRgb( (color1.red() + color2.red()) / 2,
(color1.green() + color2.green()) / 2,
(color1.blue() + color2.blue()) / 2 );
return mixedColor;
}
-bool Tools::tooDark(const QColor &color)
+bool Tools::tooDark(const TQColor &color)
{
int dontCare, value;
- color.getHsv(/*hue:*/dontCare, /*saturation:*/dontCare, value);
+ color.getHsv(/*hue:*/&dontCare, /*saturation:*/&dontCare, &value);
return value < 175;
}
// TODO: Use it for all indentPixmap()
-QPixmap Tools::normalizePixmap(const QPixmap &pixmap, int width, int height)
+TQPixmap Tools::normalizePixmap(const TQPixmap &pixmap, int width, int height)
{
if (height <= 0)
height = width;
@@ -306,7 +306,7 @@ QPixmap Tools::normalizePixmap(const QPixmap &pixmap, int width, int height)
return pixmap;
}
-QPixmap Tools::indentPixmap(const QPixmap &source, int depth, int deltaX)
+TQPixmap Tools::indentPixmap(const TQPixmap &source, int depth, int deltaX)
{
// Verify if it is possible:
if (depth <= 0 || source.isNull())
@@ -318,8 +318,8 @@ QPixmap Tools::indentPixmap(const QPixmap &source, int depth, int deltaX)
int indent = depth * deltaX;
// Create the images:
- QImage resultImage(indent + source.width(), source.height(), 32);
- QImage sourceImage = source.convertToImage();
+ TQImage resultImage(indent + source.width(), source.height(), 32);
+ TQImage sourceImage = source.convertToImage();
resultImage.setAlphaBuffer(true);
// Clear the indent part (the left part) by making it fully transparent:
@@ -327,7 +327,7 @@ QPixmap Tools::indentPixmap(const QPixmap &source, int depth, int deltaX)
for (int row = 0; row < resultImage.height(); ++row) {
for (int column = 0; column < resultImage.width(); ++column) {
p = (uint *)resultImage.scanLine(row) + column;
- *p = 0; // qRgba(0, 0, 0, 0)
+ *p = 0; // tqRgba(0, 0, 0, 0)
}
}
@@ -342,49 +342,49 @@ QPixmap Tools::indentPixmap(const QPixmap &source, int depth, int deltaX)
}
// And return the result:
- QPixmap result;
+ TQPixmap result;
result.convertFromImage(resultImage);
return result;
}
#include <iostream>
-void Tools::deleteRecursively(const QString &folderOrFile)
+void Tools::deleteRecursively(const TQString &folderOrFile)
{
if (folderOrFile.isEmpty())
return;
- QFileInfo fileInfo(folderOrFile);
+ TQFileInfo fileInfo(folderOrFile);
if (fileInfo.isDir()) {
// Delete the child files:
- QDir dir(folderOrFile, QString::null, QDir::Name | QDir::IgnoreCase, QDir::All | QDir::Hidden);
- QStringList list = dir.entryList();
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
+ TQDir dir(folderOrFile, TQString(), TQDir::Name | TQDir::IgnoreCase, TQDir::All | TQDir::Hidden);
+ TQStringList list = dir.entryList();
+ for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
if ( *it != "." && *it != ".." )
deleteRecursively(folderOrFile + "/" + *it);
// And then delete the folder:
dir.rmdir(folderOrFile);
} else
// Delete the file:
- QFile::remove(folderOrFile);
+ TQFile::remove(folderOrFile);
}
-QString Tools::fileNameForNewFile(const QString &wantedName, const QString &destFolder)
+TQString Tools::fileNameForNewFile(const TQString &wantedName, const TQString &destFolder)
{
- QString fileName = wantedName;
- QString fullName = destFolder + fileName;
- QString extension = "";
+ TQString fileName = wantedName;
+ TQString fullName = destFolder + fileName;
+ TQString extension = "";
int number = 2;
- QDir dir;
+ TQDir dir;
// First check if the file do not exists yet (simplier and more often case)
- dir = QDir(fullName);
+ dir = TQDir(fullName);
if ( ! dir.exists(fullName) )
return fileName;
// Find the file extension, if it exists : Split fileName in fileName and extension
// Example : fileName == "note5-3.txt" => fileName = "note5-3" and extension = ".txt"
- int extIndex = fileName.findRev('.');
+ int extIndex = fileName.tqfindRev('.');
if (extIndex != -1 && extIndex != int(fileName.length()-1)) { // Extension found and fileName do not ends with '.' !
extension = fileName.mid(extIndex);
fileName.truncate(extIndex);
@@ -392,7 +392,7 @@ QString Tools::fileNameForNewFile(const QString &wantedName, const QString &dest
// Find the file number, if it exists : Split fileName in fileName and number
// Example : fileName == "note5-3" => fileName = "note5" and number = 3
- int extNumber = fileName.findRev('-');
+ int extNumber = fileName.tqfindRev('-');
if (extNumber != -1 && extNumber != int(fileName.length()-1)) { // Number found and fileName do not ends with '-' !
bool isANumber;
int theNumber = fileName.mid(extNumber + 1).toInt(&isANumber);
@@ -402,11 +402,11 @@ QString Tools::fileNameForNewFile(const QString &wantedName, const QString &dest
} // else :
} // else fileName = fileName and number = 2 (because if the file already exists, the genereated name is at last the 2nd)
- QString finalName;
+ TQString finalName;
for (/*int number = 2*/; ; ++number) { // TODO: FIXME: If overflow ???
- finalName = fileName + "-" + QString::number(number) + extension;
+ finalName = fileName + "-" + TQString::number(number) + extension;
fullName = destFolder + finalName;
- dir = QDir(fullName);
+ dir = TQDir(fullName);
if ( ! dir.exists(fullName) )
break;
}
@@ -416,28 +416,28 @@ QString Tools::fileNameForNewFile(const QString &wantedName, const QString &dest
// TODO: Move it from NoteFactory
-/*QString NoteFactory::iconForURL(const KURL &url)
+/*TQString NoteFactory::iconForURL(const KURL &url)
{
- QString icon = KMimeType::iconForURL(url.url());
+ TQString icon = KMimeType::iconForURL(url.url());
if ( url.protocol() == "mailto" )
icon = "message";
return icon;
}*/
-bool Tools::isAFileCut(QMimeSource *source)
+bool Tools::isAFileCut(TQMimeSource *source)
{
if (source->provides("application/x-kde-cutselection")) {
- QByteArray array = source->encodedData("application/x-kde-cutselection");
- return !array.isEmpty() && QCString(array.data(), array.size() + 1).at(0) == '1';
+ TQByteArray array = source->tqencodedData("application/x-kde-cutselection");
+ return !array.isEmpty() && TQCString(array.data(), array.size() + 1).at(0) == '1';
} else
return false;
}
-void Tools::printChildren(QObject* parent)
+void Tools::printChildren(TQObject* tqparent)
{
- const QObjectList* objs = parent->children();
- QObjectListIt it(*objs);
- QObject *obj;
+ const TQObjectList objs = tqparent->childrenListObject();
+ TQObjectListIt it(objs);
+ TQObject *obj;
while((obj = it.current())!= 0){
++it;
diff --git a/src/tools.h b/src/tools.h
index 338abfd..a925638 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -21,9 +21,9 @@
#ifndef TOOLS_H
#define TOOLS_H
-class QString;
-class QColor;
-class QMimeSource;
+class TQString;
+class TQColor;
+class TQMimeSource;
class StopWatch
{
@@ -31,9 +31,9 @@ class StopWatch
static void start(uint id);
static void check(uint id);
private:
- static QMemArray<QTime> starts;
- static QMemArray<double> totals;
- static QMemArray<uint> counts;
+ static TQMemArray<TQTime> starts;
+ static TQMemArray<double> totals;
+ static TQMemArray<uint> counts;
};
/** Some useful functions for that application.
@@ -42,54 +42,54 @@ class StopWatch
namespace Tools
{
// Text <-> HTML Conversions and Tools:
- QString textToHTML(const QString &text);
- QString textToHTMLWithoutP(const QString &text);
- QString htmlToParagraph(const QString &html);
- QString htmlToText(const QString &html);
- QString tagURLs(const QString &test);
- QString cssFontDefinition(const QFont &font, bool onlyFontFamily = false);
+ TQString textToHTML(const TQString &text);
+ TQString textToHTMLWithoutP(const TQString &text);
+ TQString htmlToParagraph(const TQString &html);
+ TQString htmlToText(const TQString &html);
+ TQString tagURLs(const TQString &test);
+ TQString cssFontDefinition(const TQFont &font, bool onlyFontFamily = false);
// String Manipulations:
- QString stripEndWhiteSpaces(const QString &string);
+ TQString stripEndWhiteSpaces(const TQString &string);
// Pixmap Manipulations:
/** @Return true if it is a Web color
*/
- bool isWebColor(const QColor &color);
+ bool isWebColor(const TQColor &color);
/** @Return a color that is 50% of @p color1 and 50% of @p color2.
*/
- QColor mixColor(const QColor &color1, const QColor &color2);
+ TQColor mixColor(const TQColor &color1, const TQColor &color2);
/** @Return true if the color is too dark to be darkened one more time.
*/
- bool tooDark(const QColor &color);
+ bool tooDark(const TQColor &color);
/** Make sure the @p pixmap is of the size (@p width, @p height) and @return a pixmap of this size.
* If @p height <= 0, then width will be used to make the picture square.
*/
- QPixmap normalizePixmap(const QPixmap &pixmap, int width, int height = 0);
+ TQPixmap normalizePixmap(const TQPixmap &pixmap, int width, int height = 0);
/** @Return the pixmap @p source with depth*deltaX transparent pixels added to the left.\n
* If @p deltaX is <= 0, then an indent delta is computed depending on the @p source width.
*/
- QPixmap indentPixmap(const QPixmap &source, int depth, int deltaX = 0);
+ TQPixmap indentPixmap(const TQPixmap &source, int depth, int deltaX = 0);
// File and Folder Manipulations:
/** Delete the folder @p folderOrFile recursively (to remove sub-folders and child files too).
*/
- void deleteRecursively(const QString &folderOrFile);
+ void deleteRecursively(const TQString &folderOrFile);
/** @Return a new filename that doesn't already exist in @p destFolder.
* If @p wantedName alread exist in @p destFolder, a dash and a number will be added before the extenssion.
* Id there were already such a number in @p wantedName, it is incremented until a free filename is found.
*/
- QString fileNameForNewFile(const QString &wantedName, const QString &destFolder);
+ TQString fileNameForNewFile(const TQString &wantedName, const TQString &destFolder);
// Other:
//void iconForURL(const KURL &url);
/** @Return true if the source is from a file cutting in Konqueror.
* @Return false if it was just a copy or if it was a drag.
*/
- bool isAFileCut(QMimeSource *source);
+ bool isAFileCut(TQMimeSource *source);
// Debug
- void printChildren(QObject* parent);
+ void printChildren(TQObject* tqparent);
}
#endif // TOOLS_H
diff --git a/src/variouswidgets.cpp b/src/variouswidgets.cpp
index 3d0fa74..7be265f 100644
--- a/src/variouswidgets.cpp
+++ b/src/variouswidgets.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2003 by Sébastien Laoût *
+ * Copyright (C) 2003 by S�bastien Lao�t *
* slaout@linux62.org *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -18,40 +18,40 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qlabel.h>
-#include <qsizegrip.h>
-#include <qpushbutton.h>
-#include <qstring.h>
-#include <qsizepolicy.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqlabel.h>
+#include <tqsizegrip.h>
+#include <tqpushbutton.h>
+#include <tqstring.h>
+#include <tqsizepolicy.h>
#include <kopenwith.h>
#include <klocale.h>
-#include <qwhatsthis.h>
+#include <tqwhatsthis.h>
#include <kiconview.h>
#include <kiconloader.h>
-#include <qdragobject.h>
-#include <qfontdatabase.h>
+#include <tqdragobject.h>
+#include <tqfontdatabase.h>
#include "variouswidgets.h"
/** class RunCommandRequester: */
-RunCommandRequester::RunCommandRequester(const QString &runCommand, const QString &message, QWidget *parent, const char *name)
- : QWidget(parent, name)
+RunCommandRequester::RunCommandRequester(const TQString &runCommand, const TQString &message, TQWidget *tqparent, const char *name)
+ : TQWidget(tqparent, name)
{
m_message = message;
- QHBoxLayout *layout = new QHBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
- m_runCommand = new QLineEdit(runCommand, this);
- QPushButton *pb = new QPushButton(/*"C&hoose..."*/i18n("..."), this);
+ TQHBoxLayout *tqlayout = new TQHBoxLayout(this, /*margin=*/0, KDialogBase::spacingHint());
+ m_runCommand = new TQLineEdit(runCommand, this);
+ TQPushButton *pb = new TQPushButton(/*"C&hoose..."*/i18n("..."), this);
- pb->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ pb->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
- layout->addWidget(m_runCommand);
- layout->addWidget(pb);
+ tqlayout->addWidget(m_runCommand);
+ tqlayout->addWidget(pb);
- connect( pb, SIGNAL(clicked()), this, SLOT(slotSelCommand()) );
+ connect( pb, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSelCommand()) );
}
RunCommandRequester::~RunCommandRequester()
@@ -66,20 +66,20 @@ void RunCommandRequester::slotSelCommand()
m_runCommand->setText(dlg->text());
}
-QString RunCommandRequester::runCommand()
+TQString RunCommandRequester::runCommand()
{
return m_runCommand->text();
}
-void RunCommandRequester::setRunCommand(const QString &runCommand)
+void RunCommandRequester::setRunCommand(const TQString &runCommand)
{
m_runCommand->setText(runCommand);
}
/** class IconSizeCombo: */
-IconSizeCombo::IconSizeCombo(bool rw, QWidget *parent, const char *name)
- : QComboBox(rw, parent, name)
+IconSizeCombo::IconSizeCombo(bool rw, TQWidget *tqparent, const char *name)
+ : TQComboBox(rw, tqparent, name)
{
insertItem(i18n("16 by 16 pixels"));
insertItem(i18n("22 by 22 pixels"));
@@ -122,18 +122,18 @@ void IconSizeCombo::setSize(int size)
/** class ViewSizeDialog: */
-ViewSizeDialog::ViewSizeDialog(QWidget *parent, int w, int h)
- : QDialog(parent, "ViewSizeDialog")
+ViewSizeDialog::ViewSizeDialog(TQWidget *tqparent, int w, int h)
+ : TQDialog(tqparent, "ViewSizeDialog")
{
- QLabel *label = new QLabel(i18n(
+ TQLabel *label = new TQLabel(i18n(
"Resize the window to select the image size\n"
"and close it or press Escape to accept changes."), this);
label->move(8, 8);
- label->setFixedSize( label->sizeHint() );
+ label->setFixedSize( label->tqsizeHint() );
// setSizeGripEnabled(true) doesn't work (the grip stay at the same place), so we emulate it:
- m_sizeGrip = new QSizeGrip(this);
- m_sizeGrip->setFixedSize( m_sizeGrip->sizeHint() );
+ m_sizeGrip = new TQSizeGrip(this);
+ m_sizeGrip->setFixedSize( m_sizeGrip->tqsizeHint() );
setGeometry(x(), y(), w, h);
}
@@ -142,19 +142,19 @@ ViewSizeDialog::~ViewSizeDialog()
{
}
-void ViewSizeDialog::resizeEvent(QResizeEvent *)
+void ViewSizeDialog::resizeEvent(TQResizeEvent *)
{
- setCaption( i18n("%1 by %2 pixels").arg(QString::number(width())).arg(QString::number(height())) );
+ setCaption( i18n("%1 by %2 pixels").tqarg(TQString::number(width())).tqarg(TQString::number(height())) );
m_sizeGrip->move( width() - m_sizeGrip->width(), height() - m_sizeGrip->height() );
}
/** class HelpLabel: */
-HelpLabel::HelpLabel(const QString &text, const QString &message, QWidget *parent)
- : KURLLabel(parent), m_message(message)
+HelpLabel::HelpLabel(const TQString &text, const TQString &message, TQWidget *tqparent)
+ : KURLLabel(tqparent), m_message(message)
{
setText(text);
- connect( this, SIGNAL(leftClickedURL()), this, SLOT(showMessage()) );
+ connect( this, TQT_SIGNAL(leftClickedURL()), this, TQT_SLOT(showMessage()) );
}
HelpLabel::~HelpLabel()
@@ -163,12 +163,12 @@ HelpLabel::~HelpLabel()
void HelpLabel::showMessage()
{
- QWhatsThis::display(m_message, mapToGlobal( QPoint(width() / 2, height()) ));
+ TQWhatsThis::display(m_message, mapToGlobal( TQPoint(width() / 2, height()) ));
}
-void HelpLabel::keyPressEvent(QKeyEvent *event)
+void HelpLabel::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Space)
+ if (event->key() == TQt::Key_Space)
showMessage();
else
KURLLabel::keyPressEvent(event);
@@ -179,18 +179,18 @@ void HelpLabel::keyPressEvent(QKeyEvent *event)
class UndraggableKIconView : public KIconView
{
public:
- UndraggableKIconView(QWidget * parent = 0, const char * name = 0, WFlags f = 0) : KIconView(parent, name, f) {}
- QDragObject* dragObject() { return 0; }
+ UndraggableKIconView(TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0) : KIconView(tqparent, name, f) {}
+ TQDragObject* dragObject() { return 0; }
};
-IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent)
+IconSizeDialog::IconSizeDialog(const TQString &caption, const TQString &message, const TQString &icon, int iconSize, TQWidget *tqparent)
: KDialogBase(KDialogBase::Swallow, caption, KDialogBase::Ok | KDialogBase::Cancel,
- KDialogBase::Ok, parent, /*name=*/0, /*modal=*/true, /*separator=*/false)
+ KDialogBase::Ok, tqparent, /*name=*/0, /*modal=*/true, /*separator=*/false)
{
- QWidget *page = new QWidget(this);
- QVBoxLayout *topLayout = new QVBoxLayout(page, /*margin=*/0, spacingHint());
+ TQWidget *page = new TQWidget(this);
+ TQVBoxLayout *topLayout = new TQVBoxLayout(page, /*margin=*/0, spacingHint());
- QLabel *label = new QLabel(message, page);
+ TQLabel *label = new TQLabel(message, page);
topLayout->addWidget(label);
KIconView *iconView = new UndraggableKIconView(page);
@@ -216,9 +216,9 @@ IconSizeDialog::IconSizeDialog(const QString &caption, const QString &message, c
case 128: iconView->setSelected(m_size128, true); m_iconSize = 128; break;
}
- connect( iconView, SIGNAL(executed(QIconViewItem*)), this, SLOT(choose(QIconViewItem*)) );
- connect( iconView, SIGNAL(returnPressed(QIconViewItem*)), this, SLOT(choose(QIconViewItem*)) );
- connect( iconView, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) );
+ connect( iconView, TQT_SIGNAL(executed(TQIconViewItem*)), this, TQT_SLOT(choose(TQIconViewItem*)) );
+ connect( iconView, TQT_SIGNAL(returnPressed(TQIconViewItem*)), this, TQT_SLOT(choose(TQIconViewItem*)) );
+ connect( iconView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()) );
setMainWidget(page);
}
@@ -249,7 +249,7 @@ void IconSizeDialog::slotSelectionChanged()
}
}
-void IconSizeDialog::choose(QIconViewItem*)
+void IconSizeDialog::choose(TQIconViewItem*)
{
actionButton(KDialogBase::Ok)->animateClick();
}
@@ -262,19 +262,19 @@ void IconSizeDialog::slotCancel()
/** class FontSizeCombo: */
-FontSizeCombo::FontSizeCombo(bool rw, bool withDefault, QWidget *parent, const char *name)
- : KComboBox(rw, parent, name), m_withDefault(withDefault)
+FontSizeCombo::FontSizeCombo(bool rw, bool withDefault, TQWidget *tqparent, const char *name)
+ : KComboBox(rw, tqparent, name), m_withDefault(withDefault)
{
if (m_withDefault)
insertItem(i18n("(Default)"));
- QFontDatabase fontDB;
- QValueList<int> sizes = fontDB.standardSizes();
- for (QValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it)
- insertItem(QString::number(*it));
+ TQFontDatabase fontDB;
+ TQValueList<int> sizes = fontDB.tqstandardSizes();
+ for (TQValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it)
+ insertItem(TQString::number(*it));
-// connect( this, SIGNAL(acivated(const QString&)), this, SLOT(textChangedInCombo(const QString&)) );
- connect( this, SIGNAL(textChanged(const QString&)), this, SLOT(textChangedInCombo(const QString&)) );
+// connect( this, TQT_SIGNAL(acivated(const TQString&)), this, TQT_SLOT(textChangedInCombo(const TQString&)) );
+ connect( this, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(textChangedInCombo(const TQString&)) );
// TODO: 01617 void KFontSizeAction::setFontSize( int size )
}
@@ -283,7 +283,7 @@ FontSizeCombo::~FontSizeCombo()
{
}
-void FontSizeCombo::textChangedInCombo(const QString &text)
+void FontSizeCombo::textChangedInCombo(const TQString &text)
{
bool ok = false;
int size = text.toInt(&ok);
@@ -291,11 +291,11 @@ void FontSizeCombo::textChangedInCombo(const QString &text)
emit sizeChanged(size);
}
-void FontSizeCombo::keyPressEvent(QKeyEvent *event)
+void FontSizeCombo::keyPressEvent(TQKeyEvent *event)
{
- if (event->key() == Qt::Key_Escape)
+ if (event->key() == TQt::Key_Escape)
emit escapePressed();
- else if (event->key() == Qt::Key_Return)
+ else if (event->key() == TQt::Key_Return)
emit returnPressed2();
else
KComboBox::keyPressEvent(event);
@@ -303,7 +303,7 @@ void FontSizeCombo::keyPressEvent(QKeyEvent *event)
void FontSizeCombo::setFontSize(int size)
{
- setCurrentText(QString::number(size));
+ setCurrentText(TQString::number(size));
// TODO: SEE KFontSizeAction::setFontSize( int size ) !!! for a more complete method!
}
diff --git a/src/variouswidgets.h b/src/variouswidgets.h
index c579b72..45fde52 100644
--- a/src/variouswidgets.h
+++ b/src/variouswidgets.h
@@ -21,47 +21,49 @@
#ifndef VARIOUSWIDGETS_H
#define VARIOUSWIDGETS_H
-#include <qwidget.h>
+#include <tqwidget.h>
#include <kcombobox.h>
-#include <qdialog.h>
+#include <tqdialog.h>
#include <kurllabel.h>
-#include <qstring.h>
+#include <tqstring.h>
#include <kdialogbase.h>
-class QLineEdit;
+class TQLineEdit;
class KIconViewItem;
-class QIconViewItem;
+class TQIconViewItem;
class Basket;
/** A widget to select a command to run,
- * with a QLineEdit and a QPushButton.
+ * with a TQLineEdit and a TQPushButton.
* @author Sébastien Laoût
*/
-class RunCommandRequester : public QWidget
+class RunCommandRequester : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- RunCommandRequester(const QString &runCommand, const QString &message, QWidget *parent = 0, const char *name = 0);
+ RunCommandRequester(const TQString &runCommand, const TQString &message, TQWidget *tqparent = 0, const char *name = 0);
~RunCommandRequester();
- QString runCommand();
- void setRunCommand(const QString &runCommand);
- QLineEdit *lineEdit() { return m_runCommand; }
+ TQString runCommand();
+ void setRunCommand(const TQString &runCommand);
+ TQLineEdit *lineEdit() { return m_runCommand; }
private slots:
void slotSelCommand();
private:
- QLineEdit *m_runCommand;
- QString m_message;
+ TQLineEdit *m_runCommand;
+ TQString m_message;
};
-/** QComboBox to ask icon size
+/** TQComboBox to ask icon size
* @author Sébastien Laoût
*/
-class IconSizeCombo : public QComboBox
+class IconSizeCombo : public TQComboBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- IconSizeCombo(bool rw, QWidget *parent = 0, const char *name = 0);
+ IconSizeCombo(bool rw, TQWidget *tqparent = 0, const char *name = 0);
~IconSizeCombo();
int iconSize();
void setSize(int size);
@@ -71,15 +73,16 @@ class IconSizeCombo : public QComboBox
* TODO: Create a SizePushButton or even SizeWidget
* @author Sébastien Laoût
*/
-class ViewSizeDialog : public QDialog
+class ViewSizeDialog : public TQDialog
{
Q_OBJECT
+ TQ_OBJECT
public:
- ViewSizeDialog(QWidget *parent, int w, int h);
+ ViewSizeDialog(TQWidget *tqparent, int w, int h);
~ViewSizeDialog();
private:
- virtual void resizeEvent(QResizeEvent *);
- QWidget *m_sizeGrip;
+ virtual void resizeEvent(TQResizeEvent *);
+ TQWidget *m_sizeGrip;
};
/** A label displaying a link that, once clicked, offer a What's This messageBox to help users.
@@ -88,17 +91,18 @@ class ViewSizeDialog : public QDialog
class HelpLabel : public KURLLabel
{
Q_OBJECT
+ TQ_OBJECT
public:
- HelpLabel(const QString &text, const QString &message, QWidget *parent);
+ HelpLabel(const TQString &text, const TQString &message, TQWidget *tqparent);
~HelpLabel();
- QString message() { return m_message; }
+ TQString message() { return m_message; }
public slots:
- void setMessage(const QString &message) { m_message = message; }
+ void setMessage(const TQString &message) { m_message = message; }
void showMessage();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
private:
- QString m_message;
+ TQString m_message;
};
/** A dialog to choose the size of an icon.
@@ -107,14 +111,15 @@ class HelpLabel : public KURLLabel
class IconSizeDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- IconSizeDialog(const QString &caption, const QString &message, const QString &icon, int iconSize, QWidget *parent);
+ IconSizeDialog(const TQString &caption, const TQString &message, const TQString &icon, int iconSize, TQWidget *tqparent);
~IconSizeDialog();
int iconSize() { return m_iconSize; } /// << @return the choosen icon size (16, 32, ...) or -1 if canceled!
protected slots:
void slotCancel();
void slotSelectionChanged();
- void choose(QIconViewItem*);
+ void choose(TQIconViewItem*);
private:
KIconViewItem *m_size16;
KIconViewItem *m_size22;
@@ -126,24 +131,25 @@ class IconSizeDialog : public KDialogBase
};
/**
- * A missing class from KDE (and Qt): a combobox to select a font size!
+ * A missing class from KDE (and TQt): a combobox to select a font size!
*/
class FontSizeCombo : public KComboBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- FontSizeCombo(bool rw, bool withDefault, QWidget *parent = 0, const char *name = 0);
+ FontSizeCombo(bool rw, bool withDefault, TQWidget *tqparent = 0, const char *name = 0);
~FontSizeCombo();
void setFontSize(int size);
int fontSize();
protected:
- void keyPressEvent(QKeyEvent *event);
+ void keyPressEvent(TQKeyEvent *event);
signals:
void sizeChanged(int size);
void escapePressed();
void returnPressed2();
private slots:
- void textChangedInCombo(const QString &text);
+ void textChangedInCombo(const TQString &text);
private:
bool m_withDefault;
};
diff --git a/src/xmlwork.cpp b/src/xmlwork.cpp
index 92c2aca..41eefc5 100644
--- a/src/xmlwork.cpp
+++ b/src/xmlwork.cpp
@@ -18,24 +18,24 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <qstring.h>
-#include <qdom.h>
-#include <qstringlist.h>
-#include <qfile.h>
+#include <tqstring.h>
+#include <tqdom.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
#include "xmlwork.h"
-QDomDocument* XMLWork::openFile(const QString &name, const QString &filePath)
+TQDomDocument* XMLWork::openFile(const TQString &name, const TQString &filePath)
{
- QDomDocument *doc = new QDomDocument(name);
- QFile file(filePath);
+ TQDomDocument *doc = new TQDomDocument(name);
+ TQFile file(filePath);
if ( ! file.open(IO_ReadOnly) ) {
- // QMessageBox::information(this, "Load an XML file", "Error : un-openable file");
+ // TQMessageBox::information(this, "Load an XML file", "Error : un-openable file");
delete doc;
return 0;
}
if ( ! doc->setContent(&file) ) {
- // QMessageBox::information(this, "Load an XML file", "Error : malformed content");
+ // TQMessageBox::information(this, "Load an XML file", "Error : malformed content");
file.close();
delete doc;
return 0;
@@ -44,13 +44,13 @@ QDomDocument* XMLWork::openFile(const QString &name, const QString &filePath)
return doc;
}
-QDomElement XMLWork::getElement(const QDomElement &startElement, const QString &elementPath)
+TQDomElement XMLWork::getElement(const TQDomElement &startElement, const TQString &elementPath)
{
- QStringList elements = QStringList::split("/", elementPath, false);
- QDomNode n = startElement.firstChild();
+ TQStringList elements = TQStringList::split("/", elementPath, false);
+ TQDomNode n = startElement.firstChild();
for (unsigned int i = 0; i < elements.count(); ++i) { // For each elements
while ( ! n.isNull() ) { // Browse theire sub elements
- QDomElement e = n.toElement(); // and search the good one
+ TQDomElement e = n.toElement(); // and search the good one
if ( (!e.isNull()) && e.tagName() == *elements.at(i) ) { // If found
if ( i + 1 == elements.count() ) // And if it is the asked element
return e; // Return the first corresponding
@@ -62,27 +62,27 @@ QDomElement XMLWork::getElement(const QDomElement &startElement, const QString &
n = n.nextSibling();
}
}
- return QDomElement(); // Not found !
+ return TQDomElement(); // Not found !
}
-QString XMLWork::getElementText(const QDomElement &startElement, const QString &elementPath, const QString &defaultTxt)
+TQString XMLWork::getElementText(const TQDomElement &startElement, const TQString &elementPath, const TQString &defaultTxt)
{
- QDomElement e = getElement(startElement, elementPath);
+ TQDomElement e = getElement(startElement, elementPath);
if (e.isNull())
return defaultTxt;
else
return e.text();
}
-void XMLWork::addElement(QDomDocument &document, QDomElement &parent, const QString &name, const QString &text)
+void XMLWork::addElement(TQDomDocument &document, TQDomElement &tqparent, const TQString &name, const TQString &text)
{
- QDomElement tag = document.createElement(name);
- parent.appendChild(tag);
- QDomText content = document.createTextNode(text);
+ TQDomElement tag = document.createElement(name);
+ tqparent.appendChild(tag);
+ TQDomText content = document.createTextNode(text);
tag.appendChild(content);
}
-bool XMLWork::trueOrFalse(const QString &value, bool defaultValue)
+bool XMLWork::trueOrFalse(const TQString &value, bool defaultValue)
{
if ( value == "true" || value == "1" || value == "on" || value == "yes" )
return true;
@@ -91,19 +91,19 @@ bool XMLWork::trueOrFalse(const QString &value, bool defaultValue)
return defaultValue;
}
-QString XMLWork::trueOrFalse(bool value)
+TQString XMLWork::trueOrFalse(bool value)
{
return value ? "true" : "false";
}
-QString XMLWork::innerXml(QDomElement &element)
+TQString XMLWork::innerXml(TQDomElement &element)
{
- QString inner;
- for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling())
+ TQString inner;
+ for (TQDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling())
if (n.isCharacterData())
inner += n.toCharacterData().data();
else if (n.isElement()) {
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
inner += "<" + e.tagName() + ">" + innerXml(e) + "</" + e.tagName() + ">";
}
return inner;
diff --git a/src/xmlwork.h b/src/xmlwork.h
index e4d1cae..7f62b0f 100644
--- a/src/xmlwork.h
+++ b/src/xmlwork.h
@@ -21,9 +21,9 @@
#ifndef XMLWORKXMLWORK_H
#define XMLWORKXMLWORK_H
-class QString;
-class QDomDocument;
-class QDomElement;
+class TQString;
+class TQDomDocument;
+class TQDomElement;
/** All related functions to manage XML files and trees
* @author Sébastien Laoût
@@ -31,15 +31,15 @@ class QDomElement;
namespace XMLWork
{
// Manage XML files :
- QDomDocument* openFile(const QString &name, const QString &filePath);
+ TQDomDocument* openFile(const TQString &name, const TQString &filePath);
// Manage XML trees :
- QDomElement getElement(const QDomElement &startElement, const QString &elementPath);
- QString getElementText(const QDomElement &startElement, const QString &elementPath, const QString &defaultTxt = "");
- void addElement(QDomDocument &document, QDomElement &parent, const QString &name, const QString &text);
- QString innerXml(QDomElement &element);
+ TQDomElement getElement(const TQDomElement &startElement, const TQString &elementPath);
+ TQString getElementText(const TQDomElement &startElement, const TQString &elementPath, const TQString &defaultTxt = "");
+ void addElement(TQDomDocument &document, TQDomElement &tqparent, const TQString &name, const TQString &text);
+ TQString innerXml(TQDomElement &element);
// Not directly related to XML :
- bool trueOrFalse(const QString &value, bool defaultValue = true);
- QString trueOrFalse(bool value);
+ bool trueOrFalse(const TQString &value, bool defaultValue = true);
+ TQString trueOrFalse(bool value);
}
#endif // XMLWORKXMLWORK_H