logic: commandline indexing and configuration
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user