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)
...
@@ -27,7 +27,6 @@ void FmPlugin::SetRemoteInfo(const QString &ip, int port)
bool
FmPlugin
::
DoOrderEntry
(
const
OrderObject
*
orderObject
,
QString
&
error
,
bool
bVerify
)
bool
FmPlugin
::
DoOrderEntry
(
const
OrderObject
*
orderObject
,
QString
&
error
,
bool
bVerify
)
{
{
return
true
;
QTcpSocket
socket
;
QTcpSocket
socket
;
// 连接
// 连接
socket
.
connectToHost
(
m_host
,
m_port
);
socket
.
connectToHost
(
m_host
,
m_port
);
...
...
fmTakeaway/Control/sinfoControl.cpp
View file @
1cb1995b
...
@@ -14,8 +14,15 @@ void SInfoControl::SetListenPort(int port)
...
@@ -14,8 +14,15 @@ void SInfoControl::SetListenPort(int port)
m_port
=
port
;
m_port
=
port
;
}
}
SInfoControl
::~
SInfoControl
()
{
m_bContinue
=
false
;
m_mutex
.
lock
();
}
void
SInfoControl
::
run
()
void
SInfoControl
::
run
()
{
{
m_mutex
.
lock
();
m_tcpServer
=
new
QTcpServer
(
this
);
m_tcpServer
=
new
QTcpServer
(
this
);
if
(
!
m_tcpServer
->
listen
(
QHostAddress
::
LocalHost
,
m_port
))
if
(
!
m_tcpServer
->
listen
(
QHostAddress
::
LocalHost
,
m_port
))
...
@@ -29,9 +36,10 @@ void SInfoControl::run()
...
@@ -29,9 +36,10 @@ void SInfoControl::run()
QString
replyData
;
QString
replyData
;
QJsonParseError
jsonError
;
QJsonParseError
jsonError
;
QJsonDocument
jsonDoc
;
QJsonDocument
jsonDoc
;
while
(
true
)
m_bContinue
=
true
;
while
(
m_bContinue
)
{
{
if
(
!
m_tcpServer
->
waitForNewConnection
(
60
000
))
if
(
!
m_tcpServer
->
waitForNewConnection
(
1
000
))
{
{
continue
;
continue
;
}
}
...
@@ -96,5 +104,8 @@ void SInfoControl::run()
...
@@ -96,5 +104,8 @@ void SInfoControl::run()
m_tcpSocket
->
close
();
m_tcpSocket
->
close
();
continue
;
continue
;
}
}
m_tcpServer
->
close
();
m_tcpServer
->
deleteLater
();
QLOG_INFO
()
<<
"refundControl exit."
;
QLOG_INFO
()
<<
"refundControl exit."
;
m_mutex
.
unlock
();
}
}
fmTakeaway/Control/sinfoControl.h
View file @
1cb1995b
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
#include <QObject>
#include <QObject>
#include <QTcpServer>
#include <QTcpServer>
#include <QTcpSocket>
#include <QTcpSocket>
#include <QMutex>
class
SInfoControl
:
public
QObject
class
SInfoControl
:
public
QObject
{
{
...
@@ -15,6 +16,7 @@ public:
...
@@ -15,6 +16,7 @@ public:
private
:
private
:
SInfoControl
(){}
SInfoControl
(){}
~
SInfoControl
();
SInfoControl
(
SInfoControl
const
&
);
SInfoControl
(
SInfoControl
const
&
);
SInfoControl
&
operator
=
(
SInfoControl
const
&
);
SInfoControl
&
operator
=
(
SInfoControl
const
&
);
...
@@ -22,6 +24,9 @@ private:
...
@@ -22,6 +24,9 @@ private:
QTcpSocket
*
m_tcpSocket
;
QTcpSocket
*
m_tcpSocket
;
int
m_port
;
int
m_port
;
QMutex
m_mutex
;
bool
m_bContinue
;
public
slots
:
public
slots
:
/* 功能:开启控制器
/* 功能:开启控制器
* 参数:NULL
* 参数:NULL
...
...
fmTakeaway/DTools/sysTray.cpp
View file @
1cb1995b
#include "SysTray.h"
#include "SysTray.h"
#include <QApplication>
#include <QApplication>
#include <QThread>
extern
QThread
sInfoThread
;
extern
QThread
workThread
;
SysTray
::
SysTray
(
QObject
*
parent
)
:
SysTray
::
SysTray
(
QObject
*
parent
)
:
QSystemTrayIcon
(
parent
)
QSystemTrayIcon
(
parent
)
...
@@ -22,5 +25,7 @@ void SysTray::_CreatMenu()
...
@@ -22,5 +25,7 @@ void SysTray::_CreatMenu()
void
SysTray
::
onActionQuitTriggered
()
void
SysTray
::
onActionQuitTriggered
()
{
{
qApp
->
exit
();
sInfoThread
.
terminate
();
workThread
.
terminate
();
qApp
->
exit
(
-
1
);
}
}
fmTakeaway/floatForm.cpp
View file @
1cb1995b
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
#include "DTools/configManger.h"
#include "DTools/configManger.h"
#include "preDefine.h"
#include "preDefine.h"
#include "QsLog.h"
#include "QsLog.h"
#include <QProcess>
#include <QThread>
extern
QThread
sInfoThread
;
extern
QThread
workThread
;
FloatForm
::
FloatForm
(
QWidget
*
parent
)
:
FloatForm
::
FloatForm
(
QWidget
*
parent
)
:
QDialog
(
parent
),
QDialog
(
parent
),
...
@@ -57,7 +62,10 @@ void FloatForm::mousePressEvent(QMouseEvent *event)
...
@@ -57,7 +62,10 @@ void FloatForm::mousePressEvent(QMouseEvent *event)
}
}
if
(
event
->
button
()
==
Qt
::
RightButton
)
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)
...
@@ -77,8 +85,7 @@ void FloatForm::mouseReleaseEvent(QMouseEvent *event)
}
}
m_bMouseMove
=
false
;
m_bMouseMove
=
false
;
ConfigManger
::
GetInstance
().
setFloatInitPostion
(
event
->
globalPos
());
ConfigManger
::
GetInstance
().
setFloatInitPostion
(
this
->
pos
());
m_mouseTimer
.
stop
();
}
}
void
FloatForm
::
_Init
()
void
FloatForm
::
_Init
()
...
...
fmTakeaway/main.cpp
View file @
1cb1995b
...
@@ -52,13 +52,13 @@ void LoadTheme(const QString& theme)
...
@@ -52,13 +52,13 @@ void LoadTheme(const QString& theme)
int
main
(
int
argc
,
char
*
argv
[])
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
)
{
//
if (GetLastError() == ERROR_ALREADY_EXISTS) {
CloseHandle
(
m_hMutex
);
//
CloseHandle(m_hMutex);
m_hMutex
=
NULL
;
//
m_hMutex = NULL;
return
-
1
;
//
return -1;
}
//
}
QApplication
a
(
argc
,
argv
);
QApplication
a
(
argc
,
argv
);
g_appDir
=
a
.
applicationDirPath
();
g_appDir
=
a
.
applicationDirPath
();
...
...
fmTakeaway/mainForm.cpp
View file @
1cb1995b
...
@@ -102,7 +102,7 @@ void MainForm::MyShow()
...
@@ -102,7 +102,7 @@ void MainForm::MyShow()
void
MainForm
::
_Init
()
void
MainForm
::
_Init
()
{
{
this
->
setWindowFlags
(
this
->
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
this
->
setWindowFlags
(
this
->
windowFlags
()
|
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
//
this->showFullScreen();
this
->
showFullScreen
();
// 显示托盘
// 显示托盘
m_tray
.
show
();
m_tray
.
show
();
...
@@ -218,10 +218,8 @@ void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
...
@@ -218,10 +218,8 @@ void MainForm::onShowSearchOrderResult(const QMap<QString,QString>& orderIdList)
void
MainForm
::
onrestart
()
void
MainForm
::
onrestart
()
{
{
sInfoThread
.
terminate
();
workThread
.
terminate
();
qApp
->
exit
();
QProcess
::
startDetached
(
qApp
->
applicationFilePath
(),
QStringList
());
}
}
void
MainForm
::
_RevertBtnTable
()
void
MainForm
::
_RevertBtnTable
()
...
...
run/userConfig.ini
View file @
1cb1995b
;打印机信息
;打印机信息
[Printer]
[Printer]
name
=
Fax
name
=
;悬浮窗参数
;悬浮窗参数
[Float]
[Float]
postion
=
@Point(1
97 621
)
postion
=
@Point(1
00 100
)
opacity
=
0.5
opacity
=
0.5
blinkInterval
=
0.3
blinkInterval
=
0.3
soundInterval
=
2
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