Add open settings
This commit is contained in:
parent
4fd74e0d9f
commit
e15fc63e79
1 changed files with 16 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ export default class SyncPlugin extends Plugin {
|
||||||
private remoteListenerIntervalId: number | null = null;
|
private remoteListenerIntervalId: number | null = null;
|
||||||
private readonly operations = new ObsidianFileOperations(this.app.vault);
|
private readonly operations = new ObsidianFileOperations(this.app.vault);
|
||||||
private readonly history = new SyncHistory();
|
private readonly history = new SyncHistory();
|
||||||
|
private settingsTab: SyncSettingsTab;
|
||||||
|
|
||||||
public async onload(): Promise<void> {
|
public async onload(): Promise<void> {
|
||||||
Logger.getInstance().info("Starting plugin");
|
Logger.getInstance().info("Starting plugin");
|
||||||
|
|
@ -48,11 +49,16 @@ export default class SyncPlugin extends Plugin {
|
||||||
history: this.history,
|
history: this.history,
|
||||||
});
|
});
|
||||||
|
|
||||||
this.addSettingTab(
|
this.settingsTab = new SyncSettingsTab(
|
||||||
new SyncSettingsTab(this.app, this, database, syncServer, syncer)
|
this.app,
|
||||||
|
this,
|
||||||
|
database,
|
||||||
|
syncServer,
|
||||||
|
syncer
|
||||||
);
|
);
|
||||||
|
this.addSettingTab(this.settingsTab);
|
||||||
|
|
||||||
new StatusBar(this, this.history, syncer);
|
new StatusBar(database, this, this.history, syncer);
|
||||||
|
|
||||||
const eventHandler = new ObsidianFileEventHandler(syncer);
|
const eventHandler = new ObsidianFileEventHandler(syncer);
|
||||||
|
|
||||||
|
|
@ -132,6 +138,13 @@ export default class SyncPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public openSettings() {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
(this.app as any).setting.open(); // this is undocumented
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
(this.app as any).setting.openTab(this.settingsTab); // this is undocumented
|
||||||
|
}
|
||||||
|
|
||||||
private async activateView(type: string): Promise<void> {
|
private async activateView(type: string): Promise<void> {
|
||||||
const { workspace } = this.app;
|
const { workspace } = this.app;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue