def __init__(self, filename=None):
Gtk.Window.__init__(self)
logging.debug("fpeditor.Editor.__init__(%s)", filename)
gu.EditorDialogBase.__init__(self, filename)
self.set_default_size(800, 600)
self.g_main_box = Gtk.VBox()
self.add(self.g_main_box)
self.g_actiongroup.add_actions([
('GoBack', Gtk.STOCK_GO_BACK, None, None, None, self.go_back),
])
self.setup_toolbar()
self.g_title_hbox = Gtk.HBox()
self.g_title_hbox.set_spacing(gu.hig.SPACE_SMALL)
self.g_title_hbox.set_border_width(gu.hig.SPACE_SMALL)
label = Gtk.Label()
label.set_markup(u"<b>%s</b>" % _("Front page title:"))
self.g_title_hbox.pack_start(label, False, False, 0)
self.g_fptitle = Gtk.Entry()
self.g_title_hbox.pack_start(self.g_fptitle, True, True, 0)
self.g_main_box.pack_start(self.g_title_hbox, False, False, 0)
# This dict maps the windows created for all pages belonging to
# the file.
self.m_page_mapping = {}
self.m_model = None
if filename:
self.load_file(filename)
else:
self.m_model = pd.Page(_("Untitled%s") % self.m_instance_number,
pd.Column())
self.set_not_modified()
self.add_page(Page(self.m_model, self))
self.clipboard.update_buttons()
self.show_all()
self.add_to_instance_dict()
self.g_fptitle.set_text(self.m_model.m_name)
self.g_fptitle.connect('changed', self.on_frontpage_title_changed)
评论列表
文章目录