Codebase list xapp / 08dea4a
mate applet: Add an about window, use more appropriate install locations, move build replacement strings to a separate imported file. Michael Webster 3 years ago
5 changed file(s) with 58 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
11 usr/bin/
22 usr/share/icons
33 usr/share/locale
4 usr/libexec/xapps
4 usr/libexec/xapps/mate-panel
55 usr/share/mate-panel/applets
66 usr/share/dbus-1/services
11
22 rm -f xapp.pot
33 touch xapp.pot
4 xgettext --language=C --keyword=_ --keyword=N_ --output=xapp.pot libxapp/*.c
4 xgettext --language=C --add-comments --keyword=_ --keyword=N_ --output=xapp.pot libxapp/*.c
5 xgettext --language=Python --add-comments --keyword=_ --join-existing --output=xapp.pot status-applets/*/*.py
56 xgettext --language=Desktop --join-existing --add-comments \
67 -k --keyword=Name --keyword=Description --output=xapp.pot status-applets/*/*.in
78
0 LOCALEDIR = "@locale@"
1 PKGVERSION = "@pkgversion@"
1111 gi.require_version('MatePanelApplet', '4.0')
1212 from gi.repository import Gtk, GdkPixbuf, Gdk, GObject, Gio, XApp, GLib, MatePanelApplet
1313
14 import applet_constants
15
1416 # Rename the process
1517 setproctitle.setproctitle('mate-xapp-status-applet')
1618
1719 # i18n
18 gettext.install("xapp", "@locale@")
19 locale.bindtextdomain("xapp", "@locale@")
20 gettext.install("xapp", applet_constants.LOCALEDIR)
21 locale.bindtextdomain("xapp", applet_constants.LOCALEDIR)
2022 locale.textdomain("xapp")
2123
2224 ICON_SIZE_REDUCTION = 2
235237 self.applet.set_can_focus(False)
236238 self.applet.set_background_widget(self.applet)
237239
240 self.add_about()
241
238242 button_css = Gtk.CssProvider()
239243
240244 if button_css.load_from_data(statusicon_css_string.encode()):
245249
246250 self.indicators = {}
247251 self.monitor = None
252
253 def add_about(self):
254 group = Gtk.ActionGroup(name="xapp-status-applet-group")
255 group.set_translation_domain("xapp")
256
257 about_action = Gtk.Action(name="ShowAbout",
258 icon_name="info",
259 label=_("About"),
260 visible=True)
261
262 about_action.connect("activate", self.show_about)
263 group.add_action(about_action)
264
265 xml = '\
266 <menuitem name="ShowDesktopAboutItem" action="ShowAbout"/> \
267 '
268
269 self.applet.setup_menu(xml, group)
270
271 def show_about(self, action, data=None):
272 dialog = Gtk.AboutDialog.new()
273
274 dialog.set_program_name("XApp Status Applet")
275 dialog.set_version(applet_constants.PKGVERSION)
276 dialog.set_license_type(Gtk.License.GPL_3_0)
277 dialog.set_website("https://github.com/linuxmint/xapps")
278 dialog.set_logo_icon_name("panel-applets")
279 dialog.set_comments(_("An applet for displaying XApp application status icons"))
280
281 dialog.run()
282 dialog.destroy()
248283
249284 def on_applet_realized(self, widget, data=None):
250285 self.indicator_box = Gtk.Box(visible=True)
11
22 conf = configuration_data()
33 conf.set('locale', join_paths(get_option('prefix'), get_option('localedir')))
4 conf.set('pkgversion', meson.project_version())
45
5 applet_file = configure_file(
6 input : 'mate-xapp-status-applet.py',
7 output: 'mate-xapp-status-applet.py',
6 # Put replacements in a separate file, and import the file into the applet.
7 # This is mainly to make testing/dev easier - if you put the conf replacement
8 # strings inside the applet itself, you have to build each time to get a valid
9 # file (with all replacements made). With this, you can just copy from source,
10 # and your replacements are already there in this file.
11 constants_file = configure_file(
12 input : 'applet_constants.py.in',
13 output: 'applet_constants.py',
814 configuration: conf,
915 )
1016
11 install_data(applet_file,
12 install_dir: join_paths(get_option('libexecdir'), 'xapps')
17 libexec_files = [
18 constants_file,
19 'mate-xapp-status-applet.py'
20 ]
21
22 install_data(libexec_files,
23 install_dir: join_paths(get_option('libexecdir'), 'xapps', 'mate-panel')
1324 )
1425
1526 ## DBus service file