Permalink
Browse files

Simplified the choice of contexts for actions. When you create a new …

…action, a tm_dialog menu pops up for you to pick a context out of. When you want to change the context of an action, a similar tm_dialog menu pops up.

All other ways of changing the context are removed.
Also, the "Actions for Context" command is being removed, since All Actions easily replicates it (click on a context in the list of the left to only see that context.
The other two review commands (for Next actions) will also be merged into this one HTML window.

Future plans: To have this window update itself in the background, so the user could just have it running at all times.

git-svn-id: http://svn.textmate.org/trunk/Bundles/GTDAlt.tmbundle@5902 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
1 parent 47898e2 commit 71d72c25e819b7a8bff1755dca8f9b4c5014abd2 Charilaos Skiadas committed Nov 3, 2006
View
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>beforeRunningCommand</key>
- <string>nop</string>
- <key>command</key>
- <string>#!/usr/bin/env ruby
-require File.join(ENV['TM_BUNDLE_SUPPORT'],'bin','GTDUtils.rb')
-require File.join(ENV['TM_SUPPORT_PATH'],'lib','escape.rb')
-include GTDLight
-line = STDIN.read
-contextList = GTDLight.get_env_contexts
-word = line.scan(/^\s*@(\S+)/)
-word = word.empty? ? line : word[0][0]
-len = word.length
-contextList = GTDLight.get_env_contexts
-choice = contextList.find {|i| i.slice(0..len-1) == word }
-if choice then
- print line.sub(/@(\S+)($|\s+)/) {|text,space| "@" + e_sn(choice) + ((space.nil? or space == "") ? " " : space)+"$0"}
-else
- print e_sn(line) + " "
-end
-</string>
- <key>fallbackInput</key>
- <string>line</string>
- <key>input</key>
- <string>selection</string>
- <key>keyEquivalent</key>
- <string> </string>
- <key>name</key>
- <string>Extend</string>
- <key>output</key>
- <string>insertAsSnippet</string>
- <key>scope</key>
- <string>text.gtdalt storage.type.context.action.gtdalt</string>
- <key>uuid</key>
- <string>52351CB8-C7BB-4119-AB3D-D7329A1B076A</string>
-</dict>
-</plist>
View
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require ENV['TM_BUNDLE_SUPPORT'] + '/bin/GTDUtils.rb'
+require ENV['TM_SUPPORT_PATH'] + '/lib/dialog.rb'
+contextList = GTDLight.get_env_contexts
+choice = Dialog.menu(contextList)
+if choice then
+ print "@#{contextList[choice]} "
+else
+require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes.rb'
+ TextMate.exit_discard
+end
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>@</string>
+ <key>name</key>
+ <string>New</string>
+ <key>output</key>
+ <string>afterSelectedText</string>
+ <key>scope</key>
+ <string>text.gtdalt - meta.action - meta.line.project - meta.note</string>
+ <key>uuid</key>
+ <string>BBA04431-8960-4017-A684-7FBACB0F7FFF</string>
+</dict>
+</plist>
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>beforeRunningCommand</key>
- <string>nop</string>
- <key>command</key>
- <string>#!/usr/bin/env ruby
-require File.join(ENV['TM_SUPPORT_PATH'],'lib','escape.rb')
-line = STDIN.read
-print e_sn(line).sub(/@(\S+)/,'@${1:\1}')
-</string>
- <key>fallbackInput</key>
- <string>line</string>
- <key>input</key>
- <string>selection</string>
- <key>keyEquivalent</key>
- <string>~c</string>
- <key>name</key>
- <string>Type</string>
- <key>output</key>
- <string>insertAsSnippet</string>
- <key>scope</key>
- <string>text.gtdalt meta.action</string>
- <key>uuid</key>
- <string>B8F4EBBA-F663-4507-A25A-023DD038F675</string>
-</dict>
-</plist>
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>beforeRunningCommand</key>
- <string>nop</string>
- <key>command</key>
- <string>#!/usr/bin/env ruby
-require File.join(ENV['TM_BUNDLE_SUPPORT'],'bin','GTDUtils.rb')
-include GTDLight
-contextList = GTDLight.get_env_contexts
-print contextList.join("\n")</string>
- <key>fallbackInput</key>
- <string>line</string>
- <key>input</key>
- <string>none</string>
- <key>keyEquivalent</key>
- <string>^?</string>
- <key>name</key>
- <string>Show Contexts</string>
- <key>output</key>
- <string>showAsTooltip</string>
- <key>scope</key>
- <string>text.gtdalt storage.type.action.context.gtdalt</string>
- <key>uuid</key>
- <string>D2C7662A-04A5-4845-A1AB-A71CA35083B7</string>
-</dict>
-</plist>
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>beforeRunningCommand</key>
- <string>saveActiveFile</string>
- <key>command</key>
- <string>#!/usr/bin/env ruby
-require File.join(ENV['TM_BUNDLE_SUPPORT'],'bin','GTDInfoRoutines.rb')
-require File.join(ENV['TM_SUPPORT_PATH'],'lib','dialog.rb')
-include GTD
-word = STDIN.read
-case word
-when /^@?(\w+)$/
- w = $1
-when /\s+@(\w+)\s*.*/
- w = $1
-end
-GTD.process_directory
-contexts = GTD.get_contexts
-if contexts.include?(word) then
- context = word
-else
- context = Dialog.request_item( :title =&gt; 'Listing actions for context', :prompt =&gt; 'Choose the new context', :items =&gt; contexts )
- exit unless context
-end
-#puts context
-puts html_actions_for_context(context)</string>
- <key>fallbackInput</key>
- <string>word</string>
- <key>input</key>
- <string>selection</string>
- <key>keyEquivalent</key>
- <string>^~@9</string>
- <key>name</key>
- <string>All for Context</string>
- <key>output</key>
- <string>showAsHTML</string>
- <key>scope</key>
- <string>text.gtdalt</string>
- <key>uuid</key>
- <string>C69611C8-DB19-45E5-A4C9-6665B77765A3</string>
-</dict>
-</plist>
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>beforeRunningCommand</key>
- <string>nop</string>
- <key>command</key>
- <string>#!/usr/bin/env ruby
-require ENV['TM_BUNDLE_SUPPORT']+"/bin/GTDUtils.rb"
-include GTDLight
-line = STDIN.read
-#GTD.process_directory
-contextList = GTDLight.get_env_contexts
-print line.sub(/@(\S+)/) {|text| "@"+contextList.next(text[1..-1])}
-</string>
- <key>fallbackInput</key>
- <string>line</string>
- <key>input</key>
- <string>selection</string>
- <key>keyEquivalent</key>
- <string>^c</string>
- <key>name</key>
- <string>Next</string>
- <key>output</key>
- <string>replaceSelectedText</string>
- <key>scope</key>
- <string>text.gtdalt meta.action</string>
- <key>uuid</key>
- <string>B68706F9-891B-46FB-ABC0-39FCE6DB7819</string>
-</dict>
-</plist>
@@ -26,7 +26,7 @@ end
<key>keyEquivalent</key>
<string>^~c</string>
<key>name</key>
- <string>Choose</string>
+ <string>Change Context</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>commands</key>
- <array>
- <dict>
- <key>command</key>
- <string>moveToEndOfLine:</string>
- </dict>
- <dict>
- <key>command</key>
- <string>insertNewline:</string>
- </dict>
- <dict>
- <key>argument</key>
- <dict>
- <key>content</key>
- <string>@${0:email}</string>
- <key>keyEquivalent</key>
- <string>@</string>
- <key>name</key>
- <string>new action</string>
- <key>scope</key>
- <string>text.gtdalt</string>
- <key>uuid</key>
- <string>6152B5ED-9BE0-4AAB-AB58-181D297A1CFF</string>
- </dict>
- <key>command</key>
- <string>insertSnippetWithOptions:</string>
- </dict>
- </array>
- <key>keyEquivalent</key>
- <string></string>
- <key>name</key>
- <string>New (on next line)</string>
- <key>scope</key>
- <string>text.gtdalt</string>
- <key>uuid</key>
- <string>4EDA94AC-8A6A-457D-A58B-DE6921F7D1FD</string>
-</dict>
-</plist>
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>commands</key>
+ <array>
+ <dict>
+ <key>command</key>
+ <string>moveToEndOfLine:</string>
+ </dict>
+ <dict>
+ <key>command</key>
+ <string>insertNewline:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require ENV['TM_BUNDLE_SUPPORT'] + '/bin/GTDUtils.rb'
+require ENV['TM_SUPPORT_PATH'] + '/lib/dialog.rb'
+contextList = GTDLight.get_env_contexts
+choice = Dialog.menu(contextList)
+if choice then
+ print "@#{contextList[choice]} "
+else
+require ENV['TM_SUPPORT_PATH'] + '/lib/exit_codes.rb'
+ TextMate.exit_discard
+end
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string>@</string>
+ <key>name</key>
+ <string>New</string>
+ <key>output</key>
+ <string>afterSelectedText</string>
+ <key>scope</key>
+ <string>text.gtdalt - meta.action - meta.line.project - meta.note</string>
+ <key>uuid</key>
+ <string>BBA04431-8960-4017-A684-7FBACB0F7FFF</string>
+ </dict>
+ <key>command</key>
+ <string>executeCommandWithOptions:</string>
+ </dict>
+ </array>
+ <key>keyEquivalent</key>
+ <string></string>
+ <key>name</key>
+ <string>New (on next line)</string>
+ <key>scope</key>
+ <string>text.gtdalt</string>
+ <key>uuid</key>
+ <string>4EF0270A-A1D7-4E98-8123-6E6F1305B7E2</string>
+</dict>
+</plist>
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>@${0:email}</string>
- <key>keyEquivalent</key>
- <string>@</string>
- <key>name</key>
- <string>New</string>
- <key>scope</key>
- <string>text.gtdalt - meta.action - meta.line.project - meta.note</string>
- <key>uuid</key>
- <string>6152B5ED-9BE0-4AAB-AB58-181D297A1CFF</string>
-</dict>
-</plist>
Oops, something went wrong.

0 comments on commit 71d72c2

Please sign in to comment.