Commit 2e50725e by Carwyn

1.导航模块独立项目上传

parent 854d709a
#include "fmnetwork.h"
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QEventLoop>
#include <QTimer>
#include <QDebug>
FMNetwork::FMNetwork(QObject *parent) :
QObject(parent),
_nam(new QNetworkAccessManager),
_req(new QNetworkRequest)
{
}
FMNetwork::~FMNetwork()
{
delete _nam;
delete _req;
}
bool FMNetwork::post(const QString &url, const QByteArray *reqData, QByteArray *rspData)
{
qDebug() << "Post Url: " << url;
qDebug() << "Post Data: " << *reqData;
_req->setUrl(url);
// 设置请求头
_req->setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
_req->setHeader(QNetworkRequest::ContentLengthHeader, reqData->length());
auto reply = _nam->post(*_req, *reqData);
// 使用定时器处理超时
QEventLoop loop;
connect(_nam, SIGNAL(finished(QNetworkReply*)), &loop, SLOT(quit()));
QTimer timer;
timer.setSingleShot(true);
connect(&timer, SIGNAL(timeout()),&loop,SLOT(quit()));
timer.start(1000 * 30);
loop.exec();
if(timer.isActive())
{
timer.stop();
if (reply->error() == QNetworkReply::NoError) {
*rspData = reply->readAll();
qDebug() << tr("Recv data: ") << QString::fromUtf8(*rspData);
} else {
_errorString = reply->errorString();
qDebug() << tr("Network error: %1").arg(_errorString);
return false;
}
}else{
_errorString = "Time out";
qDebug() << tr("Network error: %1").arg(_errorString);
return false;
}
return true;
}
#ifndef FMNETWORK_H
#define FMNETWORK_H
#include <QObject>
class QNetworkAccessManager;
class QNetworkRequest;
class FMNetwork : public QObject
{
Q_OBJECT
public:
explicit FMNetwork(QObject *parent = 0);
~FMNetwork();
/**
* @brief post
* @param url 请求地址
* @param reqData 请求数据
* @param rspData 返回数据
* @return 是否有错误
*/
bool post(const QString &url, const QByteArray *reqData, QByteArray *rspData);
QString errorString() const { return _errorString;}
private:
QNetworkAccessManager *_nam;
QNetworkRequest *_req;
QString _errorString;
};
#endif // FMNETWORK_H
#include "fmnumpad.h"
#include "ui_fmnumpad.h"
#include <QLineEdit>
FMNumPad::FMNumPad(QWidget *parent) :
QWidget(parent),
ui(new Ui::FMNumPad),
_lineEdit(nullptr)
{
ui->setupUi(this);
connect(ui->no0, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no1, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no2, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no3, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no4, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no5, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no6, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no7, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no8, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->no9, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
connect(ui->dot, &QPushButton::clicked, this, &FMNumPad::on_digit_clicked);
}
FMNumPad::~FMNumPad()
{
delete ui;
}
void FMNumPad::on_digit_clicked()
{
QString num_str = qobject_cast<QPushButton*>(sender())->text();
if(_lineEdit) {
_lineEdit->insert(num_str);
_lineEdit->setFocus();
}
emit digit_click(num_str);
}
void FMNumPad::on_backspace_btn_clicked()
{
if(_lineEdit) {
_lineEdit->backspace();
_lineEdit->setFocus();
}
emit digit_delete();
}
void FMNumPad::on_clear_btn_clicked()
{
if(_lineEdit) {
_lineEdit->clear();
_lineEdit->setFocus();
}
emit digit_clear();
}
void FMNumPad::on_confirm_btn_clicked()
{
emit digit_confirm();
}
void FMNumPad::setLineEdit(QLineEdit *lineEdit)
{
Q_ASSERT(nullptr != lineEdit);
this->_lineEdit = lineEdit;
}
#ifndef FMNUMPAD_H
#define FMNUMPAD_H
#include <QWidget>
class QLineEdit;
namespace Ui {
class FMNumPad;
}
class FMNumPad : public QWidget
{
Q_OBJECT
public:
explicit FMNumPad(QWidget *parent = 0);
~FMNumPad();
void setLineEdit(QLineEdit* lineEdit);
signals:
void digit_click(QString keynum);
void digit_delete();
void digit_clear();
void digit_confirm();
private slots:
void on_digit_clicked();
void on_backspace_btn_clicked();
void on_clear_btn_clicked();
void on_confirm_btn_clicked();
private:
Ui::FMNumPad *ui;
QLineEdit *_lineEdit;
};
#endif // FMNUMPAD_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FMNumPad</class>
<widget class="QWidget" name="FMNumPad">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>246</width>
<height>234</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget {
font: normal 22px &quot;Microsoft YaHei&quot;;
color: rgb(90,90,90);
}
#FMNumPad {
background: rgb(255,255,255);
border: 1 solid silver;
}
/*
* 标题栏
*/
#title {
background: rgb(61,65,77);
min-height: 32px; max-height: 32px;
border: 1 solid silver;
border-bottom: 0 solid silver;
}
#title_label {
margin-left: 4px;
font: normal 15px &quot;Microsoft YaHei&quot;;
color: rgb(252,252,252);
}
#close_btn {
min-width: 32px; min-height: 32px;
max-width: 32px; max-height: 32px;
border-image: url(&quot;:/img/btn_close.png&quot;);
background: transparent;
}
#close_btn:hover{
min-width: 31px; min-height: 31px;
max-width: 31px; max-height: 31px;
border-image: url(&quot;:/img/btn_alert_close.png&quot;);
}
QPushButton {
border: 1 solid silver;
border-radius: 2px;
min-width: 50px; min-height: 50px;
max-width: 50px; max-height: 50px;
color: rgb(120,120,120);
background: transparent;
}
QPushButton:hover {
background: #7aad65;
color: white;
padding: 2 0 0 2;
}
#no0 {
min-width: 106px;
max-width: 106px;}
#backspace_btn, #clear_btn {
font: normal 16px &quot;Microsoft YaHei&quot;;
}
#backspace_btn {
background-image: url(:/img/num_del.png);
}
#confirm_btn {
background: rgb(93,144,237);
font: 400 16px &quot;Microsoft YaHei&quot;;
color: white;
min-height: 106px;
max-height: 106px;
border: 0 solid white;
border-right: 1 solid silver;
}
#confirm_btn:hover {
padding: 2 0 0 2;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>8</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>10</number>
</property>
<property name="rightMargin">
<number>10</number>
</property>
<item row="1" column="3">
<widget class="QPushButton" name="clear_btn">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QPushButton" name="no0">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="no9">
<property name="text">
<string>9</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QPushButton" name="no6">
<property name="text">
<string>6</string>
</property>
</widget>
</item>
<item row="2" column="3" rowspan="2">
<widget class="QPushButton" name="confirm_btn">
<property name="text">
<string>确认</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="no1">
<property name="text">
<string>1</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="no2">
<property name="text">
<string>2</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="no3">
<property name="text">
<string>3</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="no5">
<property name="text">
<string>5</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QPushButton" name="no4">
<property name="text">
<string>4</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="backspace_btn">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="3" column="2">
<widget class="QPushButton" name="dot">
<property name="text">
<string>.</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="no7">
<property name="text">
<string>7</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="no8">
<property name="text">
<string>8</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
#include <fmp_logger_i.h>
#include "fmp_he_handlers.h"
#include "fmp_home.h"
FMPStartEventHandler::FMPStartEventHandler(ctkPluginContext *ctx, FMPHome *home)
: FMPHomeEventHandler(FMP_TOPICS_SERVICES FMPE_SERVICE_REQ_START "/*" , home),
_ctx(ctx)
{
FMPProps props;
props[ctkEventConstants::EVENT_TOPIC] = _topic;
_ctx->registerService<ctkEventHandler>(this, props);
}
void FMPStartEventHandler::handleEvent(const ctkEvent &event)
{
if (_home) {
QString ack_topic = event.getTopic();
//! com/fmp/services/REQ_START/id
ack_topic.replace(FMPE_SERVICE_REQ_START, FMPE_SERVICE_ACK_START);
FMPProps props;
props[FMP_PROPKEY_AGREED] = _home->isLogined();
_home->PostEvent(ack_topic, props);
}
else {
FMP_DEBUG_CTX(_ctx) << "No handler instance for event" << event.getTopic();
}
}
#ifndef FMP_MANAGER_EVENT_HANDLERS_H
#define FMP_MANAGER_EVENT_HANDLERS_H
#include <QObject>
#include <service/event/ctkEventConstants.h>
#include <service/event/ctkEventHandler.h>
class FMPHome;
class FMPHomeEventHandler : public ctkEventHandler
{
public:
explicit FMPHomeEventHandler(const QString &topic, FMPHome *home) : _home(home), _topic(topic) {}
protected:
FMPHome* _home;
const QString _topic;
};
class FMPStartEventHandler : public QObject, public FMPHomeEventHandler
{
Q_OBJECT
Q_INTERFACES(ctkEventHandler)
public:
explicit FMPStartEventHandler(ctkPluginContext *ctx, FMPHome *home);
void handleEvent(const ctkEvent &event);
private:
ctkPluginContext* _ctx;
};
#endif // FMP_MANAGER_EVENT_HANDLERS_H
#include "fmp_home_p.h"
#include <QVariant>
#include <ctkPluginContext.h>
FMPHome::FMPHome(ctkPluginContext *context)
: FMPHomeInterface(context),
d_ptr(new FMPHomePrivate(this)),
_inited(false)
{
}
FMPHome::~FMPHome()
{
delete d_ptr;
}
int FMPHome::StartService()
{
if (_inited) return FMP_SUCCESS;
Q_D(FMPHome);
return d->Init();
}
int FMPHome::StopService()
{
if (!_inited) return FMP_SUCCESS;
Q_D(FMPHome);
return d->Uninit();
}
void FMPHome::StartPlugins(const QVariantList &pids)
{
Q_D(FMPHome);
d->StartPlugins(pids);
}
int FMPHome::login()
{
Q_D(FMPHome);
return d->login();
}
bool FMPHome::isLogined()
{
Q_D(FMPHome);
return d->_isLogined;
}
QString FMPHome::userName()
{
Q_D(FMPHome);
return d->_userName;
}
int FMPHome::blink(FMPluginInterface *plugin, const QString &image)
{
Q_D(FMPHome);
return d->blink(plugin, image);
}
bool FMPHome::stopBlink(int blinkId)
{
Q_D(FMPHome);
return d->stopBlink(blinkId);
}
#ifndef FMP_HOME_H
#define FMP_HOME_H
#include <QObject>
#include "fmp_home_i.h"
class ctkPluginContext;
class FMPHomePrivate;
class FMPStartEventHandler;
class FMPHome : public QObject, public FMPHomeInterface
{
Q_OBJECT
Q_INTERFACES(FMPBaseInterface)
Q_INTERFACES(FMPHomeInterface)
Q_DECLARE_PRIVATE(FMPHome)
public:
explicit FMPHome(ctkPluginContext *context);
~FMPHome();
int StartService();
int StopService();
void StartPlugins(const QVariantList &pids);
int login();
bool isLogined();
QString userName();
int blink(FMPluginInterface *plugin, const QString &image);
bool stopBlink(int blinkId);
private:
FMPHomePrivate *d_ptr;
bool _inited;
friend class FMPStartEventHandler;
};
#endif // FMP_HOME_H
#-------------------------------------------------
#
# Project created by QtCreator 2017-02-16T11:47:22
#
#-------------------------------------------------
TEMPLATE = lib
QT += core gui network concurrent
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
SOURCES +=\
fmp_home.cpp \
fmp_home_plugin.cpp \
fmp_home_p.cpp \
fmp_home_navwindow.cpp \
menubutton.cpp \
fmp_wnd.cpp \
fmp_login.cpp \
fmnetwork.cpp \
fmp_he_handlers.cpp \
fmnumpad.cpp \
fmp_home_settings.cpp
HEADERS += fmp_home.h \
fmp_home_plugin_p.h \
fmp_home_i.h \
fmp_home_p.h \
fmp_home_navwindow.h \
fmp_wnd.h \
fmp_login.h \
menubutton.h \
fmnetwork.h \
fmp_he_handlers.h \
fmnumpad.h \
fmp_home_settings.h
FORMS += \
fmp_home_navwindow.ui \
fmp_login.ui \
fmnumpad.ui
unix {
target.path = /usr/lib
INSTALLS += target
}
#Target name
VER = $$system($$PWD/../fmprc.bat $$TARGET)
ORIGIN_TARGET = $$TARGET
TARGET = $${TARGET}_$${VER}
#Header path
INCLUDEPATH += $$PWD/../include/ctk \
+= $$PWD/../include/interface \
#Library path
LIBS += -L$$PWD/../lib
CONFIG(debug, debug|release) {
#Linking library
LIBS += -lCTKCored -lCTKPluginFrameworkd
#Destination path
DESTDIR = $$PWD/../debug/plugins
} else {
LIBS += -lCTKCore -lCTKPluginFramework
DESTDIR = $$PWD/../release/plugins
}
#
RESOURCES += \
res/$${ORIGIN_TARGET}.qrc \
res/img.qrc
win32 {
RC_FILE += res/$${ORIGIN_TARGET}.rc
system($$PWD/../fmprc.bat $$PWD/version.h $$ORIGIN_TARGET)
}
else {
system($$PWD/../fmprc.sh $$PWD/version.h $$ORIGIN_TARGET)
}
#ifndef FMP_HOME_I_H
#define FMP_HOME_I_H
#include <fmp_plugin_i.h>
class FMPHomeInterface : public FMPluginInterface
{
public:
explicit FMPHomeInterface(ctkPluginContext *ctx) : FMPluginInterface(ctx) {}
virtual int login() = 0;
virtual bool isLogined() = 0;
virtual QString userName() = 0;
/**
* @brief blink
* 在导航窗口中闪烁某张图片,并在下次点击导航窗口时唤起传入的插件
* @param plugin 要换起的插件对象
* @param image 要闪烁的图片地址
* @return int 此闪烁的标识id,可调用stopBlink(int blinkId)结束此闪烁
*/
virtual int blink(FMPluginInterface *plugin, const QString &image) = 0;
/**
* @brief stopBlink
* 结束某个闪烁
* @param blinkId 创建blink时返回的闪烁标识id
* @return bool 如果参数blinkId标识的闪烁不存在或已结束则返回false, 否则返回true
*/
virtual bool stopBlink(int blinkId) = 0;
};
Q_DECLARE_INTERFACE(FMPHomeInterface, "com.fmp.home")
#endif // FMP_HOME_I_H
#ifndef NAVWINDOW_H
#define NAVWINDOW_H
#include <QDialog>
#include <vector>
#include <QQueue>
#include <QSet>
#include <QString>
#include <QFuture>
namespace Ui {
class NavWindow;
}
class QButtonGroup;
class QAbstractButton;
class QParallelAnimationGroup;
class QSequentialAnimationGroup;
class FMPSettingsInterface;
class QStateMachine;
class QState;
class QSystemTrayIcon;
class FMPluginInterface;
/**
* struct BlinkObject '闪烁'结构体
* id: 闪烁对象的id
* plugin: 闪烁结束时回调的插件对象
* image: 闪烁的图片
**/
typedef struct {
int id;
FMPluginInterface *plugin;
QString image;
} BlinkObject;
class NavWindow : public QDialog
{
Q_OBJECT
Q_PROPERTY(QString navImage READ navImage WRITE setNavImage NOTIFY navImageChanged)
public:
explicit NavWindow(QWidget *parent = 0);
~NavWindow();
QString navImage() const;
void setNavImage(const QString &image);
public slots:
/**
* @brief spreadMenus
* 展开或关闭菜单按钮
* @param isSpread
*/
void spreadMenus(const bool isSpread);
/**
* @brief addBlink
* 向闪烁队列中添加一个闪烁对象
* @param plugin 闪烁对象的plugin
* @param image 闪烁对象的image
* @return 返回该闪烁的id
*/
int addBlink(FMPluginInterface *plugin, const QString &image);
/**
* @brief removeBlink
* 从闪烁队列中移除一个闪烁
* @param blinkId 要移除的闪烁对象的id
* @return 是否成功
*/
bool removeBlink(int blinkId);
signals:
void menuBtnClicked(QString btnName);
/**
* @brief startBlink
* 此信号使状态机进入stateBlink
*/
void startBlink();
/**
* @brief stopBlink
* 此信号使状态机退出stateBlink
*/
void stopBlink();
/**
* @brief pluginActived
* 此信号在状态机在stateBlink并且点击导航按钮时发出
* @param plugin blinkObject的plugin
*/
void pluginActived(FMPluginInterface* plugin);
void navImageChanged();
private slots:
void onMenuBtnClicked(QAbstractButton*);
void onMoved(QPoint point);
void onNavImageChanged();
private:
Ui::NavWindow *ui;
QButtonGroup* _btn_group;
QList<QAction*> actions;
std::vector<QRect> _btnsGeometry;
QParallelAnimationGroup* _animationShow;
QRect _centerGeometry;
QStateMachine *_stateMachine;
QState *stateGroup;
QState *stateDefault;
QState *stateSpread;
QState *stateBlink;
QString _navImage;
//! 标识状态机是否在stateBlink状态
//! 之所以没用bool QState::active()方法是因为多进程同步问题
bool _isStateBlink;
//! 闪烁队列、闪烁id的set及执行闪烁的进程future
QQueue<BlinkObject> _blinkObjQueue;
QSet<int> _blinkObjIdSet;
QFuture<void> _blinkFuture;
//! System tray icon.
QSystemTrayIcon *_systemTrayIcon;
private:
void initSystemTrayIcon();
void initMenu();
void blink();
private:
/**
* @brief btns
* pair.first: Button的objcetName, icon文件的名字。
* pair.second: 托盘中显示的按钮名字
*/
std::vector<std::pair<QString, QString>> btns;
const double PI;
struct MenuUiProps
{
int distance;
double beginAngle;
double endAngle;
double interval;
};
MenuUiProps MenuUiProp;
bool isUseAnimation;
};
#endif // NAVWINDOW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NavWindow</class>
<widget class="QDialog" name="NavWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>315</height>
</rect>
</property>
<property name="windowTitle">
<string>NavWindow</string>
</property>
<property name="styleSheet">
<string notr="true">#navMainBtn {
background: url(:fm-icon_01) center no-repeat;
border: none;
}
QPushButton {
min-width:60px;
min-height:60px;
}
QPushButton:hover {
border: 5px solid;
}
#tool {
border-image: url(:tool);
}
#tool:pressed {
border-image: url(:tool_onclick);
}
#payment {
border-image: url(:payment);
}
#payment:pressed {
border-image: url(:payment_onclick);
}
#vip {
border-image: url(:member02);
}
#vip:pressed {
border-image: url(:member02_onclick);
}</string>
</property>
<widget class="MenuButton" name="navMainBtn" native="true">
<property name="geometry">
<rect>
<x>140</x>
<y>90</y>
<width>124</width>
<height>124</height>
</rect>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text" stdset="0">
<string/>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>MenuButton</class>
<extends>QWidget</extends>
<header>menubutton.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
#include "fmp_home_p.h"
#include "fmp_home_navwindow.h"
#include <fmp_logger_i.h>
#include <ctkPluginContext.h>
#include <ctkServiceReference.h>
#include <QDebug>
#include <fmp_epay_i.h>
#include <fmp_settings_i.h>
#include <QApplication>
#include "fmp_login.h"
#include "fmp_he_handlers.h"
#include "fmp_home_settings.h"
FMPHomePrivate::FMPHomePrivate(FMPHome *q)
: q_ptr(q),
_isLogined(false),
_userName(""),
_errorMsg("")
{
}
FMPHomePrivate::~FMPHomePrivate()
{
Uninit();
}
int FMPHomePrivate::Init()
{
Q_Q(FMPHome);
FMPLoggerInterface* logger = q->GetService<FMPLoggerInterface>(q->_ctx);
_settings = q->GetService<FMPSettingsInterface>(q->_ctx);
FMPHomeSettings::instance()->init(_settings, logger);
_navWindow = new NavWindow;
FMPStartEventHandler* handler = new FMPStartEventHandler(q->_ctx, q);
_navWindow->show();
connect(_navWindow, SIGNAL(menuBtnClicked(QString)), this, SLOT(onMenuBtnClicked(QString)));
connect(_navWindow, &NavWindow::pluginActived, this, &FMPHomePrivate::onPluginActived);
q->_inited = true;
return FMP_SUCCESS;
}
int FMPHomePrivate::Uninit()
{
Q_Q(FMPHome);
// 关闭导航窗口
if (!_navWindow) {
_navWindow->close();
}
delete _navWindow;
_navWindow = 0;
q->_inited = false;
return FMP_SUCCESS;
}
void FMPHomePrivate::StartPlugins(const QVariantList &pids)
{
HOME_DEBUG() << pids;
}
int FMPHomePrivate::login()
{
FMPLogin loginWnd;
loginWnd.exec();
if(loginWnd.isLogined()) {
_isLogined = true;
_userName = loginWnd.userName();
return FMP_SUCCESS;
} else {
_isLogined = false;
return FMP_FAILURE;
}
}
int FMPHomePrivate::blink(FMPluginInterface *plugin, const QString &image)
{
int blinkId = _navWindow->addBlink(plugin, image);
return blinkId;
}
bool FMPHomePrivate::stopBlink(int blinkId)
{
return _navWindow->removeBlink(blinkId);
}
void FMPHomePrivate::onPluginActived(FMPBaseInterface *plugin)
{
if(plugin != nullptr) {
plugin->StartService();
}
}
void FMPHomePrivate::onMenuBtnClicked(QString btnName)
{
Q_Q(FMPHome);
FMP_DEBUG_CTX(q->_ctx) << "Menu clicked: " << btnName;
if(btnName == "quit") {
FMP_DEBUG_CTX(q->_ctx) << "Will Quit!";
q->PostEvent(FMP_TOPICS_QUIT);
return;
}
if(!_isLogined && btnName!="tool") {
if(login() != FMP_SUCCESS) {
return;
}
}
if(btnName == "payment") {
FMPePayInterface *e = q->GetService<FMPePayInterface>(q->_ctx);
e->StartService();
} else if(btnName == "tool") {
HOME_DEBUG() << "tool menu";
}
}
#ifndef FMP_HOME_P_H
#define FMP_HOME_P_H
#include "fmp_home.h"
class NavWindow;
class FMPLogin;
class FMPSettingsInterface;
class FMPHomePrivate : public QObject
{
Q_OBJECT
Q_DECLARE_PUBLIC(FMPHome)
public:
explicit FMPHomePrivate(FMPHome *q);
~FMPHomePrivate();
int Init();
int Uninit();
void StartPlugins(const QVariantList &pids);
int login();
int blink(FMPluginInterface *plugin, const QString &image);
bool stopBlink(int blinkId);
public slots:
void onMenuBtnClicked(QString btnName);
void onPluginActived(FMPBaseInterface* plugin);
public:
FMPHome *q_ptr;
bool _isLogined;
QString _userName;
QString _errorMsg;
private:
NavWindow *_navWindow;
FMPSettingsInterface *_settings;
};
#endif // FMP_HOME_P_H
#include "fmp_home_plugin_p.h"
#include "fmp_home.h"
#include <QtPlugin>
FMPHomePlugin::FMPHomePlugin()
:_home_service(0)
{
}
void FMPHomePlugin::start(ctkPluginContext *context)
{
_home_service = new FMPHome(context);
context->registerService<FMPHomeInterface>(_home_service);
}
void FMPHomePlugin::stop(ctkPluginContext *context)
{
Q_UNUSED(context)
if (_home_service)
{
delete _home_service;
_home_service = 0;
}
}
#if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
Q_EXPORT_PLUGIN2(fmp_home, FMPHomePlugin)
#endif
#ifndef FMP_HOME_PLUGIN_P_H
#define FMP_HOME_PLUGIN_P_H
#include <ctkPluginActivator.h>
class FMPHome;
class FMPHomePlugin : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_INTERFACES(ctkPluginActivator)
#if (QT_VERSION > QT_VERSION_CHECK(5,0,0))
Q_PLUGIN_METADATA(IID "fmp_home")
#endif
public:
explicit FMPHomePlugin();
void start(ctkPluginContext *context);
void stop(ctkPluginContext *context);
private:
FMPHome* _home_service;
};
#endif // FMP_HOME_PLUGIN_P_H
#include "fmp_home_settings.h"
#include <fmp_settings_i.h>
#include <QDebug>
FMPHomeSettings::FMPHomeSettings(QObject *parent) : QObject(parent)
{
}
FMPHomeSettings *FMPHomeSettings::instance()
{
static FMPHomeSettings homeSettings;
return &homeSettings;
}
void FMPHomeSettings::init(FMPSettingsInterface *settings, FMPLoggerInterface *logger)
{
this->_settings = settings;
this->_logger = logger;
}
FMPLoggerInterface *FMPHomeSettings::getLogger()
{
return _logger;
}
bool FMPHomeSettings::getIsUseAnimation()
{
return _GetValue(FMP_INIKEY_HOMEANIMATION).toBool();
}
bool FMPHomeSettings::setIsUseAnimation(bool isUse)
{
return _SetValue(FMP_INIKEY_HOMEANIMATION, isUse);
}
QPoint FMPHomeSettings::getWindowPosition()
{
QStringList posList = _GetValue(FMP_INIKEY_HOMEPOSITION).toStringList();
if(posList.length() == 2) {
return QPoint(posList[0].toInt(), posList[1].toInt());
}
return QPoint(50, 50);
}
bool FMPHomeSettings::setWindowPosition(QPoint point)
{
QStringList posList;
posList << QString::number(point.x());
posList << QString::number(point.y());
return _SetValue(FMP_INIKEY_HOMEPOSITION, posList);
}
QString FMPHomeSettings::getServer()
{
return _GetValue(FMP_INIKEY_LOGINSERVER).toString();
}
QString FMPHomeSettings::getPartnerId()
{
return _GetValue(FMP_INIKEY_LOGINPARTNERID).toString();
}
QString FMPHomeSettings::getStroeId()
{
return _GetValue(FMP_INIKEY_LOGINSTOREID).toString();
}
QVariant FMPHomeSettings::_GetValue(const QString &key, QVariant defaultValue)
{
if (_settings) {
return _settings->GetValue(key);
}
else {
HOME_WARN() << "Settings service not available";
}
return defaultValue;
}
bool FMPHomeSettings::_SetValue(const QString &key, QVariant value)
{
if (_settings) {
_settings->SetValue(key, value);
return true;
}
else {
HOME_WARN() << "Settings service not available";
}
return false;
}
#ifndef FMP_VIP_SETTINGS_H
#define FMP_VIP_SETTINGS_H
#include <QObject>
#include <QVariant>
#include <fmp_logger_i.h>
class FMPSettingsInterface;
class FMPHomeSettings : public QObject
{
Q_OBJECT
public:
static FMPHomeSettings *instance();
void init(FMPSettingsInterface *settings, FMPLoggerInterface *logger);
FMPLoggerInterface *getLogger();
/**
* @brief getIsUseAnimation
* 获取/设置动画开关配置
* @return
*/
bool getIsUseAnimation();
bool setIsUseAnimation(bool isUse);
/**
* @brief getWindowPos
* 获取/设置窗口的位置
* @return
*/
QPoint getWindowPosition();
bool setWindowPosition(QPoint point);
/**
* @brief getServer
* 获取登录认证服务器地址
* @return
*/
QString getServer();
/**
* @brief getPartnerId
* 获取登录认证商户号
* @return
*/
QString getPartnerId();
/**
* @brief getStroeId
* 获取登录认证门店号
* @return
*/
QString getStroeId();
private:
explicit FMPHomeSettings(QObject *parent = 0);
QVariant _GetValue(const QString &key, QVariant defaultValue = 0);
bool _SetValue(const QString &key, QVariant value);
private:
FMPSettingsInterface *_settings;
FMPLoggerInterface *_logger;
};
#define HOME_DEBUG() FMP_DEBUG(FMPHomeSettings::instance()->getLogger())
#define HOME_INFO() FMP_INFO(FMPHomeSettings::instance()->getLogger())
#define HOME_WARN() FMP_WARN(FMPHomeSettings::instance()->getLogger())
#define HOME_ERROR() FMP_ERROR(FMPHomeSettings::instance()->getLogger())
#endif // FMP_VIP_SETTINGS_H
#include "fmp_login.h"
#include "ui_fmp_login.h"
#include "fmp_home_settings.h"
#include <QMessageBox>
#include <QDesktopWidget>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include "fmnetwork.h"
#include <QDebug>
FMPLogin::FMPLogin(QDialog *parent) :
FMPWnd(parent),
ui(new Ui::FMPLogin),
_userName(""),
_errorMsg("")
{
ui->setupUi(this);
connect(ui->numpad, SIGNAL(digit_confirm()), this, SLOT(on_login_btn_clicked()));
connect(qApp, &QApplication::focusChanged, this, &FMPLogin::onFocusChanged);
setAttribute(Qt::WA_QuitOnClose, false);
_url = FMPHomeSettings::instance()->getServer();
_storeId = FMPHomeSettings::instance()->getStroeId();
_partnerId = FMPHomeSettings::instance()->getPartnerId();
}
FMPLogin::~FMPLogin()
{
delete ui;
}
void FMPLogin::on_login_btn_clicked()
{
this->setEnabled(false);
if(login(ui->user_edit->text(), ui->pwd_edit->text())) {
this->close();
} else {
QMessageBox::critical(this, "Login Failed", _errorMsg);
this->setEnabled(true);
ui->pwd_edit->clear();
ui->pwd_edit->setFocus();
}
}
bool FMPLogin::login(QString userName, QString password)
{
_userName = "";
QByteArray reqData = tr("{\"StoreId\": \"%1\",\"PartnerId\": \"%2\",\"UserId\": \"%3\",\"Pwd\": \"%4\"}")
.arg(_storeId)
.arg(_partnerId)
.arg(userName)
.arg(password).toLatin1();
QByteArray rspData;
FMNetwork net;
if(net.post(_url, &reqData, &rspData)) {
// 解析返回的数据
QJsonParseError error;
QJsonDocument json = QJsonDocument::fromJson(rspData, &error);
if(error.error == QJsonParseError::NoError) {
QJsonObject job = json.object();
if(job["Code"] == 1000) {
_userName = job["Data"].toObject()["UserId"].toString();
} else{
_errorMsg = job["Msg"].toString();
}
} else {
_errorMsg = error.errorString();
}
}
return isLogined();
}
void FMPLogin::onFocusChanged(QWidget *, QWidget *now)
{
if(ui->user_edit == now || ui->pwd_edit == now) {
ui->numpad->setLineEdit(qobject_cast<QLineEdit*>(now));
}
}
#ifndef FMP_LOGIN_H
#define FMP_LOGIN_H
#include "fmp_wnd.h"
namespace Ui {
class FMPLogin;
}
class FMPLogin : public FMPWnd
{
Q_OBJECT
public:
explicit FMPLogin(QDialog *parent = 0);
~FMPLogin();
/**
* @brief login
* @param userName
* @param password
* @return
*/
bool login(QString userName, QString password);
bool isLogined() {return _userName != "";}
QString userName() {return _userName;}
QString errorMsg() {return _errorMsg;}
private slots:
void on_login_btn_clicked();
void onFocusChanged(QWidget*, QWidget* now);
private:
Ui::FMPLogin *ui;
QString _userName;
QString _errorMsg;
QString _url;
QString _storeId;
QString _partnerId;
};
#endif // FMP_LOGIN_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FMPLogin</class>
<widget class="QWidget" name="FMPLogin">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>480</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<property name="styleSheet">
<string notr="true">#FMPLogin {
background: rgb(255,255,255);
}
QWidget {
font: normal 22px &quot;Microsoft YaHei&quot;;
color: rgb(90,90,90);
}
/*
* 标题栏
*/
#title {
background: rgb(61,65,77);
min-height: 48px; max-height: 48px;
border: 1 solid silver;
border-bottom: 0 solid silver;
}
#logo_label {
min-height: 48px;
color: rgb(252,252,252);
}
#close_btn {
min-width: 50px; min-height: 50px;
border-image: url(&quot;:/img/btn_close.png&quot;);
margin-right: 12px;
}
#close_btn:hover{
min-width: 51px; min-height: 51px;
border-image: url(&quot;:/img/btn_alert_close.png&quot;);
}
/*
* 信息
*/
#tip, #tip QLabel {
background: rgb(186,186,186);
color: rgb(252,252,252);
font-size: 14px;
border-bottom: 1 solid silver;
}
#tip {
min-height: 0px; max-height: 0px;
border: 1 solid silver;
border-top: 0;
}
/*
* 主界面
*/
QLineEdit {
min-height: 49px;
font: 100 19px &quot;Microsoft YaHei&quot;;
color: rgb(50,50,50);
background: white;
border: 1 solid silver;
}
#login_btn {
min-height: 56px;
background: rgb(93,144,237);
font: 400 23px &quot;Microsoft YaHei&quot;;
color: white;
border: 1 solid white;
border-right: 0 solid silver;
}
#login_btn:hover {
padding: 2 0 0 2;
}
#numpad {
min-width: 0; min-height:0;
max-width: 0; max-height:0;
}</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QWidget" name="title" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="logo_label">
<property name="text">
<string>非码</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="close_btn">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="main">
<property name="spacing">
<number>40</number>
</property>
<property name="leftMargin">
<number>130</number>
</property>
<property name="rightMargin">
<number>130</number>
</property>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>30</number>
</property>
<item>
<widget class="QLineEdit" name="user_edit">
<property name="text">
<string/>
</property>
<property name="placeholderText">
<string>账号</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="pwd_edit">
<property name="echoMode">
<enum>QLineEdit::Password</enum>
</property>
<property name="placeholderText">
<string>密码</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="login_btn">
<property name="text">
<string>登录</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="FMNumPad" name="numpad" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QWidget" name="tip" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>20</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>20</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="operator_desc_label">
<property name="text">
<string>操作员:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="operator_label">
<property name="text">
<string>00000</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="bd_desc_label_2">
<property name="text">
<string>营业日:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="bd_desc_label">
<property name="text">
<string>2017-02-20</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>FMNumPad</class>
<extends>QWidget</extends>
<header>fmnumpad.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>close_btn</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
#include "fmp_wnd.h"
#include <QDesktopWidget>
#include <QStyleOption>
#include <QPainter>
#ifdef Q_OS_WIN
#include <windows.h>
#include <windowsx.h>
#endif
FMPWnd::FMPWnd(QDialog *parent)
: QDialog(parent)
{
setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
setAttribute(Qt::WA_TranslucentBackground);
}
FMPWnd::~FMPWnd()
{
}
int FMPWnd::exec()
{
showNormal();
// ::SetForegroundWindow((HWND)effectiveWinId());
// ::SetWindowPos( (HWND)effectiveWinId(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
// showFullScreen();
// ::SetForegroundWindow((HWND)effectiveWinId());
QDesktopWidget w;
QRect rc = w.availableGeometry();
setGeometry((rc.width()-width())/2, (rc.height()-height())/2, width(), height());
return QDialog::exec();
}
void FMPWnd::on_close_btn_clicked()
{
this->done(-1);
}
#ifdef Q_OS_WIN
//! Gui class member of platform
bool FMPWnd::nativeEvent(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(eventType)
MSG* msg = (MSG*)message;
//! true indicates the message need to be processed by DefWindowProc
bool fCallDWP = true;
bool fMsgDone = false;
switch (msg->message) {
case WM_NCHITTEST: {
*result = winHCHitTest(msg);
if(*result != HTNOWHERE) {
// HTMINBUTTON 等消息当作HTCLIENT处理
switch (*result) {
case HTMINBUTTON:
case HTMAXBUTTON:
case HTCLOSE:
*result = HTCLIENT;
break;
}
fCallDWP = false;
}
break;
}
case WM_GETMINMAXINFO: {
// 最大化时的处理
MINMAXINFO *mmi = (MINMAXINFO*)(msg->lParam);
QDesktopWidget desktopWidget;
QRect desktop = desktopWidget.availableGeometry();
mmi->ptMaxSize.x = desktop.width();
mmi->ptMaxSize.y = desktop.height();
mmi->ptMaxPosition.x = desktop.x();
mmi->ptMaxPosition.y = desktop.y();
mmi->ptMinTrackSize.x = minimumWidth(); // mininum width for your window
mmi->ptMinTrackSize.y = minimumHeight();
mmi->ptMaxTrackSize.x = maximumWidth();
mmi->ptMaxTrackSize.y = maximumHeight();
*result = 0;
fMsgDone = true;
break;
}
case WA_INACTIVE: {
activateWindow();
break;
}
default:
break;
}
fMsgDone = fMsgDone || !fCallDWP;
return fMsgDone;
}
void FMPWnd::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event);
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
long FMPWnd::winHCHitTest(MSG *msg)
{
// Mouse position
QPoint mouse_pos(GET_X_LPARAM(msg->lParam), GET_Y_LPARAM(msg->lParam));
QRect window_rect = geometry();
// Set default value (HTNOWHERE) (1,1).
USHORT uRow = 1;
USHORT uCol = 1;
bool fOnResizeBorder = false;
// //! Test caption area
// QRegion m_children_region(0, 0, width()-54, 60);
// QRegion new_region = m_children_region.translated(window_rect.x(), window_rect.y());
// if (new_region.contains(mouse_pos)) {
// //! Title regions contains the mouse position, treat it as caption area
// uRow = 0;
// }
// Hit test (HTTOPLEFT, ... HTBOTTOMRIGHT)
LRESULT hitTests[3][3] =
{
{HTTOPLEFT, fOnResizeBorder ? HTTOP : HTCAPTION, HTTOPRIGHT},
{HTLEFT, HTNOWHERE, HTRIGHT},
{HTBOTTOMLEFT, HTBOTTOM, HTBOTTOMRIGHT},
};
//! Test borders area
if (minimumSize() != maximumSize()) {
//! To be implemented
}
return hitTests[uRow][uCol];
}
#endif
#ifndef FMP_WND_H
#define FMP_WND_H
#include <QDialog>
class FMPWnd : public QDialog
{
Q_OBJECT
public:
explicit FMPWnd(QDialog* parent = 0);
~FMPWnd();
int exec();
public slots:
void on_close_btn_clicked();
#ifdef Q_OS_WIN
protected:
bool nativeEvent(const QByteArray &eventType, void *message, long *result);
void paintEvent(QPaintEvent *event);
long winHCHitTest(MSG* msg);
#endif
};
#endif // FMP_WND_H
#include "menubutton.h"
#include <QDebug>
MenuButton::MenuButton(QWidget *parent)
: QPushButton(parent),
_mouseMove(false),
_mousePress(false),
_canMove(false),
_movedItem(nullptr)
{
}
void MenuButton::setMovedItem(QWidget *item)
{
Q_ASSERT(item!=0);
this->_movedItem = item;
}
void MenuButton::mousePressEvent(QMouseEvent *e)
{
if (e->button()==Qt::LeftButton)
{
_mousePress = true;
_lastMousePos = e->globalPos();
_canMove = false;
}
QPushButton::mousePressEvent(e);
return;
}
void MenuButton::mouseMoveEvent(QMouseEvent *e)
{
if (_movedItem && _mousePress && (e->buttons()==Qt::LeftButton))
{
QPoint moved = e->globalPos() - _lastMousePos;
// 防止因抖动误拖动
if(_canMove || (abs(moved.x())>10 || abs(moved.y())>10)) {
_movedItem->move(_movedItem->pos() + moved);
_lastMousePos = e->globalPos();
_mouseMove = true;
_canMove = true;
}
}
return;
}
void MenuButton::mouseReleaseEvent(QMouseEvent *e)
{
if (e->button()==Qt::LeftButton)
{
_mousePress = false;
if(_canMove) {
emit moved(_movedItem->pos());
}
}
if(!_mouseMove)
{
QPushButton::mouseReleaseEvent(e);
}
_mouseMove = false;
return;
}
#ifndef MENUBUTTON_H
#define MENUBUTTON_H
#include <QPushButton>
#include <QMouseEvent>
class MenuButton : public QPushButton
{
Q_OBJECT
public:
explicit MenuButton(QWidget* parent = 0);
void setMovedItem(QWidget *item);
protected:
void mouseMoveEvent(QMouseEvent * e);
void mousePressEvent(QMouseEvent * e);
void mouseReleaseEvent(QMouseEvent * e);
signals:
void moved(QPoint point);
private:
bool _mouseMove;
bool _mousePress;
bool _canMove;
QPoint _lastMousePos;
QWidget* _movedItem;
};
#endif // MENUBUTTON_H
Plugin-SymbolicName: fmp.home
Plugin-Version: 0.1.0
Plugin-Name: fmp.home
Plugin-Copyright: Freemud Ltd. Copyright (C) 2014-2017
Plugin-Vendor: Freemud
<RCC>
<qresource prefix="/fmp.home/META-INF">
<file>MANIFEST.MF</file>
</qresource>
</RCC>
File added
<RCC>
<qresource prefix="/">
<file alias="xiaoxi">img/消息.png</file>
<file>img/btn_close.png</file>
<file>img/num_del.png</file>
<file alias="fm-icon_01">img/fm-icon_01.png</file>
<file alias="payment">img/fm-icon_payment.png</file>
<file alias="payment_onclick">img/fm-icon_payment_onclick.png</file>
<file alias="tool">img/fm-icon_tool.png</file>
<file>img/btn_alert_close.png</file>
<file alias="fm-icon_02">img/fm-icon_02.png</file>
<file alias="tool_onclick">img/fm-icon_tool_onclick.png</file>
<file alias="fm-icon_tray">img/fm-icon_tray.png</file>
</qresource>
</RCC>
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by fmproxy_service.rc
// ¶һĬֵ
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#ifndef _VERSION_H_
#define _VERSION_H_
#define VER_MAJOR 0
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 35
//! Convert version numbers to string
#define _STR(S) #S
#define STR(S) _STR(S)
#define _MAK_VER(maj, min, rev, build) STR(##maj.##min.##rev.##build\0)
#define MAK_VER(maj, min, rev, build) _MAK_VER(maj, min, rev, build)
//! Resource version infomation
#define RES_FILE_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_PRODUCT_VER VER_MAJOR,VER_MINOR,VER_REVISION,VER_BUILD
#define RES_STR_FILE_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_STR_PRODUCT_VER MAK_VER(VER_MAJOR, VER_MINOR, VER_REVISION, VER_BUILD)
#define RES_COMPANY_NAME "上海非码网络科技有限公司\0"
#define RES_COPYRIGHT "Freemud Ltd. Copyright (C) 2014-2017\0"
#define RES_FILE_DESC "fmp.home\0"
#define RES_INTER_NAME "fmp.home\0"
#define RES_FILE_NAME "fmp.home\0"
#define RES_PRODUCT_NAME "fmp.home\0"
#define RES_FILE_EXT "*\0"
#endif //!_VERSION_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment