Changeset 1e7a7033f60a…
Parent b3eaebd77fd1…
by
Changes to 10 files · Browse files at 1e7a7033f60a Showing diff from parent b3eaebd77fd1 Diff from another changeset...
@@ -7,7 +7,7 @@ import gtk
import os
import pango
-from dialog import question_dialog, error_dialog, info_dialog
+from dialog import error_dialog
from mercurial import hg, ui, cmdutil, util
from mercurial.i18n import _
import shlib
|
@@ -83,8 +83,3 @@ def warning_dialog(parent, primary, secondary):
""" Display a warning dialog with the given message. """
return _message_dialog(parent, gtk.MESSAGE_WARNING, primary, secondary)
-
-def question_dialog(parent, primary, secondary):
- """ Display a dialog with the given question. """
- return _message_dialog(parent, gtk.MESSAGE_QUESTION, primary, secondary,
- gtk.BUTTONS_YES_NO)
|
@@ -7,7 +7,7 @@ import gtk
import Queue
import sys
-from dialog import question_dialog, error_dialog
+from dialog import error_dialog
from mercurial import util
from mercurial.i18n import _
import shlib
|
@@ -6,10 +6,11 @@
import gtk
import sys
-from dialog import error_dialog, question_dialog
+from dialog import error_dialog
from mercurial.node import short, nullrev
from mercurial.i18n import _
from mercurial import util, hg, ui
+import gdialog
import hgcmd
import shlib
import histselect
@@ -194,8 +195,8 @@ _('please select revision to unmerge'))
return
- response = question_dialog(self, _('Undo merge'),
- _('and checkout revision %s?') % rev)
+ response = gdialog.Confirm(_('undo merge'), [], self,
+ _('and checkout revision %s?') % rev).run()
if response != gtk.RESPONSE_YES:
return
@@ -218,8 +219,8 @@ _('please enter revision to merge'))
return
- response = question_dialog(self, _('Really want to merge?'),
- _('with revision %s') % rev)
+ response = gdialog.Confirm(_('merge'), [], self,
+ _('with revision %s') % rev).run()
if response != gtk.RESPONSE_YES:
return
|
@@ -17,7 +17,8 @@ import time
import hglib
import shlib
-from dialog import question_dialog, error_dialog
+import gdialog
+from dialog import error_dialog
from mercurial.i18n import _
from mercurial import hg, ui, commands, cmdutil, util
from mercurial.hgweb import server
@@ -149,13 +150,14 @@ check if server is running, or to terminate if running
'''
if gservice and not gservice.stopped:
- if question_dialog(self, _('Really Exit?'),
+ ret = gdialog.Confirm(_('Really Exit?'), [], self,
_('Server process is still running\n'
- 'Exiting will stop the server.')) != gtk.RESPONSE_YES:
- return False
- else:
+ 'Exiting will stop the server.')).run()
+ if ret == gtk.RESPONSE_YES:
self._stop_server()
return True
+ else:
+ return False
else:
return True
|
@@ -13,7 +13,7 @@ import threading
from mercurial.i18n import _
from mercurial import hg, ui, util, extensions, url
-from dialog import error_dialog, question_dialog, info_dialog
+from dialog import error_dialog, info_dialog
from hglib import HgThread, fromutf, toutf, rootpath, RepoError
import shlib
import gtklib
|
@@ -6,7 +6,7 @@
import os
import gtk
-from dialog import question_dialog, error_dialog, info_dialog
+from dialog import error_dialog, info_dialog
from mercurial import hg, ui, cmdutil, util
from mercurial.i18n import _
from mercurial.node import short, nullid
|
@@ -13,9 +13,10 @@ import threading
from mercurial.i18n import _
from mercurial import hg, ui, util, url
-from dialog import error_dialog, question_dialog
+from dialog import error_dialog
from hglib import RepoError, toutf, fromutf, rootpath
import shlib
+import gdialog
import iniparse
_unspecstr = _('<unspecified>')
@@ -429,8 +430,9 @@
def should_live(self, *args):
if self.dirty:
- if question_dialog(self, _('Quit without saving?'),
- _('Yes to abandon changes, No to continue')) != gtk.RESPONSE_YES:
+ ret = gdialog.Confirm(_('quit without saving?'), [], self,
+ _('Yes to abandon changes, No to continue')).run()
+ if ret != gtk.RESPONSE_YES:
self.emit_stop_by_name('response')
return True
if len(args) == 2 and args[1] == gtk.RESPONSE_YES:
@@ -448,7 +450,6 @@ u.config('ui', 'editor') or
os.environ.get('EDITOR', 'vi'))
if os.path.basename(editor) in ('vi', 'vim', 'hgeditor'):
- import gdialog
gdialog.Prompt(_('No visual editor configured'),
_('Please configure a visual editor.'), self).run()
self.focus_field('tortoisehg.editor')
|
@@ -7,13 +7,14 @@ import os
import sys
import gtk
-from dialog import error_dialog, question_dialog
+from dialog import error_dialog
from mercurial import util, hg, ui
from mercurial.node import short, nullrev
from mercurial.i18n import _
from hglib import rootpath, toutf, RepoError
import shlib
import hgcmd
+import gdialog
class UpdateDialog(gtk.Window):
""" Dialog to update Mercurial repo """
@@ -163,8 +164,8 @@ _('please enter revision to update to'))
return
- response = question_dialog(self, _('Really want to update?'),
- _('to revision %s') % rev)
+ response = gdialog.Confirm(_('update'), [], self,
+ _('to revision %s') % rev).run()
if response != gtk.RESPONSE_YES:
return
|
Loading...