* runner.cpp,
* graphicsview.cpp,
* main.cpp,
* mainwindow.cpp,
* mainwindow.h,
* xml.cpp: Save the xml path when it is loaded.
---
GScribo/GScribo.pro | 3 +-
GScribo/GScribo.pro.user | 154 ++++++++++++++++++++++++++++++++----
GScribo/Processing/runner.cpp | 2 +-
GScribo/Rendering/graphicsview.cpp | 1 -
GScribo/main.cpp | 2 +-
GScribo/mainwindow.cpp | 27 ++++---
GScribo/mainwindow.h | 4 +-
7 files changed, 160 insertions(+), 33 deletions(-)
diff --git a/GScribo/GScribo.pro b/GScribo/GScribo.pro
index 09e2034..1495495 100644
--- a/GScribo/GScribo.pro
+++ b/GScribo/GScribo.pro
@@ -9,7 +9,8 @@ QMAKE_CXXFLAGS += -DNDEBUG \
-DMLN_WO_GLOBAL_VARS
LIBS += -I/usr/include/graphicsImage \
-lGraphicsMagick++ \
- -ltesseract_full
+ -ltesseract_full \
+ -ltiff
TARGET = GScribo
TEMPLATE = app
SOURCES += regionwidget.cpp \
diff --git a/GScribo/GScribo.pro.user b/GScribo/GScribo.pro.user
index c8d3403..27b49eb 100644
--- a/GScribo/GScribo.pro.user
+++ b/GScribo/GScribo.pro.user
@@ -50,7 +50,7 @@
</data>
<data>
<variable>activebuildconfiguration</variable>
- <value type="QString">Debug</value>
+ <value type="QString">Release</value>
</data>
<data>
<variable>buildConfiguration-Debug</variable>
@@ -67,6 +67,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
<value key="QtVersionId" type="int">0</value>
+ <value key="ToolChain" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">0</value>
</valuemap>
@@ -76,7 +77,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
<valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-AApY2C9ax7,guid=67203c296298a08d55b5e06d00024298</value>
+ <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CpLYiAxYxd,guid=7696c32902b91e2834ddfd270002800f</value>
<value type="QString">DESKTOP_SESSION=fluxbox</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=fluxbox</value>
@@ -92,16 +93,16 @@
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=14368</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-klKXX14308/agent.14308</value>
+ <value type="QString">SSH_AGENT_PID=15822</value>
+ <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-OPYeW15762/agent.15762</value>
<value type="QString">TERM=xterm</value>
<value type="QString">USER=froger_a</value>
<value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmVOT6RW</value>
+ <value type="QString">WINDOWID=18874392</value>
+ <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8</value>
+ <value type="QString">XAUTHORITY=/tmp/.gdmWKEBSW</value>
<value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360922534.723042-2005793738</value>
+ <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360938269.426603-816256819</value>
<value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
<value type="QString">XTERM_SHELL=/bin/bash</value>
<value type="QString">XTERM_VERSION=XTerm(261)</value>
@@ -114,7 +115,7 @@
<value type="QString">CONFIG+=debug</value>
</valuelist>
<value key="abstractProcess.command"
type="QString">/usr/bin/qmake-qt4</value>
- <value key="abstractProcess.enabled"
type="bool">true</value>
+ <value key="abstractProcess.enabled"
type="bool">false</value>
<value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
</valuemap>
</data>
@@ -123,7 +124,7 @@
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Debug</value>
<valuelist key="abstractProcess.Environment"
type="QVariantList">
- <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-AApY2C9ax7,guid=67203c296298a08d55b5e06d00024298</value>
+ <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CpLYiAxYxd,guid=7696c32902b91e2834ddfd270002800f</value>
<value type="QString">DESKTOP_SESSION=fluxbox</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=fluxbox</value>
@@ -139,16 +140,16 @@
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=2</value>
- <value type="QString">SSH_AGENT_PID=14368</value>
- <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-klKXX14308/agent.14308</value>
+ <value type="QString">SSH_AGENT_PID=15822</value>
+ <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-OPYeW15762/agent.15762</value>
<value type="QString">TERM=xterm</value>
<value type="QString">USER=froger_a</value>
<value type="QString">USERNAME=froger_a</value>
- <value type="QString">WINDOWID=10485784</value>
- <value type="QString">WINDOWPATH=7:8:8:8:8:8</value>
- <value type="QString">XAUTHORITY=/tmp/.gdmVOT6RW</value>
+ <value type="QString">WINDOWID=18874392</value>
+ <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8</value>
+ <value type="QString">XAUTHORITY=/tmp/.gdmWKEBSW</value>
<value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
- <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360922534.723042-2005793738</value>
+ <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360938269.426603-816256819</value>
<value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
<value type="QString">XTERM_SHELL=/bin/bash</value>
<value type="QString">XTERM_VERSION=XTerm(261)</value>
@@ -176,18 +177,139 @@
<variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment"
type="QVariantList">
+ <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CpLYiAxYxd,guid=7696c32902b91e2834ddfd270002800f</value>
+ <value type="QString">DESKTOP_SESSION=fluxbox</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">GDMSESSION=fluxbox</value>
+ <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
+ <value type="QString">GDM_XSERVER_LOCATION=local</value>
+ <value type="QString">GTK_MODULES=canberra-gtk-module</value>
+ <value type="QString">HOME=/lrde/home/stage/froger_a</value>
+ <value type="QString">LANG=fr_FR.UTF-8</value>
+ <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
+ <value type="QString">LOGNAME=froger_a</value>
+ <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
+ <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
+ <value type="QString">QTDIR=/usr/share/qt4</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=2</value>
+ <value type="QString">SSH_AGENT_PID=15822</value>
+ <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-OPYeW15762/agent.15762</value>
+ <value type="QString">TERM=xterm</value>
+ <value type="QString">USER=froger_a</value>
+ <value type="QString">USERNAME=froger_a</value>
+ <value type="QString">WINDOWID=18874392</value>
+ <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8</value>
+ <value type="QString">XAUTHORITY=/tmp/.gdmWKEBSW</value>
+ <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
+ <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360938269.426603-816256819</value>
+ <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
+ <value type="QString">XTERM_SHELL=/bin/bash</value>
+ <value type="QString">XTERM_VERSION=XTerm(261)</value>
+ </valuelist>
+ <valuelist key="abstractProcess.arguments"
type="QVariantList">
+ <value
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo/GScribo.pro</value>
+ <value type="QString">-spec</value>
+ <value type="QString">linux-g++</value>
+ <value type="QString">-r</value>
+ </valuelist>
+ <value key="abstractProcess.command"
type="QString">/usr/bin/qmake-qt4</value>
+ <value key="abstractProcess.enabled"
type="bool">false</value>
+ <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment"
type="QVariantList">
+ <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CpLYiAxYxd,guid=7696c32902b91e2834ddfd270002800f</value>
+ <value type="QString">DESKTOP_SESSION=fluxbox</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">GDMSESSION=fluxbox</value>
+ <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
+ <value type="QString">GDM_XSERVER_LOCATION=local</value>
+ <value type="QString">GTK_MODULES=canberra-gtk-module</value>
+ <value type="QString">HOME=/lrde/home/stage/froger_a</value>
+ <value type="QString">LANG=fr_FR.UTF-8</value>
+ <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
+ <value type="QString">LOGNAME=froger_a</value>
+ <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
+ <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
+ <value type="QString">QTDIR=/usr/share/qt4</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=2</value>
+ <value type="QString">SSH_AGENT_PID=15822</value>
+ <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-OPYeW15762/agent.15762</value>
+ <value type="QString">TERM=xterm</value>
+ <value type="QString">USER=froger_a</value>
+ <value type="QString">USERNAME=froger_a</value>
+ <value type="QString">WINDOWID=18874392</value>
+ <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8</value>
+ <value type="QString">XAUTHORITY=/tmp/.gdmWKEBSW</value>
+ <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
+ <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360938269.426603-816256819</value>
+ <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
+ <value type="QString">XTERM_SHELL=/bin/bash</value>
+ <value type="QString">XTERM_VERSION=XTerm(261)</value>
+ </valuelist>
+ <value key="abstractProcess.IgnoreReturnValue"
type="bool">false</value>
+ <valuelist key="abstractProcess.arguments"
type="QVariantList">
+ <value type="QString">-w</value>
+ </valuelist>
+ <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
+ <value key="abstractProcess.enabled"
type="bool">true</value>
+ <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName"
type="QString">Release</value>
+ <valuelist key="abstractProcess.Environment"
type="QVariantList">
+ <value
type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-CpLYiAxYxd,guid=7696c32902b91e2834ddfd270002800f</value>
+ <value type="QString">DESKTOP_SESSION=fluxbox</value>
+ <value type="QString">DISPLAY=:0.0</value>
+ <value type="QString">GDMSESSION=fluxbox</value>
+ <value type="QString">GDM_LANG=fr_FR.UTF-8</value>
+ <value type="QString">GDM_XSERVER_LOCATION=local</value>
+ <value type="QString">GTK_MODULES=canberra-gtk-module</value>
+ <value type="QString">HOME=/lrde/home/stage/froger_a</value>
+ <value type="QString">LANG=fr_FR.UTF-8</value>
+ <value
type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
+ <value type="QString">LOGNAME=froger_a</value>
+ <value
type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
+ <value
type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
+ <value type="QString">QTDIR=/usr/share/qt4</value>
+ <value type="QString">SHELL=/bin/bash</value>
+ <value type="QString">SHLVL=2</value>
+ <value type="QString">SSH_AGENT_PID=15822</value>
+ <value
type="QString">SSH_AUTH_SOCK=/tmp/ssh-OPYeW15762/agent.15762</value>
+ <value type="QString">TERM=xterm</value>
+ <value type="QString">USER=froger_a</value>
+ <value type="QString">USERNAME=froger_a</value>
+ <value type="QString">WINDOWID=18874392</value>
+ <value type="QString">WINDOWPATH=7:8:8:8:8:8:8:8</value>
+ <value type="QString">XAUTHORITY=/tmp/.gdmWKEBSW</value>
+ <value
type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
+ <value
type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360938269.426603-816256819</value>
+ <value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
+ <value type="QString">XTERM_SHELL=/bin/bash</value>
+ <value type="QString">XTERM_VERSION=XTerm(261)</value>
+ </valuelist>
+ <value key="abstractProcess.IgnoreReturnValue"
type="bool">true</value>
+ <valuelist key="abstractProcess.arguments"
type="QVariantList">
+ <value type="QString">clean</value>
+ <value type="QString">-w</value>
+ </valuelist>
+ <value key="abstractProcess.command"
type="QString">/usr/bin/make</value>
+ <value key="abstractProcess.enabled"
type="bool">true</value>
+ <value key="abstractProcess.workingDirectory"
type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
+ <value key="cleanConfig" type="bool">true</value>
+ <valuelist key="makeargs" type="QVariantList">
+ <value type="QString">clean</value>
+ </valuelist>
</valuemap>
</data>
<data>
diff --git a/GScribo/Processing/runner.cpp b/GScribo/Processing/runner.cpp
index 34145ee..00348a5 100644
--- a/GScribo/Processing/runner.cpp
+++ b/GScribo/Processing/runner.cpp
@@ -102,7 +102,7 @@ void Runner::process(const image2d<value::rgb8>&
original_ima,
this, SIGNAL(xml_saved(const QString&)));
// Load config.
- Configs * const conf = Configs::getInstance();
+ Configs *const conf = Configs::getInstance();
Separator::FindSeparator find_seps =
static_cast<Separator::FindSeparator>(conf->segmentationFindSeps());
f.enable_line_seps = (find_seps == Separator::Lines
diff --git a/GScribo/Rendering/graphicsview.cpp b/GScribo/Rendering/graphicsview.cpp
index 7a05cd5..ea846e9 100644
--- a/GScribo/Rendering/graphicsview.cpp
+++ b/GScribo/Rendering/graphicsview.cpp
@@ -35,7 +35,6 @@ void GraphicsView::mousePressEvent(QMouseEvent *event)
QMouseEvent *mouseEvent = new QMouseEvent(QEvent::MouseButtonPress, event->pos(),
Qt::LeftButton,
Qt::LeftButton, Qt::MetaModifier);
-
event->ignore();
QGraphicsView::mousePressEvent(mouseEvent);
}
diff --git a/GScribo/main.cpp b/GScribo/main.cpp
index 9b2669e..d47ec16 100644
--- a/GScribo/main.cpp
+++ b/GScribo/main.cpp
@@ -12,7 +12,7 @@
int main(int argc, char *argv[])
{
- //Magick::InitializeMagick(*argv);
+ Magick::InitializeMagick(*argv);
// On Linux, we NEED to use the raster graphics system.
// Linux don't really support openGL graphics system (the default one on Linux).
QApplication::setGraphicsSystem("raster");
diff --git a/GScribo/mainwindow.cpp b/GScribo/mainwindow.cpp
index 4586fbb..8682bec 100644
--- a/GScribo/mainwindow.cpp
+++ b/GScribo/mainwindow.cpp
@@ -286,6 +286,21 @@ void MainWindow::printScene(QPrinter *printer)
scene_.clearSelection();
}
+void MainWindow::printItems(QPainter *painter, const QList<QGraphicsItem *>&
items, QStyleOptionGraphicsItem *options)
+{
+ foreach(QGraphicsItem *child, items)
+ {
+ if(child->isVisible())
+ {
+ QRect viewport = scene_.backgroundPixmap()->mapRectFromItem(child,
child->boundingRect()).toRect();
+ painter->translate(abs(child->boundingRect().x() - viewport.x()),
+ abs(child->boundingRect().y() - viewport.y()));
+ child->paint(painter, options);
+ painter->resetTransform();
+ }
+ }
+}
+
void MainWindow::onExportation()
{
QFileInfo fileInfo(scene_.backgroundPath());
@@ -300,18 +315,6 @@ void MainWindow::onExportation()
}
}
-void MainWindow::printItems(QPainter *painter, const QList<QGraphicsItem *>&
items, QStyleOptionGraphicsItem *options)
-{
- foreach(QGraphicsItem *child, items)
- {
- QRect viewport = scene_.backgroundPixmap()->mapRectFromItem(child,
child->boundingRect()).toRect();
- painter->translate(abs(child->boundingRect().x() - viewport.x()),
- abs(child->boundingRect().y() - viewport.y()));
- child->paint(painter, options);
- painter->resetTransform();
- }
-}
-
void MainWindow::onPreferences()
{
PreferencesDialog *preferenceDialog = new PreferencesDialog(this);
diff --git a/GScribo/mainwindow.h b/GScribo/mainwindow.h
index 1b4d31f..919314f 100644
--- a/GScribo/mainwindow.h
+++ b/GScribo/mainwindow.h
@@ -51,7 +51,6 @@ class MainWindow:
void setActionsEnabled(bool isSegmented);
void disableActions();
- void printScene(QPrinter *printer);
void printItems(QPainter *painter, const QList<QGraphicsItem *>& items,
QStyleOptionGraphicsItem *options);
Xml processTmpXml(const QString& filename) const;
@@ -81,6 +80,9 @@ class MainWindow:
QAction *print_;
QAction *export_;
+ public slots:
+ void printScene(QPrinter *printer);
+
private slots:
void onOpen();
void onSegment();
--
1.7.2.5