maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Annouce] HealthCheck - Hardware/System checker for the N900 (https://talk.maemo.org/showthread.php?t=45453)

noobmonkey 2010-06-07 18:31

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
looks like you missed the f in the command:
/home/user # apt-get - install

Should have been
apt-get -f install

Really shouldnt be a problem at all though - try what i said in my last post, almost certain that should fix it :)

chubbyisacat 2010-06-07 18:42

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
ok did it again
~ $ sudo gainroot
Root shell enabled


BusyBox v1.10.2 (Debian 3:1.10.2.legal-1osso30+0m5) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/home/user # apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
/home/user #

ot having any luck with the second thing. says no such file but maybe not doing it right. do I put in sudo gainroot every time first - and is that a 1 numeral or an I letter? Thanks for the help.

noobmonkey 2010-06-07 18:46

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
probably best to just try this lot :)
(close x-terminal and try again)
Code:

sudo gainroot
apt-get remove healthcheck && apt-get autoremove
apt-get install healthcheck

enter after each line

chubbyisacat 2010-06-07 18:50

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
ok, from one of the earlier posts:
Enter 'help' for a list of built-in commands.

/home/user # apt-get remove healthcheck ?? apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Regex compilation error - Invalid preceding regular expression
/home/user #
/home/user # apt-get install healthcheck
Reading package lists... Done
Building dependency tree
Reading state information... Done
healthcheck is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
/home/user #

chubbyisacat 2010-06-07 18:52

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
And no change - still won't load :(

noobmonkey 2010-06-07 18:56

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
can you just confirm which version you are trying to download? (I may have missed this question by accident)

Healthcheck in Extras = 1.0.0-0
In extras-testing 1.2.0-3
In devel 1.2.1-3

i've just thought of one more thing!

Code:

sudo gainroot
apt-get upgrade python2.5qt4*


noobmonkey 2010-06-07 18:58

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by chubbyisacat (Post 703952)
ok, from one of the earlier posts:
Enter 'help' for a list of built-in commands.

/home/user # apt-get remove healthcheck ?? apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Regex compilation error - Invalid preceding regular expression
/home/user #
/home/user # apt-get install healthcheck
Reading package lists... Done
Building dependency tree
Reading state information... Done
healthcheck is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
/home/user #

Lol - sorry to be a pain - just noticed another typo !

apt-get remove healthcheck ?? apt-get autoremove

Should have been
apt-get remove healthcheck && apt-get autoremove

(Missing the &&'s)

chubbyisacat 2010-06-07 19:03

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 703973)
can you just confirm which version you are trying to download? (I may have missed this question by accident)

Healthcheck in Extras = 1.0.0-0
In extras-testing 1.2.0-3
In devel 1.2.1-3

i've just thought of one more thing!

Code:

sudo gainroot
apt-get upgrade python2.5qt4*


Not sure, but I think the one I had that went wrong was 1.2.1-3. It's doing its stuff now with that last command, so I need to wait.

noobmonkey 2010-06-07 19:04

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by chubbyisacat (Post 703992)
Not sure, but I think the one I had that went wrong was 1.2.1-3. It's doing its stuff now with that last command, so I need to wait.

cool thats good! :)

1.2.1-3 - means i'm helping you to fix the version i thought i was :)

chubbyisacat 2010-06-07 19:06

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
YES! SUCCESS! :):)
It now opens. Perfect. Thanks for your help and your patience.

noobmonkey 2010-06-07 19:10

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by chubbyisacat (Post 704005)
YES! SUCCESS! :):)
It now opens. Perfect. Thanks for your help and your patience.

Yay - so sorry it took so long, was hoping the other bits would lead to a simpler fix :) - but great to hear it is now working :)

Once again, thank you very much for testing :) - if there is anything you would like to see, or see changed or added just let me know :)

(I'm learning - so not all fixes are next day fixes! hehehe)

attila77 2010-06-07 19:11

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 703749)
Hold on!
let me set the depends correctly :)

Gonna change the build file to - python2.5-qt4 (>= 4.6)
That should help! :)

You need (>> 4.7.3)

noobmonkey 2010-06-07 19:32

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by attila77 (Post 704024)
You need (>> 4.7.3)

hehe! noticed the mistake before i updated! :)

qwerty12 2010-06-08 00:01

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Apologies for providing a half-assed FMTxFrequency function. I should've known better as I wrote a clone of the status bar applet...

Code:

import gettext #part of standard Python, I believe

def FMTxFrequency():
        freq = "%.1f" % float(GetProp(FMTxPropertiesInterfaceConnect(), 'frequency') / 1000.0)
        freq_mhz = gettext.dgettext("osso-fm-transmitter", "fmtx_va_frequency")
        if freq_mhz != "fmtx_va_frequency":
                freq_mhz %= freq
                return freq_mhz
        return freq

Oh, it returns a str so no need for manual casts :)

P.S. You can pass False (introspection=False) as the third argument of your get_object calls to stop it from introspecting the given interface and producing those error messages

noobmonkey 2010-06-08 07:54

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by qwerty12 (Post 704543)
Apologies for providing a half-assed FMTxFrequency function. I should've known better as I wrote a clone of the status bar applet...

Code:

import gettext #part of standard Python, I believe

def FMTxFrequency():
        freq = "%.1f" % float(GetProp(FMTxPropertiesInterfaceConnect(), 'frequency') / 1000.0)
        freq_mhz = gettext.dgettext("osso-fm-transmitter", "fmtx_va_frequency")
        if freq_mhz != "fmtx_va_frequency":
                freq_mhz %= freq
                return freq_mhz
        return freq

Oh, it returns a str so no need for manual casts :)

P.S. You can pass False (introspection=False) as the third argument of your get_object calls to stop it from introspecting the given interface and producing those error messages

Haha! Spent a while last night trying to get it to return correctly! never thought to divide by 1000.0 instead of 1000!
Thank you very much!

Brank 2010-06-08 09:07

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
is led test supposed to show all colors? I only get red twice. or is red what you get when you combine them all?

noobmonkey 2010-06-08 09:42

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Hi Brank, there is a dropdown list to the right of the LED test button. this will allow you to choose a few tests.
i am working on testing all colours, but the with current patterns, some only work when the device is sleeping etc.
so therefore the drop down list only allows a few. Will work on adding more soon.

noobmonkey 2010-06-08 12:01

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Brank, also realised you might need to let me know which version you are using - there are 3 versions currently available - one in extras, testing and devel.

noobmonkey 2010-06-09 20:21

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Just wanted to get some opinions. Did a quick mockup of a possible new design.

The idea is as follows:
  • Main Menu
  • Each information screen displays as before but in a stackable window, with a lister, but less per page, so easier to find information
  • Each test loads up in it's own stackable window.

First draft of menu below:
http://www.greg-roberts.com/healthcheck1.png
(Ignore the title - just a label until i do something fancy)

noobmonkey 2010-06-10 11:12

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Just a quick update. V1.2.0-3 is now promoted to extras. screenshots will follow shortly.

doksng 2010-06-11 07:27

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
NICE:D:D:D:D:D This is amazing.
Are you no longer sticking with the green theme?

I was wondering if it is possible to make the signal strength measurement on the comms tab to be dynamic so that it varies with signal level changes.

Would it be possible to have a widget version
Thanks

Quote:

Originally Posted by noobmonkey (Post 707774)
Just wanted to get some opinions. Did a quick mockup of a possible new design.

The idea is as follows:
  • Main Menu
  • Each information screen displays as before but in a stackable window, with a lister, but less per page, so easier to find information
  • Each test loads up in it's own stackable window.

First draft of menu below:
http://www.greg-roberts.com/healthcheck1.png
(Ignore the title - just a label until i do something fancy)


noobmonkey 2010-06-11 07:31

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by doksng (Post 709961)
NICE:D:D:D:D:D This is amazing.
Are you no longer sticking with the green theme?

I was wondering if it is possible to make the signal strength measurement on the comms tab to be dynamic so that it varies with signal level changes.

Would it be possible to have a widget version
Thanks

I'm not purposely moving away from the green theme, was just doing a mock-up for opinions :)
Going to start working on something this week, still not wholly decided!

Hmmmmm, i have to admit i am trying to complete threading etc, to allow the values to auto update, but for now i might need to stick with a 'Click to update' if that is ok?

Hmmmm widget-wise, it is probably worth using queenbee/DSE (Not sure those two can do everything though?)

doksng 2010-06-11 07:52

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
it is okay for now but would love to see the signal changes as you move around.
Installed Quenbee but it is not that quite easy to use.

noobmonkey 2010-06-11 08:51

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
good point. i spose my plans to improve are as follows:
Improve ui
add multi threading or similar function to allow updating
add further tests
add translations

The UI part will be developed over the next two weeks, and will be pretty much a full re-code as well.
But if anyone has useful tips for threading in pyqt, please let me know!

Venemo 2010-06-11 09:02

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710055)
But if anyone has useful tips for threading in pyqt, please let me know!


Well, of course we have!

The easiest way is using QThreadPool with a custom QRunnable implementation.

Your QRunnable's run() method would check the necessary values and refresh the UI.

The main UI window should have a QTimer and on a predefined interval (on the QTimer's timeout signal), it would create a new instance of your own QRunnable and make the thread pool execute it.

Note that the thread pool has a static "global instance", so you don't have to create an instance of it, just access the global instance and make that do things for you.

noobmonkey 2010-06-11 09:06

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by Venemo (Post 710063)
Well, of course we have!

The easiest way is using QThreadPool with a custom QRunnable implementation.

Your QRunnable's run() method would check the necessary values and refresh the UI.

The main UI window should have a QTimer and on a predefined interval, it would create a new instance of your own QRunnable and make the thread pool execute it.

Note that the thread pool has a static "global instance", so you don't have to create an instance of that, just access the global instance and make that do things for you.

Ahaaaaaaa - thats actually the first explanation that i have understood! :) hehehe

I did see THP did something here, that looked similar to threading / updating - but may not be suitable.

Will see if i can get some basic versions running, assuming it all works, i can't see it being too difficult to do it for all updatable values :)

Venemo 2010-06-11 09:08

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710071)
Ahaaaaaaa - thats actually the first explanation that i have understood! :) hehehe

Thanks! :)

Quote:

Originally Posted by noobmonkey (Post 710071)
I did see THP did something here, that looked similar to threading / updating - but may not be suitable.

Well, I don't know a thing about Python, so I'm not sure.

Quote:

Originally Posted by noobmonkey (Post 710071)
Will see if i can get some basic versions running, assuming it all works, i can't see it being too difficult to do it for all updatable values :)

You just have to do a single QRunnable implementation for yourself that updates all the values.
No need to do it separately for all the updatable values.

(As this is not a quad core monster processor, there is no point in launching that many threads at once. The usual good practice is to keep one thread for the UI, and do all the other stuff that would otherwise slow it down in separate threads.)

noobmonkey 2010-06-11 09:13

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by Venemo (Post 710074)
Thanks! :)



Well, I don't know a thing about Python, so I'm not sure.



You just have to do a single QRunnable implementation for yourself that updates all the values.
No need to do it separately for all the updatable values.

(As this is not a quad core monster processor, there is no point in launching that many threads at once. The usual good practice is to keep one thread for the UI, and do all the other stuff that would otherwise slow it down in separate threads.)

The Qrunnable idea is interesting, as now all of my values (Ate least in system) are retrieved via functions
ie
Code:

a = gn_functions.getaValue()
 self.listWidget.currentItem().setText("Value Name \t\t\t" + a)

So in theory i should be able to just put those calls into that qrunnable idea/format....

Venemo 2010-06-11 09:34

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710084)
The Qrunnable idea is interesting, as now all of my values (Ate least in system) are retrieved via functions
ie
Code:

a = gn_functions.getaValue()
 self.listWidget.currentItem().setText("Value Name \t\t\t" + a)

So in theory i should be able to just put those calls into that qrunnable idea/format....

The only thing you should take care of is the communication between QRunnable and the UI.

I would do it the following way:
- Create a method in the UI that calls those functions you're talking about
- Then, create a class that derives from QRunnable (Let's call it Updater) and has a reference to the UI class, and in its run() method calls the method that you created above
- Create a QTimer in the UI class and in its timeout(), create a new instance of the Updater class you created above, and make the global instance of QThreadPool execute it.

It couldn't be more straightforward. :)
I would gladly post code examples, but I don't know a thing about Python :( , and I'm not sure whether my C++ example would be of any use to you. :p

noobmonkey 2010-06-11 09:37

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

I would do it the following way:
- Create a method in the UI that calls those functions you're talking about
Done!

Quote:

Then, create a class that derives from QRunnable (Let's call it Updater) and has a reference to the UI class, and in its run() method calls the method that you created above
Ok, sounds easy!

Quote:

- Create a QTimer in the UI class and in its timeout(), create a new instance of the Updater class you created above, and make the global instance of QThreadPool execute it.
:)

Quote:

I would gladly post code examples, but I don't know a thing about Python :( , and I'm not sure whether my C++ example would be of any use to you. :p
Any examples will help - i'm getting used to translating examples from GTK and c++! :)

attila77 2010-06-11 10:05

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
In case of Qt and Python vs C++, the code is translatable almost line by line, especially if the C++ original uses Qt constructs like foreach() for looping. There are a few caveats regarding variable scope and garbage collection, but in general it should not be an issue. Python to C++ is a bit more nasty (as C++ simply lacks a lot of the built-in goodies Python has, even with Qt - f.e. list comprehension).

bonsai009 2010-06-12 08:21

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
application crash after starting...
When I start the programm from the xterm, I have this messages:
Nokia-N900:~# python /opt/healthcheck/healthcheck.py
***** Start Imports *****
** Importing qtcore & gui **
** Importing ui.touchstub - accuracy tool **
** Importing sys **
** Importing commands **
** Importing os **
** Importing os.path **
** Importing subprocess **
** Importing dbus.glib **
** Importing Start location**
** Importing Cellinfo **
** Importing Hildon **
** Importing Functions **
** Importing Time **
** Importing GTK **
** Initialize Threads(GTK) **
** Importing Gobject **
***** Finish Imports *****
** Seting global variables **
** Starting Main **
** app = QtGui App** - Running app = QtGui.QApplication(sys.argv) **
/opt/healthcheck/healthcheck.py:1053: GtkWarning: gtk_widget_set_sensitive: assertion `GTK_IS_WIDGET (widget)' failed
app = QtGui.QApplication(sys.argv)
** Setting Main Window**
** Setting tool window #1**
** Starting healthcheckWindow Class **
** Set basic color on rectangle **
** Setting window details and loading form**
** Completed healthcheckWindow Class load **
** Setting tool window #2**
** Setting Video window**
** Set basic color on rectangle **
** Setting window details and loading form**
** Declare the UI**
** Draw everything and start the main function**
** start SetupUi**
Could not parse stylesheet of widget 0x6ff8b8
** Run retranslateUi **
** Show tab1 (0) **
** Show everything**
** Waiting for quit signal - healthcheck loaded **
** Running Update ALL**
** Running tab1 update **
** Start Function - rootfs % used **
** Start Function - rootfs free MB **
** Start Function - MyDocs % Used **
** Start Function - myDocs MB Free **
** Start Function - App Used **
** Start Function - App Free **
** Start Function - Memory Card Used **
** Start Function - Memory Card Free **
** Start Function - CPU Frequency **
** Start Function - Backlight Info **
** Start Function - Backlight Info MAX **
** Start Function - Kernel Core Info **
** Start Function - MMC Cover/latch **
** Start Function - CPU Frequency File **
** Adding CPUQ Frequencies **
** Start Function - Processor Information **
** Start Function - N900 Board Information **
** Start Function - Board Version **
** Start Function - System Locale **
** Start Function - boot count**
** Start Function - FM Transmitter power level **
** Start Function - Boot Reason**
** Start Function - Cam Shutter State **
** Start Function - Keyboard Slider State **
** Start Function - proximity sensor state**
** Start Function - Headphone State **
** Start Function - Battery Current **
** Start Function - battery last charge**
** Start Function - Battery Charge **
** Start Function - system uptime**
** Start Function - load from uptime **
** Start Function - firmware version **
Traceback (most recent call last):
File "/opt/healthcheck/healthcheck.py", line 1076, in <module>
ui.funcUpdateAll()
File "/opt/healthcheck/healthcheck.py", line 890, in funcUpdateAll
self.funcSystemTab()
File "/opt/healthcheck/healthcheck.py", line 848, in funcSystemTab
g = gn_functions.funcMaemoVersion()
File "/opt/healthcheck/gn_functions.py", line 196, in funcMaemoVersion
g = s[2].strip()
IndexError: list index out of range

What is wrong?

noobmonkey 2010-06-12 08:28

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Oooooooooooooooo That's interesting!

Quote:

Originally Posted by bonsai009 (Post 711703)
application crash after starting...

g = gn_functions.funcMaemoVersion()
File "/opt/healthcheck/gn_functions.py", line 196, in funcMaemoVersion
g = s[2].strip()
IndexError: list index out of range

What is wrong?

Can you confirm what version of healthcheck please? :)
It seems to be struggling whilst looking at this command
Code:

dpkg -l mp-fremantle-* | grep ii
If you fancy trying that in terminal, it will be interesting to see how your version string looks.

bonsai009 2010-06-12 08:46

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Nokia-N900:~# dpkg -l mp-fremantle-* | grep ii
Nokia-N900:~#

soryy, i see nothing.

bonsai009 2010-06-12 08:49

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Nokia-N900:~# dpkg -l mp-fremantle-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=============================-=============================-================================================== ========================
pn mp-fremantle-generic-pr <none> (no description available)

sorry for bad english, I´m a german-people

Venemo 2010-06-12 08:49

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 710126)
Any examples will help - i'm getting used to translating examples from GTK and c++! :)

Okay, I'm sold!
I don't guarantee syntax rightness, though, because I'm typing it rigt in here, not into my IDE. :p

I also only write my idea, I guess the "..."s will make sense.

MainWindow.h
Code:

...

//include whatever...

class MainWindow
{
    ...
private:
    QTimer *timer;
    ...   
public:
    MainWindow(...); // constructor
    void updateAll(); // method that updates all
    ...
private slots:
    void on_timer_timeout(); // the method
    ...
}

UpdaterRunnable.h
Code:

#include "MainWindow.h"

class UpdaterRunnable : private QRunnable
{
private:
    MainWindow *myWindow;
public:
    UpdaterRunnable(MainWindow *window);
    void run();
}

MainWindow.cpp
Code:


#include "MainWindow.h"
#include "UpdaterRunnable.h"

MainWindow::MainWindow(...)
{
    // creating a new timer instance on the heap
    timer = new QTimer(this);
    // connecting to its signal
    connect(timer, SIGNAL(timeout()), this, SLOT(on_timer_timeout()));
    // running the timeout method - to fill up values on the beginning
    on_timer_timeout();
    // starting the timer with a nice interval
    timer->start(3000);
   
    ...
}

void MainWindow::updateAll()
{
    // This is the method in which you update all your labels
}

void MainWindow::on_timer_timeout()
{
    // makes the thread pool start updating asynchronously
    // note that the QRunnable instance will be deleted by the thread pool, so this is not a memory leak
    QThreadPool::globalInstance()->start(new UpdaterRunnable(this));
}

UpdaterRunnable.cpp
Code:

#include "UpdaterRunnable.h"

UpdaterRunnable::UpdaterRunnable(MainWindow *window)
    : QRunnable(), myWindow(window)
{
}

void UpdaterRunnable::run()
{
    myWindow->updateAll();
}

Rougly this is what I was speaking about - I really hope it helps.

I also recommend setting the default caption of all labels to "Updating...", and start updating them asynchonously. It just adds a feeling of responsiveness to the UI. (This is why there is a call to the timeout method in the constructor of my example.)

noobmonkey 2010-06-12 09:03

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by bonsai009 (Post 711731)
Nokia-N900:~# dpkg -l mp-fremantle-*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=============================-=============================-================================================== ========================
pn mp-fremantle-generic-pr <none> (no description available)

sorry for bad english, I´m a german-people

thank you very much! don't worry, i can understand you.

it is very odd though. it looks like you do not have maemo installed! never expected no value being returned! anyone else got any suggestions?

Venemo 2010-06-12 09:08

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by noobmonkey (Post 711743)
it is very odd though. it looks like you do not have maemo installed! never expected no value being returned! anyone else got any suggestions?

If you break some dependencies, the first thing apt-get is going to do is uninstalling the "mp-fremantle-*" package.

Eg. install some apps from the debian repos or the SDK repo, and there you go with it.

mikec 2010-06-12 09:13

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
Quote:

Originally Posted by Venemo (Post 711732)
Okay, I'm sold!
I don't guarantee syntax rightness, though, because I'm typing it rigt in here, not into my IDE. :p

I also only write my idea, I guess the "..."s will make sense.

MainWindow.h
Code:

...

//include whatever...

class MainWindow
{
    ...
private:
    QTimer *timer;
    ...   
public:
    MainWindow(...); // constructor
    void updateAll(); // method that updates all
    ...
private slots:
    void on_timer_timeout(); // the method
    ...
}

UpdaterRunnable.h
Code:

#include "MainWindow.h"

class UpdaterRunnable : private QRunnable
{
private:
    MainWindow *myWindow;
public:
    UpdaterRunnable(MainWindow *window);
    void run();
}

MainWindow.cpp
Code:


#include "MainWindow.h"
#include "UpdaterRunnable.h"

MainWindow::MainWindow(...)
{
    // creating a new timer instance on the heap
    timer = new QTimer(this);
    // connecting to its signal
    connect(timer, SIGNAL(timeout()), this, SLOT(on_timer_timeout()));
    // running the timeout method - to fill up values on the beginning
    on_timer_timeout();
    // starting the timer with a nice interval
    timer->start(3000);
   
    ...
}

void MainWindow::updateAll()
{
    // This is the method in which you update all your labels
}

void MainWindow::on_timer_timeout()
{
    // makes the thread pool start updating asynchronously
    // note that the QRunnable instance will be deleted by the thread pool, so this is not a memory leak
    QThreadPool::globalInstance()->start(new UpdaterRunnable(this));
}

UpdaterRunnable.cpp
Code:

#include "UpdaterRunnable.h"

UpdaterRunnable::UpdaterRunnable(MainWindow *window)
    : QRunnable(), myWindow(window)
{
}

void UpdaterRunnable::run()
{
    myWindow->updateAll();
}

Rougly this is what I was speaking about - I really hope it helps.

I also recommend setting the default caption of all labels to "Updating...", and start updating them asynchonously. It just adds a feeling of responsiveness to the UI. (This is why there is a call to the timeout method in the constructor of my example.)

Very Timely as I am struggling with a performance problem with Maesynth where I think I need to move to a threading solution. Too many sounds playing at the same time :D

noobmonkey 2010-06-12 09:30

Re: [Annouce] HealthCheck - Hardware/System checker for the N900
 
mike, got a python version working with threading, will copy the code when i get near a pc. bit laggy, as i am calling so many functions! hehe


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

vBulletin® Version 3.8.8