Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_home
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
zhenfei.zhang
fmp_home
Commits
b1ddd768
Commit
b1ddd768
authored
Apr 11, 2017
by
NitefullWind
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev'
parents
9e475908
3abd1032
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
9 deletions
+43
-9
fmp_home.cpp
+7
-0
fmp_home.h
+3
-0
fmp_home_i.h
+13
-0
fmp_home_navwindow.cpp
+2
-2
fmp_home_navwindow.h
+4
-2
fmp_home_p.cpp
+9
-5
fmp_home_p.h
+5
-0
No files found.
fmp_home.cpp
View file @
b1ddd768
...
@@ -63,3 +63,10 @@ bool FMPHome::stopBlink(int blinkId)
...
@@ -63,3 +63,10 @@ bool FMPHome::stopBlink(int blinkId)
Q_D
(
FMPHome
);
Q_D
(
FMPHome
);
return
d
->
stopBlink
(
blinkId
);
return
d
->
stopBlink
(
blinkId
);
}
}
void
FMPHome
::
notification
(
const
QString
&
msg
,
const
QString
&
title
,
QSystemTrayIcon
::
MessageIcon
icon
,
int
mecs
)
{
Q_D
(
FMPHome
);
return
d
->
notification
(
msg
,
title
,
icon
,
mecs
);
}
fmp_home.h
View file @
b1ddd768
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define FMP_HOME_H
#define FMP_HOME_H
#include <QObject>
#include <QObject>
#include <QSystemTrayIcon>
#include "fmp_home_i.h"
#include "fmp_home_i.h"
...
@@ -30,6 +31,8 @@ public:
...
@@ -30,6 +31,8 @@ public:
int
blink
(
FMPluginInterface
*
plugin
,
const
QString
&
image
);
int
blink
(
FMPluginInterface
*
plugin
,
const
QString
&
image
);
bool
stopBlink
(
int
blinkId
);
bool
stopBlink
(
int
blinkId
);
void
notification
(
const
QString
&
msg
,
const
QString
&
title
=
QString
::
fromLocal8Bit
(
FMP_APPNAME
),
QSystemTrayIcon
::
MessageIcon
icon
=
QSystemTrayIcon
::
Information
,
int
mecs
=
1000
);
private
:
private
:
FMPHomePrivate
*
d_ptr
;
FMPHomePrivate
*
d_ptr
;
...
...
fmp_home_i.h
View file @
b1ddd768
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
#define FMP_HOME_I_H
#define FMP_HOME_I_H
#include <fmp_plugin_i.h>
#include <fmp_plugin_i.h>
#include <QSystemTrayIcon>
class
FMPHomeInterface
:
public
FMPluginInterface
class
FMPHomeInterface
:
public
FMPluginInterface
{
{
...
@@ -26,6 +27,18 @@ public:
...
@@ -26,6 +27,18 @@ public:
* @return bool 如果参数blinkId标识的闪烁不存在或已结束则返回false, 否则返回true
* @return bool 如果参数blinkId标识的闪烁不存在或已结束则返回false, 否则返回true
*/
*/
virtual
bool
stopBlink
(
int
blinkId
)
=
0
;
virtual
bool
stopBlink
(
int
blinkId
)
=
0
;
/**
* @brief notification
* 弹出一个Toast通知
* @param msg
* @param title
* @param icon
* @param mecs
*/
virtual
void
notification
(
const
QString
&
msg
,
const
QString
&
title
=
QString
::
fromLocal8Bit
(
FMP_APPNAME
),
QSystemTrayIcon
::
MessageIcon
icon
=
QSystemTrayIcon
::
Information
,
int
mecs
=
1000
)
=
0
;
};
};
Q_DECLARE_INTERFACE
(
FMPHomeInterface
,
"com.fmp.home"
)
Q_DECLARE_INTERFACE
(
FMPHomeInterface
,
"com.fmp.home"
)
...
...
fmp_home_navwindow.cpp
View file @
b1ddd768
...
@@ -316,7 +316,7 @@ void NavWindow::onNavImageChanged()
...
@@ -316,7 +316,7 @@ void NavWindow::onNavImageChanged()
"border: none;}"
"border: none;}"
).
arg
(
_navImage
));
).
arg
(
_navImage
));
}
}
void
NavWindow
::
showMessage
(
const
QString
&
message
)
void
NavWindow
::
showMessage
(
const
QString
&
title
,
const
QString
&
msg
,
QSystemTrayIcon
::
MessageIcon
icon
,
int
mecs
)
{
{
_systemTrayIcon
->
showMessage
(
QString
::
fromLocal8Bit
(
FMP_APPNAME
),
message
);
_systemTrayIcon
->
showMessage
(
title
,
msg
,
icon
,
mecs
);
}
}
fmp_home_navwindow.h
View file @
b1ddd768
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include <QSet>
#include <QSet>
#include <QString>
#include <QString>
#include <QFuture>
#include <QFuture>
#include <QSystemTrayIcon>
namespace
Ui
{
namespace
Ui
{
class
NavWindow
;
class
NavWindow
;
...
@@ -19,7 +20,6 @@ class QSequentialAnimationGroup;
...
@@ -19,7 +20,6 @@ class QSequentialAnimationGroup;
class
FMPSettingsInterface
;
class
FMPSettingsInterface
;
class
QStateMachine
;
class
QStateMachine
;
class
QState
;
class
QState
;
class
QSystemTrayIcon
;
class
FMPluginInterface
;
class
FMPluginInterface
;
/**
/**
...
@@ -76,7 +76,9 @@ public slots:
...
@@ -76,7 +76,9 @@ public slots:
* @brief showMessage
* @brief showMessage
* @param message
* @param message
*/
*/
void
showMessage
(
const
QString
&
message
);
void
showMessage
(
const
QString
&
title
,
const
QString
&
msg
,
QSystemTrayIcon
::
MessageIcon
icon
=
QSystemTrayIcon
::
Information
,
int
mecs
=
1000
);
signals
:
signals
:
void
menuBtnClicked
(
QString
btnName
);
void
menuBtnClicked
(
QString
btnName
);
...
...
fmp_home_p.cpp
View file @
b1ddd768
...
@@ -103,6 +103,12 @@ bool FMPHomePrivate::stopBlink(int blinkId)
...
@@ -103,6 +103,12 @@ bool FMPHomePrivate::stopBlink(int blinkId)
return
_navWindow
->
removeBlink
(
blinkId
);
return
_navWindow
->
removeBlink
(
blinkId
);
}
}
void
FMPHomePrivate
::
notification
(
const
QString
&
msg
,
const
QString
&
title
,
QSystemTrayIcon
::
MessageIcon
icon
,
int
mecs
)
{
_navWindow
->
showMessage
(
title
,
msg
,
icon
,
mecs
);
}
void
FMPHomePrivate
::
onPluginActived
(
FMPBaseInterface
*
plugin
)
void
FMPHomePrivate
::
onPluginActived
(
FMPBaseInterface
*
plugin
)
{
{
if
(
plugin
!=
nullptr
)
{
if
(
plugin
!=
nullptr
)
{
...
@@ -132,11 +138,9 @@ void FMPHomePrivate::onMenuBtnClicked(QString btnName)
...
@@ -132,11 +138,9 @@ void FMPHomePrivate::onMenuBtnClicked(QString btnName)
e
->
StartService
();
e
->
StartService
();
}
else
if
(
btnName
==
"vip"
)
{
}
else
if
(
btnName
==
"vip"
)
{
FMPVipInterface
*
e
=
q
->
GetService
<
FMPVipInterface
>
(
q
->
_ctx
);
FMPVipInterface
*
e
=
q
->
GetService
<
FMPVipInterface
>
(
q
->
_ctx
);
if
(
e
->
StartService
()
==
FMP_SUCCESS
)
{
e
->
StartService
();
_navWindow
->
showMessage
(
QString
::
fromLocal8Bit
(
"[非码会员]已启动"
));
}
else
if
(
btnName
==
"takeout"
)
{
}
// FMPTakeoutInterface *e = q->GetService<FMPTakeoutInterface>(q->_ctx);
}
else
if
(
btnName
==
"takeaway"
)
{
// FMPTakeawayInterface *e = q->GetService<FMPTakeawayInterface>(q->_ctx);
// e->StartService();
// e->StartService();
}
else
if
(
btnName
==
"coupons"
)
{
}
else
if
(
btnName
==
"coupons"
)
{
// FMPVipInterface *e = q->GetService<FMPVipInterface>(q->_ctx);
// FMPVipInterface *e = q->GetService<FMPVipInterface>(q->_ctx);
...
...
fmp_home_p.h
View file @
b1ddd768
#
ifndef
FMP_HOME_P_H
#
ifndef
FMP_HOME_P_H
#define FMP_HOME_P_H
#define FMP_HOME_P_H
#include <QSystemTrayIcon>
#include "fmp_home.h"
#include "fmp_home.h"
class
NavWindow
;
class
NavWindow
;
...
@@ -23,6 +25,9 @@ public:
...
@@ -23,6 +25,9 @@ public:
int
blink
(
FMPluginInterface
*
plugin
,
const
QString
&
image
);
int
blink
(
FMPluginInterface
*
plugin
,
const
QString
&
image
);
bool
stopBlink
(
int
blinkId
);
bool
stopBlink
(
int
blinkId
);
void
notification
(
const
QString
&
msg
,
const
QString
&
title
=
QString
::
fromLocal8Bit
(
FMP_APPNAME
),
QSystemTrayIcon
::
MessageIcon
icon
=
QSystemTrayIcon
::
Information
,
int
mecs
=
1000
);
public
slots
:
public
slots
:
void
onMenuBtnClicked
(
QString
btnName
);
void
onMenuBtnClicked
(
QString
btnName
);
void
onPluginActived
(
FMPBaseInterface
*
plugin
);
void
onPluginActived
(
FMPBaseInterface
*
plugin
);
...
...
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