1
# Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26
from bzrlib.plugins.gtk import _i18n
27
from bzrlib.plugins.gtk.dialog import question_dialog
28
from bzrlib.plugins.loom import branch as loom_branch
30
class LoomDialog(gtk.Dialog):
31
"""Simple Loom browse dialog."""
33
def __init__(self, branch, parent=None):
34
gtk.Dialog.__init__(self, title="Threads",
37
buttons=(gtk.STOCK_CLOSE,gtk.RESPONSE_OK))
44
loom_branch.require_loom_branch(self.branch)
45
except loom_branch.NotALoom:
46
response = question_dialog(
47
_i18n("Upgrade to Loom branch?"),
48
_i18n("Branch is not a loom branch. Upgrade to Loom format?"),
50
# Doesn't set a parent for the dialog..
51
if response == gtk.RESPONSE_NO:
53
loom_branch.loomify(self.branch)
54
return super(LoomDialog, self).run()
57
self._threads_view = gtk.TreeView()
58
self._threads_view.show()
59
self.vbox.pack_start(self._threads_view)
61
# Buttons: combine-thread, export-loom, revert-loom, up-thread