# 需要导入模块: from gi.repository import Gtk [as 别名]
# 或者: from gi.repository.Gtk import Statusbar [as 别名]
def __init__(self, parent, application):
"""
:param parent: The parent window for this object.
:type parent: :py:class:`Gtk.Window`
:param application: The main client application instance.
:type application: :py:class:`Gtk.Application`
"""
super(MailSenderTab, self).__init__()
self.parent = parent
self.application = application
self.config = application.config
self.box = Gtk.Box()
self.box.set_property('orientation', Gtk.Orientation.VERTICAL)
self.box.show()
self.label = Gtk.Label(label='Send Messages')
"""The :py:class:`Gtk.Label` representing this tabs name."""
self.notebook = Gtk.Notebook()
""" The :py:class:`Gtk.Notebook` for holding sub-tabs."""
self.notebook.connect('switch-page', self.signal_notebook_switch_page)
self.notebook.set_scrollable(True)
self.box.pack_start(self.notebook, True, True, 0)
self.status_bar = Gtk.Statusbar()
self.status_bar.show()
self.box.pack_end(self.status_bar, False, False, 0)
self.tabs = utilities.FreezableDict()
"""A dict object holding the sub tabs managed by this object."""
current_page = self.notebook.get_current_page()
self.last_page_id = current_page
config_tab = MailSenderConfigurationTab(self.application)
self.tabs['config'] = config_tab
self.notebook.append_page(config_tab.box, config_tab.label)
edit_tab = MailSenderEditTab(self.application)
self.tabs['edit'] = edit_tab
self.notebook.append_page(edit_tab.box, edit_tab.label)
preview_tab = MailSenderPreviewTab(self.application)
self.tabs['preview'] = preview_tab
self.notebook.append_page(preview_tab.box, preview_tab.label)
send_messages_tab = MailSenderSendTab(self.application)
self.tabs['send_messages'] = send_messages_tab
self.notebook.append_page(send_messages_tab.box, send_messages_tab.label)
self.tabs.freeze()
for tab in self.tabs.values():
tab.box.show()
self.notebook.show()
self.application.connect('campaign-set', self.signal_kpc_campaign_set)