🔧 Allow effects with no settings
This commit is contained in:
@@ -227,8 +227,16 @@ var PreferencesDialog = class PreferencesDialog {
|
|||||||
const [minMajor, minMinor] = effect.getMinShellVersion();
|
const [minMajor, minMinor] = effect.getMinShellVersion();
|
||||||
if (utils.shellVersionIsAtLeast(minMajor, minMinor)) {
|
if (utils.shellVersionIsAtLeast(minMajor, minMinor)) {
|
||||||
|
|
||||||
const uiFile = `/ui/${utils.getUIDir()}/${effect.getNick()}.ui`;
|
const uiFile = `/ui/${utils.getUIDir()}/${effect.getNick()}.ui`;
|
||||||
const [hasPrefs] = Gio.resources_get_info(uiFile, 0);
|
|
||||||
|
// Is there a better way to test for the existence of a resource file?
|
||||||
|
let hasPrefs = false;
|
||||||
|
try {
|
||||||
|
Gio.resources_get_info(uiFile, 0);
|
||||||
|
hasPrefs = true;
|
||||||
|
} catch (e) {
|
||||||
|
// Nothing todo, there
|
||||||
|
}
|
||||||
|
|
||||||
// Add the settings page to the builder.
|
// Add the settings page to the builder.
|
||||||
if (hasPrefs) {
|
if (hasPrefs) {
|
||||||
@@ -288,9 +296,11 @@ var PreferencesDialog = class PreferencesDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._effectRows.push(row);
|
this._effectRows.push(row);
|
||||||
|
row.add_action(previewButton);
|
||||||
|
} else {
|
||||||
|
row.add_suffix(previewButton);
|
||||||
}
|
}
|
||||||
|
|
||||||
row.add_action(previewButton);
|
|
||||||
row.add_prefix(button);
|
row.add_prefix(button);
|
||||||
|
|
||||||
group.add(row);
|
group.add(row);
|
||||||
|
|||||||
Reference in New Issue
Block a user