mv clan-vm-manager to its own package

This commit is contained in:
Jörg Thalheim
2023-11-23 13:56:25 +01:00
parent 832c41df7e
commit a838c4da17
5 changed files with 2 additions and 6 deletions

View File

@@ -0,0 +1,11 @@
import argparse
from typing import Callable, Optional
start_app: Optional[Callable] = None
from .app import start_app
def register_parser(parser: argparse.ArgumentParser) -> None:
parser = argparse.ArgumentParser(description="clan-vm-manager")
parser.set_defaults(func=start_app)

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<object class="GtkApplicationWindow" id="main-window">
<property name="can-focus">False</property>
<child>
<object class="GtkFixed">
<property name="name">asdasd</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<child>
<object class="GtkButton" id="help_button">
<property name="label" translatable="yes">May I help you?</property>
<property name="name">asdasd</property>
<property name="width-request">100</property>
<property name="height-request">80</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>
<property name="image-position">top</property>
<signal name="clicked" handler="on_help_button_clicked" object="coffee_label" swapped="no"/>
</object>
<packing>
<property name="x">21</property>
<property name="y">21</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="coffee_label">
<property name="width-request">100</property>
<property name="height-request">80</property>
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Get me some coffe! </property>
<property name="width-chars">0</property>
</object>
<packing>
<property name="x">178</property>
<property name="y">120</property>
</packing>
</child>
<style>
<class name="asdasd"/>
</style>
</object>
</child>
</object>
</interface>

View File

@@ -0,0 +1,19 @@
# !/usr/bin/env python3
import argparse # noqa
from pathlib import Path # noqa
import gi # noqa
gi.require_version("Gtk", "3.0") # noqa
from gi.repository import Gtk # noqa
def start_app(args: argparse.Namespace) -> None:
builder = Gtk.Builder()
glade_file = Path(__file__).parent / "app.glade"
builder.add_from_file(str(glade_file))
window = builder.get_object("main-window")
window.show_all()
Gtk.main()