-
Notifications
You must be signed in to change notification settings - Fork 10
/
pp_menu_help.cpp
56 lines (41 loc) · 1.35 KB
/
pp_menu_help.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
#include <gtk/gtkstock.h>
#include <gtk/gtkmain.h>
#include "config.h"
#include "pp_mainwindow.h"
#include "dialogs.h"
#include "miscwidgets/generaldialogs.h"
#include "progressbar.h"
#include "pp_menu_help.h"
#include "gettext.h"
#define _(x) gettext(x)
#define N_(x) gettext_noop(x)
using namespace std;
static void help_about(GtkAction *action,gpointer *ob)
{
pp_MainWindow *mw=(pp_MainWindow *)ob;
About_Dialog(GTK_WINDOW(mw));
}
static GtkActionEntry helpmenu_entries[] = {
{ "HelpMenu", NULL, N_("_Help") },
{ "About", NULL, N_("About..."), NULL, N_("Some information about PhotoPrint"), G_CALLBACK(help_about) },
};
static const char *helpmenu_ui_description =
"<ui>"
" <menubar name='MainMenu'>"
" <menu action='HelpMenu'>"
" <menuitem action='About'/>"
" </menu>"
" </menubar>"
"</ui>";
void BuildHelpMenu(void *userdata,GtkUIManager *ui_manager)
{
GError *error=NULL;
GtkActionGroup *action_group;
action_group = gtk_action_group_new ("HelpMenuActions");
gtk_action_group_set_translation_domain(action_group,PACKAGE);
gtk_action_group_add_actions (action_group, helpmenu_entries, G_N_ELEMENTS (helpmenu_entries), userdata);
gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
if (!gtk_ui_manager_add_ui_from_string (ui_manager, helpmenu_ui_description, -1, &error))
throw error->message;
}