def create_import_from_server_dialog(self, chart_list):
import_chart = None
import_dialog = Gtk.Dialog("Import from server", self, 0)
box = import_dialog.get_content_area()
content_box = Gtk.Box()
box.add(content_box)
chart_selector = Gtk.ComboBoxText()
for chart in sorted(chart_list):
chart_selector.append_text(chart)
content_box.pack_start(Gtk.Label("Choose a chart:"), True, True, 0)
content_box.pack_start(chart_selector, True, True, 0)
import_dialog.add_button('Import', Gtk.ResponseType.OK)
content_box.show_all()
response = import_dialog.run()
if response == Gtk.ResponseType.OK:
import_chart = chart_selector.get_active_text()
import_dialog.destroy()
if import_chart:
return import_chart
评论列表
文章目录