update
This commit is contained in:
parent
77d16bea39
commit
86e9b9b6ec
|
@ -39,8 +39,6 @@ SOURCES += \
|
|||
findbar.cpp \
|
||||
linebar.cpp \
|
||||
replacebar.cpp \
|
||||
aboutsoftwaredialog.cpp \
|
||||
sponsordialog.cpp \
|
||||
scriptmanager.cpp \
|
||||
scriptcenterwindow.cpp
|
||||
|
||||
|
@ -89,8 +87,6 @@ HEADERS += \
|
|||
findbar.h \
|
||||
linebar.h \
|
||||
replacebar.h \
|
||||
aboutsoftwaredialog.h \
|
||||
sponsordialog.h \
|
||||
scriptmanager.h \
|
||||
scriptcenterwindow.h \
|
||||
PythonQt/PythonQt_QtAll.h \
|
||||
|
|
BIN
WingHexPy.qm
BIN
WingHexPy.qm
Binary file not shown.
100
WingHexPy.ts
100
WingHexPy.ts
|
@ -116,7 +116,7 @@
|
|||
<context>
|
||||
<name>ScriptManager</name>
|
||||
<message>
|
||||
<location filename="scriptmanager.cpp" line="75"/>
|
||||
<location filename="scriptmanager.cpp" line="50"/>
|
||||
<source>NoScript</source>
|
||||
<translation>暂无脚本</translation>
|
||||
</message>
|
||||
|
@ -124,133 +124,133 @@
|
|||
<context>
|
||||
<name>ScriptWindow</name>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="37"/>
|
||||
<location filename="scriptwindow.cpp" line="36"/>
|
||||
<source>WingHexPyScriptWindow</source>
|
||||
<translation>羽云 Python 脚本编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="73"/>
|
||||
<location filename="scriptwindow.cpp" line="72"/>
|
||||
<source>File</source>
|
||||
<translation>文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="75"/>
|
||||
<location filename="scriptwindow.cpp" line="74"/>
|
||||
<location filename="scriptwindow.cpp" line="177"/>
|
||||
<source>New</source>
|
||||
<translation>新建</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="79"/>
|
||||
<location filename="scriptwindow.cpp" line="78"/>
|
||||
<location filename="scriptwindow.cpp" line="179"/>
|
||||
<source>Open</source>
|
||||
<translation>打开</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="83"/>
|
||||
<location filename="scriptwindow.cpp" line="82"/>
|
||||
<location filename="scriptwindow.cpp" line="181"/>
|
||||
<source>Save</source>
|
||||
<translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="87"/>
|
||||
<location filename="scriptwindow.cpp" line="86"/>
|
||||
<location filename="scriptwindow.cpp" line="183"/>
|
||||
<source>SaveAs</source>
|
||||
<translation>另存为</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="92"/>
|
||||
<location filename="scriptwindow.cpp" line="91"/>
|
||||
<source>RecentFile</source>
|
||||
<translation>最近文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="96"/>
|
||||
<location filename="scriptwindow.cpp" line="95"/>
|
||||
<source>Close</source>
|
||||
<translation>关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="102"/>
|
||||
<location filename="scriptwindow.cpp" line="101"/>
|
||||
<source>Edit</source>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="104"/>
|
||||
<location filename="scriptwindow.cpp" line="103"/>
|
||||
<location filename="scriptwindow.cpp" line="186"/>
|
||||
<source>Undo</source>
|
||||
<translation>撤销</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="110"/>
|
||||
<location filename="scriptwindow.cpp" line="109"/>
|
||||
<location filename="scriptwindow.cpp" line="190"/>
|
||||
<source>Redo</source>
|
||||
<translation>恢复</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="117"/>
|
||||
<location filename="scriptwindow.cpp" line="116"/>
|
||||
<location filename="scriptwindow.cpp" line="194"/>
|
||||
<source>Cut</source>
|
||||
<translation>剪切</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="121"/>
|
||||
<location filename="scriptwindow.cpp" line="120"/>
|
||||
<location filename="scriptwindow.cpp" line="196"/>
|
||||
<source>Copy</source>
|
||||
<translation>复制</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="125"/>
|
||||
<location filename="scriptwindow.cpp" line="124"/>
|
||||
<location filename="scriptwindow.cpp" line="198"/>
|
||||
<source>Paste</source>
|
||||
<translation>粘贴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="130"/>
|
||||
<location filename="scriptwindow.cpp" line="129"/>
|
||||
<location filename="scriptwindow.cpp" line="201"/>
|
||||
<source>Find</source>
|
||||
<translation>查找</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="134"/>
|
||||
<location filename="scriptwindow.cpp" line="133"/>
|
||||
<location filename="scriptwindow.cpp" line="203"/>
|
||||
<source>Replace</source>
|
||||
<translation>替换</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="138"/>
|
||||
<location filename="scriptwindow.cpp" line="137"/>
|
||||
<location filename="scriptwindow.cpp" line="205"/>
|
||||
<location filename="scriptwindow.cpp" line="558"/>
|
||||
<source>Goto</source>
|
||||
<translation>跳转</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="145"/>
|
||||
<location filename="scriptwindow.cpp" line="144"/>
|
||||
<source>Script</source>
|
||||
<translation>脚本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="147"/>
|
||||
<location filename="scriptwindow.cpp" line="146"/>
|
||||
<location filename="scriptwindow.cpp" line="208"/>
|
||||
<source>Run</source>
|
||||
<translation>执行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="151"/>
|
||||
<location filename="scriptwindow.cpp" line="150"/>
|
||||
<location filename="scriptwindow.cpp" line="210"/>
|
||||
<source>RunFile</source>
|
||||
<translation>从文件执行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="158"/>
|
||||
<location filename="scriptwindow.cpp" line="157"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="160"/>
|
||||
<location filename="scriptwindow.cpp" line="159"/>
|
||||
<location filename="scriptwindow.cpp" line="213"/>
|
||||
<source>AboutPlugin</source>
|
||||
<translation>关于插件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="scriptwindow.cpp" line="162"/>
|
||||
<location filename="scriptwindow.cpp" line="161"/>
|
||||
<location filename="scriptwindow.cpp" line="215"/>
|
||||
<source>Sponsor</source>
|
||||
<translation>赞助</translation>
|
||||
|
@ -350,102 +350,100 @@
|
|||
<context>
|
||||
<name>SponsorDialog</name>
|
||||
<message>
|
||||
<location filename="sponsordialog.cpp" line="6"/>
|
||||
<source>Sponsor</source>
|
||||
<translation>赞助</translation>
|
||||
<translation type="vanished">赞助</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="sponsordialog.cpp" line="9"/>
|
||||
<source>ThanksForSponsor</source>
|
||||
<translation>感谢大家的赞助支持!</translation>
|
||||
<translation type="vanished">感谢大家的赞助支持!</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>WingHexPy</name>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="45"/>
|
||||
<location filename="winghexpy.cpp" line="183"/>
|
||||
<location filename="winghexpy.cpp" line="50"/>
|
||||
<location filename="winghexpy.cpp" line="182"/>
|
||||
<source>WingHexPy</source>
|
||||
<translation>WingHexPy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="47"/>
|
||||
<location filename="winghexpy.cpp" line="52"/>
|
||||
<source>ScriptEditor</source>
|
||||
<translation>脚本编辑器</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="49"/>
|
||||
<location filename="winghexpy.cpp" line="105"/>
|
||||
<location filename="winghexpy.cpp" line="54"/>
|
||||
<location filename="winghexpy.cpp" line="114"/>
|
||||
<source>Run File</source>
|
||||
<translation>从文件执行</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="51"/>
|
||||
<location filename="winghexpy.cpp" line="93"/>
|
||||
<location filename="winghexpy.cpp" line="56"/>
|
||||
<location filename="winghexpy.cpp" line="102"/>
|
||||
<source>Database</source>
|
||||
<translation>脚本库</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="56"/>
|
||||
<location filename="winghexpy.cpp" line="61"/>
|
||||
<source>Script</source>
|
||||
<translation>脚本</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="64"/>
|
||||
<location filename="winghexpy.cpp" line="69"/>
|
||||
<source>Console</source>
|
||||
<translation>控制台</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="67"/>
|
||||
<location filename="winghexpy.cpp" line="112"/>
|
||||
<location filename="winghexpy.cpp" line="72"/>
|
||||
<location filename="winghexpy.cpp" line="121"/>
|
||||
<source>InfoList</source>
|
||||
<translation>信息列表</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="71"/>
|
||||
<location filename="winghexpy.cpp" line="126"/>
|
||||
<location filename="winghexpy.cpp" line="76"/>
|
||||
<location filename="winghexpy.cpp" line="135"/>
|
||||
<source>InfoTree</source>
|
||||
<translation>树信息列表</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="74"/>
|
||||
<location filename="winghexpy.cpp" line="119"/>
|
||||
<location filename="winghexpy.cpp" line="79"/>
|
||||
<location filename="winghexpy.cpp" line="128"/>
|
||||
<source>InfoTable</source>
|
||||
<translation>信息表格</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="78"/>
|
||||
<location filename="winghexpy.cpp" line="133"/>
|
||||
<location filename="winghexpy.cpp" line="83"/>
|
||||
<location filename="winghexpy.cpp" line="142"/>
|
||||
<source>InfoTxt</source>
|
||||
<translation>信息文本浏览</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="86"/>
|
||||
<location filename="winghexpy.cpp" line="95"/>
|
||||
<source>ScriptWindow</source>
|
||||
<translation>脚本窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="141"/>
|
||||
<location filename="winghexpy.cpp" line="145"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="148"/>
|
||||
<location filename="winghexpy.cpp" line="155"/>
|
||||
<source>Sponsor</source>
|
||||
<translation>赞助</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="156"/>
|
||||
<location filename="winghexpy.cpp" line="153"/>
|
||||
<source>Wiki</source>
|
||||
<translation>网页 Wiki</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="164"/>
|
||||
<location filename="winghexpy.cpp" line="163"/>
|
||||
<source>ChooseFile</source>
|
||||
<translation>选择文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="winghexpy.cpp" line="188"/>
|
||||
<location filename="winghexpy.cpp" line="187"/>
|
||||
<source>A useful plugin for python3.7 support.</source>
|
||||
<translation>一个十分有用的 Python 3.7 的支持插件。</translation>
|
||||
</message>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#include "aboutsoftwaredialog.h"
|
||||
#include <DLabel>
|
||||
#include <DTextBrowser>
|
||||
#include <QPixmap>
|
||||
|
||||
AboutSoftwareDialog::AboutSoftwareDialog(DMainWindow *parent)
|
||||
: DDialog(parent) {
|
||||
QPixmap pic;
|
||||
pic.load(HOSTAUTHORPIMG);
|
||||
auto l = new DLabel(this);
|
||||
l->setFixedSize(100, 100);
|
||||
l->setScaledContents(true);
|
||||
l->setPixmap(pic);
|
||||
addContent(l, Qt::AlignHCenter);
|
||||
addSpacing(10);
|
||||
auto b = new DTextBrowser(this);
|
||||
b->setSearchPaths(QStringList({":/WingHexPy", ":/WingHexPy/img"}));
|
||||
b->setSource(QUrl("README.md"), QTextDocument::MarkdownResource);
|
||||
|
||||
b->setFixedSize(800, 500);
|
||||
b->setOpenExternalLinks(true);
|
||||
addContent(b);
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
#ifndef ABOUTSOFTWAREDIALOG_H
|
||||
#define ABOUTSOFTWAREDIALOG_H
|
||||
|
||||
#include "../../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
|
||||
#include <DDialog>
|
||||
#include <DMainWindow>
|
||||
#include <QObject>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
class AboutSoftwareDialog : public DDialog {
|
||||
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AboutSoftwareDialog(DMainWindow *parent = nullptr);
|
||||
};
|
||||
|
||||
#endif // ABOUTSOFTWAREDIALOG_H
|
|
@ -1,9 +1,7 @@
|
|||
#include "scriptwindow.h"
|
||||
#include "../../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
|
||||
#include "QCodeEditor/QPythonHighlighter.hpp"
|
||||
#include "aboutsoftwaredialog.h"
|
||||
#include "plginterface.h"
|
||||
#include "sponsordialog.h"
|
||||
#include <DFileDialog>
|
||||
#include <DInputDialog>
|
||||
#include <DMessageManager>
|
||||
|
@ -568,11 +566,11 @@ void ScriptWindow::on_jmp() {
|
|||
}
|
||||
|
||||
void ScriptWindow::on_about() {
|
||||
AboutSoftwareDialog d;
|
||||
d.exec();
|
||||
emit sigAbout();
|
||||
raise();
|
||||
}
|
||||
|
||||
void ScriptWindow::on_sponsor() {
|
||||
SponsorDialog d;
|
||||
d.exec();
|
||||
emit sigSponsor();
|
||||
raise();
|
||||
}
|
||||
|
|
|
@ -49,6 +49,10 @@ private:
|
|||
|
||||
void setSaved(bool b);
|
||||
|
||||
signals:
|
||||
void sigAbout();
|
||||
void sigSponsor();
|
||||
|
||||
private:
|
||||
QCodeEditor *editor;
|
||||
static ScriptWindow *m_instance;
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#include "sponsordialog.h"
|
||||
#include <DLabel>
|
||||
#include <QPixmap>
|
||||
|
||||
SponsorDialog::SponsorDialog(DMainWindow *parent) : DDialog(parent) {
|
||||
setWindowTitle(tr("Sponsor"));
|
||||
|
||||
addSpacing(5);
|
||||
addContent(new DLabel(tr("ThanksForSponsor"), this), Qt::AlignHCenter);
|
||||
addSpacing(5);
|
||||
QPixmap sponsor(SPONSORQRCODE);
|
||||
|
||||
auto l = new DLabel(this);
|
||||
l->setPixmap(sponsor);
|
||||
l->setScaledContents(true);
|
||||
addContent(l);
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef SPONSORDIALOG_H
|
||||
#define SPONSORDIALOG_H
|
||||
|
||||
#include "../../WingHexExplorer/wing-hex-explorer.sourcecode/WingHexExplorer/plugin/iwingplugin.h"
|
||||
#include <DDialog>
|
||||
#include <DMainWindow>
|
||||
#include <QObject>
|
||||
|
||||
DWIDGET_USE_NAMESPACE
|
||||
class SponsorDialog : public DDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SponsorDialog(DMainWindow *parent = nullptr);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
};
|
||||
|
||||
#endif // SPONSORDIALOG_H
|
|
@ -1,8 +1,6 @@
|
|||
#include "winghexpy.h"
|
||||
#include "aboutsoftwaredialog.h"
|
||||
#include "scriptcenterwindow.h"
|
||||
#include "scriptwindow.h"
|
||||
#include "sponsordialog.h"
|
||||
#include <QApplication>
|
||||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
|
@ -26,8 +24,14 @@ QString WingHexPy::signature() { return WINGSUMMER; }
|
|||
bool WingHexPy::init(QList<WingPluginInfo> loadedplugin) {
|
||||
Q_UNUSED(loadedplugin);
|
||||
|
||||
auto translator = new QTranslator(this);
|
||||
if (SDKVERSION < 8) {
|
||||
QMessageBox::critical(nullptr, "Error",
|
||||
"UnSupported Plugin System Version!",
|
||||
QMessageBox::Ok);
|
||||
return false;
|
||||
}
|
||||
|
||||
auto translator = new QTranslator(this);
|
||||
auto s = GETPLUGINQM("WingHexPy.qm");
|
||||
if (!translator->load(s) || !QApplication::installTranslator(translator)) {
|
||||
QMessageBox::critical(nullptr, "Error", "Error Loading Translation File!",
|
||||
|
@ -81,6 +85,10 @@ bool WingHexPy::init(QList<WingPluginInfo> loadedplugin) {
|
|||
|
||||
plgint->initInfo(infolist, infotree, infotable, infotxt);
|
||||
|
||||
auto sw = ScriptWindow::instance();
|
||||
connect(sw, &ScriptWindow::sigAbout, this, &WingHexPy::on_about);
|
||||
connect(sw, &ScriptWindow::sigSponsor, this, &WingHexPy::on_sponsor);
|
||||
|
||||
PluginToolBarInitBegin(tb, "WingHexPy", "WingHexPy") {
|
||||
PluginToolBarAddLamba(
|
||||
tb, ICONRES("pys"), [=] { ScriptWindow::instance()->show(); },
|
||||
|
@ -133,13 +141,8 @@ bool WingHexPy::init(QList<WingPluginInfo> loadedplugin) {
|
|||
},
|
||||
tr("InfoTxt"));
|
||||
tb->addSeparator();
|
||||
PluginToolBarAddLamba(
|
||||
tb, HOSTICONRES("author"),
|
||||
[=] {
|
||||
AboutSoftwareDialog d;
|
||||
d.exec();
|
||||
},
|
||||
tr("About"));
|
||||
PluginToolBarAddAction(tb, HOSTICONRES("author"), WingHexPy::on_about,
|
||||
tr("About"));
|
||||
PluginToolBarAddLamba(
|
||||
tb, HOSTICONRES("wiki"),
|
||||
[=] {
|
||||
|
@ -148,13 +151,8 @@ bool WingHexPy::init(QList<WingPluginInfo> loadedplugin) {
|
|||
"%E6%95%99%E7%A8%8B"));
|
||||
},
|
||||
tr("Wiki"));
|
||||
PluginToolBarAddLamba(
|
||||
tb, HOSTICONRES("sponsor"),
|
||||
[=] {
|
||||
SponsorDialog d;
|
||||
d.exec();
|
||||
},
|
||||
tr("Sponsor"));
|
||||
PluginToolBarAddAction(tb, HOSTICONRES("sponsor"), WingHexPy::on_sponsor,
|
||||
tr("Sponsor"));
|
||||
}
|
||||
PluginToolBarInitEnd();
|
||||
|
||||
|
@ -205,3 +203,15 @@ void WingHexPy::registerDockWidget(
|
|||
QToolBar *WingHexPy::registerToolBar() { return tb; }
|
||||
|
||||
void WingHexPy::log(QString message) { txt->consoleMessage(message); }
|
||||
|
||||
void WingHexPy::on_about() {
|
||||
auto authord = newAboutDialog(QPixmap(), {":/WingHexPy", ":/WingHexPy/img"});
|
||||
authord->exec();
|
||||
delete authord;
|
||||
}
|
||||
|
||||
void WingHexPy::on_sponsor() {
|
||||
auto sponsor = newSponsorDialog();
|
||||
sponsor->exec();
|
||||
delete sponsor;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,8 @@ public:
|
|||
|
||||
public:
|
||||
void log(QString message);
|
||||
void on_about();
|
||||
void on_sponsor();
|
||||
|
||||
public:
|
||||
void RunPyFile(QString filename);
|
||||
|
|
Loading…
Reference in New Issue