John A Meinel wrote:
> Alexander Belchenko wrote:
>> It works for me actually. Sorry for the noise.
>
>
> So it still doesn't work for me for merge, push, and pull
>
> Other windows like branch seem to have settings in qbzr.conf.
>
> Hmm... they have settings but the changes are not remembered.
>
> Maybe it is because I'm using PyQt 4.5.2 on python2.6?
>
> I don't see any failure warnings, etc. in ~/.bzr.log is there something
> I can do to help debug this?
>
> John
> =:->
>
So I started adding some 'print' statements into qbzr, and while I see:
$ bzr qcommit
_QBzrWindowBase.restoreSize (CommitWindow), commit
Committing to: C:/Users/jameinel/dev/,tmp/a/
modified foo
Committed revision 3.
I never see "saveSize()" getting called.
I tracked things down to _QBzrWindowBase.closeEvent() which is the only
bit of code I could find that was calling saveSize().
So I started tracking down through the call paths of closeEvent and I
think I have it sorted out.
Specifically, SubProcessDialog.closeEvent is:
def closeEvent(self, event):
if not self.process_widget.is_running(): QBzrDialog.closeEvent(self, event)
else: self.process_widget.abort() event.ignore()
And if check QBzrDialog I have:
class QBzrDialog(QtGui.QDialog, _QBzrWindowBase):
and it is on _QBzrWindowBase that you have:
def closeEvent(self, event): self.closing = True self.saveSize()
for window in self.windows:
if window.isVisible(): window.close() event.accept()
My guess is that PyQt 4.5.2 now implements a closeEvent function, and
you are using multi-inheritance and expecting all members to get called.
However because you have:
class QBzrDialog(QtGui.QDialog, _QBzrWindowBase):
Only the QDialog.closeEvent is getting called, and not your custom
implementation. and QDialog.closeEvent() isn't calling
super(...).closeEvent() in order to handle the multi-inheritance issue.
I don't really know the correct answer, but I can say that multiple
inheritance is hurting you here. It may be that the PyQt wrappers don't
play well with multiple inheritance.
I also notice that "_QBzrWindowBase" is a bare class, not a subclass of
QObject or 'object', which may complicate things even more. (without
subclassing 'object' you get an old-style class, which acts differently
in python than new-style classes.)
However, neither
class _QBzrWindowBase(QtCore.QObject):
nor
class _QBzrWindowBase(object):
caused things to work. The only thing that worked was the above. Or
possibly:
=== modified file 'lib/util.py'
- --- lib/util.py 2009-08-20 13:23:27 +0000
+++ lib/util.py 2009-09-23 15:25:01 +0000
@@ -407,6 +407,10 @@
def do_reject(self): self.reject()
In versions of PyQt earlier than v4.5 there were restrictions on the use
of super with PyQt classes. These restrictions no longer apply with v4.5
and later.
So my guess is that PyQt <4.5 isn't inheriting from 'object' and as of
4.5 it started inheriting from 'object', and that probably changed the
final effect of multiple inheritance and method resolution order.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John A Meinel wrote:
> Alexander Belchenko wrote:
>> It works for me actually. Sorry for the noise.
>
>
> So it still doesn't work for me for merge, push, and pull
>
> Other windows like branch seem to have settings in qbzr.conf.
>
> Hmm... they have settings but the changes are not remembered.
>
> Maybe it is because I'm using PyQt 4.5.2 on python2.6?
>
> I don't see any failure warnings, etc. in ~/.bzr.log is there something
> I can do to help debug this?
>
> John
> =:->
>
So I started adding some 'print' statements into qbzr, and while I see: .restoreSize (CommitWindow), commit jameinel/ dev/,tmp/ a/
$ bzr qcommit
_QBzrWindowBase
Committing to: C:/Users/
modified foo
Committed revision 3.
I never see "saveSize()" getting called.
I tracked things down to _QBzrWindowBase .closeEvent( ) which is the only
bit of code I could find that was calling saveSize().
So I started tracking down through the call paths of closeEvent and I
think I have it sorted out.
Specifically, SubProcessDialo g.closeEvent is:
def closeEvent(self, event): widget. is_running( ):
QBzrDialog .closeEvent( self, event)
self. process_ widget. abort()
event. ignore( )
if not self.process_
else:
And if check QBzrDialog I have:
class QBzrDialog( QtGui.QDialog, _QBzrWindowBase):
and it is on _QBzrWindowBase that you have:
def closeEvent(self, event):
self.closing = True
self.saveSize( )
window. close()
event. accept( )
for window in self.windows:
if window.isVisible():
My guess is that PyQt 4.5.2 now implements a closeEvent function, and
you are using multi-inheritance and expecting all members to get called.
However because you have:
class QBzrDialog( QtGui.QDialog, _QBzrWindowBase):
Only the QDialog.closeEvent is getting called, and not your custom closeEvent( ) isn't calling ..).closeEvent( ) in order to handle the multi-inheritance issue.
implementation. and QDialog.
super(.
As somewhat proof of this, if I do:
=== modified file 'lib/util.py'
self. closing = False
- --- lib/util.py 2009-08-20 13:23:27 +0000
+++ lib/util.py 2009-09-23 15:12:57 +0000
@@ -390,7 +390,7 @@
- -class QBzrDialog( QtGui.QDialog, _QBzrWindowBase): _QBzrWindowBase , QtGui.QDialog):
+class QBzrDialog(
def __init__(self, title=None, parent=None, ui_mode=True):
self. ui_mode = ui_mode
Then settings are properly saved again....
I don't really know the correct answer, but I can say that multiple
inheritance is hurting you here. It may be that the PyQt wrappers don't
play well with multiple inheritance.
I also notice that "_QBzrWindowBase" is a bare class, not a subclass of
QObject or 'object', which may complicate things even more. (without
subclassing 'object' you get an old-style class, which acts differently
in python than new-style classes.)
However, neither (QtCore. QObject) : (object) :
class _QBzrWindowBase
nor
class _QBzrWindowBase
caused things to work. The only thing that worked was the above. Or
self. reject( )
possibly:
=== modified file 'lib/util.py'
- --- lib/util.py 2009-08-20 13:23:27 +0000
+++ lib/util.py 2009-09-23 15:25:01 +0000
@@ -407,6 +407,10 @@
def do_reject(self):
+ def closeEvent(self, event): closeEvent( self, event) .closeEvent( self, event)
+ QtGui.QDialog.
+ _QBzrWindowBase
+
Note that the PyQt docs say this: www.riverbankco mputing. co.uk/static/ Docs/PyQt4/ pyqt4ref. html#multiple- inheritance
http://
14.3 Multiple Inheritance
It is not possible to define a new Python class that sub-classes from
more than one Qt class.
It also says: www.riverbankco mputing. co.uk/static/ Docs/PyQt4/ pyqt4ref. html#super- and-pyqt- classes
http://
14.7 super and PyQt Classes
In versions of PyQt earlier than v4.5 there were restrictions on the use
of super with PyQt classes. These restrictions no longer apply with v4.5
and later.
So my guess is that PyQt <4.5 isn't inheriting from 'object' and as of
4.5 it started inheriting from 'object', and that probably changed the
final effect of multiple inheritance and method resolution order.
If you look at the python documentation: docs.python. org/tutorial/ classes. html#multiple- inheritance
http://
It says that for "old-style classes the only rule is:
depth-first, left-to-right
"
Which means that if QtCore.QDialog implements a closeEvent() then
class QBzrDialog( QtGui.QDialog, _QBzrWindowBase):
Will always call the QDialog.closeEvent *first*, since it is the
'leftmost' parent.
The alternative with new-style classes is the mro, which is defined more www.python. org/download/ releases/ 2.3/mro/
in detail here:
http://
Anyway, I'm trying to get to the sources for the closeEvent stuff, I'll
see where I get to.
John enigmail. mozdev. org/
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://
iEYEARECAAYFAkq 6QS0ACgkQJdeBCY SNAAP7OgCgz2GB5 lniM5HPLQkbyPv/ tpLw f3IVgDe1zUFprgQ xKRHkbdCeW
SucAnj/
=Ipfi
-----END PGP SIGNATURE-----