Exemplo n.º 1
0
class Application(Gtk.Application):
    def __init__(self, app_id):
        super().__init__(application_id=app_id)
        self.window = None

    def do_activate(self):
        if not self.window:
            self.window = AppWindow(application=self)
        self.window.present()
Exemplo n.º 2
0
def main():
    QApplication.setQuitOnLastWindowClosed(False)

    app = QApplication(sys.argv)
    app.setApplicationName(APP_NAME)
    app.setApplicationDisplayName(APP_NAME)

    app_window = AppWindow()
    tray_icon = init_tray_icon(app_window)
    tray_icon.show()

    return app.exec_()
Exemplo n.º 3
0
 def login(self):
     if not self.password.text() or not self.username.text():
         QMessageBox.about(self, "Error", "\nPlease fill all entries\t\n")
     else:
         try:
             login_stats = requests.get(self.URL + '/login?username='******'&password='******'status'] == True:
                 self.app_window = AppWindow(user=self.username.text())
             else:
                 QMessageBox.about(self, "Login Failed",
                                   "\nPlease try again\t\n")
         except requests.exceptions.ConnectionError:
             QMessageBox.about(self, "Conenction Error",
                               "\nDatabase is not running\t\n")
Exemplo n.º 4
0
 def do_activate(self):
     if not self.window:
         self.window = AppWindow(application=self)
     self.window.present()
Exemplo n.º 5
0
                        pilot_name += ' (' + pilot['variant'] + ')'
                    self.pilot_table[k][j][2].config(text=pilot_name)
                    self.pilot_table[k][j][0].grid()
                elif j == 2:
                    if pilot['elite_upgrade']:
                        self.pilot_table[k][j].config(text='Yes')
                    else:
                        self.pilot_table[k][j].config(text='No')
                    self.pilot_table[k][j].grid()
                elif j == 3:
                    self.pilot_table[k][j].config(
                        text=str(pilot['point_cost']))
                    self.pilot_table[k][j].grid()
            if k >= 15:
                break

    def __generate_header(self):
        self.pilot_table[0][0].config(text='PS')
        self.pilot_table[0][1].config(text='     Pilot Name')
        self.pilot_table[0][2].config(text='Elite?')
        self.pilot_table[0][3].config(text='Point Cost')


if __name__ == '__main__':
    shipId = 1
    root = tk.Tk()
    root.title(XwmDbQuery.get_ship_name(shipId))
    app = AppWindow(root)
    PilotList(app, shipId)
    root.mainloop()
Exemplo n.º 6
0
 def do_activate(self) -> None:
     window = AppWindow(self)
     window.show_all()
Exemplo n.º 7
0
 def run(self):
     self.root = tk.Tk()
     self.app = AppWindow(self.root)
     GlobalEnvironment.change_screen(
         MainMenu(GlobalEnvironment.get_master_frame()))
     self.root.mainloop()