| 241 | |
| 242 | |
| 243 | bool GUI::process_queue_item(std::wstring url) |
| 244 | { |
| 245 | using widgets::theme; |
| 246 | auto &bottom {bottoms.at(url)}; |
| 247 | auto &tbpipe {outbox}; |
| 248 | auto &tbpipe_overlay {overlay}; |
| 249 | auto &working {bottom.working}; |
| 250 | auto &graceful_exit {bottom.graceful_exit}; |
| 251 | |
| 252 | if(!bottom.started) |
| 253 | { |
| 254 | if(qurl == url) |
| 255 | btndl.caption("Stop download"); |
| 256 | bottom.started = true; |
| 257 | bottom.idx_error = 0; |
| 258 | taskbar_overall_progress(); |
| 259 | auto item {lbq.item_from_value(url)}; |
| 260 | if(item.checked()) |
| 261 | { |
| 262 | item.check(false); |
| 263 | item.fgcolor(lbq.fgcolor()); |
| 264 | } |
| 265 | if(tbpipe.current() == url) |
| 266 | { |
| 267 | tbpipe.clear(); |
| 268 | if(tbpipe_overlay.visible() && btnq.caption().find("queue") != -1) |
| 269 | tbpipe.show(url); |
| 270 | } |
| 271 | else tbpipe.clear(url); |
| 272 | if(bottom.cbargs) |
| 273 | { |
| 274 | bool check {true}; |
| 275 | const auto size {com_args.the_number_of_options()}; |
| 276 | auto caption {com_args.caption()}; |
| 277 | const auto label_from_caption {label_from_argset(caption)}, |
| 278 | argset_from_caption {argset_without_label(caption)}; |
| 279 | auto &conf_argsets {conf.argsets}; |
| 280 | if(!label_from_caption.empty()) |
| 281 | { |
| 282 | for(size_t n {0}; n < size; n++) |
| 283 | { |
| 284 | const auto item_text {com_args.text(n)}, item_label {label_from_argset(item_text)}; |
| 285 | if(argset_without_label(item_text) == argset_from_caption && label_from_caption != item_label) |
| 286 | { |
| 287 | caption = '[' + label_from_caption + "] " + argset_from_caption; |
| 288 | com_args.caption(caption); |
| 289 | com_args[argset_from_caption].text(caption); |
| 290 | auto it {std::find(conf.argsets.begin(), conf.argsets.end(), item_text)}; |
| 291 | if(it != conf.argsets.end()) |
| 292 | *it = caption; |
| 293 | if(conf.common_dl_options) |
| 294 | { |
| 295 | for(auto &pbot : bottoms) |
| 296 | { |
| 297 | auto &bot {*pbot.second}; |
| 298 | bot.argset = caption; |
| 299 | } |
| 300 | } |
nothing calls this directly
no test coverage detected