-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEFEDIT-7152 Added preference to disable loading of external changes on app focus #7158
DEFEDIT-7152 Added preference to disable loading of external changes on app focus #7158
Conversation
(prefs-dialog/open-prefs prefs) | ||
(workspace/update-build-settings! workspace prefs))) | ||
(workspace/update-build-settings! workspace prefs) | ||
(ui/invalidate-menubar-item! ::file))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabling auto-load of external changes activates the Load External Changes menu item in the File menu. When auto-load of external changes is enabled, the menu item will not be visible.
(when (and (async-reload-on-app-focus? prefs) | ||
(can-async-reload?)) | ||
(async-reload! app-view changes-view workspace []))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to app-view
from boot-open-project
.
|
||
(defn build-in-progress? [] | ||
@build-in-progress-atom) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved up, since we need it above.
(not (sync/sync-dialog-open?)) | ||
(disk-availability/available?)) | ||
(async-reload! workspace changes-view))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to app-view
.
(.lookup root "#changes-container")) | ||
changes-view (changes-view/make-changes-view *view-graph* workspace prefs (.lookup root "#changes-container") | ||
(fn [changes-view moved-files] | ||
(app-view/async-reload! app-view changes-view workspace moved-files))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed async-reload!
callback signature to only provide the changes-view
and the moved-files
. This is called when files are reverted from the Changes View.
Changed argument order to make-changes-view
, putting the async-reload!
callback in the last argument position.
@@ -179,7 +179,7 @@ | |||
(when (some? git) | |||
(.close git))))) | |||
|
|||
(defn make-changes-view [view-graph workspace prefs async-reload! ^Parent parent] | |||
(defn make-changes-view [view-graph workspace prefs ^Parent parent async-reload!] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed argument order to make-changes-view
, putting the async-reload!
callback in the last argument position.
@@ -30,127 +30,129 @@ | |||
;; of mistake. | |||
;; Note that specifying Shortcut key (which is Meta on mac and Ctrl on windows | |||
;; and linux) is not allowed. | |||
{:macos [["A" :add] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed indentation for the :macos
block (due to earlier rename from :darwin
), but also added ["Alt+Meta+Y" :async-reload]
. This key combination used to perform the same operation in IntelliJ (not sure they have manual refresh anymore?) and is suitably unique for our needs.
@@ -72,7 +72,7 @@ | |||
control)) | |||
|
|||
(defn- create-prefs-row! [prefs ^GridPane grid row desc] | |||
(let [label (Label. (str (:label desc) ":")) | |||
(let [label (Label. (:label desc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed colon-suffix for Preference Dialog labels on a whim.
{:name "Code" | ||
:prefs [{:label "Custom Editor" :type :string :key "code-custom-editor" :default ""} | ||
{:label "Open File" :type :string :key "code-open-file" :default "{file}"} | ||
{:label "Open File at Line" :type :string :key "code-open-file-at-line" :default "{file}:{line}"}]} | ||
{:label "Open File at Line" :type :string :key "code-open-file-at-line" :default "{file}:{line}"} | ||
{:label "Code Editor Font (Requires Restart)" :type :string :key "code-editor-font-name" :default "Dejavu Sans Mono"}]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed capitalization, added Load External Changes on App Focus, and moved Code Editor Font to the Code page.
@@ -1500,7 +1500,7 @@ | |||
(when-some [parent (or (.getParentMenu old) menu-bar)] | |||
(when-some [parent-children (menu-items parent)] | |||
(let [index (.indexOf parent-children old)] | |||
(when (pos? index) | |||
(when-not (neg? index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugfix: (ui/invalidate-menubar-item! ::file)
wouldn't do anything since it is at index zero.
2f8dda2
to
60a599f
Compare
editor/src/clj/editor/keymap.clj
Outdated
"W" ; :move-tool | ||
"Ctrl+Alt+Y" ; :async-reload | ||
"Shift+A" ; :add-secondary | ||
"Shift+E"}) ; :erase-tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly whitespace, but added "Ctrl+Alt+Y" here. It seems Ctrl+Alt+[Anything] is considered "typeable" under Windows, because the AltGr key is the same as pressing Ctrl+Alt. AltGr+Y appears to produce an ü
on most keyboard layouts. I don't know, maybe we should choose a different shortcut?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Ctrl+Y on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I think I'll just revert this and change it to use Shift+Cmd/Ctrl+Y
on all platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ship it! 👍
editor/src/clj/editor/keymap.clj
Outdated
"W" ; :move-tool | ||
"Ctrl+Alt+Y" ; :async-reload | ||
"Shift+A" ; :add-secondary | ||
"Shift+E"}) ; :erase-tool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use Ctrl+Y on Windows?
…on app focus (#7158) * DEFEDIT-7152 Added preference to disable loading of external changes on app focus * Review fix
Fixes #7152.
User-facing changes