/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to commit.py

  • Committer: Jasper Groenewegen
  • Date: 2008-07-27 12:01:40 UTC
  • mfrom: (576.3.2 improve-merge)
  • mto: This revision was merged to the branch mainline in revision 579.
  • Revision ID: colbrac@xs4all.nl-20080727120140-1agdlzkc9fumjk5f
Merge merge dialog improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import os.path
 
18
import re
 
19
 
17
20
try:
18
21
    import pygtk
19
22
    pygtk.require("2.0")
24
27
import gobject
25
28
import pango
26
29
 
27
 
import os.path
28
 
import re
29
 
 
30
30
from bzrlib import errors, osutils
31
31
from bzrlib.trace import mutter
32
32
from bzrlib.util import bencode
33
33
 
34
34
from bzrlib.plugins.gtk import _i18n
35
 
from dialog import error_dialog, question_dialog
36
 
from errors import show_bzr_error
 
35
from bzrlib.plugins.gtk.dialog import question_dialog
 
36
from bzrlib.plugins.gtk.errors import show_bzr_error
37
37
 
38
38
try:
39
39
    import dbus
105
105
                                  parent=parent,
106
106
                                  flags=0,
107
107
                                  buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))
108
 
        self._question_dialog = question_dialog
109
108
 
110
109
        self._wt = wt
111
110
        # TODO: Do something with this value, it is used by Olive
303
302
                            gtk.gdk.CONTROL_MASK, 0, self._on_accel_next)
304
303
        self.add_accel_group(group)
305
304
 
 
305
        # ignore the escape key (avoid closing the window)
 
306
        self.connect_object('close', self.emit_stop_by_name, 'close')
 
307
 
306
308
    def _construct_left_pane(self):
307
309
        self._left_pane_box = gtk.VBox(homogeneous=False, spacing=5)
308
310
        self._construct_file_list()
648
650
        message = self._get_global_commit_message()
649
651
 
650
652
        if message == '':
651
 
            response = self._question_dialog(
 
653
            response = question_dialog(
652
654
                _i18n('Commit with an empty message?'),
653
 
                _i18n('You can describe your commit intent in the message.'))
 
655
                _i18n('You can describe your commit intent in the message.'),
 
656
                parent=self)
654
657
            if response == gtk.RESPONSE_NO:
655
658
                # Kindly give focus to message area
656
659
                self._global_message_text_view.grab_focus()
668
671
        #       entirely, since there isn't a way for them to add the unknown
669
672
        #       files at this point.
670
673
        for path in self._wt.unknowns():
671
 
            response = self._question_dialog(
 
674
            response = question_dialog(
672
675
                _i18n("Commit with unknowns?"),
673
 
                _i18n("Unknown files exist in the working tree. Commit anyway?"))
 
676
                _i18n("Unknown files exist in the working tree. Commit anyway?"),
 
677
                parent=self)
 
678
                # Doesn't set a parent for the dialog..
674
679
            if response == gtk.RESPONSE_NO:
675
680
                return
676
681
            break
687
692
                       specific_files=specific_files,
688
693
                       revprops=revprops)
689
694
        except errors.PointlessCommit:
690
 
            response = self._question_dialog(
 
695
            response = question_dialog(
691
696
                _i18n('Commit with no changes?'),
692
697
                _i18n('There are no changes in the working tree.'
693
 
                      ' Do you want to commit anyway?'))
 
698
                      ' Do you want to commit anyway?'),
 
699
                parent=self)
694
700
            if response == gtk.RESPONSE_YES:
695
701
                rev_id = self._wt.commit(message,
696
702
                               allow_pointless=True,