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

Method reStyle

DSView/pv/toolbars/samplingbar.cpp:213–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211 }
212
213 void SamplingBar::reStyle()
214 {
215 bool bDev = _device_agent->have_instance();
216
217 if (bDev)
218 {
219 if (_device_agent->is_demo())
220 _device_type.setIcon(QIcon(":/icons/demo.svg"));
221 else if (_device_agent->is_file())
222 _device_type.setIcon(QIcon(":/icons/data.svg"));
223 else
224 {
225 int usb_speed = LIBUSB_SPEED_HIGH;
226 _device_agent->get_config_int32(SR_CONF_USB_SPEED, usb_speed);
227
228 if (usb_speed == LIBUSB_SPEED_SUPER)
229 _device_type.setIcon(QIcon(":/icons/usb3.svg"));
230 else
231 _device_type.setIcon(QIcon(":/icons/usb2.svg"));
232 }
233 }
234
235 if (true)
236 {
237 QString iconPath = GetIconPath();
238 _configure_button.setIcon(QIcon(iconPath + "/params.svg"));
239
240 QString icon2 = _session->is_working() ? "stop.svg" : "start.svg";
241 _run_stop_button.setIcon(QIcon(iconPath + "/" + icon2));
242 _instant_button.setIcon(QIcon(iconPath + "/single.svg"));
243
244 _action_single->setIcon(QIcon(iconPath + SINGLE_ACTION_ICON));
245 _action_repeat->setIcon(QIcon(iconPath + REPEAT_ACTION_ICON));
246 _action_loop->setIcon(QIcon(iconPath + LOOP_ACTION_ICON));
247
248 update_mode_icon();
249 }
250 }
251
252 void SamplingBar::on_configure()
253 {

Callers

nothing calls this directly

Calls 6

GetIconPathFunction · 0.85
have_instanceMethod · 0.80
is_demoMethod · 0.80
get_config_int32Method · 0.80
is_workingMethod · 0.80
is_fileMethod · 0.45

Tested by

no test coverage detected