Open GoogleCodeExporter opened 9 years ago
With the Open dialog it happen's something similar. It shows just a part of the
dialog.
Original comment by andresgattinoni
on 4 Aug 2010 at 7:00
Attachments:
The problem seems not to be in the marave application, but in the PyQt/QT
version included in Ubuntu... I came to spelltextedit.py:179 and nothing seems
to avoid the problem...
fname=unicode(QtGui.QFileDialog.getSaveFileName(self.parent(), self.tr("Save
as"), self.lastFolder))
I searched through the web and nobody appears to get the same bad behavior...
:-/
Original comment by fernandezm
on 4 Aug 2010 at 7:12
What happens if instead of self.parent() you use None?
Original comment by roberto.alsina
on 4 Aug 2010 at 7:18
I guess this issue should be merged with issue #85
Original comment by andresgattinoni
on 5 Aug 2010 at 11:53
BTW, I tried changing self.parent() to None on spelltextedit.py:179 and it's
the same.
Original comment by andresgattinoni
on 5 Aug 2010 at 11:59
I have the same problem. Curiously, everything seems to work fine (i.e., the
dialog shows and can be interacted with; I didn't proceed any further) if one
uses an explicitly constructed QFileDialog, e.g.
dlg = QtGui.QFileDialog(self.parent(), self.tr("Save as"), self.lastFolder)
dlg.exec_()
Instead of QtGui.QFileDialog.getSaveFileName. A little more work may be
necessary (e.g., properly setting some options, retrieving the filename, etc.),
but it should work.
BTW: The same thing happens/applies to the open dialog.
Original comment by st.loeffler
on 5 Aug 2010 at 1:58
@6 awesome! Could you check if r460 works for "save as"? If it does, I'll
change the rest immediately.
Original comment by roberto.alsina
on 5 Aug 2010 at 2:32
It works better for me, but there are some errors.
- Now the dialog shows correctly
- Minor issue: the confirmation button says "Open" instead of "Save"
- Bigger issue: it doesn't save the file.
Here is the output:
elbarto@tarantino:~/marave-read-only$ python marave-editor
Using canvas editor
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
Disabling spellchecker
Traceback (most recent call last):
File "/home/elbarto/marave-read-only/marave/editor/spelltextedit.py", line 188, in saveas
if fname:
UnboundLocalError: local variable 'fname' referenced before assignment
QWidget::setWindowModified: The window title does not contain a '[*]'
placeholder
FNAME: /home/elbarto/test.txt
Original comment by andresgattinoni
on 5 Aug 2010 at 2:35
One more time with r461 :-)
Original comment by roberto.alsina
on 5 Aug 2010 at 2:42
Now the button says "Save" and it doesn't throw the exception. But it still
shows an error saying that the file couldn't be saved. Actually the file is
created but empty.
I'm also still getting a segfault when I quit.
elbarto@tarantino:~/marave-read-only$ python marave-editor
Using canvas editor
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
Disabling spellchecker
FNAME: /home/elbarto/test.txt
Segmentation fault
Original comment by andresgattinoni
on 5 Aug 2010 at 2:46
Hmmm... could you try debugging marave.editor.spelltextedit.save and see where
the exception happens?
Original comment by roberto.alsina
on 5 Aug 2010 at 2:51
Same here. Note that it's the Qt dialog, not the native one (which may or may
not be the wanted effect)
re. "Open" instead of "Save": I believe
fdialog.setAcceptMode(QtGui.QFileDialog.AcceptSave)
solves this (and maybe sets some other internal flags properly)
Note that fname should be initialized to None at the beginning of saveas(), or
else "if fname" might raise an exception when the user aborts the dialog
re. failing to save: I narrowed down the problem to the line
encoded = unicode(self.toPlainText()).encode(unicode(stream.codec().name()))
in save(). stream.codec().name() returns "System" for some reason, which
apparently is no valid python codec name. I'd suggest to do the whole writting
via "stream", which is designed specifically for encoding the string correctly.
I don't know how to use "<<" in python, though
Original comment by st.loeffler
on 5 Aug 2010 at 2:53
I commented the big try/except in the save method and here's the exception:
Traceback (most recent call last):
File "/home/elbarto/marave-read-only/marave/editor/spelltextedit.py", line 193, in saveas
self.save()
File "/home/elbarto/marave-read-only/marave/editor/spelltextedit.py", line 160, in save
encoded = unicode(self.toPlainText()).encode(unicode(stream.codec().name()))
LookupError: unknown encoding: System
Original comment by andresgattinoni
on 5 Aug 2010 at 2:57
same problem fedora goddard
Original comment by amc...@gmail.com
on 5 Aug 2010 at 5:30
I don't know if this is right, but reaplcing line 160 for this worked fine for
me:
encoded = unicode(stream.codec().toUnicode(self.toPlainText()))
Original comment by andresgattinoni
on 5 Aug 2010 at 5:50
@15 the problem there is that we are saving the unicode object and we need to
save an encoded string. I'm checking it out now.
Original comment by roberto.alsina
on 6 Aug 2010 at 10:38
Please try again with r462. If "save as" works well, I can do the rest in
minutes :-)
Original comment by roberto.alsina
on 6 Aug 2010 at 10:43
The saving works. When I'm still getting errors. The beep exception came back!
python marave-editor
Using canvas editor
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
Disabling spellchecker
FNAME: /home/elbarto/test.txt
FNAME: /home/elbarto/lele.pepe
Traceback (most recent call last):
File "/home/elbarto/marave-read-only/marave/main.py", line 947, in close
self.beep.stop()
AttributeError: 'NoneType' object has no attribute 'stop'
Segmentation fault
Original comment by andresgattinoni
on 6 Aug 2010 at 10:54
Updated to r462, now I get no segfault and "saving as" works ok. :-)
marcelo@marcelo-laptop:~/src/marave-read-only$ svn up
U marave/editor/spelltextedit.py
Actualizado a la revisión 462.
marcelo@marcelo-laptop:~/src/marave-read-only$ ./marave-editor
Using canvas editor
<module 'marave' from '/home/marcelo/src/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/marcelo/src/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/marcelo/src/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/marcelo/src/marave-read-only/marave/__init__.pyc'>
Disabling spellchecker
FNAME: /home/marcelo/test.txt
marcelo@marcelo-laptop:~/src/marave-read-only$ cd
marcelo@marcelo-laptop:~$ cat test.txt
asdfasdfasdfasdf
adsf
asd
fasdf
Regards
Original comment by fernandezm
on 6 Aug 2010 at 10:56
@18: but that exception is in another line now :-) Fixed in r463
@19: great!
Since "save as" works for both of you, I'll do the same for the other file
dialogs.
Original comment by roberto.alsina
on 6 Aug 2010 at 11:07
Ok, now all file dialogs are fixed in r465. How about color dialogs? If you
open the fonts row in the menu and click on the color wheel, is it broken too?
Original comment by roberto.alsina
on 6 Aug 2010 at 11:17
All dialogs are working great for me now.
The segfault when I quit persists, though.
Original comment by andresgattinoni
on 6 Aug 2010 at 11:19
+1 to andresgattinoni, dialogs fine and the segfault appeared again. :-/
Original comment by fernandezm
on 6 Aug 2010 at 11:24
Are the segfaults there in r465?
Original comment by roberto.alsina
on 6 Aug 2010 at 11:38
Yep.
Original comment by andresgattinoni
on 6 Aug 2010 at 11:39
Honestly... if it saves, closes then crashes it's not terrible :-)
Another Ubuntu problem: does the settings button work?
Original comment by roberto.alsina
on 7 Aug 2010 at 12:31
Yep, the settings button is working fine for me.
I had this exception on the stdout but I didn't notice anything wrong in the UI.
elbarto@tarantino:~/marave-read-only$ python marave-editor
Using canvas editor
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
<module 'marave' from '/home/elbarto/marave-read-only/marave/__init__.pyc'>
Disabling spellchecker
Traceback (most recent call last):
File "/home/elbarto/marave-read-only/marave/plugins/plugins.py", line 53, in enable
client.pluginButton.show()
AttributeError: 'MainWidget' object has no attribute 'pluginButton'
Traceback (most recent call last):
File "/home/elbarto/marave-read-only/marave/plugins/plugins.py", line 55, in enable
client.pluginButton.hide()
AttributeError: 'MainWidget' object has no attribute 'pluginButton'
Segmentation fault
Original comment by andresgattinoni
on 7 Aug 2010 at 3:56
same problem here with ubuntu 11.04. can not save :( apart from that the
program looks great
Original comment by nilsjan...@gmail.com
on 29 May 2011 at 1:32
did U tried to run editor with sudo privileges? saving and loading works fine
this way.
Original comment by P.Lukasi...@gmail.com
on 1 Jun 2011 at 8:13
Original issue reported on code.google.com by
andresgattinoni
on 4 Aug 2010 at 6:52Attachments: