update
This commit is contained in:
parent
5d13296701
commit
e070ce0249
|
@ -59,7 +59,7 @@ PythonQtScriptingConsole *PlgInterface::getScriptingConsole() {
|
|||
return console;
|
||||
}
|
||||
|
||||
bool PlgInterface::RunPyFile(QString filename) {
|
||||
bool PlgInterface::RunPyFile(const QString &filename) {
|
||||
if (mutex.tryLock()) {
|
||||
auto cur = console->textCursor();
|
||||
cur.movePosition(QTextCursor::End);
|
||||
|
@ -83,11 +83,19 @@ bool PlgInterface::requestRelease() { return plg->requestRelease(); }
|
|||
|
||||
bool PlgInterface::hasControl() { return plg->hasControl(); }
|
||||
|
||||
void PlgInterface::toast(QIcon icon, QString message) {
|
||||
return plg->toast(icon, message);
|
||||
void PlgInterface::toast(const QIcon &icon, const QString &message) {
|
||||
plg->toast(icon, message);
|
||||
}
|
||||
|
||||
bool PlgInterface::RunPyText(QString content) {
|
||||
void PlgInterface::logWarn(const QString &message) { plg->warn(message); }
|
||||
|
||||
void PlgInterface::logError(const QString &message) { plg->error(message); }
|
||||
|
||||
void PlgInterface::logInfo(const QString &message) { plg->info(message); }
|
||||
|
||||
void PlgInterface::logDebug(const QString &message) { plg->debug(message); }
|
||||
|
||||
bool PlgInterface::RunPyText(const QString &content) {
|
||||
if (mutex.tryLock()) {
|
||||
auto cur = console->textCursor();
|
||||
cur.movePosition(QTextCursor::End);
|
||||
|
|
|
@ -34,12 +34,16 @@ public:
|
|||
void initInfo(QListWidget *infolist, QTreeWidget *infotree,
|
||||
QTableWidget *infotable, QTextBrowser *infotxt);
|
||||
PythonQtScriptingConsole *getScriptingConsole();
|
||||
bool RunPyFile(QString filename);
|
||||
bool RunPyText(QString content);
|
||||
bool RunPyFile(const QString &filename);
|
||||
bool RunPyText(const QString &content);
|
||||
bool requestControl(int timeout = 1500);
|
||||
bool requestRelease();
|
||||
bool hasControl();
|
||||
void toast(QIcon icon, QString message);
|
||||
void toast(const QIcon &icon, const QString &message);
|
||||
void logWarn(const QString &message);
|
||||
void logError(const QString &message);
|
||||
void logInfo(const QString &message);
|
||||
void logDebug(const QString &message);
|
||||
|
||||
static PlgInterface *instance();
|
||||
private slots:
|
||||
|
@ -67,11 +71,16 @@ public slots:
|
|||
}
|
||||
bool requestRelease() { return inter->requestRelease(); }
|
||||
bool hasControl() { return inter->hasControl(); }
|
||||
void toast(QIcon icon, QString message) { inter->toast(icon, message); }
|
||||
void toast(QString message) {
|
||||
void toast(const QIcon &icon, const QString &message) {
|
||||
inter->toast(icon, message);
|
||||
}
|
||||
void toast(const QString &message) {
|
||||
inter->toast(QIcon(":/WingHexPy/img/icon.png"), message);
|
||||
}
|
||||
|
||||
void logWarn(const QString &message) { inter->logWarn(message); }
|
||||
void logError(const QString &message) { inter->logError(message); }
|
||||
void logInfo(const QString &message) { inter->logInfo(message); }
|
||||
void logDebug(const QString &message) { inter->logDebug(message); }
|
||||
void print(QString message) { inter->log(message); }
|
||||
void errPrint(QString message) { inter->log(ERRLOG(message)); }
|
||||
void infoPrint(QString message) { inter->log(INFOLOG(message)); }
|
||||
|
|
|
@ -19,7 +19,7 @@ Q_EXPORT_PLUGIN2(WingHexPy, GenericPlugin)
|
|||
|
||||
int WingHexPy::sdkVersion() { return SDKVERSION; }
|
||||
|
||||
QString WingHexPy::signature() { return WINGSUMMER; }
|
||||
const QString WingHexPy::signature() { return WINGSUMMER; }
|
||||
|
||||
bool WingHexPy::init(QList<WingPluginInfo> loadedplugin) {
|
||||
Q_UNUSED(loadedplugin);
|
||||
|
@ -179,11 +179,11 @@ void WingHexPy::plugin2MessagePipe(WingPluginMessage type,
|
|||
Q_UNUSED(msg);
|
||||
}
|
||||
|
||||
QString WingHexPy::pluginName() { return tr("WingHexPy"); }
|
||||
const QString WingHexPy::pluginName() { return tr("WingHexPy"); }
|
||||
|
||||
QString WingHexPy::pluginAuthor() { return WINGSUMMER; }
|
||||
const QString WingHexPy::pluginAuthor() { return WINGSUMMER; }
|
||||
|
||||
QString WingHexPy::pluginComment() {
|
||||
const QString WingHexPy::pluginComment() {
|
||||
return tr("A useful plugin for python3.7 support.");
|
||||
}
|
||||
|
||||
|
@ -192,7 +192,7 @@ uint WingHexPy::pluginVersion() { return 1; }
|
|||
QMenu *WingHexPy::registerMenu() { return menu; }
|
||||
|
||||
void WingHexPy::registerDockWidget(
|
||||
QMap<QDockWidget *, Qt::DockWidgetArea> &rdw) {
|
||||
QHash<QDockWidget *, Qt::DockWidgetArea> &rdw) {
|
||||
rdw.insert(dw, Qt::DockWidgetArea::BottomDockWidgetArea);
|
||||
rdw.insert(dtree, Qt::DockWidgetArea::BottomDockWidgetArea);
|
||||
rdw.insert(dtable, Qt::DockWidgetArea::BottomDockWidgetArea);
|
||||
|
|
10
winghexpy.h
10
winghexpy.h
|
@ -30,12 +30,12 @@ public:
|
|||
QToolBar *registerToolBar() override;
|
||||
Qt::ToolBarArea registerToolBarArea() override;
|
||||
void
|
||||
registerDockWidget(QMap<QDockWidget *, Qt::DockWidgetArea> &rdw) override;
|
||||
QString pluginName() override;
|
||||
QString pluginAuthor() override;
|
||||
registerDockWidget(QHash<QDockWidget *, Qt::DockWidgetArea> &rdw) override;
|
||||
const QString pluginName() override;
|
||||
const QString pluginAuthor() override;
|
||||
uint pluginVersion() override;
|
||||
QString signature() override;
|
||||
QString pluginComment() override;
|
||||
const QString signature() override;
|
||||
const QString pluginComment() override;
|
||||
void plugin2MessagePipe(WingPluginMessage type, QList<QVariant> msg) override;
|
||||
|
||||
public:
|
||||
|
|
Loading…
Reference in New Issue