Skip to content

Commit

Permalink
Rename migration command
Browse files Browse the repository at this point in the history
  • Loading branch information
msiniscalchi committed Jan 1, 2016
1 parent 96e3b3b commit 190716b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion LaTeX.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{ "caption": "LaTeXTools: View PDF", "command": "view_pdf"},
{ "caption": "LaTeXTools: Jump to PDF", "command": "jump_to_pdf"},
{ "caption": "LaTeXTools: Toggle focus (PDF/editor)", "command": "toggle_focus"},
{ "caption": "LaTeXTools: Reconfigure and migrate settings", "command": "latextools_migrate"},
{ "caption": "LaTeXTools: Reset user settings to default", "command": "latextools_migrate"},
{ "caption": "LaTeXTools: View package documentation", "command": "latex_pkg_doc"},
{ "caption": "LaTeXTools: Build cache for LaTeX packages", "command": "latex_gen_pkg_cache"}
]
2 changes: 1 addition & 1 deletion Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
{
"command": "latextools_migrate",
"caption": "Reconfigure LaTeXTools and migrate settings"
"caption": "Reset user settings to default"
},
{ "caption": "-" },
{
Expand Down
6 changes: 3 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Additional contributors (*thank you thank you thank you*): first of all, Wallace
- If you **do not** currently have a `LaTeXTools.sublime-settings` settings file in your `User` directory (e.g., if you are installing LaTeXTools for the first time), you will be given the option to create one. The newly created settings file will be an exact copy of the default one, and will open in a tab for you to customize.
- If instead you **do** have am existing `LaTeXTools.sublime-settings` file in your `User` directory, it will be opened in a tab for you to customize.
- The `Settings - Default` menu option will open the default settings file **in read-only mode*. This may be useful if your existing settings file only contains a few options and you want to see what other options may be available without consulting this README file.
* There is an alternative way to generate a user settings file. From the `Preferences | Package Settings | LaTeXTools` menu, or from the Command Palette, choose `Reconfigure and migrate settings`. This will **not** migrate settings from an existing `LaTeXTools.sublime-settings` file in `User`: it will merely create a copy of the default settings file, potentially clobbering your personalizations. This may be useful if you want to start customizing LaTeXTools from scratch. (This is no longer that relevant in 2016, but just for the record, if you have a pre-2014, old-style settings file, this option *will* import it).
* There is an alternative way to generate a user settings file. From the `Preferences | Package Settings | LaTeXTools` menu, or from the Command Palette, choose `Reset user settings to default`. This will also create a copy of the default settings file, potentially *clobbering your personalizations*. This may be useful if you want to start customizing LaTeXTools from scratch. (This is no longer that relevant in 2016, but just for the record, if you have a pre-2014, old-style settings file, this option *will* import it).

Introduction
------------
Expand Down Expand Up @@ -404,10 +404,10 @@ You can consult the documentation for any LaTeX package by invoking the `View Pa
Settings
--------

LaTeXTools supports user-defined settings. The settings file is called `LaTeXTools.sublime-settings`. One copy resides in the LaTeXTools plugin directory and **must not be edited**. You can however create a copy in your `User` directory, either manually or using the `Settings - User` option in the `Preferences | Package Settings | LaTeXTools` submenu, as described at the top of this README. You can also use the "Reconfigure and migrate settings" command from the Command Palette or from the same submenu.
LaTeXTools supports user-defined settings. The settings file is called `LaTeXTools.sublime-settings`. One copy resides in the LaTeXTools plugin directory and **must not be edited**. You can however create a copy in your `User` directory, either manually or using the `Settings - User` option in the `Preferences | Package Settings | LaTeXTools` submenu, as described at the top of this README. You can also use the "Reset user settings to default" command from the Command Palette or from the same submenu.

If you ever want to revert your settings to their default state, just invoke the
Reconfigure and migrate settings" command again, as above.
Reset user settings to default" command again, as above.

*Warning*: in general, tweaking options can cause breakage. For instance, if on Linux you change the default `python2` setting (empty by default) to a non-existent binary, forward and inverse search will stop working. With great power comes great responsibility! If you think you have found a bug, *delete your settings file in the `User` directory and rerun the `latextools_migrate` command before reporting it!* Thanks :-)

Expand Down
10 changes: 5 additions & 5 deletions migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def run(self):
# Hence, quit
# NOTE: we will move this code somewhere else, but for now, it's here

print ("Running migrate")
sublime.status_message("Reconfiguring and migrating settings...")
print ("Running settings reset")
sublime.status_message("Resetting user settings to default...")
ltt_path = os.path.join(sublime.packages_path(),"LaTeXTools")
user_path = os.path.join(sublime.packages_path(),"User")
default_file = os.path.join(ltt_path,DEFAULT_SETTINGS)
Expand All @@ -71,7 +71,7 @@ def run(self):
killall = False # So final message check works even if there is no existing setting file
if os.path.exists(user_file):
killall = sublime.ok_cancel_dialog(USER_SETTINGS + " already exists in the User directory!\n"
"Are you sure you want to DELETE YOUR CURRENT SETTINGS and revert them to default?",
"Are you sure you want to DELETE YOUR CURRENT SETTINGS and reset them to default?",
"DELETE current settings")
if not killall:
sublime.message_dialog("OK, I will preserve your existing settings.")
Expand Down Expand Up @@ -154,7 +154,7 @@ def run(self):
msg_preserved = ""
else:
msg_preserved = "Old-style, pre-2014 settings (if any) have been migrated."
sublime.status_message("Reconfiguration complete.")
sublime.message_dialog("LaTeXTools settings successfully reconfigured. " + msg_preserved)
sublime.status_message("Settings reset to default.")
sublime.message_dialog("LaTeXTools settings successfully reset to default. " + msg_preserved)
return

0 comments on commit 190716b

Please sign in to comment.