[Pkg-bazaar-commits] ./bzr-gtk/unstable r104: Merged Alexander Belchenko's bugfixes.
Szilveszter Farkas (Phanatic)
Szilveszter.Farkas at gmail.com
Fri Apr 10 07:49:07 UTC 2009
------------------------------------------------------------
revno: 104
committer: Szilveszter Farkas (Phanatic) <Szilveszter.Farkas at gmail.com>
branch nick: bzr-gtk
timestamp: Wed 2006-10-25 11:21:40 +0200
message:
Merged Alexander Belchenko's bugfixes.
added:
olive/gladefile.py
modified:
__init__.py
olive/__init__.py
olive/add.py
olive/bookmark.py
olive/branch.py
olive/checkout.py
olive/commit.py
olive/dialog.py
olive/info.py
olive/merge.py
olive/mkdir.py
olive/move.py
olive/push.py
olive/remove.py
olive/rename.py
olive/status.py
------------------------------------------------------------
revno: 93.1.6
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr-gtk.win32.bialix
timestamp: Wed 2006-10-25 11:34:09 +0300
message:
detecting name of glade file doing in separate module (olive.gladefile)
This fix problem with gcommit (Bug 68127: glade file not found)
added:
olive/gladefile.py
modified:
olive/__init__.py
olive/add.py
olive/bookmark.py
olive/branch.py
olive/checkout.py
olive/commit.py
olive/dialog.py
olive/info.py
olive/merge.py
olive/mkdir.py
olive/move.py
olive/push.py
olive/remove.py
olive/rename.py
olive/status.py
------------------------------------------------------------
revno: 93.1.7
committer: Alexander Belchenko <bialix at ukr.net>
branch nick: bzr-gtk.win32.bialix
timestamp: Wed 2006-10-25 12:00:02 +0300
message:
Fix gcommit bug 66937 (bzr still running after cancel/commit clicked)
modified:
__init__.py
olive/commit.py
-------------- next part --------------
=== modified file '__init__.py'
--- a/__init__.py 2006-10-08 20:51:52 +0000
+++ b/__init__.py 2006-10-25 09:00:02 +0000
@@ -215,7 +215,7 @@
(wt, path) = WorkingTree.open_containing(filename)
- dialog = CommitDialog(wt, path)
+ dialog = CommitDialog(wt, path, standalone=True)
dialog.display()
gtk.main()
=== modified file 'olive/__init__.py'
--- a/olive/__init__.py 2006-10-24 06:38:50 +0000
+++ b/olive/__init__.py 2006-10-25 08:34:09 +0000
@@ -38,23 +38,8 @@
# Olive GTK UI version
__version__ = '0.11.0'
-# Load the glade file
-if sys.platform == 'win32':
- gladefile = os.path.dirname(sys.executable) + "/share/olive/olive.glade"
-else:
- gladefile = "/usr/share/olive/olive.glade"
-
-if not os.path.exists(gladefile):
- # Load from sources directory if not installed
- dir_ = os.path.split(os.path.dirname(__file__))[0]
- gladefile = os.path.join(dir_, "olive.glade")
- # Check again
- if not os.path.exists(gladefile):
- # Fail
- print _('Glade file cannot be found.')
- sys.exit(1)
-
from dialog import error_dialog, info_dialog
+from gladefile import GLADEFILENAME
# import this classes only once
try:
@@ -74,7 +59,7 @@
program. """
def __init__(self):
- self.toplevel = gtk.glade.XML(gladefile, 'window_main', 'olive-gtk')
+ self.toplevel = gtk.glade.XML(GLADEFILENAME, 'window_main', 'olive-gtk')
self.window = self.toplevel.get_widget('window_main')
=== modified file 'olive/add.py'
--- a/olive/add.py 2006-10-03 06:44:48 +0000
+++ b/olive/add.py 2006-10-25 08:34:09 +0000
@@ -28,14 +28,15 @@
import bzrlib.add
import bzrlib.errors as errors
-from olive import gladefile
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
class OliveAdd:
""" Display the Add file(s) dialog and perform the needed actions. """
def __init__(self, wt, wtpath, selected=[]):
""" Initialize the Add file(s) dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_add', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_add', 'olive-gtk')
self.window = self.glade.get_widget('window_add')
=== modified file 'olive/bookmark.py'
--- a/olive/bookmark.py 2006-09-29 22:22:20 +0000
+++ b/olive/bookmark.py 2006-10-25 08:34:09 +0000
@@ -23,14 +23,16 @@
import gtk
import gtk.glade
-from olive import gladefile, OlivePreferences
+from olive import OlivePreferences
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
class OliveBookmark:
""" Display the Edit bookmark dialog and perform the needed actions. """
def __init__(self, selected):
""" Initialize the Edit bookmark dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_bookmark', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_bookmark', 'olive-gtk')
self.window = self.glade.get_widget('window_bookmark')
=== modified file 'olive/branch.py'
--- a/olive/branch.py 2006-10-04 19:11:46 +0000
+++ b/olive/branch.py 2006-10-25 08:34:09 +0000
@@ -28,14 +28,15 @@
from bzrlib.branch import Branch
import bzrlib.errors as errors
-from __init__ import gladefile
from dialog import error_dialog, info_dialog
+from gladefile import GLADEFILENAME
+
class BranchDialog:
""" Display branch dialog and perform the needed operations. """
def __init__(self, path=None):
""" Initialize the Branch dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_branch', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_branch', 'olive-gtk')
self.window = self.glade.get_widget('window_branch')
=== modified file 'olive/checkout.py'
--- a/olive/checkout.py 2006-09-30 09:18:20 +0000
+++ b/olive/checkout.py 2006-10-25 08:34:09 +0000
@@ -30,14 +30,15 @@
import bzrlib.errors as errors
import bzrlib.osutils
-from olive import gladefile
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
class OliveCheckout:
""" Display checkout dialog and perform the needed operations. """
def __init__(self, path=None):
""" Initialize the Checkout dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_checkout', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_checkout', 'olive-gtk')
self.window = self.glade.get_widget('window_checkout')
=== modified file 'olive/commit.py'
--- a/olive/commit.py 2006-10-15 17:47:36 +0000
+++ b/olive/commit.py 2006-10-25 09:00:02 +0000
@@ -28,17 +28,25 @@
import bzrlib.errors as errors
from dialog import error_dialog
-from olive import gladefile
+from gladefile import GLADEFILENAME
+
class CommitDialog:
""" Display Commit dialog and perform the needed actions. """
- def __init__(self, wt, wtpath):
- """ Initialize the Commit dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_commit', 'olive-gtk')
+ def __init__(self, wt, wtpath, standalone=False):
+ """ Initialize the Commit dialog.
+ @param wt: bzr working tree object
+ @param wtpath: path to working tree root
+ @param standalone: when used in gcommit command as standalone window
+ this argument should be True
+ """
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_commit', 'olive-gtk')
self.wt = wt
self.wtpath = wtpath
+ self.standalone = standalone
+
# Get some important widgets
self.window = self.glade.get_widget('window_commit')
self.checkbutton_local = self.glade.get_widget('checkbutton_commit_local')
@@ -64,6 +72,9 @@
# Dictionary for signal_autoconnect
dic = { "on_button_commit_commit_clicked": self.commit,
"on_button_commit_cancel_clicked": self.close }
+
+ if self.standalone:
+ dic["on_button_commit_cancel_clicked"] = self.quit
# Connect the signals to the handlers
self.glade.signal_autoconnect(dic)
@@ -270,8 +281,15 @@
except Exception, msg:
error_dialog(_('Unknown error'), str(msg))
return
-
- self.close()
+
+ if not self.standalone:
+ self.close()
+ else:
+ self.quit()
def close(self, widget=None):
self.window.destroy()
+
+ def quit(self, widget=None):
+ self.close(widget)
+ gtk.main_quit()
=== modified file 'olive/dialog.py'
--- a/olive/dialog.py 2006-10-04 19:11:46 +0000
+++ b/olive/dialog.py 2006-10-25 08:34:09 +0000
@@ -27,9 +27,10 @@
def about():
""" Display the AboutDialog. """
import olive
+ from gladefile import GLADEFILENAME
# Load AboutDialog description
- dglade = gtk.glade.XML(olive.gladefile, 'aboutdialog')
+ dglade = gtk.glade.XML(GLADEFILENAME, 'aboutdialog')
dialog = dglade.get_widget('aboutdialog')
# Set version
=== added file 'olive/gladefile.py'
--- a/olive/gladefile.py 1970-01-01 00:00:00 +0000
+++ b/olive/gladefile.py 2006-10-25 08:34:09 +0000
@@ -0,0 +1,36 @@
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+"""Glade file name"""
+
+import os
+import sys
+
+
+# Get the glade file name
+if sys.platform == 'win32':
+ GLADEFILENAME = os.path.join(os.path.dirname(sys.executable),
+ "share/olive/olive.glade")
+else:
+ GLADEFILENAME = "/usr/share/olive/olive.glade"
+
+if not os.path.isfile(GLADEFILENAME):
+ # Load from sources directory if not installed
+ dir_ = os.path.split(os.path.dirname(__file__))[0]
+ GLADEFILENAME = os.path.join(dir_, "olive.glade")
+ # Check again
+ if not os.path.isfile(GLADEFILENAME):
+ # Fail
+ print _('Glade file cannot be found.')
+ sys.exit(1)
=== modified file 'olive/info.py'
--- a/olive/info.py 2006-09-30 13:04:15 +0000
+++ b/olive/info.py 2006-10-25 08:34:09 +0000
@@ -25,8 +25,9 @@
import bzrlib.errors as errors
-from olive import gladefile
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
def info(location):
""" Get info about branch, working tree, and repository
@@ -143,7 +144,7 @@
""" Display Informations window and perform the needed actions. """
def __init__(self, wt):
""" Initialize the Informations window. """
- self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
# Get the Informations window widget
self.window = self.glade.get_widget('window_info')
=== modified file 'olive/merge.py'
--- a/olive/merge.py 2006-10-17 23:47:33 +0000
+++ b/olive/merge.py 2006-10-25 08:34:09 +0000
@@ -28,14 +28,15 @@
from bzrlib.branch import Branch
import bzrlib.errors as errors
-from __init__ import gladefile
from dialog import error_dialog, info_dialog, warning_dialog
+from gladefile import GLADEFILENAME
+
class MergeDialog:
""" Display the Merge dialog and perform the needed actions. """
def __init__(self, wt, wtpath):
""" Initialize the Merge dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_merge', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_merge', 'olive-gtk')
self.window = self.glade.get_widget('window_merge')
=== modified file 'olive/mkdir.py'
--- a/olive/mkdir.py 2006-09-30 13:04:15 +0000
+++ b/olive/mkdir.py 2006-10-25 08:34:09 +0000
@@ -27,14 +27,15 @@
import bzrlib.errors as errors
-from olive import gladefile
from dialog import error_dialog, warning_dialog
+from gladefile import GLADEFILENAME
+
class OliveMkdir:
""" Display the Make directory dialog and perform the needed actions. """
def __init__(self, wt, wtpath):
""" Initialize the Make directory dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_mkdir', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_mkdir', 'olive-gtk')
self.window = self.glade.get_widget('window_mkdir')
=== modified file 'olive/move.py'
--- a/olive/move.py 2006-09-30 13:04:15 +0000
+++ b/olive/move.py 2006-10-25 08:34:09 +0000
@@ -29,14 +29,15 @@
import bzrlib.errors as errors
from bzrlib.workingtree import WorkingTree
-from olive import gladefile
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
class OliveMove:
""" Display the Move dialog and perform the needed actions. """
def __init__(self, wt, wtpath, selected=[]):
""" Initialize the Move dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_move', 'olive-gtk')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_move', 'olive-gtk')
self.window = self.glade.get_widget('window_move')
=== modified file 'olive/push.py'
--- a/olive/push.py 2006-10-24 06:38:50 +0000
+++ b/olive/push.py 2006-10-25 08:34:09 +0000
@@ -26,14 +26,15 @@
import bzrlib.errors as errors
-from olive import gladefile
from dialog import error_dialog, info_dialog
+from gladefile import GLADEFILENAME
+
class OlivePush:
""" Display Push dialog and perform the needed actions. """
def __init__(self, branch):
""" Initialize the Push dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_push')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_push')
self.window = self.glade.get_widget('window_push')
=== modified file 'olive/remove.py'
--- a/olive/remove.py 2006-10-03 06:44:48 +0000
+++ b/olive/remove.py 2006-10-25 08:34:09 +0000
@@ -27,14 +27,15 @@
import bzrlib.errors as errors
-from olive import gladefile
from dialog import error_dialog, warning_dialog
+from gladefile import GLADEFILENAME
+
class OliveRemove:
""" Display the Remove file(s) dialog and perform the needed actions. """
def __init__(self, wt, wtpath, selected=[]):
""" Initialize the Remove file(s) dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_remove')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_remove')
self.window = self.glade.get_widget('window_remove')
=== modified file 'olive/rename.py'
--- a/olive/rename.py 2006-09-30 13:04:15 +0000
+++ b/olive/rename.py 2006-10-25 08:34:09 +0000
@@ -28,14 +28,15 @@
import bzrlib.errors as errors
from bzrlib.workingtree import WorkingTree
-from olive import gladefile
from dialog import error_dialog
+from gladefile import GLADEFILENAME
+
class OliveRename:
""" Display the Rename dialog and perform the needed actions. """
def __init__(self, wt, wtpath, selected=[]):
""" Initialize the Rename dialog. """
- self.glade = gtk.glade.XML(gladefile, 'window_rename')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_rename')
self.window = self.glade.get_widget('window_rename')
=== modified file 'olive/status.py'
--- a/olive/status.py 2006-09-30 13:04:15 +0000
+++ b/olive/status.py 2006-10-25 08:34:09 +0000
@@ -23,13 +23,14 @@
import gtk
import gtk.glade
-from olive import gladefile
+from gladefile import GLADEFILENAME
+
class OliveStatus:
""" Display Status window and perform the needed actions. """
def __init__(self, wt, wtpath):
""" Initialize the Status window. """
- self.glade = gtk.glade.XML(gladefile, 'window_status')
+ self.glade = gtk.glade.XML(GLADEFILENAME, 'window_status')
# Get the Status window widget
self.window = self.glade.get_widget('window_status')
More information about the Pkg-bazaar-commits
mailing list