Пример #1
0
    def __on_merge(self, action):
        tab = PMApp().main_window.get_tab('PropertyTab')

        if self.active_diff:
            tab.remove_notify_for(self.active_diff, self.__diff_editing)
            self.active_diff = None

        if not self.active_layer or not self.active_packets:
            return

        log.debug("Merging %d packets" % len(self.active_packets))

        self.active_diff = backend.MetaPacket(self.active_layer())
        self.session.set_active_packet(self.active_diff)

        # Now we should connect the property tree signals to our
        # but we should check if the packet edited is our or not
        # because the property manages the edit phase of multiple
        # packets in multiple changes.

        tab.register_notify_for(self.active_diff, self.__diff_editing)
Пример #2
0
    def __on_merge(self, action):
        tab = PMApp().main_window.get_tab('PropertyTab')

        if self.active_diff:
            tab.remove_notify_for(self.active_diff, self.__diff_editing)
            self.active_diff = None

        if not self.active_layer or not self.active_packets:
            return

        log.debug("Merging %d packets" % len(self.active_packets))

        self.active_diff = backend.MetaPacket(self.active_layer())
        self.session.set_active_packet(self.active_diff)

        # Now we should connect the property tree signals to our
        # but we should check if the packet edited is our or not
        # because the property manages the edit phase of multiple
        # packets in multiple changes.

        tab.register_notify_for(self.active_diff, self.__diff_editing)
Пример #3
0
    def __on_filter(self, combo):
        self.active_layer = self.combo.get_active_protocol()

        if self.active_layer:
            self.merging = True

            self.tree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)

            self.refilter()
            self.tree.set_model(self.filter_store)
        else:
            self.merging = False
            self.tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
            self.tree.set_model(self.store)

            if self.active_diff:
                tab = PMApp().main_window.get_tab('PropertyTab')
                tab.remove_notify_for(self.active_diff, self.__diff_editing)

                self.active_diff = None
                self.active_packets = []
                self.active_layer = None

                self.tree.get_selection().select_path((0, ))
Пример #4
0
    def __on_filter(self, combo):
        self.active_layer = self.combo.get_active_protocol()

        if self.active_layer:
            self.merging = True

            self.tree.get_selection().set_mode(gtk.SELECTION_MULTIPLE)

            self.refilter()
            self.tree.set_model(self.filter_store)
        else:
            self.merging = False
            self.tree.get_selection().set_mode(gtk.SELECTION_SINGLE)
            self.tree.set_model(self.store)

            if self.active_diff:
                tab = PMApp().main_window.get_tab('PropertyTab')
                tab.remove_notify_for(self.active_diff, self.__diff_editing)

                self.active_diff = None
                self.active_packets = []
                self.active_layer = None

                self.tree.get_selection().select_path((0, ))