~amduser29/tortoisebzr/trunk

« back to all changes in this revision

Viewing changes to commands/BranchCommand.py

  • Committer: Alexander Haro
  • Date: 2007-08-29 08:20:49 UTC
  • Revision ID: amduser29@gmail.com-20070829082049-d85wlfjc6erj96e0
Refactored the code so that every TBZRCommand derives from the same base class Command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
# You should have received a copy of the GNU General Public License
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
from Command import Command
 
17
 
 
18
class BranchCommand(Command):
 
19
    def __init__(self):
 
20
        Command.__init__(self)
 
21
        self.cmd_name = "Branch"
 
22
 
 
23
    def Run(self):
 
24
        self.dialog = BranchDialog(self.cmd_name)
 
25
        self.dialog.filename = self.filenames[0]
 
26
        self.dialog.Create()
 
27
 
16
28
import sys
17
29
import win32con
18
30
try:
40
52
IDC_LOG = 2940
41
53
 
42
54
class BranchDialog(BaseDialog):
43
 
    def __init__(self):
44
 
        BaseDialog.__init__(self)
45
 
        self.cmd_name = "Branch"
 
55
    def __init__(self, cmd_name):
 
56
        BaseDialog.__init__(self, cmd_name)
46
57
        self.file_browser = FileBrowser()
47
58
        
48
59
    @show_bzr_error
158
169
        return 1
159
170
        
160
171
    def OnHelpClick(self):
161
 
        import HelpDialog
162
 
        dialog = HelpDialog.HelpDialog()
163
 
        dialog.DoModal()
 
172
        from HelpCommand import HelpCommand
 
173
        command = HelpCommand()
 
174
        command.Run()
164
175
        return 1
165
176
 
166
177
    def OnLogClick(self):
167
 
        import LogDialog
168
 
        dialog = LogDialog.LogDialog()
169
 
        dialog.DoModal()
 
178
        from LogCommand import LogCommand
 
179
        command = LogCommand()
 
180
        command.Run()
170
181
        return 1
171
182
  
172
183
    def OnFileBrowseClick(self):
184
195
        self.EnableControl(win32con.IDOK, text != "")
185
196
        return 1
186
197
 
187
 
    def _get_template(self, class_name):
 
198
    def GetTemplate(self, class_name):
188
199
        DLG = []
189
200
        SIZE = (0, 0, 300, 160)
190
201
        STYLE = win32con.DS_FIXEDSYS | win32con.DS_MODALFRAME | win32con.WS_POPUP | win32con.WS_VISIBLE | win32con.WS_CAPTION | win32con.WS_SYSMENU | win32con.DS_SETFONT