update
This commit is contained in:
parent
ea9688991c
commit
42123144ed
11
README.md
11
README.md
|
@ -26,6 +26,10 @@
|
||||||
|
|
||||||
  本软件定位是本地生产力基础工具,旨在快速启动和使用高效工具。本人不考虑像 utool 和 quicker 之类提供插件商店。该程序不会进行与网络相关的任何操作,所有的插件安装都是本地的。如果有仅本地的需要,待该软件出 beta 之后,可以尝试该软件,发现 Bug 并递交修复。
|
  本软件定位是本地生产力基础工具,旨在快速启动和使用高效工具。本人不考虑像 utool 和 quicker 之类提供插件商店。该程序不会进行与网络相关的任何操作,所有的插件安装都是本地的。如果有仅本地的需要,待该软件出 beta 之后,可以尝试该软件,发现 Bug 并递交修复。
|
||||||
|
|
||||||
|
## Wiki
|
||||||
|
|
||||||
|
  教程文档已撰写完毕,点击 [此链接](https://code.gitlink.org.cn/wingsummer/WingTool/wiki/%E7%AE%80%E4%BB%8B) 进行学习如何使用。
|
||||||
|
|
||||||
## 效果图
|
## 效果图
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
|
@ -48,3 +52,10 @@
|
||||||
<p align="center">感谢支持</p>
|
<p align="center">感谢支持</p>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
## 相关仓库
|
||||||
|
|
||||||
|
* Gitea : https://code.gitlink.org.cn/wingsummer/WingTool
|
||||||
|
* Gitee : https://gitee.com/wing-cloud/wing-tool
|
||||||
|
* Github : https://github.com/Wing-summer/WingTool
|
||||||
|
* Gitlink : https://www.gitlink.org.cn/wingsummer/WingTool
|
||||||
|
|
|
@ -4,7 +4,15 @@
|
||||||
TestPlugin::TestPlugin(QObject *parent) {
|
TestPlugin::TestPlugin(QObject *parent) {
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
qRegisterMetaType<TestService>("TestService");
|
qRegisterMetaType<TestService>("TestService");
|
||||||
|
}
|
||||||
|
|
||||||
|
int TestPlugin::sdkVersion() { return SDKVERSION; }
|
||||||
|
|
||||||
|
QString TestPlugin::signature() { return WINGSUMMER; }
|
||||||
|
|
||||||
|
TestPlugin::~TestPlugin() { testmenu->deleteLater(); }
|
||||||
|
|
||||||
|
bool TestPlugin::preInit() {
|
||||||
dialog = new QDialog;
|
dialog = new QDialog;
|
||||||
dialog->setFixedSize(400, 400);
|
dialog->setFixedSize(400, 400);
|
||||||
dialog->setWindowTitle("TestPluginConsole");
|
dialog->setWindowTitle("TestPluginConsole");
|
||||||
|
@ -20,29 +28,19 @@ TestPlugin::TestPlugin(QObject *parent) {
|
||||||
testmenu = new QAction;
|
testmenu = new QAction;
|
||||||
testmenu->setIcon(QIcon(":/TestPlugin/logo.svg"));
|
testmenu->setIcon(QIcon(":/TestPlugin/logo.svg"));
|
||||||
testmenu->setText("TestMenu");
|
testmenu->setText("TestMenu");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TestPlugin::sdkVersion() { return SDKVERSION; }
|
|
||||||
|
|
||||||
QString TestPlugin::signature() { return WINGSUMMER; }
|
|
||||||
|
|
||||||
TestPlugin::~TestPlugin() { testmenu->deleteLater(); }
|
|
||||||
|
|
||||||
bool TestPlugin::init(QList<WingPluginInfo> loadedplugin) {
|
bool TestPlugin::init(QList<WingPluginInfo> loadedplugin) {
|
||||||
Q_UNUSED(loadedplugin);
|
Q_UNUSED(loadedplugin);
|
||||||
dialog->show();
|
dialog->show();
|
||||||
auto s = GETPLUGINQM("TestPlugin.qm");
|
|
||||||
if (!translator.load(s) || !QApplication::installTranslator(&translator)) {
|
|
||||||
QMessageBox::critical(nullptr, "Error", "Error Loading File!",
|
|
||||||
QMessageBox::Ok);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestPlugin::unload() {
|
void TestPlugin::unload() {
|
||||||
dialog->close();
|
dialog->close();
|
||||||
delete dialog;
|
delete dialog;
|
||||||
|
testmenu->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TestPlugin::pluginName() { return "TestPlugin"; }
|
QString TestPlugin::pluginName() { return "TestPlugin"; }
|
||||||
|
@ -73,47 +71,23 @@ HookIndex TestPlugin::getHookSubscribe() { return HookIndex::None; }
|
||||||
|
|
||||||
QObject *TestPlugin::trayRegisteredMenu() { return testmenu; }
|
QObject *TestPlugin::trayRegisteredMenu() { return testmenu; }
|
||||||
|
|
||||||
|
QString TestPlugin::translatorFile() { return "TestPlugin.qm"; }
|
||||||
|
|
||||||
QVariant TestPlugin::pluginServicePipe(int serviceID, QList<QVariant> params) {
|
QVariant TestPlugin::pluginServicePipe(int serviceID, QList<QVariant> params) {
|
||||||
|
Q_UNUSED(params);
|
||||||
switch (serviceID) {
|
switch (serviceID) {
|
||||||
case HostService:
|
case PLUGINLOADING:
|
||||||
if (params.first() == LoadedPluginMsg) {
|
break;
|
||||||
|
case PLUGINLOADED: {
|
||||||
testhotkey = registerHotkey(
|
testhotkey = registerHotkey(
|
||||||
QKeySequence(Qt::KeyboardModifier::ControlModifier |
|
QKeySequence(Qt::KeyboardModifier::ControlModifier |
|
||||||
Qt::KeyboardModifier::AltModifier | Qt::Key_Q));
|
Qt::KeyboardModifier::AltModifier | Qt::Key_Q));
|
||||||
if (testhotkey.isNull()) {
|
if (testhotkey.isNull()) {
|
||||||
tbinfo->append(QString("registerHotkey Error!"));
|
tbinfo->append(QString("registerHotkey Error!"));
|
||||||
}
|
}
|
||||||
}
|
} break;
|
||||||
break;
|
default:
|
||||||
case RemoteCallRes:
|
tbinfo->append(QString("GetMessage : %1").arg(serviceID));
|
||||||
break;
|
|
||||||
case HotKeyTriggered:
|
|
||||||
tbinfo->append(QString("HotKeyTriggered : %1")
|
|
||||||
.arg(params.first().value<QUuid>().toString()));
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
if (params.count()) {
|
|
||||||
auto param = params.first();
|
|
||||||
if (param.canConvert(QMetaType::Int)) {
|
|
||||||
tbinfo->append(QString("[func1 call] : %1").arg(param.value<int>()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (params.count()) {
|
|
||||||
QStringList res;
|
|
||||||
for (auto &item : params) {
|
|
||||||
if (item.canConvert(QMetaType::QString)) {
|
|
||||||
res.append(item.value<QString>());
|
|
||||||
} else if (item.canConvert(QMetaType::QStringList)) {
|
|
||||||
res += item.value<QStringList>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tbinfo->append(QString("[func2 call] : ") + res.join(';'));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
dialog->setVisible(!dialog->isVisible());
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
@ -123,6 +97,10 @@ void TestPlugin::onPluginCenter() {
|
||||||
QMessageBox::information(nullptr, "Settings", "You Clicked Settings!");
|
QMessageBox::information(nullptr, "Settings", "You Clicked Settings!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestPlugin::hotkeyTirggered(QUuid id) {
|
||||||
|
tbinfo->append(QString("HotKeyTriggered : %1").arg(id.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
#if QT_VERSION < 0x050000
|
#if QT_VERSION < 0x050000
|
||||||
Q_EXPORT_PLUGIN2(TestPlugin, IWingToolPlg)
|
Q_EXPORT_PLUGIN2(TestPlugin, IWingToolPlg)
|
||||||
#endif // QT_VERSION < 0x050000
|
#endif // QT_VERSION < 0x050000
|
||||||
|
|
|
@ -50,6 +50,7 @@ public:
|
||||||
QString signature() override;
|
QString signature() override;
|
||||||
~TestPlugin() override;
|
~TestPlugin() override;
|
||||||
|
|
||||||
|
bool preInit() override;
|
||||||
bool init(QList<WingPluginInfo> loadedplugin) override;
|
bool init(QList<WingPluginInfo> loadedplugin) override;
|
||||||
void unload() override;
|
void unload() override;
|
||||||
QString pluginName() override;
|
QString pluginName() override;
|
||||||
|
@ -64,11 +65,14 @@ public:
|
||||||
HookIndex getHookSubscribe() override;
|
HookIndex getHookSubscribe() override;
|
||||||
|
|
||||||
QObject *trayRegisteredMenu() override;
|
QObject *trayRegisteredMenu() override;
|
||||||
|
QString translatorFile() override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
QVariant pluginServicePipe(int serviceID, QList<QVariant> params) override;
|
QVariant pluginServicePipe(int serviceID, QList<QVariant> params) override;
|
||||||
virtual void onPluginCenter() override;
|
virtual void onPluginCenter() override;
|
||||||
|
|
||||||
|
void hotkeyTirggered(QUuid id) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QUuid testhotkey;
|
QUuid testhotkey;
|
||||||
QDialog *dialog;
|
QDialog *dialog;
|
||||||
|
|
|
@ -102,6 +102,14 @@ Qt::KeyboardModifiers AppManager::getKeyModifiers() const {
|
||||||
return monitor.getKeyModifiers();
|
return monitor.getKeyModifiers();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Qt::MouseButtons AppManager::getMouseButtons() const {
|
||||||
|
return monitor.getMouseButtons();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AppManager::isRegistered(QKeySequence &seq) const {
|
||||||
|
return registeredSeq.contains(seq);
|
||||||
|
}
|
||||||
|
|
||||||
void AppManager::setToolIcon(int index, QIcon icon, QString tip) {
|
void AppManager::setToolIcon(int index, QIcon icon, QString tip) {
|
||||||
toolwin.setIcon(index, icon, tip);
|
toolwin.setIcon(index, icon, tip);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ public:
|
||||||
void clearHotkey();
|
void clearHotkey();
|
||||||
|
|
||||||
Qt::KeyboardModifiers getKeyModifiers() const;
|
Qt::KeyboardModifiers getKeyModifiers() const;
|
||||||
|
Qt::MouseButtons getMouseButtons() const;
|
||||||
|
bool isRegistered(QKeySequence &seq) const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void buttonPress(Qt::MouseButton btn, int x, int y);
|
void buttonPress(Qt::MouseButton btn, int x, int y);
|
||||||
|
|
|
@ -69,6 +69,8 @@ Qt::KeyboardModifiers EventMonitor::getKeyModifiers() const {
|
||||||
return keyModifiers;
|
return keyModifiers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Qt::MouseButtons EventMonitor::getMouseButtons() const { return mouseBtns; }
|
||||||
|
|
||||||
void EventMonitor::callback(XPointer ptr, XRecordInterceptData *data) {
|
void EventMonitor::callback(XPointer ptr, XRecordInterceptData *data) {
|
||||||
(reinterpret_cast<EventMonitor *>(ptr))->handleRecordEvent(data);
|
(reinterpret_cast<EventMonitor *>(ptr))->handleRecordEvent(data);
|
||||||
}
|
}
|
||||||
|
@ -85,6 +87,7 @@ void EventMonitor::handleRecordEvent(XRecordInterceptData *data) {
|
||||||
switch (event->u.u.detail) {
|
switch (event->u.u.detail) {
|
||||||
case Button1: {
|
case Button1: {
|
||||||
btn = Qt::MouseButton::LeftButton;
|
btn = Qt::MouseButton::LeftButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::LeftButton);
|
||||||
|
|
||||||
auto clicknow = std::chrono::system_clock::now();
|
auto clicknow = std::chrono::system_clock::now();
|
||||||
double diff_ms =
|
double diff_ms =
|
||||||
|
@ -104,15 +107,19 @@ void EventMonitor::handleRecordEvent(XRecordInterceptData *data) {
|
||||||
} break;
|
} break;
|
||||||
case Button2:
|
case Button2:
|
||||||
btn = Qt::MouseButton::MiddleButton;
|
btn = Qt::MouseButton::MiddleButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::MiddleButton);
|
||||||
break;
|
break;
|
||||||
case Button3:
|
case Button3:
|
||||||
btn = Qt::MouseButton::RightButton;
|
btn = Qt::MouseButton::RightButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::RightButton);
|
||||||
break;
|
break;
|
||||||
case XButton_1:
|
case XButton_1:
|
||||||
btn = Qt::MouseButton::XButton1;
|
btn = Qt::MouseButton::XButton1;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::XButton1);
|
||||||
break;
|
break;
|
||||||
case XButton_2:
|
case XButton_2:
|
||||||
btn = Qt::MouseButton::XButton2;
|
btn = Qt::MouseButton::XButton2;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::XButton2);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,18 +144,23 @@ void EventMonitor::handleRecordEvent(XRecordInterceptData *data) {
|
||||||
switch (event->u.u.detail) {
|
switch (event->u.u.detail) {
|
||||||
case Button1:
|
case Button1:
|
||||||
btn = Qt::MouseButton::LeftButton;
|
btn = Qt::MouseButton::LeftButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::LeftButton, false);
|
||||||
break;
|
break;
|
||||||
case Button2:
|
case Button2:
|
||||||
btn = Qt::MouseButton::MiddleButton;
|
btn = Qt::MouseButton::MiddleButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::MiddleButton, false);
|
||||||
break;
|
break;
|
||||||
case Button3:
|
case Button3:
|
||||||
btn = Qt::MouseButton::RightButton;
|
btn = Qt::MouseButton::RightButton;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::RightButton, false);
|
||||||
break;
|
break;
|
||||||
case XButton_1:
|
case XButton_1:
|
||||||
btn = Qt::MouseButton::XButton1;
|
btn = Qt::MouseButton::XButton1;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::XButton1, false);
|
||||||
break;
|
break;
|
||||||
case XButton_2:
|
case XButton_2:
|
||||||
btn = Qt::MouseButton::XButton2;
|
btn = Qt::MouseButton::XButton2;
|
||||||
|
mouseBtns.setFlag(Qt::MouseButton::XButton2, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
emit buttonRelease(btn, event->u.keyButtonPointer.rootX,
|
emit buttonRelease(btn, event->u.keyButtonPointer.rootX,
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
~EventMonitor() override;
|
~EventMonitor() override;
|
||||||
|
|
||||||
Qt::KeyboardModifiers getKeyModifiers() const;
|
Qt::KeyboardModifiers getKeyModifiers() const;
|
||||||
|
Qt::MouseButtons getMouseButtons() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void buttonPress(Qt::MouseButton btn, int x, int y); // 当鼠标按键被按下时
|
void buttonPress(Qt::MouseButton btn, int x, int y); // 当鼠标按键被按下时
|
||||||
|
@ -71,6 +72,7 @@ private:
|
||||||
std::chrono::system_clock::time_point clickbefore;
|
std::chrono::system_clock::time_point clickbefore;
|
||||||
|
|
||||||
Qt::KeyboardModifiers keyModifiers;
|
Qt::KeyboardModifiers keyModifiers;
|
||||||
|
Qt::MouseButtons mouseBtns;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -275,6 +275,13 @@ CenterWindow::CenterWindow(DMainWindow *parent) : DMainWindow(parent) {
|
||||||
tbtoolinfo->append(QObject::tr("Version:") +
|
tbtoolinfo->append(QObject::tr("Version:") +
|
||||||
QString::number(plg->pluginVersion()));
|
QString::number(plg->pluginVersion()));
|
||||||
tbtoolinfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
tbtoolinfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
||||||
|
tbplginfo->append("");
|
||||||
|
auto fm = tbplginfo->currentCharFormat();
|
||||||
|
tbplginfo->insertHtml(
|
||||||
|
QString("<p>%1<a href=\"%2\" title=\"%2\">%2</a></p>")
|
||||||
|
.arg(QObject::tr("Web:"))
|
||||||
|
.arg(plg->pluginWebsite()));
|
||||||
|
tbplginfo->setCurrentCharFormat(fm);
|
||||||
tbtoolinfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
tbtoolinfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
||||||
tbtoolinfo->append(QObject::tr("Provider:") +
|
tbtoolinfo->append(QObject::tr("Provider:") +
|
||||||
plgsys->pluginProvider(plg));
|
plgsys->pluginProvider(plg));
|
||||||
|
@ -300,6 +307,7 @@ CenterWindow::CenterWindow(DMainWindow *parent) : DMainWindow(parent) {
|
||||||
tvlayout->addWidget(gw, 0, Qt::AlignCenter);
|
tvlayout->addWidget(gw, 0, Qt::AlignCenter);
|
||||||
tbtoolinfo = new DTextBrowser(w);
|
tbtoolinfo = new DTextBrowser(w);
|
||||||
tbtoolinfo->setUndoRedoEnabled(false);
|
tbtoolinfo->setUndoRedoEnabled(false);
|
||||||
|
tbtoolinfo->setOpenExternalLinks(true);
|
||||||
tvlayout->addWidget(tbtoolinfo);
|
tvlayout->addWidget(tbtoolinfo);
|
||||||
|
|
||||||
group = new DButtonBox(this);
|
group = new DButtonBox(this);
|
||||||
|
@ -520,8 +528,9 @@ CenterWindow::CenterWindow(DMainWindow *parent) : DMainWindow(parent) {
|
||||||
tbplginfo->setUndoRedoEnabled(false);
|
tbplginfo->setUndoRedoEnabled(false);
|
||||||
tbplginfo->setText(tr("No selected plugin."));
|
tbplginfo->setText(tr("No selected plugin."));
|
||||||
tbplginfo->setLineWrapMode(DTextBrowser::LineWrapMode::NoWrap);
|
tbplginfo->setLineWrapMode(DTextBrowser::LineWrapMode::NoWrap);
|
||||||
|
tbplginfo->setOpenExternalLinks(true);
|
||||||
|
|
||||||
pvlayout->addWidget(tbplginfo, 1);
|
pvlayout->addWidget(tbplginfo);
|
||||||
auto btnplgset = new DPushButton(tr("PluginCenter"), w);
|
auto btnplgset = new DPushButton(tr("PluginCenter"), w);
|
||||||
connect(btnplgset, &DPushButton::clicked, this, [=] {
|
connect(btnplgset, &DPushButton::clicked, this, [=] {
|
||||||
auto plg = plgsys->plugin(lwplgs->currentRow());
|
auto plg = plgsys->plugin(lwplgs->currentRow());
|
||||||
|
@ -548,6 +557,12 @@ CenterWindow::CenterWindow(DMainWindow *parent) : DMainWindow(parent) {
|
||||||
tbplginfo->append(QObject::tr("Version:") +
|
tbplginfo->append(QObject::tr("Version:") +
|
||||||
QString::number(plg->pluginVersion()));
|
QString::number(plg->pluginVersion()));
|
||||||
tbplginfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
tbplginfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
||||||
|
tbplginfo->append("");
|
||||||
|
auto fm = tbplginfo->currentCharFormat();
|
||||||
|
tbplginfo->insertHtml(QString("<p>%1<a href=\"%2\" title=\"%2\">%2</a></p>")
|
||||||
|
.arg(QObject::tr("Web:"))
|
||||||
|
.arg(plg->pluginWebsite()));
|
||||||
|
tbplginfo->setCurrentCharFormat(fm);
|
||||||
tbplginfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
tbplginfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
||||||
tbplginfo->append(QObject::tr("Provider:") + plgsys->pluginProvider(plg));
|
tbplginfo->append(QObject::tr("Provider:") + plgsys->pluginProvider(plg));
|
||||||
|
|
||||||
|
@ -559,7 +574,7 @@ CenterWindow::CenterWindow(DMainWindow *parent) : DMainWindow(parent) {
|
||||||
auto len = srv.count();
|
auto len = srv.count();
|
||||||
for (auto i = 0; i < len; i++) {
|
for (auto i = 0; i < len; i++) {
|
||||||
tbplginfo->append(
|
tbplginfo->append(
|
||||||
QString("\t%1 : %2 ( %3 )").arg(i).arg(srvtr[i]).arg(srv[i]));
|
QString("\t%1 : %2 ( %3 )").arg(i + 1).arg(srvtr[i]).arg(srv[i]));
|
||||||
}
|
}
|
||||||
|
|
||||||
tbplginfo->append(tr("RegisteredHotkey:"));
|
tbplginfo->append(tr("RegisteredHotkey:"));
|
||||||
|
@ -618,7 +633,7 @@ bool CenterWindow::runTask(ToolStructInfo record) {
|
||||||
for (auto &item : params) {
|
for (auto &item : params) {
|
||||||
ps.append(item);
|
ps.append(item);
|
||||||
}
|
}
|
||||||
plgsys->pluginCall(record.provider, record.serviceID, ps);
|
plgsys->pluginCall(record.provider, record.serviceID + 1, ps);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ PluginSelDialog::PluginSelDialog(DDialog *parent)
|
||||||
tbplginfo->setUndoRedoEnabled(false);
|
tbplginfo->setUndoRedoEnabled(false);
|
||||||
tbplginfo->setText(tr("No selected plugin."));
|
tbplginfo->setText(tr("No selected plugin."));
|
||||||
tbplginfo->setLineWrapMode(DTextBrowser::LineWrapMode::NoWrap);
|
tbplginfo->setLineWrapMode(DTextBrowser::LineWrapMode::NoWrap);
|
||||||
|
tbplginfo->setOpenExternalLinks(true);
|
||||||
|
|
||||||
connect(lsplgs, &DListWidget::itemSelectionChanged, this, [=] {
|
connect(lsplgs, &DListWidget::itemSelectionChanged, this, [=] {
|
||||||
tbplginfo->clear();
|
tbplginfo->clear();
|
||||||
|
@ -38,6 +39,12 @@ PluginSelDialog::PluginSelDialog(DDialog *parent)
|
||||||
tbplginfo->append(QObject::tr("Version:") +
|
tbplginfo->append(QObject::tr("Version:") +
|
||||||
QString::number(plg->pluginVersion()));
|
QString::number(plg->pluginVersion()));
|
||||||
tbplginfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
tbplginfo->append(QObject::tr("Author:") + plg->pluginAuthor());
|
||||||
|
tbplginfo->append("");
|
||||||
|
auto fm = tbplginfo->currentCharFormat();
|
||||||
|
tbplginfo->insertHtml(QString("<p>%1<a href=\"%2\" title=\"%2\">%2</a></p>")
|
||||||
|
.arg(QObject::tr("Web:"))
|
||||||
|
.arg(plg->pluginWebsite()));
|
||||||
|
tbplginfo->setCurrentCharFormat(fm);
|
||||||
tbplginfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
tbplginfo->append(QObject::tr("Comment:") + plg->pluginComment());
|
||||||
tbplginfo->append(QObject::tr("Provider:") + plgsys->pluginProvider(plg));
|
tbplginfo->append(QObject::tr("Provider:") + plgsys->pluginProvider(plg));
|
||||||
tbplginfo->append(QObject::tr("Services:"));
|
tbplginfo->append(QObject::tr("Services:"));
|
||||||
|
@ -47,7 +54,7 @@ PluginSelDialog::PluginSelDialog(DDialog *parent)
|
||||||
auto len = srvs.count();
|
auto len = srvs.count();
|
||||||
for (auto i = 0; i < len; i++) {
|
for (auto i = 0; i < len; i++) {
|
||||||
tbplginfo->append(
|
tbplginfo->append(
|
||||||
QString("\t%1 : %2 ( %3 )").arg(i).arg(trsrvs[i]).arg(srvs[i]));
|
QString("\t%1 : %2 ( %3 )").arg(i + 1).arg(trsrvs[i]).arg(srvs[i]));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ void RunDialog::on_accept() {
|
||||||
params.append(item);
|
params.append(item);
|
||||||
}
|
}
|
||||||
auto res = plgsys->pluginCall(plgsys->pluginProvider(plg),
|
auto res = plgsys->pluginCall(plgsys->pluginProvider(plg),
|
||||||
cbService->currentIndex(), params);
|
cbService->currentIndex() + 1, params);
|
||||||
done(res);
|
done(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,12 @@ void ShortCutEditDialog::on_accept() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (manager->isRegistered(res.seq)) {
|
||||||
|
DMessageManager::instance()->sendMessage(this, ProgramIcon,
|
||||||
|
tr("HotkeyRegistered"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
res.isPlugin = ps->getSelectedIndex() >= 0;
|
res.isPlugin = ps->getSelectedIndex() >= 0;
|
||||||
|
|
||||||
if (res.isPlugin) {
|
if (res.isPlugin) {
|
||||||
|
|
|
@ -50,28 +50,7 @@ ToolEditDialog::ToolEditDialog(ToolStructInfo res, DMainWindow *parent)
|
||||||
connect(fcicon, &DFileChooserEdit::textChanged, this, [=] {
|
connect(fcicon, &DFileChooserEdit::textChanged, this, [=] {
|
||||||
auto name = fcicon->text().trimmed();
|
auto name = fcicon->text().trimmed();
|
||||||
this->res.iconpath = name;
|
this->res.iconpath = name;
|
||||||
if (name.isEmpty()) {
|
sicon = name.isEmpty() ? QIcon() : Utilities::trimIconFromFile(name);
|
||||||
sicon = QIcon();
|
|
||||||
this->refreshIcon();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (QIcon::hasThemeIcon(name)) {
|
|
||||||
sicon = QIcon::fromTheme(name);
|
|
||||||
} else {
|
|
||||||
if (QFile::exists(name)) {
|
|
||||||
QPixmap img;
|
|
||||||
if (img.load(name)) {
|
|
||||||
auto icon = QIcon((img.width() > 64 || img.height() > 64)
|
|
||||||
? img.scaled(64, 64, Qt::KeepAspectRatio)
|
|
||||||
: img);
|
|
||||||
sicon = icon;
|
|
||||||
} else {
|
|
||||||
sicon = QIcon();
|
|
||||||
DMessageManager::instance()->sendMessage(this, ProgramIcon,
|
|
||||||
tr("InvalidIcon"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this->refreshIcon();
|
this->refreshIcon();
|
||||||
});
|
});
|
||||||
connect(fcicon, &DFileChooserEdit::fileChoosed, this,
|
connect(fcicon, &DFileChooserEdit::fileChoosed, this,
|
||||||
|
|
|
@ -11,3 +11,14 @@
|
||||||
## 有关 issue
|
## 有关 issue
|
||||||
|
|
||||||
  本软件定位是本地生产力基础工具,旨在快速启动和使用高效工具。本人不考虑像 utool 和 quicker 之类提供插件商店。该程序不会进行与网络相关的任何操作,所有的插件安装都是本地的。如果有仅本地的需要,待该软件出 beta 之后,可以尝试该软件,发现 Bug 并递交修复。
|
  本软件定位是本地生产力基础工具,旨在快速启动和使用高效工具。本人不考虑像 utool 和 quicker 之类提供插件商店。该程序不会进行与网络相关的任何操作,所有的插件安装都是本地的。如果有仅本地的需要,待该软件出 beta 之后,可以尝试该软件,发现 Bug 并递交修复。
|
||||||
|
|
||||||
|
## WIKI
|
||||||
|
|
||||||
|
  教程文档已撰写完毕,点击 [此链接](https://code.gitlink.org.cn/wingsummer/WingTool/wiki/%E7%AE%80%E4%BB%8B) 进行学习如何使用。
|
||||||
|
|
||||||
|
## 相关仓库
|
||||||
|
|
||||||
|
* Gitea : https://code.gitlink.org.cn/wingsummer/WingTool
|
||||||
|
* Gitee : https://gitee.com/wing-cloud/wing-tool
|
||||||
|
* Github : https://github.com/Wing-summer/WingTool
|
||||||
|
* Gitlink : https://www.gitlink.org.cn/wingsummer/WingTool
|
||||||
|
|
BIN
lang/zh.qm
BIN
lang/zh.qm
Binary file not shown.
244
lang/zh.ts
244
lang/zh.ts
|
@ -127,33 +127,33 @@
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="157"/>
|
<location filename="../dialog/centerwindow.cpp" line="157"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="197"/>
|
<location filename="../dialog/centerwindow.cpp" line="197"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="374"/>
|
<location filename="../dialog/centerwindow.cpp" line="378"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="412"/>
|
<location filename="../dialog/centerwindow.cpp" line="416"/>
|
||||||
<source>Add</source>
|
<source>Add</source>
|
||||||
<translation>添加</translation>
|
<translation>添加</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="160"/>
|
<location filename="../dialog/centerwindow.cpp" line="160"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="200"/>
|
<location filename="../dialog/centerwindow.cpp" line="200"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="380"/>
|
<location filename="../dialog/centerwindow.cpp" line="384"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="415"/>
|
<location filename="../dialog/centerwindow.cpp" line="419"/>
|
||||||
<source>Remove</source>
|
<source>Remove</source>
|
||||||
<translation>删除</translation>
|
<translation>删除</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="163"/>
|
<location filename="../dialog/centerwindow.cpp" line="163"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="198"/>
|
<location filename="../dialog/centerwindow.cpp" line="198"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="310"/>
|
<location filename="../dialog/centerwindow.cpp" line="312"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="386"/>
|
<location filename="../dialog/centerwindow.cpp" line="390"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="413"/>
|
<location filename="../dialog/centerwindow.cpp" line="417"/>
|
||||||
<source>Edit</source>
|
<source>Edit</source>
|
||||||
<translation>编辑</translation>
|
<translation>编辑</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="166"/>
|
<location filename="../dialog/centerwindow.cpp" line="166"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="202"/>
|
<location filename="../dialog/centerwindow.cpp" line="202"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="404"/>
|
<location filename="../dialog/centerwindow.cpp" line="408"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="417"/>
|
<location filename="../dialog/centerwindow.cpp" line="421"/>
|
||||||
<source>Clear</source>
|
<source>Clear</source>
|
||||||
<translation>清空</translation>
|
<translation>清空</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -195,7 +195,7 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="265"/>
|
<location filename="../dialog/centerwindow.cpp" line="265"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="287"/>
|
<location filename="../dialog/centerwindow.cpp" line="288"/>
|
||||||
<source>FakeName:</source>
|
<source>FakeName:</source>
|
||||||
<translation>别名:</translation>
|
<translation>别名:</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -206,164 +206,164 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="268"/>
|
<location filename="../dialog/centerwindow.cpp" line="268"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="289"/>
|
<location filename="../dialog/centerwindow.cpp" line="290"/>
|
||||||
<source>Params:</source>
|
<source>Params:</source>
|
||||||
<translation>参数:</translation>
|
<translation>参数:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="282"/>
|
<location filename="../dialog/centerwindow.cpp" line="283"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="291"/>
|
<location filename="../dialog/centerwindow.cpp" line="292"/>
|
||||||
<source>NoTool</source>
|
<source>NoTool</source>
|
||||||
<translation>暂无工具相关信息……</translation>
|
<translation>暂无工具相关信息……</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="286"/>
|
<location filename="../dialog/centerwindow.cpp" line="287"/>
|
||||||
<source>[File]</source>
|
<source>[File]</source>
|
||||||
<translation>【文件】</translation>
|
<translation>【文件】</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="288"/>
|
<location filename="../dialog/centerwindow.cpp" line="289"/>
|
||||||
<source>FileName:</source>
|
<source>FileName:</source>
|
||||||
<translation>文件名:</translation>
|
<translation>文件名:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="324"/>
|
<location filename="../dialog/centerwindow.cpp" line="326"/>
|
||||||
<source>Swap</source>
|
<source>Swap</source>
|
||||||
<translation>交换</translation>
|
<translation>交换</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="352"/>
|
<location filename="../dialog/centerwindow.cpp" line="355"/>
|
||||||
<source>Delete</source>
|
<source>Delete</source>
|
||||||
<translation>删除</translation>
|
<translation>删除</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="392"/>
|
<location filename="../dialog/centerwindow.cpp" line="396"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="419"/>
|
<location filename="../dialog/centerwindow.cpp" line="423"/>
|
||||||
<source>Up</source>
|
<source>Up</source>
|
||||||
<translation>上移</translation>
|
<translation>上移</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="398"/>
|
<location filename="../dialog/centerwindow.cpp" line="402"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="421"/>
|
<location filename="../dialog/centerwindow.cpp" line="425"/>
|
||||||
<source>Down</source>
|
<source>Down</source>
|
||||||
<translation>下移</translation>
|
<translation>下移</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="423"/>
|
<location filename="../dialog/centerwindow.cpp" line="427"/>
|
||||||
<source>TopMost</source>
|
<source>TopMost</source>
|
||||||
<translation>置顶</translation>
|
<translation>置顶</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="456"/>
|
<location filename="../dialog/centerwindow.cpp" line="460"/>
|
||||||
<source>DownMost</source>
|
<source>DownMost</source>
|
||||||
<translation>置底</translation>
|
<translation>置底</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="507"/>
|
<location filename="../dialog/centerwindow.cpp" line="511"/>
|
||||||
<source>ToolBox</source>
|
<source>ToolBox</source>
|
||||||
<translation>工具箱</translation>
|
<translation>工具箱</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="519"/>
|
<location filename="../dialog/centerwindow.cpp" line="523"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="533"/>
|
<location filename="../dialog/centerwindow.cpp" line="538"/>
|
||||||
<source>No selected plugin.</source>
|
<source>No selected plugin.</source>
|
||||||
<translation>没有选择插件,故无法显示插件信息。</translation>
|
<translation>没有选择插件,故无法显示插件信息。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="523"/>
|
<location filename="../dialog/centerwindow.cpp" line="528"/>
|
||||||
<source>PluginCenter</source>
|
<source>PluginCenter</source>
|
||||||
<translation>插件中心</translation>
|
<translation>插件中心</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="540"/>
|
<location filename="../dialog/centerwindow.cpp" line="545"/>
|
||||||
<source>Name:</source>
|
<source>Name:</source>
|
||||||
<translation>名称:</translation>
|
<translation>名称:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="563"/>
|
<location filename="../dialog/centerwindow.cpp" line="569"/>
|
||||||
<source>RegisteredHotkey:</source>
|
<source>RegisteredHotkey:</source>
|
||||||
<translation>注册的热键:</translation>
|
<translation>注册的热键:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="569"/>
|
<location filename="../dialog/centerwindow.cpp" line="575"/>
|
||||||
<source>Plugins</source>
|
<source>Plugins</source>
|
||||||
<translation>插件</translation>
|
<translation>插件</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="588"/>
|
<location filename="../dialog/centerwindow.cpp" line="594"/>
|
||||||
<source>About</source>
|
<source>About</source>
|
||||||
<translation>关于</translation>
|
<translation>关于</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="593"/>
|
<location filename="../dialog/centerwindow.cpp" line="599"/>
|
||||||
<source>ThanksForSponsor</source>
|
<source>ThanksForSponsor</source>
|
||||||
<translation>感谢大家的赞助和支持!</translation>
|
<translation>感谢大家的赞助和支持!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="600"/>
|
<location filename="../dialog/centerwindow.cpp" line="606"/>
|
||||||
<source>Sponsor</source>
|
<source>Sponsor</source>
|
||||||
<translation>赞助</translation>
|
<translation>赞助</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="627"/>
|
<location filename="../dialog/centerwindow.cpp" line="633"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="643"/>
|
<location filename="../dialog/centerwindow.cpp" line="649"/>
|
||||||
<source>runErr</source>
|
<source>runErr</source>
|
||||||
<translation>执行失败</translation>
|
<translation>执行失败</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="648"/>
|
<location filename="../dialog/centerwindow.cpp" line="654"/>
|
||||||
<source>err</source>
|
<source>err</source>
|
||||||
<translation>错误</translation>
|
<translation>错误</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="648"/>
|
<location filename="../dialog/centerwindow.cpp" line="654"/>
|
||||||
<source>openErr</source>
|
<source>openErr</source>
|
||||||
<translation>打开失败!</translation>
|
<translation>打开失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="717"/>
|
<location filename="../dialog/centerwindow.cpp" line="723"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="809"/>
|
<location filename="../dialog/centerwindow.cpp" line="815"/>
|
||||||
<source>ClearSuccess</source>
|
<source>ClearSuccess</source>
|
||||||
<translation>数据清空完毕</translation>
|
<translation>数据清空完毕</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="727"/>
|
<location filename="../dialog/centerwindow.cpp" line="733"/>
|
||||||
<source>HotkeyRegisterFail</source>
|
<source>HotkeyRegisterFail</source>
|
||||||
<translation>注册热键失败!</translation>
|
<translation>注册热键失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="763"/>
|
<location filename="../dialog/centerwindow.cpp" line="769"/>
|
||||||
<source>PleaseSelectOne</source>
|
<source>PleaseSelectOne</source>
|
||||||
<translation>请选择一个项目</translation>
|
<translation>请选择一个项目</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="915"/>
|
<location filename="../dialog/centerwindow.cpp" line="921"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="927"/>
|
<location filename="../dialog/centerwindow.cpp" line="933"/>
|
||||||
<source>Config (*.wtcfg)</source>
|
<source>Config (*.wtcfg)</source>
|
||||||
<translation>羽云工具箱配置文件 (*.wtcfg)</translation>
|
<translation>羽云工具箱配置文件 (*.wtcfg)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="921"/>
|
<location filename="../dialog/centerwindow.cpp" line="927"/>
|
||||||
<source>ExportSuccess</source>
|
<source>ExportSuccess</source>
|
||||||
<translation>导出成功!</translation>
|
<translation>导出成功!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="933"/>
|
<location filename="../dialog/centerwindow.cpp" line="939"/>
|
||||||
<source>ImportSuccess</source>
|
<source>ImportSuccess</source>
|
||||||
<translation>倒入成功!</translation>
|
<translation>倒入成功!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="938"/>
|
<location filename="../dialog/centerwindow.cpp" line="944"/>
|
||||||
<source>Warn</source>
|
<source>Warn</source>
|
||||||
<translation>警告</translation>
|
<translation>警告</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="938"/>
|
<location filename="../dialog/centerwindow.cpp" line="944"/>
|
||||||
<source>ResetSettings</source>
|
<source>ResetSettings</source>
|
||||||
<translation>你将要进行重置操作,原有的将不会保留,你确认吗?</translation>
|
<translation>你将要进行重置操作,原有的将不会保留,你确认吗?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="949"/>
|
<location filename="../dialog/centerwindow.cpp" line="955"/>
|
||||||
<source>[%1] RunErr</source>
|
<source>[%1] RunErr</source>
|
||||||
<translation>【%1】执行失败,具体错误请查看日志</translation>
|
<translation>【%1】执行失败,具体错误请查看日志</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -381,27 +381,27 @@
|
||||||
<translation>请选择一个插件,以显示该插件的信息。</translation>
|
<translation>请选择一个插件,以显示该插件的信息。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="32"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="33"/>
|
||||||
<source>Name:</source>
|
<source>Name:</source>
|
||||||
<translation>名称:</translation>
|
<translation>名称:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="61"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="63"/>
|
||||||
<source>Select</source>
|
<source>Select</source>
|
||||||
<translation>选择</translation>
|
<translation>选择</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="66"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="68"/>
|
||||||
<source>NoSelection</source>
|
<source>NoSelection</source>
|
||||||
<translation>没有选择插件!</translation>
|
<translation>没有选择插件!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="72"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="74"/>
|
||||||
<source>NoPlugin</source>
|
<source>NoPlugin</source>
|
||||||
<translation>无插件</translation>
|
<translation>无插件</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="75"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="77"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation>取消</translation>
|
<translation>取消</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -409,84 +409,90 @@
|
||||||
<context>
|
<context>
|
||||||
<name>PluginSystem</name>
|
<name>PluginSystem</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="150"/>
|
<location filename="../plugin/pluginsystem.cpp" line="148"/>
|
||||||
<source>PluginLoadingBegin : %1</source>
|
<source>PluginLoadingBegin : %1</source>
|
||||||
<translation>开始加载插件:%1</translation>
|
<translation>开始加载插件:%1</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="153"/>
|
<location filename="../plugin/pluginsystem.cpp" line="151"/>
|
||||||
<source>ErrLoadPluginSign</source>
|
<source>ErrLoadPluginSign</source>
|
||||||
<translation>由于插件签名不正确,插件加载失败!</translation>
|
<translation>由于插件签名不正确,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="158"/>
|
<location filename="../plugin/pluginsystem.cpp" line="156"/>
|
||||||
<source>ErrLoadPluginSDKVersion</source>
|
<source>ErrLoadPluginSDKVersion</source>
|
||||||
<translation>由于插件 SDK 版本不匹配,插件加载失败!</translation>
|
<translation>由于插件 SDK 版本不匹配,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="163"/>
|
<location filename="../plugin/pluginsystem.cpp" line="161"/>
|
||||||
<source>ErrLoadPluginNoName</source>
|
<source>ErrLoadPluginNoName</source>
|
||||||
<translation>由于插件没有名称,插件加载失败!</translation>
|
<translation>由于插件没有名称,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="170"/>
|
<location filename="../plugin/pluginsystem.cpp" line="180"/>
|
||||||
|
<source>ErrLoadPreInitPlugin</source>
|
||||||
|
<translation>由于插件预初始化失败,插件加载失败!</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../plugin/pluginsystem.cpp" line="191"/>
|
||||||
<source>ErrLoadPluginNoHandler</source>
|
<source>ErrLoadPluginNoHandler</source>
|
||||||
<translation>由于插件没有服务句柄,插件加载失败!</translation>
|
<translation>由于插件没有服务句柄,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="178"/>
|
<location filename="../plugin/pluginsystem.cpp" line="203"/>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="185"/>
|
<location filename="../plugin/pluginsystem.cpp" line="214"/>
|
||||||
<source>ErrLoadPluginProvider</source>
|
<source>ErrLoadPluginProvider</source>
|
||||||
<translation>由于插件没有提供者,插件加载失败!</translation>
|
<translation>由于插件没有提供者,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="207"/>
|
<location filename="../plugin/pluginsystem.cpp" line="245"/>
|
||||||
<source>[InvaildPlgSrvArg]</source>
|
<source>[InvaildPlgSrvArg]</source>
|
||||||
<translation>【无效的插件服务,参数过多】</translation>
|
<translation>【无效的插件服务,参数过多】</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="219"/>
|
<location filename="../plugin/pluginsystem.cpp" line="257"/>
|
||||||
|
<location filename="../plugin/pluginsystem.cpp" line="273"/>
|
||||||
<source>ErLoadPluginService</source>
|
<source>ErLoadPluginService</source>
|
||||||
<translation>由于插件没有服务,插件加载失败!</translation>
|
<translation>由于插件没有服务,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="228"/>
|
<location filename="../plugin/pluginsystem.cpp" line="287"/>
|
||||||
<source>ErrLoadInitPlugin</source>
|
<source>ErrLoadInitPlugin</source>
|
||||||
<translation>由于插件初始化失败,插件加载失败!</translation>
|
<translation>由于插件初始化失败,插件加载失败!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="250"/>
|
<location filename="../plugin/pluginsystem.cpp" line="317"/>
|
||||||
<source>PluginInitRegister</source>
|
<source>PluginInitRegister</source>
|
||||||
<translation>插件注册开始</translation>
|
<translation>插件注册开始</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="266"/>
|
<location filename="../plugin/pluginsystem.cpp" line="333"/>
|
||||||
<source>InvaildPlgMenu in loading %1</source>
|
<source>InvaildPlgMenu in loading %1</source>
|
||||||
<translation>加载 %1 插件中含有非法注册托盘菜单组件</translation>
|
<translation>加载 %1 插件中含有非法注册托盘菜单组件</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="369"/>
|
<location filename="../plugin/pluginsystem.cpp" line="575"/>
|
||||||
<source>PluginLoaded : %1 %2</source>
|
<source>PluginLoaded : %1 %2</source>
|
||||||
<translation>插件已加载完毕:%1 %2</translation>
|
<translation>插件已加载完毕:%1 %2</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="375"/>
|
<location filename="../plugin/pluginsystem.cpp" line="581"/>
|
||||||
<source>PluginLoadingEx</source>
|
<source>PluginLoadingEx</source>
|
||||||
<translation>加载插件出现异常</translation>
|
<translation>加载插件出现异常</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="497"/>
|
<location filename="../plugin/pluginsystem.cpp" line="684"/>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="505"/>
|
<location filename="../plugin/pluginsystem.cpp" line="692"/>
|
||||||
<source>[remoteCallVaildErr]</source>
|
<source>[remoteCallVaildErr]</source>
|
||||||
<translation>【插件远程调用失败】</translation>
|
<translation>【插件远程调用失败】</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="526"/>
|
<location filename="../plugin/pluginsystem.cpp" line="713"/>
|
||||||
<source>[remoteCallArgErr]</source>
|
<source>[remoteCallArgErr]</source>
|
||||||
<translation>【插件远程调用参数错误】</translation>
|
<translation>【插件远程调用参数错误】</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../plugin/pluginsystem.cpp" line="553"/>
|
<location filename="../plugin/pluginsystem.cpp" line="740"/>
|
||||||
<source>[remoteCallEx]</source>
|
<source>[remoteCallEx]</source>
|
||||||
<translation>【插件远程调用异常】</translation>
|
<translation>【插件远程调用异常】</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -513,95 +519,107 @@
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="273"/>
|
<location filename="../dialog/centerwindow.cpp" line="273"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="544"/>
|
<location filename="../dialog/centerwindow.cpp" line="549"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="36"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="37"/>
|
||||||
<source>Catagory:</source>
|
<source>Catagory:</source>
|
||||||
<translation>分类:</translation>
|
<translation>分类:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="275"/>
|
<location filename="../dialog/centerwindow.cpp" line="275"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="546"/>
|
<location filename="../dialog/centerwindow.cpp" line="551"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="38"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="39"/>
|
||||||
<source>Version:</source>
|
<source>Version:</source>
|
||||||
<translation>版本:</translation>
|
<translation>版本:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="277"/>
|
<location filename="../dialog/centerwindow.cpp" line="277"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="548"/>
|
<location filename="../dialog/centerwindow.cpp" line="553"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="40"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="41"/>
|
||||||
<source>Author:</source>
|
<source>Author:</source>
|
||||||
<translation>作者:</translation>
|
<translation>作者:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="278"/>
|
<location filename="../dialog/centerwindow.cpp" line="278"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="549"/>
|
<location filename="../dialog/centerwindow.cpp" line="554"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="41"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="42"/>
|
||||||
|
<source>Web:</source>
|
||||||
|
<translation>网站:</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../dialog/centerwindow.cpp" line="279"/>
|
||||||
|
<location filename="../dialog/centerwindow.cpp" line="555"/>
|
||||||
|
<location filename="../dialog/pluginseldialog.cpp" line="43"/>
|
||||||
<source>Comment:</source>
|
<source>Comment:</source>
|
||||||
<translation>说明:</translation>
|
<translation>说明:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="279"/>
|
<location filename="../dialog/centerwindow.cpp" line="280"/>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="550"/>
|
<location filename="../dialog/centerwindow.cpp" line="556"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="42"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="44"/>
|
||||||
<source>Provider:</source>
|
<source>Provider:</source>
|
||||||
<translation>提供者:</translation>
|
<translation>提供者:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/centerwindow.cpp" line="552"/>
|
<location filename="../dialog/centerwindow.cpp" line="558"/>
|
||||||
<location filename="../dialog/pluginseldialog.cpp" line="43"/>
|
<location filename="../dialog/pluginseldialog.cpp" line="45"/>
|
||||||
<source>Services:</source>
|
<source>Services:</source>
|
||||||
<translation>服务:</translation>
|
<translation>服务:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="53"/>
|
<location filename="../main.cpp" line="54"/>
|
||||||
<location filename="../main.cpp" line="59"/>
|
<location filename="../main.cpp" line="60"/>
|
||||||
<location filename="../main.cpp" line="169"/>
|
<location filename="../main.cpp" line="176"/>
|
||||||
<source>WingTool</source>
|
<source>WingTool</source>
|
||||||
<translation>羽云工具箱</translation>
|
<translation>羽云工具箱</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="61"/>
|
<location filename="../main.cpp" line="62"/>
|
||||||
<source>A powerful plugin toolbox for Deepin.</source>
|
<source>A powerful plugin toolbox for Deepin.</source>
|
||||||
<translation>一个用于 Deepin 上强大的插件工具箱</translation>
|
<translation>一个用于 Deepin 上强大的插件工具箱</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="131"/>
|
<location filename="../main.cpp" line="132"/>
|
||||||
<source>ErrorLoadingSettings</source>
|
<source>ErrorLoadingSettings</source>
|
||||||
<translation>加载配置失败,将重置配置尝试启动程序!</translation>
|
<translation>加载配置失败,将重置配置尝试启动程序!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="91"/>
|
<location filename="../main.cpp" line="92"/>
|
||||||
<source>ShowMain</source>
|
<source>ShowMain</source>
|
||||||
<translation>显示主窗体</translation>
|
<translation>显示主窗体</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="135"/>
|
<location filename="../main.cpp" line="136"/>
|
||||||
<source>Err</source>
|
<source>Err</source>
|
||||||
<translation>出错啦</translation>
|
<translation>出错啦</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="136"/>
|
<location filename="../main.cpp" line="137"/>
|
||||||
<source>ErrResetSettings</source>
|
<source>ErrResetSettings</source>
|
||||||
<translation>加载的配置文件错误,可能是配置文件损坏或者老版本不支持,现已经存放到桌面上。</translation>
|
<translation>加载的配置文件错误,可能是配置文件损坏或者老版本不支持,现已经存放到桌面上。</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="151"/>
|
<location filename="../main.cpp" line="152"/>
|
||||||
<source>About</source>
|
<source>About</source>
|
||||||
<translation>关于</translation>
|
<translation>关于</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="158"/>
|
<location filename="../main.cpp" line="159"/>
|
||||||
|
<source>Wiki</source>
|
||||||
|
<translation>教程</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../main.cpp" line="165"/>
|
||||||
<source>Sponsor</source>
|
<source>Sponsor</source>
|
||||||
<translation>赞助</translation>
|
<translation>赞助</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="165"/>
|
|
||||||
<location filename="../main.cpp" line="172"/>
|
<location filename="../main.cpp" line="172"/>
|
||||||
|
<location filename="../main.cpp" line="179"/>
|
||||||
<source>Exit</source>
|
<source>Exit</source>
|
||||||
<translation>退出</translation>
|
<translation>退出</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../main.cpp" line="173"/>
|
<location filename="../main.cpp" line="180"/>
|
||||||
<source>ConfirmExit</source>
|
<source>ConfirmExit</source>
|
||||||
<translation>你确认继续关闭该程序吗?</translation>
|
<translation>你确认继续关闭该程序吗?</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -636,7 +654,7 @@
|
||||||
<translation>创造力</translation>
|
<translation>创造力</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../utilities.h" line="125"/>
|
<location filename="../utilities.h" line="115"/>
|
||||||
<source>FakeName:%1
|
<source>FakeName:%1
|
||||||
Process:%2
|
Process:%2
|
||||||
Service:%3
|
Service:%3
|
||||||
|
@ -647,7 +665,7 @@ Params:%4</source>
|
||||||
参数:%4</translation>
|
参数:%4</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../utilities.h" line="131"/>
|
<location filename="../utilities.h" line="121"/>
|
||||||
<source>FakeName:%1
|
<source>FakeName:%1
|
||||||
Process:%2
|
Process:%2
|
||||||
Params:%3</source>
|
Params:%3</source>
|
||||||
|
@ -666,12 +684,12 @@ Params:%3</source>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/rundialog.cpp" line="9"/>
|
<location filename="../dialog/rundialog.cpp" line="9"/>
|
||||||
<source>Plugin</source>
|
<source>Plugin</source>
|
||||||
<translation>插件插件</translation>
|
<translation>插件</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/rundialog.cpp" line="21"/>
|
<location filename="../dialog/rundialog.cpp" line="21"/>
|
||||||
<source>Service</source>
|
<source>Service</source>
|
||||||
<translation>服务服务</translation>
|
<translation>服务</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/rundialog.cpp" line="31"/>
|
<location filename="../dialog/rundialog.cpp" line="31"/>
|
||||||
|
@ -734,7 +752,12 @@ Params:%3</source>
|
||||||
<translation>没有设置热键</translation>
|
<translation>没有设置热键</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/shortcuteditdialog.cpp" line="130"/>
|
<location filename="../dialog/shortcuteditdialog.cpp" line="119"/>
|
||||||
|
<source>HotkeyRegistered</source>
|
||||||
|
<translation>此热键已被注册,请更换!</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="../dialog/shortcuteditdialog.cpp" line="136"/>
|
||||||
<source>NoProcessSet</source>
|
<source>NoProcessSet</source>
|
||||||
<translation>没有设置进程</translation>
|
<translation>没有设置进程</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -781,13 +804,13 @@ Params:%3</source>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="26"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="26"/>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="88"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="67"/>
|
||||||
<source>Service</source>
|
<source>Service</source>
|
||||||
<translation>服务</translation>
|
<translation>服务</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="32"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="32"/>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="88"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="67"/>
|
||||||
<source>FilePath</source>
|
<source>FilePath</source>
|
||||||
<translation>文件路径</translation>
|
<translation>文件路径</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -802,32 +825,27 @@ Params:%3</source>
|
||||||
<translation>图像 (*.png *.svg *.jpg *.jpeg)</translation>
|
<translation>图像 (*.png *.svg *.jpg *.jpeg)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="71"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="99"/>
|
||||||
<source>InvalidIcon</source>
|
|
||||||
<translation>无效图标!</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="120"/>
|
|
||||||
<source>Param</source>
|
<source>Param</source>
|
||||||
<translation>参数</translation>
|
<translation>参数</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="126"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="105"/>
|
||||||
<source>FakeName</source>
|
<source>FakeName</source>
|
||||||
<translation>别名</translation>
|
<translation>别名</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="135"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="114"/>
|
||||||
<source>IconPreview</source>
|
<source>IconPreview</source>
|
||||||
<translation>图标预览</translation>
|
<translation>图标预览</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="159"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="140"/>
|
||||||
<source>NoVaildIconSet</source>
|
<source>NoVaildIconSet</source>
|
||||||
<translation>没有有效的图标设置!</translation>
|
<translation>没有有效的图标设置!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../dialog/tooleditdialog.cpp" line="177"/>
|
<location filename="../dialog/tooleditdialog.cpp" line="157"/>
|
||||||
<source>NoVaildProcessSet</source>
|
<source>NoVaildProcessSet</source>
|
||||||
<translation>没有有效的进程设置!</translation>
|
<translation>没有有效的进程设置!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
|
7
main.cpp
7
main.cpp
|
@ -8,6 +8,7 @@
|
||||||
#include <DApplicationSettings>
|
#include <DApplicationSettings>
|
||||||
#include <DGuiApplicationHelper>
|
#include <DGuiApplicationHelper>
|
||||||
#include <DWidgetUtil>
|
#include <DWidgetUtil>
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
|
@ -155,6 +156,12 @@ int main(int argc, char *argv[]) {
|
||||||
w.raise();
|
w.raise();
|
||||||
});
|
});
|
||||||
sysmenu.addAction(ac);
|
sysmenu.addAction(ac);
|
||||||
|
ac = new QAction(QObject::tr("Wiki"), menu);
|
||||||
|
QObject::connect(ac, &QAction::triggered, [=] {
|
||||||
|
QDesktopServices::openUrl(QUrl("https://code.gitlink.org.cn/wingsummer/"
|
||||||
|
"WingTool/wiki/%E7%AE%80%E4%BB%8B"));
|
||||||
|
});
|
||||||
|
sysmenu.addAction(ac);
|
||||||
ac = new QAction(QObject::tr("Sponsor"), menu);
|
ac = new QAction(QObject::tr("Sponsor"), menu);
|
||||||
QObject::connect(ac, &QAction::triggered, [&w] {
|
QObject::connect(ac, &QAction::triggered, [&w] {
|
||||||
w.show(CenterWindow::TabPage::Sponsor);
|
w.show(CenterWindow::TabPage::Sponsor);
|
||||||
|
|
|
@ -17,36 +17,24 @@
|
||||||
|
|
||||||
#define WINGSUMMER "wingsummer"
|
#define WINGSUMMER "wingsummer"
|
||||||
|
|
||||||
#define LoadingPluginMsg QVariant::fromValue('l')
|
|
||||||
#define LoadedPluginMsg QVariant::fromValue('L')
|
|
||||||
|
|
||||||
#ifndef Q_MOC_RUN
|
#ifndef Q_MOC_RUN
|
||||||
#define PLUGINSRV
|
#define PLUGINSRV
|
||||||
|
#define PLUGININT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PLUGINSRVTAG "PLUGINSRV"
|
#define PLUGINSRVTAG "PLUGINSRV"
|
||||||
|
#define PLUGININTTAG "PLUGININT"
|
||||||
|
|
||||||
/*=================================*/
|
/*=================================*/
|
||||||
|
|
||||||
// 插件系统预定义服务号,全部为负数
|
// 插件系统预定义服务号,全部为负数
|
||||||
// 如果服务号为非负数,则表示为插件服务
|
// 如果服务号为非负数,则表示为插件服务
|
||||||
|
|
||||||
#define HostService -1 // 插件加载消息服务
|
#define PLUGINLOADING -1 // 插件加载中消息
|
||||||
#define RemoteCallRes -2 // 远程调用结果服务
|
#define PLUGINLOADED -2 // 插件加载完消息
|
||||||
#define HotKeyTriggered -3 // 热键触发服务
|
|
||||||
#define HotKeyReleased -4 //热键释放服务
|
|
||||||
#define HotkeyEnableChanged -5 // 热键状态更改服务
|
|
||||||
|
|
||||||
/*=================================*/
|
/*=================================*/
|
||||||
|
|
||||||
struct WingPluginInfo {
|
|
||||||
QString pluginName;
|
|
||||||
QString pluginAuthor;
|
|
||||||
uint pluginVersion;
|
|
||||||
QString provider;
|
|
||||||
QString pluginComment;
|
|
||||||
};
|
|
||||||
|
|
||||||
enum class MouseWheelEvent { None, Up, Down, Left, Right };
|
enum class MouseWheelEvent { None, Up, Down, Left, Right };
|
||||||
Q_DECLARE_METATYPE(MouseWheelEvent)
|
Q_DECLARE_METATYPE(MouseWheelEvent)
|
||||||
|
|
||||||
|
@ -57,7 +45,8 @@ enum class RemoteCallError {
|
||||||
Unkown, // 回调未知错误,通常由于未处理异常导致
|
Unkown, // 回调未知错误,通常由于未处理异常导致
|
||||||
PluginNotFound, // 找不到的插件
|
PluginNotFound, // 找不到的插件
|
||||||
ServiceNotFound, // 找到插件,但没有找到对应的服务
|
ServiceNotFound, // 找到插件,但没有找到对应的服务
|
||||||
ArgError // 调用的参数出现问题
|
ArgError, // 调用的参数出现问题
|
||||||
|
MessageIDError // 发送消息的 ID 错误,基本发送了小于 0 的消息
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(RemoteCallError)
|
Q_DECLARE_METATYPE(RemoteCallError)
|
||||||
|
|
||||||
|
@ -75,6 +64,8 @@ enum HookIndex {
|
||||||
};
|
};
|
||||||
Q_DECLARE_METATYPE(HookIndex)
|
Q_DECLARE_METATYPE(HookIndex)
|
||||||
|
|
||||||
|
struct WingPluginInfo;
|
||||||
|
|
||||||
class IWingToolPlg : public QObject {
|
class IWingToolPlg : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -96,8 +87,11 @@ public:
|
||||||
virtual QString signature() = 0;
|
virtual QString signature() = 0;
|
||||||
// 析构函数
|
// 析构函数
|
||||||
virtual ~IWingToolPlg() {}
|
virtual ~IWingToolPlg() {}
|
||||||
|
// 插件预初始化,主要初始化服务以备正式初始化使用,可选
|
||||||
// 插件初始化函数
|
// 如果预初始化失败,则插件会被卸载
|
||||||
|
// 注:如果提供翻译文件名,此时就已经被加载
|
||||||
|
virtual bool preInit() { return true; }
|
||||||
|
// 插件初始化函数,如果初始化失败,则插件会被卸载
|
||||||
virtual bool init(QList<WingPluginInfo> loadedplugin) = 0;
|
virtual bool init(QList<WingPluginInfo> loadedplugin) = 0;
|
||||||
// 插件卸载函数
|
// 插件卸载函数
|
||||||
virtual void unload() = 0;
|
virtual void unload() = 0;
|
||||||
|
@ -125,9 +119,12 @@ public:
|
||||||
// 但非必要不要弄,因为这样的插件多了,反而麻烦了,一个插件仅有一项
|
// 但非必要不要弄,因为这样的插件多了,反而麻烦了,一个插件仅有一项
|
||||||
// 类型仅支持 QMenu* 或者 QAction* 否则不载入
|
// 类型仅支持 QMenu* 或者 QAction* 否则不载入
|
||||||
virtual QObject *trayRegisteredMenu() { return nullptr; }
|
virtual QObject *trayRegisteredMenu() { return nullptr; }
|
||||||
|
// 插件的语言包文件名,如果空插件系统默认不加载
|
||||||
|
// 如果有需要还请手动加载
|
||||||
|
virtual QString translatorFile() { return QString(); }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
// 注册热键,如果被占用则返回 -1 表示失败(通常是重复),
|
// 注册热键,如果被占用则返回空表示失败(通常是重复),
|
||||||
// 大于等于 0 则表示成功,返回句柄
|
// 大于等于 0 则表示成功,返回句柄
|
||||||
QUuid registerHotkey(QKeySequence keyseq);
|
QUuid registerHotkey(QKeySequence keyseq);
|
||||||
|
|
||||||
|
@ -150,6 +147,41 @@ signals:
|
||||||
QVariant sendRemoteMessage(const QString provider, int id,
|
QVariant sendRemoteMessage(const QString provider, int id,
|
||||||
QList<QVariant> params, RemoteCallError &err);
|
QList<QVariant> params, RemoteCallError &err);
|
||||||
|
|
||||||
|
// 查询某个插件是否存在
|
||||||
|
bool isProviderExists(const QString provider);
|
||||||
|
|
||||||
|
// 查询某个插件服务是否含有所述服务
|
||||||
|
bool isServiceExists(const QString provider, const QString callback);
|
||||||
|
|
||||||
|
// 查询某个插件服务是否接口
|
||||||
|
bool isInterfaceExists(const QString provider, const QString callback);
|
||||||
|
|
||||||
|
// 获取服务的参数类型
|
||||||
|
QList<int> getServiceParamTypes(const QString provider,
|
||||||
|
const QString callback);
|
||||||
|
|
||||||
|
// 获取接口的参数类型
|
||||||
|
QVector<QList<int>> getInterfaceParamTypes(const QString provider,
|
||||||
|
const QString callback);
|
||||||
|
|
||||||
|
// 获取全局按下的修饰键序列
|
||||||
|
Qt::KeyboardModifiers getPressedKeyModifiers();
|
||||||
|
|
||||||
|
// 获取全局按下的鼠标按键序列
|
||||||
|
Qt::MouseButtons getPressedMouseButtons();
|
||||||
|
|
||||||
|
// 获取所有插件提供者名称
|
||||||
|
QStringList getPluginProviders();
|
||||||
|
|
||||||
|
// 获取插件信息
|
||||||
|
WingPluginInfo getPluginInfo(const QString provider);
|
||||||
|
|
||||||
|
// 获取插件的所有服务名,isTr 指示是否使用本地化的
|
||||||
|
QStringList getPluginServices(const QString provider, bool isTr = false);
|
||||||
|
|
||||||
|
// 获取所有插件的所有接口名(注:无去重,可能有重复项)
|
||||||
|
QStringList getPluginInterfaces(const QString provider);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// 宿主开始回调函数时候使用,第一个参数是函数服务索引,第二个是参数集合
|
// 宿主开始回调函数时候使用,第一个参数是函数服务索引,第二个是参数集合
|
||||||
virtual QVariant pluginServicePipe(int serviceID, QList<QVariant> params) = 0;
|
virtual QVariant pluginServicePipe(int serviceID, QList<QVariant> params) = 0;
|
||||||
|
@ -202,22 +234,29 @@ public slots:
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当插件注册的热键触发时会触发该函数
|
// 当插件注册的热键触发时会触发该函数
|
||||||
virtual void hotkeyTirggered(int index) { Q_UNUSED(index); }
|
virtual void hotkeyTirggered(QUuid id) { Q_UNUSED(id); }
|
||||||
// 如果插件注册的热键被释放时会触发该函数
|
// 如果插件注册的热键被释放时会触发该函数
|
||||||
virtual void hotkeyReleased(int index) { Q_UNUSED(index); }
|
virtual void hotkeyReleased(QUuid id) { Q_UNUSED(id); }
|
||||||
// 如果插件注册的热键启用状态改变时会触发该函数
|
// 如果插件注册的热键启用状态改变时会触发该函数
|
||||||
virtual void hotkeyEnableChanged(bool value, int index) {
|
virtual void hotkeyEnableChanged(bool value, QUuid id) {
|
||||||
Q_UNUSED(value);
|
Q_UNUSED(value);
|
||||||
Q_UNUSED(index);
|
Q_UNUSED(id);
|
||||||
}
|
|
||||||
|
|
||||||
// 当系统选词更改时触发该函数(仅 X11 有效,Deepin 支持)
|
|
||||||
virtual void selectionTextChanged(const QString &selectedText) {
|
|
||||||
Q_UNUSED(selectedText);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IWINGPLUGIN_INTERFACE_IID "com.wingsummer.iwingtoolplg"
|
#define IWINGPLUGIN_INTERFACE_IID "com.wingsummer.iwingtoolplg"
|
||||||
Q_DECLARE_INTERFACE(IWingToolPlg, IWINGPLUGIN_INTERFACE_IID)
|
Q_DECLARE_INTERFACE(IWingToolPlg, IWINGPLUGIN_INTERFACE_IID)
|
||||||
|
|
||||||
|
struct WingPluginInfo {
|
||||||
|
QString pluginName;
|
||||||
|
QString pluginAuthor;
|
||||||
|
IWingToolPlg::Catagorys pluginCatagory;
|
||||||
|
uint pluginVersion;
|
||||||
|
QString provider;
|
||||||
|
QString pluginComment;
|
||||||
|
QString pluginWebsite;
|
||||||
|
HookIndex HookSubscribe;
|
||||||
|
QString translatorFile;
|
||||||
|
};
|
||||||
|
|
||||||
#endif // IWINGTOOLPLG_H
|
#endif // IWINGTOOLPLG_H
|
||||||
|
|
|
@ -19,6 +19,8 @@ PluginSystem::PluginSystem(QMenu *systray, QObject *parent)
|
||||||
InitDispathcer(HookIndex::MouseWheel);
|
InitDispathcer(HookIndex::MouseWheel);
|
||||||
InitDispathcer(HookIndex::DoubleClicked);
|
InitDispathcer(HookIndex::DoubleClicked);
|
||||||
InitDispathcer(HookIndex::MouseDrag);
|
InitDispathcer(HookIndex::MouseDrag);
|
||||||
|
InitDispathcer(HookIndex::ButtonPress);
|
||||||
|
InitDispathcer(HookIndex::ButtonRelease);
|
||||||
|
|
||||||
// 初始化类别插件容器
|
// 初始化类别插件容器
|
||||||
#define InitCatagory(catagory) \
|
#define InitCatagory(catagory) \
|
||||||
|
@ -74,14 +76,12 @@ PluginSystem::PluginSystem(QMenu *systray, QObject *parent)
|
||||||
[=](const Hotkey *hotkey) {
|
[=](const Hotkey *hotkey) {
|
||||||
if (hotkey->isHostHotkey())
|
if (hotkey->isHostHotkey())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
||||||
if (uuid.isNull())
|
if (uuid.isNull())
|
||||||
return;
|
return;
|
||||||
int id;
|
auto plg = this->loopUpHotkey(uuid);
|
||||||
auto plg = this->loopUpHotkey(uuid, id);
|
|
||||||
if (plg)
|
if (plg)
|
||||||
plg->pluginServicePipe(HotKeyTriggered, {uuid});
|
plg->hotkeyTirggered(uuid);
|
||||||
});
|
});
|
||||||
connect(manager, &AppManager::hotkeyReleased, this,
|
connect(manager, &AppManager::hotkeyReleased, this,
|
||||||
[=](const Hotkey *hotkey) {
|
[=](const Hotkey *hotkey) {
|
||||||
|
@ -91,23 +91,20 @@ PluginSystem::PluginSystem(QMenu *systray, QObject *parent)
|
||||||
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
||||||
if (uuid.isNull())
|
if (uuid.isNull())
|
||||||
return;
|
return;
|
||||||
int id;
|
auto plg = this->loopUpHotkey(uuid);
|
||||||
auto plg = this->loopUpHotkey(uuid, id);
|
|
||||||
if (plg)
|
if (plg)
|
||||||
plg->pluginServicePipe(HotKeyReleased, {uuid});
|
plg->hotkeyReleased(uuid);
|
||||||
});
|
});
|
||||||
connect(manager, &AppManager::hotkeyEnableChanged, this,
|
connect(manager, &AppManager::hotkeyEnableChanged, this,
|
||||||
[=](bool value, const Hotkey *hotkey) {
|
[=](bool value, const Hotkey *hotkey) {
|
||||||
if (hotkey->isHostHotkey())
|
if (hotkey->isHostHotkey())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
auto uuid = uhmap.key(const_cast<Hotkey *>(hotkey), QUuid());
|
||||||
if (uuid.isNull())
|
if (uuid.isNull())
|
||||||
return;
|
return;
|
||||||
int id;
|
auto plg = this->loopUpHotkey(uuid);
|
||||||
auto plg = this->loopUpHotkey(uuid, id);
|
|
||||||
if (plg)
|
if (plg)
|
||||||
plg->pluginServicePipe(HotkeyEnableChanged, {value, uuid});
|
plg->hotkeyEnableChanged(value, uuid);
|
||||||
});
|
});
|
||||||
|
|
||||||
LoadPlugin();
|
LoadPlugin();
|
||||||
|
@ -144,6 +141,7 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
QPluginLoader loader(fileinfo.absoluteFilePath());
|
QPluginLoader loader(fileinfo.absoluteFilePath());
|
||||||
QList<WingPluginInfo> loadedplginfos;
|
QList<WingPluginInfo> loadedplginfos;
|
||||||
QList<QVariant> emptyparam;
|
QList<QVariant> emptyparam;
|
||||||
|
QTranslator *translator = nullptr;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auto p = qobject_cast<IWingToolPlg *>(loader.instance());
|
auto p = qobject_cast<IWingToolPlg *>(loader.instance());
|
||||||
|
@ -165,10 +163,37 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto trans = p->translatorFile();
|
||||||
|
if (trans.length()) {
|
||||||
|
translator = new QTranslator(this);
|
||||||
|
auto s = GETPLUGINQM(trans);
|
||||||
|
if (!translator->load(s) ||
|
||||||
|
!QApplication::installTranslator(translator)) {
|
||||||
|
dError(QString("Error Loading translatorFile in %1")
|
||||||
|
.arg(p->pluginName()));
|
||||||
|
translator->deleteLater();
|
||||||
|
translator = nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!p->preInit()) {
|
||||||
|
dError(tr("ErrLoadPreInitPlugin"));
|
||||||
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto handler = p->serviceHandler();
|
auto handler = p->serviceHandler();
|
||||||
if (handler.isNull()) {
|
if (handler.isNull()) {
|
||||||
dError(tr("ErrLoadPluginNoHandler"));
|
dError(tr("ErrLoadPluginNoHandler"));
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,6 +202,10 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
if (clsname == nullptr) {
|
if (clsname == nullptr) {
|
||||||
dError(tr("ErrLoadPluginProvider"));
|
dError(tr("ErrLoadPluginProvider"));
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,6 +213,10 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
if (provider.isEmpty() || loadedProvider.contains(provider)) {
|
if (provider.isEmpty() || loadedProvider.contains(provider)) {
|
||||||
dError(tr("ErrLoadPluginProvider"));
|
dError(tr("ErrLoadPluginProvider"));
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,14 +228,17 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
|
|
||||||
// 暂时缓存一下原函数名称和参数个数,供之后的函数名本地化之用
|
// 暂时缓存一下原函数名称和参数个数,供之后的函数名本地化之用
|
||||||
QVector<const char *> tmpfunc;
|
QVector<const char *> tmpfunc;
|
||||||
QVector<int> tmpfuncargc;
|
|
||||||
|
|
||||||
for (auto i = 0; i < srvc; i++) {
|
for (auto i = 0; i < srvc; i++) {
|
||||||
auto m = meta->method(i);
|
auto m = meta->method(i);
|
||||||
|
|
||||||
|
bool isinterface = false;
|
||||||
if (strcmp(PLUGINSRVTAG, m.tag())) {
|
if (strcmp(PLUGINSRVTAG, m.tag())) {
|
||||||
|
if (strcmp(PLUGININTTAG, m.tag())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
isinterface = true;
|
||||||
|
}
|
||||||
|
|
||||||
auto argc = m.parameterCount();
|
auto argc = m.parameterCount();
|
||||||
if (argc > 10) {
|
if (argc > 10) {
|
||||||
|
@ -210,34 +246,57 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
QString("%1/10").arg(m.parameterCount()));
|
QString("%1/10").arg(m.parameterCount()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tmpfuncargc.append(argc);
|
|
||||||
|
|
||||||
|
if (isinterface) {
|
||||||
|
record.interfaces.append(m);
|
||||||
|
auto name = QString::fromUtf8(m.name());
|
||||||
|
record.interfaceNames.append(name);
|
||||||
|
} else {
|
||||||
|
auto name = QString::fromUtf8(m.name());
|
||||||
|
if (record.serviceNames.contains(name)) {
|
||||||
|
dError(tr("ErLoadPluginService"));
|
||||||
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
record.services.append(m);
|
record.services.append(m);
|
||||||
tmpfunc.append(m.name());
|
tmpfunc.append(m.name());
|
||||||
auto name = QString::fromUtf8(m.name());
|
|
||||||
record.serviceNames.append(name);
|
record.serviceNames.append(name);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (record.services.isEmpty()) {
|
if (record.services.isEmpty()) {
|
||||||
dError(tr("ErLoadPluginService"));
|
dError(tr("ErLoadPluginService"));
|
||||||
|
p->unload();
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查完毕后,就可以进入真正的加载环节
|
// 检查完毕后,就可以进入真正的加载环节
|
||||||
emit p->pluginServicePipe(HostService, {LoadingPluginMsg});
|
emit p->pluginServicePipe(PLUGINLOADING, emptyparam);
|
||||||
|
|
||||||
if (!p->init(loadedplginfos)) {
|
if (!p->init(loadedplginfos)) {
|
||||||
dError(tr("ErrLoadInitPlugin"));
|
dError(tr("ErrLoadInitPlugin"));
|
||||||
|
p->unload();
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto len = tmpfunc.count();
|
for (auto item : tmpfunc) {
|
||||||
for (auto i = 0; i < len; i++) {
|
|
||||||
record.servicetrNames.append(
|
record.servicetrNames.append(
|
||||||
QCoreApplication::translate(clsname, tmpfunc[i]) +
|
QCoreApplication::translate(clsname, item));
|
||||||
QString(" [%1]").arg(tmpfuncargc[i]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WingPluginInfo info;
|
WingPluginInfo info;
|
||||||
|
@ -246,12 +305,16 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
info.pluginAuthor = p->pluginAuthor();
|
info.pluginAuthor = p->pluginAuthor();
|
||||||
info.pluginComment = p->pluginComment();
|
info.pluginComment = p->pluginComment();
|
||||||
info.pluginVersion = p->pluginVersion();
|
info.pluginVersion = p->pluginVersion();
|
||||||
|
info.pluginWebsite = p->pluginWebsite();
|
||||||
|
info.HookSubscribe = p->getHookSubscribe();
|
||||||
|
info.pluginCatagory = p->pluginCatagory();
|
||||||
|
info.translatorFile = p->translatorFile();
|
||||||
|
|
||||||
loadedplginfos << info;
|
loadedplginfos << info;
|
||||||
m_plgs << p;
|
m_plgs << p;
|
||||||
loadedProvider << provider;
|
loadedProvider << provider;
|
||||||
|
|
||||||
dWarning(tr("PluginInitRegister"));
|
dInfo(tr("PluginInitRegister"));
|
||||||
|
|
||||||
// 看看有没有要注册的托盘
|
// 看看有没有要注册的托盘
|
||||||
|
|
||||||
|
@ -288,6 +351,8 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
INSERTSUBSCRIBE(HookIndex::MouseWheel);
|
INSERTSUBSCRIBE(HookIndex::MouseWheel);
|
||||||
INSERTSUBSCRIBE(HookIndex::DoubleClicked);
|
INSERTSUBSCRIBE(HookIndex::DoubleClicked);
|
||||||
INSERTSUBSCRIBE(HookIndex::MouseDrag);
|
INSERTSUBSCRIBE(HookIndex::MouseDrag);
|
||||||
|
INSERTSUBSCRIBE(HookIndex::ButtonPress);
|
||||||
|
INSERTSUBSCRIBE(HookIndex::ButtonRelease);
|
||||||
|
|
||||||
// 连接信号
|
// 连接信号
|
||||||
connect(p, &IWingToolPlg::registerHotkey, this,
|
connect(p, &IWingToolPlg::registerHotkey, this,
|
||||||
|
@ -375,6 +440,10 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
connect(p, &IWingToolPlg::sendRemoteMessage, this,
|
connect(p, &IWingToolPlg::sendRemoteMessage, this,
|
||||||
[=](const QString provider, int id, QList<QVariant> params,
|
[=](const QString provider, int id, QList<QVariant> params,
|
||||||
RemoteCallError &err) {
|
RemoteCallError &err) {
|
||||||
|
if (id < 0) {
|
||||||
|
err = RemoteCallError::MessageIDError;
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
auto sender = qobject_cast<IWingToolPlg *>(QObject::sender());
|
auto sender = qobject_cast<IWingToolPlg *>(QObject::sender());
|
||||||
if (sender == nullptr) {
|
if (sender == nullptr) {
|
||||||
err = RemoteCallError::Unkown;
|
err = RemoteCallError::Unkown;
|
||||||
|
@ -394,8 +463,115 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
err = RemoteCallError::Success;
|
err = RemoteCallError::Success;
|
||||||
return res;
|
return res;
|
||||||
});
|
});
|
||||||
|
connect(p, &IWingToolPlg::isProviderExists, this,
|
||||||
|
[=](const QString provider) {
|
||||||
|
return loadedProvider.contains(provider);
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::isServiceExists, this,
|
||||||
|
[=](const QString provider, const QString callback) {
|
||||||
|
if (callback.trimmed().isEmpty())
|
||||||
|
return false;
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
if (plg == nullptr)
|
||||||
|
return false;
|
||||||
|
return m_plgrec[plg].serviceNames.contains(callback);
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::isInterfaceExists, this,
|
||||||
|
[=](const QString provider, const QString callback) {
|
||||||
|
if (callback.trimmed().isEmpty())
|
||||||
|
return false;
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
if (plg == nullptr)
|
||||||
|
return false;
|
||||||
|
return m_plgrec[plg].interfaceNames.contains(callback);
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::getServiceParamTypes, this,
|
||||||
|
[=](const QString provider, const QString callback) {
|
||||||
|
auto res = QList<int>();
|
||||||
|
if (callback.trimmed().isEmpty())
|
||||||
|
return res;
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
if (plg == nullptr)
|
||||||
|
return res;
|
||||||
|
auto &rec = m_plgrec[plg];
|
||||||
|
auto &srvs = rec.serviceNames;
|
||||||
|
int id = srvs.indexOf(callback);
|
||||||
|
if (id < 0)
|
||||||
|
return res;
|
||||||
|
auto m = rec.services[id];
|
||||||
|
auto len = m.parameterCount();
|
||||||
|
for (auto i = 0; i < len; i++) {
|
||||||
|
res.append(m.parameterType(i));
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::getInterfaceParamTypes, this,
|
||||||
|
[=](const QString provider, const QString callback) {
|
||||||
|
auto res = QVector<QList<int>>();
|
||||||
|
if (callback.trimmed().isEmpty())
|
||||||
|
return res;
|
||||||
|
auto index = this->pluginIndexByProvider(provider);
|
||||||
|
if (index < 0)
|
||||||
|
return res;
|
||||||
|
auto &rec = m_plgrec[m_plgs[index]];
|
||||||
|
auto &srvs = rec.interfaceNames;
|
||||||
|
int id = 0;
|
||||||
|
for (;; id++) {
|
||||||
|
id = srvs.indexOf(callback, id);
|
||||||
|
if (id < 0)
|
||||||
|
return res;
|
||||||
|
|
||||||
emit p->pluginServicePipe(HostService, {LoadedPluginMsg});
|
QList<int> infos;
|
||||||
|
auto m = rec.interfaces[id];
|
||||||
|
auto len = m.parameterCount();
|
||||||
|
for (auto i = 0; i < len; i++) {
|
||||||
|
infos.append(m.parameterType(i));
|
||||||
|
}
|
||||||
|
res.append(infos);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::getPressedKeyModifiers, this,
|
||||||
|
[=] { return this->manager->getKeyModifiers(); });
|
||||||
|
connect(p, &IWingToolPlg::getPressedMouseButtons, this,
|
||||||
|
[=] { return this->manager->getMouseButtons(); });
|
||||||
|
connect(p, &IWingToolPlg::getPluginProviders, this,
|
||||||
|
[=] { return loadedProvider; });
|
||||||
|
connect(p, &IWingToolPlg::getPluginInfo, this,
|
||||||
|
[=](const QString provider) {
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
WingPluginInfo info{};
|
||||||
|
if (plg) {
|
||||||
|
info.provider = provider;
|
||||||
|
info.pluginName = plg->pluginName();
|
||||||
|
info.pluginAuthor = plg->pluginAuthor();
|
||||||
|
info.pluginComment = plg->pluginComment();
|
||||||
|
info.pluginVersion = plg->pluginVersion();
|
||||||
|
info.pluginWebsite = plg->pluginWebsite();
|
||||||
|
info.HookSubscribe = plg->getHookSubscribe();
|
||||||
|
info.pluginCatagory = plg->pluginCatagory();
|
||||||
|
info.translatorFile = plg->translatorFile();
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::getPluginServices, this,
|
||||||
|
[=](const QString provider, bool isTr) {
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
if (plg) {
|
||||||
|
return isTr ? this->pluginServicetrNames(plg)
|
||||||
|
: this->pluginServiceNames(plg);
|
||||||
|
}
|
||||||
|
return QStringList();
|
||||||
|
});
|
||||||
|
connect(p, &IWingToolPlg::getPluginInterfaces, this,
|
||||||
|
[=](const QString provider) {
|
||||||
|
auto plg = plugin(pluginIndexByProvider(provider));
|
||||||
|
if (plg) {
|
||||||
|
return m_plgrec[plg].interfaceNames;
|
||||||
|
}
|
||||||
|
return QStringList();
|
||||||
|
});
|
||||||
|
|
||||||
|
emit p->pluginServicePipe(PLUGINLOADED, emptyparam);
|
||||||
dInfo(tr("PluginLoaded : %1 %2").arg(p->pluginName()).arg(provider));
|
dInfo(tr("PluginLoaded : %1 %2").arg(p->pluginName()).arg(provider));
|
||||||
} else {
|
} else {
|
||||||
dError(loader.errorString());
|
dError(loader.errorString());
|
||||||
|
@ -404,6 +580,10 @@ void PluginSystem::loadPlugin(QFileInfo fileinfo) {
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
dError(tr("PluginLoadingEx"));
|
dError(tr("PluginLoadingEx"));
|
||||||
loader.unload();
|
loader.unload();
|
||||||
|
if (translator) {
|
||||||
|
QApplication::removeTranslator(translator);
|
||||||
|
translator->deleteLater();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -469,57 +649,36 @@ QString PluginSystem::pluginProvider(IWingToolPlg *plg) {
|
||||||
|
|
||||||
bool PluginSystem::hasRegisteredMenu() { return plgmenuCount > 0; }
|
bool PluginSystem::hasRegisteredMenu() { return plgmenuCount > 0; }
|
||||||
|
|
||||||
IWingToolPlg *PluginSystem::loopUpHotkey(QUuid uuid, int &index) {
|
IWingToolPlg *PluginSystem::loopUpHotkey(QUuid uuid) {
|
||||||
for (auto plg : m_plgs) {
|
for (auto plg : m_plgs) {
|
||||||
auto res = m_plgrec[plg].hotkeyuid.indexOf(uuid);
|
auto res = m_plgrec[plg].hotkeyuid.contains(uuid);
|
||||||
if (res >= 0) {
|
if (res)
|
||||||
index = res;
|
|
||||||
return plg;
|
return plg;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PluginSystem::remoteCall(IWingToolPlg *plg, QString &callback,
|
int PluginSystem::remoteCall(IWingToolPlg *plg, QString &callback,
|
||||||
QVector<QVariant> params, QVariant &ret) {
|
QVector<QVariant> params, QVariant &ret) {
|
||||||
// 开始查询有没有对应的函数
|
|
||||||
auto &srvn = m_plgrec[plg].serviceNames;
|
|
||||||
auto id = 0;
|
|
||||||
auto &srv = m_plgrec[plg].services;
|
|
||||||
|
|
||||||
for (;; id++) {
|
|
||||||
id = srvn.indexOf(callback, id);
|
|
||||||
if (id < 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 先检查一下参数个数
|
|
||||||
auto &m = srv[id];
|
|
||||||
if (params.count() != m.parameterCount()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查类型是否合格
|
|
||||||
auto len = params.count();
|
|
||||||
bool invalid = false;
|
|
||||||
for (auto i = 0; i < len; i++) {
|
|
||||||
if (!params[i].canConvert(m.parameterType(i))) {
|
|
||||||
invalid = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (invalid)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
return remoteCall(plg, id, params, ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
auto id = getCallID(plg, callback, params, false); // 先检查服务有没有
|
||||||
|
if (!id) {
|
||||||
|
// 再检查非隐藏服务有没有
|
||||||
|
id = getCallID(plg, callback, params, true);
|
||||||
|
if (!id) {
|
||||||
return CALL_INVALID;
|
return CALL_INVALID;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return remoteCall(plg, id, params, ret);
|
||||||
|
}
|
||||||
|
|
||||||
int PluginSystem::remoteCall(IWingToolPlg *plg, int callID,
|
int PluginSystem::remoteCall(IWingToolPlg *plg, int callID,
|
||||||
QVector<QVariant> params, QVariant &ret) {
|
QVector<QVariant> params, QVariant &ret) {
|
||||||
|
if (!callID)
|
||||||
|
return CALL_INVALID;
|
||||||
|
|
||||||
auto caller = m_plgrec[plg].services[callID];
|
auto caller = callID > 0 ? m_plgrec[plg].services[callID - 1]
|
||||||
|
: m_plgrec[plg].interfaces[-callID - 1];
|
||||||
|
|
||||||
if (!caller.isValid()) {
|
if (!caller.isValid()) {
|
||||||
dError(tr("[remoteCallVaildErr]") +
|
dError(tr("[remoteCallVaildErr]") +
|
||||||
|
@ -584,3 +743,40 @@ int PluginSystem::remoteCall(IWingToolPlg *plg, int callID,
|
||||||
return CALL_EXCEPTION;
|
return CALL_EXCEPTION;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int PluginSystem::getCallID(IWingToolPlg *plg, QString &callback,
|
||||||
|
QVector<QVariant> params, bool isInterface) {
|
||||||
|
auto &srvn =
|
||||||
|
isInterface ? m_plgrec[plg].interfaceNames : m_plgrec[plg].serviceNames;
|
||||||
|
auto id = 0;
|
||||||
|
auto &srv = m_plgrec[plg].services;
|
||||||
|
|
||||||
|
for (;; id++) {
|
||||||
|
id = srvn.indexOf(callback, id);
|
||||||
|
if (id < 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
// 先检查一下参数个数
|
||||||
|
auto &m = srv[id];
|
||||||
|
if (params.count() != m.parameterCount()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查类型是否合格
|
||||||
|
auto len = params.count();
|
||||||
|
bool invalid = false;
|
||||||
|
for (auto i = 0; i < len; i++) {
|
||||||
|
if (!params[i].canConvert(m.parameterType(i))) {
|
||||||
|
invalid = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (invalid)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
id++;
|
||||||
|
return isInterface ? -id : id;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -47,11 +47,13 @@ public:
|
||||||
bool hasRegisteredMenu();
|
bool hasRegisteredMenu();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
IWingToolPlg *loopUpHotkey(QUuid uuid, int &index);
|
IWingToolPlg *loopUpHotkey(QUuid uuid);
|
||||||
int remoteCall(IWingToolPlg *plg, QString &callback, QVector<QVariant> params,
|
int remoteCall(IWingToolPlg *plg, QString &callback, QVector<QVariant> params,
|
||||||
QVariant &ret);
|
QVariant &ret);
|
||||||
int remoteCall(IWingToolPlg *plg, int callID, QVector<QVariant> params,
|
int remoteCall(IWingToolPlg *plg, int callID, QVector<QVariant> params,
|
||||||
QVariant &ret);
|
QVariant &ret);
|
||||||
|
int getCallID(IWingToolPlg *plg, QString &callback, QVector<QVariant> params,
|
||||||
|
bool isInterface);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct PluginRecord {
|
struct PluginRecord {
|
||||||
|
@ -59,6 +61,9 @@ private:
|
||||||
QList<QUuid> hotkeyuid;
|
QList<QUuid> hotkeyuid;
|
||||||
QList<QMetaMethod> services;
|
QList<QMetaMethod> services;
|
||||||
|
|
||||||
|
QList<QMetaMethod> interfaces;
|
||||||
|
QStringList interfaceNames;
|
||||||
|
|
||||||
QStringList serviceNames; // 插件服务名缓存
|
QStringList serviceNames; // 插件服务名缓存
|
||||||
QStringList servicetrNames; // 插件服务本地化名称缓存
|
QStringList servicetrNames; // 插件服务本地化名称缓存
|
||||||
};
|
};
|
||||||
|
|
BIN
screenshot.gif
BIN
screenshot.gif
Binary file not shown.
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.0 MiB |
|
@ -29,7 +29,7 @@ struct ToolStructInfo {
|
||||||
QIcon icon = QIcon(); // 缓存
|
QIcon icon = QIcon(); // 缓存
|
||||||
|
|
||||||
// 以下仅供插件使用
|
// 以下仅供插件使用
|
||||||
int serviceID = -1;
|
int serviceID = -1; // 这个 ID 比服务 CALLID 小 1
|
||||||
int pluginIndex = -1;
|
int pluginIndex = -1;
|
||||||
QString provider = QString();
|
QString provider = QString();
|
||||||
QString serviceName = QString(); // 函数服务名缓存
|
QString serviceName = QString(); // 函数服务名缓存
|
||||||
|
|
Loading…
Reference in New Issue