Skip to content

Commit e172f59

Browse files
committed
refactor: Convert rest of synchronization settings to modern libadwaita components
Signed-off-by: Felicitas Pojtinger <felicitas@pojtinger.com>
1 parent 1e8b6ab commit e172f59

File tree

2 files changed

+38
-10
lines changed

2 files changed

+38
-10
lines changed

internal/components/main_menu.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ func AddMainMenu(
4545
remoteGatewayURLInput := preferencesBuilder.GetObject("htorrent-url-input").Cast().(*adw.EntryRow)
4646
remoteGatewayUsernameInput := preferencesBuilder.GetObject("htorrent-username-input").Cast().(*adw.EntryRow)
4747
remoteGatewayPasswordInput := preferencesBuilder.GetObject("htorrent-password-input").Cast().(*adw.PasswordEntryRow)
48-
weronURLInput := preferencesBuilder.GetObject("weron-url-input").Cast().(*gtk.Entry)
49-
weronICEInput := preferencesBuilder.GetObject("weron-ice-input").Cast().(*gtk.Entry)
48+
weronURLInput := preferencesBuilder.GetObject("weron-url-input").Cast().(*adw.EntryRow)
49+
weronICEInput := preferencesBuilder.GetObject("weron-ice-input").Cast().(*adw.EntryRow)
5050
weronTimeoutInput := preferencesBuilder.GetObject("weron-timeout-input").Cast().(*adw.SpinRow)
5151
weronForceRelayInput := preferencesBuilder.GetObject("weron-force-relay-input").Cast().(*gtk.Switch)
5252

internal/resources/preferences.ui

+36-8
Original file line numberDiff line numberDiff line change
@@ -166,28 +166,40 @@
166166
<property name="title" translatable="yes">General</property>
167167

168168
<child>
169-
<object class="AdwActionRow">
169+
<object class="AdwEntryRow" id="weron-url-input">
170170
<property name="title" translatable="yes">Signaling server URL</property>
171-
<property name="subtitle" translatable="yes">URL for the weron signaling server</property>
172-
<property name="activatable-widget">weron-url-input</property>
173171

174172
<child>
175-
<object class="GtkEntry" id="weron-url-input">
173+
<object class="GtkMenuButton">
174+
<style>
175+
<class name="flat"></class>
176+
<class name="circular"></class>
177+
</style>
178+
179+
<property name="icon-name">help-about</property>
180+
<property name="tooltip-text">Show help</property>
176181
<property name="valign">center</property>
182+
<property name="popover">weron-url-input-popover</property>
177183
</object>
178184
</child>
179185
</object>
180186
</child>
181187

182188
<child>
183-
<object class="AdwActionRow">
189+
<object class="AdwEntryRow" id="weron-ice-input">
184190
<property name="title" translatable="yes">STUN/TURN servers</property>
185-
<property name="subtitle" translatable="yes">Comma-separated list of weron STUN (in format stun:host:port) and TURN servers (in format username:credential@turn:host:port)</property>
186-
<property name="activatable-widget">weron-ice-input</property>
187191

188192
<child>
189-
<object class="GtkEntry" id="weron-ice-input">
193+
<object class="GtkMenuButton">
194+
<style>
195+
<class name="flat"></class>
196+
<class name="circular"></class>
197+
</style>
198+
199+
<property name="icon-name">help-about</property>
200+
<property name="tooltip-text">Show help</property>
190201
<property name="valign">center</property>
202+
<property name="popover">weron-ice-input-popover</property>
191203
</object>
192204
</child>
193205
</object>
@@ -261,4 +273,20 @@
261273
</object>
262274
</child>
263275
</object>
276+
277+
<object class="GtkPopover" id="weron-url-input-popover">
278+
<child>
279+
<object class="GtkLabel">
280+
<property name="label">URL for the weron signaling server</property>
281+
</object>
282+
</child>
283+
</object>
284+
285+
<object class="GtkPopover" id="weron-ice-input-popover">
286+
<child>
287+
<object class="GtkLabel">
288+
<property name="label">Comma-separated list of weron STUN (in format stun:host:port) and TURN servers (in format username:credential@turn:host:port)</property>
289+
</object>
290+
</child>
291+
</object>
264292
</interface>

0 commit comments

Comments
 (0)