Exemplo n.º 1
0
 def _set_style(self):
     #sets style of EditWindow
     if self._entry["title"]:
         self.set_title(_("Edit > %s") % self._entry["title"])
     else:
         self.set_title(_("New Entry"))
     self.set_modal(True)
Exemplo n.º 2
0
 def _create_ui(self):
     #creates ui
     self._info_lb = gtk.Label(_("Boot menu display time:"))
     adj = gtk.Adjustment(value=self._default, lower=0, upper=1000,
                          step_incr=1)
     self._timeout_sb = gtk.SpinButton(adj)
     self.apply_btn = gtk.Button(_("Apply"))
     self.apply_btn.set_sensitive(False)
     self.pack_start(self._info_lb, expand=False, fill=False)
     self.pack_start(self._timeout_sb, expand=False, fill=False)
     self.pack_start(self.apply_btn, expand=False, fill=False)
Exemplo n.º 3
0
 def _create_ui(self):
     #creates ui elements
     self.vbox = gtk.VBox(homogeneous=False, spacing=5)
     self.add(self.vbox)
     self.add_elements()
     hbox = gtk.HBox()
     self.ok_btn = gtk.Button(_("OK"))
     self.cancel_btn = gtk.Button(_("Cancel"))
     hbox.pack_end(self.ok_btn, fill=False, expand=False)
     hbox.pack_end(self.cancel_btn, fill=False, expand=False)
     self.vbox.pack_end(hbox, fill=False, expand=False)
     self.vbox.show_all()
Exemplo n.º 4
0
 def __init__(self):
     """init the variables"""
     super(BootManagerAddon, self).__init__()
     self._uuid = "fa2e9fe7-7f3f-4a7a-aea8-e1a7a46aafef"
     self._icon_name = "computer"
     self._label = _("Boot Manager")
     self._widget = BootManager 
Exemplo n.º 5
0
    def _create_ui(self):
        self.check_btn = gtk.CheckButton()

        self._name_lb = gtk.Label()
        self._name_lb.set_alignment(0.0, 0.5)
        self._device_lb = gtk.Label()
        self._device_lb.set_alignment(0.0, 0.5)
        self.edit_btn = gtk.Button(_("Edit"))
        self.delete_btn = gtk.Button(_("Delete"))

        self.attach(self.check_btn, 0, 1, 0, 2,
                    gtk.SHRINK, gtk.SHRINK)
        #icon goes here: self.attach(self._icon, 0, 2, 1, 2)
        self.attach(self._name_lb, 2, 3, 0, 1,
                    gtk.EXPAND|gtk.FILL, gtk.SHRINK)
        self.attach(self._device_lb, 2, 3, 1, 2,
                    gtk.EXPAND|gtk.FILL, gtk.SHRINK)
        self.attach(self.edit_btn, 3, 4, 0, 2,
                    gtk.SHRINK, gtk.SHRINK)
        self.attach(self.delete_btn, 4, 5, 0, 2,
                    gtk.SHRINK, gtk.SHRINK)
Exemplo n.º 6
0
 def _set_style(self):
     self.set_label(_("Add New"))
Exemplo n.º 7
0
 def _on_exception(self, e):
     if "Comar.PolicyKit" in e._dbus_error_name:
         self.open_error_dialog(_("Access Denied"))
     else:
         self.open_error_dialog(unicode(e))
Exemplo n.º 8
0
                          title:'Pardus',
                          root:/dev/sda1,
                          os_type:linux,
                          default:True})}
        """
        action = data["action"]
        props = data["props"]
        if action == "make_default":
            try:
                self.iface.setOption("default", props["index"])
            except Exception, e:
                self._on_exception(e)
        elif action == "edit":
            EditWindow(self.entries[props["index"]], self.on_edit).show()
        elif action == "delete":
            m = _("Do you want to delete the entry '%s' ?") % props["title"]
            dialog = gtk.MessageDialog(type=gtk.MESSAGE_WARNING, buttons=gtk.BUTTONS_YES_NO, message_format=m)
            response = dialog.run()
            if response == gtk.RESPONSE_YES:
                try:
                    self.iface.removeEntry(props["index"], props["title"])
                except Exception, e:
                    self._on_exception(e)
            dialog.destroy()

    def _on_exception(self, e):
        if "Comar.PolicyKit" in e._dbus_error_name:
            self.open_error_dialog(_("Access Denied"))
        else:
            self.open_error_dialog(unicode(e))
Exemplo n.º 9
0
#based on TUBITAK/UAKAE version
def get_disk_by_uuid(uuid):
    """get disk path by uuid"""
    from os import path, readlink
    uuid_p = "/dev/disk/by-uuid" #uuidpath
    if path.exists(uuid_p+"/%s" % uuid):
        return path.realpath(path.join("/dev/disk/by-uuid/",
                                       readlink(uuid_p+"/%s" % uuid)))
    else:
        return uuid


from boot_manager_gtk.translation import _
EDIT_WINDOW_LABELS = {
    "title":_("Title"),
    "root":_("Disk"),
    "kernel":_("Kernel"),
    "initrd":_("Ramdisk File"),
    "options":_("Boot Options")
    }
EDIT_WINDOW_INFOS = {
    "title":_("Name of the boot entry to be shown at the boot menu."),
    "root":_("Disk that contains operating system."),
    "initrd": _("File that contains a micro operating system for preloading kernel modules."),
    "kernel":_("Operating system kernel."),
    "options":_("Boot options for operating system.")
    }
def dummy_entry(systems, name):
    """returns a dummy entry using name
 def _set_style(self):
     #sets style of window
     self.set_title(_("Boot Manager"))
     self.set_default_size(483, 300)