logic: commandline indexing and configuration
This commit is contained in:
@@ -99,6 +99,11 @@ add_files(
|
||||
qt/utility/utilityQt.cpp
|
||||
qt/utility/utilityQt.h
|
||||
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler.cpp
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler.h
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler_p.h
|
||||
# qt/utility/qctrlsignals/QCtrlSignals
|
||||
|
||||
qt/view/graphElements/nodeComponents/QtGraphNodeComponent.cpp
|
||||
qt/view/graphElements/nodeComponents/QtGraphNodeComponent.h
|
||||
qt/view/graphElements/nodeComponents/QtGraphNodeComponentClickable.cpp
|
||||
@@ -270,8 +275,31 @@ add_files(
|
||||
utility/path_detector/PathDetector.cpp
|
||||
utility/path_detector/PathDetector.h
|
||||
|
||||
# utility/signal_handler/SignalHandler.cpp
|
||||
# utility/signal_handler/SignalHandler.h
|
||||
|
||||
# utility/QtUnixSignalEmitter.cpp
|
||||
# utility/QtUnixSignalEmitter.h
|
||||
|
||||
# utility/SignalWatcher.cpp
|
||||
# utility/SignalWatcher.h
|
||||
|
||||
utility/utilityApp.cpp
|
||||
utility/utilityApp.h
|
||||
utility/utilityPathDetection.cpp
|
||||
utility/utilityPathDetection.h
|
||||
)
|
||||
|
||||
#if(WIN32)
|
||||
#add_files(
|
||||
# LIB_GUI_FILES
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler_win.cpp
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler_win.h
|
||||
#)
|
||||
#else()
|
||||
#add_files(
|
||||
# LIB_GUI_FILES
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler_unix.cpp
|
||||
# qt/utility/qctrlsignals/qctrlsignalhandler_unix.h
|
||||
#)
|
||||
#endif()
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "utility/logging/LogManager.h"
|
||||
|
||||
#include "component/controller/LogController.h"
|
||||
#include "utility/utilityApp.h"
|
||||
|
||||
QtApplication::QtApplication(int& argc, char** argv)
|
||||
: QApplication(argc, argv)
|
||||
|
||||
@@ -7,7 +7,6 @@ class QtApplication
|
||||
: public QApplication
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QtApplication(int& argc, char** argv);
|
||||
|
||||
|
||||
@@ -7,39 +7,34 @@
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/AppPath.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/utilityApp.h"
|
||||
#include "License.h"
|
||||
|
||||
QtCoreApplication::QtCoreApplication(int argc, char **argv )
|
||||
: QCoreApplication(argc, argv)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
QtCoreApplication::~QtCoreApplication()
|
||||
{
|
||||
}
|
||||
|
||||
void QtCoreApplication::handleMessage(MessageFinishedParsing* message)
|
||||
void QtCoreApplication::handleMessage(MessageQuitApplication* message)
|
||||
{
|
||||
std::cout << "Finished parsing" << std::endl;
|
||||
LOG_INFO("Finished parsing");
|
||||
this->quit();
|
||||
emit quit();
|
||||
}
|
||||
|
||||
void QtCoreApplication::handleMessage(MessageStatus* message)
|
||||
{
|
||||
// if (m.substr(0,5) == "Index")
|
||||
{
|
||||
std::cout << message->status << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
bool QtCoreApplication::saveLicense(License license)
|
||||
{
|
||||
if (license.isValid())
|
||||
{
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
std::string appLocation = AppPath::getAppPath();
|
||||
appSettings->setLicenseString(license.getLicenseEncodedString(appLocation));
|
||||
FilePath p(appLocation);
|
||||
appSettings->setLicenseCheck(license.hashLocation(p.absolute().str()));
|
||||
appSettings->save(UserPaths::getAppSettingsPath());
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR( "The entered license key is invalid.");
|
||||
return false;
|
||||
}
|
||||
return utility::saveLicense(&license);
|
||||
}
|
||||
|
||||
@@ -3,14 +3,18 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include "utility/messaging/MessageListener.h"
|
||||
#include "utility/messaging/type/MessageFinishedParsing.h"
|
||||
#include "utility/messaging/type/MessageQuitApplication.h"
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
|
||||
class License;
|
||||
class UnixSignalWatcher;
|
||||
|
||||
class QtCoreApplication
|
||||
: public QCoreApplication
|
||||
, public MessageListener<MessageFinishedParsing>
|
||||
, public MessageListener<MessageQuitApplication>
|
||||
, public MessageListener<MessageStatus>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QtCoreApplication(int argc, char **argv);
|
||||
virtual ~QtCoreApplication();
|
||||
@@ -18,7 +22,8 @@ public:
|
||||
signals:
|
||||
void quitSignal();
|
||||
private:
|
||||
virtual void handleMessage(MessageFinishedParsing* message);
|
||||
virtual void handleMessage(MessageQuitApplication* message);
|
||||
virtual void handleMessage(MessageStatus* message);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -153,15 +153,6 @@ DialogView::IndexingOptions QtDialogView::startIndexingDialog(
|
||||
void QtDialogView::updateIndexingDialog(
|
||||
size_t startedFileCount, size_t finishedFileCount, size_t totalFileCount, std::string sourcePath)
|
||||
{
|
||||
if (sourcePath.size())
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "Indexing file: [";
|
||||
ss << startedFileCount << "/";
|
||||
ss << totalFileCount << "] ";
|
||||
ss << sourcePath;
|
||||
MessageStatus(ss.str(), false, true).dispatch();
|
||||
}
|
||||
|
||||
m_onQtThread(
|
||||
[=]()
|
||||
|
||||
@@ -145,7 +145,7 @@ void QtStartScreen::setupStartScreen()
|
||||
{
|
||||
License license;
|
||||
license.loadFromEncodedString(ApplicationSettings::getInstance()->getLicenseString(), AppPath::getAppPath());
|
||||
license.loadPublicKeyFromString(PUBLIC_KEY);
|
||||
// license.loadPublicKeyFromString(PUBLIC_KEY);
|
||||
bool licenseValid = license.isValid();
|
||||
|
||||
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath().concat(FilePath("startscreen/startscreen.css"))).c_str());
|
||||
|
||||
@@ -356,7 +356,7 @@ void QtProjectWizzardContentPreferences::save()
|
||||
|
||||
if (m_javaPath)
|
||||
{
|
||||
appSettings->setJavaPath(m_javaPath->getText().toStdString());
|
||||
appSettings->setJavaPath(FilePath(m_javaPath->getText().toStdString()));
|
||||
}
|
||||
|
||||
appSettings->setJreSystemLibraryPaths(m_jreSystemLibraryPaths->getList());
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
#include <QThread>
|
||||
#include <qprocessordetection.h>
|
||||
|
||||
#include "License.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "utility/logging/logging.h"
|
||||
#include "utility/AppPath.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
namespace utility
|
||||
@@ -98,3 +103,33 @@ int utility::getIdealThreadCount()
|
||||
{
|
||||
return QThread::idealThreadCount();
|
||||
}
|
||||
|
||||
bool utility::saveLicense(License* license)
|
||||
{
|
||||
if (license == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (license->isValid())
|
||||
{
|
||||
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
|
||||
if (appSettings == NULL)
|
||||
{
|
||||
LOG_ERROR_STREAM(<< "Unable to retrieve app settings");
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string appLocation = AppPath::getAppPath();
|
||||
appSettings->setLicenseString(license->getLicenseEncodedString(appLocation));
|
||||
FilePath p(appLocation);
|
||||
appSettings->setLicenseCheck(license->hashLocation(p.absolute().str()));
|
||||
appSettings->save(UserPaths::getAppSettingsPath());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR( "The entered license key is invalid.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "utility/OsType.h"
|
||||
|
||||
class License;
|
||||
|
||||
namespace utility
|
||||
{
|
||||
std::string executeProcess(const std::string& command, const std::string& workingDirectory = "", int timeout = 30000);
|
||||
@@ -17,6 +19,7 @@ namespace utility
|
||||
int getIdealThreadCount();
|
||||
|
||||
OsType getOsType();
|
||||
bool saveLicense(License* license);
|
||||
}
|
||||
|
||||
#endif // UTILITY_APP_H
|
||||
|
||||
Reference in New Issue
Block a user