| 65 | } |
| 66 | |
| 67 | void PresetRuleDialog::onAddClicked() |
| 68 | { |
| 69 | if(!deviceModel->loadRemaining(ruleModel)) |
| 70 | { |
| 71 | QMessageBox::information(this, tr("Cannot add new rule"), |
| 72 | tr("All connected audio devices have already a rule defined.\n" |
| 73 | "You can only create one rule per device.")); |
| 74 | return; |
| 75 | } |
| 76 | |
| 77 | if(PresetManager::instance().presetModel()->rowCount() <= 0) |
| 78 | { |
| 79 | QMessageBox::information(this, tr("Cannot add new rule"), tr("You have no presets saved.\n" |
| 80 | "Please create one first before adding a new rule.")); |
| 81 | return; |
| 82 | } |
| 83 | |
| 84 | presetModel->rescan(); |
| 85 | addRuleFragment->slideIn(); |
| 86 | } |
| 87 | |
| 88 | void PresetRuleDialog::onAddConfirmed() |
| 89 | { |
nothing calls this directly
no test coverage detected