44 lines
1020 B
Python
44 lines
1020 B
Python
import argparse
|
|
import sys
|
|
|
|
import gi
|
|
|
|
gi.require_version("Gtk", "4.0")
|
|
gi.require_version("Adw", "1")
|
|
|
|
from gi.repository import Adw, Gio, Gtk
|
|
|
|
from .ui.window import InstallerWindow
|
|
|
|
|
|
class IridiumInstallerApp(Adw.Application):
|
|
def __init__(self, mock_mode=False):
|
|
super().__init__(
|
|
application_id="org.iridium.Installer",
|
|
flags=Gio.ApplicationFlags.FLAGS_NONE,
|
|
)
|
|
self.mock_mode = mock_mode
|
|
|
|
def do_activate(self):
|
|
win = self.props.active_window
|
|
if not win:
|
|
win = InstallerWindow(application=self, mock_mode=self.mock_mode)
|
|
win.present()
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description="Iridium OS Installer")
|
|
parser.add_argument(
|
|
"--mock",
|
|
action="store_true",
|
|
help="Run in mock mode (no actual changes to disk)",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
app = IridiumInstallerApp(mock_mode=args.mock)
|
|
return app.run(sys.argv)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|