From aa20cd566777989b6b153379731b3499f310fe6d Mon Sep 17 00:00:00 2001 From: me Date: Sun, 13 Oct 2024 09:41:01 +0000 Subject: [PATCH] place ui code in own directory --- src/application.vala | 2 +- src/audrey.gresource.xml | 6 +++--- src/meson.build | 12 ++++++------ src/{ => ui}/play_queue.blp | 2 +- src/{ => ui}/play_queue.vala | 4 ++-- src/{ => ui}/setup.blp | 2 +- src/{ => ui}/setup.vala | 4 ++-- src/{ => ui}/window.blp | 4 ++-- src/{ => ui}/window.vala | 6 +++--- 9 files changed, 21 insertions(+), 21 deletions(-) rename src/{ => ui}/play_queue.blp (97%) rename src/{ => ui}/play_queue.vala (96%) rename src/{ => ui}/setup.blp (97%) rename src/{ => ui}/setup.vala (98%) rename src/{ => ui}/window.blp (98%) rename src/{ => ui}/window.vala (98%) diff --git a/src/application.vala b/src/application.vala index 29ddd8f..ef8e1a5 100644 --- a/src/application.vala +++ b/src/application.vala @@ -21,7 +21,7 @@ public class Application : Adw.Application { public override void activate () { base.activate (); // if this.active_window not null, this isnt the primary instance - var win = this.active_window ?? new Window (this); + var win = this.active_window ?? new Ui.Window (this); win.present (); } diff --git a/src/audrey.gresource.xml b/src/audrey.gresource.xml index 54d0e3d..d4fa1ec 100644 --- a/src/audrey.gresource.xml +++ b/src/audrey.gresource.xml @@ -3,8 +3,8 @@ audrey.css gtk/help-overlay.ui - play_queue.ui - setup.ui - window.ui + ui/play_queue.ui + ui/setup.ui + ui/window.ui diff --git a/src/meson.build b/src/meson.build index 6cc684c..10c3448 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,10 +3,10 @@ audrey_sources = [ 'application.vala', 'main.vala', 'mpris.vala', - 'play_queue.vala', 'playbin.vala', - 'setup.vala', - 'window.vala', + 'ui/play_queue.vala', + 'ui/setup.vala', + 'ui/window.vala', ] audrey_deps = [ @@ -22,9 +22,9 @@ audrey_deps = [ blueprints = custom_target('blueprints', input: files( - 'play_queue.blp', - 'setup.blp', - 'window.blp', + 'ui/play_queue.blp', + 'ui/setup.blp', + 'ui/window.blp', ), output: [ 'play_queue.ui', diff --git a/src/play_queue.blp b/src/ui/play_queue.blp similarity index 97% rename from src/play_queue.blp rename to src/ui/play_queue.blp index 0a52a94..07eec39 100644 --- a/src/play_queue.blp +++ b/src/ui/play_queue.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -template $PlayQueue: Adw.NavigationPage { +template $UiPlayQueue: Adw.NavigationPage { title: _("Play queue"); Adw.ToolbarView { diff --git a/src/play_queue.vala b/src/ui/play_queue.vala similarity index 96% rename from src/play_queue.vala rename to src/ui/play_queue.vala index bae49de..f7c6bb6 100644 --- a/src/play_queue.vala +++ b/src/ui/play_queue.vala @@ -1,5 +1,5 @@ -[GtkTemplate (ui = "/eu/callcc/audrey/play_queue.ui")] -public class PlayQueue : Adw.NavigationPage { +[GtkTemplate (ui = "/eu/callcc/audrey/ui/play_queue.ui")] +public class Ui.PlayQueue : Adw.NavigationPage { public ListStore songs { get; private set; } public uint selected_index { get; set; } diff --git a/src/setup.blp b/src/ui/setup.blp similarity index 97% rename from src/setup.blp rename to src/ui/setup.blp index de0d92f..c2d2716 100644 --- a/src/setup.blp +++ b/src/ui/setup.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -template $Setup: Adw.PreferencesDialog { +template $UiSetup: Adw.PreferencesDialog { title: _("Setup"); Adw.ToolbarView { diff --git a/src/setup.vala b/src/ui/setup.vala similarity index 98% rename from src/setup.vala rename to src/ui/setup.vala index 09cd176..7b63ee3 100644 --- a/src/setup.vala +++ b/src/ui/setup.vala @@ -1,8 +1,8 @@ [CCode (cname = "sqlite3_randomness")] public extern void randomness (int N, void *P); -[GtkTemplate (ui = "/eu/callcc/audrey/setup.ui")] -public class Setup : Adw.PreferencesDialog { +[GtkTemplate (ui = "/eu/callcc/audrey/ui/setup.ui")] +public class Ui.Setup : Adw.PreferencesDialog { public string status { get; private set; default = _("Not connected"); } public bool authn_can_edit { get; private set; default = true; } diff --git a/src/window.blp b/src/ui/window.blp similarity index 98% rename from src/window.blp rename to src/ui/window.blp index 02d8b1d..4074847 100644 --- a/src/window.blp +++ b/src/ui/window.blp @@ -1,7 +1,7 @@ using Gtk 4.0; using Adw 1; -template $Window: Adw.ApplicationWindow { +template $UiWindow: Adw.ApplicationWindow { title: _("audrey"); default-width: 800; default-height: 600; @@ -81,7 +81,7 @@ paintable: bind template.playing_cover_art; name: "play_queue"; title: _("Play queue"); - child: $PlayQueue play_queue {}; + child: $UiPlayQueue play_queue {}; } } } diff --git a/src/window.vala b/src/ui/window.vala similarity index 98% rename from src/window.vala rename to src/ui/window.vala index 0c96ca3..34e380c 100644 --- a/src/window.vala +++ b/src/ui/window.vala @@ -1,10 +1,10 @@ -[GtkTemplate (ui = "/eu/callcc/audrey/window.ui")] -class Window : Adw.ApplicationWindow { +[GtkTemplate (ui = "/eu/callcc/audrey/ui/window.ui")] +class Ui.Window : Adw.ApplicationWindow { [GtkChild] private unowned Gtk.ListBox sidebar; [GtkChild] private unowned Gtk.ListBoxRow sidebar_play_queue; [GtkChild] private unowned Gtk.Stack stack; - [GtkChild] public unowned PlayQueue play_queue; + [GtkChild] public unowned Ui.PlayQueue play_queue; [GtkChild] public unowned Adw.ButtonRow shuffle_all_tracks; private Setup setup;