Skip to content

Commit

Permalink
Merge branch 'linuxdeepin:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
N0rthHXD authored Nov 15, 2023
2 parents 54ca4ca + 37b4171 commit ff02e8e
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 91 deletions.
45 changes: 22 additions & 23 deletions assets/translations/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,12 @@
<context>
<name>CodeEditComponent</name>
<message>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="143"/>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="150"/>
<source>Copy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="147"/>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="154"/>
<source>Insert</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -591,35 +591,40 @@
<context>
<name>CodeGeeXWidget</name>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="64"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="70"/>
<source>Login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="97"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="100"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="100"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="103"/>
<source>History</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="103"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="106"/>
<source>New</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="117"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="120"/>
<source>Ask CodeGeeX</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="118"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="121"/>
<source>Translation</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="144"/>
<source>Creating a new session...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CodeLens</name>
Expand Down Expand Up @@ -936,12 +941,6 @@ The dap port is not ready, please retry.
<source>Choose path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/option/detailwidget.cpp" line="93"/>
<location filename="../../src/plugins/codegeex/option/detailwidget.cpp" line="100"/>
<source>Detail</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>DetailsButton</name>
Expand Down Expand Up @@ -1376,38 +1375,38 @@ repos path: %0</source>
<context>
<name>MainDialog</name>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="59"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="58"/>
<source>New File or Project</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="61"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="60"/>
<source>Choose a template:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="73"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="72"/>
<source>Templates</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="157"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="156"/>
<source>Create</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="158"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="157"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="194"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="207"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="193"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="206"/>
<source>Tip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="207"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="206"/>
<source>Can not find kit.</source>
<translation type="unfinished"></translation>
</message>
Expand Down Expand Up @@ -3593,7 +3592,7 @@ Delete anyway?</source>
<context>
<name>WindowKeeper</name>
<message>
<location filename="../../src/plugins/core/mainframe/windowkeeper.cpp" line="242"/>
<location filename="../../src/plugins/core/mainframe/windowkeeper.cpp" line="243"/>
<source>Deepin Union Code</source>
<translation type="unfinished"></translation>
</message>
Expand Down
45 changes: 22 additions & 23 deletions assets/translations/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,12 @@
<context>
<name>CodeEditComponent</name>
<message>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="143"/>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="150"/>
<source>Copy</source>
<translation>复制</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="147"/>
<location filename="../../src/plugins/codegeex/widgets/codeeditcomponent.cpp" line="154"/>
<source>Insert</source>
<translation>插入</translation>
</message>
Expand Down Expand Up @@ -603,35 +603,40 @@
<context>
<name>CodeGeeXWidget</name>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="64"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="70"/>
<source>Login</source>
<translation>登录</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="97"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="100"/>
<source>Delete</source>
<translation>删除</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="100"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="103"/>
<source>History</source>
<translation>历史记录</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="103"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="106"/>
<source>New</source>
<translation>新对话</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="117"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="120"/>
<source>Ask CodeGeeX</source>
<translation>询问 CodeGeeX</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="118"/>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="121"/>
<source>Translation</source>
<translation>翻译代码</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/widgets/codegeexwidget.cpp" line="144"/>
<source>Creating a new session...</source>
<translation>创建新的会话中...</translation>
</message>
</context>
<context>
<name>CodeLens</name>
Expand Down Expand Up @@ -960,12 +965,6 @@ dap端口未就绪,请重试。
<source>Choose path</source>
<translation>选择路径</translation>
</message>
<message>
<location filename="../../src/plugins/codegeex/option/detailwidget.cpp" line="93"/>
<location filename="../../src/plugins/codegeex/option/detailwidget.cpp" line="100"/>
<source>Detail</source>
<translation>细节</translation>
</message>
</context>
<context>
<name>DetailsButton</name>
Expand Down Expand Up @@ -1401,38 +1400,38 @@ repos path: %0</source>
<context>
<name>MainDialog</name>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="59"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="58"/>
<source>New File or Project</source>
<translation>新建文件或工程</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="61"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="60"/>
<source>Choose a template:</source>
<translation>选择一个模板:</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="73"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="72"/>
<source>Templates</source>
<translation>模板</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="157"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="156"/>
<source>Create</source>
<translation>创建</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="158"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="157"/>
<source>Cancel</source>
<translation>取消</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="194"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="207"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="193"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="206"/>
<source>Tip</source>
<translation>提示</translation>
</message>
<message>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="207"/>
<location filename="../../src/plugins/template/wizard/maindialog.cpp" line="206"/>
<source>Can not find kit.</source>
<translation>找不到配套工具。</translation>
</message>
Expand Down Expand Up @@ -3635,7 +3634,7 @@ Delete anyway?</source>
<context>
<name>WindowKeeper</name>
<message>
<location filename="../../src/plugins/core/mainframe/windowkeeper.cpp" line="242"/>
<location filename="../../src/plugins/core/mainframe/windowkeeper.cpp" line="243"/>
<source>Deepin Union Code</source>
<translation></translation>
</message>
Expand Down
1 change: 1 addition & 0 deletions src/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ set(CXX_H
toolchain/toolchain.h
actionmanager/actionmanager.h
actionmanager/command.h
unilog.h
)

set(CXX_CPP
Expand Down
13 changes: 7 additions & 6 deletions src/common/lsp/client/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "private/client_p.h"
#include "common/util/custompaths.h"
#include "common/util/processutil.h"
#include "common/unilog.h"

#include <QMetaType>
#include <QDebug>
Expand Down Expand Up @@ -291,7 +292,7 @@ void ClientPrivate::callNotification(const QString &method, const QJsonObject &p

void ClientPrivate::writeLspData(const QByteArray &jsonObj)
{
qInfo() << "\nclient->server:\n{\n" << jsonObj << "\n}";
uniDebug() << "\nclient->server:\n{\n" << jsonObj << "\n}";
q->write(jsonObj);
q->waitForBytesWritten();
}
Expand Down Expand Up @@ -1058,18 +1059,18 @@ void ClientPrivate::doReadStdoutLine()
void ClientPrivate::identifyJsonObject(const QJsonObject &jsonObj)
{
if (calledError(jsonObj)) {
qWarning() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
uniCritical() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
return;
}


if (calledResult(jsonObj)) {
qInfo() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
uniWarning() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
return;
}

if (serverCalled(jsonObj)) {
qInfo() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
uniWarning() << "\nclient <- server:\n{\n" << jsonObj << "\n}";
return;
}
}
Expand All @@ -1096,13 +1097,13 @@ ClientPrivate::ClientPrivate(Client * const q)
QObject::connect(q, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
this, [&](int exitCode, QProcess::ExitStatus status)
{
qCritical() << "\nclient <- server\n{\n" << "lspServerProc finished:\n" << exitCode << status << "\n}";
uniInfo() << "\nclient <- server\n{\n" << "lspServerProc finished:\n" << exitCode << status << "\n}";
});

QObject::connect(q, &QProcess::readyReadStandardError,
this, [=]()
{
qCritical() << "\nclient <- server\n{\n" <<q->readAllStandardError() << "\n}";
uniCritical() << "\nclient <- server\n{\n" <<q->readAllStandardError() << "\n}";
});

QObject::connect(q, &QProcess::readyReadStandardOutput,
Expand Down
25 changes: 25 additions & 0 deletions src/common/unilog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2022 - 2023 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
#ifndef UNILOG_H
#define UNILOG_H

#include <QDebug>

#ifdef QT_DEBUG
#define UNI_DEBUG
#endif
#ifdef UNI_DEBUG
#define uniDebug(...) qDebug(__VA_ARGS__)
#define uniInfo(...) qInfo(__VA_ARGS__)
#define uniWarning(...) qWarning(__VA_ARGS__)
#define uniCritical(...) qCritical(__VA_ARGS__)
#else
#define NO_DEBUG(LOG) QMessageLogger().noDebug(LOG)
#define uniDebug(...) NO_DEBUG(__VA_ARGS__)
#define uniInfo(...) NO_DEBUG(__VA_ARGS__)
#define uniWarning(...) NO_DEBUG(__VA_ARGS__)
#define uniCritical(...) NO_DEBUG(__VA_ARGS__)
#endif

#endif // UNILOG_H
2 changes: 1 addition & 1 deletion src/plugins/codegeex/codegeex.qrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<RCC>
<qresource prefix="/demo">
<qresource prefix="/resoures">
<file>images/navigation.png</file>
<file>images/logo-codegeex.png</file>
<file>images/photo.svg</file>
Expand Down
Loading

0 comments on commit ff02e8e

Please sign in to comment.