update languages & icons

This commit is contained in:
DreamSourceLab 2022-06-14 14:00:04 +08:00
parent d12593fe8a
commit 95fa1df6b7
21 changed files with 261 additions and 46 deletions

View File

@ -138,5 +138,7 @@
<file>icons/dsl_logo.svg</file> <file>icons/dsl_logo.svg</file>
<file>icons/dark/minimize.svg</file> <file>icons/dark/minimize.svg</file>
<file>icons/logo.svg</file> <file>icons/logo.svg</file>
<file>icons/light/update.svg</file>
<file>icons/dark/update.svg</file>
</qresource> </qresource>
</RCC> </RCC>

View File

@ -30,6 +30,6 @@
#define DS_VERSION_MAJOR 1 #define DS_VERSION_MAJOR 1
#define DS_VERSION_MINOR 2 #define DS_VERSION_MINOR 2
#define DS_VERSION_MICRO 0 #define DS_VERSION_MICRO 0
#define DS_VERSION_STRING "1.2.0-RC8" #define DS_VERSION_STRING "1.2.0-RC10"
#endif #endif

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 32 32"
style="enable-background:new 0 0 32 32;"
xml:space="preserve"
sodipodi:docname="update.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata46"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs44" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="962"
inkscape:window-height="1379"
id="namedview42"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="16"
inkscape:cy="16"
inkscape:window-x="144"
inkscape:window-y="578"
inkscape:window-maximized="0"
inkscape:current-layer="Capa_1" />
<g
id="g9"
style="fill:#d7d7d7;fill-opacity:1">
<g
id="spin"
style="fill:#d7d7d7;fill-opacity:1">
<g
id="g6"
style="fill:#d7d7d7;fill-opacity:1">
<path
style="fill:#d7d7d7;fill-opacity:1"
d="M25.883,6.086l-2.82,2.832C24.953,10.809,26,13.324,26,16c0,5.516-4.484,10-10,10v-2l-4,4l4,4v-2 c7.719,0,14-6.281,14-14C30,12.254,28.539,8.734,25.883,6.086z"
id="path2" />
<path
style="fill:#d7d7d7;fill-opacity:1"
d="M20,4l-4-4v2C8.281,2,2,8.281,2,16c0,3.746,1.461,7.266,4.117,9.914l2.82-2.832 C7.047,21.191,6,18.676,6,16c0-5.516,4.484-10,10-10v2L20,4z"
id="path4" />
</g>
</g>
</g>
<g
id="g11">
</g>
<g
id="g13">
</g>
<g
id="g15">
</g>
<g
id="g17">
</g>
<g
id="g19">
</g>
<g
id="g21">
</g>
<g
id="g23">
</g>
<g
id="g25">
</g>
<g
id="g27">
</g>
<g
id="g29">
</g>
<g
id="g31">
</g>
<g
id="g33">
</g>
<g
id="g35">
</g>
<g
id="g37">
</g>
<g
id="g39">
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
id="Capa_1"
x="0px"
y="0px"
viewBox="0 0 32 32"
style="enable-background:new 0 0 32 32;"
xml:space="preserve"
sodipodi:docname="update.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"><metadata
id="metadata46"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs44" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="962"
inkscape:window-height="1379"
id="namedview42"
showgrid="false"
inkscape:zoom="7.375"
inkscape:cx="16"
inkscape:cy="16"
inkscape:window-x="144"
inkscape:window-y="578"
inkscape:window-maximized="0"
inkscape:current-layer="Capa_1" />
<g
id="g9"
style="fill:#2a2a2a;fill-opacity:1">
<g
id="spin"
style="fill:#2a2a2a;fill-opacity:1">
<g
id="g6"
style="fill:#2a2a2a;fill-opacity:1">
<path
style="fill:#2a2a2a;fill-opacity:1"
d="M25.883,6.086l-2.82,2.832C24.953,10.809,26,13.324,26,16c0,5.516-4.484,10-10,10v-2l-4,4l4,4v-2 c7.719,0,14-6.281,14-14C30,12.254,28.539,8.734,25.883,6.086z"
id="path2" />
<path
style="fill:#2a2a2a;fill-opacity:1"
d="M20,4l-4-4v2C8.281,2,2,8.281,2,16c0,3.746,1.461,7.266,4.117,9.914l2.82-2.832 C7.047,21.191,6,18.676,6,16c0-5.516,4.484-10,10-10v2L20,4z"
id="path4" />
</g>
</g>
</g>
<g
id="g11">
</g>
<g
id="g13">
</g>
<g
id="g15">
</g>
<g
id="g17">
</g>
<g
id="g19">
</g>
<g
id="g21">
</g>
<g
id="g23">
</g>
<g
id="g25">
</g>
<g
id="g27">
</g>
<g
id="g29">
</g>
<g
id="g31">
</g>
<g
id="g33">
</g>
<g
id="g35">
</g>
<g
id="g37">
</g>
<g
id="g39">
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

View File

@ -142,7 +142,7 @@ void DeviceManager::init_drivers()
for (sr_dev_driver **driver = drivers; *driver; driver++) { for (sr_dev_driver **driver = drivers; *driver; driver++) {
if (sr_driver_init(_sr_ctx, *driver) != SR_OK) { if (sr_driver_init(_sr_ctx, *driver) != SR_OK) {
throw runtime_error( throw runtime_error(
string("Failed to initialize driver ") + string("Failed to initialize driver ") +
string((*driver)->name)); string((*driver)->name));
} }
} }

View File

@ -43,7 +43,7 @@ ApplicationParamDlg::~ApplicationParamDlg()
bool ApplicationParamDlg::ShowDlg(QWidget *parent) bool ApplicationParamDlg::ShowDlg(QWidget *parent)
{ {
DSDialog dlg(parent, true, true); DSDialog dlg(parent, true, true);
dlg.setTitle("Display options"); dlg.setTitle(tr("Display options"));
dlg.setMinimumSize(300, 200); dlg.setMinimumSize(300, 200);
QFormLayout &lay = *(new QFormLayout()); QFormLayout &lay = *(new QFormLayout());
lay.setContentsMargins(0,20,0,30); lay.setContentsMargins(0,20,0,30);
@ -53,7 +53,7 @@ bool ApplicationParamDlg::ShowDlg(QWidget *parent)
QCheckBox *ck_quickScroll = new QCheckBox(); QCheckBox *ck_quickScroll = new QCheckBox();
ck_quickScroll->setChecked(app._appOptions.quickScroll); ck_quickScroll->setChecked(app._appOptions.quickScroll);
lay.addRow("Quick scroll", ck_quickScroll); lay.addRow(tr("Quick scroll"), ck_quickScroll);
dlg.layout()->addLayout(&lay); dlg.layout()->addLayout(&lay);
dlg.exec(); dlg.exec();

View File

@ -29,9 +29,9 @@ namespace pv
namespace dialogs namespace dialogs
{ {
class ApplicationParamDlg class ApplicationParamDlg : public QObject
{ {
// Q_OBJECT Q_OBJECT
public: public:
ApplicationParamDlg(); ApplicationParamDlg();

View File

@ -433,7 +433,7 @@ void DecoderOptionsDlg::commit_decoder_probes(data::decode::Decoder *dec)
void DecoderOptionsDlg::on_accept() void DecoderOptionsDlg::on_accept()
{ {
if (_cursor1 > 0 && _cursor1 == _cursor2){ if (_cursor1 > 0 && _cursor1 == _cursor2){
MsgBox::Show("error", "Invalid cursor index for sample range!"); MsgBox::Show(tr("error"), tr("Invalid cursor index for sample range!"));
return; return;
} }

View File

@ -33,7 +33,7 @@
namespace pv { namespace pv {
namespace dialogs { namespace dialogs {
DSMessageBox::DSMessageBox(QWidget *parent,const char *title) : DSMessageBox::DSMessageBox(QWidget *parent,const QString title) :
QDialog(parent) QDialog(parent)
{ {
(void)parent; (void)parent;
@ -67,8 +67,8 @@ DSMessageBox::DSMessageBox(QWidget *parent,const char *title) :
_msg->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint); _msg->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint);
if (title){ if (!title.isEmpty()){
_titlebar->setTitle(QString(title)); _titlebar->setTitle(title);
} }
else{ else{
_titlebar->setTitle(tr("Message")); _titlebar->setTitle(tr("Message"));

View File

@ -40,7 +40,7 @@ class DSMessageBox : public QDialog
Q_OBJECT Q_OBJECT
public: public:
DSMessageBox(QWidget *parent, const char *title=0); DSMessageBox(QWidget *parent, const QString title=0);
~DSMessageBox(); ~DSMessageBox();

View File

@ -125,7 +125,7 @@ void StoreProgress::reject()
void StoreProgress::accept() void StoreProgress::accept()
{ {
if (_store_session.GetFileName() == ""){ if (_store_session.GetFileName() == ""){
MsgBox::Show(NULL, "you need to select a file name."); MsgBox::Show(NULL, tr("You need to select a file name."));
return; return;
} }

View File

@ -22,9 +22,6 @@
#include "keywordlineedit.h" #include "keywordlineedit.h"
#include "../config/appconfig.h" #include "../config/appconfig.h"
#define PROTOCOL_FIND_TITLE "Protocol search..."
#define PROTOCOL_FIND_TITLE_cn "协议查找..."
KeywordLineEdit::KeywordLineEdit(QWidget *parent, IKeywordActive *active) KeywordLineEdit::KeywordLineEdit(QWidget *parent, IKeywordActive *active)
:QLineEdit(parent) :QLineEdit(parent)
{ {
@ -47,10 +44,7 @@ KeywordLineEdit::KeywordLineEdit(QWidget *parent, IKeywordActive *active)
return; return;
} }
if (AppConfig::Instance().IsLangCn()) this->setText(tr("Protocol search..."));
this->setText(PROTOCOL_FIND_TITLE_cn);
else
this->setText(PROTOCOL_FIND_TITLE);
} }
void KeywordLineEdit::SetInputText(QString text) void KeywordLineEdit::SetInputText(QString text)

View File

@ -113,9 +113,9 @@ ProtocolDock::ProtocolDock(QWidget *parent, view::View &view, SigSession *sessio
sort(_decoderInfoList.begin(), _decoderInfoList.end(), ProtocolDock::protocol_sort_callback); sort(_decoderInfoList.begin(), _decoderInfoList.end(), ProtocolDock::protocol_sort_callback);
if (repeatNammes != ""){ if (repeatNammes != ""){
QString err = "Any protocol have repeated id or name: "; QString err = tr("Any protocol have repeated id or name: ");
err += repeatNammes; err += repeatNammes;
MsgBox::Show("error", err.toUtf8().data()); MsgBox::Show(tr("error"), err.toUtf8().data());
} }
_arrow = new QToolButton(_up_widget); _arrow = new QToolButton(_up_widget);
@ -324,11 +324,11 @@ int ProtocolDock::get_protocol_index_by_id(QString id)
void ProtocolDock::on_add_protocol() void ProtocolDock::on_add_protocol()
{ {
if (_decoderInfoList.size() == 0){ if (_decoderInfoList.size() == 0){
MsgBox::Show(NULL, "Protocol list is empty!"); MsgBox::Show(NULL, tr("Protocol list is empty!"));
return; return;
} }
if (_selected_protocol_id == ""){ if (_selected_protocol_id == ""){
MsgBox::Show(NULL, "Please select a protocol!"); MsgBox::Show(NULL, tr("Please select a protocol!"));
return; return;
} }
@ -372,7 +372,7 @@ void ProtocolDock::on_add_protocol()
} }
if (pro_id == ""){ if (pro_id == ""){
MsgBox::Show("error", "find the base protocol error!"); MsgBox::Show(tr("error"), tr("find the base protocol error!"));
for(auto sub: sub_decoders){ for(auto sub: sub_decoders){
delete sub; delete sub;
@ -446,11 +446,11 @@ bool ProtocolDock::add_protocol_by_id(QString id, bool silent, std::list<pv::dat
void ProtocolDock::on_del_all_protocol(){ void ProtocolDock::on_del_all_protocol(){
if (_protocol_lay_items.size() == 0){ if (_protocol_lay_items.size() == 0){
MsgBox::Show(NULL, "No Protocol Analyzer to delete!", this); MsgBox::Show(NULL, tr("No Protocol Analyzer to delete!"), this);
return; return;
} }
if (MsgBox::Confirm("Are you sure to remove all protocol analyzer?", this)){ if (MsgBox::Confirm(tr("Are you sure to remove all protocol analyzer?"), this)){
del_all_protocol(); del_all_protocol();
} }
} }
@ -877,7 +877,7 @@ void ProtocolDock::OnProtocolSetting(void *handle){
} }
void ProtocolDock::OnProtocolDelete(void *handle){ void ProtocolDock::OnProtocolDelete(void *handle){
if (!MsgBox::Confirm("Are you sure to remove this protocol analyzer?", this)){ if (!MsgBox::Confirm(tr("Are you sure to remove this protocol analyzer?"), this)){
return; return;
} }

View File

@ -428,8 +428,8 @@ void MainWindow::update_device_list()
g_variant_unref(gvar); g_variant_unref(gvar);
if (usb30_support && usb_speed == LIBUSB_SPEED_HIGH) if (usb30_support && usb_speed == LIBUSB_SPEED_HIGH)
show_error("Plug it into a USB 2.0 port will seriously affect its performance." show_error(tr("Plug it into a USB 2.0 port will seriously affect its performance."
"Please replug it into a USB 3.0 port."); "Please replug it into a USB 3.0 port."));
} }
} }
@ -449,7 +449,7 @@ void MainWindow::update_device_list()
} }
else{ else{
qDebug()<<"file is not exists:"<<opf; qDebug()<<"file is not exists:"<<opf;
MsgBox::Show("Open file error!", opf.toStdString().c_str()); MsgBox::Show(tr("Open file error!"), opf.toStdString().c_str());
} }
} }
} }
@ -990,7 +990,7 @@ bool MainWindow::load_session_json(QJsonDocument json, bool file_dev, bool bDeco
const sr_dev_inst *const sdi = _session->get_device()->dev_inst(); const sr_dev_inst *const sdi = _session->get_device()->dev_inst();
if ((!file_dev && strcmp(sdi->driver->name, sessionObj["Device"].toString().toUtf8()) != 0) || if ((!file_dev && strcmp(sdi->driver->name, sessionObj["Device"].toString().toUtf8()) != 0) ||
sdi->mode != sessionObj["DeviceMode"].toDouble()) { sdi->mode != sessionObj["DeviceMode"].toDouble()) {
MsgBox::Show(NULL, "Session File is not compatible with current device or mode!", this); MsgBox::Show(NULL, tr("Session File is not compatible with current device or mode!"), this);
return false; return false;
} }
@ -1295,7 +1295,7 @@ void MainWindow::restore_dock()
} }
catch(...) catch(...)
{ {
MsgBox::Show(NULL, "restore window status error!"); MsgBox::Show(NULL, tr("restore window status error!"));
} }
} }

View File

@ -121,8 +121,8 @@ void FileBar::reStyle()
_action_load->setIcon(QIcon(iconPath+"/open.svg")); _action_load->setIcon(QIcon(iconPath+"/open.svg"));
_action_store->setIcon(QIcon(iconPath+"/save.svg")); _action_store->setIcon(QIcon(iconPath+"/save.svg"));
_action_default->setIcon(QIcon(iconPath+"/settings.svg")); _action_default->setIcon(QIcon(iconPath+"/gear.svg"));
_menu_session->setIcon(QIcon(iconPath+"/settings.svg")); _menu_session->setIcon(QIcon(iconPath+"/gear.svg"));
_action_open->setIcon(QIcon(iconPath+"/open.svg")); _action_open->setIcon(QIcon(iconPath+"/open.svg"));
_action_save->setIcon(QIcon(iconPath+"/save.svg")); _action_save->setIcon(QIcon(iconPath+"/save.svg"));
_action_export->setIcon(QIcon(iconPath+"/export.svg")); _action_export->setIcon(QIcon(iconPath+"/export.svg"));
@ -194,7 +194,7 @@ void FileBar::on_actionDefault_triggered()
{ {
QDir dir(GetResourceDir()); QDir dir(GetResourceDir());
if (!dir.exists()) { if (!dir.exists()) {
MsgBox::Show(NULL, "Cannot find default session file for this device!", this); MsgBox::Show(NULL, tr("Cannot find default session file for this device!"), this);
return; return;
} }

View File

@ -72,7 +72,7 @@ LogoBar::LogoBar(SigSession *session, QWidget *parent) :
_logo_button.addAction(_manual); _logo_button.addAction(_manual);
_issue = new QAction(this); _issue = new QAction(this);
_issue->setObjectName(QString::fromUtf8("actionManual")); _issue->setObjectName(QString::fromUtf8("actionIssue"));
_logo_button.addAction(_issue); _logo_button.addAction(_issue);
_update = new QAction(this); _update = new QAction(this);
@ -140,7 +140,7 @@ void LogoBar::reStyle()
_about->setIcon(QIcon(iconPath+"/about.svg")); _about->setIcon(QIcon(iconPath+"/about.svg"));
_manual->setIcon(QIcon(iconPath+"/manual.svg")); _manual->setIcon(QIcon(iconPath+"/manual.svg"));
_issue->setIcon(QIcon(iconPath+"/bug.svg")); _issue->setIcon(QIcon(iconPath+"/bug.svg"));
_update->setIcon(QIcon(iconPath+"/bug.svg")); _update->setIcon(QIcon(iconPath+"/update.svg"));
if (_connected) if (_connected)
_logo_button.setIcon(QIcon(iconPath+"/logo_color.svg")); _logo_button.setIcon(QIcon(iconPath+"/logo_color.svg"));

View File

@ -177,7 +177,7 @@ void TrigBar::reStyle()
_dark_style->setIcon(QIcon(iconPath+"/dark.svg")); _dark_style->setIcon(QIcon(iconPath+"/dark.svg"));
_light_style->setIcon(QIcon(iconPath+"/light.svg")); _light_style->setIcon(QIcon(iconPath+"/light.svg"));
_action_dispalyOptions->setIcon(QIcon(iconPath+"/params.svg")); _action_dispalyOptions->setIcon(QIcon(iconPath+"/gear.svg"));
AppConfig &app = AppConfig::Instance(); AppConfig &app = AppConfig::Instance();

View File

@ -23,7 +23,6 @@
#include "../dialogs/dsmessagebox.h" #include "../dialogs/dsmessagebox.h"
#include <assert.h> #include <assert.h>
#include <QMessageBox> #include <QMessageBox>
#include <QString>
#include "../dsvdef.h" #include "../dsvdef.h"
#include "../appcontrol.h" #include "../appcontrol.h"
@ -32,9 +31,9 @@
//QMessageBox::information(NULL, "Title", "Content"); //QMessageBox::information(NULL, "Title", "Content");
//QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes|QMessageBox::No|QMessageBox::Abort); //QMessageBox::information(NULL, "Title", "Content",QMessageBox::Yes|QMessageBox::No|QMessageBox::Abort);
void MsgBox::Show(const char *title, const char *text, QWidget *parent) void MsgBox::Show(const QString title, const QString text, QWidget *parent)
{ {
assert(text); assert(!text.isEmpty());
QString str; QString str;
str.append("\n"); str.append("\n");
@ -52,9 +51,9 @@ void MsgBox::Show(const char *title, const char *text, QWidget *parent)
msg.exec(); msg.exec();
} }
bool MsgBox::Confirm(const char *text, QWidget *parent) bool MsgBox::Confirm(const QString text, QWidget *parent)
{ {
assert(text); assert(!text.isEmpty());
QString str; QString str;
str.append("\n"); str.append("\n");

View File

@ -21,12 +21,14 @@
#pragma once #pragma once
#include <QString>
class QWidget; class QWidget;
class MsgBox class MsgBox
{ {
public: public:
static void Show(const char *title, const char *text, QWidget *parent=0); static void Show(const QString title, const QString text, QWidget *parent=0);
static bool Confirm(const char *text, QWidget *parent=0); static bool Confirm(const QString text, QWidget *parent=0);
}; };

View File

@ -208,7 +208,7 @@ void DevMode::on_close()
DevInst *dev_inst = _session->get_device(); DevInst *dev_inst = _session->get_device();
assert(dev_inst); assert(dev_inst);
if (_bFile && MsgBox::Confirm("are you sure to close the device?")){ if (_bFile && MsgBox::Confirm(tr("are you sure to close the device?"))){
_session->close_file(dev_inst); _session->close_file(dev_inst);
dev_changed(true); dev_changed(true);
} }