summaryrefslogtreecommitdiff
path: root/lib/shortcut.tcl
AgeCommit message (Collapse)AuthorFilesLines
2010-07-30git-gui: fix usage of _gitworktree when creating shortcut for windowsLibravatar Heiko Voigt1-2/+2
This fixes msysGit issue 425. Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-01-23git-gui: update shortcut tools to use _gitworktreeLibravatar Giuseppe Bilotta1-3/+4
Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2009-03-09Append ampersand to "Target" of lnk files created by do_cygwin_shortcutLibravatar Phil Lawrence1-1/+1
The git-gui menu item "Repository | Create Desktop Icon" creates a shortcut (.lnk file) on the Windows desktop. The purpose of the created shortcut is to make it easy for a user to launch git-gui for a particular repo in the future. A Windows user would expect to see git gui launch when they click the shortcut; they would not expect (nor want) to see a cmd window open and remain open in the background. msysGit avoids opening a command window altogether when it's Git GUI shortcut is used. Ideally, git on cygwin would also have shortcuts that simply open the GUI, but as a first step, this change allows the shell window to politely disappear after starting git gui as a background process. Signed-off-by: Phil Lawrence <prlawrence@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-12git-gui: Use proper Windows shortcuts instead of bat filesLibravatar Shawn O. Pearce1-31/+18
On Windows its better to use a shortcut (.lnk file) over a batch script (.bat) as we can specify the icon file for the .lnk and thus have these git specific objects appear on the desktop with that git specific icon file. Unfortunately the authors of Tcl did not bless us with the APIs needed to create shortcuts from within Tcl. But Microsoft did give us Windows Scripting Host which allows us to execute some JavaScript that calls some sort of COM object that can operate on a .lnk file. We now build both Cygwin and non-Cygwin "desktop icons" as proper Windows .lnk files, using the "Start in" property of these files to indicate the working directory of the repository the user wants to launch. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-14git-gui: Paper bag fix missing translated stringsLibravatar Shawn O. Pearce1-3/+3
The Tcl expression "[append [mc Foo] Bar]" does not return the string "FooBar" after translation; instead it is setting the variable Foo to the value Bar, or if Foo is already defined it is appending Bar onto the end of it. This is *not* what we wanted to have happen here. Tcl's join function is actually the correct function but its default joinStr argument is a single space. Unfortunately all of our call sites do not want an extra space added to their string. So we need a small wrapper function to make the call to join with an empty join string. In C this is (roughly) the job of the strcat function. Since strcat is not yet used at the global level it is a reasonable name to use here. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-02Mark strings for translation.Libravatar Christian Stimming1-6/+6
The procedure [mc ...] will translate the strings through msgcat. Strings must be enclosed in quotes, not in braces, because otherwise xgettext cannot extract them properly, although on the Tcl side both delimiters would work fine. [jes: I merged the later patches to that end.] Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2007-07-09git-gui: Include a space in Cygwin shortcut command linesLibravatar Shawn O. Pearce1-1/+1
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09git-gui: Use sh.exe in Cygwin shortcutsLibravatar Shawn O. Pearce1-1/+1
Because we are trying to execute /bin/sh we know it must be a real Windows executable and thus ends with the standard .exe suffix. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09git-gui: Paper bag fix for Cygwin shortcut creationLibravatar Shawn O. Pearce1-1/+1
We cannot execute the git directory, it is not a valid Tcl command name. Instead we just want to pass it as an argument to our sq proc. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09git-gui: Improve the Windows and Mac OS X shortcut creatorsLibravatar Shawn O. Pearce1-21/+26
We now embed any GIT_* and SSH_* environment variables as well as the path to the git wrapper executable into the Mac OS X .app file. This should allow us to restore the environment properly when we restart. We also try to use proper Bourne shell single quoting when we can, as this avoids any sort of problems that might occur due to a path containing shell metacharacters. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-06git-gui: Ensure windows shortcuts always have .bat extensionLibravatar Shawn O. Pearce1-0/+6
Apparently under some setups on Windows Tk is hiding our file extension recommendation of ".bat" from the user and that is allowing the user to create a shortcut file which has no file extension. Double clicking on such a file in Windows Explorer brings up the associate file dialog, as Windows does not know what application to launch. We now append the file extension ".bat" to the filename of the shortcut file if it has no extension or if it has one but it is not ".bat". Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-07git-gui: Refactor into multiple files to save my sanityLibravatar Shawn O. Pearce1-0/+141
I'm finding it difficult to work with a 6,000+ line Tcl script and not go insane while looking for a particular block of code. Since most of the program is organized into different units of functionality and not all users will need all units immediately on startup we can improve things by splitting procs out into multiple files and let auto_load handle things for us. This should help not only to better organize the source, but it may also improve startup times for some users as the Tcl parser does not need to read as much script before it can show the UI. In many cases the user can avoid reading at least half of git-gui now. Unfortunately we now need a library directory in our runtime location. This is currently assumed to be $(sharedir)/git-gui/lib and its expected that the Makefile invoker will setup some sort of reasonable sharedir value for us, or let us assume its going to be $(gitexecdir)/../share. We now also require a tclsh (in TCL_PATH) to just run the Makefile, as we use tclsh to generate the tclIndex for our lib directory. I'm hoping this is not an unncessary burden on end-users who are building from source. I haven't really made any functionality changes here, this is just a huge migration of code from one file to many smaller files. All of the new changes are to setup the library path and install the library files. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>