Skip to content

Commit

Permalink
main,callbacks: add a report-bug/request-feature menu item
Browse files Browse the repository at this point in the history
Re #138
  • Loading branch information
bk138 committed Feb 26, 2024
1 parent 6d4c7f3 commit f076166
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,16 @@ void on_intro(GtkMenuItem *menuitem,
gtk_widget_show_all (assistant);
}

void on_issues(GtkMenuItem *menuitem,
gpointer user_data)
{
gtk_show_uri_on_window (NULL,
"https://github.com/bk138/gromit-mpx/issues",
GDK_CURRENT_TIME,
NULL);
}


void on_support_liberapay(GtkMenuItem *menuitem, gpointer user_data)
{
gtk_show_uri_on_window (NULL,
Expand Down
3 changes: 3 additions & 0 deletions src/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ void on_about(GtkMenuItem *menuitem,
void on_intro(GtkMenuItem *menuitem,
gpointer user_data);

void on_issues(GtkMenuItem *menuitem,
gpointer user_data);

void on_support_liberapay(GtkMenuItem *menuitem,
gpointer user_data);

Expand Down
6 changes: 6 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ void setup_main_app (GromitData *data, int argc, char ** argv)

GtkWidget* sep1_item = gtk_separator_menu_item_new();
GtkWidget* intro_item = gtk_menu_item_new_with_mnemonic(_("_Introduction"));
GtkWidget* issues_item = gtk_menu_item_new_with_mnemonic(_("_Report Bug / Request Feature"));
GtkWidget* support_item = gtk_menu_item_new_with_mnemonic(_("_Support Gromit-MPX"));
GtkWidget* about_item = gtk_menu_item_new_with_mnemonic(_("_About"));

Expand All @@ -819,6 +820,7 @@ void setup_main_app (GromitData *data, int argc, char ** argv)

gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep1_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), intro_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), issues_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), support_item);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), about_item);

Expand Down Expand Up @@ -880,6 +882,9 @@ void setup_main_app (GromitData *data, int argc, char ** argv)
g_signal_connect(G_OBJECT (intro_item), "activate",
G_CALLBACK (on_intro),
data);
g_signal_connect(G_OBJECT (issues_item), "activate",
G_CALLBACK (on_issues),
data);
g_signal_connect(G_OBJECT (about_item), "activate",
G_CALLBACK (on_about),
NULL);
Expand All @@ -901,6 +906,7 @@ void setup_main_app (GromitData *data, int argc, char ** argv)

gtk_widget_show (sep1_item);
gtk_widget_show (intro_item);
gtk_widget_show (issues_item);
gtk_widget_show (support_item);
gtk_widget_show (about_item);

Expand Down

0 comments on commit f076166

Please sign in to comment.