From 052a609f37450380b0bb20cddb6d5b2112c81417 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Wed, 6 Jun 2012 19:03:23 +0200 Subject: implemented About dialog * some values are set in the Glade-UI definition (license text, copyright, authors) * others are set in main() using Autoconf-defined macros to avoid redundancies --- src/default.ui | 42 ++++++++++++++++++++++++++++++++++++++++++ src/experiment-player.h | 2 ++ src/main.c | 21 +++++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/src/default.ui b/src/default.ui index 6d49350..e8496d6 100644 --- a/src/default.ui +++ b/src/default.ui @@ -129,6 +129,7 @@ True True True + @@ -504,4 +505,45 @@ audio-volume-medium True gtk-directory + + 5 + False + center-on-parent + True + dialog + True + True + player_window + Copyright (C) 2012 Otto-von-Guericke-Universität Magdeburg + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. + Jens Lammert <jens.lammert@st.ovgu.de> +Robin Haberkorn <robin.haberkorn@st.ovgu.de> + Jens Lammert <jens.lammert@st.ovgu.de> +Robin Haberkorn <robin.haberkorn@st.ovgu.de> + True + + + True + 2 + + + + + + True + end + + + False + end + 0 + + + + + diff --git a/src/experiment-player.h b/src/experiment-player.h index e3a2a19..9bbe592 100644 --- a/src/experiment-player.h +++ b/src/experiment-player.h @@ -16,6 +16,8 @@ gboolean load_transcript_file(const gchar *file); void show_message_dialog_gerror(GError *err); +extern GtkWidget *about_dialog; + extern GtkWidget *player_widget, *controls_hbox, *scale_widget, diff --git a/src/main.c b/src/main.c index 22e7266..6594e24 100644 --- a/src/main.c +++ b/src/main.c @@ -29,6 +29,8 @@ static inline void button_image_set_from_stock(GtkButton *widget, const gchar *name); +GtkWidget *about_dialog; + GtkWidget *player_widget, *controls_hbox, *scale_widget, @@ -53,6 +55,14 @@ gchar *current_filename = NULL; * NOTE: for some strange reason the parameters are switched */ +void +help_menu_about_item_activate_cb(GtkWidget *widget, + gpointer data __attribute__((unused))) +{ + gtk_dialog_run(GTK_DIALOG(widget)); + gtk_widget_hide(widget); +} + void playpause_button_clicked_cb(GtkWidget *widget, gpointer data) { @@ -276,6 +286,7 @@ main(int argc, char *argv[]) gdk_threads_init(); gtk_init(&argc, &argv); + g_set_prgname(PACKAGE_NAME); config_init_key_file(); @@ -284,6 +295,8 @@ main(int argc, char *argv[]) gtk_builder_add_from_file(builder, DEFAULT_UI, NULL); gtk_builder_connect_signals(builder, NULL); + BUILDER_INIT(builder, about_dialog); + BUILDER_INIT(builder, player_widget); BUILDER_INIT(builder, controls_hbox); BUILDER_INIT(builder, scale_widget); @@ -310,6 +323,14 @@ main(int argc, char *argv[]) g_object_unref(G_OBJECT(builder)); + /* configure about dialog */ + gtk_about_dialog_set_program_name(GTK_ABOUT_DIALOG(about_dialog), + PACKAGE_NAME); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about_dialog), + PACKAGE_VERSION); + gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about_dialog), + PACKAGE_URL); + /** @todo most of this could be done in Glade with proper catalog files */ /* connect timeline, volume button and other widgets with player widget */ adj = gtk_vlc_player_get_time_adjustment(GTK_VLC_PLAYER(player_widget)); -- cgit v1.2.3