Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
shangshang.dai
FmTakeaway
Commits
1cb1995b
Commit
1cb1995b
authored
Oct 14, 2016
by
ss.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改推出后进程残留
parent
e7c71abe
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
45 additions
and
20 deletions
+45
-20
fmPlugin/fmPlugin.cpp
+0
-1
fmTakeaway/Control/sinfoControl.cpp
+13
-2
fmTakeaway/Control/sinfoControl.h
+5
-0
fmTakeaway/DTools/sysTray.cpp
+6
-1
fmTakeaway/floatForm.cpp
+10
-3
fmTakeaway/main.cpp
+6
-6
fmTakeaway/mainForm.cpp
+3
-5
run/userConfig.ini
+2
-2
No files found.
fmPlugin/fmPlugin.cpp
View file @
1cb1995b
...
...
@@ -27,7 +27,6 @@ void FmPlugin::SetRemoteInfo(const QString &ip, int port)
bool
FmPlugin
::
DoOrderEntry
(
const
OrderObject
*
orderObject
,
QString
&
error
,
bool
bVerify
)
{
return
true
;
QTcpSocket
socket
;
// 连接
socket
.
connectToHost
(
m_host
,
m_port
);
...
...
fmTakeaway/Control/sinfoControl.cpp
View file @
1cb1995b
...
...
@@ -14,8 +14,15 @@ void SInfoControl::SetListenPort(int port)
m_port
=
port
;
}
SInfoControl
::~
SInfoControl
()
{
m_bContinue
=
false
;
m_mutex
.
lock
();
}
void
SInfoControl
::
run
()
{
m_mutex
.
lock
();
m_tcpServer
=
new
QTcpServer
(
this
);
if
(
!
m_tcpServer
->
listen
(
QHostAddress
::
LocalHost
,
m_port
))
...
...
@@ -29,9 +36,10 @@ void SInfoControl::run()
QString
replyData
;
QJsonParseError
jsonError
;
QJsonDocument
jsonDoc
;
while
(
true
)
m_bContinue
=
true
;
while
(
m_bContinue
)
{
if
(
!
m_tcpServer
->
waitForNewConnection
(
60
000
))
if
(
!
m_tcpServer
->
waitForNewConnection
(
1
000
))
{
continue
;
}
...
...
@@ -96,5 +104,8 @@ void SInfoControl::run()
m_tcpSocket
->
close
();
continue
;
}
m_tcpServer
->
close
();
m_tcpServer
->
deleteLater
();
QLOG_INFO
()
<<
"refundControl exit."
;
m_mutex
.
unlock
();
}
fmTakeaway/Control/sinfoControl.h
View file @
1cb1995b
...
...
@@ -4,6 +4,7 @@
#include <QObject>
#include <QTcpServer>
#include <QTcpSocket>
#include <QMutex>
class
SInfoControl
:
public
QObject
{
...
...
@@ -15,6 +16,7 @@ public:
private
:
SInfoControl
(){}
~
SInfoControl
();
SInfoControl
(
SInfoControl
const
&
);
SInfoControl
&
operator
=
(
SInfoControl
const
&
);
...
...
@@ -22,6 +24,9 @@ private:
QTcpSocket
*
m_tcpSocket
;
int
m_port
;
QMutex
m_mutex
;
bool
m_bContinue
;
public
slots
:
/* 功能:开启控制器
* 参数:NULL
...
...
fmTakeaway/DTools/sysTray.cpp
View file @
1cb1995b
#include "SysTray.h"
#include <QApplication>
#include <QThread>
extern
QThread
sInfoThread
;
extern
QThread
workThread
;
SysTray
::
SysTray
(
QObject
*
parent
)
:
QSystemTrayIcon
(
parent
)
...
...
@@ -22,5 +25,7 @@ void SysTray::_CreatMenu()
void
SysTray
::
onActionQuitTriggered
()
{
qApp
->
exit
();
sInfoThread
.
terminate
();
workThread
.
terminate
();
qApp
->
exit
(
-
1
);
}
fmTakeaway/floatForm.cpp
View file @
1cb1995b
...
...
@@ -4,6 +4,11 @@
#include "DTools/configManger.h"
#include "preDefine.h"
#include "QsLog.h"
#include <QProcess>
#include <QThread>
extern
QThread
sInfoThread
;
extern
QThread
workThread
;
FloatForm
::
FloatForm
(
QWidget
*
parent
)
:
QDialog
(
parent
),
...
...
@@ -57,7 +62,10 @@ void FloatForm::mousePressEvent(QMouseEvent *event)
}
if
(
event
->
button
()
==
Qt
::
RightButton
)
{
emit
restart
();
sInfoThread
.
terminate
();
workThread
.
terminate
();
qApp
->
exit
(
-
1
);
QProcess
::
startDetached
(
qApp
->
applicationFilePath
(),
QStringList
(
qApp
->
applicationFilePath
()));
}
}
...
...
@@ -77,8 +85,7 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
}
m_bMouseMove
=
false
;
ConfigManger
::
GetInstance
().
setFloatInitPostion
(
event
->
globalPos
());
m_mouseTimer
.
stop
();
ConfigManger
::
GetInstance
().
setFloatInitPostion
(
this
->
pos
());
}
void
FloatForm
::
_Init
()
...
...
fmTakeaway/main.cpp
View file @
1cb1995b
...
...
@@ -52,13 +52,13 @@ void LoadTheme(const QString& theme)
int
main
(
int
argc
,
char
*
argv
[])
{
HANDLE
m_hMutex
=
CreateMutex
(
NULL
,
FALSE
,
L"fmTakeaway"
);
//
HANDLE m_hMutex = CreateMutex(NULL, FALSE, L"fmTakeaway" );
if
(
GetLastError
()
==
ERROR_ALREADY_EXISTS
)
{
CloseHandle
(
m_hMutex
);
m_hMutex
=
NULL
;
return
-
1
;
}
//
if (GetLastError() == ERROR_ALREADY_EXISTS) {
//
CloseHandle(m_hMutex);
//
m_hMutex = NULL;
//
return -1;
//
}
QApplication
a
(
argc
,
argv
);
g_appDir
=
a
.
applicationDirPath
();
...
...
fmTakeaway/mainForm.cpp
View file @
1cb1995b
...
...
@@ -102,7 +102,7 @@ void MainForm::MyShow()
void
MainForm
::
_Init
()
{
this
->
setWindowFlags
(
this
->
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
//
this->showFullScreen();
this
->
showFullScreen
();
// 显示托盘
m_tray
.
show
();
...
...
@@ -218,10 +218,8 @@ void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
void
MainForm
::
onrestart
()
{
sInfoThread
.
terminate
();
workThread
.
terminate
();
qApp
->
exit
();
QProcess
::
startDetached
(
qApp
->
applicationFilePath
(),
QStringList
());
}
void
MainForm
::
_RevertBtnTable
()
...
...
run/userConfig.ini
View file @
1cb1995b
;打印机信息
[Printer]
name
=
Fax
name
=
;悬浮窗参数
[Float]
postion
=
@Point(1
97 621
)
postion
=
@Point(1
00 100
)
opacity
=
0.5
blinkInterval
=
0.3
soundInterval
=
2
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