from .gtk import Gtk class app(Gtk.Window): def __init__(self, logger): self.logger = logger super().__init__(title = "CxNewsletter JSON creator") self.connect("destroy", Gtk.main_quit) self.content = Gtk.Grid() self.content.set_column_spacing(4) self.content.set_row_spacing(4) self.content.set_column_homogeneous(False) self.add(self.content) self.input = Gtk.FileChooserButton() self.input.set_width_chars(20) self.input.set_title("Select XLSX file") self.content.attach(self.input, 0, 0, 2, 1) input_label = Gtk.Label() input_label.set_label("Select XLSX") self.content.attach(input_label, 0, 1, 2, 1) self.output = Gtk.FileChooserButton() self.output.set_width_chars(20) self.input.set_title("Select output JSON") self.content.attach(self.output, 2, 0, 2, 1) output_label = Gtk.Label() output_label.set_label("Select JSON") self.content.attach(output_label, 2, 1, 2, 1) self.convert = Gtk.Button() self.convert.set_label("Convert") self.convert.connect("clicked", self.convert_clicked) self.content.attach(self.convert, 0, 2, 4, 1) name_column = Gtk.Label() name_column.set_width_chars(40) name_column.set_xalign(1) name_column.set_label("Select column with names and surnames") self.content.attach(name_column, 6, 0, 1, 1) self.name_column = Gtk.ComboBoxText() self.content.attach(self.name_column, 7, 0, 1, 1) email_column = Gtk.Label() email_column.set_width_chars(40) email_column.set_xalign(1) email_column.set_label("Select column with e-mails") self.content.attach(email_column, 6, 1, 1, 1) self.email_column = Gtk.ComboBoxText() self.email_column.set_popup_fixed_width(200) self.content.attach(self.email_column, 7, 1, 1, 1) phone_column = Gtk.Label() phone_column.set_width_chars(40) phone_column.set_xalign(1) phone_column.set_label("Select column with phone numbers") self.content.attach(phone_column, 6, 2, 1, 1) self.phone_column = Gtk.ComboBoxText() self.content.attach(self.phone_column, 7, 2, 1, 1) self.logger.info("App window created.") def convert_clicked(self, trigger): self.logger.info("Convert button clicked.")