-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
155 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,20 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<schemalist gettext-domain="lapel"> | ||
<schema id="org.dithernet.lapel" path="/org/dithernet/lapel/"> | ||
<key name="websocket-address" type="s"> | ||
<default>"0.0.0.0"</default> | ||
<summary>Websocket address</summary> | ||
<description> | ||
Websocket address used when connecting to Mycroft. | ||
</description> | ||
</key> | ||
|
||
<key name="websocket-port" type="i"> | ||
<default>8181</default> | ||
<summary>Websocket port</summary> | ||
<description> | ||
Websocket port used when connecting to Mycroft. | ||
</description> | ||
</key> | ||
</schema> | ||
</schemalist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<interface> | ||
<requires lib="gtk" version="4.0"/> | ||
<requires lib="libadwaita" version="1.0"/> | ||
<template class="LapelPreferences" parent="AdwPreferencesWindow"> | ||
<child> | ||
<object class="AdwPreferencesPage"> | ||
<property name="icon_name">preferences-window-layout-symbolic</property> | ||
<property name="title">Assistant</property> | ||
|
||
<child> | ||
<object class="AdwPreferencesGroup"> | ||
<property name="title" translatable="yes">Connection</property> | ||
|
||
<child> | ||
<object class="AdwActionRow"> | ||
<property name="title" translatable="yes">Websocket address</property> | ||
<property name="subtitle" translatable="yes">Address and port to use when connecting to Mycroft's websocket. You will need to restart Assistant before the changes take effect.</property> | ||
|
||
<child> | ||
<object class="GtkBox"> | ||
<property name="valign">center</property> | ||
<style> | ||
<class name="linked"/> | ||
</style> | ||
|
||
<child> | ||
<object class="GtkEntry" id="ws_address_entry"> | ||
<property name="placeholder-text">0.0.0.0</property> | ||
<signal name="changed" handler="set_address"/> | ||
</object> | ||
</child> | ||
|
||
<child> | ||
<object class="GtkEntry" id="ws_port_entry"> | ||
<property name="input-purpose">digits</property> | ||
<property name="max-length">5</property> | ||
<property name="max-width-chars">5</property> | ||
<property name="placeholder-text">8181</property> | ||
<signal name="changed" handler="set_port"/> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</object> | ||
</child> | ||
</template> | ||
</interface> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
data/org.dithernet.lapel.desktop.in | ||
data/org.dithernet.lapel.appdata.xml.in | ||
data/org.dithernet.lapel.gschema.xml | ||
data/ui/window.ui | ||
data/ui/assistant.ui | ||
data/ui/preferences.ui | ||
data/ui/window.ui | ||
src/window.py | ||
src/skill.py | ||
src/types/skill.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# coding: utf-8 | ||
""" | ||
Provides the configuration variable for setting up Assistant | ||
""" | ||
from gi.repository import Gio | ||
|
||
config = Gio.Settings.new('org.dithernet.lapel') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ configure_file( | |
|
||
lapel_sources = [ | ||
'__init__.py', | ||
'config.py', | ||
'daemon.py', | ||
'window.py' | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# coding: utf-8 | ||
""" | ||
Code for the preferences window. | ||
""" | ||
from gi.repository import Adw, Gtk | ||
|
||
from ..config import config | ||
|
||
@Gtk.Template(resource_path='/org/dithernet/lapel/ui/preferences.ui') | ||
class LapelPreferences(Adw.PreferencesWindow): | ||
"""Preference window for Assistant.""" | ||
__gtype_name__ = 'LapelPreferences' | ||
|
||
ws_address_entry = Gtk.Template.Child() | ||
ws_port_entry = Gtk.Template.Child() | ||
|
||
def __init__(self): | ||
"""Initializes the preferences.""" | ||
super().__init__() | ||
|
||
self.ws_address_entry.set_text(config['websocket-address']) | ||
self.ws_port_entry.set_text(str(config['websocket-port'])) | ||
|
||
@Gtk.Template.Callback() | ||
def set_address(self, entry, *args): | ||
config['websocket-address'] = entry.get_text() | ||
|
||
@Gtk.Template.Callback() | ||
def set_port(self, entry, *args): | ||
config['websocket-port'] = int(entry.get_text()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters