From fa761a129de45c0484fdf85a9aa0e4ce3e8b7508 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Tue, 19 May 2015 11:53:56 +0200 Subject: [PATCH] gsdx-linux: add an option to enable/disable recording Avoid to kill the computer/application if the user press F12 by accident --- plugins/GSdx/GS.cpp | 6 ++++++ plugins/GSdx/GSLinuxDialog.cpp | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/plugins/GSdx/GS.cpp b/plugins/GSdx/GS.cpp index f5275ffe2c..4a5e15a761 100644 --- a/plugins/GSdx/GS.cpp +++ b/plugins/GSdx/GS.cpp @@ -823,6 +823,12 @@ EXPORT_C_(int) GSsetupRecording(int start, void* data) printf("GSdx: no s_gs for recording\n"); return 0; } +#ifdef __linux__ + if (theApp.GetConfig("capture_enabled", 0)) { + printf("GSdx: Recording is disabled\n"); + return 0; + } +#endif if(start & 1) { diff --git a/plugins/GSdx/GSLinuxDialog.cpp b/plugins/GSdx/GSLinuxDialog.cpp index e7aacee6bc..c9548b84e5 100644 --- a/plugins/GSdx/GSLinuxDialog.cpp +++ b/plugins/GSdx/GSLinuxDialog.cpp @@ -470,16 +470,16 @@ void populate_debug_table(GtkWidget* debug_table) void populate_record_table(GtkWidget* record_table) { - GtkWidget* resxy_label = gtk_label_new("Resolution:"); - GtkWidget* resx_spin = CreateSpinButton(256, 8192, "capture_resx", 1280); - GtkWidget* resy_spin = CreateSpinButton(256, 8192, "capture_resy", 1024); - + GtkWidget* capture_check = CreateCheckBox("Enable Recording (with F12)", "capture_enabled"); + GtkWidget* resxy_label = gtk_label_new("Resolution:"); + GtkWidget* resx_spin = CreateSpinButton(256, 8192, "capture_resx", 1280); + GtkWidget* resy_spin = CreateSpinButton(256, 8192, "capture_resy", 1024); GtkWidget* threads_label = gtk_label_new("Saving Threads:"); GtkWidget* threads_spin = CreateSpinButton(1, 32, "capture_threads", 4); - GtkWidget* out_dir_label = gtk_label_new("Output Directory:"); GtkWidget* out_dir = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, "Select a directory", "capture_out_dir", "/tmp"); + InsertWidgetInTable(record_table , capture_check); InsertWidgetInTable(record_table , resxy_label , resx_spin , resy_spin); InsertWidgetInTable(record_table , threads_label , threads_spin); InsertWidgetInTable(record_table , out_dir_label , out_dir);