commit 603ad22c40c6d39ddd2a84b184d2a0b59e22560a
parent fc17982e386f9fa834da0faa7bc819787298e404
Author: lash <dev@holbrook.no>
Date: Sun, 31 Aug 2025 03:27:14 +0100
Hello world gui
Diffstat:
2 files changed, 66 insertions(+), 0 deletions(-)
diff --git a/gui/base.py b/gui/base.py
@@ -0,0 +1,65 @@
+import sys
+import logging
+
+import gi
+gi.require_version('Gtk', '4.0')
+gi.require_version('Adw', '1')
+from gi.repository import Gtk, Adw
+
+from ungana.ical import ICalManager
+
+logging.basicConfig(level=logging.DEBUG)
+logg = logging.getLogger()
+
+class MainWindow(Gtk.ApplicationWindow):
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+
+ self.box_main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+ self.set_child(self.box_main)
+
+ title = Gtk.Label(label="UUID")
+ self.box_main.append(title)
+ entry = Gtk.Entry()
+ entry.set_editable(False)
+ entry.set_sensitive(False)
+ entry.set_text("foo")
+ self.box_main.append(entry)
+
+ title = Gtk.Label(label="Summary")
+ self.box_main.append(title)
+ entry = Gtk.Entry()
+ self.box_main.append(entry)
+
+ title = Gtk.Label(label="Description")
+ self.box_main.append(title)
+ entry = Gtk.Entry()
+ self.box_main.append(entry)
+
+ title = Gtk.Label(label="Start")
+ self.box_main.append(title)
+ entry = Gtk.Entry(placeholder_text="YYYY-MM-DD HH:MM")
+ self.box_main.append(entry)
+
+ title = Gtk.Label(label="Duration")
+ self.box_main.append(title)
+ entry = Gtk.Entry(placeholder_text="")
+ self.box_main.append(entry)
+
+class Ungana(Adw.Application):
+ def __init__(self, *args, **kwargs):
+ super().__init__(**kwargs)
+ self.win = None
+ self.connect('activate', self.on_activate)
+
+ def on_activate(self, app):
+ logg.debug("activate")
+ self.win = MainWindow(application=app)
+ self.win.present()
+
+cal = ICalManager()
+cal.load_ical_file(sys.argv[1])
+print(cal.get_all_events(cal.calendar))
+
+app = Ungana(application_id="org.defalsify.ungana")
+app.run(None)
diff --git a/ungana/ical/__init__.py b/ungana/ical/__init__.py
@@ -0,0 +1 @@
+from .ical_manager import ICalManager