summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor/kimagemapeditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kimagemapeditor/kimagemapeditor.cpp')
-rw-r--r--kimagemapeditor/kimagemapeditor.cpp542
1 files changed, 271 insertions, 271 deletions
diff --git a/kimagemapeditor/kimagemapeditor.cpp b/kimagemapeditor/kimagemapeditor.cpp
index ebfb0c7f..6a71f3a6 100644
--- a/kimagemapeditor/kimagemapeditor.cpp
+++ b/kimagemapeditor/kimagemapeditor.cpp
@@ -19,24 +19,24 @@
#include <assert.h>
// QT
-#include <qlayout.h>
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
-#include <qpixmap.h>
-#include <qcombobox.h>
-#include <qsplitter.h>
-#include <qfileinfo.h>
-#include <qmultilineedit.h>
-#include <qtextstream.h>
-#include <qpopupmenu.h>
-#include <qdict.h>
-#include <qwhatsthis.h>
-#include <qtooltip.h>
-#include <qpainter.h>
-#include <qtabwidget.h>
-#include <qfontdatabase.h>
-#include <qfile.h>
+#include <tqlayout.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
+#include <tqpixmap.h>
+#include <tqcombobox.h>
+#include <tqsplitter.h>
+#include <tqfileinfo.h>
+#include <tqmultilineedit.h>
+#include <tqtextstream.h>
+#include <tqpopupmenu.h>
+#include <tqdict.h>
+#include <tqwhatsthis.h>
+#include <tqtooltip.h>
+#include <tqpainter.h>
+#include <tqtabwidget.h>
+#include <tqfontdatabase.h>
+#include <tqfile.h>
// KDE
#include <kcommand.h>
@@ -61,7 +61,7 @@
#if KDE_IS_VERSION(3,1,90)
#include <kinputdialog.h>
#else
-#include <qinputdialog.h>
+#include <tqinputdialog.h>
#endif
// local
@@ -84,8 +84,8 @@
typedef KParts::GenericFactory<KImageMapEditor> KimeFactory;
K_EXPORT_COMPONENT_FACTORY( libkimagemapeditor , KimeFactory )
-KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
- QObject *parent, const char *name, const QStringList & )
+KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
+ TQObject *parent, const char *name, const TQStringList & )
: KParts::ReadWritePart(parent,name)
{
setInstance( KimeFactory::instance() );
@@ -95,7 +95,7 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
// Test if the MainWindow can handle DockWindows, if so create DockWidgets
// instead of a Splitter
mainDock = dynamic_cast<KDockMainWindow*>(parent) ;
- QSplitter * splitter = 0L;
+ TQSplitter * splitter = 0L;
tabWidget = 0L;
if (mainDock) {
@@ -118,15 +118,15 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
mapsDock->manualDock( (KDockWidget*) areaDock, KDockWidget::DockCenter);
imagesDock->manualDock( (KDockWidget*) mapsDock, KDockWidget::DockCenter);
- connect( mainDock->manager(), SIGNAL(change()), this, SLOT(dockingStateChanged()));
+ connect( mainDock->manager(), TQT_SIGNAL(change()), this, TQT_SLOT(dockingStateChanged()));
}
else
{
areaDock = 0L;
mapsDock = 0L;
imagesDock = 0L;
- splitter = new QSplitter(parentWidget);
- tabWidget = new QTabWidget(splitter);
+ splitter = new TQSplitter(parentWidget);
+ tabWidget = new TQTabWidget(splitter);
areaListView = new AreaListView(tabWidget,"AreaListView");
mapsListView = new MapsListView(tabWidget, "MapsListView");
imagesListView = new ImagesListView(tabWidget, "ImagesListView");
@@ -137,30 +137,30 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
}
- connect( areaListView->listView, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()));
- connect( areaListView->listView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(showTagEditor(QListViewItem*)));
- connect( areaListView->listView, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowPopupMenu(QListViewItem*,const QPoint &)));
+ connect( areaListView->listView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(slotSelectionChanged()));
+ connect( areaListView->listView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), this, TQT_SLOT(showTagEditor(TQListViewItem*)));
+ connect( areaListView->listView, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowPopupMenu(TQListViewItem*,const TQPoint &)));
- connect( mapsListView, SIGNAL( mapSelected(const QString &)),
- this, SLOT( setMap(const QString &)));
+ connect( mapsListView, TQT_SIGNAL( mapSelected(const TQString &)),
+ this, TQT_SLOT( setMap(const TQString &)));
- connect( mapsListView, SIGNAL( mapRenamed(const QString &)),
- this, SLOT( setMapName(const QString &)));
+ connect( mapsListView, TQT_SIGNAL( mapRenamed(const TQString &)),
+ this, TQT_SLOT( setMapName(const TQString &)));
- connect( mapsListView->listView(), SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowMapPopupMenu(QListViewItem*,const QPoint &)));
+ connect( mapsListView->listView(), TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowMapPopupMenu(TQListViewItem*,const TQPoint &)));
- connect( imagesListView, SIGNAL( imageSelected(const KURL &)),
- this, SLOT( setPicture(const KURL &)));
+ connect( imagesListView, TQT_SIGNAL( imageSelected(const KURL &)),
+ this, TQT_SLOT( setPicture(const KURL &)));
- connect( imagesListView, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint &,int)), this,
- SLOT(slotShowImagePopupMenu(QListViewItem*,const QPoint &)));
+ connect( imagesListView, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint &,int)), this,
+ TQT_SLOT(slotShowImagePopupMenu(TQListViewItem*,const TQPoint &)));
// Shows the text:
// "Drop an image or html file"
-/* QString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/dropimage.png" ) + "kimagemapeditor/dropimage.png";
- if ( ! QFileInfo(path).exists() ) {
+/* TQString path = KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/dropimage.png" ) + "kimagemapeditor/dropimage.png";
+ if ( ! TQFileInfo(path).exists() ) {
kdError() << "Couldn't find needed dropimage.png file in "
"the data directory of KImageMapEditor.\n"
"Perhaps you have forgotten to do a make install !" << endl;
@@ -170,8 +170,8 @@ KImageMapEditor::KImageMapEditor(QWidget *parentWidget, const char *,
if (splitter) {
drawZone = new DrawZone(splitter,this);
- splitter->setResizeMode(drawZone,QSplitter::Stretch);
- splitter->setResizeMode(tabWidget,QSplitter::KeepSize);
+ splitter->setResizeMode(drawZone,TQSplitter::Stretch);
+ splitter->setResizeMode(tabWidget,TQSplitter::KeepSize);
setWidget(splitter);
} else {
drawZone = new DrawZone(parentWidget,this);
@@ -225,14 +225,14 @@ KImageMapEditor::~KImageMapEditor() {
MapTag::MapTag() {
modified = false;
- name = QString::null;
+ name = TQString::null;
}
void KImageMapEditor::init()
{
_htmlContent.clear();
- _imageUrl = QString::null;
- m_url = QString::null;
+ _imageUrl = TQString::null;
+ m_url = TQString::null;
HtmlElement* el = new HtmlElement("<html>\n");
_htmlContent.append(el);
el = new HtmlElement("<head>\n");
@@ -401,8 +401,8 @@ void KImageMapEditor::slotConfigChanged()
void KImageMapEditor::openLastURL(KConfig* config) {
KURL lastURL ( config->readPathEntry("lastopenurl") );
- QString lastMap = config->readEntry("lastactivemap");
- QString lastImage = config->readPathEntry("lastactiveimage");
+ TQString lastMap = config->readEntry("lastactivemap");
+ TQString lastImage = config->readPathEntry("lastactiveimage");
// kdDebug() << "loading from group : " << config->group() << endl;
@@ -414,7 +414,7 @@ void KImageMapEditor::openLastURL(KConfig* config) {
if ( openHTMLFile(lastURL, lastMap, lastImage) )
m_url = lastURL;
else
- m_url = QString::null;
+ m_url = TQString::null;
}
}
@@ -425,53 +425,53 @@ void KImageMapEditor::saveLastURL(KConfig* config) {
// kdDebug() << "writing entry lastopenurl : " << url().path() << endl;
// kdDebug() << "writing entry lastactivemap : " << mapName() << endl;
// kdDebug() << "writing entry lastactiveimage : " << _imageUrl.path() << endl;
- //KMessageBox::information(0L, QString("Group: %1 Saving ... %2").arg(config->group()).arg(url().path()));
+ //KMessageBox::information(0L, TQString("Group: %1 Saving ... %2").arg(config->group()).arg(url().path()));
}
void KImageMapEditor::setupActions()
{
// File Open
- KAction *temp=KStdAction::open(this, SLOT(fileOpen()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "openimage", SmallIcon("fileopen") );
+ KAction *temp=KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "openimage", SmallIcon("fileopen") );
temp->setWhatsThis(i18n("<h3>Open File</h3>Click this to <em>open</em> a new picture or HTML file."));
temp->setToolTip(i18n("Open new picture or HTML file"));
// File Open Recent
- recentFilesAction = KStdAction::openRecent(this, SLOT(openURL(const KURL&)),
+ recentFilesAction = KStdAction::openRecent(this, TQT_SLOT(openURL(const KURL&)),
actionCollection());
// File Save
- temp =KStdAction::save(this, SLOT(fileSave()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "saveimage", SmallIcon("filesave") );
+ temp =KStdAction::save(this, TQT_SLOT(fileSave()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "saveimage", SmallIcon("filesave") );
temp->setWhatsThis(i18n("<h3>Save File</h3>Click this to <em>save</em> the changes to the HTML file."));
temp->setToolTip(i18n("Save HTML file"));
// File Save As
- (void)KStdAction::saveAs(this, SLOT(fileSaveAs()), actionCollection());
+ (void)KStdAction::saveAs(this, TQT_SLOT(fileSaveAs()), actionCollection());
// File Close
- temp=KStdAction::close(this, SLOT(fileClose()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "closeimage", SmallIcon("fileclose") );
+ temp=KStdAction::close(this, TQT_SLOT(fileClose()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "closeimage", SmallIcon("fileclose") );
temp->setWhatsThis(i18n("<h3>Close File</h3>Click this to <em>close</em> the currently open HTML file."));
temp->setToolTip(i18n("Close HTML file"));
// Edit Copy
- copyAction=KStdAction::copy(this, SLOT(slotCopy()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editcopyimage", SmallIcon("editcopy") );
+ copyAction=KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editcopyimage", SmallIcon("editcopy") );
copyAction->setWhatsThis(i18n("<h3>Copy</h3>"
"Click this to <em>copy</em> the selected area."));
copyAction->setEnabled(false);
// Edit Cut
- cutAction=KStdAction::cut(this, SLOT(slotCut()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editcutimage", SmallIcon("editcut") );
+ cutAction=KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editcutimage", SmallIcon("editcut") );
cutAction->setWhatsThis(i18n("<h3>Cut</h3>"
"Click this to <em>cut</em> the selected area."));
cutAction->setEnabled(false);
// Edit Paste
- pasteAction=KStdAction::paste(this, SLOT(slotPaste()), actionCollection());
- QMimeSourceFactory::defaultFactory()->setPixmap( "editpasteimage", SmallIcon("editpaste") );
+ pasteAction=KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection());
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editpasteimage", SmallIcon("editpaste") );
pasteAction->setWhatsThis(i18n("<h3>Paste</h3>"
"Click this to <em>paste</em> the copied area."));
pasteAction->setEnabled(false);
@@ -479,8 +479,8 @@ void KImageMapEditor::setupActions()
// Edit Delete
deleteAction=new KAction(i18n("&Delete"), "editdelete",
- Key_Delete,this,SLOT (slotDelete()),actionCollection(), "edit_delete");
- QMimeSourceFactory::defaultFactory()->setPixmap( "editdeleteimage", SmallIcon("editdelete") );
+ Key_Delete,this,TQT_SLOT (slotDelete()),actionCollection(), "edit_delete");
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "editdeleteimage", SmallIcon("editdelete") );
deleteAction->setWhatsThis(i18n("<h3>Delete</h3>"
"Click this to <em>delete</em> the selected area."));
deleteAction->setEnabled(false);
@@ -489,21 +489,21 @@ void KImageMapEditor::setupActions()
_commandHistory = new KCommandHistory( actionCollection(), true);
// Edit Properties
- areaPropertiesAction= new KAction(i18n("Pr&operties"),0,this,SLOT(showTagEditor()),
+ areaPropertiesAction= new KAction(i18n("Pr&operties"),0,this,TQT_SLOT(showTagEditor()),
actionCollection(), "edit_properties");
areaPropertiesAction->setEnabled(false);
// View Zoom In
- zoomInAction=KStdAction::zoomIn(this, SLOT(slotZoomIn()), actionCollection());
+ zoomInAction=KStdAction::zoomIn(this, TQT_SLOT(slotZoomIn()), actionCollection());
// View Zoom Out
- zoomOutAction=KStdAction::zoomOut(this, SLOT(slotZoomOut()), actionCollection());
+ zoomOutAction=KStdAction::zoomOut(this, TQT_SLOT(slotZoomOut()), actionCollection());
// View Zoom
- zoomAction=new KSelectAction(i18n("Zoom"), 0,this,SLOT (slotZoom()),
+ zoomAction=new KSelectAction(i18n("Zoom"), 0,this,TQT_SLOT (slotZoom()),
actionCollection(), "view_zoom");
zoomAction->setWhatsThis(i18n("<h3>Zoom</h3>"
"Choose the desired zoom level."));
- zoomAction->setItems(QStringList()
+ zoomAction->setItems(TQStringList()
<< i18n("25%")
<< i18n("50%")
<< i18n("100%")
@@ -517,58 +517,58 @@ void KImageMapEditor::setupActions()
zoomAction->setCurrentItem(2);
- highlightAreasAction = new KToggleAction(i18n("Highlight Areas"),0, this, SLOT (slotHightlightAreas()),
+ highlightAreasAction = new KToggleAction(i18n("Highlight Areas"),0, this, TQT_SLOT (slotHightlightAreas()),
actionCollection(), "view_highlightareas");
- showAltAction = new KToggleAction(i18n("Show Alt Tag"),0, this, SLOT (slotShowAltTag()),
+ showAltAction = new KToggleAction(i18n("Show Alt Tag"),0, this, TQT_SLOT (slotShowAltTag()),
actionCollection(), "view_showalt");
#if KDE_IS_VERSION(3,2,90)
showAltAction->setCheckedState(i18n("Hide Alt Tag"));
#endif
- mapNameAction= new KAction(i18n("Map &Name..."),0,this,SLOT(mapEditName()),
+ mapNameAction= new KAction(i18n("Map &Name..."),0,this,TQT_SLOT(mapEditName()),
actionCollection(), "map_name");
- mapNewAction = new KAction(i18n("Ne&w Map..."),0,this,SLOT(mapNew()),
+ mapNewAction = new KAction(i18n("Ne&w Map..."),0,this,TQT_SLOT(mapNew()),
actionCollection(), "map_new");
mapNewAction->setToolTip(i18n("Create a new map"));
- mapDeleteAction = new KAction(i18n("D&elete Map"),0,this,SLOT(mapDelete()),
+ mapDeleteAction = new KAction(i18n("D&elete Map"),0,this,TQT_SLOT(mapDelete()),
actionCollection(), "map_delete");
mapDeleteAction->setToolTip(i18n("Delete the current active map"));
- mapDefaultAreaAction = new KAction(i18n("Edit &Default Area..."),0,this,SLOT(mapDefaultArea()),
+ mapDefaultAreaAction = new KAction(i18n("Edit &Default Area..."),0,this,TQT_SLOT(mapDefaultArea()),
actionCollection(), "map_defaultarea");
mapDefaultAreaAction->setToolTip(i18n("Edit the default area of the current active map"));
- temp = new KAction(i18n("&Preview"),0,this,SLOT(mapPreview()),
+ temp = new KAction(i18n("&Preview"),0,this,TQT_SLOT(mapPreview()),
actionCollection(), "map_preview");
temp->setToolTip(i18n("Show a preview"));
// IMAGE
i18n("&Image");
- imageAddAction = new KAction(i18n("Add Image..."),0,this,SLOT(imageAdd()),
+ imageAddAction = new KAction(i18n("Add Image..."),0,this,TQT_SLOT(imageAdd()),
actionCollection(), "image_add");
imageAddAction->setToolTip(i18n("Add a new image"));
- imageRemoveAction = new KAction(i18n("Remove Image"),0,this,SLOT(imageRemove()),
+ imageRemoveAction = new KAction(i18n("Remove Image"),0,this,TQT_SLOT(imageRemove()),
actionCollection(), "image_remove");
imageRemoveAction->setToolTip(i18n("Remove the current visible image"));
- imageUsemapAction = new KAction(i18n("Edit Usemap..."),0,this,SLOT(imageUsemap()),
+ imageUsemapAction = new KAction(i18n("Edit Usemap..."),0,this,TQT_SLOT(imageUsemap()),
actionCollection(), "image_usemap");
imageUsemapAction->setToolTip(i18n("Edit the usemap tag of the current visible image"));
- temp= new KAction(i18n("Show &HTML"),0,this,SLOT(mapShowHTML()),
+ temp= new KAction(i18n("Show &HTML"),0,this,TQT_SLOT(mapShowHTML()),
actionCollection(), "map_showhtml");
// Selection Tool
arrowAction=new KRadioAction(i18n("&Selection"), "arrow",
- 0,this,SLOT (slotDrawArrow()),
+ 0,this,TQT_SLOT (slotDrawArrow()),
actionCollection(), "tool_arrow");
- QMimeSourceFactory::defaultFactory()->setPixmap( "arrowimage", SmallIcon("arrow") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "arrowimage", SmallIcon("arrow") );
arrowAction->setWhatsThis(i18n("<h3>Selection</h3>"
"Click this to select areas."));
arrowAction->setExclusiveGroup("drawing");
@@ -576,54 +576,54 @@ void KImageMapEditor::setupActions()
// Circle
circleAction=new KRadioAction(i18n("&Circle"), "circle",
- 0,this,SLOT (slotDrawCircle()),
+ 0,this,TQT_SLOT (slotDrawCircle()),
actionCollection(), "tool_circle");
- QMimeSourceFactory::defaultFactory()->setPixmap( "circleimage", SmallIcon("drawcircle") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "circleimage", SmallIcon("drawcircle") );
circleAction->setWhatsThis(i18n("<h3>Circle</h3>"
"Click this to start drawing a circle."));
circleAction->setExclusiveGroup("drawing");
// Rectangle
rectangleAction=new KRadioAction(i18n("&Rectangle"), "rectangle",
- 0,this,SLOT (slotDrawRectangle()),
+ 0,this,TQT_SLOT (slotDrawRectangle()),
actionCollection(), "tool_rectangle");
- QMimeSourceFactory::defaultFactory()->setPixmap( "rectangleimage", SmallIcon("drawrectangle") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "rectangleimage", SmallIcon("drawrectangle") );
rectangleAction->setWhatsThis(i18n("<h3>Rectangle</h3>"
"Click this to start drawing a rectangle."));
rectangleAction->setExclusiveGroup("drawing");
// Polygon
polygonAction=new KRadioAction(i18n("&Polygon"), "polygon",
- 0,this,SLOT (slotDrawPolygon()),
+ 0,this,TQT_SLOT (slotDrawPolygon()),
actionCollection(), "tool_polygon");
- QMimeSourceFactory::defaultFactory()->setPixmap( "polygonimage", SmallIcon("drawpolygon") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "polygonimage", SmallIcon("drawpolygon") );
polygonAction->setWhatsThis(i18n("<h3>Polygon</h3>"
"Click this to start drawing a polygon."));
polygonAction->setExclusiveGroup("drawing");
// Freehand
freehandAction=new KRadioAction(i18n("&Freehand Polygon"), "freehand",
- 0,this,SLOT (slotDrawFreehand()),
+ 0,this,TQT_SLOT (slotDrawFreehand()),
actionCollection(), "tool_freehand");
- QMimeSourceFactory::defaultFactory()->setPixmap( "freehandimage", SmallIcon("freehand") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "freehandimage", SmallIcon("freehand") );
freehandAction->setWhatsThis(i18n("<h3>Freehandpolygon</h3>"
"Click this to start drawing a freehand polygon."));
freehandAction->setExclusiveGroup("drawing");
// Add Point
addPointAction=new KRadioAction(i18n("&Add Point"), "addpoint",
- 0,this,SLOT (slotDrawAddPoint()),
+ 0,this,TQT_SLOT (slotDrawAddPoint()),
actionCollection(), "tool_addpoint");
- QMimeSourceFactory::defaultFactory()->setPixmap( "addpointimage", SmallIcon("addpoint") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "addpointimage", SmallIcon("addpoint") );
addPointAction->setWhatsThis(i18n("<h3>Add Point</h3>"
"Click this to add points to a polygon."));
addPointAction->setExclusiveGroup("drawing");
// Remove Point
removePointAction=new KRadioAction(i18n("&Remove Point"), "removepoint",
- 0,this,SLOT (slotDrawRemovePoint()),
+ 0,this,TQT_SLOT (slotDrawRemovePoint()),
actionCollection(), "tool_removepoint");
- QMimeSourceFactory::defaultFactory()->setPixmap( "removepointimage", SmallIcon("removepoint") );
+ TQMimeSourceFactory::defaultFactory()->setPixmap( "removepointimage", SmallIcon("removepoint") );
removePointAction->setWhatsThis(i18n("<h3>Remove Point</h3>"
"Click this to remove points from a polygon."));
removePointAction->setExclusiveGroup("drawing");
@@ -631,31 +631,31 @@ void KImageMapEditor::setupActions()
#if KDE_VERSION < 300
KAction *cancelAction =
#endif
- new KAction(i18n("Cancel Drawing"), Key_Escape, this, SLOT( slotCancelDrawing() ),
+ new KAction(i18n("Cancel Drawing"), Key_Escape, this, TQT_SLOT( slotCancelDrawing() ),
actionCollection(), "canceldrawing" );
- moveLeftAction = new KAction(i18n("Move Left"), Key_Left, this, SLOT( slotMoveLeft() ),
+ moveLeftAction = new KAction(i18n("Move Left"), Key_Left, this, TQT_SLOT( slotMoveLeft() ),
actionCollection() , "moveleft" );
- moveRightAction = new KAction(i18n("Move Right"), Key_Right, this, SLOT( slotMoveRight() ),
+ moveRightAction = new KAction(i18n("Move Right"), Key_Right, this, TQT_SLOT( slotMoveRight() ),
actionCollection() , "moveright" );
- moveUpAction = new KAction(i18n("Move Up"), Key_Up, this, SLOT( slotMoveUp() ),
+ moveUpAction = new KAction(i18n("Move Up"), Key_Up, this, TQT_SLOT( slotMoveUp() ),
actionCollection() , "moveup" );
- moveDownAction = new KAction(i18n("Move Down"), Key_Down, this, SLOT( slotMoveDown() ),
+ moveDownAction = new KAction(i18n("Move Down"), Key_Down, this, TQT_SLOT( slotMoveDown() ),
actionCollection() , "movedown" );
- increaseWidthAction = new KAction(i18n("Increase Width"), Key_Right + SHIFT, this, SLOT( slotIncreaseWidth() ),
+ increaseWidthAction = new KAction(i18n("Increase Width"), Key_Right + SHIFT, this, TQT_SLOT( slotIncreaseWidth() ),
actionCollection() , "increasewidth" );
- decreaseWidthAction = new KAction(i18n("Decrease Width"), Key_Left + SHIFT, this, SLOT( slotDecreaseWidth() ),
+ decreaseWidthAction = new KAction(i18n("Decrease Width"), Key_Left + SHIFT, this, TQT_SLOT( slotDecreaseWidth() ),
actionCollection() , "decreasewidth" );
- increaseHeightAction = new KAction(i18n("Increase Height"), Key_Up + SHIFT, this, SLOT( slotIncreaseHeight() ),
+ increaseHeightAction = new KAction(i18n("Increase Height"), Key_Up + SHIFT, this, TQT_SLOT( slotIncreaseHeight() ),
actionCollection() , "increaseheight" );
- decreaseHeightAction = new KAction(i18n("Decrease Height"), Key_Down + SHIFT, this, SLOT( slotDecreaseHeight() ),
+ decreaseHeightAction = new KAction(i18n("Decrease Height"), Key_Down + SHIFT, this, TQT_SLOT( slotDecreaseHeight() ),
actionCollection() , "decreaseheight" );
#if KDE_VERSION < 300
accel = new KAccel(widget());
@@ -670,38 +670,38 @@ void KImageMapEditor::setupActions()
decreaseHeightAction->plugAccel(accel, true);
#endif
- toFrontAction = new KAction(i18n("Bring to Front"), 0 , this, SLOT( slotToFront() ),
+ toFrontAction = new KAction(i18n("Bring to Front"), 0 , this, TQT_SLOT( slotToFront() ),
actionCollection() , "tofront" );
- toBackAction = new KAction(i18n("Send to Back"), 0 , this, SLOT( slotToBack() ),
+ toBackAction = new KAction(i18n("Send to Back"), 0 , this, TQT_SLOT( slotToBack() ),
actionCollection() , "toback" );
- forwardOneAction = new KAction(i18n("Bring Forward One"), "raise" ,0, this, SLOT( slotForwardOne() ),
+ forwardOneAction = new KAction(i18n("Bring Forward One"), "raise" ,0, this, TQT_SLOT( slotForwardOne() ),
actionCollection() , "forwardone" );
- backOneAction = new KAction(i18n("Send Back One"), "lower" ,0, this, SLOT( slotBackOne() ),
+ backOneAction = new KAction(i18n("Send Back One"), "lower" ,0, this, TQT_SLOT( slotBackOne() ),
actionCollection() , "backone" );
forwardOneAction->plug(areaListView->upBtn);
backOneAction->plug(areaListView->downBtn);
- connect( areaListView->upBtn, SIGNAL(pressed()), forwardOneAction, SLOT(activate()));
- connect( areaListView->downBtn, SIGNAL(pressed()), backOneAction, SLOT(activate()));
+ connect( areaListView->upBtn, TQT_SIGNAL(pressed()), forwardOneAction, TQT_SLOT(activate()));
+ connect( areaListView->downBtn, TQT_SIGNAL(pressed()), backOneAction, TQT_SLOT(activate()));
new KAction( i18n("Configure KImageMapEditor..."), "configure", 0,
- this, SLOT(slotShowPreferences()),
+ this, TQT_SLOT(slotShowPreferences()),
actionCollection(), "configure_kimagemapeditor" );
if (areaDock) {
configureShowAreaListAction = new KToggleAction( i18n("Show Area List"), 0L, 0,
- this, SLOT(configureShowAreaList()),
+ this, TQT_SLOT(configureShowAreaList()),
actionCollection(), "configure_show_arealist" );
configureShowMapListAction = new KToggleAction( i18n("Show Map List"), 0L, 0,
- this, SLOT(configureShowMapList()),
+ this, TQT_SLOT(configureShowMapList()),
actionCollection(), "configure_show_maplist" );
configureShowImageListAction = new KToggleAction( i18n("Show Image List"), 0L, 0,
- this, SLOT(configureShowImageList()),
+ this, TQT_SLOT(configureShowImageList()),
actionCollection(), "configure_show_imagelist" );
#if KDE_IS_VERSION(3,2,90)
configureShowAreaListAction->setCheckedState(i18n("Hide Area List"));
@@ -725,30 +725,30 @@ void KImageMapEditor::setupStatusBar()
void KImageMapEditor::slotShowPreferences()
{
PreferencesDialog *dialog = new PreferencesDialog(widget(),config());
- connect(dialog, SIGNAL(applyClicked()), this, SLOT(slotConfigChanged()));
+ connect(dialog, TQT_SIGNAL(applyClicked()), this, TQT_SLOT(slotConfigChanged()));
dialog->exec();
delete dialog;
}
-void KImageMapEditor::showPopupMenu(const QPoint & pos, const QString & name)
+void KImageMapEditor::showPopupMenu(const TQPoint & pos, const TQString & name)
{
- QPopupMenu* pop = static_cast<QPopupMenu *>(factory()->container(name, this));
+ TQPopupMenu* pop = static_cast<TQPopupMenu *>(factory()->container(name, this));
if (!pop) {
- kdWarning() << QString("KImageMapEditorPart: Missing XML definition for %1\n").arg(name) << endl;
+ kdWarning() << TQString("KImageMapEditorPart: Missing XML definition for %1\n").arg(name) << endl;
return;
}
pop->popup(pos);
}
-void KImageMapEditor::slotShowMainPopupMenu(const QPoint & pos)
+void KImageMapEditor::slotShowMainPopupMenu(const TQPoint & pos)
{
showPopupMenu(pos,"popup_main");
}
-void KImageMapEditor::slotShowMapPopupMenu(QListViewItem* item,const QPoint & pos)
+void KImageMapEditor::slotShowMapPopupMenu(TQListViewItem* item,const TQPoint & pos)
{
if (isReadWrite()) {
mapDeleteAction->setEnabled(item);
@@ -762,7 +762,7 @@ void KImageMapEditor::slotShowMapPopupMenu(QListViewItem* item,const QPoint & po
showPopupMenu(pos,"popup_map");
}
-void KImageMapEditor::slotShowImagePopupMenu(QListViewItem* item,const QPoint & pos)
+void KImageMapEditor::slotShowImagePopupMenu(TQListViewItem* item,const TQPoint & pos)
{
imageRemoveAction->setEnabled(item);
imageUsemapAction->setEnabled(item);
@@ -773,7 +773,7 @@ void KImageMapEditor::slotShowImagePopupMenu(QListViewItem* item,const QPoint &
showPopupMenu(pos,"popup_image");
}
-void KImageMapEditor::slotShowPopupMenu(QListViewItem* item,const QPoint & p)
+void KImageMapEditor::slotShowPopupMenu(TQListViewItem* item,const TQPoint & p)
{
if (!item)
return;
@@ -794,14 +794,14 @@ void KImageMapEditor::updateStatusBar()
void KImageMapEditor::slotChangeStatusCoords(int x,int y)
{
-// statusBar()->changeItem(QString(" Cursor : x: %1 ,y: %2 ").arg(x).arg(y),STATUS_CURSOR);
+// statusBar()->changeItem(TQString(" Cursor : x: %1 ,y: %2 ").arg(x).arg(y),STATUS_CURSOR);
cursorStatusText = i18n(" Cursor: x: %1, y: %2 ").arg(x).arg(y);
updateStatusBar();
}
void KImageMapEditor::slotUpdateSelectionCoords() {
if (selected()->count()>0) {
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
// statusBar()->changeItem(
selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").arg(r.left()).arg(r.top()).arg(r.width()).arg(r.height());
@@ -814,7 +814,7 @@ void KImageMapEditor::slotUpdateSelectionCoords() {
updateStatusBar();
}
-void KImageMapEditor::slotUpdateSelectionCoords( const QRect & r )
+void KImageMapEditor::slotUpdateSelectionCoords( const TQRect & r )
{
selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").arg(r.left()).arg(r.top()).arg(r.width()).arg(r.height());
updateStatusBar();
@@ -827,57 +827,57 @@ KApplication* KImageMapEditor::app() const
}
-void KImageMapEditor::drawToCenter(QPainter* p, const QString & str, int y, int width) {
+void KImageMapEditor::drawToCenter(TQPainter* p, const TQString & str, int y, int width) {
int xmid = width / 2;
- QFontMetrics fm = p->fontMetrics();
- QRect strBounds = fm.boundingRect(str);
+ TQFontMetrics fm = p->fontMetrics();
+ TQRect strBounds = fm.boundingRect(str);
p->drawText(xmid-(strBounds.width()/2),y,str);
}
-QImage KImageMapEditor::getBackgroundImage() {
+TQImage KImageMapEditor::getBackgroundImage() {
// Lazy initialisation
if ( _backgroundImage.isNull() ) {
-// QString filename = QString("dropimage_")+KGlobal::locale()->language()+".png";
-// QString path = QString::null; //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
+// TQString filename = TQString("dropimage_")+KGlobal::locale()->language()+".png";
+// TQString path = TQString::null; //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
// kdDebug() << "getBackgroundPic : loaded image : " << path << endl;
-// if ( ! QFileInfo(path).exists() ) {
+// if ( ! TQFileInfo(path).exists() ) {
int width = 400;
int height = 400;
int border = 20;
int fontSize = 58;
- QPixmap pix(width,height);
- pix.fill(QColor(74,76,74));
- QPainter p(&pix);
+ TQPixmap pix(width,height);
+ pix.fill(TQColor(74,76,74));
+ TQPainter p(&pix);
- QFont font;
+ TQFont font;
font.setFamily("Sans");
font.setPixelSize(fontSize);
font.setBold(true);
p.setFont( font );
p.setRasterOp(Qt::CopyROP);
- p.setPen(QPen(QColor(112,114,112),1));
+ p.setPen(TQPen(TQColor(112,114,112),1));
// The translated string must be divided into
// parts with about the same size that fit to the image
- QString str = i18n("Drop an image or HTML file");
- QStringList strList = QStringList::split(" ",str);
+ TQString str = i18n("Drop an image or HTML file");
+ TQStringList strList = TQStringList::split(" ",str);
// Get the string parts
- QString tmp;
- QStringList outputStrList;
- QFontMetrics fm = p.fontMetrics();
+ TQString tmp;
+ TQStringList outputStrList;
+ TQFontMetrics fm = p.fontMetrics();
- for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) {
- QString tmp2 = tmp + *it;
+ for ( TQStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) {
+ TQString tmp2 = tmp + *it;
if (fm.boundingRect(tmp2).width() > width-border) {
outputStrList.append(tmp);
@@ -894,7 +894,7 @@ QImage KImageMapEditor::getBackgroundImage() {
int step = myround(float(height) / (outputStrList.size()+1));
int y = step;
- for ( QStringList::Iterator it = outputStrList.begin(); it != outputStrList.end(); ++it ) {
+ for ( TQStringList::Iterator it = outputStrList.begin(); it != outputStrList.end(); ++it ) {
drawToCenter(&p, *it, y, pix.width());
y += step;
}
@@ -908,19 +908,19 @@ QImage KImageMapEditor::getBackgroundImage() {
return _backgroundImage;
/*
- QFontDatabase fdb;
- QStringList families = fdb.families();
- for ( QStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
- QString family = *f;
+ TQFontDatabase fdb;
+ TQStringList families = fdb.families();
+ for ( TQStringList::Iterator f = families.begin(); f != families.end(); ++f ) {
+ TQString family = *f;
qDebug( family );
- QStringList styles = fdb.styles( family );
- for ( QStringList::Iterator s = styles.begin(); s != styles.end(); ++s ) {
- QString style = *s;
- QString dstyle = "\t" + style + " (";
- QValueList<int> smoothies = fdb.smoothSizes( family, style );
- for ( QValueList<int>::Iterator points = smoothies.begin();
+ TQStringList styles = fdb.styles( family );
+ for ( TQStringList::Iterator s = styles.begin(); s != styles.end(); ++s ) {
+ TQString style = *s;
+ TQString dstyle = "\t" + style + " (";
+ TQValueList<int> smoothies = fdb.smoothSizes( family, style );
+ for ( TQValueList<int>::Iterator points = smoothies.begin();
points != smoothies.end(); ++points ) {
- dstyle += QString::number( *points ) + " ";
+ dstyle += TQString::number( *points ) + " ";
}
dstyle = dstyle.left( dstyle.length() - 1 ) + ")";
qDebug( dstyle );
@@ -933,7 +933,7 @@ QImage KImageMapEditor::getBackgroundImage() {
pix.save(path,"PNG",100);
}
- if ( ! QFileInfo(path).exists() ) {
+ if ( ! TQFileInfo(path).exists() ) {
kdError() << "Couldn't find needed " << filename << " file in "
"the data directory of KImageMapEditor.\n"
"Perhaps you have forgotten to do a make install !" << endl;
@@ -957,14 +957,14 @@ void KImageMapEditor::addArea(Area* area) {
for (Area* a = list.first(); a != 0L; a = list.next() )
{
areas->prepend(a);
- a->setListViewItem(new QListViewItem(areaListView->listView,a->attribute("href")));
+ a->setListViewItem(new TQListViewItem(areaListView->listView,a->attribute("href")));
a->listViewItem()->setPixmap(1,makeListViewPix(*a));
}
}
else
{
areas->prepend(area);
- area->setListViewItem(new QListViewItem(areaListView->listView,area->attribute("href")));
+ area->setListViewItem(new TQListViewItem(areaListView->listView,area->attribute("href")));
area->listViewItem()->setPixmap(1,makeListViewPix(*area));
}
@@ -975,7 +975,7 @@ void KImageMapEditor::addArea(Area* area) {
void KImageMapEditor::addAreaAndEdit(Area* s)
{
areas->prepend(s);
- s->setListViewItem(new QListViewItem(areaListView->listView,s->attribute("href")));
+ s->setListViewItem(new TQListViewItem(areaListView->listView,s->attribute("href")));
s->listViewItem()->setPixmap(1,makeListViewPix(*s));
deselectAll();
select(s);
@@ -991,7 +991,7 @@ void KImageMapEditor::deleteArea( Area * area )
if (!area) return;
// only for repaint reasons
- QRect redrawRect = area->selectionRect();
+ TQRect redrawRect = area->selectionRect();
// Perhaps we've got a selection of areas
// so test it and delete the whole selection
@@ -1112,7 +1112,7 @@ void KImageMapEditor::slotSelectionChanged()
}
-void KImageMapEditor::select( QListViewItem* item)
+void KImageMapEditor::select( TQListViewItem* item)
{
AreaListIterator it = areaList();
@@ -1307,13 +1307,13 @@ void KImageMapEditor::updateUpDownBtn()
void KImageMapEditor::deselectAll()
{
- QRect redrawRect= currentSelected->selectionRect();
+ TQRect redrawRect= currentSelected->selectionRect();
currentSelected->reset();
drawZone->repaintRect(redrawRect);
updateActionAccess();
}
-Area* KImageMapEditor::onArea(const QPoint & p) const {
+Area* KImageMapEditor::onArea(const TQPoint & p) const {
for (Area* s=areas->first();s!=0L;s=areas->next()) {
if (s->contains(p))
return s;
@@ -1327,7 +1327,7 @@ int KImageMapEditor::showTagEditor(Area *a) {
drawZone->repaintArea(*a);
AreaDialog *dialog= new AreaDialog(this,a);
- connect (dialog, SIGNAL(areaChanged(Area*)), this, SLOT(slotAreaChanged(Area*)));
+ connect (dialog, TQT_SIGNAL(areaChanged(Area*)), this, TQT_SLOT(slotAreaChanged(Area*)));
int result = dialog->exec();
@@ -1336,7 +1336,7 @@ int KImageMapEditor::showTagEditor(Area *a) {
}
-int KImageMapEditor::showTagEditor(QListViewItem *item) {
+int KImageMapEditor::showTagEditor(TQListViewItem *item) {
if (!item) return 0;
for (Area* a=areas->first();a!=0L;a=areas->next()) {
if (a->listViewItem()==item) {
@@ -1351,9 +1351,9 @@ int KImageMapEditor::showTagEditor() {
}
-QString KImageMapEditor::getHTMLImageMap() const {
- QString retStr;
- retStr+="<map "+QString("name=\"")+_mapName+"\">\n";
+TQString KImageMapEditor::getHTMLImageMap() const {
+ TQString retStr;
+ retStr+="<map "+TQString("name=\"")+_mapName+"\">\n";
for (Area* a=areas->first();a!=0L;a=areas->next()) {
retStr+=" "+a->getHTMLCode()+"\n";
@@ -1366,9 +1366,9 @@ QString KImageMapEditor::getHTMLImageMap() const {
return retStr;
}
-QPixmap KImageMapEditor::makeListViewPix(Area & a)
+TQPixmap KImageMapEditor::makeListViewPix(Area & a)
{
- QPixmap pix=a.cutOut(drawZone->picture());
+ TQPixmap pix=a.cutOut(drawZone->picture());
double shrinkFactor=1;
@@ -1376,12 +1376,12 @@ QPixmap KImageMapEditor::makeListViewPix(Area & a)
if (maxAreaPreviewHeight < pix.height())
shrinkFactor = ( (double) maxAreaPreviewHeight / pix.height() );
- QPixmap pix2((int)(pix.width()*shrinkFactor), (int)(pix.height()*shrinkFactor));
+ TQPixmap pix2((int)(pix.width()*shrinkFactor), (int)(pix.height()*shrinkFactor));
// Give all pixels a defined color
pix2.fill(Qt::white);
- QPainter p(&pix2);
+ TQPainter p(&pix2);
p.scale(shrinkFactor,shrinkFactor);
p.drawPixmap(0,0,pix);
@@ -1389,7 +1389,7 @@ QPixmap KImageMapEditor::makeListViewPix(Area & a)
return pix2;
}
-void KImageMapEditor::setMapName(const QString & s) {
+void KImageMapEditor::setMapName(const TQString & s) {
mapsListView->changeMapName(_mapName, s);
_mapName=s;
currentMapElement->mapTag->name = s;
@@ -1398,8 +1398,8 @@ void KImageMapEditor::setMapName(const QString & s) {
void KImageMapEditor::setPicture(const KURL & url) {
_imageUrl=url;
- if (QFileInfo(url.path()).exists()) {
- QImage img(url.path());
+ if (TQFileInfo(url.path()).exists()) {
+ TQImage img(url.path());
if (!img.isNull()) {
setPicture(img);
@@ -1407,13 +1407,13 @@ void KImageMapEditor::setPicture(const KURL & url) {
imageUsemapAction->setEnabled(true);
}
else
- kdError() << QString("The image %1 could not be opened.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 could not be opened.").arg(url.path()) << endl;
}
else
- kdError() << QString("The image %1 does not exist.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 does not exist.").arg(url.path()) << endl;
}
-void KImageMapEditor::setPicture(const QImage & pix) {
+void KImageMapEditor::setPicture(const TQImage & pix) {
drawZone->setPicture(pix);
updateAllAreas();
}
@@ -1508,11 +1508,11 @@ void KImageMapEditor::mapEditName()
{
bool ok=false;
#if KDE_IS_VERSION(3, 1, 90)
- QString input = KInputDialog::getText(i18n("Enter Map Name"),
+ TQString input = KInputDialog::getText(i18n("Enter Map Name"),
i18n("Enter the name of the map:"),
_mapName,&ok,widget());
#else
- QString input = KLineEditDlg::getText(i18n("Enter Map Name"),
+ TQString input = KLineEditDlg::getText(i18n("Enter Map Name"),
i18n("Enter the name of the map:"),
_mapName,&ok,widget());
#endif
@@ -1529,12 +1529,12 @@ void KImageMapEditor::mapEditName()
void KImageMapEditor::mapShowHTML()
{
- KDialogBase *dialog= new KDialogBase(widget(),QString::null,true,i18n("HTML Code of Map"),KDialogBase::Ok);
- QMultiLineEdit *edit = new QMultiLineEdit(dialog);
+ KDialogBase *dialog= new KDialogBase(widget(),TQString::null,true,i18n("HTML Code of Map"),KDialogBase::Ok);
+ TQMultiLineEdit *edit = new TQMultiLineEdit(dialog);
edit->setText(getHtmlCode());
edit->setReadOnly(true);
- edit->setWordWrap(QTextEdit::NoWrap);
+ edit->setWordWrap(TQTextEdit::NoWrap);
dialog->setMainWidget(edit);
// dialog->resize(dialog->calculateSize(edit->maxLineWidth(),edit->numLines()*));
// dialog->adjustSize();
@@ -1544,7 +1544,7 @@ void KImageMapEditor::mapShowHTML()
void KImageMapEditor::openFile(const KURL & url) {
if ( ! url.isEmpty()) {
- QString ext=QFileInfo(url.path()).extension().lower();
+ TQString ext=TQFileInfo(url.path()).extension().lower();
if (ext=="png" || ext=="jpg" || ext=="jpeg" || ext=="gif" ||
ext=="bmp" || ext=="xbm" || ext=="xpm" || ext=="mng" || ext=="pnm")
@@ -1561,14 +1561,14 @@ bool KImageMapEditor::openURL(const KURL & url) {
// For non local files, we cannot check
// the existance
if (url.isLocalFile() &&
- ! QFile::exists(url.path()))
+ ! TQFile::exists(url.path()))
return true;
return KParts::ReadOnlyPart::openURL(url);
}
void KImageMapEditor::fileOpen() {
- QString fileName = KFileDialog::getOpenFileName(QString::null,
+ TQString fileName = KFileDialog::getOpenFileName(TQString::null,
i18n("*.png *.jpg *.jpeg *.gif *.htm *.html|Web File\n"
"*.png *.jpg *.jpeg *.gif *.bmp *.xbm *.xpm *.pnm *.mng|Images\n"
"*.htm *.html|HTML Files\n"
@@ -1617,7 +1617,7 @@ void KImageMapEditor::fileSaveAs() {
}
- QFileInfo fileInfo(url.path());
+ TQFileInfo fileInfo(url.path());
if ( fileInfo.exists() )
{
@@ -1641,7 +1641,7 @@ void KImageMapEditor::fileSaveAs() {
bool KImageMapEditor::openFile()
{
- QFileInfo fileInfo(url().path());
+ TQFileInfo fileInfo(url().path());
if ( !fileInfo.exists() )
{
@@ -1661,28 +1661,28 @@ bool KImageMapEditor::openFile()
}
/**
- * This methods supposes that the given QTextStream s has just read
+ * This methods supposes that the given TQTextStream s has just read
* the &lt; of a tag. It now reads all attributes of the tag until a &gt;
* The tagname itself is also read and stored as a <em>tagname</em>
- * attribute. After parsing the whole tag it returns a QDict<QString>
+ * attribute. After parsing the whole tag it returns a TQDict<TQString>
* with all attributes and their values. It stores the whole read text in the
* parameter readText.
*/
-QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & readText)
+TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString & readText)
{
- QDict<QString> dict(17,false);
+ TQDict<TQString> dict(17,false);
// the "<" is already read
- QChar w;
- QString attr,value;
+ TQChar w;
+ TQString attr,value;
- readText = QString::null;
+ readText = TQString::null;
// get the tagname
while (!s.atEnd() && w!=" ") {
s >> w;
readText.append(w);
if (w==" " || w==">") {
- dict.insert("tagname",new QString(value));
+ dict.insert("tagname",new TQString(value));
break;
}
value+=w;
@@ -1715,10 +1715,10 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
bool attrRead=true; // currently reading an attribute ?
bool equalSign=false; // an equalsign was read?
bool valueRead=false; // currently reading a value ?
- QChar quotation='\0'; // currently reading a value with quotation marks ?
+ TQChar quotation='\0'; // currently reading a value with quotation marks ?
bool php=false; // currently reading a php script
- attr=QString::null;
- value=QString::null;
+ attr=TQString::null;
+ value=TQString::null;
//get the other attributes
while (!s.atEnd() && w!=">")
@@ -1761,7 +1761,7 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
// finished ?
if (w==">") {
if (valueRead)
- dict.insert(attr,new QString(value));
+ dict.insert(attr,new TQString(value));
return dict;
} else
// currently reading an attribute ?
@@ -1801,16 +1801,16 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
} else {
quotation='\0';
valueRead=false;
- dict.insert(attr,new QString(value));
- attr = value = QString::null;
+ dict.insert(attr,new TQString(value));
+ attr = value = TQString::null;
}
} else
// a whitespace indicates that the value has finished
if (w==" ") {
valueRead=false;
- dict.insert(attr,new QString(value));
- attr = value = QString::null;
+ dict.insert(attr,new TQString(value));
+ attr = value = TQString::null;
}
} else {
if (w!=" ") {
@@ -1825,25 +1825,25 @@ QDict<QString> KImageMapEditor::getTagAttributes(QTextStream & s, QString & read
}
-bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, const QString & imagePath)
+bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, const TQString & imagePath)
{
- QFile f(url.path());
+ TQFile f(url.path());
if ( !f.exists () )
return false;
f.open(IO_ReadOnly);
- QTextStream s(&f);
- QString str;
- QChar w;
- QDict<QString> *attr=0L;
- QPtrList<ImageTag> *images= new QPtrList<ImageTag>;
+ TQTextStream s(&f);
+ TQString str;
+ TQChar w;
+ TQDict<TQString> *attr=0L;
+ TQPtrList<ImageTag> *images= new TQPtrList<ImageTag>;
MapTag *map=0L;
- QPtrList<MapTag> *maps = new QPtrList<MapTag>;
+ TQPtrList<MapTag> *maps = new TQPtrList<MapTag>;
_htmlContent.clear();
currentMapElement = 0L;
- QString temp;
- QString origcode;
+ TQString temp;
+ TQString origcode;
bool readMap=false;
@@ -1854,11 +1854,11 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
{
if (!readMap && !origcode.isEmpty()) {
_htmlContent.append( new HtmlElement(origcode));
- origcode = QString::null;
+ origcode = TQString::null;
}
origcode.append("<");
- attr=new QDict<QString>(getTagAttributes(s,temp));
+ attr=new TQDict<TQString>(getTagAttributes(s,temp));
origcode.append(temp);
if (attr->find("tagname")) {
@@ -1869,7 +1869,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
images->append(el->imgTag);
_htmlContent.append(el);
- origcode = QString::null;
+ origcode = TQString::null;
} else
if (attr->find("tagname")->lower()=="map") {
map = new MapTag();
@@ -1883,7 +1883,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
el->mapTag = map;
_htmlContent.append(el);
- origcode = QString::null;
+ origcode = TQString::null;
} else
if (readMap) {
if (attr->find("tagname")->lower()=="area") {
@@ -1891,7 +1891,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
}
} else {
_htmlContent.append(new HtmlElement(origcode));
- origcode = QString::null;
+ origcode = TQString::null;
}
}
@@ -1924,7 +1924,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
if (images->count() == 1) {
if (images->first()) {
ImageTag* imgTag = images->first();
- QString *src = imgTag->find("src");
+ TQString *src = imgTag->find("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -1936,12 +1936,12 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
ImageTag* imageTag;
for ( imageTag = images->first(); imageTag; imageTag = images->next() )
{
- QString *usemap = imageTag->find("usemap");
+ TQString *usemap = imageTag->find("usemap");
if (usemap) {
// Remove the #
- QString usemapName = usemap->right(usemap->length()-1);
+ TQString usemapName = usemap->right(usemap->length()-1);
if (usemapName == map->name) {
- QString *src = imageTag->find("src");
+ TQString *src = imageTag->find("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -2003,7 +2003,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const QString & mapName, co
* Returns the first matching element.
* Returns 0L if no element was found.
*/
-HtmlElement* KImageMapEditor::findHtmlElement(const QString & containingText) {
+HtmlElement* KImageMapEditor::findHtmlElement(const TQString & containingText) {
for (HtmlElement * el = _htmlContent.first(); el; el = _htmlContent.next() ) {
if (el->htmlCode.contains(containingText,false)) {
return el;
@@ -2027,7 +2027,7 @@ HtmlImgElement* KImageMapEditor::findHtmlImgElement(ImageTag* tag) {
return 0L;
}
-void KImageMapEditor::addMap(const QString & name = QString::null) {
+void KImageMapEditor::addMap(const TQString & name = TQString::null) {
HtmlMapElement* el = new HtmlMapElement("\n<map></map>");
MapTag* map = new MapTag();
map->name = name;
@@ -2062,7 +2062,7 @@ void KImageMapEditor::addMap(const QString & name = QString::null) {
* to the given map name.<br>
* Returns 0L if there exists no map with the given name
*/
-HtmlMapElement* KImageMapEditor::findHtmlMapElement(const QString & mapName) {
+HtmlMapElement* KImageMapEditor::findHtmlMapElement(const TQString & mapName) {
for (HtmlElement * el = _htmlContent.first(); el; el = _htmlContent.next() ) {
if (dynamic_cast<HtmlMapElement*>(el)) {
HtmlMapElement *tagEl = static_cast<HtmlMapElement*>(el);
@@ -2079,7 +2079,7 @@ HtmlMapElement* KImageMapEditor::findHtmlMapElement(const QString & mapName) {
/**
* Calls setMap with the HtmlMapElement with the given map name
*/
-void KImageMapEditor::setMap(const QString & mapName) {
+void KImageMapEditor::setMap(const TQString & mapName) {
HtmlMapElement* el = findHtmlMapElement(mapName);
if (!el) {
kdWarning() << "KImageMapEditor::setMap : Couldn't set map '" << mapName << "', because it wasn't found !" << endl;
@@ -2106,34 +2106,34 @@ void KImageMapEditor::setMap(MapTag* map) {
void KImageMapEditor::saveAreasToMapTag(MapTag* map) {
map->clear();
for (Area* a=areas->first();a!=0L;a=areas->next()) {
- QDict<QString> *dict = new QDict<QString>(17,false);
- QString *shapeStr = 0L;
+ TQDict<TQString> *dict = new TQDict<TQString>(17,false);
+ TQString *shapeStr = 0L;
switch (a->type()) {
- case Area::Rectangle : shapeStr = new QString("rect");break;
- case Area::Circle : shapeStr = new QString("circle");break;
- case Area::Polygon : shapeStr = new QString("poly");break;
+ case Area::Rectangle : shapeStr = new TQString("rect");break;
+ case Area::Circle : shapeStr = new TQString("circle");break;
+ case Area::Polygon : shapeStr = new TQString("poly");break;
default : continue;
}
dict->insert("shape",shapeStr);
for (AttributeIterator it = a->firstAttribute();it!=a->lastAttribute();++it) {
- dict->insert(it.key(),new QString(it.data()));
+ dict->insert(it.key(),new TQString(it.data()));
}
- dict->insert("coords",new QString(a->coordsToString()));
+ dict->insert("coords",new TQString(a->coordsToString()));
map->append(dict);
}
if (defaultArea && defaultArea->finished()) {
- QDict<QString> *dict = new QDict<QString>(17,false);
- dict->insert("shape",new QString("default"));
+ TQDict<TQString> *dict = new TQDict<TQString>(17,false);
+ dict->insert("shape",new TQString("default"));
for (AttributeIterator it = defaultArea->firstAttribute();it!=defaultArea->lastAttribute();++it) {
- dict->insert(it.key(),new QString(it.data()));
+ dict->insert(it.key(),new TQString(it.data()));
}
map->append(dict);
@@ -2159,7 +2159,7 @@ void KImageMapEditor::setMap(HtmlMapElement* mapElement) {
_mapName = map->name;
for (AreaTag *tag=map->first();tag!=0L;tag=map->next())
{
- QString shape="rect";
+ TQString shape="rect";
if (tag->find("shape"))
shape=*tag->find("shape");
@@ -2245,12 +2245,12 @@ void KImageMapEditor::setMapActionsEnabled(bool b) {
}
-QString KImageMapEditor::getHtmlCode() {
+TQString KImageMapEditor::getHtmlCode() {
if (currentMapElement) {
currentMapElement->htmlCode = getHTMLImageMap();
}
- QString result;
+ TQString result;
HtmlElement *el;
for ( el = _htmlContent.first(); el; el = _htmlContent.next() ) {
@@ -2263,16 +2263,16 @@ QString KImageMapEditor::getHtmlCode() {
void KImageMapEditor::saveImageMap(const KURL & url)
{
- QFileInfo fileInfo(url.path());
+ TQFileInfo fileInfo(url.path());
- if (!QFileInfo(url.directory()).isWritable()) {
+ if (!TQFileInfo(url.directory()).isWritable()) {
KMessageBox::error(widget(),
i18n("<qt>The file <i>%1</i> could not be saved, because you do not have the required write permissions.</qt>").arg(url.path()));
return;
}
if (!backupFileCreated) {
- QString backupFile = url.path()+"~";
+ TQString backupFile = url.path()+"~";
KIO::file_copy(url, KURL::fromPathOrURL( backupFile ), -1, true, false, false);
backupFileCreated = true;
}
@@ -2282,10 +2282,10 @@ void KImageMapEditor::saveImageMap(const KURL & url)
if (mapName().isEmpty()) {
mapEditName();
}
- QFile file(url.path());
+ TQFile file(url.path());
file.open(IO_WriteOnly);
- QTextStream t(&file);
+ TQTextStream t(&file);
if (_htmlContent.isEmpty()) {
t << "<html>\n"
@@ -2432,7 +2432,7 @@ void KImageMapEditor::slotToFront()
void KImageMapEditor::slotMoveUp()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(0,-1);
@@ -2445,7 +2445,7 @@ void KImageMapEditor::slotMoveUp()
void KImageMapEditor::slotMoveDown()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(0,1);
@@ -2458,7 +2458,7 @@ void KImageMapEditor::slotMoveDown()
void KImageMapEditor::slotMoveLeft()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(-1,0);
@@ -2471,7 +2471,7 @@ void KImageMapEditor::slotMoveLeft()
void KImageMapEditor::slotMoveRight()
{
- QRect r=selected()->rect();
+ TQRect r=selected()->rect();
selected()->setMoving(true);
selected()->moveBy(1,0);
@@ -2491,7 +2491,7 @@ void KImageMapEditor::slotIncreaseHeight()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setHeight( r.height()+1 );
r.moveBy(0,-1);
@@ -2507,7 +2507,7 @@ void KImageMapEditor::slotDecreaseHeight()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setHeight( r.height()-1 );
r.moveBy(0,1);
@@ -2523,7 +2523,7 @@ void KImageMapEditor::slotIncreaseWidth()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setWidth( r.width()+1 );
selected()->setRect(r);
@@ -2538,7 +2538,7 @@ void KImageMapEditor::slotDecreaseWidth()
{
Area *oldArea=selected()->clone();
- QRect r = selected()->rect();
+ TQRect r = selected()->rect();
r.setWidth( r.width()-1 );
selected()->setRect(r);
@@ -2569,7 +2569,7 @@ void KImageMapEditor::slotShowAltTag()
void KImageMapEditor::mapNew()
{
- QString mapName = mapsListView->getUnusedMapName();
+ TQString mapName = mapsListView->getUnusedMapName();
addMap(mapName);
mapEditName();
}
@@ -2579,7 +2579,7 @@ void KImageMapEditor::mapDelete()
if (mapsListView->count() == 0)
return;
- QString selectedMap = mapsListView->selectedMap();
+ TQString selectedMap = mapsListView->selectedMap();
int result = KMessageBox::warningContinueCancel(widget(),
i18n("<qt>Are you sure you want to delete the map <i>%1</i>?"
@@ -2631,7 +2631,7 @@ bool KImageMapEditor::queryClose() {
return true;
switch ( KMessageBox::warningYesNoCancel( widget(),
- i18n("<qt>The file <i>%1</i> has been modified.<br>Do you want to save it?</qt>").arg(url().fileName()), QString::null, KStdGuiItem::save(), KStdGuiItem::discard()) ) {
+ i18n("<qt>The file <i>%1</i> has been modified.<br>Do you want to save it?</qt>").arg(url().fileName()), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()) ) {
case KMessageBox::Yes :
saveFile();
return true;
@@ -2671,12 +2671,12 @@ void KImageMapEditor::addImage(const KURL & imgUrl) {
if (imgUrl.isEmpty())
return;
- QString relativePath ( QExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
+ TQString relativePath ( QExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
- QString imgHtml = QString("<img src=\"")+relativePath+QString("\">");
+ TQString imgHtml = TQString("<img src=\"")+relativePath+TQString("\">");
ImageTag *imgTag = new ImageTag();
- imgTag->insert("tagname",new QString("img"));
- imgTag->insert("src", new QString(relativePath));
+ imgTag->insert("tagname",new TQString("img"));
+ imgTag->insert("src", new TQString(relativePath));
HtmlImgElement *imgEl = new HtmlImgElement(imgHtml);
imgEl->imgTag = imgTag;
@@ -2727,7 +2727,7 @@ void KImageMapEditor::imageRemove() {
else {
ImageTag* selected = imagesListView->selectedImage();
if (selected) {
- QString *url = selected->find("src");
+ TQString *url = selected->find("src");
if (url) {
setPicture(KURL(*url));
}
@@ -2744,12 +2744,12 @@ void KImageMapEditor::imageUsemap() {
if ( ! imageTag)
return;
- QString usemap;
+ TQString usemap;
if (imageTag->find("usemap"))
usemap=*imageTag->find("usemap");
- QStringList maps = mapsListView->getMaps();
+ TQStringList maps = mapsListView->getMaps();
int index = maps.findIndex(usemap);
if (index == -1) {
maps.prepend("");
@@ -2757,14 +2757,14 @@ void KImageMapEditor::imageUsemap() {
}
#if KDE_IS_VERSION(3, 1, 90)
- QString input = KInputDialog::getItem(i18n("Enter Usemap"),
+ TQString input = KInputDialog::getItem(i18n("Enter Usemap"),
#else
- QString input = QInputDialog::getItem(i18n("Enter Usemap"),
+ TQString input = QInputDialog::getItem(i18n("Enter Usemap"),
#endif
i18n("Enter the usemap value:"),
maps,index,true,&ok,widget());
if (ok) {
- imageTag->replace("usemap", new QString(input));
+ imageTag->replace("usemap", new TQString(input));
imagesListView->updateImage(imageTag);
setModified(true);
@@ -2772,10 +2772,10 @@ void KImageMapEditor::imageUsemap() {
HtmlImgElement* imgEl = findHtmlImgElement(imageTag);
imgEl->htmlCode = "<";
- QString *tagName = imgEl->imgTag->find("tagname");
- imgEl->htmlCode += QString(*tagName);
+ TQString *tagName = imgEl->imgTag->find("tagname");
+ imgEl->htmlCode += TQString(*tagName);
- QDictIterator<QString> it( *imgEl->imgTag );
+ TQDictIterator<TQString> it( *imgEl->imgTag );
for( ; it.current(); ++it ) {
if (it.currentKey() != "tagname") {
imgEl->htmlCode += " " + it.currentKey() + "=\"";