Notices


Reply
Thread Tools
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#51
I would like to suggest the following: Make every one of the buttons on the Advanced Switcher have two functions: Normal press, which simply does the switching on/off, for each of the three icons, and then long-press, which brings up a submenu just like the stock Profile, Bluetooth, Wifi, and FM Transmitter status menu applets do. (Just for clarity's sake - I use applet to mean the stuff that gets added to the drop down menu; I use widget to mean the things that get placed on the desktops that are not just shortcuts to launching something else.)

Anyway, my thinking is this: The WiFi button, when long-pressed, brings up the same menu the current stock WiFi applet does - brings up list of connections that the WiFi detects, and the one you are currently connected to. Basically, same thing as normal-pressing the current "Internet connection"/"Интернет-соединение" button does. So, short press just toggles WiFi, long-press lets you connect/disconnect like you could normally.

Then, long-pressing the Bluetooth button in your Interface Switcher could do the same: Bring up the same sub-menu that the stock Bluetooth button does. Normal press would just toggle it, as it does now.

And finally, to get the zerocool2k request covered (which I agree with), long pressing the phone connectivity button would bring up a submenu that is basically the 2G/3G/Dual mode switcher. Also, if the current GSM button puts the device in flight mode, IE, kills WiFi and GSM (don't have it installed yet, so I can't test this to figure this out for myself), and toggling the WiFi will make it revive the GSM connectivity as well, then the Tablet Mode button can be added as a fourth button to this submenu.

If you can implement this, it would be great, because it means that I can basically uninstall the 2G/3G switcher, and hide/remove the stock WiFi and Bluetooth buttons from my menu, freeing up room in the status menu (mine's getting crowded).

If you are familiar with qwerty12's work, one of his versions of the FM Transmitter status menu applet has normal press and long-press functionality, so you could look at the source code of that. (I will edit a link in here to the post where he links to it shortly.) Since the other applets involved (2G/3G/Dual switcher and Tablet/Phone mode switchers are both open source as I understand it, it should be easy to find out how to code those options into the submenus if you don't already know how to do that).

- Edit (Links) -
Post where qwerty12 posted the version of fmtx_status_menu_item.so that has long-press functionality: http://talk.maemo.org/showpost.php?p...1&postcount=44
Page of that thread this came from: http://talk.maemo.org/showthread.php?t=43395&page=5
He links to an earlier fmtx_status_menu_item.so at the beginning of that thread - this is not the one that can do long-press as I understood it. My N900 isn't loading the www.freemoe.org link where qwerty12 had this stuff posted, not sure if it's an N900, college wifi, or website problem.
- End Edit -

Naturally, I would contribute myself, but currently my coding knowledge is minimal.

Last edited by Mentalist Traceur; 2010-10-01 at 17:09. Reason: Links as Promised
 

The Following User Says Thank You to Mentalist Traceur For This Useful Post:
Posts: 462 | Thanked: 550 times | Joined on Sep 2008 @ Moscow
#52
Originally Posted by Mentalist Traceur View Post
I would like to suggest the following: Make every one of the buttons on the Advanced Switcher have two functions: Normal press, which simply does the switching on/off, for each of the three icons, and then long-press, which brings up a submenu just like the stock Profile, Bluetooth, Wifi, and FM Transmitter status menu applets do. (Just for clarity's sake - I use applet to mean the stuff that gets added to the drop down menu; I use widget to mean the things that get placed on the desktops that are not just shortcuts to launching something else.)

Anyway, my thinking is this: The WiFi button, when long-pressed, brings up the same menu the current stock WiFi applet does - brings up list of connections that the WiFi detects, and the one you are currently connected to. Basically, same thing as normal-pressing the current "Internet connection"/"Интернет-соединение" button does. So, short press just toggles WiFi, long-press lets you connect/disconnect like you could normally.

Then, long-pressing the Bluetooth button in your Interface Switcher could do the same: Bring up the same sub-menu that the stock Bluetooth button does. Normal press would just toggle it, as it does now.

And finally, to get the zerocool2k request covered (which I agree with), long pressing the phone connectivity button would bring up a submenu that is basically the 2G/3G/Dual mode switcher. Also, if the current GSM button puts the device in flight mode, IE, kills WiFi and GSM (don't have it installed yet, so I can't test this to figure this out for myself), and toggling the WiFi will make it revive the GSM connectivity as well, then the Tablet Mode button can be added as a fourth button to this submenu.

If you can implement this, it would be great, because it means that I can basically uninstall the 2G/3G switcher, and hide/remove the stock WiFi and Bluetooth buttons from my menu, freeing up room in the status menu (mine's getting crowded).

If you are familiar with qwerty12's work, one of his versions of the FM Transmitter status menu applet has normal press and long-press functionality, so you could look at the source code of that. (I will edit a link in here to the post where he links to it shortly.) Since the other applets involved (2G/3G/Dual switcher and Tablet/Phone mode switchers are both open source as I understand it, it should be easy to find out how to code those options into the submenus if you don't already know how to do that).

- Edit (Links) -
Post where qwerty12 posted the version of fmtx_status_menu_item.so that has long-press functionality: http://talk.maemo.org/showpost.php?p...1&postcount=44
Page of that thread this came from: http://talk.maemo.org/showthread.php?t=43395&page=5
He links to an earlier fmtx_status_menu_item.so at the beginning of that thread - this is not the one that can do long-press as I understood it. My N900 isn't loading the www.freemoe.org link where qwerty12 had this stuff posted, not sure if it's an N900, college wifi, or website problem.
- End Edit -

Naturally, I would contribute myself, but currently my coding knowledge is minimal.
At the moment, new version is almost finished, so I'll first release it and then think about new features. New release will include Dual/2G/3G modes for GSM, Connectable/Discoverable for Bluetooth, and new dialogs for switching.
But even before release I can say with no doubt, that one more button for normal/flight mode is already implemented, but there is not enough space for it in status menu, unfortunatelly.
 

The Following User Says Thank You to 412b For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#53
Sounds good. Honestly, right now I feel like you're pretty much doing both this and Advanced Power really well, so I'm sure whatever you ultimately do with these applets will be pretty good. (I can't really complement MediaBox Home Widget either way, just because I haven't looked at it at all.)

I look forward to seeing what your next version looks like. I haven't downloaded this one yet, but I'll be downloading the upcoming one once I see the version number update in the repositories.
 
Posts: 83 | Thanked: 130 times | Joined on Dec 2009
#54
App doesn't work on PR1.3.. Think the status menu implementation has changed.. Advanced power also doesn't work..
 

The Following User Says Thank You to rnb89 For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#55
No such issue here. Advanced Interface Switcher works for me. I have not tested Advanced Power (about to) but I'm pretty sure that will be working too.

Whatever the problem is, it's in your system, not the app. Did you reflash to 1.3 or did you get the over-the-air update. Are you running power kernel? Did you install it before or after this one? What else did you install?

(I'll admit, I only tested bluetooth and wifi - I don't yet use my N900 as a phone - but both of those worked just fine. I'm using the version from Extras-Devel, mind, I don't know what you have.)

I suspect you're either missing the requisite python libraries (though I don't remember off the top of my head what's required), or something else. Did you try rebooting after installing? What else do you have installed?

Moral of the story: Don't say "app doesn't work on ____" unless you know damn sure it does. "App didn't work for me on ____" is a lot more meaningful, and it doesn't spread inaccurate information.

412b: Do you still have any intention to release what you said you had almost-finished as of your last post? If not, don't worry, I'm slowly getting to the point where I'll feel comfortable enough to look at the code and start messing around with stuff (though with college it'll probably be another month before I can actually get any serious work done, but I'll keep you updated). Now, how long it will take me to get to being able to figure out how to put any improvements I am able to think of into the autobuilder is another matter.
 

The Following User Says Thank You to Mentalist Traceur For This Useful Post:
Posts: 462 | Thanked: 550 times | Joined on Sep 2008 @ Moscow
#56
Originally Posted by Mentalist Traceur View Post
412b: Do you still have any intention to release what you said you had almost-finished as of your last post? If not, don't worry, I'm slowly getting to the point where I'll feel comfortable enough to look at the code and start messing around with stuff (though with college it'll probably be another month before I can actually get any serious work done, but I'll keep you updated). Now, how long it will take me to get to being able to figure out how to put any improvements I am able to think of into the autobuilder is another matter.
All the new stuff is in SVN, but time is the main problem. In fact? I'm thinking of buying one more N900 next month as N9 (or whatever it gonna be called) does not seems to appear sooner than next year.
 

The Following User Says Thank You to 412b For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#57
Alright, so after some very confused wandering around in the garage.maemo.org pages, I found what the SVN is, and how to look through it. It was something I meant to do since you first mentioned uploading changes to the SVN in the "pybattery"/Advanced Power Monitor thread, but I didn't have the time to do it then, and kept not getting around to it after.

I am currently going through the various python files by hand. I noticed this:
Code:
from advpowcommon.ui.Config import ConfigUIMaemo5
from advpowcommon.ui.Gtk import *
from advpowcommon.ui.Notebook import NotebookMaemo5
That's something new, in the opt/maemo/usr/lib/hildon-desktop/advifswlib/core/maemo5.py file. I am currently editing the files for each of these by hand on the device with Vi, to make them match the latest ones. I was going to just test the Interface Switcher before updating Advanced Power and Advanced Power Monitor - but does this mean that you added something to Advanced Power Monitor that I should update in that first for this to work? Or is it already in Advanced Power Monitor, just being used now in Interface Switcher?

Anyway, I am assuming everything should still update correctly whenever you push this to extras devel, even if I edit this stuff manually now, right?

A good news side-note: Reading through the python code for this is slowly helping me understand python in general.

As for your N900 purchasing - I wish you luck with that. I hope they are still on sale in Russia, and all goes well in that regard.

- Edit -

Alright, so I got to /opt/maemo/usr/lib/hildon-desktop/advifswlib/interfaces/BT.py

In the latest version in SVN, it says (in line 22):

'images': ('ifsw_statusarea_bluetooth_off', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_online'),

Is there a reason ifws_statusarea_bluetooth_on is repeated thrice? It's not repeated at all in the previous version? I'm copying it as-is right now, but just wondering.

Anyway, whenever I finish making all the changes correlating to the SVN latest version (using vi to manually type everything, so that I learn better, so it's taking me a while, lol - and lots of wrist pain ), I shall let you know how it works with PR1.3 (stock kernel for now). So you'll at least get some next-version testing by proxy before getting your N900, if you do get another one.

Last edited by Mentalist Traceur; 2010-10-30 at 04:15. Reason: More questions as I go through code.
 

The Following User Says Thank You to Mentalist Traceur For This Useful Post:
Posts: 462 | Thanked: 550 times | Joined on Sep 2008 @ Moscow
#58
Originally Posted by Mentalist Traceur View Post
I am currently going through the various python files by hand. I noticed this:
Code:
from advpowcommon.ui.Config import ConfigUIMaemo5
from advpowcommon.ui.Gtk import *
from advpowcommon.ui.Notebook import NotebookMaemo5
That's something new, in the opt/maemo/usr/lib/hildon-desktop/advifswlib/core/maemo5.py file. I am currently editing the files for each of these by hand on the device with Vi, to make them match the latest ones. I was going to just test the Interface Switcher before updating Advanced Power and Advanced Power Monitor - but does this mean that you added something to Advanced Power Monitor that I should update in that first for this to work? Or is it already in Advanced Power Monitor, just being used now in Interface Switcher?
Don't forget 'bout advanced-power-common package, that has a lot of common stuff in it. All the modules starting with advpowcommon are from advanced-power-common package.

Originally Posted by Mentalist Traceur View Post
Anyway, I am assuming everything should still update correctly whenever you push this to extras devel, even if I edit this stuff manually now, right?
It really should, but all the files will be replaced with the package ones.

Originally Posted by Mentalist Traceur View Post
As for your N900 purchasing - I wish you luck with that. I hope they are still on sale in Russia, and all goes well in that regard.
There are and even for about 500$ for a new one.

Originally Posted by Mentalist Traceur View Post
Alright, so I got to /opt/maemo/usr/lib/hildon-desktop/advifswlib/interfaces/BT.py

In the latest version in SVN, it says (in line 22):

'images': ('ifsw_statusarea_bluetooth_off', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_on', 'ifsw_statusarea_bluetooth_online'),

Is there a reason ifws_statusarea_bluetooth_on is repeated thrice? It's not repeated at all in the previous version? I'm copying it as-is right now, but just wondering.
I forgot to remove 2 occurs of it. Those are images for different interface states: Off, On and Connected. So there should be only 3 images. Fixed that in revision 2.

Originally Posted by Mentalist Traceur View Post
Anyway, whenever I finish making all the changes correlating to the SVN latest version (using vi to manually type everything, so that I learn better, so it's taking me a while, lol - and lots of wrist pain ), I shall let you know how it works with PR1.3 (stock kernel for now).
Look at the MC (Midnight Comander) And there is Subversion for N900 So it could easier than it's at the moment )))
 

The Following User Says Thank You to 412b For This Useful Post:
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#59
Quick question - every one of my .py files related to Advance(either one of your apps) has a larger-file-sized copy ending with .pyc. They all have later last-modified dates than the original last-modified dates for the .py ending ones. Is there any reason to remove them or overwrite them with copies of the latest .py files? And is this created by your own apps or is it a behavior of python?

Anyway, I am copying the advpowcommon stuff right now. (Last night I copied advanced interface switcher and advanced power monitor.) I know there's filemanagers and source code editors for the N900 - I just generally actually like using Vi. Admittedly though, after spending hours last night just reading code and typing it out, I decided to skip all of that. Now I'm just copying the code from SVN to Bluefish (one of the oh-so-many available open source source code editors for windows), and saving them from there, then dropping them on my SD card while in Mass Storage mode and just using terminal to copy them to the right place.

The only problem currently is that I can't copy-paste the code text without copying those line numbers at the beginning of every line. If I could figure out how to do that I could skip most of the above steps too. Anyway, I'll look into Subversion, since I haven't heard of that one yet.

- Edit -

Looked up Subversion... Honestly, I think I'm going to see how well I can make that work. As fun as copying-pasting is, I think I'm still causing bugs all over the place for myself (namely, I made interface switcher stop appearing at all, and battery is stuck on the "Starting APMD", greyed-out battery icon stage - which admittedly is progress because last night before updating advpowcommon I got it stuck to displaying 0% battery constantly ). Anyway, I'm thinking I'm gonna stop trying to manually do this and just see if I can directly pull the python files to the N900 somehow.

Currently trying to figure out if Subversion is in the repositories or elsewhere....

- Edit 2 -

Found subversion in extras devel (had to apt-get it, wouldn't even appear under "All packages" in FApMan. Supposedly it's not optified, but eh, I'll live. Time to look up how to use it.

- Edit 3 -

Alright, I figured out Subversion, at least, how to check out files, and how to put them into the desired path. I'll copy the checked out files over to where they belong, reboot, and let you know how that went.

The only thing I'm worried about is accidentally committing stuff back to the SVN. I'm hoping anonymous checkout doesn't let changes be immediately merged, if at all, just in case I manage to type the command during some moment of zealously using the tab key.

- Edit 4 -

Alright, I copied everything in correctly, I think. Now I just have to figure out what needs to be given execute permissions (I'm trying to look at the make.py scripts to see if the post.install instructions tell me anything about what to make executable).

I am unsure about /etc/event.d/apmonitord - but I think not, because almost nothing in event.d is.

Because apmonitord executes /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py I think that should be given exec permissions.

Right now (after noticing I had accidentally copied the of the directories slightly in the wrong path [advpowlib inside advpowlib instead of overwriting advpowlib's contents, and the same mistake in two other places], and fixing that), I enabled execute rights for apmdaemon.py, did killall hildon-status-menu, and Advanced Power works again. However, for all I know there's some other component that does need to be made executable, that I just don't know about, and don't notice not running.

Anyway, I GOT IT WORKING!

I like the new pop-up dialogs. Nothing appears in the Preferences tab for the time being though. (But if I press the "about" tab it shows your name and info, so that works. I'm guessing the preferences part just needs to be developed still.)

Also, I have managed to find some bugs, linked to the order of pressing things.

Basically, if your WiFi is on, and you press the Off button, then after the WLAN: Off banner pops out, but without closing out of the dialog try to turn it on using either the On or <> buttons (say, user opens dialog, presses off, then remembers they needed to do something with internet so try to press on before closing the dialog), the banner for "on" pops up, but the actual WiFi doesn't seem to turn on (connection list doesn't try to load - no loading animated circle, just straight to "No connections available" just as it does in cases when the wifi is off. But the Interface Switcher's icon continues to show "On". I find that in those cases the only way to turn it on is with the <> button, instead of the "On" button. Unsure how/why that is, because my actual understanding of the code is only semi complete, and largely vague logical guesses, rather than technical understanding. I'm guessing that perhaps the boolean variable with which Interface Switcher tracks whether the WiFi is off is set upon dialog exit, and the icon/text changing is not completely tied to the actual modprobe/rmmod of the WLAN driver. So press off, if-wlan-on then wlan-rmmod, and vice versa, but icons change in response to the click of the button (if-off-clicked, WLAN off banner, off-icon - and vice-versa). So if the state of the WLAN isn't directly queried, and set in a way similar to the above, then clicking on before the WiFi on/off variable is set to off would result in wifi-off?->No->Do-nothing.->on-button-pressed?->Yes->Switch-image-and-text-to-'on'. (If I was truly diligent I would go check if this is the case now, but I've been looking at python code and/or doing technical N900 stuff for approx. an entire waking day now, so I'm taking a brake.)

But, good news is is that aside from that, everything seems to work.

Last edited by Mentalist Traceur; 2010-10-31 at 01:50. Reason: Heh, got subversion. Experimenting time. | Figured it out. | Copied everything.
 
Posts: 462 | Thanked: 550 times | Joined on Sep 2008 @ Moscow
#60
Originally Posted by Mentalist Traceur View Post
Quick question - every one of my .py files related to Advance(either one of your apps) has a larger-file-sized copy ending with .pyc. They all have later last-modified dates than the original last-modified dates for the .py ending ones. Is there any reason to remove them or overwrite them with copies of the latest .py files? And is this created by your own apps or is it a behavior of python?
*.pyc are compiled python files

Originally Posted by Mentalist Traceur View Post
The only thing I'm worried about is accidentally committing stuff back to the SVN. I'm hoping anonymous checkout doesn't let changes be immediately merged, if at all, just in case I manage to type the command during some moment of zealously using the tab key.
Don't worry, anonymous is read-only. You need to commit changes to let them take effect.

Originally Posted by Mentalist Traceur View Post
I am unsure about /etc/event.d/apmonitord - but I think not, because almost nothing in event.d is.

Because apmonitord executes /opt/maemo/usr/lib/advanced-power-monitor/apmdaemon.py I think that should be given exec permissions.
Both files does not have to be exec, in fact. apmdaemon is included via python.

Originally Posted by Mentalist Traceur View Post
Right now (after noticing I had accidentally copied the of the directories slightly in the wrong path [advpowlib inside advpowlib instead of overwriting advpowlib's contents, and the same mistake in two other places], and fixing that), I enabled execute rights for apmdaemon.py, did killall hildon-status-menu, and Advanced Power works again. However, for all I know there's some other component that does need to be made executable, that I just don't know about, and don't notice not running.
Look at the *.sudoers rule file It allows to start apmonitord job as user.

Originally Posted by Mentalist Traceur View Post
I like the new pop-up dialogs. Nothing appears in the Preferences tab for the time being though. (But if I press the "about" tab it shows your name and info, so that works. I'm guessing the preferences part just needs to be developed still.)
The preferences part is to be thought of. Just because it's in common already implemented, so only concrete settings are to be figured out.

Originally Posted by Mentalist Traceur View Post
Also, I have managed to find some bugs, linked to the order of pressing things.

Basically, if your WiFi is on, and you press the Off button, then after the WLAN: Off banner pops out, but without closing out of the dialog try to turn it on using either the On or <> buttons (say, user opens dialog, presses off, then remembers they needed to do something with internet so try to press on before closing the dialog), the banner for "on" pops up, but the actual WiFi doesn't seem to turn on (connection list doesn't try to load - no loading animated circle, just straight to "No connections available" just as it does in cases when the wifi is off. But the Interface Switcher's icon continues to show "On". I find that in those cases the only way to turn it on is with the <> button, instead of the "On" button. Unsure how/why that is, because my actual understanding of the code is only semi complete, and largely vague logical guesses, rather than technical understanding. I'm guessing that perhaps the boolean variable with which Interface Switcher tracks whether the WiFi is off is set upon dialog exit, and the icon/text changing is not completely tied to the actual modprobe/rmmod of the WLAN driver. So press off, if-wlan-on then wlan-rmmod, and vice versa, but icons change in response to the click of the button (if-off-clicked, WLAN off banner, off-icon - and vice-versa). So if the state of the WLAN isn't directly queried, and set in a way similar to the above, then clicking on before the WiFi on/off variable is set to off would result in wifi-off?->No->Do-nothing.->on-button-pressed?->Yes->Switch-image-and-text-to-'on'. (If I was truly diligent I would go check if this is the case now, but I've been looking at python code and/or doing technical N900 stuff for approx. an entire waking day now, so I'm taking a brake.)
Unfortunatelly, it's not a bug. To make things look clearly: WiFi state is tied with async D-Bus signals. So AIS changes WiFi state only if signal is emitted by system. When you change state in dialog AIS only 'requests' to change WiFi state and, if it goes right (the changed signal is emitted), changes its state. All the interfaces' modules work using this logic. One of the reasons of no connection found could be long time for initializing WiFi, in fact. Try opening Connections dialog again after some time or wait a bit. Connections should be there.
 
Reply


 
Forum Jump


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