You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0378532
Browse filesBrowse the repository at this point in the historyBrowse files
Adds a Bing Preferred Region SelectionRow to get_settings_widget() --
14 options (All Markets, No Preference, plus 13 individual markets
labelled Region - Market), reading/writing
~/.config/ncz-wallpaper/bing-markets, the same file
cix-installer's 45-wallpaper-rotator.sh ncz-wallpaper-bing helper
already reads.
Ports a complete, working implementation (fa5a38a on singularity-shell,
zoder-reviewed, full ninja+meson test pass) that lived inline on the
Desktop settings page before the plugin-based wallpaper manager
(132efb7) deleted it as collateral damage of that rewrite -- it never
had a new home in the plugin architecture. Every market is always
fetched and combined by the helper regardless of this setting; the
picker only chooses whose caption/credit wins when the same photo is
shared across regions.
Verified: full ninja -C builddir build succeeds (0 errors) against a
fresh subproject checkout of libsingularity.
Assisted-by: Claude Code:claude-sonnet-5
AI scope: ported the deleted desktop_page.vala implementation into the
plugin's settings widget, adjusted class/field placement for the
plugin context.
bing_markets_row.subtitle = _("Bing always combines every region's photo of the day; this only picks whose caption and credit win when the same photo is shared");
155
+
bing_markets_row.selected.connect((id) => {
156
+
if (bing_markets_updating || bing_markets_row ==null) return;
157
+
if (id ==BING_MARKETS_ID_ALL) {
158
+
write_bing_markets_all();
159
+
} else {
160
+
write_bing_markets_codes({id});
161
+
}
162
+
});
163
+
box.append(bing_markets_row);
87
164
return box;
88
165
}
166
+
167
+
// Lower-case an ASCII string. Vala's GLib string has no public
168
+
// lowercase() (only casefold(), which is Unicode-aware and therefore
169
+
// locale-sensitive -- the bing-market codes are all ISO 639-1 +
170
+
// ISO 3166-1 letters, so a literal ASCII fold is both correct and
171
+
// cheaper).
172
+
privatestaticstring ascii_lower(string s) {
173
+
stringout="";
174
+
for (int i =0; i < s.length; i++) {
175
+
char c = s[i];
176
+
if (c >='A'&& c <='Z') c = (char)(c +32);
177
+
out+= c.to_string();
178
+
}
179
+
returnout;
180
+
}
181
+
182
+
// Parse BING_MARKETS_TABLE into bing_markets_rows ({code, label,
183
+
// region}), in table order. Called once per get_settings_widget()
184
+
// build, before the SelectionRow option list is built from it.
0 commit comments