From 03184de73de4adf8fcba09b8eac6b8c0a3f06aab Mon Sep 17 00:00:00 2001 From: Burt P Date: Tue, 25 Jul 2017 06:24:47 -0500 Subject: GTK3 updates * Use gtk_widget_get_window() instead of ->window cmake: * add option to build against gtk3 `-DHARDINFO_GTK3=1` * combine hardinfo-shell static library and hardinfo * disable guibench for gtk3 hardinfo/util.c: * widget_set_cursor() gtk3 changes * For now, the whole function tree_view_save_image() is disabled for gtk3. shell/shell.c: * add gtk_notebook_set_page() compatibility macro if not defined * shell_summary_add_item() fixes * Disable RANGE_GET_VALUE() RANGE_SET_VALUE() macros for GTK3. This is a nigtmare onion to try and peel. shell/callbacks.c: * gtk_about_dialog_set_name() -> gtk_about_dialog_set_program_name() after GTK+2.12. shell/loadgraph.c: * builds, but not yet functioning under gtk3 Signed-off-by: Burt P --- shell/callbacks.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'shell/callbacks.c') diff --git a/shell/callbacks.c b/shell/callbacks.c index ecf2beac..6599975b 100755 --- a/shell/callbacks.c +++ b/shell/callbacks.c @@ -161,7 +161,11 @@ void cb_about_module(GtkAction * action) gtk_window_set_transient_for(GTK_WINDOW(about), GTK_WINDOW(shell->window)); text = g_strdup_printf(_("%s Module"), sm->name); +#if GTK_CHECK_VERSION(2, 12, 0) + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about), text); +#else gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), text); +#endif g_free(text); gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), @@ -225,7 +229,13 @@ void cb_about() about = gtk_about_dialog_new(); gtk_window_set_transient_for(GTK_WINDOW(about), GTK_WINDOW(shell->window)); + +#if GTK_CHECK_VERSION(2, 12, 0) + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about), "HardInfo"); +#else gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), "HardInfo"); +#endif + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), VERSION); gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), "Copyright \302\251 2003-2016 " @@ -274,6 +284,6 @@ void cb_quit(void) do { gtk_main_quit(); } while (gtk_main_level() > 1); - + exit(0); } -- cgit v1.2.3