Skip to content

Commit 3090f1c

Browse files
committed
Refactor UI components: remove search bar, integrate search functionality into HostList; add WelcomeView; enhance HostEditor with new buttons for adding, duplicating, and deleting hosts; update main window layout and navigation for improved user experience.
1 parent 17619d7 commit 3090f1c

19 files changed

+682
-353
lines changed

Formula/ssh-studio.rb

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
class SshStudio < Formula
2+
desc "GTK4 desktop app to edit and validate your ~/.ssh/config"
3+
homepage "https://github.com/BuddySirJava/SSH-Studio"
4+
url "https://github.com/BuddySirJava/SSH-Studio/archive/refs/tags/1.2.3.tar.gz"
5+
sha256 "8fc311467822c8c858400288386b023b9008bb2f5992966b57052ddd197c9cba"
6+
license "GPL-3.0-or-later"
7+
head "https://github.com/BuddySirJava/SSH-Studio.git", branch: "master"
8+
9+
depends_on "meson" => :build
10+
depends_on "ninja" => :build
11+
depends_on "pkg-config" => :build
12+
13+
depends_on "[email protected]"
14+
depends_on "glib"
15+
depends_on "gtk4"
16+
depends_on "libadwaita"
17+
depends_on "pygobject3"
18+
19+
resource "blueprint-compiler" do
20+
url "https://gitlab.gnome.org/GNOME/blueprint-compiler/-/archive/v0.18.0/blueprint-compiler-v0.18.0.tar.gz"
21+
sha256 "703c7ccd23cb6f77a8fe9c8cae0f91de9274910ca953de77135b6e79dbff1fc3"
22+
end
23+
24+
def install
25+
resource("blueprint-compiler").stage do
26+
system "meson", "setup", "build", "--prefix=#{libexec}", "--buildtype=release"
27+
system "meson", "compile", "-C", "build"
28+
system "meson", "install", "-C", "build"
29+
end
30+
ENV.prepend_path "PATH", libexec/"bin"
31+
32+
ENV["PYTHON"] = Formula["[email protected]"].opt_bin/"python3"
33+
34+
system "meson", "setup", "build", *std_meson_args
35+
system "meson", "compile", "-C", "build"
36+
system "meson", "install", "-C", "build"
37+
38+
app_root = prefix/"Applications/SSH Studio.app/Contents"
39+
(app_root/"MacOS").mkpath
40+
(app_root/"Resources").mkpath
41+
42+
(app_root/"Info.plist").write <<~PLIST
43+
<?xml version="1.0" encoding="UTF-8"?>
44+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
45+
<plist version="1.0">
46+
<dict>
47+
<key>CFBundleName</key><string>SSH Studio</string>
48+
<key>CFBundleIdentifier</key><string>io.github.BuddySirJava.SSH-Studio</string>
49+
<key>CFBundleVersion</key><string>#{version}</string>
50+
<key>CFBundleShortVersionString</key><string>#{version}</string>
51+
<key>CFBundleExecutable</key><string>ssh-studio</string>
52+
<key>CFBundlePackageType</key><string>APPL</string>
53+
<key>LSMinimumSystemVersion</key><string>11.0</string>
54+
<key>LSApplicationCategoryType</key><string>public.app-category.developer-tools</string>
55+
</dict>
56+
</plist>
57+
PLIST
58+
59+
(app_root/"MacOS/ssh-studio").write <<~SH
60+
#!/bin/bash
61+
exec "#{Formula["[email protected]"].opt_bin}/python3" -m ssh_studio.main "$@"
62+
SH
63+
chmod 0755, (app_root/"MacOS/ssh-studio")
64+
end
65+
66+
def caveats
67+
<<~EOS
68+
A minimal app bundle was installed at:
69+
#{opt_prefix}/Applications/SSH Studio.app
70+
71+
To add a Desktop shortcut:
72+
ln -sf "#{opt_prefix}/Applications/SSH Studio.app" "$HOME/Desktop/SSH Studio.app"
73+
74+
To add it to /Applications (optional):
75+
ln -sf "#{opt_prefix}/Applications/SSH Studio.app" "/Applications/SSH Studio.app"
76+
EOS
77+
end
78+
79+
test do
80+
system bin/"ssh-studio", "--help"
81+
end
82+
end
83+
84+

data/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ blueprint_files = files(
55
'ui/host_list.blp',
66
'ui/main_window.blp',
77
'ui/preferences_dialog.blp',
8-
'ui/search_bar.blp',
98
'ui/test_connection_dialog.blp',
109
'ui/ssh_key_manager_dialog.blp',
1110
'ui/generate_key_dialog.blp',
1211
'ui/key_picker_dialog.blp',
1312
'ui/keyboard_shortcuts_dialog.blp',
13+
'ui/welcome_view.blp',
1414
)
1515

1616
bp_gen = generator(blueprint_compiler,

data/ssh-studio.gresource.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<file alias="ui/main_window.ui" preprocess="xml-stripblanks">main_window.ui</file>
55
<file alias="ui/host_editor.ui" preprocess="xml-stripblanks">host_editor.ui</file>
66
<file alias="ui/host_list.ui" preprocess="xml-stripblanks">host_list.ui</file>
7-
<file alias="ui/search_bar.ui" preprocess="xml-stripblanks">search_bar.ui</file>
87
<file alias="ui/preferences_dialog.ui" preprocess="xml-stripblanks">preferences_dialog.ui</file>
98
<file alias="ui/test_connection_dialog.ui" preprocess="xml-stripblanks">test_connection_dialog.ui</file>
109
<file alias="ui/ssh_key_manager_dialog.ui" preprocess="xml-stripblanks">ssh_key_manager_dialog.ui</file>
1110
<file alias="ui/generate_key_dialog.ui" preprocess="xml-stripblanks">generate_key_dialog.ui</file>
1211
<file alias="ui/key_picker_dialog.ui" preprocess="xml-stripblanks">key_picker_dialog.ui</file>
1312
<file alias="ui/keyboard_shortcuts_dialog.ui" preprocess="xml-stripblanks">keyboard_shortcuts_dialog.ui</file>
13+
<file alias="ui/welcome_view.ui" preprocess="xml-stripblanks">welcome_view.ui</file>
1414
<file>ssh-studio.css</file>
1515
<file alias="media/icon_256.png">icon_256.png</file>
1616
<file alias="icons/256x256/apps/io.github.BuddySirJava.SSH-Studio.png">icon_256.png</file>

data/ui/host_editor.blp

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,80 @@ template $HostEditor: Gtk.Box {
55
orientation: vertical;
66
vexpand: true;
77
hexpand: true;
8-
margin-start: 20;
9-
margin-end: 20;
108
styles [
119
"editor-pane",
1210
"host-editor-pane",
1311
]
14-
Adw.Clamp {
12+
13+
14+
[start]
15+
Button add_button {
16+
icon-name: "list-add-symbolic";
17+
tooltip-text: _("Add Host");
18+
visible: false;
19+
20+
styles [
21+
"suggested-action",
22+
]
23+
}
24+
25+
[start]
26+
Button duplicate_button {
27+
icon-name: "edit-copy-symbolic";
28+
tooltip-text: _("Duplicate Host");
29+
visible: false;
30+
31+
styles [
32+
"flat",
33+
]
34+
}
35+
36+
[start]
37+
Button delete_button {
38+
icon-name: "edit-delete-symbolic";
39+
tooltip-text: _("Delete Host");
40+
visible: false;
41+
42+
styles [
43+
"destructive-action",
44+
]
45+
}
46+
47+
48+
Box {
49+
50+
orientation: vertical;
51+
vexpand: true;
52+
hexpand: true;
53+
54+
Adw.HeaderBar {
55+
show-title: false;
56+
[center]
1557
Adw.ViewSwitcher viewswitcher {
1658
stack: viewstack;
59+
margin-end: 20;
1760
policy: wide;
1861
valign: center;
1962
halign: center;
2063
hexpand: true;
21-
margin-top: 16;
22-
margin-bottom: 16;
2364

2465
styles [
2566
"view-switcher",
2667
]
27-
28-
}
68+
}
69+
70+
[end]
71+
Gtk.WindowControls window_controls {}
2972
}
30-
73+
3174
Adw.ViewStack viewstack {
3275
vexpand: true;
3376
margin-start: 4;
3477
margin-end: 4;
3578
styles [
3679
"host-editor",
3780
]
38-
81+
3982
Adw.ViewStackPage {
4083
title: _("Settings");
4184
icon-name: "preferences-system-symbolic";
@@ -375,10 +418,12 @@ template $HostEditor: Gtk.Box {
375418
/* Local banner moved to main window ActionBar for consistency */
376419
Revealer banner_revealer { visible: false; }
377420

378-
/* Hidden placeholders to satisfy template children in code */
379-
Box {
380-
visible: false;
381-
Button save_button {}
382-
Button revert_button {}
421+
/* Hidden placeholders to satisfy template children in code */
422+
Box {
423+
visible: false;
424+
Button save_button {}
425+
Button revert_button {}
426+
}
383427
}
384428
}
429+

data/ui/host_list.blp

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,31 @@ template $HostList: Box {
2222
margin-top: 8;
2323
margin-bottom: 8;
2424

25-
Label {
26-
margin-start: 14;
27-
label: _("SSH Hosts");
28-
halign: start;
25+
Button search_button {
26+
icon-name: "system-search-symbolic";
27+
tooltip-text: _("Search");
28+
styles [ "flat", ]
29+
}
2930

31+
Label {
32+
label: _("SSH Studio");
33+
halign: center;
34+
hexpand: true;
35+
margin-start: 24;
3036
styles [
31-
"title",
37+
"title-4",
3238
]
3339
}
3440

35-
Box { hexpand: true; }
41+
MenuButton {
42+
icon-name: "open-menu-symbolic";
43+
menu-model: main_menu;
44+
valign: center;
45+
46+
styles [
47+
"flat",
48+
]
49+
}
3650

3751
Button add_bottom_button {
3852
icon-name: "list-add-symbolic";
@@ -41,6 +55,27 @@ template $HostList: Box {
4155
}
4256
}
4357

58+
Box search_bar {
59+
orientation: horizontal;
60+
spacing: 0;
61+
hexpand: true;
62+
visible: false;
63+
64+
SearchEntry search_entry {
65+
placeholder-text: _("Search hosts, hostnames, users, keys...");
66+
tooltip-text: _("Search across all SSH host configurations");
67+
hexpand: true;
68+
halign: center;
69+
margin-start: 20;
70+
margin-end: 20;
71+
margin-bottom: 12;
72+
styles [
73+
"pill",
74+
]
75+
}
76+
}
77+
78+
4479
ScrolledWindow {
4580
hexpand: true;
4681
vexpand: true;
@@ -74,3 +109,42 @@ template $HostList: Box {
74109

75110
}
76111
}
112+
113+
menu main_menu {
114+
section {
115+
116+
item {
117+
label: _("Open Config");
118+
action: "app.open-config";
119+
}
120+
121+
item {
122+
label: _("Reload");
123+
action: "app.reload";
124+
}
125+
126+
item {
127+
label: _("Preferences");
128+
action: "app.preferences";
129+
}
130+
131+
item {
132+
label: _("Keyboard Shortcuts");
133+
action: "app.keyboard-shortcuts";
134+
}
135+
136+
}
137+
138+
section {
139+
item {
140+
label: _("Manage SSH Keys…");
141+
action: "app.manage-keys";
142+
}
143+
}
144+
section {
145+
item {
146+
label: _("About");
147+
action: "app.about";
148+
}
149+
}
150+
}

0 commit comments

Comments
 (0)