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

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-08-03 10:44:56 UTC
  • mto: (0.14.1 main) (93.1.1 win32.bialix)
  • mto: This revision was merged to the branch mainline in revision 83.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060803104456-b5f901b6775ef158
Push dialog now displays stored location

2006-08-03  Szilveszter Farkas <Szilveszter.Farkas@gmail.com>

    * olive/frontend/gtk/push.py: display known push location if available
    * olive/backend/info.py: implemented get_push_location()

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
import olive.backend.commit as commit
32
32
import olive.backend.errors as errors
 
33
import olive.backend.info as info
33
34
 
34
35
class OlivePush:
35
36
    """ Display Push dialog and perform the needed actions. """
52
53
        self.glade.signal_autoconnect(dic)
53
54
        
54
55
        # Get some useful widgets
 
56
        self.entry_stored = self.glade.get_widget('entry_push_stored')
55
57
        self.entry_location = self.glade.get_widget('entry_push_location')
56
58
        self.check_remember = self.glade.get_widget('checkbutton_push_remember')
57
59
        self.check_overwrite = self.glade.get_widget('checkbutton_push_overwrite')
58
60
        self.check_create = self.glade.get_widget('checkbutton_push_create')
 
61
        
 
62
        # Get stored location
 
63
        loc = info.get_push_location(self.comm.get_path())
 
64
        if loc != '':
 
65
            self.entry_stored.set_text(loc)
59
66
    
60
67
    def display(self):
61
68
        """ Display the Push dialog. """
64
71
    
65
72
    def stored_toggled(self, widget):
66
73
        if widget.get_active():
 
74
            self.entry_stored.show()
67
75
            self.entry_location.hide()
68
76
            self.check_remember.hide()
69
 
            self.check_overwrite.hide()
70
77
            self.check_create.hide()
71
78
            self.window.resize(self.width, self.height)
72
79
        else:
 
80
            self.entry_stored.hide()
73
81
            self.entry_location.show()
74
82
            self.check_remember.show()
75
 
            self.check_overwrite.show()
76
83
            self.check_create.show()
77
84
    
78
85
    def specific_toggled(self, widget):
79
86
        if widget.get_active():
 
87
            self.entry_stored.hide()
80
88
            self.entry_location.show()
81
89
            self.check_remember.show()
82
 
            self.check_overwrite.show()
83
90
            self.check_create.show()
84
91
        else:
 
92
            self.entry_stored.show()
85
93
            self.entry_location.hide()
86
94
            self.check_remember.hide()
87
 
            self.check_overwrite.hide()
88
95
            self.check_create.hide()
89
96
    
90
97
    def push(self, widget):
98
105
        self.comm.set_busy(self.window)
99
106
        if radio_stored.get_active():
100
107
            try:
101
 
                revs = commit.push(self.comm.get_path())
 
108
                revs = commit.push(self.comm.get_path(),
 
109
                                   overwrite=self.check_overwrite.get_active())
102
110
            except errors.NotBranchError:
103
111
                dialog.error_dialog('Directory is not a branch.')
104
112
                return