aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTotalCaesar659 <x24cm5b8c54q6szxw@yandex.ru>2017-08-18 00:22:35 +0300
committerLeandro Pereira <leandro@hardinfo.org>2017-09-10 08:08:46 -0700
commit9e06c19c9447431530074fe24fa2152cc8091602 (patch)
treea3343ebb51a9f8783dd8db9d56ff46565418cd49
parentb2991d74be17fbca029ddec46cd6569ec6db6ce6 (diff)
Fix compilation warning when benchmarking
-rw-r--r--modules/benchmark.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/modules/benchmark.c b/modules/benchmark.c
index 76c36ecf..857904a8 100644
--- a/modules/benchmark.c
+++ b/modules/benchmark.c
@@ -422,6 +422,27 @@ static void do_benchmark(void (*benchmark_function)(void), int entry)
bench_image = icon_cache_get_image("benchmark.png");
gtk_widget_show(bench_image);
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GtkWidget *button;
+ GtkWidget *content_area;
+ GtkWidget *hbox;
+ GtkWidget *label;
+
+ bench_dialog = gtk_dialog_new_with_buttons("",
+ NULL,
+ GTK_DIALOG_MODAL,
+ _("Cancel"),
+ GTK_RESPONSE_ACCEPT,
+ NULL);
+ content_area = gtk_dialog_get_content_area(GTK_DIALOG(bench_dialog));
+ label = gtk_label_new(_("Benchmarking. Please do not move your mouse " \
+ "or press any keys."));
+ hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
+ gtk_box_pack_start(GTK_BOX(hbox), bench_image, TRUE, TRUE, 5);
+ gtk_box_pack_end(GTK_BOX(hbox), label, TRUE, TRUE, 5);
+ gtk_container_add(GTK_CONTAINER (content_area), hbox);
+ gtk_widget_show_all(bench_dialog);
+#else
bench_dialog = gtk_message_dialog_new(GTK_WINDOW(shell_get_main_shell()->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_INFO,
@@ -432,6 +453,7 @@ static void do_benchmark(void (*benchmark_function)(void), int entry)
gtk_dialog_add_buttons(GTK_DIALOG(bench_dialog),
_("Cancel"), GTK_RESPONSE_ACCEPT, NULL);
gtk_message_dialog_set_image(GTK_MESSAGE_DIALOG(bench_dialog), bench_image);
+#endif
while (gtk_events_pending()) {
gtk_main_iteration();
@@ -720,4 +742,3 @@ gchar **hi_module_get_dependencies(void)
return deps;
}
-