Skip to content

Commit

Permalink
release 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsender committed Oct 6, 2015
1 parent b56c154 commit a01d9fc
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 11 deletions.
6 changes: 6 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Release History

---------------

Release 3.2.0 (2015-10-07)
++++++++++++++++++
* Deliver enhancement #73
* Deliver enhancement #77


Release 3.1.9 (2015-08-26)
++++++++++++++++++
* Fix issue #71, export workbooks by user input
Expand Down
8 changes: 8 additions & 0 deletions config/commands/main.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,14 @@
"command": "deploy_open_files_to_server"
},

{
"caption": "HaoIDE: Deploy Selected Open Files",
"command": "deploy_open_files_to_server",
"args": {
"select_all": false
}
},

{
"caption": "HaoIDE: Open Log Panel",
"command": "show_panel",
Expand Down
8 changes: 8 additions & 0 deletions config/menus/Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,14 @@
"command": "deploy_open_files_to_server"
},

{
"caption": "Deploy Selected Open Files",
"command": "deploy_open_files_to_server",
"args": {
"select_all": false
}
},

{ "caption": "-" },

{
Expand Down
8 changes: 8 additions & 0 deletions config/messages/3.2.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Build 3.2.0
-----------
Release Date: 7 Oct 2015

* Deliver enhancement #73
* Deliver enhancement #77

* Restart your sublime when new version is installed
2 changes: 1 addition & 1 deletion config/settings/package.sublime-settings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "HaoIDE",
"version": "3.1.9",
"version": "3.2.0",
"description": "HaoIDE is a Sublime Text 3 plugin for Salesforce and used for swift development on Force.com",
"author": "Hao Liu",
"email": "[email protected]",
Expand Down
60 changes: 50 additions & 10 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,10 +855,47 @@ class DeployOpenFilesToServer(sublime_plugin.WindowCommand):
def __init__(self, *args, **kwargs):
super(DeployOpenFilesToServer, self).__init__(*args, **kwargs)

def run(self):
# Get the package path to deploy
sublime.active_window().run_command("deploy_files_to_server",
{"files": self.files})
def run(self, select_all=True):
# If deploy all open files
if select_all:
return sublime.active_window().run_command("deploy_files_to_server",
{"files": list(self.file_attributes.values())})

# If just deploy some files
if not hasattr(self, "chosen_files"):
self.chosen_files = []

self.populate_items()
self.window.show_quick_panel(self.items, self.on_choose)

def populate_items(self):
self.items = []
for fileName in list(self.file_attributes.keys()):
if fileName in self.chosen_files:
self.items.append("[√] %s" % fileName)
else:
self.items.append("[x] %s" % fileName)

def on_choose(self, index):
if index == -1:
return sublime.active_window().run_command("deploy_files_to_server",
{"files": list(self.file_attributes.values())}
)

# Get chosen file name
chosen_item = self.items[index]
chosen_file_name = chosen_item[4:]

# Add or remove chosen file from list
if chosen_file_name in self.chosen_files:
self.chosen_files.remove(chosen_file_name)
else:
self.chosen_files.append(chosen_file_name)

# Start next round
self.populate_items()
sublime.set_timeout(lambda:self.window.show_quick_panel(self.items,
self.on_choose, sublime.MONOSPACE_FONT), 10)

def is_enabled(self):
"""
Expand All @@ -871,18 +908,21 @@ def is_enabled(self):
if not views or len(views) == 0: return False

self.settings = context.get_settings()
self.files = [];
self.file_attributes = {};
for _view in views:
_file = _view.file_name()
if not _file or not os.path.isfile(_file): continue # Ignore folder
_folder = util.get_metadata_folder(_file) # Ignore non-sfdc files
if _folder not in self.settings["all_metadata_folders"]:
# Ignore folder
if not _file or not os.path.isfile(_file):
continue
attributes = util.get_file_attributes(_file)
# Ignore non-sfdc files
if attributes["metadata_folder"] not in self.settings["all_metadata_folders"]:
continue

self.files.append(_file)
self.file_attributes[attributes["fullName"]] = _file

# If there is no sfdc code file, just disable this command
if not self.files:
if not self.file_attributes:
return False

return True
Expand Down
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"3.1.7": "config/messages/3.1.7.md",
"3.1.8": "config/messages/3.1.8.md",
"3.1.9": "config/messages/3.1.9.md",
"3.2.0": "config/messages/3.2.0.md",
"install": "config/messages/install.txt"
}

1 comment on commit a01d9fc

@xjsender
Copy link
Owner Author

Choose a reason for hiding this comment

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

Deliver enhancement #73

Please sign in to comment.