~ubuntu-branches/ubuntu/wily/gpaste/wily

« back to all changes in this revision

Viewing changes to src/libgpaste/applet/gpaste-applet-quit.c

  • Committer: Package Import Robot
  • Author(s): Jérémy Lal
  • Date: 2015-06-19 11:05:16 UTC
  • mfrom: (6.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20150619110516-h53wz9xi9i4k3smb
Tags: 3.16.2.1-1
* Imported Upstream version 3.16.2.1 (Closes: #789255)
* gpaste-applet does not need a manpage - upstream dropped it
* Build-Depends gtk >= 3.16
* Depends gnome-shell >= 3.16
* Major API changes, bump soname to 3 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *      This file is part of GPaste.
3
3
 *
4
 
 *      Copyright 2014 Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
 
4
 *      Copyright 2014-2015 Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
5
5
 *
6
6
 *      GPaste is free software: you can redistribute it and/or modify
7
7
 *      it under the terms of the GNU General Public License as published by
17
17
 *      along with GPaste.  If not, see <http://www.gnu.org/licenses/>.
18
18
 */
19
19
 
20
 
#include "gpaste-applet-quit-private.h"
21
 
 
22
 
#include <glib/gi18n-lib.h>
23
 
 
24
 
struct _GPasteAppletQuitPrivate
 
20
#include <gpaste-applet-quit.h>
 
21
 
 
22
struct _GPasteAppletQuit
 
23
{
 
24
    GtkMenuItem parent_instance;
 
25
};
 
26
 
 
27
typedef struct
25
28
{
26
29
    GApplication *app;
27
 
};
 
30
} GPasteAppletQuitPrivate;
28
31
 
29
32
G_DEFINE_TYPE_WITH_PRIVATE (GPasteAppletQuit, g_paste_applet_quit, GTK_TYPE_MENU_ITEM)
30
33
 
31
34
static void
32
35
g_paste_applet_quit_activate (GtkMenuItem *menu_item)
33
36
{
34
 
    GPasteAppletQuitPrivate *priv = g_paste_applet_quit_get_instance_private ((GPasteAppletQuit *) menu_item);
 
37
    GPasteAppletQuitPrivate *priv = g_paste_applet_quit_get_instance_private (G_PASTE_APPLET_QUIT (menu_item));
35
38
 
36
39
    g_application_quit (priv->app);
37
40
 
66
69
    GtkWidget *self = gtk_widget_new (G_PASTE_TYPE_APPLET_QUIT,
67
70
                                      "label", _("Quit"),
68
71
                                      NULL);
69
 
    GPasteAppletQuitPrivate *priv = g_paste_applet_quit_get_instance_private ((GPasteAppletQuit *) self);
 
72
    GPasteAppletQuitPrivate *priv = g_paste_applet_quit_get_instance_private (G_PASTE_APPLET_QUIT (self));
 
73
 
70
74
    priv->app = app;
 
75
 
71
76
    return self;
72
77
}