MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / accept

Method accept

DSView/pv/dialogs/storeprogress.cpp:154–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void StoreProgress::accept()
155{
156 if (_store_session->GetFileName() == ""){
157 MsgBox::Show(NULL, L_S(STR_PAGE_MSG, S_ID(IDS_MSG_SEL_FILENAME), "You need to select a file name."));
158 return;
159 }
160
161 if (_is_done){
162 return;
163 }
164
165 if (_isExport && _store_session->IsLogicDataType()){
166 bool ck = _ckOrigin->isChecked();
167 AppConfig &app = AppConfig::Instance();
168 if (app.appOptions.originalData != ck){
169 app.appOptions.originalData = ck;
170 app.SaveApp();
171 }
172 }
173
174 // Get data range
175 if (_store_session->IsLogicDataType() && _view != NULL)
176 {
177 uint64_t start_index = 0;
178 uint64_t end_index = 0;
179
180 auto &cursor_list = _view->get_cursorList();
181
182 int dex1 = _start_cursor->currentIndex();
183 int dex2 = _end_cursor->currentIndex();
184
185 if (dex1 > 0)
186 {
187 auto c = _view->get_cursor_by_index(dex1-1);
188 assert(c);
189 start_index = c->get_index();
190 }
191
192 if (dex2 > 0){
193 auto c = _view->get_cursor_by_index(dex2-1);
194 assert(c);
195 end_index = c->get_index();
196 }
197
198 if (dex1 > 0 && dex2 > 0)
199 {
200 if (dex1 == dex2){
201 QString mStr = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_RANGE_ERROR), "Data range error");
202 MsgBox::Show(mStr);
203 return;
204 }
205
206 int total_count = _view->session().get_ring_sample_count();
207
208 if (start_index > total_count && end_index > total_count)
209 {
210 QString mStr = L_S(STR_PAGE_MSG, S_ID(IDS_MSG_DATA_RANGE_HAVE_NO_DATA), "No data in the data range");
211 MsgBox::Show(mStr);

Callers

nothing calls this directly

Calls 13

ShowFunction · 0.85
GetFileNameMethod · 0.80
IsLogicDataTypeMethod · 0.80
SaveAppMethod · 0.80
get_cursor_by_indexMethod · 0.80
sessionMethod · 0.80
SetDataRangeMethod · 0.80
export_startMethod · 0.80
set_savingMethod · 0.80
save_startMethod · 0.80
get_indexMethod · 0.45
get_ring_sample_countMethod · 0.45

Tested by

no test coverage detected