TQt4 port potracegui

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/potracegui@1239033 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent dad5420e97
commit 94ddde53d9

129
debian/changelog vendored

@ -1,129 +0,0 @@
potracegui-kde3 (1.3-2.0ubuntu1) karmic; urgency=low
* Karmic rebuild for KDE3
-- Timothy Pearson <kb9vqf@pearsoncomputing.net> Sat, 06 Mar 2010 06:02:00 -0600
potracegui (1.3-2.3ubuntu2) jaunty; urgency=low
* debian/rules: added --without-arts parameter to configure script call to
rebuild without arts support (LP: #320915)
-- Fabrice Coutadeur <fabricesp@ubuntu.com> Fri, 17 Apr 2009 05:08:31 +0000
potracegui (1.3-2.3ubuntu1) intrepid; urgency=low
* Merge from Debian unstable (LP: #229066). Remaining Ubuntu changes:
- debian/control: modify Maintainer to Ubuntu MOTU Developers
- debian/rules: add dh_icon
* Update Standards-Version to 3.7.3.
* Fix debian-rules-ignores-make-clean-error lintian warning.
* Fix debhelper-script-needs-versioned-build-depends lintian warning.
-- Devid Filoni <d.filoni@techemail.com> Sat, 22 Mar 2008 15:31:50 +0100
potracegui (1.3-2.3) unstable; urgency=medium
* Non-maintainer upload.
* Fix FTBFS with GCC 4.3 (Closes: #417484).
-- Luk Claes <luk@debian.org> Fri, 14 Mar 2008 19:01:38 +0000
potracegui (1.3-2.2ubuntu3) hardy; urgency=low
* debian/rules: change dh_iconcache to dh_icons to fix FTFBS. (LP: #204263)
-- Andrea Colangelo <warp10@ubuntu.com> Thu, 20 Mar 2008 14:41:57 +0100
potracegui (1.3-2.2ubuntu2) gutsy; urgency=low
* debian/control: Update maintainer fields according to debian-
maintainer-field spec.
-- Martin Pitt <martin.pitt@ubuntu.com> Wed, 15 Aug 2007 08:09:41 +0000
potracegui (1.3-2.2ubuntu1) dapper; urgency=low
* debian/rules: added dh_iconcache
-- Szilveszter Farkas (Phanatic) <Szilveszter.Farkas@gmail.com> Mon, 8 May 2006 10:26:45 +0200
potracegui (1.3-2.2) unstable; urgency=medium
* Non-maintainer upload.
* Fix FTBFS due to more restrictive coreutils. (Closes: #340010)
Patch by Roland Stigge.
-- Adeodato Simó <dato@net.com.org.es> Tue, 13 Dec 2005 03:40:56 +0100
potracegui (1.3-2.1) unstable; urgency=low
* Non-maintainer upload.
* Rebuild for the Qt/KDE transition (Closes: #327984)
* German PO file corrections (Closes: #313817)
-- Luk Claes <luk@debian.org> Fri, 30 Sep 2005 17:24:45 +0200
potracegui (1.3-2) unstable; urgency=medium
* Urgency medium, cause without this fix package is almost unusable
for people using German locale.
* Closes: #303718: translated text is passed as option to potrace
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Sat, 30 Apr 2005 23:04:34 +0200
potracegui (1.3-1) unstable; urgency=low
* New upstream release
- german translation
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Sat, 5 Mar 2005 12:46:14 +0100
potracegui (1.2-1) unstable; urgency=low
* New upstream release
- added support for autotrace
* added upstream author to manpage
* Suggests autotrace now
* mention autotrace in description
* using dh_installman now
* added watch file
* various other minor fixes to make sponsor happy
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Tue, 4 Jan 2005 09:30:40 +0100
potracegui (1.1-1) unstable; urgency=low
* New upstream release
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Wed, 17 Nov 2004 07:04:33 +0100
potracegui (1.0-1) unstable; urgency=low
* new upstream release.
* removed recommondation for libmagick, as it is no longer needed.
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Tue, 22 Jun 2004 14:56:45 +0200
potracegui (0.5.1-3) unstable; urgency=low
* added autotool-dev to Build-Depends.
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Thu, 10 Jun 2004 16:00:58 +0200
potracegui (0.5.1-2) unstable; urgency=low
* adjusting the copyright file and the package description.
* fixed Build-Depends.
* Closes: #253205: ITP: potracegui -- a KDE frontend for potrace.
* Recommends now imagemagick, needed for displaying tracing results.
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Tue, 8 Jun 2004 09:40:05 +0200
potracegui (0.5.1-1) unstable; urgency=low
* Initial Release.
* My first debian package.
-- Christoph Wegscheider <christoph.wegscheider@wegi.net> Sat, 5 Jun 2004 14:59:34 +0200

1
debian/compat vendored

@ -1 +0,0 @@
4

20
debian/control vendored

@ -1,20 +0,0 @@
Source: potracegui-kde3
Section: graphics
Priority: optional
Maintainer: Timothy Pearson <kb9vqf@pearsoncomputing.net>
XSBC-Original-Maintainer: Christoph Wegscheider <christoph.wegscheider@wegi.net>
Uploaders: Bartosz Fenski <fenio@debian.org>
Build-Depends: debhelper (>= 5.0.51), autotools-dev, kdelibs4-kde3-dev
Standards-Version: 3.8.3
Package: potracegui-kde3
Architecture: any
Depends: ${shlibs:Depends}, potrace
Suggests: autotrace
Description: KDE frontend for potrace [KDE3]
A KDE interface for the commandline tracing tools potrace and/or autotrace. It
supports drag and drop as well as all image types recognized by KDE, which are
a lot more than the 4 recognized by the potrace commandline tool. Loading of
remote files (web, ftp, ...) is also supported.
.
Homepage: http://potracegui.sourceforge.net

21
debian/copyright vendored

@ -1,21 +0,0 @@
This package was debianized by Christoph Wegscheider <christoph.wegscheider@wegi.net> on
Thu, 5 Jun 2004 15:05:07 +0200.
It was downloaded from http://potracegui.sourceforge.net/
Upstream Author: Antonio Fasolato <Antonio.Fasolato@poste.it>
Copyright:
Copyright 2004 Antonio Fasolato <Antonio.Fasolato@poste.it>
License:
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
On Debian systems, the complete text of the GNU General Public License
can be found in the file `/usr/share/common-licenses/GPL'.

4
debian/dirs vendored

@ -1,4 +0,0 @@
usr/bin
usr/share/applnk/Graphics
usr/share/doc/kde

2
debian/docs vendored

@ -1,2 +0,0 @@
README

@ -1,67 +0,0 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH POTRACEGUI 1 "January 4, 2005"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
potracegui \- a KDE frontend for potrace
.SH SYNOPSIS
.B potracegui
[Qt-options] [KDE-options] [URL]
.br
.SH DESCRIPTION
This manual page documents briefly the
.B potracegui
commands.
This manual page was written for the Debian distribution
because the original program does not have a manual page.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBpotracegui\fP is a KDE frontend for potrace.
.SH OPTIONS
A summary of options is included below.
.TP
.B \-\-help
Show help about options.
.TP
.B \-\-help-qt
Show QT specific options.
.TP
.B \-\-help-kde
Show KDE specific options.
.TP
.B \-\-help-all
Show all options.
.TP
.B \-\-author
Show author information.
.TP
.B \-v, \-\-version
Show version information.
.TP
.B \-\-license
Show license information.
.TP
.B \-\-
End of options.
.SH SEE ALSO
.BR potrace (1).
.SH AUTHOR
This manual page was written by Christoph Wegscheider
<christoph.wegscheider@wegi.net>, for the Debian project (but may be used by
others). The original author of potracegui is Antonio Fasolato
<Antonio.Fasolato@poste.it>.

@ -1,4 +0,0 @@
?package(potracegui):needs="X11" section="Apps/Graphics"\
title="potracegui" command="/opt/kde3/bin/potracegui"\
hints="KDE frontend for tracing programs"

107
debian/rules vendored

@ -1,107 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_CONFIGURE_INCLUDEDIR := /opt/kde3/include/kde
DEB_CONFIGURE_MANDIR := /opt/kde3/share/man
DEB_CONFIGURE_PREFIX := /opt/kde3
DEB_CONFIGURE_INFODIR := /opt/kde3/share/info
cdbs_configure_flags := --with-qt-dir=/usr/share/qt3 --disable-rpath --with-xinerama $(cdbs_kde_enable_final) $(cdbs_kde_enable_debug)
DEB_CONFIGURE_EXTRA_FLAGS := --prefix=/opt/kde3 --with-extra-libs=/opt/kde3/lib
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
config.status:
! [ -f /usr/share/libtool/ltmain.sh ] || \
cp -f /usr/share/libtool/ltmain.sh admin/ltmain.sh
! [ -f /usr/share/libtool/config/ltmain.sh ] || \
cp -f /usr/share/libtool/config/ltmain.sh admin/ltmain.sh
cp -f /usr/share/aclocal/libtool.m4 admin/libtool.m4.in
make -f admin/Makefile.common cvs
dh_testdir
CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/opt/kde3 --mandir=/opt/kde3/share/man --infodir=/opt/kde3/share/info --disable-rpath
build: build-stamp
build-stamp: config.status
dh_testdir
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
rm -f po/*.gmo
dh_clean --exclude ./src/potracegui.cpp.orig
install: build
dh_testdir
dh_testroot
dh_clean -k --exclude ./src/potracegui.cpp.orig
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/potracegui-kde3
mkdir -p $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/doc/kde
mv $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/doc/HTML $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/doc/kde/HTML
mkdir -p $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/applnk/Graphics
mv $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/applnk/Utilities/potracegui.desktop $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/applnk/Graphics/
rmdir $(CURDIR)/debian/potracegui-kde3/opt/kde3/share/applnk/Utilities
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installmenu
dh_installman debian/potracegui-kde3.1
dh_icons
dh_link
dh_strip
dh_compress -X.docbook
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

2
debian/watch vendored

@ -1,2 +0,0 @@
version=2
ftp://ftp2.sf.net/pub/sourceforge/p/po/potracegui/ potracegui-([\d\.]*)\.tar\.gz debian uupdate

File diff suppressed because it is too large Load Diff

@ -19,9 +19,9 @@
***************************************************************************/
#include "autotraceformats.h"
AutotraceFormats::AutotraceFormats(QObject *parent, const char *name): QObject(parent, name), allOK(true) {
inputProcess=new QProcess(this);
outputProcess=new QProcess(this);
AutotraceFormats::AutotraceFormats(TQObject *tqparent, const char *name): TQObject(tqparent, name), allOK(true) {
inputProcess=new TQProcess(this);
outputProcess=new TQProcess(this);
inputProcess->addArgument("autotrace");
inputProcess->addArgument("--list-input-formats");
@ -29,8 +29,8 @@ AutotraceFormats::AutotraceFormats(QObject *parent, const char *name): QObject(p
outputProcess->addArgument("autotrace");
outputProcess->addArgument("--list-output-formats");
connect(inputProcess,SIGNAL(readyReadStderr()),this,SLOT(inputRead()));
connect(outputProcess,SIGNAL(readyReadStderr()),this,SLOT(outputRead()));
connect(inputProcess,TQT_SIGNAL(readyReadStderr()),this,TQT_SLOT(inputRead()));
connect(outputProcess,TQT_SIGNAL(readyReadStderr()),this,TQT_SLOT(outputRead()));
if(!(inputProcess->start()) || !(outputProcess->start())) {
allOK=false;
@ -45,7 +45,7 @@ void AutotraceFormats::inputRead( ) {
void AutotraceFormats::outputRead( ) {
while(outputProcess->canReadLineStderr()) {
QString tmp=outputProcess->readLineStderr();
TQString tmp=outputProcess->readLineStderr();
if(!(tmp.startsWith("Supported")))
output+=tmp.stripWhiteSpace();
}
@ -59,11 +59,11 @@ bool AutotraceFormats::done( ) {
return (!(inputProcess->isRunning()) && !(outputProcess->isRunning()));
}
QStringList AutotraceFormats::inputFormats( ) {
TQStringList AutotraceFormats::inputFormats( ) {
return input;
}
QStringList AutotraceFormats::outputFormats( ) {
TQStringList AutotraceFormats::outputFormats( ) {
return output;
}

@ -20,34 +20,35 @@
#ifndef AUTOTRACEFORMATS_H
#define AUTOTRACEFORMATS_H
#include <qobject.h>
#include <qstringlist.h>
#include <qprocess.h>
#include <tqobject.h>
#include <tqstringlist.h>
#include <tqprocess.h>
//! Class to read autotrace input and output formats
/** This class executes autotrace to gain informations about the formats it can use
* \author Antonio Fasolato
*/
class AutotraceFormats : public QObject
class AutotraceFormats : public TQObject
{
Q_OBJECT
TQ_OBJECT
public:
//! Standard QObject-like constructor
//! Standard TQObject-like constructor
/** The constructor, nothing fancy
* \param parent The parent of the QObject
* \param name The name of the QObject
* \param tqparent The tqparent of the TQObject
* \param name The name of the TQObject
*/
AutotraceFormats(QObject *parent = 0, const char *name = 0);
AutotraceFormats(TQObject *tqparent = 0, const char *name = 0);
//!Returns the list of supported input formats
/** This class returns the list of formats returned by <code>autotrace -list-input-formats</code>
* \return The supported formats
*/
QStringList inputFormats();
TQStringList inputFormats();
//!Returns the list of supported output formats
/** This class returns the list of formats returned by <code>autotrace -list-output-formats</code>
* \return The supported formats
*/
QStringList outputFormats();
TQStringList outputFormats();
//! Function to test the execution of autotrace
/** This functions returns <code>true</code> if the autotrace command could be run succesfully. If it returns
* <code>false</code> autotrace executable can not be found in the environment
@ -62,13 +63,13 @@ public:
private:
//! The process to get input formats
QProcess *inputProcess;
TQProcess *inputProcess;
//! The process to get output formats
QProcess *outputProcess;
TQProcess *outputProcess;
//! The list of input formats
QStringList input;
TQStringList input;
//! The list of output formats
QStringList output;
TQStringList output;
//! <code>true</code> if autotrace could be run
bool allOK;

@ -23,15 +23,15 @@
#include "options.h"
#include "autotraceformats.h"
#include <qcheckbox.h>
#include <qradiobutton.h>
#include <qbuffer.h>
#include <qbuttongroup.h>
#include <qtabwidget.h>
#include <qcursor.h>
#include <qapplication.h>
#include <qwidgetstack.h>
#include <qglobal.h>
#include <tqcheckbox.h>
#include <tqradiobutton.h>
#include <tqbuffer.h>
#include <tqbuttongroup.h>
#include <tqtabwidget.h>
#include <tqcursor.h>
#include <tqapplication.h>
#include <tqwidgetstack.h>
#include <tqglobal.h>
#include <kurldrag.h>
#include <kfiledialog.h>
@ -48,19 +48,19 @@
#include <fstream>
using namespace std;
MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl): MainWidgetBase(parent,name,fl), m_changed(false) {
MainWidget::MainWidget(TQWidget* tqparent, const char* name, WFlags fl): MainWidgetBase(tqparent,name,fl), m_changed(false) {
KImageIO::registerFormats();
setAcceptDrops(true);
/*Scrolled image viewers*/
delete imagesTabs->page(0);
QScrollView *originalScroll=new QScrollView(this);
QScrollView *previewScroll=new QScrollView(this);
TQScrollView *originalScroll=new TQScrollView(this);
TQScrollView *previewScroll=new TQScrollView(this);
imagesTabs->addTab(originalScroll,i18n("Original image"));
imagesTabs->addTab(previewScroll,i18n("Preview"));
originalLabel=new QLabel(this);
previewLabel=new QLabel(this);
originalLabel=new TQLabel(this);
previewLabel=new TQLabel(this);
originalLabel->setGeometry(0,0,10,10);
previewLabel->setGeometry(0,0,10,10);
originalScroll->addChild(originalLabel);
@ -73,14 +73,14 @@ MainWidget::MainWidget(QWidget* parent, const char* name, WFlags fl): MainWidget
m_state.clear();
m_oldPreviews.clear();
m_state.push_back(o);
m_oldPreviews.push_back(QPixmap());
m_oldPreviews.push_back(TQPixmap());
m_currentState=m_state.begin();
m_currentPreview=m_oldPreviews.begin();
connect(&tracer,SIGNAL(processExited()),this,SLOT(tracerExited()));
connect(&tracer,SIGNAL(wroteToStdin()),this,SLOT(writeCompleted()));
connect(traceBtn,SIGNAL(clicked()),this,SLOT(trace()));
connect(defaultBtn,SIGNAL(clicked()),this,SLOT(defaultOptions()));
connect(&tracer,TQT_SIGNAL(processExited()),this,TQT_SLOT(tracerExited()));
connect(&tracer,TQT_SIGNAL(wroteToStdin()),this,TQT_SLOT(writeCompleted()));
connect(traceBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(trace()));
connect(defaultBtn,TQT_SIGNAL(clicked()),this,TQT_SLOT(defaultOptions()));
emit(signalChangeStatusbar(i18n("Checking autotrace formats.")));
AutotraceFormats *formats=new AutotraceFormats();
@ -105,17 +105,17 @@ MainWidget::~MainWidget() {
}
void MainWidget::fileOpen() {
KFileDialog d(QString::null,KImageIO::pattern(),this,i18n("Select an image"),true);
KFileDialog d(TQString(),KImageIO::pattern(),this,i18n("Select an image"),true);
d.exec();
if(d.result()==QDialog::Accepted)
if(d.result()==TQDialog::Accepted)
getImageFromURL(d.selectedURL());
}
void MainWidget::fileSave() {
if(m_outputFilename=="" && m_changed)
{
QString filter;
TQString filter;
if(backendCombo->currentText()=="potrace") { //potrace formats
if((**m_currentState)["outputFormat"]==i18n("eps"))
filter=i18n("*.eps|Encapsulated postscript");
@ -133,14 +133,14 @@ void MainWidget::fileSave() {
else { //autotrace formats
filter="*."+(**m_currentState)["outputFormat"];
}
QString saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to"));
TQString saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to"));
bool salva=false;
while(saveFilename!="")
{
int res;
if(QFile::exists(saveFilename))
res=KMessageBox::warningYesNo(this, i18n("Overwrite %1 ?").arg(saveFilename));
if(TQFile::exists(saveFilename))
res=KMessageBox::warningYesNo(this, i18n("Overwrite %1 ?").tqarg(saveFilename));
else
{
salva=true;
@ -152,7 +152,7 @@ void MainWidget::fileSave() {
break;
}
else
saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to"));
saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to"));
}
if(salva)
@ -165,14 +165,14 @@ void MainWidget::fileSave() {
emit signalChangeStatusbar(i18n(i18n("Error while saving file")));
return;
}
emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename));
char ch;
while(in.get(ch))
out.put(ch);
in.close();
out.close();
m_changed=false;
emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename));
}
else
emit signalChangeStatusbar(i18n("File not saved"));
@ -186,14 +186,14 @@ void MainWidget::fileSave() {
emit signalChangeStatusbar(i18n("Error while saving file"));
return;
}
emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename));
char ch;
while(in.get(ch))
out.put(ch);
in.close();
out.close();
emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename));
m_changed=false;
}
}
@ -201,7 +201,7 @@ void MainWidget::fileSave() {
void MainWidget::fileSaveAs() {
if(previewLabel->pixmap()!=0 || previewLabel->text()!="")
{
QString filter;
TQString filter;
if(backendCombo->currentText()=="potrace") { //potrace formats
if((**m_currentState)["outputFormat"]==i18n("eps"))
filter=i18n("*.eps|Encapsulated postscript");
@ -219,14 +219,14 @@ void MainWidget::fileSaveAs() {
else { //autotrace formats
filter="*."+(**m_currentState)["outputFormat"];
}
QString saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to"));
TQString saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to"));
bool salva=false;
while(saveFilename!="")
{
int res;
if(QFile::exists(saveFilename))
res=KMessageBox::warningYesNo(this,i18n("Overwrite %1 ?").arg(saveFilename));
if(TQFile::exists(saveFilename))
res=KMessageBox::warningYesNo(this,i18n("Overwrite %1 ?").tqarg(saveFilename));
else
{
salva=true;
@ -238,7 +238,7 @@ void MainWidget::fileSaveAs() {
break;
}
else
saveFilename=KFileDialog::getSaveFileName(QString::null,filter,this,i18n("Select the file to save to"));
saveFilename=KFileDialog::getSaveFileName(TQString(),filter,this,i18n("Select the file to save to"));
}
if(salva)
@ -251,14 +251,14 @@ void MainWidget::fileSaveAs() {
emit signalChangeStatusbar(i18n("Error while saving file"));
return;
}
emit signalChangeStatusbar(i18n("Saving %1...").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("Saving %1...").tqarg(m_outputFilename));
char ch;
while(in.get(ch))
out.put(ch);
in.close();
out.close();
m_changed=false;
emit signalChangeStatusbar(i18n("File %1 saved.").arg(m_outputFilename));
emit signalChangeStatusbar(i18n("File %1 saved.").tqarg(m_outputFilename));
}
else
emit signalChangeStatusbar(i18n("File not saved"));
@ -277,7 +277,7 @@ void MainWidget::fileClose() {
m_state.clear();
m_oldPreviews.clear();
m_state.push_back(o);
m_oldPreviews.push_back(QPixmap());
m_oldPreviews.push_back(TQPixmap());
m_currentState=m_state.begin();
m_currentPreview=m_oldPreviews.begin();
readOptions();
@ -286,7 +286,7 @@ void MainWidget::fileClose() {
void MainWidget::cut() {
if(originalLabel->pixmap()!=0)
{
QApplication::clipboard()->setPixmap(QPixmap(*(originalLabel->pixmap())));
TQApplication::tqclipboard()->setPixmap(TQPixmap(*(originalLabel->pixmap())));
fileClose();
}
}
@ -294,12 +294,12 @@ void MainWidget::cut() {
void MainWidget::copy() {
if(originalLabel->pixmap()!=0)
{
QApplication::clipboard()->setPixmap(QPixmap(*(originalLabel->pixmap())));
TQApplication::tqclipboard()->setPixmap(TQPixmap(*(originalLabel->pixmap())));
}
}
void MainWidget::paste() {
QPixmap clip=QApplication::clipboard()->pixmap();
TQPixmap clip=TQApplication::tqclipboard()->pixmap();
if(!clip.isNull())
{
if(!createTmpFilename())
@ -309,7 +309,7 @@ void MainWidget::paste() {
}
m_outputFilename="";
QPixmap pix(QApplication::clipboard()->pixmap());
TQPixmap pix(TQApplication::tqclipboard()->pixmap());
originalLabel->clear();
originalLabel->setGeometry(0,0,pix.width(),pix.height());
originalLabel->setPixmap(pix);
@ -333,7 +333,7 @@ void MainWidget::paste() {
if(previewLabel->pixmap()!=0)
m_oldPreviews.push_back(*(previewLabel->pixmap()));
else
m_oldPreviews.push_back(QPixmap());
m_oldPreviews.push_back(TQPixmap());
m_currentState=m_state.begin();
m_currentPreview=m_oldPreviews.begin();
@ -342,7 +342,7 @@ void MainWidget::paste() {
}
void MainWidget::getImageFromURL(KURL url) {
QString filename; // prevent overwriting previous local file with current remote one
TQString filename; // prevent overwriting previous local file with current remote one
if (!url.isLocalFile())
{ // download to temporary file
if (!KIO::NetAccess::download(url,filename,this))
@ -359,14 +359,14 @@ void MainWidget::getImageFromURL(KURL url) {
}
m_outputFilename="";
QPixmap pix(filename);
TQPixmap pix(filename);
originalLabel->clear();
originalLabel->setGeometry(0,0,pix.width(),pix.height());
originalLabel->setPixmap(pix);
previewLabel->clear();
previewLabel->setGeometry(0,0,10,10);
imagesTabs->setCurrentPage(0);
emit signalChangeStatusbar(i18n("File %1 loaded.").arg(filename));
emit signalChangeStatusbar(i18n("File %1 loaded.").tqarg(filename));
if (!url.isLocalFile())
KIO::NetAccess::removeTempFile(filename);
@ -386,7 +386,7 @@ void MainWidget::getImageFromURL(KURL url) {
if(previewLabel->pixmap()!=0)
m_oldPreviews.push_back(*(previewLabel->pixmap()));
else
m_oldPreviews.push_back(QPixmap());
m_oldPreviews.push_back(TQPixmap());
m_currentState=m_state.begin();
m_currentPreview=m_oldPreviews.begin();
@ -416,14 +416,14 @@ void MainWidget::readOptions() {
{ //pgm format
antialiasGamma->setValue(((**m_currentState)["antialiasGamma"]).toFloat());
//Scale
if(((**m_currentState)["scale"]).find('x')==-1)
if(((**m_currentState)["scale"]).tqfind('x')==-1)
{ //only one value
scaleAll->setValue(((**m_currentState)["scale"]).toFloat());
scaleAllBTN->setChecked(true);
}
else
{
QString tmp=(**m_currentState)["scale"];
TQString tmp=(**m_currentState)["scale"];
scaleX->setValue((tmp.section('x',0,0)).toFloat());
scaleY->setValue((tmp.section('x',1,1)).toFloat());
scaleXYBTN->setChecked(true);
@ -431,9 +431,9 @@ void MainWidget::readOptions() {
}
//Color
foregroundBtn->setColor(QColor((**m_currentState)["foregroundBtn"]));
foregroundBtn->setColor(TQColor((**m_currentState)["foregroundBtn"]));
opaque->setChecked((**m_currentState)["opaque"]=="y");
backgroundBtn->setColor(QColor((**m_currentState)["backgroundBtn"]));
backgroundBtn->setColor(TQColor((**m_currentState)["backgroundBtn"]));
//Algorithm
policy->setCurrentItem(((**m_currentState)["policy"]).toInt());
@ -450,21 +450,21 @@ void MainWidget::readOptions() {
rotation->setValue(((**m_currentState)["rotation"]).toFloat());
//Resolution
if(((**m_currentState)["resolution"]).find('x')==-1)
if(((**m_currentState)["resolution"]).tqfind('x')==-1)
{ //only one value
resolutionAll->setValue(((**m_currentState)["resolution"]).toFloat());
resolutionAllBTN->setChecked(true);
}
else
{
QString tmp=(**m_currentState)["resolution"];
TQString tmp=(**m_currentState)["resolution"];
resolutionX->setValue((tmp.section('x',0,0)).toFloat());
resolutionY->setValue((tmp.section('x',1,1)).toFloat());
resolutionXYBTN->setChecked(true);
}
//Margins
QString tmp=(**m_currentState)["margins"];
TQString tmp=(**m_currentState)["margins"];
marginsL->setValue((tmp.section('x',0,0)).toFloat());
marginsR->setValue((tmp.section('x',1,1)).toFloat());
marginsT->setValue((tmp.section('x',2,2)).toFloat());
@ -484,7 +484,7 @@ void MainWidget::getOptions() {
void MainWidget::getPotraceOptions( ) {
//input-output
(*m_currentState)->setValue("blackLevel",QString::number(blackLevel->value()));
(*m_currentState)->setValue("blackLevel",TQString::number(blackLevel->value()));
if(invertInput->isChecked())
(*m_currentState)->setValue("invertInput","y");
else
@ -494,7 +494,7 @@ void MainWidget::getPotraceOptions( ) {
{ //ps options
(*m_currentState)->setValue("pageSize",pageSize->currentText());
(*m_currentState)->setValue("optimizedNumericalCode",(optimizedNumericalCode->isChecked())?"y":"n");
QButton *b=compressionLevel->selected();
TQButton *b=compressionLevel->selected();
if(b->text()=="None")
(*m_currentState)->setValue("compressionLevel","1");
else if(b->text()=="Level 2")
@ -514,44 +514,44 @@ void MainWidget::getPotraceOptions( ) {
}
else
{ //pgm options
(*m_currentState)->setValue("antialiasGamma",QString::number(antialiasGamma->value()));
(*m_currentState)->setValue("antialiasGamma",TQString::number(antialiasGamma->value()));
//Scale
if(scaleAll->isEnabled())
(*m_currentState)->setValue("scale",QString::number(scaleAll->value()));
(*m_currentState)->setValue("scale",TQString::number(scaleAll->value()));
else
(*m_currentState)->setValue("scale",QString::number(scaleX->value())+"x"+QString::number(scaleY->value()));
(*m_currentState)->setValue("scale",TQString::number(scaleX->value())+"x"+TQString::number(scaleY->value()));
}
//Color
QColor c=foregroundBtn->color();
TQColor c=foregroundBtn->color();
(*m_currentState)->setValue("foregroundBtn",c.name());
(*m_currentState)->setValue("opaque",(opaque->isChecked())?"y":"n");
c=backgroundBtn->color();
(*m_currentState)->setValue("backgroundBtn",c.name());
//Algorithm
(*m_currentState)->setValue("policy",QString::number(policy->currentItem()));
(*m_currentState)->setValue("despeckle",QString::number(despeckle->value()));
(*m_currentState)->setValue("cornerThreshold",QString::number(cornerThreshold->value()));
(*m_currentState)->setValue("optimizationTolerance",QString::number(optimizationTolerance->value()));
(*m_currentState)->setValue("outputQuantization",QString::number(outputQuantization->value()));
(*m_currentState)->setValue("policy",TQString::number(policy->currentItem()));
(*m_currentState)->setValue("despeckle",TQString::number(despeckle->value()));
(*m_currentState)->setValue("cornerThreshold",TQString::number(cornerThreshold->value()));
(*m_currentState)->setValue("optimizationTolerance",TQString::number(optimizationTolerance->value()));
(*m_currentState)->setValue("outputQuantization",TQString::number(outputQuantization->value()));
(*m_currentState)->setValue("curveOptimization",(curveOptimization->isChecked())?"y":"n");
//Transformation
(*m_currentState)->setValue("width",QString::number(width->value()));
(*m_currentState)->setValue("height",QString::number(height->value()));
(*m_currentState)->setValue("stretch",QString::number(stretch->value()));
(*m_currentState)->setValue("rotation",QString::number(rotation->value()));
(*m_currentState)->setValue("width",TQString::number(width->value()));
(*m_currentState)->setValue("height",TQString::number(height->value()));
(*m_currentState)->setValue("stretch",TQString::number(stretch->value()));
(*m_currentState)->setValue("rotation",TQString::number(rotation->value()));
//Resolution
if(resolutionAll->isEnabled())
(*m_currentState)->setValue("resolution",QString::number(resolutionAll->value()));
(*m_currentState)->setValue("resolution",TQString::number(resolutionAll->value()));
else
(*m_currentState)->setValue("resolution",QString::number(resolutionX->value())+"x"+QString::number(resolutionY->value()));
(*m_currentState)->setValue("resolution",TQString::number(resolutionX->value())+"x"+TQString::number(resolutionY->value()));
//Margins
(*m_currentState)->setValue("syncronizeMargins",checkBoxSyncronizeMargins->isChecked()?"y":"n");
(*m_currentState)->setValue("margins",QString::number(marginsL->value())+"x"+QString::number(marginsR->value())+"x"+QString::number(marginsT->value())+"x"+QString::number(marginsB->value()));
(*m_currentState)->setValue("margins",TQString::number(marginsL->value())+"x"+TQString::number(marginsR->value())+"x"+TQString::number(marginsT->value())+"x"+TQString::number(marginsB->value()));
}
void MainWidget::getAutotraceOptions( ) {
@ -560,35 +560,35 @@ void MainWidget::getAutotraceOptions( ) {
opt->clear();
//input output
QString tmp=autotraceOutputFormat->currentText();
tmp.truncate(tmp.find(" "));
TQString tmp=autotraceOutputFormat->currentText();
tmp.truncate(tmp.tqfind(" "));
opt->setValue("outputFormat",tmp);
if(autotraceDpiCheckbox->isChecked() && autotraceDpiInput->value()!=0)
opt->setValue("dpi",QString::number(autotraceDpiInput->value()));
opt->setValue("dpi",TQString::number(autotraceDpiInput->value()));
opt->setValue("reduceColorsEnabled",(autotraceCheckBoxReduceColors->isChecked())?"y":"n");
opt->setValue("colorCount",QString::number(autotraceColorCount->value()));
opt->setValue("colorCount",TQString::number(autotraceColorCount->value()));
if(autotraceUseBackground->isChecked())
opt->setValue("background",autotraceBackground->color().name().upper());
opt->setValue("background",TQString(autotraceBackground->color().name()).upper());
if(autotraceLog->isChecked())
opt->setValue("log","y");
//corners and curves
if(autotraceThreshold->value()!=100)
opt->setValue("threshold",QString::number(autotraceThreshold->value()));
opt->setValue("threshold",TQString::number(autotraceThreshold->value()));
if(autotraceAlwaysThreshold->value()!=60)
opt->setValue("alwaysThreshold",QString::number(autotraceAlwaysThreshold->value()));
opt->setValue("alwaysThreshold",TQString::number(autotraceAlwaysThreshold->value()));
if(autotraceSurround->value()!=4)
opt->setValue("surround",QString::number(autotraceSurround->value()));
opt->setValue("surround",TQString::number(autotraceSurround->value()));
if(autotraceAdjacentCorners->isChecked())
opt->setValue("removeAdjacentCorners","y");
if(autotraceErrorThreshold->value()!=2)
opt->setValue("errorThreshold",QString::number(autotraceErrorThreshold->value()));
opt->setValue("errorThreshold",TQString::number(autotraceErrorThreshold->value()));
if(autotraceLineThreshold->value()!=1)
opt->setValue("lineThreshold",QString::number(autotraceLineThreshold->value()));
opt->setValue("lineThreshold",TQString::number(autotraceLineThreshold->value()));
if(autotraceReversionThreshold->value()!=0.01)
opt->setValue("reversionThreshold",QString::number(autotraceReversionThreshold->value()));
opt->setValue("reversionThreshold",TQString::number(autotraceReversionThreshold->value()));
if(autotraceIterations->value()!=4)
opt->setValue("iterations",QString::number(autotraceIterations->value()));
opt->setValue("iterations",TQString::number(autotraceIterations->value()));
if(autotracePreserveWidth->isChecked())
opt->setValue("preserveWidth","y");
@ -596,23 +596,23 @@ void MainWidget::getAutotraceOptions( ) {
if(autotraceCenterline->isChecked())
opt->setValue("centerline","y");
if(autotraceTangentSurround->value()!=3)
opt->setValue("tangentSurround",QString::number(autotraceTangentSurround->value()));
opt->setValue("tangentSurround",TQString::number(autotraceTangentSurround->value()));
//despeckle
opt->setValue("doDespeckle",(autotraceDoDespeckle->isChecked()?"y":"n"));
opt->setValue("despeckleLevel",QString::number(autotraceDespeckleLevel->value()));
opt->setValue("despeckleTightness",QString::number(autotraceDespeckleTightness->value()));
opt->setValue("despeckleLevel",TQString::number(autotraceDespeckleLevel->value()));
opt->setValue("despeckleTightness",TQString::number(autotraceDespeckleTightness->value()));
}
QStringList MainWidget::createCommandLine() {
TQStringList MainWidget::createCommandLine() {
if(backendCombo->currentText()=="potrace")
return createPotraceCommandLine();
else
return createAutotraceCommandLine();
}
QStringList MainWidget::createPotraceCommandLine( ) {
QStringList toReturn;
TQStringList MainWidget::createPotraceCommandLine( ) {
TQStringList toReturn;
toReturn+="potrace";
//input
@ -750,11 +750,11 @@ QStringList MainWidget::createPotraceCommandLine( ) {
//Margins
if((**m_currentState)["margins"]!="0" && (**m_currentState)["margins"]!="0x0x0x0")
{
if((**m_currentState)["margins"].find('x')==-1)
if((**m_currentState)["margins"].tqfind('x')==-1)
toReturn+="-M"+(**m_currentState)["margins"]+"cm";
else
{
QString tmp=(**m_currentState)["margins"];
TQString tmp=(**m_currentState)["margins"];
toReturn+="-L"+tmp.section('x',0,0)+"cm";
toReturn+="-R"+tmp.section('x',1,1)+"cm";
toReturn+="-T"+tmp.section('x',2,2)+"cm";
@ -765,9 +765,9 @@ QStringList MainWidget::createPotraceCommandLine( ) {
return toReturn;
}
QStringList MainWidget::createAutotraceCommandLine( ) {
QStringList toReturn;
QString tmp;
TQStringList MainWidget::createAutotraceCommandLine( ) {
TQStringList toReturn;
TQString tmp;
toReturn+="autotrace";
//iput-output
@ -822,7 +822,7 @@ QStringList MainWidget::createAutotraceCommandLine( ) {
//input file
char inputFile[]="/tmp/potraceguiTmp-XXXXXX";
mkstemp(inputFile);
m_tmpInputFilename=QString(inputFile);
m_tmpInputFilename=TQString(inputFile);
originalLabel->pixmap()->save(m_tmpInputFilename,"PPM");
toReturn+="--input-format=PPM";
toReturn+=m_tmpInputFilename;
@ -848,7 +848,7 @@ void MainWidget::trace() {
aborted=false;
getOptions();
QStringList commandLine=createCommandLine();
TQStringList commandLine=createCommandLine();
tracer.clearArguments();
tracer.setArguments(commandLine);
@ -863,8 +863,8 @@ void MainWidget::trace() {
{
emit(signalChangeStatusbar(i18n("Tracing...")));
traceBtn->setText(i18n("Abort"));
QByteArray pixData;
QBuffer buf(pixData);
TQByteArray pixData;
TQBuffer buf(pixData);
buf.open(IO_WriteOnly);
originalLabel->pixmap()->save(&buf,"PPM");
tracer.writeToStdin(pixData);
@ -879,25 +879,25 @@ void MainWidget::tracerExited() {
setCursor(ArrowCursor);
return;
}
if(tracer.exitStatus()!=0)
if(tracer.exitqStatus()!=0)
{
emit(signalChangeStatusbar(i18n("Finished with errors")));
QString tmp(i18n("Error during the process:"));
TQString tmp(i18n("Error during the process:"));
tmp+=i18n("Standard output:\n");
QString t=tracer.readLineStdout();
while(t!=QString::null)
TQString t=tracer.readLineStdout();
while(t!=TQString())
{
tmp+= t+"\n";
t=tracer.readLineStdout();
}
tmp+=i18n("Standard error:\n");
t=tracer.readLineStderr();
while(t!=QString::null)
while(t!=TQString())
{
tmp+=t+"\n";
t=tracer.readLineStderr();
}
QStringList l=tracer.arguments();
TQStringList l=tracer.arguments();
tmp+=i18n("Executed:\n")+l.join(" ");
previewLabel->setText(tmp);
setCursor(ArrowCursor);
@ -908,8 +908,8 @@ void MainWidget::tracerExited() {
if(autoTraceCheck->isChecked())
{
emit(signalChangeStatusbar(i18n("Loading preview image...")));
QImage img(m_tmpFilename);
QPixmap pix;
TQImage img(m_tmpFilename);
TQPixmap pix;
if(pix.convertFromImage(img,0))
{
previewLabel->clear();
@ -930,7 +930,7 @@ void MainWidget::tracerExited() {
//delete autotrace tempfile
if(backendCombo->currentText()=="autotrace") {
QFile tmp(m_tmpInputFilename);
TQFile tmp(m_tmpInputFilename);
tmp.remove();
}
@ -947,7 +947,7 @@ bool MainWidget::createTmpFilename() {
char tmp[]="/tmp/potraceguiTmp-XXXXXX";
if (mkstemp(tmp)!=-1)
{
m_tmpFilename=QString(tmp);
m_tmpFilename=TQString(tmp);
return true;
}
else
@ -955,25 +955,25 @@ bool MainWidget::createTmpFilename() {
}
bool MainWidget::deleteTmpFilename() {
QFile tmp(m_tmpFilename);
TQFile tmp(m_tmpFilename);
bool toReturn=tmp.remove();
if(toReturn==true)
m_tmpFilename="";
return toReturn;
}
int MainWidget::notificationDialog(QString caption, QString text) {
int MainWidget::notificationDialog(TQString caption, TQString text) {
KDialogBase w(this, "potracegui", true, caption, KDialogBase::Ok|KDialogBase::Cancel,KDialogBase::Ok,true);
w.setMainWidget(new QLabel(text,&w));
w.setMainWidget(new TQLabel(text,&w));
w.exec();
return w.result();
}
void MainWidget::dragEnterEvent(QDragEnterEvent* event) {
void MainWidget::dragEnterEvent(TQDragEnterEvent* event) {
event->accept(KURLDrag::canDecode(event));
}
void MainWidget::dropEvent(QDropEvent* event) {
void MainWidget::dropEvent(TQDropEvent* event) {
KURL::List urls;
if (KURLDrag::decode(event,urls))
{
@ -990,7 +990,7 @@ void MainWidget::defaultOptions() {
m_state.clear();
m_oldPreviews.clear();
m_state.push_back(o);
m_oldPreviews.push_back(QPixmap());
m_oldPreviews.push_back(TQPixmap());
m_currentState=m_state.begin();
m_currentPreview=m_oldPreviews.begin();
@ -1023,7 +1023,7 @@ void MainWidget::defaultOptions() {
optionsStack->raiseWidget(psPage);
}
void MainWidget::showOptions(const QString &selection) {
void MainWidget::showOptions(const TQString &selection) {
if(selection==i18n("SVG"))
optionsStack->raiseWidget(svgPage);
else if(selection==i18n("pgm"))
@ -1034,7 +1034,7 @@ void MainWidget::showOptions(const QString &selection) {
optionsStack->raiseWidget(undefinedPage);
}
void MainWidget::backendChoosen( const QString & back ) {
void MainWidget::backendChoosen( const TQString & back ) {
if(back=="potrace")
backendStack->raiseWidget(potracePage);
else

@ -23,13 +23,13 @@
#include "MainWidgetBase.h"
#include <qstring.h>
#include <qprocess.h>
#include <qstringlist.h>
#include <qpixmap.h>
#include <qclipboard.h>
#include <qevent.h>
#include <qlabel.h>
#include <tqstring.h>
#include <tqprocess.h>
#include <tqstringlist.h>
#include <tqpixmap.h>
#include <tqclipboard.h>
#include <tqevent.h>
#include <tqlabel.h>
#include <kurl.h>
@ -48,25 +48,26 @@ class Options;
class MainWidget : public MainWidgetBase
{
Q_OBJECT
TQ_OBJECT
//! For simplicity
friend class potracegui;
public:
//! Default constructor (all parameters are simply passed to MainWidgetBase)
MainWidget(QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
MainWidget(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 );
//! Default destructor
~MainWidget();
private:
//! Contains the temporary file name used while tracing
QString m_tmpFilename;
TQString m_tmpFilename;
//! Contains the input file name for autotrace
QString m_tmpInputFilename;
TQString m_tmpInputFilename;
//! Contains the real file name where to save the traced image
QString m_outputFilename;
TQString m_outputFilename;
//! The process of potrace (used to abort it and to control its exit status)
QProcess tracer;
TQProcess tracer;
//! To know if the tracing has exited normally, or it has been interrupted
bool aborted;
//! To know if the current document is different from the saved one
@ -74,15 +75,15 @@ private:
//! The history of the options (not used yet, it will permit undo/redo in the future)
vector<Options *> m_state;
//! The history of the previews (not used yet, it will permit undo/redo in the future)
vector<QPixmap> m_oldPreviews;
vector<TQPixmap> m_oldPreviews;
//! The current options
vector<Options *>::iterator m_currentState;
//! The current preview image
vector<QPixmap>::iterator m_currentPreview;
vector<TQPixmap>::iterator m_currentPreview;
//! Label to display the original image
QLabel *originalLabel;
TQLabel *originalLabel;
//! Label to display the traced image
QLabel *previewLabel;
TQLabel *previewLabel;
//! Retrives an image from an URL
/*!
@ -115,21 +116,21 @@ private:
//! Creates the command line for tracing
/*!
* It reads m_currentState and creates from all the options a commandline to be executed
* \returns A QStringList that can be used as a commandline to a QProcess
* \returns A TQStringList that can be used as a commandline to a TQProcess
*/
QStringList createCommandLine();
TQStringList createCommandLine();
//! Creates the command line for tracing with potrace
/*!
* It reads m_currentState and creates from all the options a commandline to be executed
* \returns A QStringList that can be used as a commandline to a QProcess
* \returns A TQStringList that can be used as a commandline to a TQProcess
*/
QStringList createPotraceCommandLine();
TQStringList createPotraceCommandLine();
//! Creates the command line for tracing with autotrace
/*!
* It reads m_currentState and creates from all the options a commandline to be executed
* \returns A QStringList that can be used as a commandline to a QProcess
* \returns A TQStringList that can be used as a commandline to a TQProcess
*/
QStringList createAutotraceCommandLine();
TQStringList createAutotraceCommandLine();
//! Sets m_tmpFilename to a new temporary filename (generated through mkstemp())
bool createTmpFilename();
//! Deletes the file pointed by m_tmpFilename
@ -140,14 +141,14 @@ private:
* \param text The text to display into the dialog
* \returns The code of the dialog button pressed.
*/
int notificationDialog(QString caption, QString text);
int notificationDialog(TQString caption, TQString text);
//! Accepts only a KURL
void dragEnterEvent(QDragEnterEvent* event);
void dragEnterEvent(TQDragEnterEvent* event);
//! Receives a KURL and loads it.
/*!
* \sa getImageFromURL()
*/
void dropEvent(QDropEvent* event);
void dropEvent(TQDropEvent* event);
private slots:
//! Opens a file (whith a KFileDialog)
@ -179,9 +180,9 @@ private slots:
//! Reverts to the default options
void defaultOptions();
//! When an output format for potrace has been selected, it shows the relevant options
void showOptions(const QString &selection);
void showOptions(const TQString &selection);
//! When a backend has been selected, it shows the relevant options
void backendChoosen(const QString &back);
void backendChoosen(const TQString &back);
//! Syncronize margins if corresponding checkbox is checked
void marginValueChanged( double newValue);
@ -191,7 +192,7 @@ signals:
/*!
* \param message The message to display into the statusbar
*/
void signalChangeStatusbar(QString message);
void signalChangeStatusbar(TQString message);
protected:
bool marginValueSynconizingNecessary;
};

@ -13,16 +13,16 @@
#include <map>
using namespace std;
#include <qstring.h>
#include <tqstring.h>
Options::Options(): options()
{
}
void Options::setValue(QString key, QString value) {
void Options::setValue(TQString key, TQString value) {
if(options.find(key)!=options.end())
options.erase(options.find(key));
map<QString,QString>::value_type v(key,value);
map<TQString,TQString>::value_type v(key,value);
options.insert(v);
}
@ -34,7 +34,7 @@ void Options::clear() {
options.clear();
}
QString Options::operator[](QString key) {
TQString Options::operator[](TQString key) {
if(options.find(key)!=options.end())
return options[key];
else
@ -80,7 +80,7 @@ void Options::defaultOptions(){
}
void Options::debug() {
for(map<QString,QString>::iterator i=options.begin(); i!=options.end(); i++)
for(map<TQString,TQString>::iterator i=options.begin(); i!=options.end(); i++)
cout << (*i).first << "=" << (*i).second << endl;
}

@ -13,7 +13,7 @@
#include <map>
using namespace std;
#include <qstring.h>
#include <tqstring.h>
//! Class that contains all the options for a document.
@ -38,7 +38,7 @@ public:
*
* \sa operator[]()
*/
void setValue(QString key, QString value);
void setValue(TQString key, TQString value);
//! Checks if the object contains no keys
/*!
* \returns \b true if the object is empty, \b false otherwise
@ -53,14 +53,14 @@ public:
* \returns The value associated with the key
* \sa setValue()
*/
QString operator[](QString key);
TQString operator[](TQString key);
//! Sets all the options to their default value.
void defaultOptions();
//! Prints the list of options
void debug();
private:
map<QString,QString> options; /*!< The map containing the options */
map<TQString,TQString> options; /*!< The map containing the options */
};
#endif

@ -21,8 +21,8 @@
#include "potracegui.h"
#include "mainwidget.h"
#include <qlabel.h>
#include <qclipboard.h>
#include <tqlabel.h>
#include <tqclipboard.h>
#include <kmainwindow.h>
#include <klocale.h>
@ -55,7 +55,7 @@ potracegui::potracegui()
setAutoSaveSettings();
setAcceptDrops(true);
connect(m_centralWidget,SIGNAL(signalChangeStatusbar(QString)),this,SLOT(changeStatusbar(QString)));
connect(m_centralWidget,TQT_SIGNAL(signalChangeStatusbar(TQString)),this,TQT_SLOT(changeStatusbar(TQString)));
createInterface();
}
@ -67,21 +67,21 @@ potracegui::~potracegui()
void potracegui::createInterface()
{
/*handled by potracegui*/
KStdAction::openNew(this, SLOT(fileNew()),actionCollection());
KStdAction::quit(this, SLOT(quit()),actionCollection());
m_toolbarAction=KStdAction::showToolbar(this, SLOT(showToolbar()),actionCollection());
m_statusbarAction=KStdAction::showStatusbar(this, SLOT(showStatusbar()),actionCollection());
KStdAction::keyBindings(this, SLOT(configureKeys()),actionCollection());
KStdAction::configureToolbars(this, SLOT(configureTB()),actionCollection());
KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(fileNew()),actionCollection());
KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quit()),actionCollection());
m_toolbarAction=KStdAction::showToolbar(TQT_TQOBJECT(this), TQT_SLOT(showToolbar()),actionCollection());
m_statusbarAction=KStdAction::showStatusbar(TQT_TQOBJECT(this), TQT_SLOT(showStatusbar()),actionCollection());
KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configureKeys()),actionCollection());
KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configureTB()),actionCollection());
/*handled by MainWidget*/
KStdAction::open(m_centralWidget, SLOT(fileOpen()),actionCollection());
KStdAction::save(m_centralWidget, SLOT(fileSave()),actionCollection());
KStdAction::saveAs(m_centralWidget, SLOT(fileSaveAs()),actionCollection());
KStdAction::close(m_centralWidget, SLOT(fileClose()),actionCollection());
KStdAction::cut(m_centralWidget, SLOT(cut()),actionCollection());
KStdAction::copy(m_centralWidget, SLOT(copy()),actionCollection());
KStdAction::paste(m_centralWidget, SLOT(paste()),actionCollection());
KStdAction::open(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileOpen()),actionCollection());
KStdAction::save(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileSave()),actionCollection());
KStdAction::saveAs(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileSaveAs()),actionCollection());
KStdAction::close(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(fileClose()),actionCollection());
KStdAction::cut(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(cut()),actionCollection());
KStdAction::copy(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(copy()),actionCollection());
KStdAction::paste(TQT_TQOBJECT(m_centralWidget), TQT_SLOT(paste()),actionCollection());
/*Create menu and toolbar*/
createGUI();
@ -123,7 +123,7 @@ void potracegui::configureKeys()
void potracegui::configureTB()
{
KEditToolbar dlg(actionCollection());
connect(&dlg,SIGNAL(newToolbarConfig()),this,SLOT(NewTBConfig()));
connect(&dlg,TQT_SIGNAL(newToolbarConfig()),this,TQT_SLOT(NewTBConfig()));
dlg.exec();
}
@ -133,7 +133,7 @@ void potracegui::NewTBConfig()
saveMainWindowSettings(KGlobal::config());
}
void potracegui::changeStatusbar(QString message)
void potracegui::changeStatusbar(TQString message)
{
statusBar()->message(message);
}

@ -28,7 +28,7 @@
#include <kmainwindow.h>
#include <kapplication.h>
#include <qlabel.h>
#include <tqlabel.h>
class KToggleAction;
class MainWidget;
@ -43,6 +43,7 @@ class MainWidget;
class potracegui : public KMainWindow
{
Q_OBJECT
TQ_OBJECT
public:
/**
* @short Default Constructor
@ -92,7 +93,7 @@ private slots:
/*!
* \param message The message to show
*/
void changeStatusbar(QString message);
void changeStatusbar(TQString message);
};
#endif // _POTRACEGUI_H_

Loading…
Cancel
Save