-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
005e318
commit c85b4ea
Showing
7 changed files
with
20 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/****************************************************************************** | ||
* @File: config.h | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/****************************************************************************** | ||
* @File: config_loader.h | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/****************************************************************************** | ||
* @File: selection_dialog.h | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#pragma once | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,14 @@ | |
* @File: config.cpp | ||
* @Brief: Config class. | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#include "../Includes/config.h" | ||
|
||
#include <QByteArray> | ||
#include <QDebug> ///////////////// | ||
#include <QIODevice> | ||
#include <QMessageBox> | ||
#include <QRegularExpression> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* @File: config_loader.cpp | ||
* @Brief: Main window of the tool. | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#include "../Includes/config_loader.h" | ||
|
@@ -20,9 +20,11 @@ ConfigLoader::ConfigLoader(QWidget *parent) : QMainWindow(parent) | |
{ | ||
ui.setupUi(this); | ||
|
||
/* set path of folders */ | ||
assets_folder_path_ = "C:/Program Files/Engine Sim/assets/"; | ||
// assets_folder_path_ = "../assets/"; | ||
/* set absolute path of folders */ | ||
// assets_folder_path_ = "C:/Program Files/Engine Sim/assets/"; | ||
QDir temp_dir("../assets/"); | ||
assets_folder_path_ = temp_dir.absolutePath() + '/'; | ||
config_.SetRootPath(assets_folder_path_); | ||
engines_folder_path_ = assets_folder_path_ + "engines/"; | ||
themes_folder_path_ = assets_folder_path_ + "themes/"; | ||
|
||
|
@@ -48,8 +50,6 @@ ConfigLoader::ConfigLoader(QWidget *parent) : QMainWindow(parent) | |
exit(EXIT_FAILURE); | ||
} | ||
|
||
config_.SetRootPath(assets_folder_path_); | ||
|
||
/* read "main.mr" as default config */ | ||
config_.Read(); | ||
|
||
|
@@ -75,32 +75,6 @@ ConfigLoader::ConfigLoader(QWidget *parent) : QMainWindow(parent) | |
|
||
ConfigLoader::~ConfigLoader() { delete file_model_; } | ||
|
||
/* read "main.mr" file | ||
void ConfigLoader::ReadMainFile() | ||
{ | ||
QByteArray line; | ||
line.clear(); | ||
QString theme_file_name_; | ||
QRegularExpression theme_include("^import[ |\s]*\"themes/"); | ||
if (!main_file_.open(QIODevice::ReadOnly | QIODevice::Text)) | ||
QMessageBox::critical(NULL, "ERROR", "File \"main.mr\" is not accessible.", | ||
QMessageBox::Ok); | ||
else | ||
{ | ||
while (!main_file_.atEnd()) | ||
{ | ||
line = main_file_.readLine(); | ||
if (theme_include.match(line).hasMatch()) | ||
{ | ||
theme_file_path_ = assets_folder_path_ + line.split('\"')[1]; | ||
QFile theme_file(theme_file_path_); | ||
} | ||
} | ||
main_file_.close(); | ||
} | ||
} | ||
*/ | ||
|
||
/* display engine files in tree view */ | ||
void ConfigLoader::DisplayTreeView() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,11 @@ | |
* then "main.mr" will be automatically generated. | ||
* @File: main.cpp | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @What's new: | ||
* 1) Modifying theme is available.\ | ||
* 2) Add a dialog for engine files where the program can not decide\ | ||
* which is the engine node. | ||
* 1) Read old config file as default config. | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#include <QtWidgets/QApplication> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,9 +2,9 @@ | |
* @File: selection_dialog.cpp | ||
* @Brife: A dialog for users to select engine, transmission and vehicle nodes. | ||
* @Author: Gol3vka<[email protected]> | ||
* @Version: 2.0.1 | ||
* @Version: 2.1.0 | ||
* @Created date: 2022/10/21 | ||
* @Last modified date: 2022/10/29 | ||
* @Last modified date: 2022/10/31 | ||
*****************************************************************************/ | ||
|
||
#include "../Includes/selection_dialog.h" | ||
|