Skip to content

Commit a3f5f15

Browse files
committed
test aboutToQuit
1 parent 3617e66 commit a3f5f15

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# drcom-jlu-qt
22
drcom for jlu in qt cross platform
33

4-
跨平台 **win linux** [下载链接]("https://github.com/code4lala/drcom-jlu-qt/releases")
4+
跨平台 **win linux** [下载链接](https://github.com/code4lala/drcom-jlu-qt/releases)
55

66
# 警告
7-
现在密码是明文保存,具体存在哪跟平台有关。用的QSettings存的,详情请参见官方文档:[https://doc.qt.io/qt-5/qsettings.html#platform-specific-notes]("https://doc.qt.io/qt-5/qsettings.html#platform-specific-notes")
7+
现在密码是明文保存,具体存在哪跟平台有关。用的QSettings存的,详情请参见官方文档:[https://doc.qt.io/qt-5/qsettings.html#platform-specific-notes](https://doc.qt.io/qt-5/qsettings.html#platform-specific-notes)
88

99
# 功能对比
1010
| 功能 | 官方 | 本版 | 说明 |
1111
|----------------------|------|------|------------------------------------------------------------------|
12-
| 打开速度 ||| 我也不知道为什么官版打开那么慢 |
1312
| 记住密码 自动登录 ||| |
1413
| 密文保存密码 || | 待改进 |
1514
| 多语言支持 || | 或许不会改进了... |
1615
| 被顶掉 || | 警告!巨大缺陷!本版掉线后会自动重启重新登录!所以顶不掉!待改进 |
16+
| 打开速度 ||| 我也不知道为什么官版打开那么慢 |
1717
| 单实例 | || 开机自启慢的话可以直接打开不会报错说已经在运行 |
1818
| 快速注销 | || 官方版是真·注销,本版是直接关闭socket,所以不需要等20s的发包周期 |
1919
| 托盘图标无bug | || 不知道你们有没有碰到过官方win版托盘有俩图标的bug |
@@ -24,40 +24,39 @@ drcom for jlu in qt cross platform
2424
| win版不需要管理员 | || |
2525
| linux版最小化到托盘 | || |
2626
| linux版不需要root | || |
27+
| 不限制NAT | || 并不支持有违校方意愿的做法,请自行承担后果 |
2728

2829
# 注意事项
29-
掉线后客户端自动重启重连尝试三次。自动重启登录成功后不弹窗口只最小化到托盘。注:自动重启功能依赖于“记住我”选项的勾选,否则没有账户密码自行重启也并没有什么用
30+
- 掉线后客户端自动重启重连尝试三次。自动重启登录成功后不弹窗口只最小化到托盘。注:自动重启功能依赖于“记住我”选项的勾选,否则没有账户密码自行重启也并没有什么用
31+
- 连接JLU.PC登录的时候mac地址随便填就可以,或者随便选一个网卡也可以,只有有线网要求mac地址和网络中心的一致
3032

3133
# 截图
32-
WIN:
34+
> WIN:
3335
34-
![AmH6mR.png](https://s2.ax1x.com/2019/03/18/AmH6mR.png)
36+
![n9c6aQ.png](https://s2.ax1x.com/2019/09/02/n9c6aQ.png)
3537

36-
UBUNTU:
38+
> UBUNTU:
3739
38-
![AmHb7t.png](https://s2.ax1x.com/2019/03/18/AmHb7t.png)
40+
![nCtJ2Q.png](https://s2.ax1x.com/2019/09/02/nCtJ2Q.png)
3941

40-
注意:Ubuntu 18不显示托盘图标的bug的解决方案:
41-
[https://askubuntu.com/questions/1056226/ubuntu-budgie-18-04-lts-system-tray-icons-not-all-showing](https://askubuntu.com/questions/1056226/ubuntu-budgie-18-04-lts-system-tray-icons-not-all-showing)
42+
> Ubuntu 18不显示托盘图标的bug的解决方案:
43+
> [https://askubuntu.com/questions/1056226/ubuntu-budgie-18-04-lts-system-tray-icons-not-all-showing](https://askubuntu.com/questions/1056226/ubuntu-budgie-18-04-lts-system-tray-icons-not-all-showing)
4244
4345
# 感谢
4446

45-
感谢[https://github.com/lyj3516](https://github.com/lyj3516)提供的图标
47+
**图标作者**
48+
> [https://github.com/lyj3516](https://github.com/lyj3516)
4649
4750
**jlu的drcom协议细节**
48-
49-
[https://github.com/drcoms/jlu-drcom-client/blob/master/jlu-drcom-java/jlu-drcom-protocol.md](https://github.com/drcoms/jlu-drcom-client/blob/master/jlu-drcom-java/jlu-drcom-protocol.md)
51+
> [https://github.com/drcoms/jlu-drcom-client/blob/master/jlu-drcom-java/jlu-drcom-protocol.md](https://github.com/drcoms/jlu-drcom-client/blob/master/jlu-drcom-java/jlu-drcom-protocol.md)
5052
5153
**唯一实例**
52-
53-
[https://github.com/itay-grudev/SingleApplication](https://github.com/itay-grudev/SingleApplication)
54+
> [https://github.com/itay-grudev/SingleApplication](https://github.com/itay-grudev/SingleApplication)
5455
5556
# 特别感谢
56-
57-
[https://github.com/mchome/dogcom](https://github.com/mchome/dogcom)
58-
59-
提取出来jlu部分的代码改动到此项目中
57+
**登录部分复制了jlu部分代码**
58+
> [https://github.com/mchome/dogcom](https://github.com/mchome/dogcom)
6059
6160
# 许可证
6261

63-
GNU Affero General Public License v3.0
62+
[GNU Affero General Public License v3.0](https://github.com/code4lala/drcom-jlu-qt/blob/master/LICENSE)

main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,16 @@ int main(int argc, char *argv[])
9191
w.ShowLoginWindow();
9292
});
9393

94+
// 关机时接收退出信号,释放socket
95+
QObject::connect(&a, &SingleApplication::aboutToQuit, &w, &MainWindow::QuitDrcom);
96+
9497
QSettings s(SETTINGS_FILE_NAME);
9598
bool bHideWindow=s.value(ID_HIDE_WINDOW, false).toBool();
9699
// 如果是软件自行重启的就不显示窗口
97100
int restartTimes = s.value(ID_RESTART_TIMES, 0).toInt();
98101
qDebug() << "main: restartTimes=" << restartTimes;
99102
if(bHideWindow){
100-
qDebug()<<"not show window caused user settings";
103+
qDebug()<<"not show window caused by user settings";
101104
} else if (restartTimes > 0) {
102105
// 是自行重启不显示窗口
103106
qDebug()<<"not show window caused by self restart";

mainwindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ MainWindow::MainWindow(QWidget *parent) :
2020
QDialog(parent),
2121
ui(new Ui::MainWindow)
2222
{
23+
qDebug()<<"MainWindow constructor";
2324
ui->setupUi(this);
2425

2526
CURR_STATE = STATE_OFFLINE;
@@ -248,6 +249,7 @@ void MainWindow::SetMAC(const QString &m)
248249

249250
MainWindow::~MainWindow()
250251
{
252+
qDebug()<<"MainWindow destructor";
251253
delete ui;
252254
delete restartAction;
253255
delete restoreAction;

0 commit comments

Comments
 (0)