def set(self, x): if self.__show ^ x: self.__show = x config = red_settings.get_config() config.set(self.conf_str, x) config.sync() self.emit("changed", x)
def change_visibility(self): config = red_settings.get_config() if self.get_property("visible"): config.set(self.conf_str_hidden, 1) self.hide() else: config.set(self.conf_str_hidden, 0) self.show_all() config.sync()
def __init__(self): gtk.VBox.__init__(self, 0, 6) red_pendingops.PendingOpsListener.__init__(self) self.update_pending = 0 self.set_border_width(6) self.build() config = red_settings.get_config() if not int(config.getboolean(self.conf_str_hidden + "=0")): self.show_all()
def save_geometry(self): conf = red_settings.get_config() x, y, w, h = self.allocation conf.set("Geometry/width", w) conf.set("Geometry/height", h) x, y, w, h = self.sidebar.allocation conf.set("Geometry/sidebar_width", w) conf.sync()
def activate(self, button): service_id = self.service_opt.get_service_id() service = rcd_util.get_service_by_id(service_id) email = self.email.get_text() code = self.code.get_text() email_required = 1 if service and service["type"] == "zenworks": email_required = 0 email = "" if not code or (email_required and not email): dialog = gtk.MessageDialog( self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Please fill in both email and registration code.")) dialog.run() dialog.destroy() return server = rcd_util.get_server_proxy() def activate_finished_cb(worker, this): if worker.is_cancelled(): return try: worker.get_result() except ximian_xmlrpclib.Fault, f: rcd_util.dialog_from_fault( f, error_text=_("Unable to activate"), additional_text=_("Please ensure " "you typed the email address " "and registration code correctly"), parent=self) return # Store email to config. config = red_settings.get_config() config.set("Activation/email", this.email_to_save) config.sync() rcd_util.refresh(this) this.destroy()
def load_geometry(self): conf = red_settings.get_config() w = int(conf.get("Geometry/width=0")) h = int(conf.get("Geometry/height=0")) if w and h: self.set_default_size(w, h) else: w, h = self.size_request() w = int(w * 1.3) h = int(w * .667) self.set_default_size(w, h) w = int(conf.get("Geometry/sidebar_width=0")) if w: self.hpaned.set_position(w)
def activate(self, button): service_id = self.service_opt.get_service_id() service = rcd_util.get_service_by_id(service_id) email = self.email.get_text() code = self.code.get_text() email_required = 1 if service and service["type"] == "zenworks": email_required = 0 email = "" if not code or (email_required and not email): dialog = gtk.MessageDialog(self, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("Please fill in both email and registration code.")) dialog.run() dialog.destroy() return server = rcd_util.get_server_proxy() def activate_finished_cb(worker, this): if worker.is_cancelled(): return try: worker.get_result() except ximian_xmlrpclib.Fault, f: rcd_util.dialog_from_fault(f, error_text=_("Unable to activate"), additional_text=_("Please ensure " "you typed the email address " "and registration code correctly"), parent=self) return # Store email to config. config = red_settings.get_config() config.set("Activation/email", this.email_to_save) config.sync() rcd_util.refresh(this) this.destroy()
def __init__(self): gobject.GObject.__init__(self) config = red_settings.get_config() self.__show = int(config.getboolean(self.conf_str + "=0"))
def fill(self): config = red_settings.get_config() email = config.get("Activation/email") if email: self.email.set_text(email)