PINE64
Flashlight application - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: Mobian on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=139)
+---- Thread: Flashlight application (/showthread.php?tid=10498)

Pages: 1 2 3


RE: Flashlight application - devrtz - 07-01-2020

(07-01-2020, 04:07 PM)bcnaz Wrote: Will this flashlight app soon be in the nightly build,    or in a soon to be release ?

Without having it checked, I would expect it to already be in the nightly build.
If not, it will definitely soon be in there (both nightly and release).

The debos recipe has recently been updated
to include flashlight.


RE: Flashlight application - antiX-Dave - 07-01-2020

I was looking at the code but as I am not too familiar with C and the method of compiling, I am not really capable of making changes and submitting a merge request at this moment. Still trying to learn but finding it a bit more vague than python, php, perl and the like...

So perhaps a function request?
Maybe the app could have a g_signal_connect on the window for the delete and destroy events to run the enable_flashlight(False) function (which as best as I can tell is a toggle based on the button press being true or false) so that the flashlight is turned off before the application is closed?


RE: Flashlight application - devrtz - 07-02-2020

(07-01-2020, 09:11 PM)antiX-Dave Wrote: I was looking at the code but as I am not too familiar with C and the method of compiling, I am not really capable of making changes and submitting a merge request at this moment. Still trying to learn but finding it a bit more vague than python, php, perl and the like...

So perhaps a function request?
Maybe the app could have a g_signal_connect on the window for the delete and destroy events to run the enable_flashlight(False) function (which as best as I can tell is a toggle based on the button press being true or false) so that the flashlight is turned off before the application is closed?

I myself have never really dived into php and perl. Python is cool though, but sometimes I get confused by all the magic that happens in the background.
In C I feel there is no magic involved and I like being in total control (also allowing you to make stupid mistakes of course ;) ).

Anyway: In case you are interested, have a look at this MR.


RE: Flashlight application - antiX-Dave - 07-02-2020

(07-02-2020, 12:46 AM)devrtz Wrote: I myself have never really dived into php and perl. Python is cool though, but sometimes I get confused by all the magic that happens in the background.
In C I feel there is no magic involved and I like being in total control (also allowing you to make stupid mistakes of course Wink ).

Anyway: In case you are interested, have a look at this MR.

Ah excellent, thank you for the addition; Super quick with an update to the repo as well!

Indeed there is full control and allowing all the mistakes.
I see the new function, and an variable for the object class being set.

Now it is not as clear to me how the function is attached to the events. For python I would have something like
Code:
window.connect("destroy", quit_app())

But I cannot tell what would be the equivalent / replacement of that line in C.
I deduce it to be
Code:
object_class->finalize = finalize;

and read it like if gtk object class is finalized run the finalize function.
Is this the case?


RE: Flashlight application - devrtz - 07-02-2020

If you take a look here
you can see, that something like
Code:
g_signal_connect (window, "destroy",
                  G_CALLBACK (destroy), NULL);
could also be used.

In most C GTK apps I have looked at (gnome-calendar, phosh, calls, chatty) usually the finalize or dispose methods
are overriden. (By the way I only started with GTK in C ~2months back - so I'm definitely not an expert - I just poke at things
until they do what I want them to Tongue )

Quote:and read it like if gtk object class is finalized run the finalize function.

Is this the case?

Yup!


RE: Flashlight application - arturo2bodegas - 07-02-2020

just tried ...installs, opens, but no light when I click the button...ran all apt updates, including dist and other above...wonder what could be the problem?


RE: Flashlight application - bcnaz - 07-02-2020

It will soon be included in the release or nightly build


RE: Flashlight application - devrtz - 07-02-2020

(07-02-2020, 07:18 PM)arturo2bodegas Wrote: just tried ...installs, opens, but no light when I click the button...ran all apt updates, including dist and other above...wonder what could be the problem?
Did you also reboot your phone after the upgrade?


RE: Flashlight application - wibble - 07-03-2020

(07-02-2020, 09:44 PM)devrtz Wrote:
(07-02-2020, 07:18 PM)arturo2bodegas Wrote: just tried ...installs, opens, but no light when I click the button...ran all apt updates, including dist and other above...wonder what could be the problem?
Did you also reboot your phone after the upgrade?
It looks like there's another step needed in the manual upgrade process - the new kernel package is installed but the older 5.6 kernel is still present and being used after reboot. 'apt autoremove' doesn't remove the 5.6 kernel package.
Code:
root@mobian:~# apt-cache policy u-boot-sunxi
u-boot-sunxi:
  Installed: 2020.04+dfsg-2+pinephone5
  Candidate: 2020.04+dfsg-2+pinephone5
  Version table:
*** 2020.04+dfsg-2+pinephone5 700
        700 http://repo.mobian-project.org mobian/main arm64 Packages
        100 /var/lib/dpkg/status
     2020.04+dfsg-2 500
        500 http://deb.debian.org/debian bullseye/main arm64 Packages
root@mobian:~# apt-cache policy linux-image-5.7-pinephone
linux-image-5.7-pinephone:
  Installed: 5.7.0+pinephone4
  Candidate: 5.7.0+pinephone4
  Version table:
*** 5.7.0+pinephone4 700
        700 http://repo.mobian-project.org mobian/main arm64 Packages
        100 /var/lib/dpkg/status
root@mobian:~# uname -a
Linux mobian 5.6-pinephone #5.6.0+pinephone10 SMP PREEMPT Thu May 28 14:13:07 CEST 2020 aarch64 GNU/Linux
root@mobian:~# apt-cache policy linux-image-5.6-pinephone
linux-image-5.6-pinephone:
  Installed: 5.6.0+pinephone10
  Candidate: 5.6.0+pinephone10
  Version table:
*** 5.6.0+pinephone10 700
        700 http://repo.mobian-project.org mobian/main arm64 Packages
        100 /var/lib/dpkg/status
root@mobian:~# apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.



RE: Flashlight application - arturo2bodegas - 07-03-2020

Just updated and rebooted AND THE FLASHLIGHT APP WORKS NOW!
COOL!