Changeset 1ff922b0ab00…
Parent 5ddaccd255af…
by
Changes to 93 files · Browse files at 1ff922b0ab00 Showing diff from parent 5ddaccd255af Diff from another changeset...
|
@@ -0,0 +1,1 @@ + #placeholder
|
@@ -7,17 +7,10 @@ import os
import sys
import gtk
-import shlib
-from mercurial.i18n import _
-
-try:
- # post 1.1.2
- from mercurial import util
- hgversion = util.version()
-except AttributeError:
- # <= 1.1.2
- from mercurial import version
- hgversion = version.get_version()
+import gtklib
+from thgutil.i18n import _
+from thgutil.hglib import hgversion
+from thgutil import shlib
def browse_url(url):
import threading
@@ -46,7 +39,7 @@class AboutDialog(gtk.AboutDialog):
def __init__(self):
super(AboutDialog, self).__init__()
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_keys(self)
lib_versions = ', '.join([
"Mercurial-%s" % hgversion,
|
@@ -9,17 +9,18 @@ import gtk
import gobject
import pango
-from mercurial.i18n import _
+
from mercurial import hg, ui
-import shlib
-import hglib
+from thgutil.i18n import _
+from thgutil import hglib
+import gtklib
class BackoutDialog(gtk.Window):
""" Backout effect of a changeset """
def __init__(self, rev=None):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_keys(self)
self.set_title(_('Backout changeset - ') + rev)
self.set_default_size(600, 400)
@@ -64,7 +65,7 @@
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
hbbox = gtk.HButtonBox()
hbbox.set_layout(gtk.BUTTONBOX_END)
|
@@ -4,14 +4,15 @@ # Copyright (C) 2009 Steve Borho <steve@borho.org>
#
+import os
import gtk
-import os
import pango
-from mercurial.i18n import _
+
from mercurial import extensions
-from hglib import toutf, fromutf, rootpath, diffexpand
+from thgutil.i18n import _
+from thgutil import shlib
from gdialog import GDialog
-from dialog import entry_dialog
+from about import hgversion
class BugReport(GDialog):
"""GTK+ based dialog for displaying traceback info to the user in a
@@ -44,8 +45,6 @@ close.connect('clicked', gtk.main_quit)
hbbox.add(close)
- from about import hgversion
- import shlib
text = _('\n** Please report this bug to'
' tortoisehg-discuss@lists.sourceforge.net or'
' http://bitbucket.org/tortoisehg/stable/issues\n')
|
@@ -10,13 +10,15 @@ import pango
import StringIO
-from mercurial.i18n import _
from mercurial.node import short, nullrev, nullid
from mercurial import cmdutil, context, util, ui, hg, patch
+
+from thgutil.i18n import _
+from thgutil.hglib import *
+from thgutil import shlib
+
from gdialog import GDialog, Confirm, NativeSaveFileDialogWrapper
-from hglib import toutf, fromutf, displaytime, hgcmd_toq, diffexpand, LookupError
-from gtklib import StatusBar
-import shlib
+import gtklib
class ChangeSet(GDialog):
"""GTK+ based dialog for displaying repository logs
@@ -501,7 +503,7 @@ self.glog_parent.add_accel_group(accelgroup)
else:
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'d')
filelist_tree.add_accelerator('thg-diff', accelgroup, key,
modifier, gtk.ACCEL_VISIBLE)
@@ -539,7 +541,7 @@ # add status bar for main app
vbox = gtk.VBox()
vbox.pack_start(self._hpaned, True, True)
- self.stbar = StatusBar()
+ self.stbar = gtklib.StatusBar()
self.stbar.show()
vbox.pack_start(gtk.HSeparator(), False, False)
vbox.pack_start(self.stbar, False, False)
|
@@ -7,18 +7,19 @@ import gtk
import os
import pango
+from mercurial import hg, ui, cmdutil, util
+from thgutil.i18n import _
+from thgutil import shlib
import gdialog
-from mercurial import hg, ui, cmdutil, util
-from mercurial.i18n import _
-import shlib
+import gtklib
class CloneDialog(gtk.Window):
""" Dialog to add tag to Mercurial repo """
def __init__(self, repos=[]):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'menuclone.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menuclone.ico')
+ gtklib.set_tortoise_keys(self)
self.set_default_size(520, 180)
self.set_title(_('TortoiseHg Clone'))
@@ -148,7 +149,7 @@
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
hbbox = gtk.HButtonBox()
hbbox.set_layout(gtk.BUTTONBOX_END)
|
|
|
@@ -14,21 +14,23 @@ import tempfile
import cStringIO
-from mercurial.i18n import _
from mercurial.node import hex, nullrev
from mercurial import ui, hg, util, patch
-from gdialog import Prompt, Confirm
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
from status import GStatus, FM_STATUS, FM_CHECKED, FM_PATH_UTF8
from status import DM_REJECTED, DM_CHUNK_ID
-from hglib import fromutf
-import shlib
-from shlib import shell_notify
+import gtklib
+import gdialog
class BranchOperationDialog(gtk.Dialog):
def __init__(self, branch, close):
gtk.Dialog.__init__(self, parent=None, flags=gtk.DIALOG_MODAL,
buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE))
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_keys(self)
self.connect('response', self.response)
self.set_title(_('Branch Operations'))
self.newbranch = None
@@ -164,8 +166,8 @@ if index >= 0:
buf = self.text.get_buffer()
if buf.get_char_count() and buf.get_modified():
- response = Confirm(_('Confirm Discard Message'), [], self,
- _('Discard current commit message?')).run()
+ response = gdialog.Confirm(_('Confirm Discard Message'),
+ [], self, _('Discard current commit message?')).run()
if response != gtk.RESPONSE_YES:
combobox.set_active(-1)
return
@@ -281,7 +283,7 @@ live = False
buf = self.text.get_buffer()
if buf.get_char_count() > 10 and buf.get_modified():
- dialog = Confirm(_('Confirm Exit'), [], self,
+ dialog = gdialog.Confirm(_('Confirm Exit'), [], self,
_('Save commit message at exit?'))
res = dialog.run()
if res == gtk.RESPONSE_YES:
@@ -387,7 +389,7 @@ # as of Mercurial 1.0, merges must be committed without
# specifying file list.
self._hg_commit([])
- shell_notify(self._relevant_files('MAR'))
+ shlib.shell_notify(self._relevant_files('MAR'))
self.reload_status()
else:
commitable = 'MAR'
@@ -401,7 +403,7 @@ elif len(self.filemodel) == 0 and self.qnew:
self._commit_selected([])
else:
- Prompt(_('Nothing Commited'),
+ gdialog.Prompt(_('Nothing Commited'),
_('No committable files selected'), self).run()
return True
@@ -419,7 +421,7 @@ os.mkdir(backupdir)
except OSError, err:
if err.errno != errno.EEXIST:
- Prompt(_('Commit'), _('Unable to create ') + backupdir,
+ gdialog.Prompt(_('Commit'), _('Unable to create ') + backupdir,
self).run()
return
try:
@@ -466,7 +468,8 @@ if s:
raise util.Abort(s)
else:
- Prompt(_('Commit'), _('Unable to apply patch'), self).run()
+ gdialog.Prompt(_('Commit'),
+ _('Unable to apply patch'), self).run()
raise util.Abort(_('patch failed to apply'))
del fp
@@ -500,20 +503,20 @@ if self._ready_message():
if stat not in '?!' or self._should_addremove([file]):
self._hg_commit([file])
- shell_notify([file])
+ shlib.shell_notify([file])
self.reload_status()
return True
def _undo_clicked(self, toolbutton, data=None):
- response = Confirm(_('Confirm Undo commit'),
+ response = gdialog.Confirm(_('Confirm Undo commit'),
[], self, _('Undo last commit')).run()
if response != gtk.RESPONSE_YES:
return
tip = self._get_tip_rev(True)
if not tip == self._last_commit_id:
- Prompt(_('Undo commit'),
+ gdialog.Prompt(_('Undo commit'),
_('Unable to undo!\n\n'
'Tip revision differs from last commit.'),
self).run()
@@ -524,16 +527,19 @@ self._last_commit_id = None
self.reload_status()
except:
- Prompt(_('Undo commit'), _('Errors during rollback!'), self).run()
+ gdialog.Prompt(_('Undo commit'),
+ _('Errors during rollback!'), self).run()
def _should_addremove(self, files):
if self.test_opt('addremove'):
return True
else:
- response = Confirm(_('Confirm Add/Remove'), files, self).run()
+ response = gdialog.Confirm(_('Confirm Add/Remove'),
+ files, self).run()
if response == gtk.RESPONSE_YES:
- # This will stay set for further commits (meaning no more prompts). Problem?
+ # This will stay set for further commits (meaning no
+ # more prompts). Problem?
self.opts['addremove'] = True
return True
return False
@@ -542,7 +548,7 @@ def _ready_message(self):
buf = self.text.get_buffer()
if buf.get_char_count() == 0:
- Prompt(_('Nothing Commited'),
+ gdialog.Prompt(_('Nothing Commited'),
_('Please enter commit message'), self).run()
self.text.grab_focus()
return False
@@ -551,7 +557,7 @@ sumlen = int(self.repo.ui.config('tortoisehg', 'summarylen', 0))
maxlen = int(self.repo.ui.config('tortoisehg', 'messagewrap', 0))
except (TypeError, ValueError):
- Prompt(_('Error'),
+ gdialog.Prompt(_('Error'),
_('Message format configuration error'),
self).run()
self._msg_config(None)
@@ -561,7 +567,7 @@ buf.get_end_iter()).splitlines()
if sumlen and len(lines[0].rstrip()) > sumlen:
- resp = Confirm(_('Confirm Commit'), [], self,
+ resp = gdialog.Confirm(_('Confirm Commit'), [], self,
_('The summary line length of %i is greater than'
' %i.\n\nIgnore format policy and continue'
' commit?') %
@@ -569,7 +575,7 @@ if resp != gtk.RESPONSE_YES:
return False
if sumlen and len(lines) > 1 and len(lines[1].strip()):
- resp = Confirm(_('Confirm Commit'), [], self,
+ resp = gdialog.Confirm(_('Confirm Commit'), [], self,
_('The summary line is not followed by a blank'
' line.\n\nIgnore format policy and continue'
' commit?')).run()
@@ -581,7 +587,7 @@ errs = [str(x[1]+start+1) for x in zip(tmp, range(len(tmp)))
if x[0]]
if errs:
- resp = Confirm(_('Confirm Commit'), [], self,
+ resp = gdialog.Confirm(_('Confirm Commit'), [], self,
_('The following lines are over the %i-'
'character limit: %s.\n\nIgnore format'
' policy and continue commit?') %
@@ -596,7 +602,7 @@
def _hg_commit(self, files):
if not self.repo.ui.config('ui', 'username'):
- Prompt(_('Commit: Invalid username'),
+ gdialog.Prompt(_('Commit: Invalid username'),
_('Your username has not been configured.\n\n'
'Please configure your username and try again'),
self).run()
@@ -617,16 +623,16 @@ cmdline = ['hg', 'commit', '--verbose', '--repository', self.repo.root]
if self.nextbranch:
- newbranch = fromutf(self.nextbranch)
+ newbranch = hglib.fromutf(self.nextbranch)
if newbranch in self.repo.branchtags():
if newbranch not in [p.branch() for p in self.repo.parents()]:
- response = Confirm(_('Confirm Override Branch'), [], self,
- _('A branch named "%s" already exists,\n'
+ response = gdialog.Confirm(_('Confirm Override Branch'),
+ [], self, _('A branch named "%s" already exists,\n'
'override?') % newbranch).run()
else:
response = gtk.RESPONSE_YES
else:
- response = Confirm(_('Confirm New Branch'), [], self,
+ response = gdialog.Confirm(_('Confirm New Branch'), [], self,
_('Create new named branch "%s"?') % newbranch).run()
if response == gtk.RESPONSE_YES:
self.repo.dirstate.setbranch(newbranch)
@@ -649,9 +655,9 @@ cmdline.extend(['--user', self.opts['user']])
if self.opts['date']:
cmdline.extend(['--date', self.opts['date']])
- cmdline += ['--message', fromutf(self.opts['message'])]
+ cmdline += ['--message', hglib.fromutf(self.opts['message'])]
if self.qnew:
- cmdline += [fromutf(self._get_qnew_name())]
+ cmdline += [hglib.fromutf(self._get_qnew_name())]
cmdline += [self.repo.wjoin(x) for x in files]
from hgcmd import CmdDialog
dialog = CmdDialog(cmdline, True)
@@ -661,7 +667,7 @@
# refresh overlay icons and commit dialog
if dialog.return_code() == 0:
- shell_notify([self.cwd] + files)
+ shlib.shell_notify([self.cwd] + files)
if self.notify_func:
self.notify_func(self.notify_args)
self.closebranch = False
@@ -729,7 +735,7 @@ sumlen = 0
maxlen = 0
if not (sumlen or maxlen):
- Prompt(_('Info required'),
+ gdialog.Prompt(_('Info required'),
_('Message format needs to be configured'),
self).run()
self._msg_config(None)
@@ -742,12 +748,12 @@ return
if sumlen and len(lines[0].rstrip()) > sumlen:
- Prompt(_('Warning'),
+ gdialog.Prompt(_('Warning'),
_('The summary line length of %i is greater than %i') %
(len(lines[0].rstrip()), sumlen),
self).run()
if sumlen and len(lines) > 1 and len(lines[1].strip()):
- Prompt(_('Warning'),
+ gdialog.Prompt(_('Warning'),
_('The summary line is not followed by a blank line'),
self).run()
if not maxlen:
|
@@ -8,17 +8,22 @@ import os
import pango
import Queue
-import threading, thread2
+import threading
+
from mercurial import hg, ui, util, revlog
-from mercurial.i18n import _
-from hglib import hgcmd_toq, toutf, fromutf, gettabwidth, displaytime, LookupError, rootpath
-from gdialog import GDialog, Prompt
-from vis import treemodel
-from vis.colormap import AnnotateColorMap, AnnotateColorSaturation
-from vis.treeview import TreeView
+
+from thgutil.i18n import _
+from thgutil.hglib import *
+from thgutil import thread2
+
+from logview import treemodel
+from logview.colormap import AnnotateColorMap, AnnotateColorSaturation
+from logview.treeview import TreeView as LogTreeView
+
import gtklib
+import gdialog
-class DataMineDialog(GDialog):
+class DataMineDialog(gdialog.GDialog):
COL_REVID = 0
COL_TEXT = 1
COL_TOOLTIP = 2
@@ -52,7 +57,7 @@ if os.path.isfile(f):
cf.append(util.canonpath(root, self.cwd, f))
elif os.path.isdir(f):
- Prompt(_('Invalid path'),
+ gdialog.Prompt(_('Invalid path'),
_('Cannot annotate directory: %s') % f, None).run()
for f in cf:
self.add_annotate_page(f, '.')
@@ -308,7 +313,7 @@ excludes, includes, linenum, showall, search_hbox) = objs
retext = regexp.get_text()
if not retext:
- Prompt(_('No regular expression given'),
+ gdialog.Prompt(_('No regular expression given'),
_('You must provide a search expression'), self).run()
regexp.grab_focus()
return
@@ -449,7 +454,7 @@ try:
fctx = ctx.filectx(path)
except LookupError:
- Prompt(_('File is unrevisioned'),
+ gdialog.Prompt(_('File is unrevisioned'),
_('Unable to annotate ') + path, self).run()
return
rev = fctx.filelog().linkrev(fctx.filerev())
@@ -462,7 +467,7 @@ vbox = gtk.VBox()
# File log revision graph
- graphview = TreeView(self.repo, 5000, self.stbar)
+ graphview = LogTreeView(self.repo, 5000, self.stbar)
graphview.connect('revisions-loaded', self.revisions_loaded, rev)
graphview.refresh(True, None, {'filehist':path, 'filerev':rev})
graphview.set_property('rev-column-visible', True)
|
@@ -15,26 +15,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import gtk
-from gtklib import MessageDialog
-from mercurial.i18n import _
-
-def _message_dialog(parent, type, primary, secondary, buttons=gtk.BUTTONS_OK,
- title="TortoiseHg"):
- """ Display a given type of MessageDialog with the given message.
-
- :param type: message dialog type
-
- :param message: the message you want to display.
- """
- dialog = MessageDialog(parent, flags=gtk.DIALOG_MODAL, type=type,
- buttons=buttons)
- dialog.set_title(title)
- dialog.set_markup('<big><b>' + primary + '</b></big>')
- dialog.format_secondary_text(secondary)
- dialog.set_position(gtk.WIN_POS_MOUSE)
- response = dialog.run()
- dialog.destroy()
- return response
+from thgutil.i18n import _
+import gtklib
def entry_dialog(parent, msg, visible=True, default='', respfunc=None):
""" Allow a user to enter a text string (username/password)
@@ -72,6 +54,26 @@ dialog.destroy()
return text
+# TODO: Deprecate and remove these
+
+def _message_dialog(parent, type, primary, secondary, buttons=gtk.BUTTONS_OK,
+ title="TortoiseHg"):
+ """ Display a given type of MessageDialog with the given message.
+
+ :param type: message dialog type
+
+ :param message: the message you want to display.
+ """
+ dialog = gtklib.MessageDialog(parent, flags=gtk.DIALOG_MODAL, type=type,
+ buttons=buttons)
+ dialog.set_title(title)
+ dialog.set_markup('<big><b>' + primary + '</b></big>')
+ dialog.format_secondary_text(secondary)
+ dialog.set_position(gtk.WIN_POS_MOUSE)
+ response = dialog.run()
+ dialog.destroy()
+ return response
+
def error_dialog(parent, primary, secondary):
""" Display an error dialog with the given message. """
return _message_dialog(parent, gtk.MESSAGE_ERROR, primary, secondary)
|
@@ -6,26 +6,28 @@ # of the GNU General Public License, incorporated herein by reference.
#
-import gtk
-import gobject
-import pango
-import shlex
-
import os
import threading
import cStringIO
import sys
+import shlex
import shutil
import tempfile
-from mercurial.i18n import _
+import gtk
+import gobject
+import pango
+
from mercurial.node import short
from mercurial import cmdutil, util, ui, hg, commands
-from gtklib import MessageDialog
-import shlib
-import hglib
-class SimpleMessage(MessageDialog):
+from thgutil.i18n import _
+from thgutil import shlib
+from thgutil import hglib
+
+import gtklib
+
+class SimpleMessage(gtklib.MessageDialog):
def run(self):
response = MessageDialog.run(self)
self.destroy()
@@ -38,7 +40,7 @@ gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE)
self.set_title(hglib.toutf(title))
self.set_markup('<b>' + hglib.toutf(message) + '</b>')
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'Return')
accel_group = gtk.AccelGroup()
self.add_accel_group(accel_group)
@@ -302,8 +304,8 @@
def _setup_gtk(self):
self.set_title(self.get_title())
- shlib.set_tortoise_icon(self, self.get_icon())
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, self.get_icon())
+ gtklib.set_tortoise_keys(self)
self.ismaximized = False
self.lastpos = self._setting_winpos
|
@@ -4,10 +4,61 @@ # Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
#
+import sys
import gtk
import gobject
import pango
-from mercurial.i18n import _
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
+def set_tortoise_icon(window, thgicon):
+ ico = shlib.get_tortoise_icon(thgicon)
+ if ico: window.set_icon_from_file(ico)
+
+def get_thg_modifier():
+ if sys.platform == 'darwin':
+ return '<Mod1>'
+ else:
+ return '<Control>'
+
+def set_tortoise_keys(window):
+ 'Set default TortoiseHg keyboard accelerators'
+ if sys.platform == 'darwin':
+ mask = gtk.accelerator_get_default_mod_mask()
+ mask |= gtk.gdk.MOD1_MASK;
+ gtk.accelerator_set_default_mod_mask(mask)
+ mod = get_thg_modifier()
+ accelgroup = gtk.AccelGroup()
+ window.add_accel_group(accelgroup)
+ key, modifier = gtk.accelerator_parse(mod+'w')
+ window.add_accelerator('thg-close', accelgroup, key, modifier,
+ gtk.ACCEL_VISIBLE)
+ key, modifier = gtk.accelerator_parse(mod+'q')
+ window.add_accelerator('thg-exit', accelgroup, key, modifier,
+ gtk.ACCEL_VISIBLE)
+ key, modifier = gtk.accelerator_parse('F5')
+ window.add_accelerator('thg-refresh', accelgroup, key, modifier,
+ gtk.ACCEL_VISIBLE)
+ key, modifier = gtk.accelerator_parse(mod+'Return')
+ window.add_accelerator('thg-accept', accelgroup, key, modifier,
+ gtk.ACCEL_VISIBLE)
+
+ # connect ctrl-w and ctrl-q to every window
+ window.connect('thg-close', thgclose)
+ window.connect('thg-exit', thgexit)
+
+def thgexit(window):
+ if thgclose(window):
+ gobject.idle_add(hgtk.thgexit, window)
+
+def thgclose(window):
+ if hasattr(window, 'should_live'):
+ if window.should_live():
+ return False
+ window.destroy()
+ return True
class StatusBar(gtk.HBox):
def __init__(self, extra=None):
@@ -52,6 +103,7 @@ def set_pulse_step(self, val):
self.pbar.set_pulse_step(val)
+
class MessageDialog(gtk.Dialog):
button_map = {
gtk.BUTTONS_NONE: None,
|
@@ -10,14 +10,15 @@ import gobject
import pango
import cStringIO
-import shlib
import Queue
-import thread2
-from dialog import error_dialog
-from mercurial.i18n import _
-from mercurial import hg, ui, mdiff, cmdutil, match, util, commands
-from hglib import toutf, fromutf, diffexpand, rootpath, RepoError
-import shlib
+
+from mercurial import hg, ui, mdiff, cmdutil, match, util
+
+from thgutil.i18n import _
+from thgutil.hglib import toutf, fromutf, diffexpand, rootpath, RepoError
+from thgutil import thread2
+from thgutil import shlib
+
import gtklib
# This function and some key bits below borrowed ruthelessly from
@@ -39,8 +40,8 @@ def __init__(self):
'Initialize the Dialog'
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'detect_rename.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'detect_rename.ico')
+ gtklib.set_tortoise_keys(self)
self.root = rootpath()
self.notify_func = None
|
@@ -8,31 +8,32 @@ import gobject
import pango
import os
-import threading
import Queue
-import shlib
-from hglib import HgThread, hgcmd_toq, toutf
-from mercurial.i18n import _
+
+from thgutil.i18n import _
+from thgutil import shlib
+from thgutil import hglib
+
+import gtklib
+import hgthread
class CmdDialog(gtk.Dialog):
def __init__(self, cmdline, progressbar=True, width=520, height=400):
title = 'hg ' + ' '.join(cmdline[1:])
if len(title) > 80:
title = title[:80] + '...'
- title = toutf(title.replace('\n', ' '))
+ title = hglib.toutf(title.replace('\n', ' '))
gtk.Dialog.__init__(self,
title=title,
flags=gtk.DIALOG_MODAL,
- #buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)
)
- shlib.set_tortoise_icon(self, 'hg.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'hg.ico')
+ gtklib.set_tortoise_keys(self)
self.cmdline = cmdline
self.returncode = None
self.hgthread = None
- # construct dialog
self.set_default_size(width, height)
self._button_stop = gtk.Button(_('Stop'))
@@ -104,14 +105,14 @@
def _on_window_map_event(self, event, param):
if self.hgthread is None:
- self.hgthread = HgThread(self.cmdline[1:])
+ self.hgthread = hgthread.HgThread(self.cmdline[1:])
self.hgthread.start()
self._button_ok.set_sensitive(False)
self._button_stop.set_sensitive(True)
gobject.timeout_add(10, self.process_queue)
def write(self, msg, append=True):
- msg = toutf(msg)
+ msg = hglib.toutf(msg)
if append:
enditer = self.textbuffer.get_end_iter()
self.textbuffer.insert(enditer, msg)
@@ -127,7 +128,7 @@ while self.hgthread.getqueue().qsize():
try:
msg = self.hgthread.getqueue().get(0)
- self.textbuffer.insert(enditer, toutf(msg))
+ self.textbuffer.insert(enditer, hglib.toutf(msg))
self.textview.scroll_to_mark(self.textbuffer.get_insert(), 0)
except Queue.Empty:
pass
|
@@ -10,12 +10,16 @@ import gobject
import gtk
import pango
-import shlib
-from tempfile import mkstemp
-from dialog import info_dialog
+import tempfile
+
from mercurial import hg, ui, extensions
-from mercurial.i18n import _
-from hglib import RepoError, fromutf, toutf
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
+import gtklib
+import dialog
class EmailDialog(gtk.Window):
""" Send patches or bundles via email """
@@ -23,8 +27,8 @@ """ Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'hg.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'hg.ico')
+ gtklib.set_tortoise_keys(self)
self.root = root
self.revargs = revargs
@@ -217,10 +221,10 @@
if initial:
# Only zap these fields at startup
- self._tobox.child.set_text(fromutf(repo.ui.config('email', 'to', '')))
- self._ccbox.child.set_text(fromutf(repo.ui.config('email', 'cc', '')))
- self._frombox.child.set_text(fromutf(repo.ui.config('email', 'from', '')))
- self._subjbox.child.set_text(fromutf(repo.ui.config('email', 'subject', '')))
+ self._tobox.child.set_text(hglib.fromutf(repo.ui.config('email', 'to', '')))
+ self._ccbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'cc', '')))
+ self._frombox.child.set_text(hglib.fromutf(repo.ui.config('email', 'from', '')))
+ self._subjbox.child.set_text(hglib.fromutf(repo.ui.config('email', 'subject', '')))
self._intro = False
self._in_reply_to = False
for arg in extensions.find('patchbomb').cmdtable['email'][1]:
@@ -296,19 +300,19 @@ history.get_value(cpath).remove(newvalue)
history.get_value(cpath).insert(0, newvalue)
- totext = fromutf(self._tobox.child.get_text())
- cctext = fromutf(self._ccbox.child.get_text())
- fromtext = fromutf(self._frombox.child.get_text())
- subjtext = fromutf(self._subjbox.child.get_text())
- inreplyto = fromutf(self._replyto.get_text())
+ totext = hglib.fromutf(self._tobox.child.get_text())
+ cctext = hglib.fromutf(self._ccbox.child.get_text())
+ fromtext = hglib.fromutf(self._frombox.child.get_text())
+ subjtext = hglib.fromutf(self._subjbox.child.get_text())
+ inreplyto = hglib.fromutf(self._replyto.get_text())
if not totext:
- info_dialog(self, _('Info required'),
+ dialog.info_dialog(self, _('Info required'),
_('You must specify a recipient'))
self._tobox.grab_focus()
return
if not fromtext:
- info_dialog(self, _('Info required'),
+ dialog.info_dialog(self, _('Info required'),
_('You must specify a sender address'))
self._frombox.grab_focus()
return
@@ -318,7 +322,7 @@ if self.repo.ui.config('email', 'method', 'smtp') == 'smtp' and not test:
if not self.repo.ui.config('smtp', 'host'):
from thgconfig import ConfigDialog
- info_dialog(self, _('Info required'),
+ dialog.info_dialog(self, _('Info required'),
_('You must configure SMTP'))
dlg = ConfigDialog(False)
dlg.show_all()
@@ -361,7 +365,7 @@ end = self.descbuffer.get_end_iter()
desc = self.descbuffer.get_text(start, end)
try:
- fd, tmpfile = mkstemp(prefix="thg_emaildesc_")
+ fd, tmpfile = tempfile.mkstemp(prefix="thg_emaildesc_")
os.write(fd, desc)
os.close(fd)
cmdline += ['--desc', tmpfile]
|
@@ -7,18 +7,22 @@ import os
import gtk
import gobject
+
from mercurial import hg, ui, match
-from mercurial.i18n import _
-import shlib
-import hglib
+
+from thgutil.i18n import _
+from thgutil import shlib
+from thgutil import hglib
+
+import gtklib
class HgIgnoreDialog(gtk.Window):
'Edit a reposiory .hgignore file'
def __init__(self, fileglob='', *pats):
'Initialize the Dialog'
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'ignore.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'ignore.ico')
+ gtklib.set_tortoise_keys(self)
self.root = hglib.rootpath()
self.set_title(_('Ignore filter for ') + os.path.basename(self.root))
@@ -221,7 +225,8 @@ except IOError:
pass
shlib.shell_notify([self.ignorefile])
- if self.notify_func: self.notify_func()
+ if self.notify_func:
+ self.notify_func()
def run(_ui, *pats, **opts):
if pats and pats[0].endswith('.hgignore'):
|
@@ -6,23 +6,26 @@
import os
import gtk
-from dialog import error_dialog, info_dialog
+
from mercurial import hg, ui, util
-from mercurial.i18n import _
-from hglib import toutf, fromutf, RepoError
-import shlib
+
+from thgutil.i18n import _
+from thgutil import hglib
+
+import dialog
+import gtklib
class InitDialog(gtk.Window):
""" Dialog to add tag to Mercurial repo """
def __init__(self, repos=[]):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'menucreaterepos.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menucreaterepos.ico')
+ gtklib.set_tortoise_keys(self)
# set dialog title and icon
self.cwd = os.getcwd()
- title = 'hg init - %s' % toutf(self.cwd)
+ title = 'hg init - %s' % hglib.toutf(self.cwd)
self.set_title(title)
# preconditioning info
@@ -61,7 +64,7 @@ lbl.set_property('width-chars', 12)
lbl.set_alignment(0, 0.5)
self._dest_input = gtk.Entry()
- self._dest_input.set_text(toutf(self._dest_path))
+ self._dest_input.set_text(hglib.toutf(self._dest_path))
self._dest_input.set_position(-1)
self._btn_dest_browse = gtk.Button("...")
@@ -105,25 +108,25 @@
def _btn_dest_clicked(self, button):
""" select source folder to clone """
- dialog = gtk.FileChooserDialog(title=None,
+ dlg = gtk.FileChooserDialog(title=None,
action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,gtk.RESPONSE_OK))
- dialog.set_default_response(gtk.RESPONSE_OK)
- dialog.set_current_folder(self.cwd)
- response = dialog.run()
+ dlg.set_default_response(gtk.RESPONSE_OK)
+ dlg.set_current_folder(self.cwd)
+ response = dlg.run()
if response == gtk.RESPONSE_OK:
- self._dest_input.set_text(dialog.get_filename())
+ self._dest_input.set_text(dlg.get_filename())
self._dest_input.set_position(-1)
- dialog.destroy()
+ dlg.destroy()
def _btn_init_clicked(self, toolbutton, data=None):
# gather input data
- dest = fromutf(self._dest_input.get_text())
+ dest = hglib.fromutf(self._dest_input.get_text())
# verify input
if dest == "":
- error_dialog(self, _('Destination path is empty'),
+ dialog.error_dialog(self, _('Destination path is empty'),
_('Please enter the directory path'))
self._dest_input.grab_focus()
return False
@@ -137,15 +140,17 @@
try:
hg.repository(u, dest, create=1)
- except RepoError, inst:
- error_dialog(self, _('Unable to create new repository'), str(inst))
+ except hglib.RepoError, inst:
+ dialog.error_dialog(self, _('Unable to create new repository'),
+ str(inst))
return False
except util.Abort, inst:
- error_dialog(self, _('Error when creating repository'), str(inst))
+ dialog.error_dialog(self, _('Error when creating repository'),
+ str(inst))
return False
except:
import traceback
- error_dialog(self, _('Error when creating repository'),
+ dialog.error_dialog(self, _('Error when creating repository'),
traceback.format_exc())
return False
@@ -160,8 +165,8 @@ except:
pass
- info_dialog(self, _('New repository created'),
- _('in directory %s') % toutf(os.path.abspath(dest)))
+ dialog.info_dialog(self, _('New repository created'),
+ _('in directory %s') % hglib.toutf(os.path.abspath(dest)))
def run(ui, *pats, **opts):
return InitDialog(pats)
|
@@ -8,11 +8,20 @@
'''interactive change selection to set aside that may be restored later'''
-from mercurial.i18n import _
+import copy
+import cStringIO
+import errno
+import operator
+import os
+import re
+import shutil
+import tempfile
+
from mercurial import cmdutil, commands, cmdutil, hg, mdiff, patch, revlog
from mercurial import util, fancyopts
-import copy, cStringIO, errno, operator, os, re, shutil, tempfile
-import hglib
+
+from thgutil.i18n import _
+from thgutil import hglib
lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
|
|
|
@@ -0,0 +1,187 @@ + #
+# Gtk UI class TortoiseHg
+#
+# Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
+#
+
+import sys
+import gtk
+import gobject
+import pango
+import Queue
+
+from mercurial import ui
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+from thgutil import thread2
+
+import dialog
+import gdialog
+
+class GtkUi(ui.ui):
+ '''
+ PyGtk enabled mercurial.ui subclass. All this code will be running
+ in a background thread, so it cannot directly call into Gtk.
+ Instead, it places output and dialog requests onto queues for the
+ main thread to pickup.
+ '''
+ def __init__(self, src=None, outputq=None, dialogq=None, responseq=None,
+ parentui=None):
+ if parentui:
+ # Mercurial 1.2
+ super(GtkUi, self).__init__(parentui=parentui)
+ src = parentui
+ else:
+ # Mercurial 1.3
+ super(GtkUi, self).__init__(src)
+ if src:
+ self.outputq = src.outputq
+ self.dialogq = src.dialogq
+ self.responseq = src.responseq
+ else:
+ self.outputq = outputq
+ self.dialogq = dialogq
+ self.responseq = responseq
+ self.setconfig('ui', 'interactive', 'on')
+
+ def write(self, *args):
+ if hglib.uiwrite(self, args):
+ for a in args:
+ self.outputq.put(str(a))
+
+ def write_err(self, *args):
+ for a in args:
+ self.outputq.put('*** ' + str(a))
+
+ def flush(self):
+ pass
+
+ def prompt(self, msg, choices=None, default="y"):
+ import re
+ if not hglib.calliffunc(self.interactive): return default
+ if isinstance(choices, str):
+ pat = choices
+ choices = None
+ else:
+ pat = None
+ while True:
+ try:
+ # send request to main thread, await response
+ self.dialogq.put( (msg, True, choices, default) )
+ r = self.responseq.get(True)
+ if r is None:
+ raise EOFError
+ if not r:
+ return default
+ if not pat or re.match(pat, r):
+ return r
+ else:
+ self.write(_('unrecognized response\n'))
+ except EOFError:
+ raise util.Abort(_('response expected'))
+
+ def getpass(self, prompt=None, default=None):
+ # send request to main thread, await response
+ self.dialogq.put( (prompt or _('password: '), False, None, default) )
+ r = self.responseq.get(True)
+ if r is None:
+ raise util.Abort(_('response expected'))
+ return r
+
+
+class HgThread(thread2.Thread):
+ '''
+ Run an hg command in a background thread, implies output is being
+ sent to a rendered text buffer interactively and requests for
+ feedback from Mercurial can be handled by the user via dialog
+ windows.
+ '''
+ def __init__(self, args=[], postfunc=None, parent=None):
+ self.outputq = Queue.Queue()
+ self.dialogq = Queue.Queue()
+ self.responseq = Queue.Queue()
+ self.ui = GtkUi(None, self.outputq, self.dialogq, self.responseq)
+ self.args = args
+ self.ret = None
+ self.postfunc = postfunc
+ self.parent = parent
+ thread2.Thread.__init__(self)
+
+ def getqueue(self):
+ return self.outputq
+
+ def return_code(self):
+ '''
+ None - command is incomplete, possibly exited with exception
+ 0 - command returned successfully
+ else an error was returned
+ '''
+ return self.ret
+
+ def process_dialogs(self):
+ '''Polled every 10ms to serve dialogs for the background thread'''
+ try:
+ (prompt, visible, choices, default) = self.dialogq.get_nowait()
+ if choices:
+ dlg = gdialog.CustomPrompt('Hg Prompt', prompt,
+ self.parent, choices, default)
+ dlg.connect('response', self.prompt_response)
+ dlg.show_all()
+ else:
+ dlg = dialog.entry_dialog(self.parent, prompt,
+ visible, default, self.dialog_response)
+ except Queue.Empty:
+ pass
+
+ def prompt_response(self, dialog, response_id):
+ dialog.destroy()
+ if response_id == gtk.RESPONSE_DELETE_EVENT:
+ raise util.Abort('No response')
+ else:
+ self.responseq.put(chr(response_id))
+
+ def dialog_response(self, dialog, response_id):
+ if response_id == gtk.RESPONSE_OK:
+ text = dialog.entry.get_text()
+ else:
+ text = None
+ dialog.destroy()
+ self.responseq.put(text)
+
+ def run(self):
+ try:
+ ret = None
+ if hasattr(self.ui, 'copy'):
+ # Mercurial 1.3
+ ret = hglib.dispatch._dispatch(self.ui, self.args)
+ else:
+ # Mercurial 1.2
+ # Some commands create repositories, and thus must create
+ # new ui() instances. For those, we monkey-patch ui.ui()
+ # as briefly as possible.
+ origui = None
+ if self.args[0] in ('clone', 'init'):
+ origui = ui.ui
+ ui.ui = GtkUi
+ try:
+ ret = hglib.thgdispatch(self.ui, None, self.args)
+ finally:
+ if origui:
+ ui.ui = origui
+ if ret:
+ self.ui.write(_('[command returned code %d]\n') % int(ret))
+ else:
+ self.ui.write(_('[command completed successfully]\n'))
+ self.ret = ret or 0
+ if self.postfunc:
+ self.postfunc(ret)
+ except RepoError, e:
+ self.ui.write_err(str(e))
+ except util.Abort, e:
+ self.ui.write_err(str(e))
+ except urllib2.HTTPError, e:
+ self.ui.write_err(str(e) + '\n')
+ except Exception, e:
+ self.ui.write_err(str(e))
|
@@ -11,16 +11,18 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
'''
-from mercurial.i18n import _
-import mercurial.ui as _ui
-from mercurial import hg, util, fancyopts, cmdutil, extensions
-import hglib
-import gtk
-import gobject
import os
import pdb
import sys
import traceback
+import gtk
+import gobject
+
+import mercurial.ui as _ui
+from mercurial import hg, util, fancyopts, cmdutil, extensions
+
+from thgutil.i18n import _
+from thgutil import hglib
nonrepo_commands = 'userconfig clone debugcomplete init about help version'
|
@@ -12,13 +12,16 @@ import StringIO
from mercurial.node import *
-from mercurial.i18n import _
from mercurial import ui, hg, commands, extensions
+
+from thgutil.i18n import _
+from thgutil import hglib
+
from gdialog import *
from changeset import ChangeSet
-from vis import treemodel
-from vis.treeview import TreeView
-import hglib
+from logview import treemodel
+from logview.treeview import TreeView as LogTreeView
+
import gtklib
def create_menu(label, callback):
@@ -267,9 +270,9 @@ # Allocate TreeView instance to use internally
if 'limit' in self.opts:
firstlimit = self.get_graphlimit(self.opts['limit'])
- self.graphview = TreeView(self.repo, firstlimit, self.stbar)
+ self.graphview = LogTreeView(self.repo, firstlimit, self.stbar)
else:
- self.graphview = TreeView(self.repo, self.limit, self.stbar)
+ self.graphview = LogTreeView(self.repo, self.limit, self.stbar)
# Allocate ChangeSet instance to use internally
self.changeview = ChangeSet(self.ui, self.repo, self.cwd, [],
@@ -405,7 +408,7 @@
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'d')
self.tree.add_accelerator('thg-diff', accelgroup, key,
modifier, gtk.ACCEL_VISIBLE)
|
@@ -7,10 +7,13 @@ import gtk
import os
import sys
+
from mercurial import cmdutil, util, hg, ui
-from mercurial.i18n import _
-from hglib import RepoError
-import shlib
+
+from thgutil.i18n import _
+from thgutil import hglib
+
+import gtklib
class FilterDialog(gtk.Dialog):
""" Dialog for creating log filters """
@@ -19,8 +22,8 @@ buttons = (gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)
super(FilterDialog, self).__init__(flags=gtk.DIALOG_MODAL,
buttons=buttons)
- shlib.set_tortoise_icon(self, 'menucheckout.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menucheckout.ico')
+ gtklib.set_tortoise_keys(self)
self._btn_apply = gtk.Button(_('Apply'))
self._btn_apply.connect('clicked', self._btn_apply_clicked)
@@ -32,7 +35,7 @@
try:
self.repo = hg.repository(ui.ui(), path=root)
- except RepoError:
+ except hglib.RepoError:
return None
self.set_default_size(350, 120)
|
Change 1 of 3
Show Entire File
hggtk/logview/treemodel.py
Stacked
renamed from hggtk/vis/treemodel.py
|
||
---|---|---|
@@ -13,19 +13,7 @@ from mercurial import util
from mercurial.node import short
from mercurial.hgweb import webutil
-
-# FIXME: dirty hack to import toutf() from hggtk.hglib.
-#
-# Python 2.5's relative imports doesn't seem to work either,
-# when running history.py directly.
-#
-# Besides, we want to be compatible older Python versions.
-try:
- # when history.py is invoked directly
- from hglib import toutf, displaytime
-except ImportError:
- # when history.py is imported and called from hgproc.py
- from hggtk.hglib import toutf, displaytime
+from thgutil import hglib
# treemodel row enumerated attributes
LINES = 0
@@ -110,10 +98,10 @@ summary = summary[0:80]
else:
summary = summary.split('\n')[0]
- summary = gobject.markup_escape_text(toutf(summary))
+ summary = gobject.markup_escape_text(hglib.toutf(summary))
node = self.repo.lookup(revid)
tags = self.repo.nodetags(node)
- taglist = toutf(', '.join(tags))
+ taglist = hglib.toutf(', '.join(tags))
tstr = ''
for tag in tags:
tstr += '<span background="#ffffaa"> %s </span> ' % tag
@@ -131,11 +119,11 @@ branchstr += branch['name']
if '<' in ctx.user():
- author = toutf(self.author_re.sub('', ctx.user()).strip(' '))
+ author = hglib.toutf(self.author_re.sub('', ctx.user()).strip(' '))
else:
- author = toutf(util.shortuser(ctx.user()))
+ author = hglib.toutf(util.shortuser(ctx.user()))
- date = displaytime(ctx.date())
+ date = hglib.displaytime(ctx.date())
wc_parent = revid in self.parents
head = revid in self.heads
|
Change 1 of 1
Show Entire File
hggtk/logview/treeview.py
Stacked
renamed from hggtk/vis/treeview.py
|
||
---|---|---|
@@ -15,7 +15,7 @@ from graphcell import CellRendererGraph
from revgraph import *
from mercurial.node import hex
-from mercurial.i18n import _
+from thgutil.i18n import _
class TreeView(gtk.ScrolledWindow):
|
@@ -7,26 +7,23 @@ import os
import gtk
import gobject
-import re
-import sys
-from mercurial.node import short, nullrev
-from mercurial.hgweb import webutil
-from mercurial.i18n import _
-from mercurial import util, hg, ui
+from mercurial import hg, ui
+from thgutil.i18n import _
+from thgutil import hglib
+
+import gtklib
import gdialog
import hgcmd
-import shlib
-import hglib
class MergeDialog(gtk.Window):
""" Dialog to merge revisions of a Mercurial repo """
def __init__(self, rev=None):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'menumerge.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menumerge.ico')
+ gtklib.set_tortoise_keys(self)
self.notify_func = None
if not rev:
@@ -68,7 +65,7 @@
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
hbbox = gtk.HButtonBox()
hbbox.set_layout(gtk.BUTTONBOX_END)
|
@@ -10,23 +10,26 @@ import pango
import Queue
import os
-import threading
-from mercurial.i18n import _
+
from mercurial import hg, ui, util
-from dialog import error_dialog
-from hglib import HgThread, toutf, RepoError, rootpath
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
import gdialog
-import shlib
+import dialog
import gtklib
+import hgthread
class RecoveryDialog(gtk.Window):
def __init__(self):
""" Initialize the Dialog. """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'general.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'general.ico')
+ gtklib.set_tortoise_keys(self)
- self.root = rootpath()
+ self.root = hglib.rootpath()
self.selected_path = None
self.hgthread = None
self.connect('delete-event', self._delete)
@@ -95,7 +98,8 @@
def should_live(self):
if self._cmd_running():
- error_dialog(self, _('Cannot close now'), _('command is running'))
+ dialog.error_dialog(self, _('Cannot close now'),
+ _('command is running'))
return True
return False
@@ -120,7 +124,7 @@ return
try:
repo = hg.repository(ui.ui(), path=self.root)
- except RepoError:
+ except hglib.RepoError:
self.write(_('Unable to find repo at %s\n') % (self.root), False)
return
pl = repo.changectx(None).parents()
@@ -155,7 +159,7 @@
def _exec_cmd(self, cmd, postfunc=None):
if self._cmd_running():
- error_dialog(self, _('Cannot run now'),
+ dialog.error_dialog(self, _('Cannot run now'),
_('Please try again after the previous command is completed'))
return
@@ -170,7 +174,7 @@
# execute command and show output on text widget
gobject.timeout_add(10, self.process_queue)
- self.hgthread = HgThread(cmdline, postfunc)
+ self.hgthread = hgthread.HgThread(cmdline, postfunc)
self.hgthread.start()
self.stbar.begin()
self.stbar.set_status_text('hg ' + ' '.join(cmdline))
@@ -182,7 +186,7 @@ return False
def write(self, msg, append=True):
- msg = toutf(msg)
+ msg = hglib.toutf(msg)
if append:
enditer = self.textbuffer.get_end_iter()
self.textbuffer.insert(enditer, msg)
|
@@ -4,15 +4,16 @@ # Copyright (C) 2009 Steve Borho <steve@borho.org>
#
-import os
import sys
import gtk
import cStringIO
-from dialog import error_dialog
-from mercurial.i18n import _
+
from mercurial import hg, ui, util, commands
-from hglib import toutf, fromutf, rootpath, RepoError
-import gtklib
+
+from thgutil.i18n import _
+from thgutil import hglib
+
+import dialog
def run(ui, *pats, **opts):
fname, target = '', ''
@@ -24,10 +25,10 @@ from dialog import entry_dialog
fname = util.normpath(fname)
if target:
- target = toutf(util.normpath(target))
+ target = hglib.toutf(util.normpath(target))
else:
- target = toutf(fname)
- title = 'Rename ' + toutf(fname)
+ target = hglib.toutf(fname)
+ title = 'Rename ' + hglib.toutf(fname)
dialog = entry_dialog(None, title, True, target, rename_resp)
dialog.orig = fname
return dialog
@@ -37,13 +38,13 @@ dialog.destroy()
return
try:
- root = rootpath()
+ root = hglib.rootpath()
repo = hg.repository(ui.ui(), root)
- except (ImportError, RepoError):
+ except (ImportError, hglib.RepoError):
dialog.destroy()
return
- new_name = fromutf(dialog.entry.get_text())
+ new_name = hglib.fromutf(dialog.entry.get_text())
opts = {}
opts['force'] = False # Checkbox? Nah.
opts['after'] = False
@@ -59,14 +60,14 @@ try:
commands.rename(repo.ui, repo, dialog.orig, new_name, **opts)
toquit = True
- except (util.Abort, RepoError), inst:
- error_dialog(None, _('rename error'), str(inst))
+ except (util.Abort, hglib.RepoError), inst:
+ dialog.error_dialog(None, _('rename error'), str(inst))
toquit = False
finally:
sys.stderr = saved
textout = errors.getvalue() + repo.ui.popbuffer()
errors.close()
if len(textout) > 1:
- error_dialog(None, _('rename error'), textout)
+ dialog.error_dialog(None, _('rename error'), textout)
elif toquit:
dialog.destroy()
|
@@ -15,14 +15,16 @@ import sys
import threading
import time
-import hglib
-import shlib
-import gdialog
-from dialog import error_dialog
-from mercurial.i18n import _
+
from mercurial import hg, ui, commands, cmdutil, util
from mercurial.hgweb import server
-from mercurial.i18n import _
+
+from thgutil.i18n import _
+from thgutil import hglib
+
+import dialog
+import gdialog
+import gtklib
gservice = None
class ServeDialog(gtk.Window):
@@ -30,8 +32,8 @@ def __init__(self, webdir_conf):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'proxy.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'proxy.ico')
+ gtklib.set_tortoise_keys(self)
self.connect('delete-event', self._delete)
@@ -218,7 +220,7 @@ except:
try: port = int(self.defport)
except: port = 8000
- error_dialog(self, _('Invalid port 2048..65535'),
+ dialog.error_dialog(self, _('Invalid port 2048..65535'),
_('Defaulting to ') + self.defport)
global gservice
|
|
|
@@ -14,14 +14,17 @@ import pango
import gobject
-from mercurial.i18n import _
from mercurial import cmdutil, util, ui, hg, commands, patch, mdiff, extensions
from mercurial import merge as merge_
-from hglib import toutf, fromutf, rootpath, diffexpand
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
from gdialog import GDialog, Confirm, Prompt, NativeSaveFileDialogWrapper
import dialog
-import shlib
import hgshelve
+import gtklib
# file model row enumerations
FM_CHECKED = 0
@@ -262,7 +265,7 @@
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'d')
self.filetree.add_accelerator('thg-diff', accelgroup, key,
modifier, gtk.ACCEL_VISIBLE)
@@ -343,7 +346,7 @@ self.diff_tree = gtk.TreeView(self.diff_model)
# set CTRL-c accelerator for copy-clipboard
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'c')
self.diff_tree.add_accelerator('copy-clipboard', accelgroup, key,
modifier, gtk.ACCEL_VISIBLE)
@@ -581,7 +584,7 @@ mst = wfile in ms and ms[wfile].upper() or ""
wfile = util.localpath(wfile)
self.filemodel.append([wfile in recheck, char,
- toutf(wfile), wfile, mst, False])
+ hglib.toutf(wfile), wfile, mst, False])
selected = False
for row in model:
@@ -729,19 +732,19 @@ def _copy_file(self, stat, wfile):
wfile = self.repo.wjoin(wfile)
fdir, fname = os.path.split(wfile)
- dialog = gtk.FileChooserDialog(parent=self,
+ dlg = gtk.FileChooserDialog(parent=self,
title=_('Copy file to'),
action=gtk.FILE_CHOOSER_ACTION_SAVE,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,
gtk.STOCK_COPY,gtk.RESPONSE_OK))
- dialog.set_default_response(gtk.RESPONSE_OK)
- dialog.set_current_folder(fdir)
- dialog.set_current_name(fname)
- response = dialog.run()
+ dlg.set_default_response(gtk.RESPONSE_OK)
+ dlg.set_current_folder(fdir)
+ dlg.set_current_name(fname)
+ response = dlg.run()
newfile=wfile
if response == gtk.RESPONSE_OK:
- newfile = dialog.get_filename()
- dialog.destroy()
+ newfile = dlg.get_filename()
+ dlg.destroy()
if newfile != wfile:
self._hg_copy([wfile, newfile])
return True
@@ -820,19 +823,19 @@
bufiter = buf.get_start_iter()
for line in difftext:
- line = toutf(line)
+ line = hglib.toutf(line)
if line.startswith('---') or line.startswith('+++'):
buf.insert_with_tags_by_name(bufiter, line, 'header')
elif line.startswith('-'):
- line = diffexpand(line)
+ line = hglib.diffexpand(line)
buf.insert_with_tags_by_name(bufiter, line, 'removed')
elif line.startswith('+'):
- line = diffexpand(line)
+ line = hglib.diffexpand(line)
buf.insert_with_tags_by_name(bufiter, line, 'added')
elif line.startswith('@@'):
buf.insert_with_tags_by_name(bufiter, line, 'position')
else:
- line = diffexpand(line)
+ line = hglib.diffexpand(line)
buf.insert(bufiter, line)
self.merge_diff_text.set_buffer(buf)
@@ -907,7 +910,7 @@ lines = chunk.readlines()
lines[-1] = lines[-1].strip('\n\r')
for line in lines:
- line = gobject.markup_escape_text(toutf(line[:128]))
+ line = gobject.markup_escape_text(hglib.toutf(line[:128]))
if line.startswith('---') or line.startswith('+++'):
hunk += '<span foreground="#000090">%s</span>' % line
elif line.startswith('-'):
@@ -926,7 +929,7 @@ lines = fp.readlines()
lines[-1] = lines[-1].strip('\n\r')
for line in lines:
- hunk += gobject.markup_escape_text(toutf(line[:128]))
+ hunk += gobject.markup_escape_text(hglib.toutf(line[:128]))
return hunk
def dohgdiff():
@@ -1062,8 +1065,8 @@ def _log_file(self, stat, wfile):
from history import GLog
# Might want to include 'rev' here... trying without
- dialog = GLog(self.ui, self.repo, self.cwd, [wfile], self.opts)
- dialog.display()
+ dlg = GLog(self.ui, self.repo, self.cwd, [wfile], self.opts)
+ dlg.display()
return True
@@ -1090,14 +1093,14 @@ # rev options needs extra tweaking since is not an array for
# revert command
revertopts['rev'] = revertopts['rev'][0]
- dialog = Confirm(_('Confirm Revert'), files, self,
+ dlg = Confirm(_('Confirm Revert'), files, self,
_('Revert files to revision ') + revertopts['rev'] + '?')
else:
# rev options needs extra tweaking since it must be an empty
# string when unspecified for revert command
revertopts['rev'] = ''
- dialog = Confirm('Confirm Revert', files, self)
- if dialog.run() == gtk.RESPONSE_YES:
+ dlg = Confirm('Confirm Revert', files, self)
+ if dlg.run() == gtk.RESPONSE_YES:
success, outtext = self._hg_call_wrapper('Revert', dohgrevert)
if success:
shlib.shell_notify(wfiles)
@@ -1145,28 +1148,28 @@ move_list = self._relevant_files('C')
if move_list:
# get destination directory to files into
- dialog = gtk.FileChooserDialog(title=_('Move files to diretory...'),
+ dlg = gtk.FileChooserDialog(title=_('Move files to diretory...'),
parent=self,
action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,gtk.RESPONSE_OK))
- dialog.set_default_response(gtk.RESPONSE_OK)
- dialog.set_current_folder(self.repo.root)
- response = dialog.run()
- destdir = dialog.get_filename()
- dialog.destroy()
+ dlg.set_default_response(gtk.RESPONSE_OK)
+ dlg.set_current_folder(self.repo.root)
+ response = dlg.run()
+ destdir = dlg.get_filename()
+ dlg.destroy()
if response != gtk.RESPONSE_OK:
return True
# verify directory
- destroot = rootpath(destdir)
+ destroot = hglib.rootpath(destdir)
if destroot != self.repo.root:
Prompt(_('Nothing Moved'),
_('Cannot move outside repo!'), self).run()
return True
# move the files to dest directory
- move_list.append(fromutf(destdir))
+ move_list.append(hglib.fromutf(destdir))
self._hg_move(move_list)
else:
Prompt(_('Nothing Moved'), _('No movable files selected\n\n'
@@ -1177,8 +1180,8 @@ self._delete_files([wfile])
def _delete_files(self, files):
- dialog = Confirm(_('Confirm Delete Unrevisioned'), files, self)
- if dialog.run() == gtk.RESPONSE_YES :
+ dlg = Confirm(_('Confirm Delete Unrevisioned'), files, self)
+ if dlg.run() == gtk.RESPONSE_YES :
errors = ''
for wfile in files:
try:
@@ -1197,15 +1200,15 @@
def _guess_rename(self, stat, wfile):
import rename
- dialog = rename.DetectRenameDialog(self.repo.root)
- dialog.show_all()
- dialog.set_notify_func(self.ignoremask_updated)
+ dlg = rename.DetectRenameDialog(self.repo.root)
+ dlg.show_all()
+ dlg.set_notify_func(self.ignoremask_updated)
def _ignore_file(self, stat, wfile):
import hgignore
- dialog = hgignore.HgIgnoreDialog(self.repo.root, util.pconvert(wfile))
- dialog.show_all()
- dialog.set_notify_func(self.ignoremask_updated)
+ dlg = hgignore.HgIgnoreDialog(self.repo.root, util.pconvert(wfile))
+ dlg.show_all()
+ dlg.set_notify_func(self.ignoremask_updated)
return True
def ignoremask_updated(self):
|
|
|
@@ -10,23 +10,26 @@ import pango
import Queue
import os
-import threading
-from mercurial.i18n import _
+import urllib
+
from mercurial import hg, ui, util, extensions, url
-from dialog import error_dialog, info_dialog
-from hglib import HgThread, fromutf, toutf, rootpath, RepoError
-import shlib
+
+from thgutil.i18n import _
+from thgutil import hglib
+from thgutil import shlib
+
+import dialog
import gtklib
-import urllib
+import hgthread
class SynchDialog(gtk.Window):
def __init__(self, repos=[], pushmode=False):
""" Initialize the Dialog. """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'menusynch.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menusynch.ico')
+ gtklib.set_tortoise_keys(self)
- self.root = rootpath()
+ self.root = hglib.rootpath()
self.selected_path = None
self.hgthread = None
@@ -124,7 +127,7 @@ defpushrow = i
if repos:
- self._pathtext.set_text(toutf(repos[0]))
+ self._pathtext.set_text(hglib.toutf(repos[0]))
elif defpushrow is not None and pushmode:
self._pathbox.set_active(defpushrow)
elif defrow is not None:
@@ -259,7 +262,7 @@ self.pathlist.clear()
for alias, path in self.paths:
path = url.hidepassword(path)
- self.pathlist.append([toutf(path), toutf(alias)])
+ self.pathlist.append([hglib.toutf(path), hglib.toutf(alias)])
def _drag_receive(self, widget, context, x, y, selection, targetType, time):
if time != self._last_drop_time:
@@ -271,17 +274,17 @@ if not uri.startswith('file://'):
return
path = urllib.unquote(uri[7:])
- if rootpath(path) == path:
- self._pathtext.set_text(toutf(path))
+ if hglib.rootpath(path) == path:
+ self._pathtext.set_text(hglib.toutf(path))
elif not os.path.isdir(path) and path.endswith('.hg'):
- self._pathtext.set_text(toutf(path))
+ self._pathtext.set_text(hglib.toutf(path))
def update_buttons(self, *args):
self.buttonhbox.hide()
try:
# open a new repo, rebase can confuse cached repo
repo = hg.repository(ui.ui(), path=self.root)
- except RepoError:
+ except hglib.RepoError:
return
tip = len(repo.changelog)
if self.origchangecount == tip:
@@ -304,15 +307,15 @@ from history import GLog
countpulled = len(self.repo.changelog) - self.origchangecount
opts = {'limit' : countpulled, 'from-synch' : True}
- dialog = GLog(self.ui, None, None, [], opts)
- dialog.display()
+ dlg = GLog(self.ui, None, None, [], opts)
+ dlg.display()
def _update_to_tip(self, button):
# execute command and show output on text widget
gobject.timeout_add(10, self.process_queue)
self.write("", False)
cmdline = ['update', '-v']
- self.hgthread = HgThread(cmdline)
+ self.hgthread = hgthread.HgThread(cmdline)
self.hgthread.start()
self.stbar.begin()
self.stbar.set_status_text('hg ' + ' '.join(cmdline))
@@ -332,46 +335,47 @@ raise _("unknown sort key '%s'") % sort
paths.sort(sortfunc)
return paths
- except RepoError:
+ except hglib.RepoError:
return None
def _btn_remotepath_clicked(self, button):
""" select source folder to clone """
- dialog = gtk.FileChooserDialog(title=_('Select Repository'),
+ dlg = gtk.FileChooserDialog(title=_('Select Repository'),
action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,gtk.RESPONSE_OK))
- dialog.set_default_response(gtk.RESPONSE_OK)
- dialog.set_current_folder(self.root)
- response = dialog.run()
+ dlg.set_default_response(gtk.RESPONSE_OK)
+ dlg.set_current_folder(self.root)
+ response = dlg.run()
if response == gtk.RESPONSE_OK:
- self._pathtext.set_text(dialog.get_filename())
- dialog.destroy()
+ self._pathtext.set_text(dlg.get_filename())
+ dlg.destroy()
def _btn_bundlepath_clicked(self, button):
""" select bundle to read from """
- dialog = gtk.FileChooserDialog(title=_('Select Bundle'),
+ dlg = gtk.FileChooserDialog(title=_('Select Bundle'),
action=gtk.FILE_CHOOSER_ACTION_OPEN,
buttons=(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN,gtk.RESPONSE_OK))
- dialog.set_default_response(gtk.RESPONSE_OK)
- dialog.set_current_folder(self.root)
+ dlg.set_default_response(gtk.RESPONSE_OK)
+ dlg.set_current_folder(self.root)
filefilter = gtk.FileFilter()
filefilter.set_name(_('Bundle (*.hg)'))
filefilter.add_pattern("*.hg")
- dialog.add_filter(filefilter)
+ dlg.add_filter(filefilter)
filefilter = gtk.FileFilter()
filefilter.set_name(_('Bundle (*)'))
filefilter.add_pattern("*")
- dialog.add_filter(filefilter)
- response = dialog.run()
+ dlg.add_filter(filefilter)
+ response = dlg.run()
if response == gtk.RESPONSE_OK:
- self._pathtext.set_text(dialog.get_filename())
- dialog.destroy()
+ self._pathtext.set_text(dlg.get_filename())
+ dlg.destroy()
def should_live(self):
if self._cmd_running():
- error_dialog(self, _('Cannot close now'), _('command is running'))
+ dialog.error_dialog(self, _('Cannot close now'),
+ _('command is running'))
return True
else:
self.update_settings()
@@ -443,7 +447,7 @@ self._exec_cmd(cmd)
def _conf_clicked(self, toolbutton, data=None):
- newpath = fromutf(self._pathtext.get_text()).strip()
+ newpath = hglib.fromutf(self._pathtext.get_text()).strip()
for alias, path in self.paths:
if path == newpath:
newpath = None
@@ -463,12 +467,12 @@
def _email_clicked(self, toolbutton, data=None):
opts = []
- path = fromutf(self._pathtext.get_text()).strip()
+ path = hglib.fromutf(self._pathtext.get_text()).strip()
rev = self._get_advanced_options().get('rev')
if path:
opts.extend(['--outgoing', path])
elif not rev:
- info_dialog(self, _('No repository selected'),
+ dialog.info_dialog(self, _('No repository selected'),
_('Select a peer repository to compare with'))
self._pathbox.grab_focus()
return
@@ -510,7 +514,7 @@
def _exec_cmd(self, cmd):
if self._cmd_running():
- error_dialog(self, _('Cannot run now'),
+ dialog.error_dialog(self, _('Cannot run now'),
_('Please try again after the previous command is completed'))
return
@@ -519,7 +523,7 @@ proxy_host = ui.ui().config('http_proxy', 'host', '')
use_proxy = self._use_proxy.get_active()
text_entry = self._pathbox.get_child()
- remote_path = fromutf(text_entry.get_text()).strip()
+ remote_path = hglib.fromutf(text_entry.get_text()).strip()
for alias, path in self.paths:
if remote_path == alias:
remote_path = path
@@ -537,7 +541,7 @@
# execute command and show output on text widget
gobject.timeout_add(10, self.process_queue)
- self.hgthread = HgThread(cmdline, parent=self)
+ self.hgthread = hgthread.HgThread(cmdline, parent=self)
self.hgthread.start()
self.stbar.begin()
self.stbar.set_status_text('hg ' + ' '.join(cmd + [remote_path]))
@@ -562,7 +566,7 @@ self.fill_path_combo()
def write(self, msg, append=True):
- msg = toutf(msg)
+ msg = hglib.toutf(msg)
if append:
enditer = self.textbuffer.get_end_iter()
self.textbuffer.insert(enditer, msg)
|
@@ -6,19 +6,23 @@
import os
import gtk
-from dialog import error_dialog, info_dialog
+import traceback
+
from mercurial import hg, ui, cmdutil, util
-from mercurial.i18n import _
from mercurial.node import short, nullid
-from hglib import RepoError
-import shlib
+
+from thgutil.i18n import _
+from thgutil import hglib
+
+import dialog
+import gtklib
class TagAddDialog(gtk.Window):
""" Dialog to add tag to Mercurial repo """
def __init__(self, root='', tag='', rev=''):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_keys(self)
title = _('TortoiseHg Tag - %s') % (root or os.getcwd())
self.set_title(title)
@@ -28,7 +32,7 @@
try:
self.repo = hg.repository(ui.ui(), path=self.root)
- except RepoError:
+ except hglib.RepoError:
pass
# build dialog
@@ -156,12 +160,12 @@
# verify input
if name == '':
- error_dialog(self, _('Tag input is empty'),
+ dialog.error_dialog(self, _('Tag input is empty'),
_('Please enter tag name'))
self._tag_input.grab_focus()
return False
if use_msg and not message:
- error_dialog(self, _('Custom commit message is empty'),
+ dialog.error_dialog(self, _('Custom commit message is empty'),
_('Please enter commit message'))
self._commit_message.grab_focus()
return False
@@ -169,15 +173,15 @@ # add tag to repo
try:
self._add_hg_tag(name, rev, message, is_local, force=force)
- info_dialog(self, _('Tagging completed'),
+ dialog.info_dialog(self, _('Tagging completed'),
_('Tag "%s" has been added') % name)
self._refresh()
except util.Abort, inst:
- error_dialog(self, _('Error in tagging'), str(inst))
+ dialog.error_dialog(self, _('Error in tagging'), str(inst))
return False
except:
- import traceback
- error_dialog(self, _('Error in tagging'), traceback.format_exc())
+ dialog.error_dialog(self, _('Error in tagging'),
+ traceback.format_exc())
return False
def _do_rm_tag(self):
@@ -188,7 +192,7 @@
# verify input
if name == '':
- error_dialog(self, _('Tag name is empty'),
+ dialog.error_dialog(self, _('Tag name is empty'),
_('Please select tag name to remove'))
self._tag_input.grab_focus()
return False
@@ -200,15 +204,15 @@
try:
self._rm_hg_tag(name, message, is_local)
- info_dialog(self, _('Tagging completed'),
+ dialog.info_dialog(self, _('Tagging completed'),
_('Tag "%s" has been removed') % name)
self._refresh()
except util.Abort, inst:
- error_dialog(self, _('Error in tagging'), str(inst))
+ dialog.error_dialog(self, _('Error in tagging'), str(inst))
return False
except:
- import traceback
- error_dialog(self, _('Error in tagging'), traceback.format_exc())
+ dialog.error_dialog(self, _('Error in tagging'),
+ traceback.format_exc())
return False
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
@@ -8,10 +8,11 @@
import os
import gtk
-import cStringIO
-from mercurial.i18n import _
from mercurial import ui, hg
+
+from thgutil.i18n import _
+
from status import GStatus, FM_STATUS, FM_CHECKED, DM_CHUNK_ID, DM_REJECTED
import hgshelve
|
@@ -7,14 +7,16 @@ import os
import sys
import gtk
-from dialog import error_dialog
+
from mercurial import util, hg, ui
from mercurial.node import short, nullrev
-from mercurial.i18n import _
-import hglib
-import shlib
+
+from thgutil.i18n import _
+from thgutil import hglib
+
import hgcmd
import gdialog
+import gtklib
_branch_tip_ = _('= Current Branch Tip =')
@@ -23,8 +25,8 @@ def __init__(self, rev=None):
""" Initialize the Dialog """
gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
- shlib.set_tortoise_icon(self, 'menucheckout.ico')
- shlib.set_tortoise_keys(self)
+ gtklib.set_tortoise_icon(self, 'menucheckout.ico')
+ gtklib.set_tortoise_keys(self)
self.set_default_size(350, 120)
self.notify_func = None
@@ -80,7 +82,7 @@
update = gtk.Button(_('Update'))
update.connect('clicked', self.update, combo, repo)
- mod = shlib.get_thg_modifier()
+ mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'Return')
update.add_accelerator('clicked', accelgroup, key, modifier,
gtk.ACCEL_VISIBLE)
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
|
@@ -1,44 +0,0 @@ - Here's the simple instruction on building Windows installer for TortoiseHg.
-
-Prerequisites:
-
-[by now you should have already installed Python, pythonwin and PyGtk]
-
-1. The py2exe distutils extension
- http://sourceforge.net/projects/py2exe/
-
-2. Inno Setup (v5.2.2 was used during development)
- http://www.jrsoftware.org/isinfo.php
-
-3. mfc71.dll (just download, don't install)
- http://starship.python.net/crew/mhammond/win32/
-
-4. add_path (you need only add_path.exe in the zip file)
- http://www.barisione.org/apps.html#add_path
-
-
-Building TortoiseHg installer:
-
-1. Build and Install Mercurial on your system via Mercurial's source code.
- See Mercurial's Wiki page on how to do this:
-
- http://www.selenic.com/mercurial/wiki/index.cgi/WindowsInstall
-
-2. Clone a copy of the TortoiseHg repository, and chdir into the clone.
-
-3. Build TortoiseHg binary with py2exe:
-
- python setup.py py2exe
-
-4. Copy mfc71.dll and add_path.exe into the dist directory created by py2exe.
-
-5. Copy GTK's etc/, lib/ and share/ directories into the dist directory created
- by py2exe.
-
- Note that we really only need the share/theme/ directory, so you may
- remove all other subdirectories in dist/share/ to reduce the size of
- the installer.
-
-6. Open installer\tortoisehg.iss with Inno Setup compiler, then press Ctrl-F9
- to generate the installer, TortoiseHg-snapshot.exe, in the
- C:\hg\tortoisehg-release\Output directory.
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
|
@@ -0,0 +1,1 @@ + #placeholder
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
|
@@ -0,0 +1,14 @@ + """
+i18n.py
+ Copyright (C) 2009 Steve Borho <steve@borho.org>
+
+This software may be used and distributed according to the terms
+of the GNU General Public License, incorporated herein by reference.
+"""
+
+import gettext
+from gettext import gettext as _
+
+# TODO: get proper path from somewheres
+gettext.bindtextdomain("thg", "c:/path/to/locale")
+gettext.textdomain("thg")
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
@@ -1,5 +1,5 @@ """
-util.py - TortoiseHg utility functions
+thgutil.py - TortoiseHg utility functions
Copyright (C) 2007 TK Soh <teekaysoh@gmail.com>
This software may be used and distributed according to the terms
|
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
This file's diff was not loaded because this changeset is very large. Load changes Loading... |
renamed from tortoise/shellext/ContextMenu.cpp
|
||
---|---|---|
renamed from tortoise/shellext/Directory.cpp
|
||
---|---|---|
renamed from tortoise/shellext/IconOverlay.cpp
|
||
---|---|---|
renamed from tortoise/shellext/MenuActions.cpp
|
||
---|---|---|
renamed from tortoise/shellext/PipeUtils.cpp
|
||
---|---|---|
renamed from tortoise/shellext/ShellUtils.cpp
|
||
---|---|---|
renamed from tortoise/shellext/ShellUtils2.cpp
|
||
---|---|---|
renamed from tortoise/shellext/StringUtils.cpp
|
||
---|---|---|
renamed from tortoise/shellext/StringUtils.h
|
||
---|---|---|
renamed from tortoise/shellext/TortoiseUtils.cpp
|
||
---|---|---|
renamed from tortoise/shellext/TortoiseUtils.h
|
||
---|---|---|
Loading...