Reply
Thread Tools
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#31
Originally Posted by fatalsaint View Post
Ew. Note to noobmonkey: If you use pyuic4 to convert a ui.. don't modify that code directly. That gets ugly and messy and then you can't modify it again with QT Designer.

It's just bad mojo.

Have a separate class in your main .py file that calls the UI class and put everything into that. So much cleaner.. and then you can open/edit/save/convert your UI all day long and never have to change a lick of code.
yeah noticed that, havn't gone back into QT Designer since - so it's all manual now - have to admit i am learning alot more now!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#32
Originally Posted by fatalsaint View Post
If you do it that way You might need self.ui.btnName.connect....

ETA: Also self.pushButton I don't think is going to work.. do you have a line similar to:
Code:
self.ui = Ui_MainWindow()
Got
ui = Ui_MainWindow()
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#33
Originally Posted by noobmonkey View Post
Got
ui = Ui_MainWindow()
If you got it to work I guess it's irrelevant now.. I would have though you needed ui.pushButton though instead of self.pushButton..

But I'm sort of flying blind here with just pieces of your code and there's likely several ways this can be accomplished. If you got it working you're good.
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following User Says Thank You to fatalsaint For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#34
Just messaged you - meh, not quite working!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#35
Perfect, thank you again Fatalsaint.

Have it working like a dream now!
Its interesting, because re-reading the code, it now makes sense! But i suppose i do like the trial and error!

Now i need to do a popup message to say Loading data then loaded data - as the update takes 5/6 seconds

A gooooogling/wiki'ing/searching i go!
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Posts: 3,428 | Thanked: 2,856 times | Joined on Jul 2008
#36
QMessageBox.information(self, "Loading Data", "Please wait while the data is retrieved...")








Oh.. YOU wanted to find it.. sorry
__________________
If I've helped you or you use any of my packages feel free to help me out.
-----------------------------------------------------------------------------------
Maintaining:
pyRadio - Pandora Radio on your N900, N810 or N800!
 

The Following 2 Users Say Thank You to fatalsaint For This Useful Post:
Posts: 3,319 | Thanked: 5,610 times | Joined on Aug 2008 @ Finland
#37
fatalsaint is right, never ever touch generated code. An old indian trick is to automate pyuic4 calls - before you do the import, check timestamps and do a pyuic call if the .ui is newer (I intentionally won't show you how to do this so you could discover it on your own ). On the long run this saves you a little bit of typing, and a lot of time when something doesn't work because you forgot pyuic (and that can happen a lot if you have a 100 .ui-s )
__________________
Blogging about mobile linux - The Penguin Moves!
Maintainer of PyQt (see introduction and docs), AppWatch, QuickBrownFox, etc
 

The Following User Says Thank You to attila77 For This Useful Post:
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#38
Originally Posted by fatalsaint View Post
QMessageBox.information(self, "Loading Data", "Please wait while the data is retrieved...")

Oh.. YOU wanted to find it.. sorry
Haha! - i did it! - and very similar code to yours!

Needed to add the mainwindow bit, as i called it from within the function

Would prefer the sexy yellow message that dissapears after a few seconds lol - my next hunt!

QtGui.QMessageBox.information(MainWindow, "Loading Data", "Please wait while the data is retrieved...")
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#39
Originally Posted by attila77 View Post
fatalsaint is right, never ever touch generated code. An old indian trick is to automate pyuic4 calls - before you do the import, check timestamps and do a pyuic call if the .ui is newer (I intentionally won't show you how to do this so you could discover it on your own ). On the long run this saves you a little bit of typing, and a lot of time when something doesn't work because you forgot pyuic (and that can happen a lot if you have a 100 .ui-s )
have to learn somewhere, and good point

On my next project - will learn the proper way hehe
(Mainly did it this way, as i didnt learn QT designer properly, and didnt realise you could build code into it, thought it was just gui only)
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
noobmonkey's Avatar
Posts: 3,203 | Thanked: 1,391 times | Joined on Nov 2009 @ Worthing, England
#40
hmmm on searching for the hildon banner i found it (didn't work.... )
But also saw General A's bug post for fmms

"No Hildon Banner cluttering up the screen. Notification using the wheel in the
menubar is sufficient."

Anyone tell me what the notification wheel is, and how to activate it?
__________________
----------- Follow me on Twitter here
----------- My Photography Website and Blog is here
----------- Author of the N900 Health Check Application ----------- New Version in Extras Devel (Dec 2010 - 2.9.10)
----------- Are you on the N900 World Map? - http://pininthemap.com/maemo - masterpin: shotgun
----------- What apps do you want to see on the n900 or in MeeGo in the future? -
 
Reply

Tags
code, health check, n900, python


 
Forum Jump


All times are GMT. The time now is 06:22.