Settings checking whether VM has 'kernel' attribute.
This commit is contained in:
		
							parent
							
								
									79aa86f08e
								
							
						
					
					
						commit
						4184e49853
					
				@ -360,7 +360,25 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
 | 
			
		||||
 | 
			
		||||
        self.include_in_balancing.setChecked(self.vm.services['meminfo-writer']==True)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        #paths
 | 
			
		||||
        self.dir_path.setText(self.vm.dir_path)
 | 
			
		||||
        self.config_path.setText(self.vm.conf_file)
 | 
			
		||||
        if self.vm.template is not None:
 | 
			
		||||
            self.root_img_path.setText(self.vm.template.root_img)
 | 
			
		||||
        else:
 | 
			
		||||
            self.root_img_path.setText("n/a")
 | 
			
		||||
        self.volatile_img_path.setText(self.vm.volatile_img)
 | 
			
		||||
        self.private_img_path.setText(self.vm.private_img)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        #kernel
 | 
			
		||||
 | 
			
		||||
        #in case VM is not Linux
 | 
			
		||||
        if not hasattr(self.vm, "kernel"):
 | 
			
		||||
            self.kernel_groupbox.setVisible(False)
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        if self.vm.template is not None:
 | 
			
		||||
            text = self.vm.kernel
 | 
			
		||||
            self.kernel.insertItem(0, text)
 | 
			
		||||
@ -390,15 +408,6 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
 | 
			
		||||
            self.kernel_opts.setText(self.vm.kernelopts)
 | 
			
		||||
 | 
			
		||||
                
 | 
			
		||||
        #paths
 | 
			
		||||
        self.dir_path.setText(self.vm.dir_path)
 | 
			
		||||
        self.config_path.setText(self.vm.conf_file)
 | 
			
		||||
        if self.vm.template is not None:
 | 
			
		||||
            self.root_img_path.setText(self.vm.template.root_img)
 | 
			
		||||
        else:
 | 
			
		||||
            self.root_img_path.setText("n/a")
 | 
			
		||||
        self.volatile_img_path.setText(self.vm.volatile_img)
 | 
			
		||||
        self.private_img_path.setText(self.vm.private_img)
 | 
			
		||||
       
 | 
			
		||||
    def __apply_advanced_tab__(self):
 | 
			
		||||
 | 
			
		||||
@ -418,6 +427,10 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog):
 | 
			
		||||
        #include_in_memory_balancing applied in services tab
 | 
			
		||||
 | 
			
		||||
        
 | 
			
		||||
        #in case VM is not Linux
 | 
			
		||||
        if not hasattr(self.vm, "kernel"):
 | 
			
		||||
            return;
 | 
			
		||||
 | 
			
		||||
        #kernel changed
 | 
			
		||||
        if self.kernel.currentIndex() != self.kernel_idx:
 | 
			
		||||
            new_kernel = self.kernel.currentText()
 | 
			
		||||
 | 
			
		||||
@ -29,7 +29,7 @@
 | 
			
		||||
        <locale language="English" country="UnitedStates"/>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="currentIndex">
 | 
			
		||||
        <number>3</number>
 | 
			
		||||
        <number>1</number>
 | 
			
		||||
       </property>
 | 
			
		||||
       <widget class="QWidget" name="basic_tab">
 | 
			
		||||
        <property name="locale">
 | 
			
		||||
@ -435,7 +435,7 @@
 | 
			
		||||
          </widget>
 | 
			
		||||
         </item>
 | 
			
		||||
         <item row="0" column="1">
 | 
			
		||||
          <widget class="QGroupBox" name="groupBox_10">
 | 
			
		||||
          <widget class="QGroupBox" name="kernel_groupbox">
 | 
			
		||||
           <property name="enabled">
 | 
			
		||||
            <bool>true</bool>
 | 
			
		||||
           </property>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user