diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-09-01 21:36:22 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-09-01 21:36:22 (GMT) |
commit | 29ddd755496589e7e1f9e38697e44d3cfe64df5e (patch) | |
tree | 3db093a9082276adb96a1ce67d175ade067c0788 /plugins/python/welcome/binary.py | |
parent | e07a541d1dea13a19a587f2b97d12ed3443f235b (diff) |
Added a welcome panel as plugin using Python.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@573 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/python/welcome/binary.py')
-rw-r--r-- | plugins/python/welcome/binary.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/plugins/python/welcome/binary.py b/plugins/python/welcome/binary.py new file mode 100644 index 0000000..a9b508d --- /dev/null +++ b/plugins/python/welcome/binary.py @@ -0,0 +1,40 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from welcome.board import SmallBoard +from gi.repository import Gtk, Gdk +import pychrysalide + + +class NewBinary(SmallBoard): + """Encourage l'ouverture d'un (premier) binaire.""" + + + def __init__(self): + """Construit le panneau avec son contenu.""" + + super(NewBinary, self).__init__() + + self._menu_item = pychrysalide.get_global_gobject('mnu_project_add_binary') + + msg = 'Analyse a new binary by clicking <a href="file:///#">here</a>.' + + desc = Gtk.Label(msg, use_markup=True, wrap=True) + desc.add_events(Gdk.EventMask.ENTER_NOTIFY_MASK) + desc.set_track_visited_links(False) + desc.connect('activate-link', self.on_link_activated) + self.add(desc) + + + def on_link_activated(self, uri, data): + """Lance l'action associée au lien représenté.""" + + self._menu_item.activate() + + return True + + + def get_location(self): + """Fournit la localisation souhaitée pour la plache.""" + + return [ 0, 0, 1, 1 ] |