Skip to content

Commit 138cd05

Browse files
committed
reorder --no-entry option
1 parent fe3e40a commit 138cd05

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

src/dialogs/preferences_dialog.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,32 @@ mod imp {
135135
page.add(&terminal_group);
136136

137137
// Distrobox Settings Group
138+
let settings = gio::Settings::new("com.ranfdev.DistroShelf");
139+
138140
let distrobox_group = adw::PreferencesGroup::new();
139141
distrobox_group.set_title(&gettext("Distrobox Settings"));
140142

143+
let no_entry_row = adw::SwitchRow::new();
144+
no_entry_row.set_title(&gettext("Use --no-entry for new containers"));
145+
no_entry_row.set_subtitle(&gettext(
146+
"No .desktop app entry is created, so it won't appear in your app list.",
147+
));
148+
no_entry_row.set_active(settings.boolean("distrobox-create-no-entry"));
149+
150+
let settings_for_no_entry = settings.clone();
151+
no_entry_row.connect_active_notify(move |row| {
152+
let _ =
153+
settings_for_no_entry.set_boolean("distrobox-create-no-entry", row.is_active());
154+
});
155+
156+
distrobox_group.add(&no_entry_row);
157+
141158
let distrobox_source_row = adw::ComboRow::new();
142159
distrobox_source_row.set_title(&gettext("Distrobox Source"));
143160
let model =
144161
gtk::StringList::new(&[&gettext("System (host)"), &gettext("Bundled Version")]);
145162
distrobox_source_row.set_model(Some(&model));
146163

147-
// Bind to settings
148-
let settings = gio::Settings::new("com.ranfdev.DistroShelf");
149164
// We need to map string to index and vice versa
150165
// 0 -> host, 1 -> bundled
151166

@@ -166,21 +181,6 @@ mod imp {
166181

167182
distrobox_group.add(&distrobox_source_row);
168183

169-
let no_entry_row = adw::SwitchRow::new();
170-
no_entry_row.set_title(&gettext("Use --no-entry for new containers"));
171-
no_entry_row.set_subtitle(&gettext(
172-
"No .desktop app entry is created, so it won't appear in your app list.",
173-
));
174-
no_entry_row.set_active(settings.boolean("distrobox-create-no-entry"));
175-
176-
let settings_for_no_entry = settings.clone();
177-
no_entry_row.connect_active_notify(move |row| {
178-
let _ =
179-
settings_for_no_entry.set_boolean("distrobox-create-no-entry", row.is_active());
180-
});
181-
182-
distrobox_group.add(&no_entry_row);
183-
184184
// Add version row
185185
let version_row = adw::ActionRow::new();
186186
version_row.set_title(&gettext("Distrobox Version"));

0 commit comments

Comments
 (0)