summaryrefslogtreecommitdiff
path: root/plugins/python/welcome/binary.py
blob: a9b508d0b37c1d0d9890189f5fe643b721ea9160 (plain)
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
#!/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 ]