summaryrefslogtreecommitdiffstats
path: root/kimagemapeditor/kimagemapeditor.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /kimagemapeditor/kimagemapeditor.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kimagemapeditor/kimagemapeditor.cpp')
-rw-r--r--kimagemapeditor/kimagemapeditor.cpp242
1 files changed, 121 insertions, 121 deletions
diff --git a/kimagemapeditor/kimagemapeditor.cpp b/kimagemapeditor/kimagemapeditor.cpp
index 6a71f3a6..ba5183e0 100644
--- a/kimagemapeditor/kimagemapeditor.cpp
+++ b/kimagemapeditor/kimagemapeditor.cpp
@@ -84,9 +84,9 @@
typedef KParts::GenericFactory<KImageMapEditor> KimeFactory;
K_EXPORT_COMPONENT_FACTORY( libkimagemapeditor , KimeFactory )
-KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
- TQObject *parent, const char *name, const TQStringList & )
- : KParts::ReadWritePart(parent,name)
+KImageMapEditor::KImageMapEditor(TQWidget *tqparentWidget, const char *,
+ TQObject *tqparent, const char *name, const TQStringList & )
+ : KParts::ReadWritePart(tqparent,name)
{
setInstance( KimeFactory::instance() );
@@ -94,14 +94,14 @@ KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
// Test if the MainWindow can handle DockWindows, if so create DockWidgets
// instead of a Splitter
- mainDock = dynamic_cast<KDockMainWindow*>(parent) ;
+ mainDock = dynamic_cast<KDockMainWindow*>(tqparent) ;
TQSplitter * splitter = 0L;
tabWidget = 0L;
if (mainDock) {
// kdDebug() << "KImageMapEditor: We got a KDockMainWindow !" << endl;
- KDockWidget* parentDock = mainDock->getMainDockWidget();
+ KDockWidget* tqparentDock = mainDock->getMainDockWidget();
areaDock = mainDock->createDockWidget( "Areas", 0L, 0L, i18n("Areas"), i18n("Areas"));
mapsDock = mainDock->createDockWidget( "Maps", 0L, 0L, i18n("Maps"), i18n("Maps"));
imagesDock = mainDock->createDockWidget( "Images", 0L, 0L, i18n("Images"), i18n("Images"));
@@ -114,7 +114,7 @@ KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
mapsDock->setWidget(mapsListView);
imagesDock->setWidget(imagesListView);
- areaDock->manualDock( (KDockWidget*) parentDock, KDockWidget::DockLeft, 30);
+ areaDock->manualDock( (KDockWidget*) tqparentDock, KDockWidget::DockLeft, 30);
mapsDock->manualDock( (KDockWidget*) areaDock, KDockWidget::DockCenter);
imagesDock->manualDock( (KDockWidget*) mapsDock, KDockWidget::DockCenter);
@@ -125,7 +125,7 @@ KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
areaDock = 0L;
mapsDock = 0L;
imagesDock = 0L;
- splitter = new TQSplitter(parentWidget);
+ splitter = new TQSplitter(tqparentWidget);
tabWidget = new TQTabWidget(splitter);
areaListView = new AreaListView(tabWidget,"AreaListView");
mapsListView = new MapsListView(tabWidget, "MapsListView");
@@ -174,7 +174,7 @@ KImageMapEditor::KImageMapEditor(TQWidget *parentWidget, const char *,
splitter->setResizeMode(tabWidget,TQSplitter::KeepSize);
setWidget(splitter);
} else {
- drawZone = new DrawZone(parentWidget,this);
+ drawZone = new DrawZone(tqparentWidget,this);
setWidget(drawZone);
}
@@ -225,14 +225,14 @@ KImageMapEditor::~KImageMapEditor() {
MapTag::MapTag() {
modified = false;
- name = TQString::null;
+ name = TQString();
}
void KImageMapEditor::init()
{
_htmlContent.clear();
- _imageUrl = TQString::null;
- m_url = TQString::null;
+ _imageUrl = TQString();
+ m_url = TQString();
HtmlElement* el = new HtmlElement("<html>\n");
_htmlContent.append(el);
el = new HtmlElement("<head>\n");
@@ -333,7 +333,7 @@ void KImageMapEditor::setModified(bool modified)
else
save->setEnabled(false);
- // 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);
}
@@ -396,7 +396,7 @@ void KImageMapEditor::slotConfigChanged()
}
updateAllAreas();
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
}
void KImageMapEditor::openLastURL(KConfig* config) {
@@ -414,7 +414,7 @@ void KImageMapEditor::openLastURL(KConfig* config) {
if ( openHTMLFile(lastURL, lastMap, lastImage) )
m_url = lastURL;
else
- m_url = TQString::null;
+ m_url = TQString();
}
}
@@ -425,7 +425,7 @@ 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, TQString("Group: %1 Saving ... %2").arg(config->group()).arg(url().path()));
+ //KMessageBox::information(0L, TQString("Group: %1 Saving ... %2").tqarg(config->group()).tqarg(url().path()));
}
void KImageMapEditor::setupActions()
@@ -736,7 +736,7 @@ void KImageMapEditor::showPopupMenu(const TQPoint & pos, const TQString & name)
TQPopupMenu* pop = static_cast<TQPopupMenu *>(factory()->container(name, this));
if (!pop) {
- kdWarning() << TQString("KImageMapEditorPart: Missing XML definition for %1\n").arg(name) << endl;
+ kdWarning() << TQString("KImageMapEditorPart: Missing XML definition for %1\n").tqarg(name) << endl;
return;
}
@@ -794,8 +794,8 @@ void KImageMapEditor::updateStatusBar()
void KImageMapEditor::slotChangeStatusCoords(int x,int y)
{
-// 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);
+// statusBar()->changeItem(TQString(" Cursor : x: %1 ,y: %2 ").tqarg(x).tqarg(y),STATUS_CURSOR);
+ cursorStatusText = i18n(" Cursor: x: %1, y: %2 ").tqarg(x).tqarg(y);
updateStatusBar();
}
@@ -803,7 +803,7 @@ void KImageMapEditor::slotUpdateSelectionCoords() {
if (selected()->count()>0) {
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());
+ selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").tqarg(r.left()).tqarg(r.top()).tqarg(r.width()).tqarg(r.height());
// ,STATUS_SELECTION);
kapp->processEvents();
@@ -816,7 +816,7 @@ void KImageMapEditor::slotUpdateSelectionCoords() {
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());
+ selectionStatusText = i18n(" Selection: x: %1, y: %2, w: %3, h: %4 ").tqarg(r.left()).tqarg(r.top()).tqarg(r.width()).tqarg(r.height());
updateStatusBar();
kapp->processEvents();
}
@@ -844,7 +844,7 @@ TQImage KImageMapEditor::getBackgroundImage() {
// TQString filename = TQString("dropimage_")+KGlobal::locale()->language()+".png";
-// TQString path = TQString::null; //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
+// TQString path = TQString(); //KGlobal::dirs()->findResourceDir( "data", "kimagemapeditor/"+filename ) + "kimagemapeditor/"+filename;
// kdDebug() << "getBackgroundPic : loaded image : " << path << endl;
// if ( ! TQFileInfo(path).exists() ) {
@@ -863,7 +863,7 @@ TQImage KImageMapEditor::getBackgroundImage() {
font.setBold(true);
p.setFont( font );
- p.setRasterOp(Qt::CopyROP);
+ p.setRasterOp(TQt::CopyROP);
p.setPen(TQPen(TQColor(112,114,112),1));
// The translated string must be divided into
@@ -990,7 +990,7 @@ void KImageMapEditor::deleteArea( Area * area )
{
if (!area) return;
- // only for repaint reasons
+ // only for tqrepaint reasons
TQRect redrawRect = area->selectionRect();
// Perhaps we've got a selection of areas
@@ -1015,7 +1015,7 @@ void KImageMapEditor::deleteArea( Area * area )
area->deleteListViewItem();
}
- drawZone->repaintRect(redrawRect);
+ drawZone->tqrepaintRect(redrawRect);
// Only to disable cut and copy actions
@@ -1037,7 +1037,7 @@ void KImageMapEditor::deleteSelected() {
}
- drawZone->repaintArea( *currentSelected );
+ drawZone->tqrepaintArea( *currentSelected );
// Only to disable cut and copy actions
if (areas->count()==0)
deselectAll();
@@ -1055,7 +1055,7 @@ void KImageMapEditor::deleteAllAreas()
a=areas->first(); // because the current is deleted
}
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
}
@@ -1065,7 +1065,7 @@ void KImageMapEditor::updateAllAreas()
for (Area* a=areas->first();a!=0L;a=areas->next()) {
a->listViewItem()->setPixmap(1,makeListViewPix(*a));
}
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
}
void KImageMapEditor::updateSelection() const {
@@ -1083,7 +1083,7 @@ void KImageMapEditor::select(Area* a)
currentSelected->add(a);
updateActionAccess();
slotUpdateSelectionCoords();
-// drawZone->repaintArea( *a);
+// drawZone->tqrepaintArea( *a);
}
@@ -1100,13 +1100,13 @@ void KImageMapEditor::slotSelectionChanged()
for ( ; it.current() != 0L; ++it)
{
- if ( it.current()->listViewItem()->isSelected() != (list.containsRef(it.current()) > 0) )
+ if ( it.current()->listViewItem()->isSelected() != (list.tqcontainsRef(it.current()) > 0) )
{
it.current()->listViewItem()->isSelected()
? select( it.current() )
: deselect( it.current() );
- drawZone->repaintArea( *it.current());
+ drawZone->tqrepaintArea( *it.current());
}
}
@@ -1122,7 +1122,7 @@ void KImageMapEditor::select( TQListViewItem* item)
if (it.current()->listViewItem() == item )
{
select( it.current() );
- drawZone->repaintArea( *it.current());
+ drawZone->tqrepaintArea( *it.current());
}
}
@@ -1162,7 +1162,7 @@ void KImageMapEditor::slotAreaChanged(Area *area)
area->listViewItem()->setPixmap(1,makeListViewPix(*area));
}
- drawZone->repaintArea(*area);
+ drawZone->tqrepaintArea(*area);
}
@@ -1170,7 +1170,7 @@ void KImageMapEditor::deselect(Area* a)
{
if (a) {
currentSelected->remove(a);
-// drawZone->repaintArea(*a);
+// drawZone->tqrepaintArea(*a);
updateActionAccess();
slotUpdateSelectionCoords();
}
@@ -1280,7 +1280,7 @@ void KImageMapEditor::updateUpDownBtn()
return;
}
// if the first Area is in the selection can't move up
- if (list.find( areas->getFirst() ) == -1)
+ if (list.tqfind( areas->getFirst() ) == -1)
{
forwardOneAction->setEnabled(true);
areaListView->upBtn->setEnabled(true);
@@ -1290,10 +1290,10 @@ void KImageMapEditor::updateUpDownBtn()
areaListView->upBtn->setEnabled(false);
}
- drawZone->repaintArea(*currentSelected);
+ drawZone->tqrepaintArea(*currentSelected);
// if the last Area is in the selection can't move down
- if (list.find( areas->getLast() ) == -1)
+ if (list.tqfind( areas->getLast() ) == -1)
{
backOneAction->setEnabled(true);
areaListView->downBtn->setEnabled(true);
@@ -1309,13 +1309,13 @@ void KImageMapEditor::deselectAll()
{
TQRect redrawRect= currentSelected->selectionRect();
currentSelected->reset();
- drawZone->repaintRect(redrawRect);
+ drawZone->tqrepaintRect(redrawRect);
updateActionAccess();
}
Area* KImageMapEditor::onArea(const TQPoint & p) const {
for (Area* s=areas->first();s!=0L;s=areas->next()) {
- if (s->contains(p))
+ if (s->tqcontains(p))
return s;
}
return 0L;
@@ -1324,7 +1324,7 @@ Area* KImageMapEditor::onArea(const TQPoint & p) const {
int KImageMapEditor::showTagEditor(Area *a) {
if (!a) return 0;
- drawZone->repaintArea(*a);
+ drawZone->tqrepaintArea(*a);
AreaDialog *dialog= new AreaDialog(this,a);
connect (dialog, TQT_SIGNAL(areaChanged(Area*)), this, TQT_SLOT(slotAreaChanged(Area*)));
@@ -1379,7 +1379,7 @@ TQPixmap KImageMapEditor::makeListViewPix(Area & a)
TQPixmap pix2((int)(pix.width()*shrinkFactor), (int)(pix.height()*shrinkFactor));
// Give all pixels a defined color
- pix2.fill(Qt::white);
+ pix2.fill(TQt::white);
TQPainter p(&pix2);
@@ -1407,10 +1407,10 @@ void KImageMapEditor::setPicture(const KURL & url) {
imageUsemapAction->setEnabled(true);
}
else
- kdError() << TQString("The image %1 could not be opened.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 could not be opened.").tqarg(url.path()) << endl;
}
else
- kdError() << TQString("The image %1 does not exist.").arg(url.path()) << endl;
+ kdError() << TQString("The image %1 does not exist.").tqarg(url.path()) << endl;
}
void KImageMapEditor::setPicture(const TQImage & pix) {
@@ -1519,7 +1519,7 @@ void KImageMapEditor::mapEditName()
if (ok) {
if (input != _mapName) {
if (mapsListView->nameAlreadyExists(input))
- KMessageBox::sorry(this->widget(), i18n("The name <em>%1</em> already exists.").arg(input));
+ KMessageBox::sorry(this->widget(), i18n("The name <em>%1</em> already exists.").tqarg(input));
else {
setMapName(input);
}
@@ -1529,7 +1529,7 @@ void KImageMapEditor::mapEditName()
void KImageMapEditor::mapShowHTML()
{
- KDialogBase *dialog= new KDialogBase(widget(),TQString::null,true,i18n("HTML Code of Map"),KDialogBase::Ok);
+ KDialogBase *dialog= new KDialogBase(widget(),TQString(),true,i18n("HTML Code of Map"),KDialogBase::Ok);
TQMultiLineEdit *edit = new TQMultiLineEdit(dialog);
edit->setText(getHtmlCode());
@@ -1568,7 +1568,7 @@ bool KImageMapEditor::openURL(const KURL & url) {
void KImageMapEditor::fileOpen() {
- TQString fileName = KFileDialog::getOpenFileName(TQString::null,
+ TQString fileName = KFileDialog::getOpenFileName(TQString(),
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"
@@ -1622,12 +1622,12 @@ void KImageMapEditor::fileSaveAs() {
if ( fileInfo.exists() )
{
if (KMessageBox::warningContinueCancel(widget(),
- i18n("<qt>The file <em>%1</em> already exists.<br>Do you want to overwrite it?</qt>").arg(fileInfo.fileName()),
+ i18n("<qt>The file <em>%1</em> already exists.<br>Do you want to overwrite it?</qt>").tqarg(fileInfo.fileName()),
i18n("Overwrite File?"), i18n("Overwrite"))==KMessageBox::Cancel)
return;
if(!fileInfo.isWritable()) {
- KMessageBox::sorry(widget(), i18n("<qt>You do not have write permission for the file <em>%1</em>.</qt>").arg(fileInfo.fileName()));
+ KMessageBox::sorry(widget(), i18n("<qt>You do not have write permission for the file <em>%1</em>.</qt>").tqarg(fileInfo.fileName()));
return;
}
}
@@ -1646,14 +1646,14 @@ bool KImageMapEditor::openFile()
if ( !fileInfo.exists() )
{
KMessageBox::information(widget(),
- i18n("<qt>The file <b>%1</b> does not exist.</qt>").arg(fileInfo.fileName()),
+ i18n("<qt>The file <b>%1</b> does not exist.</qt>").tqarg(fileInfo.fileName()),
i18n("File Does Not Exist"));
return false;
}
openHTMLFile(url());
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
recentFilesAction->addURL(url());
setModified(false);
backupFileCreated = false;
@@ -1675,7 +1675,7 @@ TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString &
TQChar w;
TQString attr,value;
- readText = TQString::null;
+ readText = TQString();
// get the tagname
while (!s.atEnd() && w!=" ") {
@@ -1717,8 +1717,8 @@ TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString &
bool valueRead=false; // currently reading a value ?
TQChar quotation='\0'; // currently reading a value with quotation marks ?
bool php=false; // currently reading a php script
- attr=TQString::null;
- value=TQString::null;
+ attr=TQString();
+ value=TQString();
//get the other attributes
while (!s.atEnd() && w!=">")
@@ -1802,7 +1802,7 @@ TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString &
quotation='\0';
valueRead=false;
dict.insert(attr,new TQString(value));
- attr = value = TQString::null;
+ attr = value = TQString();
}
} else
@@ -1810,7 +1810,7 @@ TQDict<TQString> KImageMapEditor::getTagAttributes(TQTextStream & s, TQString &
if (w==" ") {
valueRead=false;
dict.insert(attr,new TQString(value));
- attr = value = TQString::null;
+ attr = value = TQString();
}
} else {
if (w!=" ") {
@@ -1854,44 +1854,44 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, c
{
if (!readMap && !origcode.isEmpty()) {
_htmlContent.append( new HtmlElement(origcode));
- origcode = TQString::null;
+ origcode = TQString();
}
origcode.append("<");
attr=new TQDict<TQString>(getTagAttributes(s,temp));
origcode.append(temp);
- if (attr->find("tagname")) {
+ if (attr->tqfind("tagname")) {
- if (attr->find("tagname")->lower()=="img") {
+ if (attr->tqfind("tagname")->lower()=="img") {
HtmlImgElement *el = new HtmlImgElement(origcode);
el->imgTag = static_cast<ImageTag*>(attr);
images->append(el->imgTag);
_htmlContent.append(el);
- origcode = TQString::null;
+ origcode = TQString();
} else
- if (attr->find("tagname")->lower()=="map") {
+ if (attr->tqfind("tagname")->lower()=="map") {
map = new MapTag();
- map->name=(*attr->find("name"));
+ map->name=(*attr->tqfind("name"));
readMap=true;
} else
- if (attr->find("tagname")->lower()=="/map") {
+ if (attr->tqfind("tagname")->lower()=="/map") {
readMap=false;
maps->append(map);
HtmlMapElement *el = new HtmlMapElement(origcode);
el->mapTag = map;
_htmlContent.append(el);
- origcode = TQString::null;
+ origcode = TQString();
} else
if (readMap) {
- if (attr->find("tagname")->lower()=="area") {
+ if (attr->tqfind("tagname")->lower()=="area") {
map->prepend(attr);
}
} else {
_htmlContent.append(new HtmlElement(origcode));
- origcode = TQString::null;
+ origcode = TQString();
}
}
@@ -1924,7 +1924,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, c
if (images->count() == 1) {
if (images->first()) {
ImageTag* imgTag = images->first();
- TQString *src = imgTag->find("src");
+ TQString *src = imgTag->tqfind("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -1936,12 +1936,12 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, c
ImageTag* imageTag;
for ( imageTag = images->first(); imageTag; imageTag = images->next() )
{
- TQString *usemap = imageTag->find("usemap");
+ TQString *usemap = imageTag->tqfind("usemap");
if (usemap) {
// Remove the #
TQString usemapName = usemap->right(usemap->length()-1);
if (usemapName == map->name) {
- TQString *src = imageTag->find("src");
+ TQString *src = imageTag->tqfind("src");
if (src)
imageUrl = KURL(url,*src);
}
@@ -2005,7 +2005,7 @@ bool KImageMapEditor::openHTMLFile(const KURL & url, const TQString & mapName, c
*/
HtmlElement* KImageMapEditor::findHtmlElement(const TQString & containingText) {
for (HtmlElement * el = _htmlContent.first(); el; el = _htmlContent.next() ) {
- if (el->htmlCode.contains(containingText,false)) {
+ if (el->htmlCode.tqcontains(containingText,false)) {
return el;
}
}
@@ -2027,7 +2027,7 @@ HtmlImgElement* KImageMapEditor::findHtmlImgElement(ImageTag* tag) {
return 0L;
}
-void KImageMapEditor::addMap(const TQString & name = TQString::null) {
+void KImageMapEditor::addMap(const TQString & name = TQString()) {
HtmlMapElement* el = new HtmlMapElement("\n<map></map>");
MapTag* map = new MapTag();
map->name = name;
@@ -2038,7 +2038,7 @@ void KImageMapEditor::addMap(const TQString & name = TQString::null) {
// if we found one add the new map right after the body tag
if (bodyTag) {
- uint index = _htmlContent.find(bodyTag);
+ uint index = _htmlContent.tqfind(bodyTag);
// Add a newline before the map
_htmlContent.insert(index+1, new HtmlElement("\n"));
@@ -2107,16 +2107,16 @@ void KImageMapEditor::saveAreasToMapTag(MapTag* map) {
map->clear();
for (Area* a=areas->first();a!=0L;a=areas->next()) {
TQDict<TQString> *dict = new TQDict<TQString>(17,false);
- TQString *shapeStr = 0L;
+ TQString *tqshapeStr = 0L;
switch (a->type()) {
- case Area::Rectangle : shapeStr = new TQString("rect");break;
- case Area::Circle : shapeStr = new TQString("circle");break;
- case Area::Polygon : shapeStr = new TQString("poly");break;
+ case Area::Rectangle : tqshapeStr = new TQString("rect");break;
+ case Area::Circle : tqshapeStr = new TQString("circle");break;
+ case Area::Polygon : tqshapeStr = new TQString("poly");break;
default : continue;
}
- dict->insert("shape",shapeStr);
+ dict->insert("tqshape",tqshapeStr);
for (AttributeIterator it = a->firstAttribute();it!=a->lastAttribute();++it) {
dict->insert(it.key(),new TQString(it.data()));
@@ -2130,7 +2130,7 @@ void KImageMapEditor::saveAreasToMapTag(MapTag* map) {
if (defaultArea && defaultArea->finished()) {
TQDict<TQString> *dict = new TQDict<TQString>(17,false);
- dict->insert("shape",new TQString("default"));
+ dict->insert("tqshape",new TQString("default"));
for (AttributeIterator it = defaultArea->firstAttribute();it!=defaultArea->lastAttribute();++it) {
dict->insert(it.key(),new TQString(it.data()));
@@ -2159,49 +2159,49 @@ void KImageMapEditor::setMap(HtmlMapElement* mapElement) {
_mapName = map->name;
for (AreaTag *tag=map->first();tag!=0L;tag=map->next())
{
- TQString shape="rect";
- if (tag->find("shape"))
- shape=*tag->find("shape");
+ TQString tqshape="rect";
+ if (tag->tqfind("tqshape"))
+ tqshape=*tag->tqfind("tqshape");
Area::ShapeType type=Area::Rectangle;
- if (shape=="circle")
+ if (tqshape=="circle")
type=Area::Circle;
- else if (shape=="poly")
+ else if (tqshape=="poly")
type=Area::Polygon;
- else if (shape=="default")
+ else if (tqshape=="default")
type=Area::Default;
Area* a=AreaCreator::create(type);
- if (tag->find("href"))
- a->setAttribute("href",*tag->find("href"));
+ if (tag->tqfind("href"))
+ a->setAttribute("href",*tag->tqfind("href"));
- if (tag->find("alt"))
- a->setAttribute("alt",*tag->find("alt"));
+ if (tag->tqfind("alt"))
+ a->setAttribute("alt",*tag->tqfind("alt"));
- if (tag->find("target"))
- a->setAttribute("target",*tag->find("target"));
+ if (tag->tqfind("target"))
+ a->setAttribute("target",*tag->tqfind("target"));
- if (tag->find("title"))
- a->setAttribute("title",*tag->find("title"));
+ if (tag->tqfind("title"))
+ a->setAttribute("title",*tag->tqfind("title"));
- if (tag->find("onclick"))
- a->setAttribute("onclick",*tag->find("onclick"));
+ if (tag->tqfind("onclick"))
+ a->setAttribute("onclick",*tag->tqfind("onclick"));
- if (tag->find("onmousedown"))
- a->setAttribute("onmousedown",*tag->find("onmousedown"));
+ if (tag->tqfind("onmousedown"))
+ a->setAttribute("onmousedown",*tag->tqfind("onmousedown"));
- if (tag->find("onmouseup"))
- a->setAttribute("onmouseup",*tag->find("onmouseup"));
+ if (tag->tqfind("onmouseup"))
+ a->setAttribute("onmouseup",*tag->tqfind("onmouseup"));
- if (tag->find("onmouseover"))
- a->setAttribute("onmouseover",*tag->find("onmouseover"));
+ if (tag->tqfind("onmouseover"))
+ a->setAttribute("onmouseover",*tag->tqfind("onmouseover"));
- if (tag->find("onmousemove"))
- a->setAttribute("onmousemove",*tag->find("onmousemove"));
+ if (tag->tqfind("onmousemove"))
+ a->setAttribute("onmousemove",*tag->tqfind("onmousemove"));
- if (tag->find("onmouseout"))
- a->setAttribute("onmouseout",*tag->find("onmouseout"));
+ if (tag->tqfind("onmouseout"))
+ a->setAttribute("onmouseout",*tag->tqfind("onmouseout"));
@@ -2211,8 +2211,8 @@ void KImageMapEditor::setMap(HtmlMapElement* mapElement) {
continue;
}
- if (tag->find("coords"))
- a->setCoords(*tag->find("coords"));
+ if (tag->tqfind("coords"))
+ a->setCoords(*tag->tqfind("coords"));
a->setMoving(false);
addArea(a);
@@ -2267,7 +2267,7 @@ void KImageMapEditor::saveImageMap(const KURL & url)
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()));
+ i18n("<qt>The file <i>%1</i> could not be saved, because you do not have the required write permissions.</qt>").tqarg(url.path()));
return;
}
@@ -2295,7 +2295,7 @@ void KImageMapEditor::saveImageMap(const KURL & url)
<< "<body>\n"
<< " " << getHTMLImageMap()
<< "\n"
- << " <img src=\"" << QExtFileInfo::toRelative(_imageUrl,KURL( url.directory() )).path() << "\""
+ << " <img src=\"" << TQExtFileInfo::toRelative(_imageUrl,KURL( url.directory() )).path() << "\""
<< " usemap=\"#" << _mapName << "\""
<< " width=\"" << drawZone->picture().width() << "\""
<< " height=\"" << drawZone->picture().height() << "\">\n"
@@ -2375,7 +2375,7 @@ void KImageMapEditor::slotBackOne()
// move every selected Area one step lower
for (int i=areas->count()-2; i > -1; i--)
{
- if (list.find( areas->at(i) ) > -1 )
+ if (list.tqfind( areas->at(i) ) > -1 )
{
a = areas->at(i);
areas->remove(a);
@@ -2399,7 +2399,7 @@ void KImageMapEditor::slotForwardOne()
// move every selected Area one step higher
for (int i=1; i < (int)areas->count(); i++)
{
- if (list.find( areas->at(i) ) > -1 )
+ if (list.tqfind( areas->at(i) ) > -1 )
{
a = areas->at(i);
areas->remove(a);
@@ -2556,7 +2556,7 @@ void KImageMapEditor::slotHightlightAreas()
// highlightAreasAction->setChecked(b);
Area::highlightArea = b;
updateAllAreas();
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
}
void KImageMapEditor::slotShowAltTag()
@@ -2564,7 +2564,7 @@ void KImageMapEditor::slotShowAltTag()
bool b = showAltAction->isChecked();
// showAltAction->setChecked(b);
Area::showAlt = b;
- drawZone->viewport()->repaint();
+ drawZone->viewport()->tqrepaint();
}
void KImageMapEditor::mapNew()
@@ -2583,7 +2583,7 @@ void KImageMapEditor::mapDelete()
int result = KMessageBox::warningContinueCancel(widget(),
i18n("<qt>Are you sure you want to delete the map <i>%1</i>?"
- " <br><b>There is no way to undo this.</b></qt>").arg(selectedMap),
+ " <br><b>There is no way to undo this.</b></qt>").tqarg(selectedMap),
i18n("Delete Map?"),KGuiItem(i18n("&Delete"),"editdelete"));
if (result == KMessageBox::No)
@@ -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()), TQString::null, KStdGuiItem::save(), KStdGuiItem::discard()) ) {
+ i18n("<qt>The file <i>%1</i> has been modified.<br>Do you want to save it?</qt>").tqarg(url().fileName()), TQString(), KStdGuiItem::save(), KStdGuiItem::discard()) ) {
case KMessageBox::Yes :
saveFile();
return true;
@@ -2671,7 +2671,7 @@ void KImageMapEditor::addImage(const KURL & imgUrl) {
if (imgUrl.isEmpty())
return;
- TQString relativePath ( QExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
+ TQString relativePath ( TQExtFileInfo::toRelative(imgUrl, KURL( url().directory() )).path() );
TQString imgHtml = TQString("<img src=\"")+relativePath+TQString("\">");
ImageTag *imgTag = new ImageTag();
@@ -2683,7 +2683,7 @@ void KImageMapEditor::addImage(const KURL & imgUrl) {
HtmlElement *bodyEl = findHtmlElement("<body");
if (bodyEl) {
- int bodyIndex = _htmlContent.find(bodyEl);
+ int bodyIndex = _htmlContent.tqfind(bodyEl);
_htmlContent.insert(bodyIndex+1, new HtmlElement("\n"));
_htmlContent.insert(bodyIndex+2, imgEl);
}
@@ -2727,7 +2727,7 @@ void KImageMapEditor::imageRemove() {
else {
ImageTag* selected = imagesListView->selectedImage();
if (selected) {
- TQString *url = selected->find("src");
+ TQString *url = selected->tqfind("src");
if (url) {
setPicture(KURL(*url));
}
@@ -2746,11 +2746,11 @@ void KImageMapEditor::imageUsemap() {
TQString usemap;
- if (imageTag->find("usemap"))
- usemap=*imageTag->find("usemap");
+ if (imageTag->tqfind("usemap"))
+ usemap=*imageTag->tqfind("usemap");
TQStringList maps = mapsListView->getMaps();
- int index = maps.findIndex(usemap);
+ int index = maps.tqfindIndex(usemap);
if (index == -1) {
maps.prepend("");
index = 0;
@@ -2759,12 +2759,12 @@ void KImageMapEditor::imageUsemap() {
#if KDE_IS_VERSION(3, 1, 90)
TQString input = KInputDialog::getItem(i18n("Enter Usemap"),
#else
- TQString input = QInputDialog::getItem(i18n("Enter Usemap"),
+ TQString input = TQInputDialog::getItem(i18n("Enter Usemap"),
#endif
i18n("Enter the usemap value:"),
maps,index,true,&ok,widget());
if (ok) {
- imageTag->replace("usemap", new TQString(input));
+ imageTag->tqreplace("usemap", new TQString(input));
imagesListView->updateImage(imageTag);
setModified(true);
@@ -2772,7 +2772,7 @@ void KImageMapEditor::imageUsemap() {
HtmlImgElement* imgEl = findHtmlImgElement(imageTag);
imgEl->htmlCode = "<";
- TQString *tagName = imgEl->imgTag->find("tagname");
+ TQString *tagName = imgEl->imgTag->tqfind("tagname");
imgEl->htmlCode += TQString(*tagName);
TQDictIterator<TQString> it( *imgEl->imgTag );