Skip to content

Commit cc84bac

Browse files
committed
WakeOnLan: modify message box and Initial
1 parent 7ce2e11 commit cc84bac

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### v0.0.32
44
- Fix player menu bug
55
- Fix player name
6+
- Fix wake on lan bug
67

78
### v0.0.31
89
- Use [RabbitCommon v2.3.2](https://github.com/KangLin/RabbitCommon/releases/tag/v2.3.2)

ChangeLog_zh_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
### v0.0.32
44
- 修复播放器菜单错误
55
- 修复播放器名称错误
6+
- 修复局域网唤醒错误
67

78
### v0.0.31
89
- 使用 [RabbitCommon v2.3.2](https://github.com/KangLin/RabbitCommon/releases/tag/v2.3.2)

Plugins/WakeOnLan/ConnecterWakeOnLan.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <QVBoxLayout>
66
#include <QRegularExpression>
77
#include <QPushButton>
8+
#include <QCheckBox>
89
#include <QtGlobal>
910
#include <QCoreApplication>
1011
#include "RabbitCommonTools.h"
@@ -35,6 +36,8 @@ qint16 CConnecterWakeOnLan::Version()
3536

3637
int CConnecterWakeOnLan::Initial()
3738
{
39+
int nRet = CConnecter::Initial();
40+
if(nRet) return nRet;
3841
qDebug(log) << Q_FUNC_INFO;
3942
bool check = false;
4043
CPluginClient* plugin = GetPlugClient();
@@ -170,17 +173,21 @@ int CConnecterWakeOnLan::Connect()
170173
static bool bShow = false;
171174
if(!bShow) {
172175
bShow = true;
173-
int nRet = QMessageBox::warning(
174-
nullptr, tr("Warning"),
176+
int nRet = 0;
177+
QMessageBox msg(
178+
QMessageBox::Warning, tr("Warning"),
175179
tr("There are no administrator privileges, "
176180
"and some functions(Get mac address) are restricted. "
177181
"Please restart the program with administrative privileges."),
178182
QMessageBox::Yes | QMessageBox::No);
183+
msg.setCheckBox(new QCheckBox(tr("Exit the program"), &msg));
184+
msg.checkBox()->setCheckable(true);
185+
nRet = msg.exec();
179186
if(QMessageBox::Yes == nRet) {
180187
bool bRet = RabbitCommon::CTools::executeByRoot(
181188
QCoreApplication::applicationFilePath());
182189
qDebug(log) << "Execute:" << bRet << QCoreApplication::applicationFilePath();
183-
if(bRet) {
190+
if(bRet && msg.checkBox()->isChecked()) {
184191
QCoreApplication::quit();
185192
}
186193
}

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,13 @@ See requirements for details: https://github.com/KangLin/RabbitRemoteControl/iss
388388
- RabbitRemoteControl_v0.0.31_x86_64.AppImage
389389
- [Download from github](https://github.com/KangLin/RabbitRemoteControl/releases/download/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage)
390390
- [Download from sourceforge](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage/download)
391+
392+
chmod u+x RabbitRemoteControl_v0.0.31_x86_64.AppImage
393+
./RabbitRemoteControl_v0.0.31_x86_64.AppImage
394+
395+
- md5sum file: RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum
396+
- [Download from github](https://github.com/KangLin/RabbitRemoteControl/releases/download/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum)
397+
- [Download from sourceforge](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum/download)
391398
- Other:
392399
- [Download from github](https://github.com/KangLin/RabbitRemoteControl/releases/tag/v0.0.31)
393400
- [Download from sourceforge](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/)

README_zh_CN.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@
375375
- RabbitRemoteControl_v0.0.31_x86_64.AppImage
376376
- [从 github 下载](https://github.com/KangLin/RabbitRemoteControl/releases/download/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage)
377377
- [从 sourceforge 下载](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage/download)
378+
379+
chmod u+x RabbitRemoteControl_v0.0.31_x86_64.AppImage
380+
./RabbitRemoteControl_v0.0.31_x86_64.AppImage
381+
382+
- md5 校验文件: RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum
383+
- [从 github 下载](https://github.com/KangLin/RabbitRemoteControl/releases/download/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum)
384+
- [从 sourceforge 下载](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/RabbitRemoteControl_v0.0.31_x86_64.AppImage.md5sum/download)
378385
- 其它:
379386
- [从 github 下载](https://github.com/KangLin/RabbitRemoteControl/releases/tag/v0.0.31)
380387
- [从 sourceforge 下载](https://sourceforge.net/projects/rabbitremotecontrol/files/v0.0.31/)

0 commit comments

Comments
 (0)