logic: file paths

Changed relative file paths for resources to absolute paths to ensure functionality of shortcuts and file associations on windows platform
This commit is contained in:
Manuel Dobusch
2016-01-26 15:28:43 +01:00
parent e0d7f1d613
commit 8d6220dafb
39 changed files with 291 additions and 84 deletions
+4 -4
View File
@@ -14,10 +14,10 @@
// project's program.
//
// WHY AM I HERE?
// Every time you open up a project in Coati it will go through your project in
// search for a function called "main". In case this function is defined the
// corresponding symbol is activated. Otherwise Coati will just activate the
// first thing in your codebase it happens to stumble across.
// Every time you open up a project in Coati it will look for a function called
// "main". In case this function is defined it will be displayed right away.
// Otherwise Coati will just activate the first thing in your codebase it
// happens to stumble across.
//
// WHAT CAN I DO NOW?
// Left-click the "my_first_step()" function call inside the main function.
@@ -7,8 +7,8 @@
//------------------------------------------------------------------------------
//
// WHAT JUST HAPPENED?
// As I mentioned earlier, Coati knows the concept of an "active" symbol. You
// just changed the active symbol by clicking on the name of a function.
// Coati uses the concept of an "active" symbol. You just changed the active
// symbol by clicking on the name of a function.
//
// OK, BUT WHAT IS AN ACTIVE SYMBOL?
// Coati doesn't show your entire code base on a single screen. Even for
@@ -16,7 +16,7 @@
//
//------------------------------------------------------------------------------
void finde_me_if_you_can()
void find_me_if_you_can()
{
}
@@ -10,15 +10,13 @@
// Well done. Lets get over the other buttons left to the search bar really
// quick.
//
// 5 - UNDO AND REDO
// You can use the buttons to the very left to undo and redo your actions. This
// may seem odd since Coati doesn't include any features to actually change
// code. Instead Coati offers these buttons to help you navigate. So they
// really come in handy in case you ask yourself something like "How did I end
// up here?"
// 5 - FORWARD AND BACKWARD
// You can use the buttons to the very left to go forward and backward, like
// in a web browser. They really come in handy in case you ask yourself something
// like "How did I end up here?"
//
// 6 - REFRESH
// The next button allows you to refresh you project in case you changed some
// The next button allows you to refresh the project in case you changed some
// of your code. The second button toggels the auto-refresh option. When
// enabled Coati refreshes your project every time it's window gets focused.
//
+1 -14
View File
@@ -1,4 +1,4 @@
ConfigManager.cpp WARNING: value path/to/nowhere is not present in config.
ConfigManager.cpp WARNING: value source/header_search_paths/header_search_path is not present in config.
Token.cpp ERROR: Location Id was not referenced by this Token.
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
Edge.cpp ERROR: Nodes are not plain copies.
@@ -45,20 +45,7 @@ Edge.cpp ERROR: Nodes are not plain copies.
INFO: handle TestMessage
INFO: handle TestMessage
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
ConfigManager.cpp WARNING: value Float is not present in config.
ConfigManager.cpp WARNING: value String is not present in config.
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
ConfigManager.cpp WARNING: value Float is not present in config.
ConfigManager.cpp WARNING: value String is not present in config.
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
ConfigManager.cpp WARNING: value Float is not present in config.
ConfigManager.cpp WARNING: value String is not present in config.
ConfigManager.cpp WARNING: value NewBool is not present in config.
INFO: file: file.cpp < 0:0 0:0>
TextAccess.cpp ERROR: Could not open file file.cpp
INFO: typedef: type -> int <file.cpp 1:1 1:1>
@@ -646,12 +646,6 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_C84BE68F0D9E42D3B9BD9C8A53DF049A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_FB29EAD658C3497D9AC46ADE92D33C83"
"MsmSig" = "8:_UNDEFINED"
}
@@ -661,6 +655,12 @@
"OwnerKey" = "8:_F81B906E39E44A5DAC37B3D70BC8A8CE"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_C84BE68F0D9E42D3B9BD9C8A53DF049A"
"MsmSig" = "8:_UNDEFINED"
}
}
"Configurations"
{
@@ -2975,6 +2975,29 @@
}
"FileType"
{
"{5EB83D71-FA18-4901-BE56-DE22E13CC478}:_BA9B3A9BDD6D40688E6BCF9DFCF96473"
{
"Name" = "8:Coati Project File"
"Description" = "8:Coati project file"
"Extensions" = "8:.coatiproject"
"MIME" = "8:"
"Icon" = "8:_096D033F5DF740A6B6B190652E5276AF"
"IconIndex" = "3:0"
"Command"
{
"Command" = "8:_0BD1A36560F540F2AFAC7B3A755E3124"
}
"Verbs"
{
"{95C0C507-CBF0-42B8-B119-07219E384A4A}:_C727665195B8487C977B0D15DFF34BC5"
{
"Command" = "8:Open"
"Verb" = "8:open"
"Arguments" = "8:\"--project\" \"%1\""
"Order" = "3:0"
}
}
}
}
"Folder"
{
@@ -3327,7 +3350,7 @@
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Coati"
"ProductCode" = "8:{2A3B2FF5-A114-4CAB-88FB-DE8942D5B8EB}"
"PackageCode" = "8:{08D7C8AB-362B-4BBA-A1A3-992D5BBB3F0E}"
"PackageCode" = "8:{1FB7C5E9-FCA4-4EE0-B3B7-9677483310C1}"
"UpgradeCode" = "8:{CFF09D53-87AF-4241-960D-98C21ED9D358}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
@@ -3608,7 +3631,7 @@
{
"{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_51EEFD238ED54FB389548F19CCABB01F"
{
"Sequence" = "3:310"
"Sequence" = "3:400"
"DisplayName" = "8:Checkboxes (A)"
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:FALSE"
@@ -3998,7 +4021,7 @@
}
"{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_FD3D5E2ADB2B4D67B173954D88B46362"
{
"Sequence" = "3:400"
"Sequence" = "3:500"
"DisplayName" = "8:Confirm Installation"
"UseDynamicProperties" = "11:TRUE"
"IsDependency" = "11:FALSE"
+12
View File
@@ -0,0 +1,12 @@
Remove self-healing on project file opened
Open .msi in Orca
Component table
Remove key path of component with ID {31DB780A-8AA4-1A96-F39E-1BD7CFCC2418}*
*I don't know if this id will stay the same, so here's how to find it:
Just install Coati as is
Open windows Event Viewer
Open .coatiproject via file association (wont work properly, that's ok)
Look for Application log
Look for a Warning entry involving MsiInstaller at time of step 3
Retrieve component id from message of that entry
+6 -1
View File
@@ -9,6 +9,8 @@
#include "PublicKey.h"
#include "settings/ApplicationSettings.h"
#include "utility/AppPath.h"
class LicenseChecker
: public MessageListener<MessageLoadProject>
{
@@ -42,11 +44,14 @@ private:
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
std::string licenseCheck = appSettings->getLicenseCheck();
FilePath p("");
std::string appPath = AppPath::getAppPath(); // for easier debugging...
FilePath p(appPath);
LOG_INFO_STREAM(<< "gonna check location: " << appPath);
if (!License::checkLocation(p.absolute().str(), licenseCheck))
{
break;
}
LOG_INFO_STREAM(<< "öhm...? done checking?");
std::string licenseString = appSettings->getLicenseString();
if (licenseString.size() == 0)
+3 -2
View File
@@ -18,7 +18,8 @@
#include "qt/view/QtViewFactory.h"
#include "version.h"
#include "component/controller/helper/NetworkProtocolHelper.h" // remove when done
#include "utility/AppPath.h"
#include "utility/ResourcePaths.h"
void init()
{
@@ -31,7 +32,7 @@ void init()
FileLogger::setFilePath(logPath);
LogManager::getInstance()->addLogger(fileLogger);
utility::loadFontsFromDirectory("data/fonts", ".otf");
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
}
int main(int argc, char *argv[])
+4
View File
@@ -274,9 +274,13 @@ add_files(
utility/text/TextAccess.cpp
utility/text/TextAccess.h
utility/AppPath.cpp
utility/AppPath.h
utility/ConfigManager.cpp
utility/ConfigManager.h
utility/Property.h
utility/ResourcePaths.cpp
utility/ResourcePaths.h
utility/TimePoint.cpp
utility/TimePoint.h
utility/types.h
+7 -5
View File
@@ -2,6 +2,8 @@
#include "utility/logging/logging.h"
#include "utility/ResourcePaths.h"
#include "component/view/GraphViewStyleImpl.h"
#include "settings/ApplicationSettings.h"
#include "settings/ColorScheme.h"
@@ -415,7 +417,7 @@ GraphViewStyle::NodeStyle GraphViewStyle::getStyleOfBundleNode(bool isFocused)
style.color = getNodeColor("bundle", isFocused);
addIcon(Node::NODE_ENUM, false, &style);
style.iconPath = "data/gui/graph_view/images/bundle.png";
style.iconPath = ResourcePaths::getGuiPath() + "graph_view/images/bundle.png";
return style;
}
@@ -562,16 +564,16 @@ void GraphViewStyle::addIcon(Node::NodeType type, bool hasChildren, NodeStyle* s
switch (type)
{
case Node::NODE_ENUM:
style->iconPath = "data/gui/graph_view/images/enum_1.png";
style->iconPath = ResourcePaths::getGuiPath() + "graph_view/images/enum_1.png";
break;
case Node::NODE_TYPEDEF:
style->iconPath = "data/gui/graph_view/images/typedef_2.png";
style->iconPath = ResourcePaths::getGuiPath() + "graph_view/images/typedef_2.png";
break;
case Node::NODE_MACRO:
style->iconPath = "data/gui/graph_view/images/macro_3.png";
style->iconPath = ResourcePaths::getGuiPath() + "graph_view/images/macro_3.png";
break;
case Node::NODE_FILE:
style->iconPath = "data/gui/graph_view/images/file.png";
style->iconPath = ResourcePaths::getGuiPath() + "graph_view/images/file.png";
break;
default:
return;
+3 -1
View File
@@ -1,5 +1,7 @@
#include "settings/ApplicationSettings.h"
#include "utility/ResourcePaths.h"
std::shared_ptr<ApplicationSettings> ApplicationSettings::s_instance;
std::shared_ptr<ApplicationSettings> ApplicationSettings::getInstance()
@@ -69,7 +71,7 @@ void ApplicationSettings::setFontSize(int fontSize)
std::string ApplicationSettings::getColorSchemePath() const
{
return getValue<std::string>("application/color_scheme", "./data/color_schemes/bright.xml");
return getValue<std::string>("application/color_scheme", ResourcePaths::getColorSchemesPath() + "bright.xml");
}
void ApplicationSettings::setColorSchemePath(const std::string& colorSchemePath)
+54
View File
@@ -0,0 +1,54 @@
#include "AppPath.h"
#include <string>
std::string AppPath::m_appPath = "";
std::string AppPath::getAppPath()
{
if (m_appPath.length() <= 0)
{
setupAppPath();
}
return m_appPath;
}
void AppPath::setupAppPath()
{
#ifdef _WIN32
HMODULE hModule = GetModuleHandleW(NULL);
WCHAR path[MAX_PATH];
GetModuleFileNameW(hModule, path, MAX_PATH);
std::wstring wPath(path);
m_appPath = std::string(wPath.begin(), wPath.end());
size_t pos = m_appPath.find_last_of("/");
if (pos == std::string::npos)
{
pos = m_appPath.find_last_of("\\");
}
if (pos != std::string::npos)
{
m_appPath = m_appPath.substr(0, pos + 1);
}
#elif _WIN64
HMODULE hModule = GetModuleHandleW(NULL);
WCHAR path[MAX_PATH];
GetModuleFileNameW(hModule, path, MAX_PATH);
std::wstring wPath(path);
m_appPath = std::string(wPath.begin(), wPath.end());
size_t pos = m_appPath.find_last_of("/");
if (pos == std::string::npos)
{
pos = m_appPath.find_last_of("\\");
}
if (pos != std::string::npos)
{
m_appPath = m_appPath.substr(0, pos + 1);
}
#endif // WINDOWS
}
+30
View File
@@ -0,0 +1,30 @@
#ifndef APP_PATH_H
#define APP_PATH_H
#include <string>
// #include "src\lib_gui\includes.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#elif _WIN64
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <Windows.h>
#endif // WINDOWS
class AppPath
{
public:
static std::string getAppPath();
private:
static void setupAppPath();
static std::string m_appPath;
};
#endif // APP_PATH_H
+22
View File
@@ -0,0 +1,22 @@
#include "ResourcePaths.h"
#include "AppPath.h"
std::string ResourcePaths::m_colorSchemesPath = AppPath::getAppPath() + "data/color_schemes/";
std::string ResourcePaths::m_fontsPath = AppPath::getAppPath() + "data/fonts/";
std::string ResourcePaths::m_guiPath = AppPath::getAppPath() + "data/gui/";
std::string ResourcePaths::getColorSchemesPath()
{
return m_colorSchemesPath;
}
std::string ResourcePaths::getFontsPath()
{
return m_fontsPath;
}
std::string ResourcePaths::getGuiPath()
{
return m_guiPath;
}
+19
View File
@@ -0,0 +1,19 @@
#ifndef RESOURCE_PATHS_H
#define RESOURCE_PATHS_H
#include <string>
class ResourcePaths
{
public:
static std::string getColorSchemesPath();
static std::string getFontsPath();
static std::string getGuiPath();
private:
static std::string m_colorSchemesPath;
static std::string m_fontsPath;
static std::string m_guiPath;
};
#endif // RESOURCE_PATHS_H
@@ -19,7 +19,7 @@
void setup(int argc, char *argv[])
{
}
#endif // INCLUDES_WINDOWS_H
+7 -2
View File
@@ -4,6 +4,7 @@
#include <QPushButton>
#include <QVBoxLayout>
#include "utility/ResourcePaths.h"
#include "utility/file/FileSystem.h"
#include "utility/logging/logging.h"
#include "utility/messaging/type/MessageActivateFile.h"
@@ -50,8 +51,10 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeFileList* parent)
m_title->setFixedHeight(std::max(m_title->fontMetrics().height() * 1.2, 28.0));
m_title->setSizePolicy(sizePolicy().horizontalPolicy(), QSizePolicy::Fixed);
std::string text = ResourcePaths::getGuiPath() + "graph_view/images/file.png";
m_title->setIcon(utility::colorizePixmap(
QPixmap("data/gui/graph_view/images/file.png"),
QPixmap(text.c_str()),
ColorScheme::getInstance()->getColor("code/file/title/icon").c_str()
));
@@ -455,7 +458,9 @@ void QtCodeFile::doUpdateTitleBar()
if ((!FileSystem::exists(m_filePath.str())) ||
(FileSystem::getLastWriteTime(m_filePath) > m_modificationTime))
{
m_title->setStyleSheet("background-image: url(data/gui/code_view/images/pattern.png);");
std::string url = ResourcePaths::getGuiPath() + "code_view/images/pattern.png";
std::string foo = "background-image: url(" + url + ");";
m_title->setStyleSheet(foo.c_str());
}
else
{
@@ -5,6 +5,8 @@
#include <QFileDialog>
#include <QMimeData>
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
QtListItemWidget::QtListItemWidget(QtDirectoryListBox* list, QListWidgetItem* item, QWidget *parent)
@@ -95,7 +97,7 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent)
m_list->setObjectName("list");
m_list->setAttribute(Qt::WA_MacShowFocusRect, 0);
setStyleSheet(utility::getStyleSheet("data/gui/setting_window/listbox.css").c_str());
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "setting_window/listbox.css").c_str());
layout->addWidget(m_list);
QWidget* buttonContainer = new QWidget(this);
@@ -106,13 +108,15 @@ QtDirectoryListBox::QtDirectoryListBox(QWidget *parent)
innerLayout->setContentsMargins(8, 4, 8, 3);
innerLayout->setSpacing(0);
m_addButton = new QPushButton(QIcon("data/gui/setting_window/plus.png"), "", this);
std::string iconPath = ResourcePaths::getGuiPath() + "setting_window/plus.png";
m_addButton = new QPushButton(QIcon(iconPath.c_str()), "", this);
m_addButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_addButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_addButton->setObjectName("roundedButton");
innerLayout->addWidget(m_addButton);
m_removeButton = new QPushButton(QIcon("data/gui/setting_window/minus.png"), "", this);
iconPath = ResourcePaths::getGuiPath() + "setting_window/minus.png";
m_removeButton = new QPushButton(QIcon(iconPath.c_str()), "", this);
m_removeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_removeButton->setAttribute(Qt::WA_LayoutUsesWidgetRect); // fixes layouting on Mac
m_removeButton->setObjectName("roundedButton");
+6 -2
View File
@@ -6,6 +6,8 @@
#include "utility/messaging/type/MessageAutoRefreshChanged.h"
#include "utility/messaging/type/MessageRefresh.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
#include "settings/ApplicationSettings.h"
#include "settings/ColorScheme.h"
@@ -60,13 +62,15 @@ void QtRefreshBar::refreshStyle()
m_refreshButton->setFixedHeight(height);
m_autoRefreshButton->setFixedHeight(height);
std::string map = ResourcePaths::getGuiPath() + "refresh_view/images/refresh.png";
m_refreshButton->setIcon(utility::colorizePixmap(
QPixmap("data/gui/refresh_view/images/refresh.png"),
QPixmap(map.c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
map = ResourcePaths::getGuiPath() + "refresh_view/images/auto_refresh.png";
m_autoRefreshButton->setIcon(utility::colorizePixmap(
QPixmap("data/gui/refresh_view/images/auto_refresh.png"),
QPixmap(map.c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
}
+4 -1
View File
@@ -9,6 +9,8 @@
#include "settings/ApplicationSettings.h"
#include "settings/ColorScheme.h"
#include "utility/ResourcePaths.h"
QtSearchBar::QtSearchBar()
{
setObjectName("search_bar");
@@ -86,8 +88,9 @@ void QtSearchBar::refreshStyle()
m_searchBox->setFixedHeight(std::max(ApplicationSettings::getInstance()->getFontSize() + 11, 25));
m_searchButton->setFixedHeight(m_searchBox->height() + 5);
std::string map = ResourcePaths::getGuiPath() + "search_view/images/search.png";
m_searchButton->setIcon(utility::colorizePixmap(
QPixmap("data/gui/search_view/images/search.png"),
QPixmap(map.c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
}
+3 -2
View File
@@ -4,11 +4,12 @@
#include "qt/utility/utilityQt.h"
#include "utility/messaging/type/MessageShowErrors.h"
#include "utility/ResourcePaths.h"
QtStatusBar::QtStatusBar()
: m_text(this)
{
QMovie* movie = new QMovie("data/gui/statusbar_view/loader.gif");
QMovie* movie = new QMovie((ResourcePaths::getGuiPath() + "statusbar_view/loader.gif").c_str());
// if movie doesn't loop forever, force it to.
if (movie->loopCount() != -1)
{
@@ -27,7 +28,7 @@ QtStatusBar::QtStatusBar()
m_errorButton.setFlat(true);
m_errorButton.setStyleSheet("QPushButton { color: #D00000; margin-right: 0; spacing: none; }");
m_errorButton.setIcon(utility::colorizePixmap(
QPixmap("data/gui/statusbar_view/octagon.png"),
QPixmap((ResourcePaths::getGuiPath() + "statusbar_view/octagon.png").c_str()),
"#D00000"
).scaledToHeight(10));
addPermanentWidget(&m_errorButton);
+3 -2
View File
@@ -5,6 +5,7 @@
#include "utility/messaging/type/MessageUndo.h"
#include "utility/messaging/type/MessageRedo.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
#include "settings/ApplicationSettings.h"
@@ -72,12 +73,12 @@ void QtUndoRedo::refreshStyle()
m_redoButton->setFixedHeight(height);
m_undoButton->setIcon(utility::colorizePixmap(
QPixmap("data/gui/undoredo_view/images/arrow_left.png"),
QPixmap((ResourcePaths::getGuiPath() + "undoredo_view/images/arrow_left.png").c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
m_redoButton->setIcon(utility::colorizePixmap(
QPixmap("data/gui/undoredo_view/images/arrow_right.png"),
QPixmap((ResourcePaths::getGuiPath() + "undoredo_view/images/arrow_right.png").c_str()),
ColorScheme::getInstance()->getColor("search/button/icon").c_str()
));
}
+2 -1
View File
@@ -1,6 +1,7 @@
#include "qt/view/QtCodeView.h"
#include "utility/file/FileSystem.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
#include "qt/element/QtCodeArea.h"
@@ -185,5 +186,5 @@ void QtCodeView::setStyleSheet() const
{
utility::setWidgetBackgroundColor(m_widget, ColorScheme::getInstance()->getColor("code/background"));
m_widget->setStyleSheet(utility::getStyleSheet("data/gui/code_view/code_view.css").c_str());
m_widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "code_view/code_view.css").c_str());
}
+2 -1
View File
@@ -14,6 +14,7 @@
#include "component/controller/helper/GraphPostprocessor.h"
#include "component/view/GraphViewStyle.h"
#include "utility/messaging/type/MessageDeactivateEdge.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/utilityQt.h"
@@ -287,7 +288,7 @@ void QtGraphView::doRefreshView()
doClear();
doResize();
std::string css = utility::getStyleSheet("data/gui/graph_view/graph_view.css");
std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath() + "graph_view/graph_view.css");
getView()->setStyleSheet(css.c_str());
float zoomFactor = GraphViewStyle::getZoomFactor();
+3 -1
View File
@@ -2,6 +2,8 @@
#include "qt/utility/utilityQt.h"
#include "utility/ResourcePaths.h"
#include "component/controller/RefreshController.h"
#include "qt/view/QtViewWidgetWrapper.h"
@@ -39,5 +41,5 @@ void QtRefreshView::doRefreshView()
void QtRefreshView::setStyleSheet()
{
m_widget->setStyleSheet(utility::getStyleSheet("data/gui/refresh_view/refresh_view.css").c_str());
m_widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "refresh_view/refresh_view.css").c_str());
}
+3 -1
View File
@@ -2,6 +2,8 @@
#include "qt/utility/utilityQt.h"
#include "utility/ResourcePaths.h"
#include "component/controller/SearchController.h"
#include "qt/view/QtViewWidgetWrapper.h"
@@ -75,7 +77,7 @@ void QtSearchView::doSetAutocompletionList(const std::vector<SearchMatch>& autoc
void QtSearchView::setStyleSheet()
{
std::string css = utility::getStyleSheet("data/gui/search_view/search_view.css");
std::string css = utility::getStyleSheet(ResourcePaths::getGuiPath() + "search_view/search_view.css");
m_widget->setStyleSheet(css.c_str());
+3 -1
View File
@@ -5,6 +5,8 @@
#include "qt/view/QtMainView.h"
#include "qt/view/QtViewWidgetWrapper.h"
#include "utility/ResourcePaths.h"
QtUndoRedoView::QtUndoRedoView(ViewLayout* viewLayout)
: UndoRedoView(viewLayout)
, m_refreshFunctor(std::bind(&QtUndoRedoView::doRefreshView, this))
@@ -35,7 +37,7 @@ void QtUndoRedoView::refreshView()
void QtUndoRedoView::setStyleSheet()
{
m_widget->setStyleSheet(utility::getStyleSheet("data/gui/undoredo_view/undoredo_view.css").c_str());
m_widget->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "undoredo_view/undoredo_view.css").c_str());
}
void QtUndoRedoView::doRefreshView()
@@ -5,6 +5,8 @@
#include <QGraphicsSceneEvent>
#include <QPen>
#include "utility/ResourcePaths.h"
#include "component/controller/helper/GraphPostprocessor.h"
#include "qt/graphics/QtRoundedRectItem.h"
@@ -371,7 +373,7 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
if (style.hasHatching)
{
QtDeviceScaledPixmap pattern("data/gui/graph_view/images/pattern.png");
QtDeviceScaledPixmap pattern((ResourcePaths::getGuiPath() + "graph_view/images/pattern.png").c_str());
pattern.scaleToHeight(10);
QPixmap pixmap = utility::colorizePixmap(pattern.pixmap(), style.color.hatching.c_str());
@@ -4,6 +4,8 @@
#include <QFontMetrics>
#include <QPen>
#include "utility/ResourcePaths.h"
#include "component/view/GraphViewStyle.h"
#include "qt/graphics/QtRoundedRectItem.h"
#include "qt/utility/QtDeviceScaledPixmap.h"
@@ -35,9 +37,13 @@ QtGraphNodeAccess::QtGraphNodeAccess(TokenComponentAccess::AccessType accessType
break;
}
QtDeviceScaledPixmap pixmap(QString::fromStdString(ResourcePaths::getGuiPath() + "graph_view/images/" + accessString + ".png"));
pixmap.scaleToHeight(m_accessIconSize);
if (fileName.size() > 0)
{
QtDeviceScaledPixmap pixmap(QString::fromStdString("data/gui/graph_view/images/" + fileName + ".png"));
QtDeviceScaledPixmap pixmap(QString::fromStdString(ResourcePaths::getGuiPath() + fileName + ".png"));
pixmap.scaleToHeight(m_accessIconSize);
m_accessIcon = new QGraphicsPixmapItem(pixmap.pixmap(), this);
@@ -4,6 +4,7 @@
#include "utility/logging/logging.h"
#include "utility/messaging/type/MessageGraphNodeExpand.h"
#include "utility/ResourcePaths.h"
#include "qt/graphics/QtRoundedRectItem.h"
#include "qt/utility/QtDeviceScaledPixmap.h"
@@ -23,7 +24,7 @@ QtGraphNodeExpandToggle::QtGraphNodeExpandToggle(bool expanded, int invisibleSub
const int iconHeight = 4;
m_icon = new QGraphicsPixmapItem(this);
QtDeviceScaledPixmap pixmap("data/gui/graph_view/images/arrow.png");
QtDeviceScaledPixmap pixmap((ResourcePaths::getGuiPath() + "graph_view/images/arrow.png").c_str());
pixmap.scaleToHeight(iconHeight);
if (invisibleSubNodeCount)
+6 -3
View File
@@ -9,6 +9,7 @@
#include "qt/utility/QtDeviceScaledPixmap.h"
#include "qt/utility/utilityQt.h"
#include "utility/Version.h"
#include "utility/ResourcePaths.h"
QtAbout::QtAbout(QWidget *parent)
: QtSettingsWindow(parent)
@@ -30,7 +31,7 @@ void QtAbout::setup()
"}"
);
setStyleSheet(utility::getStyleSheet("data/gui/about/about.css").c_str());
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "about/about.css").c_str());
QVBoxLayout* windowLayout = new QVBoxLayout();
windowLayout->setContentsMargins(30, 30, 30, 20);
@@ -39,8 +40,9 @@ void QtAbout::setup()
QHBoxLayout* rowTitle = new QHBoxLayout();
windowLayout->addLayout(rowTitle);
QtDeviceScaledPixmap coatiLogo("data/gui/about/logo.png");
QtDeviceScaledPixmap coatiLogo((ResourcePaths::getGuiPath() + "about/logo.png").c_str());
coatiLogo.scaleToWidth(120);
QLabel* coatiLogoLabel = new QLabel(this);
coatiLogoLabel->setPixmap(coatiLogo.pixmap());
coatiLogoLabel->resize(coatiLogo.width(), coatiLogo.height());
@@ -115,8 +117,9 @@ void QtAbout::setup()
rowAcknowledgementsLogos->addStretch();
QtDeviceScaledPixmap fhsLogo("data/gui/about/logo_fhs.png");
QtDeviceScaledPixmap fhsLogo((ResourcePaths::getGuiPath() + "about/logo_fhs.png").c_str());
fhsLogo.scaleToHeight(60);
QLabel* fhsLabel = new QLabel(this);
fhsLabel->setPixmap(fhsLogo.pixmap());
fhsLabel->resize(fhsLogo.width(), fhsLogo.height());
+6 -3
View File
@@ -13,6 +13,8 @@
#include "qt/utility/utilityQt.h"
#include "settings/ApplicationSettings.h"
#include "utility/file/FilePath.h"
#include "utility/AppPath.h"
#include "utility/ResourcePaths.h"
QtLicense::QtLicense(QWidget *parent)
: QtSettingsWindow(parent, 68)
@@ -51,8 +53,8 @@ void QtLicense::load()
void QtLicense::setup()
{
setStyleSheet((
utility::getStyleSheet("data/gui/setting_window/window.css") +
utility::getStyleSheet("data/gui/license/license.css")
utility::getStyleSheet(ResourcePaths::getGuiPath() + "data/gui/setting_window/window.css") +
utility::getStyleSheet(ResourcePaths::getGuiPath() + "data/gui/license/license.css")
).c_str());
addLogo();
@@ -146,7 +148,8 @@ void QtLicense::handleUpdateButtonPress()
{
ApplicationSettings* appSettings = ApplicationSettings::getInstance().get();
appSettings->setLicenseString(license.getLicenseString());
FilePath p("");
std::string appLocation = AppPath::getAppPath(); // for easier debugging
FilePath p(appLocation);
appSettings->setLicenseCheck(license.hashLocation(p.absolute().str()));
appSettings->save();
}
+4 -3
View File
@@ -26,6 +26,7 @@
#include "utility/messaging/type/MessageUndo.h"
#include "utility/messaging/type/MessageWindowFocus.h"
#include "utility/messaging/type/MessageZoom.h"
#include "utility/ResourcePaths.h"
#include "version.h"
#include "isTrial.h"
@@ -112,7 +113,7 @@ QtMainWindow::QtMainWindow()
setCentralWidget(nullptr);
setDockNestingEnabled(true);
setWindowIcon(QIcon("./data/gui/icon/logo_1024_1024.png"));
setWindowIcon(QIcon((ResourcePaths::getGuiPath() + "icon/logo_1024_1024.png").c_str()));
setWindowFlags(Qt::Widget);
// QApplication::setOverrideCursor(Qt::ArrowCursor);
@@ -121,7 +122,7 @@ QtMainWindow::QtMainWindow()
app->installEventFilter(new MouseReleaseFilter(this));
app->installEventFilter(new MouseWheelFilter(this));
app->setStyleSheet(utility::getStyleSheet("data/gui/tooltip.css").c_str());
app->setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "tooltip.css").c_str());
m_recentProjectAction = new QAction*[ApplicationSettings::MaximalAmountOfRecentProjects];
@@ -495,7 +496,7 @@ void QtMainWindow::resetZoom()
void QtMainWindow::switchColorScheme()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "./data/color_schemes", "XML Files (*.xml)");
QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), (ResourcePaths::getColorSchemesPath()).c_str(), "XML Files (*.xml)");
if (!fileName.isEmpty())
{
+4 -3
View File
@@ -11,6 +11,7 @@
#include "qt/utility/QtDeviceScaledPixmap.h"
#include "qt/utility/utilityQt.h"
#include "utility/messaging/type/MessageInterruptTasks.h"
#include "utility/ResourcePaths.h"
QtSettingsWindow::QtSettingsWindow(QWidget *parent, int displacement)
: QWidget(parent, Qt::Dialog | Qt::FramelessWindowHint)
@@ -119,14 +120,14 @@ void QtSettingsWindow::mouseReleaseEvent(QMouseEvent *event)
void QtSettingsWindow::setupForm()
{
QtDeviceScaledPixmap coati_logo("data/gui/startscreen/logo_blurry.png");
QtDeviceScaledPixmap coati_logo((ResourcePaths::getGuiPath() + "startscreen/logo_blurry.png").c_str());
coati_logo.scaleToWidth(400);
QLabel* coatiLogoLabel = new QLabel(m_window);
coatiLogoLabel->setPixmap(coati_logo.pixmap());
coatiLogoLabel->resize(coati_logo.width(), coati_logo.height());
coatiLogoLabel->move(100, 100);
setStyleSheet(utility::getStyleSheet("data/gui/setting_window/window.css").c_str());
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "setting_window/window.css").c_str());
QVBoxLayout* windowLayout = new QVBoxLayout();
windowLayout->setContentsMargins(25, 30, 25, 20);
@@ -169,7 +170,7 @@ void QtSettingsWindow::populateForm(QFormLayout* layout)
void QtSettingsWindow::addLogo()
{
QtDeviceScaledPixmap coatiLogo("data/gui/startscreen/logo.png");
QtDeviceScaledPixmap coatiLogo((ResourcePaths::getGuiPath() + "startscreen/logo.png").c_str());
coatiLogo.scaleToWidth(200);
QLabel* coatiLogoLabel = new QLabel(this);
+4 -2
View File
@@ -6,6 +6,8 @@
#include "qt/utility/QtDeviceScaledPixmap.h"
#include "utility/ResourcePaths.h"
namespace
{
class InitThread : public QThread
@@ -23,11 +25,11 @@ QtSplashScreen::QtSplashScreen(const QPixmap &pixmap, Qt::WindowFlags f)
: QSplashScreen(pixmap, f)
, m_state(0)
{
QtDeviceScaledPixmap foreground("data/gui/splash_white.png");
QtDeviceScaledPixmap foreground((ResourcePaths::getGuiPath() + "splash_white.png").c_str());
foreground.scaleToHeight(pixmap.size().height() * 0.8);
m_foreground = foreground.pixmap();
QtDeviceScaledPixmap background("data/gui/splash_blue.png");
QtDeviceScaledPixmap background((ResourcePaths::getGuiPath() + "splash_blue.png").c_str());
background.scaleToHeight(pixmap.size().height() * 0.9);
m_background = background.pixmap();
}
+3 -2
View File
@@ -7,6 +7,7 @@
#include "settings/ApplicationSettings.h"
#include "utility/file/FileSystem.h"
#include "utility/messaging/type/MessageLoadProject.h"
#include "utility/ResourcePaths.h"
#include "qt/utility/QtDeviceScaledPixmap.h"
#include "qt/utility/utilityQt.h"
@@ -33,7 +34,7 @@ QtStartScreen::QtStartScreen(QWidget *parent)
void QtStartScreen::setup()
{
setStyleSheet(utility::getStyleSheet("data/gui/startscreen/startscreen.css").c_str());
setStyleSheet(utility::getStyleSheet(ResourcePaths::getGuiPath() + "startscreen/startscreen.css").c_str());
addLogo();
@@ -57,7 +58,7 @@ void QtStartScreen::setup()
recentProjectsLabel->setObjectName("recentLabel");
int position = 290;
QIcon cpp_icon("data/gui/startscreen/icon_cpp.png");
QIcon cpp_icon((ResourcePaths::getGuiPath() + "startscreen/icon_cpp.png").c_str());
std::vector<FilePath> recentProjects = ApplicationSettings::getInstance()->getRecentProjects();
for (size_t i = 0; i < recentProjects.size() && i < ApplicationSettings::MaximalAmountOfRecentProjects; i++)
{
+3 -1
View File
@@ -5,6 +5,8 @@
#include "utility/logging/ConsoleLogger.h"
#include "utility/logging/FileLogger.h"
#include "utility/logging/LogManager.h"
#include "utility/AppPath.h"
#include "utility/ResourcePaths.h"
#include "utility/Version.h"
#include "Application.h"
@@ -29,7 +31,7 @@ void init()
FileLogger::setFilePath(logPath);
LogManager::getInstance()->addLogger(fileLogger);
utility::loadFontsFromDirectory("data/fonts", ".otf");
utility::loadFontsFromDirectory(ResourcePaths::getFontsPath(), ".otf");
}
int main(int argc, char *argv[])