Rename sources and put them to src dir
This commit is contained in:
parent
12cb3bf4ab
commit
d198c88625
@ -26,49 +26,52 @@ LIBS += -ltesseract -llept
|
|||||||
|
|
||||||
include(3rd-party/qtsingleapplication/qtsingleapplication.pri)
|
include(3rd-party/qtsingleapplication/qtsingleapplication.pri)
|
||||||
|
|
||||||
SOURCES += main.cpp\
|
INCLUDEPATH += src
|
||||||
Manager.cpp \
|
|
||||||
SettingsEditor.cpp \
|
|
||||||
SelectionDialog.cpp \
|
|
||||||
GlobalActionHelper.cpp \
|
|
||||||
Recognizer.cpp \
|
|
||||||
ResultDialog.cpp \
|
|
||||||
ProcessingItem.cpp \
|
|
||||||
ImageProcessing.cpp \
|
|
||||||
LanguageHelper.cpp \
|
|
||||||
WebTranslator.cpp \
|
|
||||||
WebTranslatorProxy.cpp \
|
|
||||||
TranslatorHelper.cpp \
|
|
||||||
RecognizerHelper.cpp \
|
|
||||||
Utils.cpp \
|
|
||||||
Updater.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
SOURCES += \
|
||||||
Manager.h \
|
src/main.cpp \
|
||||||
SettingsEditor.h \
|
src/manager.cpp \
|
||||||
SelectionDialog.h \
|
src/settingseditor.cpp \
|
||||||
GlobalActionHelper.h \
|
src/selectiondialog.cpp \
|
||||||
Recognizer.h \
|
src/globalactionhelper.cpp \
|
||||||
Settings.h \
|
src/recognizer.cpp \
|
||||||
ProcessingItem.h \
|
src/resultdialog.cpp \
|
||||||
ResultDialog.h \
|
src/processingitem.cpp \
|
||||||
ImageProcessing.h \
|
src/imageprocessing.cpp \
|
||||||
LanguageHelper.h \
|
src/languagehelper.cpp \
|
||||||
WebTranslator.h \
|
src/webtranslator.cpp \
|
||||||
WebTranslatorProxy.h \
|
src/webtranslatorproxy.cpp \
|
||||||
StAssert.h \
|
src/translatorhelper.cpp \
|
||||||
TranslatorHelper.h \
|
src/recognizerhelper.cpp \
|
||||||
RecognizerHelper.h \
|
src/utils.cpp \
|
||||||
Utils.h \
|
src/updater.cpp
|
||||||
Updater.h
|
|
||||||
|
|
||||||
FORMS += \
|
HEADERS += \
|
||||||
SettingsEditor.ui \
|
src/manager.h \
|
||||||
SelectionDialog.ui \
|
src/settingseditor.h \
|
||||||
ResultDialog.ui
|
src/selectiondialog.h \
|
||||||
|
src/globalactionhelper.h \
|
||||||
|
src/recognizer.h \
|
||||||
|
src/settings.h \
|
||||||
|
src/processingitem.h \
|
||||||
|
src/resultdialog.h \
|
||||||
|
src/imageprocessing.h \
|
||||||
|
src/languagehelper.h \
|
||||||
|
src/webtranslator.h \
|
||||||
|
src/webtranslatorproxy.h \
|
||||||
|
src/stassert.h \
|
||||||
|
src/translatorhelper.h \
|
||||||
|
src/recognizerhelper.h \
|
||||||
|
src/utils.h \
|
||||||
|
src/updater.h
|
||||||
|
|
||||||
|
FORMS += \
|
||||||
|
src/settingseditor.ui \
|
||||||
|
src/selectiondialog.ui \
|
||||||
|
src/resultdialog.ui
|
||||||
|
|
||||||
RESOURCES += \
|
RESOURCES += \
|
||||||
Recources.qrc
|
recources.qrc
|
||||||
|
|
||||||
TRANSLATIONS += \
|
TRANSLATIONS += \
|
||||||
translations/translation_en.ts \
|
translations/translation_en.ts \
|
||||||
@ -81,7 +84,7 @@ OTHER_FILES += \
|
|||||||
distr/* \
|
distr/* \
|
||||||
version.json \
|
version.json \
|
||||||
README.md \
|
README.md \
|
||||||
uncrustify.cfg\
|
uncrustify.cfg \
|
||||||
.travis.yml \
|
.travis.yml \
|
||||||
TODO.md
|
TODO.md
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
#include "GlobalActionHelper.h"
|
#include "globalactionhelper.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
#include <leptonica/allheaders.h>
|
#include <leptonica/allheaders.h>
|
||||||
|
|
||||||
#include "ImageProcessing.h"
|
#include "imageprocessing.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
# include <fstream>
|
# include <fstream>
|
@ -1,9 +1,9 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
#include "LanguageHelper.h"
|
#include "languagehelper.h"
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
|
|
||||||
LanguageHelper::LanguageHelper () {
|
LanguageHelper::LanguageHelper () {
|
||||||
init ();
|
init ();
|
@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
#include <qtsingleapplication.h>
|
#include <qtsingleapplication.h>
|
||||||
|
|
||||||
#include <Manager.h>
|
#include <manager.h>
|
||||||
#include <Settings.h>
|
#include <settings.h>
|
||||||
|
|
||||||
int main (int argc, char *argv[]) {
|
int main (int argc, char *argv[]) {
|
||||||
QtSingleApplication a (argc, argv);
|
QtSingleApplication a (argc, argv);
|
@ -1,4 +1,4 @@
|
|||||||
#include "Manager.h"
|
#include "manager.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -13,17 +13,17 @@
|
|||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
#include "SettingsEditor.h"
|
#include "settingseditor.h"
|
||||||
#include "SelectionDialog.h"
|
#include "selectiondialog.h"
|
||||||
#include "GlobalActionHelper.h"
|
#include "globalactionhelper.h"
|
||||||
#include "Recognizer.h"
|
#include "recognizer.h"
|
||||||
#include "WebTranslator.h"
|
#include "webtranslator.h"
|
||||||
#include "ResultDialog.h"
|
#include "resultdialog.h"
|
||||||
#include "LanguageHelper.h"
|
#include "languagehelper.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
#include "Utils.h"
|
#include "utils.h"
|
||||||
#include "Updater.h"
|
#include "updater.h"
|
||||||
|
|
||||||
Manager::Manager (QObject *parent) :
|
Manager::Manager (QObject *parent) :
|
||||||
QObject (parent),
|
QObject (parent),
|
||||||
@ -246,13 +246,13 @@ void Manager::capture () {
|
|||||||
QList<QScreen *> screens = QApplication::screens ();
|
QList<QScreen *> screens = QApplication::screens ();
|
||||||
foreach (QScreen * screen, screens) {
|
foreach (QScreen * screen, screens) {
|
||||||
QRect geometry = screen->availableGeometry ();
|
QRect geometry = screen->availableGeometry ();
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5,10,0)
|
#if QT_VERSION >= QT_VERSION_CHECK (5,10,0)
|
||||||
QPixmap pixmap = screen->grabWindow (0, 0, 0,
|
QPixmap pixmap = screen->grabWindow (0, 0, 0,
|
||||||
geometry.width (), geometry.height ());
|
geometry.width (), geometry.height ());
|
||||||
#else
|
#else
|
||||||
QPixmap pixmap = screen->grabWindow (0, geometry.x (), geometry.y (),
|
QPixmap pixmap = screen->grabWindow (0, geometry.x (), geometry.y (),
|
||||||
geometry.width (), geometry.height ());
|
geometry.width (), geometry.height ());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QString name = screen->name ();
|
QString name = screen->name ();
|
||||||
if (!selections_.contains (name)) {
|
if (!selections_.contains (name)) {
|
@ -5,7 +5,7 @@
|
|||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
class QAction;
|
class QAction;
|
||||||
class QMenu;
|
class QMenu;
|
@ -1,4 +1,4 @@
|
|||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
ProcessingItem::ProcessingItem ()
|
ProcessingItem::ProcessingItem ()
|
||||||
: swapLanguages_ (false) {
|
: swapLanguages_ (false) {
|
@ -1,14 +1,14 @@
|
|||||||
#include "Recognizer.h"
|
#include "recognizer.h"
|
||||||
|
|
||||||
#include <tesseract/baseapi.h>
|
#include <tesseract/baseapi.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
#include "ImageProcessing.h"
|
#include "imageprocessing.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
#include "RecognizerHelper.h"
|
#include "recognizerhelper.h"
|
||||||
|
|
||||||
Recognizer::Recognizer (QObject *parent) :
|
Recognizer::Recognizer (QObject *parent) :
|
||||||
QObject (parent),
|
QObject (parent),
|
@ -4,7 +4,7 @@
|
|||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include "QPixmap"
|
#include "QPixmap"
|
||||||
|
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
namespace tesseract {
|
namespace tesseract {
|
||||||
class TessBaseAPI;
|
class TessBaseAPI;
|
@ -4,7 +4,7 @@
|
|||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include "RecognizerHelper.h"
|
#include "recognizerhelper.h"
|
||||||
|
|
||||||
RecognizerHelper::RecognizerHelper ()
|
RecognizerHelper::RecognizerHelper ()
|
||||||
: fileName_ ("st_subs.csv") {
|
: fileName_ ("st_subs.csv") {
|
@ -1,7 +1,7 @@
|
|||||||
#include "ResultDialog.h"
|
#include "resultdialog.h"
|
||||||
#include "ui_ResultDialog.h"
|
#include "ui_resultdialog.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
#include "LanguageHelper.h"
|
#include "languagehelper.h"
|
||||||
|
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
@ -4,7 +4,7 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class ResultDialog;
|
class ResultDialog;
|
@ -1,7 +1,7 @@
|
|||||||
#include "SelectionDialog.h"
|
#include "selectiondialog.h"
|
||||||
#include "ui_SelectionDialog.h"
|
#include "ui_selectiondialog.h"
|
||||||
#include "LanguageHelper.h"
|
#include "languagehelper.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
@ -5,7 +5,7 @@
|
|||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class SelectionDialog;
|
class SelectionDialog;
|
@ -1,10 +1,10 @@
|
|||||||
#include "SettingsEditor.h"
|
#include "settingseditor.h"
|
||||||
#include "ui_SettingsEditor.h"
|
#include "ui_settingseditor.h"
|
||||||
#include "LanguageHelper.h"
|
#include "languagehelper.h"
|
||||||
#include "TranslatorHelper.h"
|
#include "translatorhelper.h"
|
||||||
#include "RecognizerHelper.h"
|
#include "recognizerhelper.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
#include "Utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
@ -12,7 +12,7 @@
|
|||||||
#include <QRegExpValidator>
|
#include <QRegExpValidator>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
SettingsEditor::SettingsEditor (const LanguageHelper &dictionary, QWidget *parent) :
|
SettingsEditor::SettingsEditor (const LanguageHelper &dictionary, QWidget *parent) :
|
||||||
QDialog (parent),
|
QDialog (parent),
|
||||||
@ -29,11 +29,11 @@ SettingsEditor::SettingsEditor (const LanguageHelper &dictionary, QWidget *paren
|
|||||||
ui->updateCombo->addItems (updateTypes);
|
ui->updateCombo->addItems (updateTypes);
|
||||||
|
|
||||||
connect (ui->tessdataButton, SIGNAL (clicked ()), SLOT (openTessdataDialog ()));
|
connect (ui->tessdataButton, SIGNAL (clicked ()), SLOT (openTessdataDialog ()));
|
||||||
connect (ui->tessdataEdit, SIGNAL (textChanged (const QString &)),
|
connect (ui->tessdataEdit, SIGNAL (textChanged (const QString&)),
|
||||||
SLOT (initOcrLangCombo (const QString &)));
|
SLOT (initOcrLangCombo (const QString&)));
|
||||||
|
|
||||||
connect (ui->recognizerFixTable, SIGNAL (itemChanged (QTableWidgetItem *)),
|
connect (ui->recognizerFixTable, SIGNAL (itemChanged (QTableWidgetItem*)),
|
||||||
SLOT (recognizerFixTableItemChanged (QTableWidgetItem *)));
|
SLOT (recognizerFixTableItemChanged (QTableWidgetItem*)));
|
||||||
|
|
||||||
ui->translateLangCombo->addItems (dictionary_.translateLanguagesUi ());
|
ui->translateLangCombo->addItems (dictionary_.translateLanguagesUi ());
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ void SettingsEditor::loadSettings () {
|
|||||||
RecognizerHelper::Subs subs = recognizerHelper_->subs ();
|
RecognizerHelper::Subs subs = recognizerHelper_->subs ();
|
||||||
ui->recognizerFixTable->setRowCount (subs.size ());
|
ui->recognizerFixTable->setRowCount (subs.size ());
|
||||||
int row = 0;
|
int row = 0;
|
||||||
foreach (const RecognizerHelper::Sub & sub, subs) {
|
foreach (const RecognizerHelper::Sub &sub, subs) {
|
||||||
if (!initSubsTableRow (row, sub.language)) {
|
if (!initSubsTableRow (row, sub.language)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
@ -3,8 +3,8 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include "TranslatorHelper.h"
|
#include "translatorhelper.h"
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
TranslatorHelper::TranslatorHelper ()
|
TranslatorHelper::TranslatorHelper ()
|
||||||
: translatorsDir_ ("translators"), currentIndex_ (0), triesLeft_ (0) {
|
: translatorsDir_ ("translators"), currentIndex_ (0), triesLeft_ (0) {
|
@ -7,8 +7,8 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include "Updater.h"
|
#include "updater.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#define FIELD(NAME) const QString _ ## NAME = #NAME
|
#define FIELD(NAME) const QString _ ## NAME = #NAME
|
||||||
@ -47,8 +47,8 @@ Updater::Updater (QObject *parent)
|
|||||||
componentsUpdating_ (0) {
|
componentsUpdating_ (0) {
|
||||||
updatesFileName_ = QApplication::applicationDirPath () + QDir::separator () + "updates.json";
|
updatesFileName_ = QApplication::applicationDirPath () + QDir::separator () + "updates.json";
|
||||||
backupSuffix_ = "_backup";
|
backupSuffix_ = "_backup";
|
||||||
connect (network_, SIGNAL (finished (QNetworkReply *)),
|
connect (network_, SIGNAL (finished (QNetworkReply*)),
|
||||||
SLOT (replyFinished (QNetworkReply *)));
|
SLOT (replyFinished (QNetworkReply*)));
|
||||||
|
|
||||||
getCurrentVersion ();
|
getCurrentVersion ();
|
||||||
updateCurrentVersion ();
|
updateCurrentVersion ();
|
@ -1,6 +1,6 @@
|
|||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
|
|
||||||
#include "Utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
QString encode (const QString &source) {
|
QString encode (const QString &source) {
|
||||||
if (source.isEmpty ()) {
|
if (source.isEmpty ()) {
|
@ -4,12 +4,12 @@
|
|||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
|
||||||
#include "WebTranslator.h"
|
#include "webtranslator.h"
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
#include "Settings.h"
|
#include "settings.h"
|
||||||
#include "StAssert.h"
|
#include "stassert.h"
|
||||||
#include "WebTranslatorProxy.h"
|
#include "webtranslatorproxy.h"
|
||||||
#include "TranslatorHelper.h"
|
#include "translatorhelper.h"
|
||||||
|
|
||||||
WebTranslator::WebTranslator ()
|
WebTranslator::WebTranslator ()
|
||||||
: QObject (),
|
: QObject (),
|
||||||
@ -25,11 +25,11 @@ WebTranslator::WebTranslator ()
|
|||||||
connect (view_, SIGNAL (loadFinished (bool)), SLOT (loadFinished (bool)));
|
connect (view_, SIGNAL (loadFinished (bool)), SLOT (loadFinished (bool)));
|
||||||
connect (view_->page ()->mainFrame (), SIGNAL (javaScriptWindowObjectCleared ()),
|
connect (view_->page ()->mainFrame (), SIGNAL (javaScriptWindowObjectCleared ()),
|
||||||
this, SLOT (addProxyToView ()));
|
this, SLOT (addProxyToView ()));
|
||||||
connect (view_->page ()->networkAccessManager (), SIGNAL (finished (QNetworkReply *)),
|
connect (view_->page ()->networkAccessManager (), SIGNAL (finished (QNetworkReply*)),
|
||||||
this, SLOT (replyFinished (QNetworkReply *)));
|
this, SLOT (replyFinished (QNetworkReply*)));
|
||||||
connect (view_->page ()->networkAccessManager (),
|
connect (view_->page ()->networkAccessManager (),
|
||||||
SIGNAL (sslErrors (QNetworkReply *, QList<QSslError>)),
|
SIGNAL (sslErrors (QNetworkReply*,QList<QSslError>)),
|
||||||
this, SLOT (handleSslErrors (QNetworkReply *, QList<QSslError>)));
|
this, SLOT (handleSslErrors (QNetworkReply*,QList<QSslError>)));
|
||||||
|
|
||||||
translationTimeout_.setSingleShot (true);
|
translationTimeout_.setSingleShot (true);
|
||||||
connect (&translationTimeout_, SIGNAL (timeout ()), SLOT (abortTranslation ()));
|
connect (&translationTimeout_, SIGNAL (timeout ()), SLOT (abortTranslation ()));
|
@ -5,7 +5,7 @@
|
|||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
class QWebView;
|
class QWebView;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
@ -1,5 +1,5 @@
|
|||||||
#include "WebTranslatorProxy.h"
|
#include "webtranslatorproxy.h"
|
||||||
#include "ProcessingItem.h"
|
#include "processingitem.h"
|
||||||
|
|
||||||
WebTranslatorProxy::WebTranslatorProxy (QObject *parent)
|
WebTranslatorProxy::WebTranslatorProxy (QObject *parent)
|
||||||
: QObject (parent) {
|
: QObject (parent) {
|
Loading…
Reference in New Issue
Block a user