Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmclientUi
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuai.liu
FmclientUi
Commits
d305132f
Commit
d305132f
authored
Dec 21, 2017
by
刘帅
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 修改ui背景颜色;
2. 参数从*.cfg文件中读取
parent
166c7c5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
54 deletions
+104
-54
.gitignore
+3
-1
FmclientUi.pro
+10
-5
bin/fmcrypt.dll
+0
-0
qfmclient.cpp
+52
-11
widget.ui
+39
-37
No files found.
.gitignore
View file @
d305132f
...
...
@@ -69,4 +69,6 @@ Thumbs.db
# Binaries
# --------
*.exe
log/
/bin/*
!/bin/*.txt
FmclientUi.pro
View file @
d305132f
...
...
@@ -8,16 +8,21 @@ QT += core gui
greaterThan
(
QT_MAJOR_VERSION
,
4
)
:
QT
+=
widgets
TARGET
=
FmclientUi
TARGET
=
fmclient
TEMPLATE
=
app
LIBS
+=
-
L
$$
PWD
/
lib
/
DESTDIR
=
$$
PWD
/
bin
LIBS
+=
-
lfmcrypt
include
(.
/
QsLog
/
QsLog
.
pri
)
win32
{
LIBS
+=
-
lfmcrypt
}
CONFIG
(
debug
,
debug
|
release
){
DESTDIR
=
$$
PWD
/
bin
/
debug
}
else
{
DESTDIR
=
$$
PWD
/
bin
/
release
}
SOURCES
+=
main
.
cpp
\
widget
.
cpp
\
...
...
bin/fmcrypt.dll
deleted
100644 → 0
View file @
166c7c5b
File deleted
qfmclient.cpp
View file @
d305132f
...
...
@@ -9,6 +9,7 @@
#include <Qdebug>
#include <QApplication>
#include <QWidget>
#include <QDir>
#include "QsLog/QsLog.h"
#ifdef WIN32
...
...
@@ -30,7 +31,7 @@
#endif
unsigned
int
QFmClient
::
s_reqCount
=
0
;
#define CONFIGURE_FILE_NAME "fmclient.cfg"
QFmClient
::
QFmClient
(
QObject
*
parent
)
:
QThread
(
parent
)
{
...
...
@@ -40,6 +41,47 @@ QFmClient::QFmClient(QObject *parent) : QThread(parent)
bool
QFmClient
::
Init
(
QString
proxy_IP
,
unsigned
short
proxy_port
,
unsigned
short
listen_prot
,
unsigned
short
long_timeout
,
unsigned
short
short_timeout
)
{
QString
fileName
=
qApp
->
applicationDirPath
();
fileName
.
append
(
QDir
::
separator
());
fileName
.
append
(
CONFIGURE_FILE_NAME
);
FILE
*
cfgFile
=
fopen
(
fileName
.
toStdString
().
c_str
(),
"rt"
);
unsigned
int
value
=
0
;
int
rlt
=
0
;
char
proxyIp
[
30
];
char
clientVerInfo
[
32
];
if
(
0
==
cfgFile
)
{
QLOG_ERROR
()
<<
"open cfg file failed!
\r\n
"
;
return
false
;
}
rlt
=
fscanf
(
cfgFile
,
"%s"
,
clientVerInfo
);
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
//changeCount = value;
rlt
=
fscanf
(
cfgFile
,
"%s"
,
proxyIp
);
proxy_IP
=
proxyIp
;
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
listen_prot
=
value
;
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
proxy_port
=
value
;
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
long_timeout
=
value
;
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
short_timeout
=
value
;
rlt
=
fscanf
(
cfgFile
,
"%u"
,
&
value
);
_codeFlag
=
(
char
)
value
;
fclose
(
cfgFile
);
cfgFile
=
0
;
if
(
proxy_IP
.
size
()
==
0
||
proxy_port
<=
0
||
...
...
@@ -691,8 +733,9 @@ void QFmClient::run()
{
if
(
!
Init
(
"115.159.63.201"
,
29534
,
34952
,
30
,
5
))
{
qDebug
()
<<
"Init QFmClient failed"
;
emit
Error
(
"Init QFmClient failed"
);
qDebug
()
<<
"Init failed!"
;
emit
Error
(
"Init failed!"
);
return
;
}
else
qDebug
()
<<
"Init QFmClient success."
;
...
...
@@ -876,7 +919,7 @@ void QFmClient::CheckRollBackData()
}
qDebug
()
<<
"need to roll back data...
\r\n
"
;
QLOG_INFO
()
<<
"need to roll back data...
\r\n
"
;
fseek
(
file
,
0
,
SEEK_SET
);
fseek
(
file
,
0
,
SEEK_END
);
...
...
@@ -898,9 +941,6 @@ void QFmClient::CheckRollBackData()
memset
(
_sendbuf
,
0
,
MAX_BUF_LEN
);
ZH_decodeBkData
(
_codeBuf
,
_sendbuf
,
readLen
);
//qDebug() << "rollback data:" << _sendbuf;
qDebug
()
<<
"
\r\n
"
;
QByteArray
senddata
(
_sendbuf
);
QJsonParseError
json_error
;
...
...
@@ -923,6 +963,7 @@ void QFmClient::CheckRollBackData()
qDebug
()
<<
"rollback data:"
<<
_sendbuf
;
qDebug
()
<<
"
\r\n
"
;
QLOG_INFO
()
<<
"rollback data:"
<<
_sendbuf
<<
"
\r\n
"
;
do
{
...
...
@@ -931,21 +972,21 @@ void QFmClient::CheckRollBackData()
if
(
0
!=
Try2ConnectZhProxy
())
{
qDebug
()
<<
"roll back data: connect ZH Proxy failed, will try after 5 seconds...
\r\n
"
;
QLOG_INFO
()
<<
"roll back data: connect ZH Proxy failed, will try after 5 seconds...
\r\n
"
;
continue
;
}
if
(
0
!=
SendCtrlInfo2Proxy
())
{
qDebug
()
<<
"roll back data: send ctrl info 2 ZH Proxy failed, will try after 5 seconds...
\r\n
"
;
QLOG_INFO
()
<<
"roll back data: send ctrl info 2 ZH Proxy failed, will try after 5 seconds...
\r\n
"
;
continue
;
}
if
(
0
!=
SendData2ZhProxyAndWaitRspData
())
{
qDebug
()
<<
"roll back data: send data to proxy fail, will try after 5 seconds...
\r\n
"
;
QLOG_INFO
()
<<
"roll back data: send data to proxy fail, will try after 5 seconds...
\r\n
"
;
continue
;
}
...
...
@@ -953,7 +994,7 @@ void QFmClient::CheckRollBackData()
}
while
(
1
);
qDebug
()
<<
"roll back ok!
\r\n
"
;
QLOG_INFO
()
<<
"roll back ok!
\r\n
"
;
CloseSocket
(
&
_zhProxySock
);
remove
(
filename
.
toStdString
().
c_str
());
...
...
widget.ui
View file @
d305132f
...
...
@@ -45,23 +45,23 @@
#widget_wait_time_11
{
border: 1px solid;
border-color: #FF
D7
00;
border-radius:
10
px;
border-color: #FF
C3
00;
border-radius:
8
px;
}
#widget_wait_main_11
{
font: 9pt
"
Agency FB
"
;
background-color: rgb(2
55, 255, 25
5);
background-color: rgb(2
25, 225, 22
5);
border-radius:15px
}
#label_wait_time_11
{
background-color:#32CD32;
border-radius:
10
px;
min-width: 49px; min-height:
23
px;
max-width: 49px; max-height:
23
px;
border-radius:
8
px;
min-width: 49px; min-height:
17
px;
max-width: 49px; max-height:
17
px;
}
#label_wait_msg_11
...
...
@@ -170,31 +170,6 @@
</spacer>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_wait_title_11"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_wait_title
{
font: 75 25px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
扫描成功 正在支付中
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer_75"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -230,6 +205,31 @@
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_wait_title_11"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Expanding"
vsizetype=
"Expanding"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#label_wait_title
{
font: 75 25px
"
Microsoft YaHei UI Light
"
;
}
</string>
</property>
<property
name=
"text"
>
<string>
扫描成功 正在支付中
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
<property
name=
"wordWrap"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer_76"
>
<property
name=
"orientation"
>
<enum>
Qt::Vertical
</enum>
...
...
@@ -284,20 +284,20 @@
<property
name=
"minimumSize"
>
<size>
<width>
200
</width>
<height>
25
</height>
<height>
19
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
200
</width>
<height>
25
</height>
<height>
19
</height>
</size>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
#Widget
{
border: 1px solid #FF00FF;
border-radius:
5
px;
border-radius:
10
px;
}
</string>
</property>
<widget
class=
"QLabel"
name=
"label_wait_time_11"
>
...
...
@@ -306,19 +306,19 @@
<x>
1
</x>
<y>
1
</y>
<width>
49
</width>
<height>
23
</height>
<height>
17
</height>
</rect>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
49
</width>
<height>
23
</height>
<height>
17
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
49
</width>
<height>
23
</height>
<height>
17
</height>
</size>
</property>
<property
name=
"styleSheet"
>
...
...
@@ -330,6 +330,8 @@
min-width: 64px; min-height:64px;
max-width: 64px; max-height:64px;
border-radius:10px;
}
</string>
</property>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment