[Pkg-bazaar-commits] ./bzr-gtk/unstable r89: Rename OliveBranch -> BranchDialog.
Jelmer Vernooij
jelmer at samba.org
Fri Apr 10 07:49:18 UTC 2009
------------------------------------------------------------
revno: 89
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: bzr-gtk
timestamp: Wed 2006-10-04 21:11:46 +0200
message:
Rename OliveBranch -> BranchDialog.
modified:
olive/__init__.py
olive/branch.py
olive/commit.py
olive/dialog.py
olive/menu.py
-------------- next part --------------
=== modified file 'olive/__init__.py'
--- a/olive/__init__.py 2006-09-30 13:04:15 +0000
+++ b/olive/__init__.py 2006-10-04 19:11:46 +0000
@@ -17,6 +17,10 @@
import os
import sys
+# gettext support
+import gettext
+gettext.install('olive-gtk')
+
try:
import pygtk
pygtk.require("2.0")
@@ -200,8 +204,8 @@
def on_menuitem_branch_get_activate(self, widget):
""" Branch/Get... menu handler. """
- from branch import OliveBranch
- branch = OliveBranch(self.get_path())
+ from branch import BranchDialog
+ branch = BranchDialog(self.get_path())
branch.display()
def on_menuitem_branch_checkout_activate(self, widget):
@@ -212,8 +216,8 @@
def on_menuitem_branch_commit_activate(self, widget):
""" Branch/Commit... menu handler. """
- from commit import OliveCommit
- commit = OliveCommit(self.wt, self.wtpath)
+ from commit import CommitDialog
+ commit = CommitDialog(self.wt, self.wtpath)
commit.display()
def on_menuitem_branch_missing_revisions_activate(self, widget):
@@ -607,7 +611,6 @@
def set_sensitivity(self):
""" Set menu and toolbar sensitivity. """
self.menuitem_branch_init.set_sensitive(self.notbranch)
- self.menuitem_branch_get.set_sensitive(self.notbranch)
self.menuitem_branch_checkout.set_sensitive(self.notbranch)
self.menuitem_branch_pull.set_sensitive(not self.notbranch)
self.menuitem_branch_push.set_sensitive(not self.notbranch)
@@ -713,7 +716,7 @@
for rpath, id, kind in delta.added:
if rpath == filename:
status = 'added'
- for rpath, id, kind, text_modified, meta_modified in delta.removed:
+ for rpath, id, kind in delta.removed:
if rpath == filename:
status = 'removed'
for rpath, id, kind, text_modified, meta_modified in delta.modified:
=== modified file 'olive/branch.py'
--- a/olive/branch.py 2006-09-30 09:09:18 +0000
+++ b/olive/branch.py 2006-10-04 19:11:46 +0000
@@ -28,10 +28,10 @@
from bzrlib.branch import Branch
import bzrlib.errors as errors
-from olive import gladefile
+from __init__ import gladefile
from dialog import error_dialog, info_dialog
-class OliveBranch:
+class BranchDialog:
""" Display branch dialog and perform the needed operations. """
def __init__(self, path=None):
""" Initialize the Branch dialog. """
=== modified file 'olive/commit.py'
--- a/olive/commit.py 2006-09-30 13:04:15 +0000
+++ b/olive/commit.py 2006-10-04 19:11:46 +0000
@@ -30,7 +30,7 @@
from dialog import error_dialog
from olive import gladefile
-class OliveCommit:
+class CommitDialog:
""" Display Commit dialog and perform the needed actions. """
def __init__(self, wt, wtpath):
""" Initialize the Commit dialog. """
=== modified file 'olive/dialog.py'
--- a/olive/dialog.py 2006-09-30 13:04:15 +0000
+++ b/olive/dialog.py 2006-10-04 19:11:46 +0000
@@ -23,61 +23,60 @@
import gtk
import gtk.glade
-from olive import gladefile
def about():
- """ Display the AboutDialog. """
- import olive
-
- # Load AboutDialog description
- dglade = gtk.glade.XML(gladefile, 'aboutdialog')
- dialog = dglade.get_widget('aboutdialog')
-
- # Set version
- dialog.set_version(olive.__version__)
-
- # Destroy the dialog
- if dialog.run() == gtk.RESPONSE_CANCEL:
- dialog.destroy()
+ """ Display the AboutDialog. """
+ import olive
+
+ # Load AboutDialog description
+ dglade = gtk.glade.XML(olive.gladefile, 'aboutdialog')
+ dialog = dglade.get_widget('aboutdialog')
+
+ # Set version
+ dialog.set_version(olive.__version__)
+
+ # Destroy the dialog
+ if dialog.run() == gtk.RESPONSE_CANCEL:
+ dialog.destroy()
def _message_dialog(type, primary, secondary):
- """ Display a given type of MessageDialog with the given message.
-
- :param type: error | warning | info
-
- :param message: the message you want to display.
- """
- if type == 'error':
- dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
- type=gtk.MESSAGE_ERROR,
- buttons=gtk.BUTTONS_OK)
- dialog.set_markup('<big><b>' + primary + '</b></big>')
- elif type == 'warning':
- dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
- type=gtk.MESSAGE_WARNING,
- buttons=gtk.BUTTONS_OK)
- dialog.set_markup('<big><b>' + primary + '</b></big>')
- elif type == 'info':
- dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
- type=gtk.MESSAGE_INFO,
- buttons=gtk.BUTTONS_OK)
- dialog.set_markup('<big><b>' + primary + '</b></big>')
- else:
- return
-
- dialog.format_secondary_markup(secondary)
-
- if dialog.run() == gtk.RESPONSE_OK:
- dialog.destroy()
+ """ Display a given type of MessageDialog with the given message.
+
+ :param type: error | warning | info
+
+ :param message: the message you want to display.
+ """
+ if type == 'error':
+ dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
+ type=gtk.MESSAGE_ERROR,
+ buttons=gtk.BUTTONS_OK)
+ dialog.set_markup('<big><b>' + primary + '</b></big>')
+ elif type == 'warning':
+ dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
+ type=gtk.MESSAGE_WARNING,
+ buttons=gtk.BUTTONS_OK)
+ dialog.set_markup('<big><b>' + primary + '</b></big>')
+ elif type == 'info':
+ dialog = gtk.MessageDialog(flags=gtk.DIALOG_MODAL,
+ type=gtk.MESSAGE_INFO,
+ buttons=gtk.BUTTONS_OK)
+ dialog.set_markup('<big><b>' + primary + '</b></big>')
+ else:
+ return
+
+ dialog.format_secondary_markup(secondary)
+
+ if dialog.run() == gtk.RESPONSE_OK:
+ dialog.destroy()
def error_dialog(primary, secondary):
- """ Display an error dialog with the given message. """
- _message_dialog('error', primary, secondary)
+ """ Display an error dialog with the given message. """
+ _message_dialog('error', primary, secondary)
def info_dialog(primary, secondary):
- """ Display an info dialog with the given message. """
- _message_dialog('info', primary, secondary)
+ """ Display an info dialog with the given message. """
+ _message_dialog('info', primary, secondary)
def warning_dialog(primary, secondary):
- """ Display a warning dialog with the given message. """
- _message_dialog('warning', primary, secondary)
+ """ Display a warning dialog with the given message. """
+ _message_dialog('warning', primary, secondary)
=== modified file 'olive/menu.py'
--- a/olive/menu.py 2006-09-30 13:04:15 +0000
+++ b/olive/menu.py 2006-10-04 19:11:46 +0000
@@ -203,9 +203,9 @@
def commit(self, action):
""" Right context menu -> Commit """
- from commit import OliveCommit
+ from commit import CommitDialog
wt, path = WorkingTree.open_containing(self.path)
- commit = OliveCommit(wt, path)
+ commit = CommitDialog(wt, path)
commit.display()
def diff(self, action):
More information about the Pkg-bazaar-commits
mailing list