| 216 | } |
| 217 | |
| 218 | void SearchDock::on_set() |
| 219 | { |
| 220 | dialogs::Search dlg(this, _session, _pattern); |
| 221 | connect(_session->device_event_object(), SIGNAL(device_updated()), &dlg, SLOT(reject())); |
| 222 | |
| 223 | if (dlg.exec()) { |
| 224 | std::map<uint16_t, QString> new_pattern = dlg.get_pattern(); |
| 225 | |
| 226 | QString search_label; |
| 227 | for (auto& iter:new_pattern) { |
| 228 | iter.second.remove(QChar(' '), Qt::CaseInsensitive); |
| 229 | iter.second = iter.second.toUpper(); |
| 230 | search_label.push_back(iter.second); |
| 231 | } |
| 232 | |
| 233 | _search_value->setText(search_label); |
| 234 | QFontMetrics fm = this->fontMetrics(); |
| 235 | //fm.width(search_label) |
| 236 | int tw = fm.boundingRect(search_label).width(); |
| 237 | _search_value->setFixedWidth(tw + _search_button->width()+20); |
| 238 | |
| 239 | if (new_pattern != _pattern) { |
| 240 | _view.set_search_pos(_view.get_search_pos(), false); |
| 241 | _pattern = new_pattern; |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | void SearchDock::UpdateLanguage() |
| 247 | { |
nothing calls this directly
no test coverage detected