Skip to content

Commit

Permalink
Added config page to linux setting dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBrownDeveloper authored and gregory38 committed Jan 3, 2017
1 parent b8a84d1 commit 248ad0d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 9 deletions.
29 changes: 29 additions & 0 deletions plugins/GSdx/GSLinuxDialog.cpp
Expand Up @@ -449,6 +449,29 @@ void populate_record_table(GtkWidget* record_table)
InsertWidgetInTable(record_table , out_dir_label , out_dir);
}

void populate_osd_table(GtkWidget* osd_table)
{
GtkWidget* fontname_label = left_label("Font:");
GtkWidget* fontname_file = CreateFileChooser(GTK_FILE_CHOOSER_ACTION_OPEN, "Select a font", "osd_fontname");
GtkWidget* fontsize_label = left_label("Size:");
GtkWidget* fontsize_text = CreateSpinButton(1, 100, "osd_fontsize");
GtkWidget* transparency_label = left_label("Transparency:");
GtkWidget* transparency_slide = CreateScale("osd_transparency");
GtkWidget* log_check = CreateCheckBox("Enable Log", "osd_log_enabled");
GtkWidget* log_speed_label = left_label("Speed:");
GtkWidget* log_speed_text = CreateSpinButton(2, 10, "osd_log_speed");
GtkWidget* monitor_check = CreateCheckBox("Enable Monitor", "osd_monitor_enabled");
GtkWidget* indicator_check = CreateCheckBox("Enable Indicator", "osd_indicator_enabled");

InsertWidgetInTable(osd_table , fontname_label , fontname_file);
InsertWidgetInTable(osd_table , fontsize_label , fontsize_text);
InsertWidgetInTable(osd_table , transparency_label , transparency_slide);
InsertWidgetInTable(osd_table , log_check);
InsertWidgetInTable(osd_table , log_speed_label, log_speed_text);
InsertWidgetInTable(osd_table , monitor_check);
InsertWidgetInTable(osd_table , indicator_check);
}

bool RunLinuxDialog()
{
GtkWidget *dialog;
Expand All @@ -468,6 +491,7 @@ bool RunLinuxDialog()
GtkWidget* central_box = gtk_vbox_new(false, 5);
GtkWidget* advanced_box = gtk_vbox_new(false, 5);
GtkWidget* debug_box = gtk_vbox_new(false, 5);
GtkWidget* osd_box = gtk_vbox_new(false, 5);

// Grab a logo, to make things look nice.
GdkPixbuf* logo_pixmap = gdk_pixbuf_from_pixdata(&gsdx_ogl_logo, false, NULL);
Expand All @@ -486,6 +510,8 @@ bool RunLinuxDialog()
GtkWidget* record_table = CreateTableInBox(debug_box , "Recording Settings" , 4 , 3);
GtkWidget* debug_table = CreateTableInBox(debug_box , "OpenGL / GSdx Debug Settings" , 6 , 3);

GtkWidget* osd_table = CreateTableInBox(osd_box , NULL , 6 , 2);

// Populate all the tables
populate_main_table(main_table);

Expand All @@ -499,11 +525,14 @@ bool RunLinuxDialog()
populate_debug_table(debug_table);
populate_record_table(record_table);

populate_osd_table(osd_table);

// Handle some nice tab
GtkWidget* notebook = gtk_notebook_new();
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), central_box , gtk_label_new("Global Settings"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), advanced_box, gtk_label_new("Advanced Settings"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), debug_box , gtk_label_new("Debug/Recording Settings"));
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), osd_box , gtk_label_new("On Screen Display"));

// Put everything in the big box.
gtk_container_add(GTK_CONTAINER(main_box), notebook);
Expand Down
19 changes: 10 additions & 9 deletions plugins/GSdx/GSdx.cpp
Expand Up @@ -301,26 +301,27 @@ void GSdxApp::Init()
m_default_configuration["extrathreads_height"] = "4";
m_default_configuration["filter"] = "2";
m_default_configuration["force_texture_clear"] = "0";
#ifdef _WIN32
m_default_configuration["fontname"] = "C:\\Windows\\Fonts\\tahoma.ttf";
#else
m_default_configuration["fontname"] = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf";
#endif
m_default_configuration["fontsize"] = "48";
m_default_configuration["fxaa"] = "0";
m_default_configuration["indicator_enabled"] = "0";
m_default_configuration["interlace"] = "7";
m_default_configuration["large_framebuffer"] = "1";
m_default_configuration["linear_present"] = "1";
m_default_configuration["log_enabled"] = "1";
m_default_configuration["MaxAnisotropy"] = "0";
m_default_configuration["mipmap"] = "1";
m_default_configuration["mipmap_hw"] = "0";
m_default_configuration["ModeHeight"] = "480";
m_default_configuration["ModeWidth"] = "640";
m_default_configuration["monitor_enabled"] = "0";
m_default_configuration["NTSC_Saturation"] = "1";
m_default_configuration["ocldev"] = "";
#ifdef _WIN32
m_default_configuration["osd_fontname"] = "C:\\Windows\\Fonts\\tahoma.ttf";
#else
m_default_configuration["osd_fontname"] = "/usr/share/fonts/truetype/freefont/FreeSerif.ttf";
#endif
m_default_configuration["osd_fontsize"] = "48";
m_default_configuration["osd_indicator_enabled"] = "0";
m_default_configuration["osd_log_enabled"] = "1";
m_default_configuration["osd_log_speed"] = "6";
m_default_configuration["osd_monitor_enabled"] = "0";
m_default_configuration["osd_transparency"] = "50";
m_default_configuration["override_geometry_shader"] = "-1";
m_default_configuration["override_GL_ARB_clear_texture"] = "-1";
Expand Down

0 comments on commit 248ad0d

Please sign in to comment.