Skip to content

Commit

Permalink
Adjust cycling commands location in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
wenlzhang committed Nov 4, 2023
1 parent 3945a81 commit d395262
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions src/taskmarker-SettingsTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,22 @@ export class TaskMarkerSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);

new Setting(this.containerEl)
.setName("Support cycling task reversely (main)")
.setDesc(
"Default disabled. If enabled, a command would be added to cycle reversely among the statuses as specified above."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.supportCyclingTasksReversely)
.onChange(async (value) => {
tempSettings.supportCyclingTasksReversely = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
);

new Setting(this.containerEl)
.setName("Cycled task (list 1)")
.setDesc(
Expand Down Expand Up @@ -364,21 +380,6 @@ export class TaskMarkerSettingsTab extends PluginSettingTab {
})
);

new Setting(this.containerEl)
.setName("Support cycling task status reversely")
.setDesc(
"Default disabled. If enabled, a command would be added to cycle reversely among the statuses as specified above."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.supportCyclingTasksReversely)
.onChange(async (value) => {
tempSettings.supportCyclingTasksReversely = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
);

this.containerEl.createEl("h2", { text: "Append text" });

// this.containerEl.createEl("p", {
Expand Down Expand Up @@ -638,59 +639,60 @@ export class TaskMarkerSettingsTab extends PluginSettingTab {
await this.plugin.saveSettings();
})
);

new Setting(this.containerEl)
.setName("Add menu item for cycling a task (list 1)")
.setName("Add menu item for cycling a task reversely (main)")
.setDesc(
"This menu item will work in a way as specified in the section \"Cycle tasks\"."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.rightClickCycleList1)
.setValue(tempSettings.rightClickCycleReversely)
.onChange(async (value) => {
tempSettings.rightClickCycleList1 = value;
tempSettings.rightClickCycleReversely = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
);

new Setting(this.containerEl)
.setName("Add menu item for cycling a task (list 2)")
.setName("Add menu item for cycling a task (list 1)")
.setDesc(
"This menu item will work in a way as specified in the section \"Cycle tasks\"."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.rightClickCycleList2)
.setValue(tempSettings.rightClickCycleList1)
.onChange(async (value) => {
tempSettings.rightClickCycleList2 = value;
tempSettings.rightClickCycleList1 = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
);
new Setting(this.containerEl)
.setName("Add menu item for cycling a task (list 3)")
.setName("Add menu item for cycling a task (list 2)")
.setDesc(
"This menu item will work in a way as specified in the section \"Cycle tasks\"."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.rightClickCycleList3)
.setValue(tempSettings.rightClickCycleList2)
.onChange(async (value) => {
tempSettings.rightClickCycleList3 = value;
tempSettings.rightClickCycleList2 = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
);

new Setting(this.containerEl)
.setName("Add menu item for cycling a task reversely")
.setName("Add menu item for cycling a task (list 3)")
.setDesc(
"This menu item will work in a way as specified in the section \"Cycle tasks\"."
)
.addToggle((toggle) =>
toggle
.setValue(tempSettings.rightClickCycleReversely)
.setValue(tempSettings.rightClickCycleList3)
.onChange(async (value) => {
tempSettings.rightClickCycleReversely = value;
tempSettings.rightClickCycleList3 = value;
this.taskMarker.updateSettings(tempSettings);
await this.plugin.saveSettings();
})
Expand Down

0 comments on commit d395262

Please sign in to comment.