Debian Codegraph @

src/devedeng/separator.py

raw
1 # Copyright 2019 (C) Raster Software Vigo (Sergio Costas)
2 #
3 # This file is part of DeVeDe-NG
4 #
5 # DeVeDe-NG is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 3
7 # as published by the Free Software Foundation.
8 #
9 # DeVeDe-NG is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>
16
17 from gi.repository import Gtk, GObject
18 import os
19
20 import devedeng.configuration_data
21 import devedeng.interface_manager
22
23 class separator(devedeng.interface_manager.interface_manager):
24
25 __gsignals__ = {'name_changed': (GObject.SIGNAL_RUN_FIRST, None, (str,)), 'page_jump_changed': (
26 GObject.SIGNAL_RUN_FIRST, None, (bool,))}
27
28 def __init__(self):
29 self.element_type = "separator"
30 devedeng.interface_manager.interface_manager.__init__(self)
31 self.add_toggle("page_jump", False)
32 self.add_text("separator_name", _("Separator"))
33
34 def set_name(self, new_name):
35 self.separator_name = new_name
36 self.emit('name_changed', self.separator_name)
37
38 def set_page_jump(self, page_jump):
39 self.page_jump = page_jump
40 self.emit('page_jump_changed', self.page_jump)
41
42 def delete_element(self):
43 return
44
45 def store_element(self):
46 data = self.serialize()
47 data["element_type"] = "separator"
48 return data
49
50 def restore_element(self, data):
51 self.unserialize(data)