| 37 | const QString RegionOptions::RegionEnd = QT_TR_NOOP("End"); |
| 38 | |
| 39 | RegionOptions::RegionOptions(view::View *view, SigSession *session, QWidget *parent) : |
| 40 | DSDialog(parent), |
| 41 | _session(session), |
| 42 | _view(view), |
| 43 | _button_box(QDialogButtonBox::Ok, |
| 44 | Qt::Horizontal, this) |
| 45 | { |
| 46 | QHBoxLayout *hlayout = new QHBoxLayout(); |
| 47 | hlayout->setContentsMargins(0,0,0,0); |
| 48 | hlayout->setSpacing(0); |
| 49 | _start_comboBox = new DsComboBox(this); |
| 50 | _end_comboBox = new DsComboBox(this); |
| 51 | _start_comboBox->addItem(RegionStart); |
| 52 | _end_comboBox->addItem(RegionEnd); |
| 53 | |
| 54 | if (_view) { |
| 55 | int index = 1; |
| 56 | auto &cursor_list = _view->get_cursorList(); |
| 57 | |
| 58 | for(auto i = cursor_list.begin(); i != cursor_list.end(); i++) { |
| 59 | QString curCursor = L_S(STR_PAGE_DLG, S_ID(IDS_DLG_CURSOR), "Cursor")+QString::number(index); |
| 60 | _start_comboBox->addItem(curCursor); |
| 61 | _end_comboBox->addItem(curCursor); |
| 62 | index++; |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | hlayout->addWidget(new QLabel("Start: ", this)); |
| 67 | hlayout->addWidget(_start_comboBox); |
| 68 | hlayout->addWidget(new QLabel(" ", this)); |
| 69 | hlayout->addWidget(new QLabel("End: ", this)); |
| 70 | hlayout->addWidget(_end_comboBox); |
| 71 | |
| 72 | QVBoxLayout *vlayout = new QVBoxLayout(); |
| 73 | vlayout->addLayout(hlayout); |
| 74 | vlayout->addWidget(&_button_box); |
| 75 | |
| 76 | layout()->addLayout(vlayout); |
| 77 | setTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_REGION), "Region")); |
| 78 | |
| 79 | connect(&_button_box, SIGNAL(accepted()), this, SLOT(set_region())); |
| 80 | connect(_session->device_event_object(), SIGNAL(device_updated()), this, SLOT(reject())); |
| 81 | |
| 82 | } |
| 83 | |
| 84 | void RegionOptions::set_region() |
| 85 | { |
nothing calls this directly
no test coverage detected