Merge remote-tracking branch 'qubesos/pr/72'
* qubesos/pr/72: Added 'Apply' button to VM Settings
This commit is contained in:
		
						commit
						fb4870a16b
					
				@ -76,10 +76,12 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
 | 
				
			|||||||
            assert idx in range(self.tabWidget.count())
 | 
					            assert idx in range(self.tabWidget.count())
 | 
				
			||||||
            self.tabWidget.setCurrentIndex(idx)
 | 
					            self.tabWidget.setCurrentIndex(idx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.connect(self.buttonBox,
 | 
					        self.buttonBox.button(QtGui.QDialogButtonBox.Ok).clicked.connect(
 | 
				
			||||||
                     QtCore.SIGNAL("accepted()"),
 | 
					            self.save_and_apply)
 | 
				
			||||||
                     self.save_and_apply)
 | 
					        self.buttonBox.button(QtGui.QDialogButtonBox.Cancel).clicked.connect(
 | 
				
			||||||
        self.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), self.reject)
 | 
					            self.reject)
 | 
				
			||||||
 | 
					        self.buttonBox.button(QtGui.QDialogButtonBox.Apply).clicked.connect(
 | 
				
			||||||
 | 
					            self.apply)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.tabWidget.currentChanged.connect(self.current_tab_changed)
 | 
					        self.tabWidget.currentChanged.connect(self.current_tab_changed)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -152,7 +154,7 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
 | 
				
			|||||||
    def accept(self):
 | 
					    def accept(self):
 | 
				
			||||||
        pass
 | 
					        pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def save_and_apply(self):
 | 
					    def save_changes(self):
 | 
				
			||||||
        t_monitor = thread_monitor.ThreadMonitor()
 | 
					        t_monitor = thread_monitor.ThreadMonitor()
 | 
				
			||||||
        thread = threading.Thread(target=self.__save_changes__,
 | 
					        thread = threading.Thread(target=self.__save_changes__,
 | 
				
			||||||
                                  args=(t_monitor,))
 | 
					                                  args=(t_monitor,))
 | 
				
			||||||
@ -179,6 +181,11 @@ class VMSettingsWindow(ui_settingsdlg.Ui_SettingsDialog, QtGui.QDialog):
 | 
				
			|||||||
                        ).format(self.vm.name),
 | 
					                        ).format(self.vm.name),
 | 
				
			||||||
                self.tr("ERROR: {0}").format(t_monitor.error_msg))
 | 
					                self.tr("ERROR: {0}").format(t_monitor.error_msg))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def apply(self):
 | 
				
			||||||
 | 
					        self.save_changes()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def save_and_apply(self):
 | 
				
			||||||
 | 
					        self.save_changes()
 | 
				
			||||||
        self.done(0)
 | 
					        self.done(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __save_changes__(self, t_monitor):
 | 
					    def __save_changes__(self, t_monitor):
 | 
				
			||||||
 | 
				
			|||||||
@ -1359,7 +1359,7 @@ border-width: 1px;</string>
 | 
				
			|||||||
        <enum>Qt::Horizontal</enum>
 | 
					        <enum>Qt::Horizontal</enum>
 | 
				
			||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
       <property name="standardButtons">
 | 
					       <property name="standardButtons">
 | 
				
			||||||
        <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 | 
					        <set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 | 
				
			||||||
       </property>
 | 
					       </property>
 | 
				
			||||||
      </widget>
 | 
					      </widget>
 | 
				
			||||||
     </item>
 | 
					     </item>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user