by
Changes to 7 files · Browse files at 3af85f5c10d1 Showing diff from parent 27a0f2d22ddf 4395e2ee6c5f Diff from another changeset...
|
@@ -289,7 +289,7 @@ buf.insert_with_tags_by_name(eob, link, 'issuelink')
if pos < len(desc):
buf.insert(eob, desc[pos:])
- buf.insert(eob, '\n\n')
+ buf.insert(eob, desc.rstrip('\n\r') + '\n\n')
def append_diff(self, wfile):
if not wfile:
@@ -304,7 +304,7 @@ fctx = self.repo[rev].filectx(wfile)
except hglib.LookupError:
fctx = None
- if fctx and fctx.size() > hglib.getmaxdiffsize(self.ui):
+ if fctx and fctx.size() > hglib.getmaxdiffsize(self.repo.ui):
lines = ['diff',
_(' %s is larger than the specified max diff size') % wfile]
else:
|
@@ -28,10 +28,15 @@ class BranchOperationDialog(gtk.Dialog):
def __init__(self, branch, close, mergebranches):
gtk.Dialog.__init__(self, parent=None, flags=gtk.DIALOG_MODAL,
- buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
- gtk.STOCK_OK, gtk.RESPONSE_OK))
+ buttons=(gtk.STOCK_OK, gtk.RESPONSE_OK,
+ gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL),
+ title=_('Branch Operations'))
+ gtklib.set_tortoise_icon(self, 'branch.ico')
gtklib.set_tortoise_keys(self)
- self.set_title(_('Branch Operations'))
+ self.set_resizable(False)
+ self.set_has_separator(False)
+ self.connect('response', self.response)
+
self.newbranch = None
self.closebranch = False
@@ -47,30 +52,30 @@ self.show_all()
return
- self.connect('response', self.response)
- lbl = gtk.Label(_('Changes take effect on next commit'))
+ # create widgets
nochanges = gtk.RadioButton(None, _('No branch changes'))
self.newbranchradio = gtk.RadioButton(nochanges,
_('Open a new named branch'))
+ self.newbranchradio.set_active(True)
+ self.newbranchradio.connect('toggled', self.nbtoggle)
+ self.branchentry = gtk.Entry()
+ self.branchentry.connect('activate', self.activated)
self.closebranchradio = gtk.RadioButton(nochanges,
_('Close current named branch'))
- self.branchentry = gtk.Entry()
- self.branchentry.connect('activate', self.activated)
- hbox = gtk.HBox()
- hbox.pack_start(self.newbranchradio, False, False, 2)
- hbox.pack_start(self.branchentry, True, True, 2)
- self.vbox.pack_start(hbox, True, True, 2)
- hbox = gtk.HBox()
- hbox.pack_start(self.closebranchradio, True, True, 2)
- self.vbox.pack_start(hbox, True, True, 2)
- hbox = gtk.HBox()
- hbox.pack_start(nochanges, True, True, 2)
- self.vbox.pack_start(hbox, True, True, 2)
- self.vbox.pack_start(lbl, True, True, 10)
- self.newbranchradio.connect('toggled', self.nbtoggle)
+ # layout table
+ table = gtklib.LayoutTable()
+ self.vbox.pack_start(table, True, True, 2)
- self.newbranchradio.set_active(True)
+ lbl = gtk.Label()
+ lbl.set_markup(gtklib.markup(_('Changes take effect on next commit'),
+ weight='bold'))
+ table.add_row(lbl, padding=False, ypad=6)
+ table.add_row(self.newbranchradio, self.branchentry)
+ table.add_row(self.closebranchradio)
+ table.add_row(nochanges)
+
+ # prepare to show
if branch:
self.newbranch = branch
self.branchentry.set_text(branch)
@@ -80,6 +85,7 @@ self.closebranchradio.set_active(True)
else:
nochanges.set_active(True)
+
self.show_all()
def nbtoggle(self, radio):
|
@@ -84,7 +84,7 @@
def load_settings(self, settings):
gdialog.GDialog.load_settings(self, settings)
- self.tabwidth = hglib.gettabwidth(self.ui)
+ self.tabwidth = hglib.gettabwidth(self.repo.ui)
def get_body(self):
""" Initialize the Dialog. """
|
@@ -34,14 +34,14 @@ SimpleMessage.__init__(self, parent, gtk.DIALOG_MODAL,
type, gtk.BUTTONS_CLOSE)
self.set_title('TortoiseHg')
- self.set_markup('<b>' + hglib.toutf(title) + '</b>')
- self.format_secondary_markup(hglib.toutf(message))
+ self.set_markup(gtklib.markup(hglib.toutf(title), weight='bold'))
+ self.format_secondary_text(hglib.toutf(message))
mod = gtklib.get_thg_modifier()
key, modifier = gtk.accelerator_parse(mod+'Return')
accel_group = gtk.AccelGroup()
self.add_accel_group(accel_group)
buttons = self.get_children()[0].get_children()[1].get_children()
- buttons[0].add_accelerator("clicked", accel_group, key,
+ buttons[0].add_accelerator('clicked', accel_group, key,
modifier, gtk.ACCEL_VISIBLE)
class CustomPrompt(gtk.MessageDialog):
@@ -55,15 +55,16 @@ gtk.MessageDialog.__init__(self, parent, gtk.DIALOG_MODAL,
gtk.MESSAGE_QUESTION)
self.set_title(hglib.toutf(title))
- self.format_secondary_markup('<b>' + hglib.toutf(message) + '</b>')
+ self.format_secondary_markup(gtklib.markup(hglib.toutf(message),
+ weight='bold'))
accel_group = gtk.AccelGroup()
self.add_accel_group(accel_group)
for i, s in enumerate(choices):
button = self.add_button(s.replace('&', '_'), i)
try:
char = s[s.index('&')+1].lower()
- button.add_accelerator('clicked', accel_group, ord(char), 0,
- gtk.ACCEL_VISIBLE)
+ button.add_accelerator('clicked', accel_group, ord(char),
+ 0, gtk.ACCEL_VISIBLE)
except ValueError:
pass
if default:
@@ -84,8 +85,7 @@ SimpleMessage.__init__(self, parent, gtk.DIALOG_MODAL,
gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO)
self.set_title(hglib.toutf(title))
- primary = '<b>' + primary + '</b>'
- self.set_markup(hglib.toutf(primary))
+ self.set_markup(gtklib.markup(hglib.toutf(primary), weight='bold'))
message = ''
for i, f in enumerate(files):
message += ' ' + f + '\n'
|
@@ -89,23 +89,26 @@
# prepare to show
self.load_settings()
- self._refresh()
+ self._refresh(clear=False)
self._taglistbox.grab_focus()
- def _refresh(self):
+ def _refresh(self, clear=True):
""" update display on dialog with recent repo data """
self.repo.invalidate()
self._tagslist.clear()
- self._tag_input.set_text("")
# add tags to drop-down list
tags = [x[0] for x in self.repo.tagslist()]
tags.sort()
for tagname in tags:
- if tagname == "tip":
+ if tagname == 'tip':
continue
self._tagslist.append([tagname])
+ # clear tag input
+ if clear:
+ self._tag_input.set_text('')
+
def load_settings(self):
expanded = self.settings.get_value('expanded', False, True)
self.expander.set_property('expanded', expanded)
|
Loading...