Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

After extension is updated/removed, reload Brackets instead of quitting #6487

Merged
merged 6 commits into from
Jan 14, 2014
Merged

After extension is updated/removed, reload Brackets instead of quitting #6487

merged 6 commits into from
Jan 14, 2014

Conversation

lkcampbell
Copy link
Contributor

This PR is a fix for issue #6350. After extension is updated/removed, Brackets will automatically reload with the new extension changes in place.

@lkcampbell
Copy link
Contributor Author

@dangoor and @njx, let me know what you want to do with those string constants. Keep them as is or change them.

@TomMalbran
Copy link
Contributor

There is one issue with this. If you remove the Debug extension, then it will not work, and in Edge Code there is no Debug extension. Maybe it could be time to move the reload commands to the core code.

@lkcampbell
Copy link
Contributor Author

@TomMalbran, good point and your solution is the only one that makes sense.

Bleh, I was hoping this one was going to be really easy. Oh well...back to the drawing board.

@lkcampbell
Copy link
Contributor Author

@TomMalbran, since you are around tonight, any suggestions on where to move the Reload code?

@TomMalbran
Copy link
Contributor

The menu items could probably stay in the Debug menu, just the code would need to be moved, but not sure where to move the code.

Moving the reload code would mean that we could also move the change language menu to Help or View.

@redmunds
Copy link
Contributor

All of the "quit" commands are handled in DocumentCommandHandlers, so I think that's the best place to put the "reload" commands.

@@ -402,23 +402,23 @@ define({
"EXTENSION_ERROR" : "Extension error",
"EXTENSION_KEYWORDS" : "Keywords",
"EXTENSION_INSTALLED" : "Installed",
"EXTENSION_UPDATE_INSTALLED" : "This extension update has been downloaded and will be installed when you quit {APP_NAME}.",
"EXTENSION_UPDATE_INSTALLED" : "This extension update has been downloaded and will be installed after {APP_NAME} automatically reloads.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the word "automatically" is necessary in any of these messages.

@lkcampbell
Copy link
Contributor Author

@redmunds, also, what do you think about changing the name from browserReload to appReload or applicationReload (seems a little long). Since we (hopefully) reload everything in the brackets-shell along with the browser window at this point, we are really reloading more than the browser when in native mode.

I also considered keeping the concept of browserReload around as well, but that makes the functionality platform-dependent. A browserReload in HTML mode is not the same as a browserReload in native mode. We should probably abstract up a level and call the whole thing appReload. The behavior is the same as closing and opening the application without the user having to do anything. Same on all platforms.

@redmunds
Copy link
Contributor

what do you think about changing the name from browserReload to appReload

If you create a second window using Debug > New Brackets Window, the calling browserReload only reloads the current window, not entire app. So, I think browserReload is probably more accurate.

@lkcampbell
Copy link
Contributor Author

@redmunds, DocumentCommandHandlers does not currently have a public API. Do you want me to keep it this way and register Reload and Reload Without Extensions through the CommandManager, or do you want me to add a new reloadAPI method to the module?

@redmunds
Copy link
Contributor

Yes, register Reload and Reload Without Extensions through the CommandManager.

"CHANGE_AND_RELOAD_MESSAGE" : "Pro aktualizaci nebo odstranění označených doplňků musíte ukončit a restartovat aplikaci {APP_NAME}. Budete vyzváni k uložení změn.",
"REMOVE_AND_RELOAD" : "Odstranit doplňky a ukončit program",
"CHANGE_AND_RELOAD" : "Změnit doplňky a ukončit program",
"UPDATE_AND_RELOAD" : "Aktualizovat doplňky a ukončit program",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@redmunds, I hope I did this correctly. I changed all of the language files. I don't know how the automated translation services work so, are you sure changing the constant names won't mess anything up? Will the service still be able to flag the strings that need updating even if we changed the constant names?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should only edit the nls/root/strings.js file, so remove changes to all of the other nls/*/strings.js files.

FYI, for fr and ja, the automated system will remove the old ids, add the new ids, and then re-translate. All of the other languages must be updated manually. They will default to the root (English) string until then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we change something that is not a translation, many times we change all the languages besides the fr and ja, so that they work, since several translations are not updated for every sprint.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I forgot to mention that other possibility: do a quick translation using something such as Google Translate.

FYI, we have an internal event going on today, and last day of sprint was pushed to tomorrow, so I may not get to reviewing this today.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't noticed that the string also changed, so it might be better to not touch it, unless we are sure that the Google translations are accurate enough.

@lkcampbell
Copy link
Contributor Author

@redmunds, updates committed.

@@ -23,11 +23,13 @@


/*jslint vars: true, plusplus: true, devel: true, nomen: true, indent: 4, maxerr: 50, regexp: true */
/*global define, $, brackets, window */
/*global define, $, brackets, window, WebSocket */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this and a few other changes to this file were not made by you, so it looks like a bad merge.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind -- I see you had to also move the disableCache() code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove "Mustache" "WebSocket" from the jslint global define list in DebugCommands/main.js.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you mean "WebSocket" since "Mustache" is still required in DebugCommands.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean "WebSocket", correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, "WebSocket".

@lkcampbell
Copy link
Contributor Author

@redmunds, incorrect changes rolled back.

@lkcampbell
Copy link
Contributor Author

@redmunds, code review changes committed.

AppInit.htmlReady(function () {
// If in Reload Without User Extensions mode, update UI and log console message
var USER_EXT_STATUS_ID = "status-user-exts";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem like there's any benefit to putting "status-user-exts" in a local variable since it's only used once.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see it was already like this and you just moved it, so I'll leave it to your discretion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's all me, old file and new file. I wrote it like that out of force of habit, throwing hard-wired strings into a constant. I can change it.

@redmunds
Copy link
Contributor

There are 2 ExtensionManager unit tests that no longer pass:

  • should remove extensions and quit if the user hits Remove and Quit on the removal confirmation dialog
  • should update extensions and quit if the user hits Update and Quit on the removal confirmation dialog

@lkcampbell
Copy link
Contributor Author

@redmunds, code review changes committed.

@ghost ghost assigned redmunds Jan 14, 2014
@redmunds
Copy link
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request Jan 14, 2014
After extension is updated/removed, reload Brackets instead of quitting
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants