Skip to content

Commit c98e976

Browse files
vkconfig: Open export files
1 parent 0ed717a commit c98e976

9 files changed

+46
-28
lines changed

vkconfig_core/test/test_type_hide_message.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ TEST(test_type_hide_message, convert_type_to_bit) {
7272
}
7373

7474
TEST(test_type_hide_message, convert_specific_flags) {
75-
const std::vector<std::string> TOKENS = {"HIDE_MESSAGE_NEED_APPLICATION_RESTART",
76-
"HIDE_MESSAGE_NOTIFICATION_EXPORT_CONFIGURATION"};
75+
const std::vector<std::string> TOKENS = {"HIDE_MESSAGE_NEED_APPLICATION_RESTART", "HIDE_MESSAGE_WARN_MISSING_LAYERS_IGNORE"};
7776

7877
HideMessageFlags flags = GetHideMessageFlags(TOKENS);
7978
const std::vector<std::string>& back = GetHideMessageTokens(flags);

vkconfig_core/type_hide_message.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ const char* GetToken(HideMessageType value) {
3232
"HIDE_MESSAGE_WIDGET_SETTING_FLOAT",
3333
"HIDE_MESSAGE_WIDGET_SETTING_INT",
3434
"HIDE_MESSAGE_WIDGET_SETTING_FRAMES",
35-
"HIDE_MESSAGE_NOTIFICATION_EXPORT_CONFIGURATION",
36-
"HIDE_MESSAGE_NOTIFICATION_EXPORT_LAYERS_SETTINGS",
3735
"HIDE_MESSAGE_NOTIFICATION_LAYERS_LOADED",
3836
"HIDE_MESSAGE_NOTIFICATION_UNORDERED_LAYER",
3937
"HIDE_MESSAGE_NOTIFICATION_EXECUTABLE_ALL",

vkconfig_core/type_hide_message.h

-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ enum HideMessageType {
3030
HIDE_MESSAGE_WIDGET_SETTING_FLOAT,
3131
HIDE_MESSAGE_WIDGET_SETTING_INT,
3232
HIDE_MESSAGE_WIDGET_SETTING_FRAMES,
33-
HIDE_MESSAGE_NOTIFICATION_EXPORT_CONFIGURATION,
34-
HIDE_MESSAGE_NOTIFICATION_EXPORT_LAYERS_SETTINGS,
3533
HIDE_MESSAGE_NOTIFICATION_LAYERS_LOADED,
3634
HIDE_MESSAGE_NOTIFICATION_UNORDERED_LAYER,
3735
HIDE_MESSAGE_NOTIFICATION_EXECUTABLE_ALL,

vkconfig_gui/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
### Improvements:
99
- Add button to remove missing layers
1010
- Add loader messages only configuration
11+
- Open created files on export
12+
- Add button to open launcher log file
1113

1214
### Fixes:
1315
- Fix application arguments and environment variables splitting

vkconfig_gui/mainwindow.ui

+16
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,22 @@
13901390
</property>
13911391
</widget>
13921392
</item>
1393+
<item>
1394+
<widget class="QPushButton" name="launch_options_log_open">
1395+
<property name="maximumSize">
1396+
<size>
1397+
<width>32</width>
1398+
<height>32</height>
1399+
</size>
1400+
</property>
1401+
<property name="toolTip">
1402+
<string>Open the output log</string>
1403+
</property>
1404+
<property name="text">
1405+
<string/>
1406+
</property>
1407+
</widget>
1408+
</item>
13931409
</layout>
13941410
</item>
13951411
</layout>

vkconfig_gui/tab_applications.cpp

+19
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "../vkconfig_core/alert.h"
2727

2828
#include <QFileDialog>
29+
#include <QDesktopServices>
2930

3031
TabApplications::TabApplications(MainWindow &window, std::shared_ptr<Ui::MainWindow> ui)
3132
: Tab(TAB_APPLICATIONS, window, ui), _launch_application(nullptr) {
@@ -36,6 +37,7 @@ TabApplications::TabApplications(MainWindow &window, std::shared_ptr<Ui::MainWin
3637
this->ui->launch_options_remove->setIcon(::Get(::ICON_OPTIONS_REMOVE));
3738
this->ui->launch_options_dir_button->setIcon(::Get(::ICON_FOLDER_SEARCH));
3839
this->ui->launch_options_log_button->setIcon(::Get(::ICON_FILE_SEARCH));
40+
this->ui->launch_options_log_open->setIcon(::Get(::ICON_FILE_EXPORT));
3941

4042
this->connect(this->ui->launch_executable_list, SIGNAL(currentIndexChanged(int)), this,
4143
SLOT(on_launch_executable_list_activated(int)));
@@ -62,6 +64,7 @@ TabApplications::TabApplications(MainWindow &window, std::shared_ptr<Ui::MainWin
6264
this->connect(this->ui->launch_options_log_edit, SIGNAL(textEdited(QString)), this,
6365
SLOT(on_launch_options_log_textEdited(QString)));
6466
this->connect(this->ui->launch_options_log_button, SIGNAL(clicked()), this, SLOT(on_launch_options_log_pressed()));
67+
this->connect(this->ui->launch_options_log_open, SIGNAL(clicked()), this, SLOT(on_launch_options_log_open_pressed()));
6568

6669
this->connect(this->ui->launch_clear_at_launch, SIGNAL(toggled(bool)), this, SLOT(on_launch_clear_at_launch_toggled(bool)));
6770
this->connect(this->ui->launch_clear_log, SIGNAL(clicked()), this, SLOT(on_launch_clear_log_pressed()));
@@ -89,6 +92,9 @@ void TabApplications::UpdateUI(UpdateUIMode mode) {
8992
this->ui->launch_executable_remove->setEnabled(!configurator.executables.Empty());
9093
this->ui->launch_button->setEnabled(!configurator.executables.Empty());
9194

95+
const Executable *executable = configurator.executables.GetActiveExecutable();
96+
const ExecutableOptions *options = executable->GetActiveOptions();
97+
9298
if (mode == UPDATE_REBUILD_UI) {
9399
// Rebuild list of applications
94100
ui->launch_executable_list->blockSignals(true);
@@ -356,6 +362,19 @@ void TabApplications::on_launch_options_log_pressed() {
356362
}
357363
}
358364

365+
void TabApplications::on_launch_options_log_open_pressed() {
366+
Configurator &configurator = Configurator::Get();
367+
368+
Executable *executable = configurator.executables.GetActiveExecutable();
369+
ExecutableOptions *options = executable->GetActiveOptions();
370+
371+
if (!options->log_file.Exists()) {
372+
options->log_file.Create(true);
373+
}
374+
375+
QDesktopServices::openUrl(QUrl::fromLocalFile(options->log_file.AbsolutePath().c_str()));
376+
}
377+
359378
void TabApplications::on_launch_clear_at_launch_toggled(bool checked) {
360379
Configurator::Get().executables.launcher_clear_on_launch = checked;
361380
}

vkconfig_gui/tab_applications.h

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class TabApplications : public Tab {
5858
void on_launch_options_envs_textEdited(const QString& text);
5959
void on_launch_options_log_textEdited(const QString& text);
6060
void on_launch_options_log_pressed();
61+
void on_launch_options_log_open_pressed();
6162

6263
void on_launch_clear_at_launch_toggled(bool checked);
6364
void on_launch_clear_log_pressed();

vkconfig_gui/tab_configurations.cpp

+4-22
Original file line numberDiff line numberDiff line change
@@ -783,17 +783,8 @@ void TabConfigurations::OnContextMenuExportConfigsClicked(ListItem *item) {
783783
msg.setWindowTitle("Exporting of a Loader Configuration file failed...");
784784
msg.setText(format("Couldn't be create '%s' Loader configuration file.", selected_path.c_str()).c_str());
785785
msg.exec();
786-
} else if (!(configurator.Get(HIDE_MESSAGE_NOTIFICATION_EXPORT_CONFIGURATION))) {
787-
QMessageBox msg;
788-
msg.setIcon(QMessageBox::Information);
789-
msg.setWindowTitle("Exporting of a Loader Configuration file successful.");
790-
msg.setText(format("'%s' Loader configuration file was created.", selected_path.c_str()).c_str());
791-
msg.setCheckBox(new QCheckBox("Do not show again."));
792-
msg.exec();
793-
794-
if (msg.checkBox()->isChecked()) {
795-
configurator.Set(HIDE_MESSAGE_NOTIFICATION_EXPORT_CONFIGURATION);
796-
}
786+
} else {
787+
QDesktopServices::openUrl(QUrl::fromLocalFile(selected_path.c_str()));
797788
}
798789
}
799790

@@ -820,17 +811,8 @@ void TabConfigurations::OnContextMenuExportSettingsClicked(ListItem *item) {
820811
msg.setWindowTitle("Exporting of a layers settings file failed...");
821812
msg.setText(format("Couldn't be create '%s' layers settings file.", selected_path.c_str()).c_str());
822813
msg.exec();
823-
} else if (!(configurator.Get(HIDE_MESSAGE_NOTIFICATION_EXPORT_LAYERS_SETTINGS))) {
824-
QMessageBox msg;
825-
msg.setIcon(QMessageBox::Information);
826-
msg.setWindowTitle("Exporting of a layers Configuration file successful.");
827-
msg.setText(format("'%s' layers configuration file was created.", selected_path.c_str()).c_str());
828-
msg.setCheckBox(new QCheckBox("Do not show again."));
829-
msg.exec();
830-
831-
if (msg.checkBox()->isChecked()) {
832-
configurator.Set(HIDE_MESSAGE_NOTIFICATION_EXPORT_LAYERS_SETTINGS);
833-
}
814+
} else {
815+
QDesktopServices::openUrl(QUrl::fromLocalFile(selected_path.c_str()));
834816
}
835817
}
836818

vkconfig_gui/tab_diagnostics.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <QFileDialog>
2929
#include <QMessageBox>
3030
#include <QMenu>
31+
#include <QDesktopServices>
3132

3233
TabDiagnostics::TabDiagnostics(MainWindow &window, std::shared_ptr<Ui::MainWindow> ui) : Tab(TAB_DIAGNOSTIC, window, ui) {
3334
this->ui->diagnostic_status_text->installEventFilter(&window);
@@ -116,6 +117,8 @@ void TabDiagnostics::on_customContextMenuRequested(const QPoint &pos) {
116117
file.close();
117118

118119
configurator.last_path_status = selected_path.toStdString();
120+
121+
QDesktopServices::openUrl(QUrl::fromLocalFile(selected_path.toStdString().c_str()));
119122
}
120123
}
121124

0 commit comments

Comments
 (0)