Changeset 1e70009b6c38…
Parent b6bc2ac7c7d1…
by
Changes to 20 files · Browse files at 1e70009b6c38 Showing diff from parent b6bc2ac7c7d1 Diff from another changeset...
@@ -79,15 +79,10 @@ self.set_comments("with " + lib_versions + "\n\n" + comment)
self.set_logo(gtk.gdk.pixbuf_new_from_file(thg_logo))
self.set_icon_from_file(thg_icon)
-
+
# somehow clicking on the Close button doesn't automatically
# close the About dialog...
self.connect('response', gtk.main_quit)
def run(_ui, *pats, **opts):
- dialog = AboutDialog()
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return AboutDialog()
|
@@ -56,9 +56,4 @@ return vbox
def run(_ui, *pats, **opts):
- dialog = BugReport(_ui, None, None, None, opts, True)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- dialog.display()
- gtk.main()
- gtk.gdk.threads_leave()
+ return BugReport(_ui, None, None, None, opts, True)
|
@@ -319,9 +319,4 @@ self._add_dest_to_recent(dest)
def run(_ui, *pats, **opts):
- dialog = CloneDialog(pats)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return CloneDialog(pats)
|
@@ -658,10 +658,4 @@ 'exclude':[], 'include':[],
'check': True, 'git':False, 'addremove':False,
}
-
- dialog = GCommit(_ui, None, None, pats, cmdoptions, True)
- dialog.display()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return GCommit(_ui, None, None, pats, cmdoptions, True)
|
@@ -703,9 +703,4 @@ 'only_merges':None, 'prune':[], 'git':False, 'verbose':False,
'include':[], 'exclude':[]
}
- dialog = DataMineDialog(ui, None, None, pats, cmdoptions, True)
- dialog.display()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return DataMineDialog(ui, None, None, pats, cmdoptions, True)
|
@@ -367,10 +367,4 @@ buf.insert(bufiter, line)
def run(ui, *pats, **opts):
- dialog = DetectRenameDialog()
- dialog.show_all()
- dialog.connect('destroy', gtk.main_quit)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return DetectRenameDialog()
|
@@ -198,10 +198,4 @@ def run(_ui, *pats, **opts):
if pats and pats[0].endswith('.hgignore'):
pats = []
- dialog = HgIgnoreDialog(*pats)
- dialog.show_all()
- dialog.connect('destroy', gtk.main_quit)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return HgIgnoreDialog(*pats)
|
@@ -165,9 +165,4 @@ _('in directory %s') % toutf(os.path.abspath(dest)))
def run(ui, *pats, **opts):
- dialog = InitDialog(repos=pats)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return InitDialog(pats)
|
|
|
@@ -15,6 +15,7 @@ import mercurial.ui as _ui
from mercurial import hg, util, fancyopts, cmdutil
import hglib
+import gtk
import os
import pdb
@@ -35,7 +36,11 @@ pdb.post_mortem(sys.exc_info()[2])
error = traceback.format_exc()
from bugreport import run
- run(u, **{'cmd':' '.join(sys.argv[1:]), 'error':error})
+ opts = {}
+ opts['cmd'] = ' '.join(sys.argv[1:])
+ opts['error'] = error
+ print error
+ gtkrun(run(u, **opts))
def get_list_from_file(filename):
try:
@@ -161,10 +166,20 @@ raise
raise hglib.ParseError(cmd, _("invalid arguments"))
+def gtkrun(mainwin):
+ mainwin.show_all()
+ if hasattr(mainwin, 'display'):
+ mainwin.display()
+ mainwin.connect('destroy', gtk.main_quit)
+ gtk.gdk.threads_init()
+ gtk.gdk.threads_enter()
+ gtk.main()
+ gtk.gdk.threads_leave()
+
def about(ui, *pats, **opts):
"""about TortoiseHg"""
from hggtk.about import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def add(ui, *pats, **opts):
"""add files"""
@@ -174,7 +189,7 @@def clone(ui, *pats, **opts):
"""clone tool"""
from hggtk.clone import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def commit(ui, *pats, **opts):
"""commit tool"""
@@ -194,86 +209,86 @@ os.chdir(repo.root)
pats = []
from hggtk.commit import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def shelve(ui, *pats, **opts):
"""shelve/unshelve tool"""
from hggtk.thgshelve import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def userconfig(ui, *pats, **opts):
"""user configuration editor"""
from hggtk.thgconfig import run
opts['repomode'] = False
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def repoconfig(ui, *pats, **opts):
"""repository configuration editor"""
from hggtk.thgconfig import run
opts['repomode'] = True
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def rename(ui, *pats, **opts):
"""rename a single file or directory"""
from hggtk.rename import run
if not pats or len(pats) > 2:
raise util.Abort(_('rename takes one or two path arguments'))
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def guess(ui, *pats, **opts):
"""guess previous renames or copies"""
from hggtk.guess import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def datamine(ui, *pats, **opts):
"""repository search and annotate tool"""
from hggtk.datamine import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def hgignore(ui, *pats, **opts):
"""ignore filter editor"""
from hggtk.hgignore import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def hginit(ui, *pats, **opts):
"""repository initialization tool"""
from hggtk.hginit import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def log(ui, *pats, **opts):
"""changelog viewer"""
from hggtk.history import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def merge(ui, node=None, rev=None, **opts):
"""merge tool"""
from hggtk.merge import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def recovery(ui, *pats, **opts):
"""recover, rollback & verify"""
from hggtk.recovery import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def remove(ui, *pats, **opts):
"""file status viewer in remove mode"""
from hggtk.status import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def revert(ui, *pats, **opts):
"""file status viewer in revert mode"""
from hggtk.status import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def serve(ui, *pats, **opts):
"""web server"""
from hggtk.serve import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def status(ui, *pats, **opts):
"""file status viewer"""
from hggtk.status import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def synch(ui, *pats, **opts):
"""repository synchronization tool"""
@@ -283,17 +298,17 @@ opts['pushmode'] = True
else:
opts['pushmode'] = False
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def update(ui, *pats, **opts):
"""update/checkout tool"""
from hggtk.update import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
def vdiff(ui, *pats, **opts):
"""launch configured visual diff tool"""
from hggtk.visdiff import run
- run(ui, *pats, **opts)
+ gtkrun(run(ui, *pats, **opts))
### help management, adapted from mercurial.commands.help_()
def help_(ui, name=None, with_version=False):
|
@@ -734,10 +734,4 @@ 'date':None, 'only_merges':None, 'prune':[], 'git':False,
'verbose':False, 'include':[], 'exclude':[]
}
-
- dialog = GLog(ui, None, None, pats, cmdoptions, True)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- dialog.display()
- gtk.main()
- gtk.gdk.threads_leave()
+ return GLog(ui, None, None, pats, cmdoptions, True)
|
@@ -236,10 +236,4 @@ self._refresh()
def run(ui, *pats, **opts):
- dialog = MergeDialog()
- dialog.connect('destroy', gtk.main_quit)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return MergeDialog()
|
@@ -208,9 +208,4 @@ return False # Stop polling this function
def run(ui, *pats, **opts):
- dialog = RecoveryDialog(root)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return RecoveryDialog()
|
@@ -30,12 +30,7 @@ title = 'Rename ' + toutf(fname)
dialog = entry_dialog(None, title, True, target, rename_resp)
dialog.orig = fname
- dialog.show_all()
- dialog.connect('destroy', gtk.main_quit)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return dialog
def rename_resp(dialog, response):
if response != gtk.RESPONSE_OK:
|
@@ -342,9 +342,4 @@ _('hg serve [OPTION]...'))}
def run(ui, *pats, **opts):
- dialog = ServeDialog(opts.get('webdir_conf'))
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return ServeDialog(opts.get('webdir_conf'))
|
@@ -1318,9 +1318,4 @@ 'exclude':[], 'include':[], 'debug':True, 'verbose':True, 'git':False,
'check':True
}
- dialog = GStatus(ui, None, None, pats, cmdoptions, True)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- dialog.display()
- gtk.main()
- gtk.gdk.threads_leave()
+ return GStatus(ui, None, None, pats, cmdoptions, True)
|
@@ -617,9 +617,4 @@ set_value(key, value)
def run(ui, *pats, **opts):
- dialog = SynchDialog(pats, opts.get('pushmode') or False)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return SynchDialog(pats, opts.get('pushmode'))
|
@@ -988,10 +988,4 @@ return 0
def run(ui, *pats, **opts):
- dialog = ConfigDialog(opts.get('repomode') or False)
- dialog.show_all()
- dialog.connect('response', gtk.main_quit)
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return ConfigDialog(opts.get('repomode'))
|
@@ -217,10 +217,4 @@ 'exclude':[], 'include':[],
'check': True, 'git':False, 'addremove':False,
}
-
- dialog = GShelve(_ui, None, None, pats, cmdoptions, True)
- dialog.display()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return GShelve(_ui, None, None, pats, cmdoptions, True)
|
@@ -181,10 +181,4 @@ shell_notify([self.root])
def run(ui, *pats, **opts):
- dialog = UpdateDialog()
- dialog.connect('destroy', gtk.main_quit)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return UpdateDialog()
|
@@ -261,10 +261,4 @@ canonpats = []
for f in pats:
canonpats.append(util.canonpath(root, os.getcwd(), f))
- dialog = FileSelectionDialog(canonpats, opts)
- dialog.connect('destroy', gtk.main_quit)
- dialog.show_all()
- gtk.gdk.threads_init()
- gtk.gdk.threads_enter()
- gtk.main()
- gtk.gdk.threads_leave()
+ return FileSelectionDialog(canonpats, opts)
|
Loading...