Commit ceda90ae authored by DreamSourceLab's avatar DreamSourceLab

Fix language support issue

parent 6c7101c2
......@@ -72,7 +72,7 @@ DeviceOptions::DeviceOptions(QWidget *parent, boost::shared_ptr<pv::device::DevI
GVariant* gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_OPERATION_MODE);
if (gvar != NULL) {
_mode = g_variant_get_string(gvar, NULL);
_mode = QString::fromUtf8(g_variant_get_string(gvar, NULL));
g_variant_unref(gvar);
}
connect(&_mode_check, SIGNAL(timeout()), this, SLOT(mode_check()));
......@@ -124,7 +124,7 @@ QWidget* DeviceOptions::get_property_form()
{
assert(p);
const QString label = p->labeled_widget() ? QString() : p->name();
if (label == "Operation Mode")
if (label == tr("Operation Mode"))
layout->addRow(label, p->get_widget(form, true));
else
layout->addRow(label, p->get_widget(form));
......@@ -159,7 +159,7 @@ void DeviceOptions::setup_probes()
const char **const options = g_variant_get_strv(gvar_opts, &num_opts);
GVariant* gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_CHANNEL_MODE);
if (gvar != NULL) {
ch_mode = g_variant_get_string(gvar, NULL);
ch_mode = QString::fromUtf8(g_variant_get_string(gvar, NULL));
g_variant_unref(gvar);
for (unsigned int i=0; i<num_opts; i++){
......@@ -167,7 +167,7 @@ void DeviceOptions::setup_probes()
_probes_box_layout.addWidget(ch_opts, row0, col, 1, 8);
connect(ch_opts, SIGNAL(pressed()), this, SLOT(channel_check()));
row0++;
if (QString::fromLocal8Bit(options[i]) == ch_mode)
if (QString::fromUtf8(options[i]) == ch_mode)
ch_opts->setChecked(true);
}
}
......@@ -247,7 +247,7 @@ void DeviceOptions::mode_check()
QString mode;
GVariant* gvar = _dev_inst->get_config(NULL, NULL, SR_CONF_OPERATION_MODE);
if (gvar != NULL) {
mode = g_variant_get_string(gvar, NULL);
mode = QString::fromUtf8(g_variant_get_string(gvar, NULL));
g_variant_unref(gvar);
if (mode != _mode) {
......@@ -276,7 +276,7 @@ void DeviceOptions::channel_check()
{
QRadioButton* sc=dynamic_cast<QRadioButton*>(sender());
if(sc != NULL)
_dev_inst->set_config(NULL, NULL, SR_CONF_CHANNEL_MODE, g_variant_new_string(sc->text().toLocal8Bit()));
_dev_inst->set_config(NULL, NULL, SR_CONF_CHANNEL_MODE, g_variant_new_string(sc->text().toUtf8().data()));
setup_probes();
}
......
......@@ -64,7 +64,7 @@ void String::commit()
if (!_line_edit)
return;
QByteArray ba = _line_edit->text().toLocal8Bit();
QByteArray ba = _line_edit->text().toUtf8();
_setter(g_variant_new_string(ba.data()));
}
......
......@@ -227,10 +227,8 @@ void View::zoom(double steps, int offset)
}
}
if (_session.get_device()->dev_inst()->mode != DSO) {
_offset = cursor_offset - _scale * offset;
_offset = max(min(_offset, get_max_offset()), get_min_offset());
}
if (_scale != _preScale || _offset != _preOffset) {
_header->update();
......
No preview for this file type
......@@ -347,6 +347,12 @@ static int fpga_setting(const struct sr_dev_inst *sdi)
if (channel_en_cnt == 0)
channel_en_cnt = 1;
devc->rle_mode = FALSE;
if (sdi->mode == LOGIC &&
!devc->stream &&
devc->limit_samples > DSLOGIC_MAX_LOGIC_DEPTH*ceil(devc->cur_samplerate * 1.0 / DSLOGIC_MAX_LOGIC_SAMPLERATE))
devc->rle_mode = TRUE;
//setting.mode = (test_mode ? 0x8000 : 0x0000) + trigger->trigger_en + (sdi->mode << 4);
setting.mode = ((devc->op_mode == SR_OP_INTERNAL_TEST) << 15) +
((devc->op_mode == SR_OP_EXTERNAL_TEST) << 14) +
......@@ -1435,12 +1441,6 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
ret = command_dso_ctrl(usb->devhdl, dso_cmd_gen(sdi, 0, SR_CONF_SAMPLERATE));
} else {
devc->sample_wide = (devc->cur_samplerate <= DSLOGIC_MAX_LOGIC_SAMPLERATE);
if (!devc->stream) {
if (devc->limit_samples > DSLOGIC_MAX_LOGIC_DEPTH*ceil(devc->cur_samplerate * 1.0 / DSLOGIC_MAX_LOGIC_SAMPLERATE))
devc->rle_mode = TRUE;
else
devc->rle_mode = FALSE;
}
ret = SR_OK;
}
} else if (id == SR_CONF_CLOCK_TYPE) {
......@@ -1471,14 +1471,6 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
ret = SR_OK;
} else if (id == SR_CONF_LIMIT_SAMPLES) {
devc->limit_samples = g_variant_get_uint64(data);
if(sdi->mode == LOGIC) {
if (!devc->stream) {
if (devc->limit_samples > DSLOGIC_MAX_LOGIC_DEPTH*ceil(devc->cur_samplerate * 1.0 / DSLOGIC_MAX_LOGIC_SAMPLERATE))
devc->rle_mode = TRUE;
else
devc->rle_mode = FALSE;
}
}
ret = SR_OK;
} else if (id == SR_CONF_DEVICE_MODE) {
sdi->mode = g_variant_get_int16(data);
......@@ -1594,7 +1586,6 @@ static int config_set(int id, GVariant *data, struct sr_dev_inst *sdi,
} else if (!strcmp(stropt, opmodes[SR_OP_STREAM]) && (devc->op_mode != SR_OP_STREAM)) {
devc->op_mode = SR_OP_STREAM;
devc->stream = TRUE;
devc->rle_mode = FALSE;
devc->ch_mode = 0;
devc->samplerates_size = 10;
adjust_probes(sdi, stream_ch_num[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment