mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-28 23:00:53 +01:00
config autonum widget: minor change about enable/disable apply button
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2351 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -59,12 +59,20 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
return nc;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::isValid
|
||||
* @return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
bool NumPartEditorW::isValid() {
|
||||
if (type_ != folio && ui -> value_field -> text().isEmpty()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::on_type_combo_activated
|
||||
* Action when user change the type comboBox
|
||||
*/
|
||||
void NumPartEditorW::on_type_combo_activated(int index) {
|
||||
emit changed();
|
||||
switch (index) {
|
||||
case unit:
|
||||
setType(unit);
|
||||
@@ -82,13 +90,14 @@ void NumPartEditorW::on_type_combo_activated(int index) {
|
||||
setType(folio);
|
||||
break;
|
||||
};
|
||||
emit changed();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief NumPartEditorW::on_value_field_textChanged
|
||||
* emit changed when @value_field text changed
|
||||
*/
|
||||
void NumPartEditorW::on_value_field_textChanged() {
|
||||
void NumPartEditorW::on_value_field_textEdited() {
|
||||
emit changed();
|
||||
}
|
||||
|
||||
@@ -97,7 +106,7 @@ void NumPartEditorW::on_value_field_textChanged() {
|
||||
*emit changed when @increase_spinBox value changed
|
||||
*/
|
||||
void NumPartEditorW::on_increase_spinBox_valueChanged() {
|
||||
emit changed();
|
||||
if (!ui -> value_field -> text().isEmpty()) emit changed();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,6 +117,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t) {
|
||||
ui -> type_combo -> setCurrentIndex(t);
|
||||
ui -> value_field -> clear();
|
||||
ui -> increase_spinBox -> setValue(1);
|
||||
type_= t;
|
||||
switch (t) {
|
||||
case unit:
|
||||
ui -> value_field -> setEnabled(true);
|
||||
|
||||
Reference in New Issue
Block a user