1
0
mirror of https://github.com/git/git.git synced 2024-10-01 00:12:47 +02:00
Commit Graph

9 Commits

Author SHA1 Message Date
Shawn O. Pearce
51a41ac4ef git-gui: Use proper Windows shortcuts instead of bat files
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-10-12 23:07:58 -04:00
Shawn O. Pearce
31bb1d1b2d git-gui: Paper bag fix missing translated strings
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-14 01:51:18 -04:00
Christian Stimming
1ac17950e9 Mark strings for translation.
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-09-02 16:54:48 +01:00
Shawn O. Pearce
264f4a32fa git-gui: Include a space in Cygwin shortcut command lines
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-07-09 21:19:22 -04:00
Shawn O. Pearce
6a5955fac3 git-gui: Use sh.exe in Cygwin shortcuts
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-09 21:19:22 -04:00
Shawn O. Pearce
5922446794 git-gui: Paper bag fix for Cygwin shortcut creation
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-09 21:19:22 -04:00
Shawn O. Pearce
7eafa2f157 git-gui: Improve the Windows and Mac OS X shortcut creators
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-09 03:38:10 -04:00
Shawn O. Pearce
47282d4646 git-gui: Ensure windows shortcuts always have .bat extension
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-07-06 04:02:18 -04:00
Shawn O. Pearce
f522c9b5ed git-gui: Refactor into multiple files to save my sanity
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>
2007-05-07 23:35:48 -04:00