GTG

Autostart from DBus (for gtg_new_task)

Bug #515431 reported by Gordon Ball
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GTG
Fix Released
Low
Luca Invernizzi

Bug Description

As set up, gtg_new_task only works if gtg is already running. This is unnecessary and can be fixed with simple changes to that script and addition of a .service file.

Add file: /usr/share/dbus-1/services/org.GTG.service containing

"""
[D-BUS Service]
Name=org.GTG
Exec=/usr/bin/gtg

"""

and change the get_task() function of gtg_new_task to

"""
def get_task() :
    #We will connect on the session bus
    bus = dbus.SessionBus()
    liste = bus.list_names()
    busname = "org.GTG"
    remote_object = bus.get_object(busname,"/org/GTG")
    timi = dbus.Interface(remote_object,dbus_interface="org.GTG")
    #Calling the method
    timi.open_new_task()

"""

The existing code searches for an already existing bus rather than trying to connect automatically so wouldn't work with just the addition of the .service file above.

(I don't know if .service files are meant to be provided by applications or distributions)

Related branches

Changed in gtg:
importance: Undecided → Low
milestone: none → 0.3
status: New → Confirmed
Revision history for this message
Luca Invernizzi (invernizzi) wrote :

It works well, thanks!

Changed in gtg:
status: Confirmed → Fix Committed
assignee: nobody → Luca Invernizzi (invernizzi)
Changed in gtg:
milestone: 0.3 → 0.2.2
Changed in gtg:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.