diff --git a/DSView/pv/mainwindow.cpp b/DSView/pv/mainwindow.cpp index f36f868b..f4b013bc 100644 --- a/DSView/pv/mainwindow.cpp +++ b/DSView/pv/mainwindow.cpp @@ -338,7 +338,6 @@ namespace pv _protocol_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_PROTOCOL_DOCK_TITLE), "Decode Protocol")); _measure_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_MEASURE_DOCK_TITLE), "Measurement")); _search_dock->setWindowTitle(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_SEARCH_DOCK_TITLE), "Search...")); - _view->get_time_view()->update_lang(); } void MainWindow::on_load_file(QString file_name) diff --git a/DSView/pv/ui/langresource.cpp b/DSView/pv/ui/langresource.cpp index 957e3ac1..b0ce66a8 100644 --- a/DSView/pv/ui/langresource.cpp +++ b/DSView/pv/ui/langresource.cpp @@ -98,11 +98,9 @@ bool LangResource::Load(int lang) } _cur_lang = lang; - _query_decoders.clear(); - - release_self(); - + release_self(); + num = sizeof(lange_page_keys) / sizeof(lang_page_item); for (int i = 0; i < num; i++) @@ -131,6 +129,7 @@ void LangResource::release_self() delete p; } _pages.clear(); + _current_page = NULL; } void LangResource::load_page(Lang_resource_page &p) @@ -225,8 +224,9 @@ const char* LangResource::get_lang_text(int page_id, const char *str_id, const c return default_str; } - if (_current_page->_loaded == false) + if (_current_page->_loaded == false){ load_page(*_current_page); + } std::string key(str_id); diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp index 7edfc48d..dea3b912 100644 --- a/DSView/pv/view/viewport.cpp +++ b/DSView/pv/view/viewport.cpp @@ -108,7 +108,6 @@ Viewport::Viewport(View &parent, View_type type) : _xAction = xAction; setContextMenuPolicy(Qt::CustomContextMenu); - this->update_font(); connect(&_trigger_timer, SIGNAL(timeout()),this, SLOT(on_trigger_timer())); connect(&_drag_timer, SIGNAL(timeout()),this, SLOT(on_drag_timer())); @@ -2144,31 +2143,22 @@ void Viewport::add_cursor_x() _view.show_xcursors(true); } -void Viewport::update_font() -{ - QFont font = this->font(); - font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); - _yAction->setFont(font); - _xAction->setFont(font); -} - -void Viewport::update_lang() +void Viewport::UpdateLanguage() { _yAction->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD_Y_CURSOR), "Add Y-cursor")); _xAction->setText(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_ADD_X_CURSOR), "Add X-cursor")); } -void Viewport::UpdateLanguage() -{ -} - void Viewport::UpdateTheme() { } void Viewport::UpdateFont() { - update_font(); + QFont font = this->font(); + font.setPointSizeF(AppConfig::Instance().appOptions.fontSize); + _yAction->setFont(font); + _xAction->setFont(font); } } // namespace view diff --git a/DSView/pv/view/viewport.h b/DSView/pv/view/viewport.h index a5da560f..6760c950 100644 --- a/DSView/pv/view/viewport.h +++ b/DSView/pv/view/viewport.h @@ -118,9 +118,7 @@ public: void set_receive_len(quint64 length); void unshow_wait_trigger(); void show_wait_trigger(); - - void update_lang(); - void update_font(); + void measure(); void update(int event);