/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 push.py

  • Committer: Curtis Hovey
  • Date: 2012-03-03 22:06:53 UTC
  • mto: This revision was merged to the branch mainline in revision 782.
  • Revision ID: sinzui.is@verizon.net-20120303220653-ci28pi8cevecyzr9
Added tests for push __init__.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        super(PushDialog, self).__init__(
44
44
            title="Push", parent=parent, flags=0,
45
45
            buttons=(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE))
 
46
        self.branch = branch
46
47
 
47
 
        # Get arguments
 
48
        # Unused arguments
48
49
        self.repository = repository
49
50
        self.revid = revid
50
 
        self.branch = branch
51
51
 
52
52
        # Create the widgets
53
53
        self._label_location = Gtk.Label(label=_i18n("Location:"))
72
72
        self.get_action_area().pack_end(self._button_push, True, True, 0)
73
73
 
74
74
        # Set progress pane.
75
 
        self.progress_widget = ProgressPanel()
76
 
        ui.ui_factory.set_progress_bar_widget(self.progress_widget)
 
75
        self._progress_widget = ProgressPanel()
 
76
        ui.ui_factory.set_progress_bar_widget(self._progress_widget)
77
77
        self.get_content_area().pack_start(
78
 
            self.progress_widget, False, False, 0)
79
 
        self.push_message = Gtk.Label()
 
78
            self._progress_widget, False, False, 0)
 
79
        self._push_message = Gtk.Label()
80
80
        alignment = Gtk.Alignment.new(0.0, 0.5, 0.0, 0.0)
81
 
        alignment.add(self.push_message)
 
81
        alignment.add(self._push_message)
82
82
        self.get_content_area().pack_start(alignment, False, False, 0)
83
83
 
84
84
        # Show the dialog
85
85
        self.get_content_area().show_all()
86
 
        self.progress_widget.hide()
 
86
        self._progress_widget.hide()
 
87
        self._push_message.hide()
87
88
 
88
89
        # Build location history
89
90
        self._history = UrlHistory(self.branch.get_config(), 'push_history')
109
110
    @show_bzr_error
110
111
    def _on_push_clicked(self, widget):
111
112
        """Push button clicked handler. """
112
 
        self.push_message.hide()
113
 
        self.progress_widget.tick()
 
113
        self._push_message.hide()
 
114
        self._progress_widget.tick()
114
115
        location = self._combo.get_child().get_text()
115
116
 
116
117
        try:
130
131
            and self.branch.get_push_location() is None):
131
132
            self.branch.set_push_location(location)
132
133
        if message:
133
 
            self.progress_widget.finished()
134
 
            self.push_message.props.label = message
135
 
            self.push_message.show()
 
134
            self._progress_widget.finished()
 
135
            self._push_message.props.label = message
 
136
            self._push_message.show()
136
137
        message
137
138
 
138
139