def updateConfig(self, ret = False):
		if (ret == True):
			sharedir = None
			if self.old_sharename != self.sharenameConfigEntry.value:
				xml_sharename = self.old_sharename
			else:
				xml_sharename = self.sharenameConfigEntry.value

			if self.sharedirConfigEntry.value.startswith("/"):
				sharedir = self.sharedirConfigEntry.value[1:]
			else:
				sharedir = self.sharedirConfigEntry.value
			iAutoMount.setMountsAttribute(xml_sharename, "mountusing", self.mountusingConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "sharename", self.sharenameConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "active", self.activeConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "ip", self.ipConfigEntry.getText())
			iAutoMount.setMountsAttribute(xml_sharename, "sharedir", sharedir)
			iAutoMount.setMountsAttribute(xml_sharename, "mounttype", self.mounttypeConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "options", self.optionsConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "username", self.usernameConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "password", self.passwordConfigEntry.value)
			iAutoMount.setMountsAttribute(xml_sharename, "hdd_replacement", self.hdd_replacementConfigEntry.value)

			self.updateConfigRef = None
			self.updateConfigRef = self.session.openWithCallback(self.updateConfigfinishedCB, MessageBox, _("Please wait while updating your network mount..."), type = MessageBox.TYPE_INFO, enable_input = False)
			iAutoMount.writeMountsConfig()
			iAutoMount.getAutoMountPoints(self.updateConfigDataAvail, True)
		else:
			self.close()
    def updateConfig(self, ret=False):
        if (ret == True):
            sharedir = None
            if self.sharedirConfigEntry.value.startswith("/"):
                sharedir = self.sharedirConfigEntry.value[1:]
            else:
                sharedir = self.sharedirConfigEntry.value
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "sharename",
                                          self.sharenameConfigEntry.value)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "active",
                                          self.activeConfigEntry.value)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "ip", self.ipConfigEntry.getText())
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "sharedir", sharedir)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "mounttype",
                                          self.mounttypeConfigEntry.value)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "options",
                                          self.optionsConfigEntry.value)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "username",
                                          self.usernameConfigEntry.value)
            iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value,
                                          "password",
                                          self.passwordConfigEntry.value)
            iAutoMount.setMountsAttribute(
                self.sharenameConfigEntry.value, "hdd_replacement",
                self.hdd_replacementConfigEntry.value)

            self.updateConfigRef = None
            self.updateConfigRef = self.session.openWithCallback(
                self.updateConfigfinishedCB,
                MessageBox,
                _("Please wait while updating your network mount..."),
                type=MessageBox.TYPE_INFO,
                enable_input=False)
            iAutoMount.writeMountsConfig()
            iAutoMount.getAutoMountPoints(self.updateConfigDataAvail)
        else:
            self.close()
Exemple #3
0
 def updateConfig(self, ret = False):
     if ret == True:
         sharedir = None
         if self.sharedirConfigEntry.value.startswith('/'):
             sharedir = self.sharedirConfigEntry.value[1:]
         else:
             sharedir = self.sharedirConfigEntry.value
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'mountusing', self.mountusingConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'sharename', self.sharenameConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'active', self.activeConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'ip', self.ipConfigEntry.getText())
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'sharedir', sharedir)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'mounttype', self.mounttypeConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'options', self.optionsConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'username', self.usernameConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'password', self.passwordConfigEntry.value)
         iAutoMount.setMountsAttribute(self.sharenameConfigEntry.value, 'hdd_replacement', self.hdd_replacementConfigEntry.value)
         self.updateConfigRef = None
         self.updateConfigRef = self.session.openWithCallback(self.updateConfigfinishedCB, MessageBox, _('Please wait while updating your network mount...'), type=MessageBox.TYPE_INFO, enable_input=False)
         iAutoMount.writeMountsConfig()
         iAutoMount.getAutoMountPoints(self.updateConfigDataAvail)
     else:
         self.close()