Re: [PyQt] KGlobalAccel, again

2007-08-04 Thread Jim Bublitz
On Friday 03 August 2007 11:50, Adeodato Simó wrote:
 Hello.

 I'm having the same problem as [1] when using KGlobalAccel. In a
 nutshell, the program crashes when pressing the configured global
 shortcut.

   [1] http://www.riverbankcomputing.com/pipermail/pyqt/2006-May/013268.html

 I tried adding /Transfer/ to the KGlobalAccel constructor as suggested
 there, but the result is the same (patched the PyKDE version in Debian,
 3.15.2+20060422; 3.16.0 gave me a compiler error when building).

 I would really really really like to see this fixed. If there's anything
 I can do to help with that, please let me know.

 Here's a sample program that shows the issue: run it and press Ctrl-Alt-U.

The /Transfer/ in KGlobalAccel should be /TransferThis/, but that makes no 
difference in your example program, which as far as I can see is correct.

The backtrace shows calls to createPopupMenu just before the crash, and as far 
as I can tell from looking at the C++ code, that shouldn't be called. From 
Python's point of view, if you interrogate the KGlobalAccel object, or the 
KAccelAction object insert() returns, everything is set up correctly.

It could be a bug in the C++ KDE code, although I'd be surprised (a C++ test 
case would be helpful). It could also be some misunderstanding of how to use 
KGlobalAccel, but that seems unlikely too. It's probably a PyKDE problem, but 
it's one I'd find very difficult to track down and what time I have to spend 
on PyKDE is going to the upcoming KDE4 version. With that only a few months 
away, I'm reluctant to spend a lot of time on PyKDE3, and this looks like it 
would take a lot of time - I've spent a few hours on and off on it today

If I get some free time, I'll try to get back to it, but that's not likely at 
the moment - sorry. Anyone else is welcome to look into it.

Jim.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Small patch for pykde/examples/systray.py

2007-08-04 Thread Adeodato Simó
Hello.

The attached patch makes the systray example load its icon in a better
way [1]. With it, an icon of the appropriate size is loaded, instead of
a big one which does not fits.

  [1] As per 
http://developer.kde.org/documentation/library/3.5-api/kdelibs-apidocs/kdeui/html/classKSystemTray.html#e0

I hope it can be applied if it's correct. (If this is not the correct
address to send patches, please direct me to the right place.)

Cheers,

-- 
Adeodato Simó dato at net.com.org.es
Debian Developer  adeodato at debian.org
 
   Listening to: Franz Ferdinand - Outsiders
--- systray.py~	2007-08-04 13:23:44.0 +0200
+++ systray.py	2007-08-04 13:25:19.0 +0200
@@ -30,7 +30,7 @@
 import sys
 
 from qt import QLabel
-from kdecore import KApplication, KIcon, KIconLoader
+from kdecore import KApplication
 from kdeui import KMainWindow, KSystemTray
 
 class MainWin (KMainWindow):
@@ -42,10 +42,9 @@
 appName = template
 app = KApplication (sys.argv, appName)
 mainWindow = MainWin (None, main window)
-icons = KIconLoader ()
 
 systray = KSystemTray (mainWindow)
-systray.setPixmap (icons.loadIcon(stop, KIcon.Desktop))
+systray.setPixmap (systray.loadIcon(stop))
 systray.show ()
 
 #mainWindow.show()
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] KURLCompletion not working

2007-08-04 Thread Adeodato Simó
Hello again.

I have no idea how much it cost to fix this one, and I guess it's not
that important since I'm beginning to realize PyKDE is not going to cut
it for me. But for documentation purposes, please find attached a sample
python script exercising KURLCompletion which does not work, together
with a C++ translation which does (linking needs -lkio).

Cheers,

-- 
Adeodato Simó dato at net.com.org.es
Debian Developer  adeodato at debian.org
 
Any life, no matter how long and complex it may be, is made up of a
single moment: the moment in which a man finds out, once and for all,
who he is.
-- Jorge Luis Borges
import sys

import kio
import kfile
import kdeui
import kdecore

def main():
application = kdecore.KApplication(sys.argv, 'test app')
main_window = MainWindow(None, 'main window')
main_window.show()
application.exec_loop()

class MainWindow(kdeui.KMainWindow):
def __init__ (self, *args):
kdeui.KMainWindow.__init__(self, *args)

self.combo = kfile.KURLComboBox(kfile.KURLComboBox.Directories, True, self, 'combo')
self.combo.setCompletionObject(kio.KURLCompletion(kio.KURLCompletion.DirCompletion))

if __name__ == '__main__':
main()

#include iostream

#include kapplication.h
#include kcmdlineargs.h
#include kmainwindow.h
#include kurlcombobox.h
#include kurlcompletion.h

class MainWindow : public KMainWindow
{
Q_OBJECT;

public:
  MainWindow();
  ~MainWindow();

private:
	KURLComboBox *combo;
};

MainWindow::MainWindow() : KMainWindow()
{
  combo = new KURLComboBox(KURLComboBox::Directories, true, this, combo);
  combo-setCompletionObject(new KURLCompletion(KURLCompletion::DirCompletion));
}

MainWindow::~MainWindow()
{
delete combo;
}

int
main (int argc, char **argv)
{
KCmdLineArgs::init(argc, argv, test, test, test, 1.0);
KApplication app;
MainWindow *window = new MainWindow;

app.setTopWidget(window);
window-show();
return app.exec();
}

#include combo_moc.cc
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt