~ubuntu-branches/ubuntu/karmic/photoprint/karmic

« back to all changes in this revision

Viewing changes to pp_menu_help.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501163213-ni1933khtg9fdvn5
Tags: 0.3.5-2
Move to unstable.

Show diffs side-by-side

added added

removed removed

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