Re: Install Fedora Button for LiveCD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tom Callaway (tcallawa@xxxxxxxxxx) said: 
> There seems to be at least some consensus that:
> 
> * The notification, unless permanent, is not an ideal solution here
> because once it goes away, the user is in the same situation of
> confusion as to how to install the Live Image to disk.

The notification that Matthias posted is permanent, until the user
explicitly goes through and clicks to remove it.

I've updated it so that it pulls translations from anaconda for the tile
and the action item.

Bill
#!/usr/bin/env python

from gi.repository import GLib
from gi.repository import Gio
from gi.repository import Notify
import sys
import os

def install_cb(n, action):
   assert action == "install"
   n.close()
   os.execlp("liveinst", "liveinst")

if __name__ == '__main__':
    appinfo = Gio.DesktopAppInfo()
    try:
       desktop = appinfo.new_from_filename("/usr/share/applications/liveinst.desktop")
    except:
       sys.exit(1)
    label = desktop.get_name()
    actionlabel = desktop.get_generic_name()

    if not Notify.init(label):
        sys.exit(1)

    n = Notify.Notification()
    n.set_property("summary",label)
    n.set_property("body", 
        "You are currently using an uninstalled live image.\n" +
        "If you want to keep using Fedora, you can install " +
        "it to your hard disk.")
    n.set_property("icon-name","anaconda")
    n.set_hint("resident", GLib.Variant('b',True))

    n.add_action("install", actionlabel, install_cb, None, None)

    if not n.show():
        print "Failed to send notification"
        sys.exit(1)

    GLib.MainLoop().run()
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux