Add shortcut settings page
This commit is contained in:
@@ -28,6 +28,7 @@ fn internal_page_title(url: &str) -> Option<&'static str> {
|
||||
"ely://about" => Some("About ELY Browser"),
|
||||
"ely://settings" => Some("Settings"),
|
||||
"ely://settings/sidebar-tabs" => Some("Sidebar & Tabs Settings"),
|
||||
"ely://settings/shortcuts" => Some("Shortcut Settings"),
|
||||
"ely://settings/plugins" => Some("Plugin Settings"),
|
||||
"ely://settings/profiles" => Some("Profile Settings"),
|
||||
"ely://settings/sync" => Some("Sync Settings"),
|
||||
@@ -137,6 +138,10 @@ pub(crate) fn settings_url() -> Result<UrlText, CoreError> {
|
||||
internal_page_url("ely://settings")
|
||||
}
|
||||
|
||||
pub(crate) fn shortcut_settings_url() -> Result<UrlText, CoreError> {
|
||||
internal_page_url("ely://settings/shortcuts")
|
||||
}
|
||||
|
||||
pub(crate) fn sync_status_url() -> Result<UrlText, CoreError> {
|
||||
internal_page_url("ely://sync/status")
|
||||
}
|
||||
@@ -157,6 +162,9 @@ fn settings_page_route(query: &str) -> Option<&'static str> {
|
||||
"sidebar" | "tabs" | "sidebar tabs" | "sidebar & tabs" => {
|
||||
Some("ely://settings/sidebar-tabs")
|
||||
}
|
||||
"shortcut" | "shortcuts" | "keyboard" | "keyboard shortcuts" => {
|
||||
Some("ely://settings/shortcuts")
|
||||
}
|
||||
"sync" | "sync settings" => Some("ely://settings/sync"),
|
||||
"profile" | "profiles" | "profile settings" | "profiles settings" => {
|
||||
Some("ely://settings/profiles")
|
||||
|
||||
@@ -8,7 +8,8 @@ use crate::{
|
||||
about_url, archive_idle_days, archive_url, bookmarks_url, downloads_url, history_url,
|
||||
move_tab_space_name, new_private_profile_name, new_profile_name, new_space_name,
|
||||
plugin_detail_url, plugins_url, reading_list_url, search_url, settings_page_url,
|
||||
settings_url, space_icon, switch_profile_name, sync_status_url, task_manager_url,
|
||||
settings_url, shortcut_settings_url, space_icon, switch_profile_name, sync_status_url,
|
||||
task_manager_url,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -181,6 +182,10 @@ impl BrowserCore {
|
||||
self.open_tab(settings_url()?);
|
||||
Ok(true)
|
||||
}
|
||||
"shortcuts" | "open-shortcuts" | "open shortcuts" => {
|
||||
self.open_tab(shortcut_settings_url()?);
|
||||
Ok(true)
|
||||
}
|
||||
"sync" | "open-sync-status" | "open sync status" => {
|
||||
self.open_tab(sync_status_url()?);
|
||||
Ok(true)
|
||||
|
||||
Reference in New Issue
Block a user