26
26
#include " ../vkconfig_core/alert.h"
27
27
28
28
#include < QFileDialog>
29
+ #include < QDesktopServices>
29
30
30
31
TabApplications::TabApplications (MainWindow &window, std::shared_ptr<Ui::MainWindow> ui)
31
32
: Tab(TAB_APPLICATIONS, window, ui), _launch_application(nullptr ) {
@@ -36,6 +37,7 @@ TabApplications::TabApplications(MainWindow &window, std::shared_ptr<Ui::MainWin
36
37
this ->ui ->launch_options_remove ->setIcon (::Get (::ICON_OPTIONS_REMOVE));
37
38
this ->ui ->launch_options_dir_button ->setIcon (::Get (::ICON_FOLDER_SEARCH));
38
39
this ->ui ->launch_options_log_button ->setIcon (::Get (::ICON_FILE_SEARCH));
40
+ this ->ui ->launch_options_log_open ->setIcon (::Get (::ICON_FILE_EXPORT));
39
41
40
42
this ->connect (this ->ui ->launch_executable_list , SIGNAL (currentIndexChanged (int )), this ,
41
43
SLOT (on_launch_executable_list_activated (int )));
@@ -62,6 +64,7 @@ TabApplications::TabApplications(MainWindow &window, std::shared_ptr<Ui::MainWin
62
64
this ->connect (this ->ui ->launch_options_log_edit , SIGNAL (textEdited (QString)), this ,
63
65
SLOT (on_launch_options_log_textEdited (QString)));
64
66
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 ()));
65
68
66
69
this ->connect (this ->ui ->launch_clear_at_launch , SIGNAL (toggled (bool )), this , SLOT (on_launch_clear_at_launch_toggled (bool )));
67
70
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) {
89
92
this ->ui ->launch_executable_remove ->setEnabled (!configurator.executables .Empty ());
90
93
this ->ui ->launch_button ->setEnabled (!configurator.executables .Empty ());
91
94
95
+ const Executable *executable = configurator.executables .GetActiveExecutable ();
96
+ const ExecutableOptions *options = executable->GetActiveOptions ();
97
+
92
98
if (mode == UPDATE_REBUILD_UI) {
93
99
// Rebuild list of applications
94
100
ui->launch_executable_list ->blockSignals (true );
@@ -356,6 +362,19 @@ void TabApplications::on_launch_options_log_pressed() {
356
362
}
357
363
}
358
364
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
+
359
378
void TabApplications::on_launch_clear_at_launch_toggled (bool checked) {
360
379
Configurator::Get ().executables .launcher_clear_on_launch = checked;
361
380
}
0 commit comments