trinity-devel@lists.pearsoncomputing.net

Message: previous - next
Month: February 2012

Re: [trinity-devel] UPower support added in tdebase/ksmserver

From: Calvin Morrison <mutantturkey@...>
Date: Thu, 16 Feb 2012 11:26:09 -0500
On 16 February 2012 10:23, Ilya Chernykh <anixxsus@...> wrote:
> On Thursday 16 February 2012 19:16:05 Serghei Amelian wrote:
>
>> > > > can we get a link to the sources? I'd like to incorporate it into my
>> > > > work on the shutdown dialog.
>> > >
>> > > http://git.trinitydesktop.org/cgit/tdebase/tree/ksmserver/shutdowndlg.cpp
>> >
>> > Is there a link to patch somewhere?
>>
>> I think the patch is a mess, because qtcreator made automatically some cleanup
>> in source file. Howewer, upower code is embraced between "#ifdef WITH_UPOWER"
>> directives.
>
> Also I wonder whether the patch affects all KDE places where one can shutdown the computer or
> only the shutdown dialog. I.e. whether it would work for hibernating from a menu such as kickoff.
>
>

Ilya, no I don't think so - if you look it calls hal directly. I am
sure similar calls could be made.

Relevant files to kickoff: kdebase/kicker/ui/k_new_menu.cpp

#ifdef KDELIBS_SUSE
    int supported = -1;
    bool suspend_ram, suspend_disk, standby;

    liblazy_hal_get_property_bool(HAL_UDI_COMPUTER,
"power_management.can_suspend", &supported);
    if (supported == 1)
        suspend_ram = true;
    else
        suspend_ram = false;
	liblazy_hal_get_property_bool(HAL_UDI_COMPUTER,
"power_management.can_standby", &supported);
	if (supported == 1)
	     standby = true;
	else
	     standby = false;
	liblazy_hal_get_property_bool(HAL_UDI_COMPUTER,
"power_management.can_hibernate", &supported);
	if (supported == 1)
	     suspend_disk = true;
	else
	     suspend_disk = false;


it's acessing it directly.