Commit b1018e6d by Carwyn

1.配置文件 Key 使用宏

parent 1398ffa3
#include "HttpSocket.h"
#include "HttpSocket.h"
#include "Tool//configManger.h"
#include "global/preDefine.h"
#include <QEventLoop>
......@@ -35,7 +35,7 @@ HttpSocket::~HttpSocket()
connect(reply, SIGNAL(finished()), &eventLoop, SLOT(quit()));
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), &eventLoop, SLOT(quit()));
// m_time->singleShot(VALUE_NETTIMEOUT, &eventLoop, &QEventLoop::quit);
m_time->singleShot(VALUE_NETTIMEOUT, &eventLoop, &QEventLoop::quit);
eventLoop.exec();
if(reply)
{
......
......@@ -2,6 +2,8 @@
#include <QApplication>
#include "global/preDefine.h"
#include "fmp_takeout_def.h"
#include <fmp_printer_i.h>
ConfigManger &ConfigManger::GetInstance()
{
......@@ -46,17 +48,17 @@ void ConfigManger::SetSqlConnectInfo(const ConfigManger::SqlConnectInfo &info)
QUrl ConfigManger::GetServerUrl()
{
return m_config->value(INI_SERVER).toUrl();
return m_config->value(FMP_INIKEY_TAKEOUTSERVER).toUrl();
}
QString ConfigManger::GetPrinterName()
{
return m_userConfig->value(INI_PRINTERNAME).toString();
return m_userConfig->value(FMP_INIKEY_PRINTERNAME).toString();
}
void ConfigManger::SetPrinterName(const QString &printer)
{
m_userConfig->setValue(INI_PRINTERNAME, printer);
m_userConfig->setValue(FMP_INIKEY_PRINTERNAME, printer);
}
QPoint ConfigManger::GetFloatInitPostion()
......@@ -86,7 +88,7 @@ int ConfigManger::GetListenPort()
QString ConfigManger::GetAutoConfirm()
{
return m_Autoconfirm->value(INI_AUTOCONFIRM).toString();
return m_Autoconfirm->value(FMP_INIKEY_TAKEOUTAUTO).toString();
}
//=================test================//
QString ConfigManger::GetTestStoreName()
......
......@@ -13,9 +13,16 @@
#include "Ui/DbsetForm.h"
#include "Ui/FloatWidget.h"
#include "Ui/MainWindow.h"
#include "fmp_takeout_def.h"
#include <fmp_home_i.h>
#ifdef Q_OS_WIN
#include "windows.h"
#endif
using namespace QsLogging;
ThreadController* g_threadCtl = 0;
#if 0
fm_post FM_Networkpost = 0;
......@@ -455,10 +462,10 @@ bool InitClass::GetStoreInfo(QString &m_storeid,QString &m_posid,QString &m_pass
{
QString apppath=QCoreApplication::applicationDirPath();
QSettings *settings = new QSettings(QString("%1/FreemudPOS.ini").arg(apppath), QSettings::IniFormat);
m_storeid=settings->value("FMTAKEOOUT/storeId").toString();
m_posid=settings->value("FMTAKEOOUT/posid").toString();
m_passd=settings->value("FMTAKEOOUT/passwd").toString();
m_cashid=settings->value("FMTAKEOOUT/cashierId").toString();
m_storeid=settings->value(FMP_INIKEY_LOGINSTOREID).toString();
m_posid=settings->value(FMP_INIKEY_LOGINPOSID).toString();
m_passd=settings->value(FMP_INIKEY_TAKEOUTPWD).toString();
m_cashid=settings->value(FMP_INIKEY_LOGINCASHIER).toString();
delete settings;
return 1;
}
......@@ -467,9 +474,9 @@ void InitClass::GetCathInfo(QString &m_cashname,QString &m_shiftid,QString &m_sh
{
QString apppath=QCoreApplication::applicationDirPath();
QSettings *settings = new QSettings(QString("%1/FreemudPOS.ini").arg(apppath), QSettings::IniFormat);
m_cashname=settings->value("FMTAKEOOUT/cashname").toString();
m_shiftid=settings->value("FMTAKEOOUT/shiftid").toInt();
m_shiftname=settings->value("FMTAKEOOUT/shiftname").toInt();
m_cashname=settings->value("Takeout/cashname").toString();
m_shiftid=settings->value("Takeout/shiftid").toInt();
m_shiftname=settings->value("Takeout/shiftname").toInt();
delete settings;
}
......
......@@ -115,8 +115,8 @@ void DetailForm::Readconfig()
{
QString apppath=QCoreApplication::applicationDirPath();
QSettings *settings = new QSettings(QString("%1/FreemudPOS.ini").arg(apppath), QSettings::IniFormat);
printsize=settings->value("Printer/printsize").toInt();
printType=settings->value("Printer/printType").toInt();
printsize=settings->value("Printer/PaperWidth").toInt();
printType=settings->value("Printer/Mode").toInt();
delete settings;
}
void DetailForm::Writeconfig()
......
......@@ -330,8 +330,11 @@ void MainWindow::onShowAlert(alertForm::Type type, const QString &msg)
{
//fms 错误的提示框暂时关闭
m_alertForm->SetContent(type, msg);
if(!m_reset)
m_alertForm->show();
if(!m_reset) {
if (isVisible()) {
m_alertForm->show();
}
}
}
void MainWindow::OnBtnHide()
......@@ -343,7 +346,6 @@ void MainWindow::showMain()
{
if(this->isVisible())
{
this->hide();
}
else
......@@ -353,7 +355,7 @@ void MainWindow::showMain()
}
void MainWindow::OnshowMainUi()
{
m_reset = 0;
m_reset = 0;
}
void MainWindow::OnResetHide(bool var)
......
......@@ -89,7 +89,8 @@ HEADERS +=fmp_takeout_i.h \
Thread/workThread/OtherThreadctr.h \
Thread/workThread/NetStoreInfo.h \
Ui/RejectForm.h \
Tool/HttpSocket.h
Tool/HttpSocket.h \
fmp_takeout_def.h
FORMS += \
Ui/mainwindow.ui \
......
#ifndef FMP_TAKEOUT_DEF_H
#define FMP_TAKEOUT_DEF_H
#define FMP_INIKEY_TAKEOUTCUSTOMER "Takeout/Customer"
#define FMP_INIKEY_TAKEOUTDELIVER "Takeout/Deliver"
#define FMP_INIKEY_TAKEOUTPWD "Takeout/Password"
#define FMP_INIKEY_TAKEOUTENTRYPORT "Takeout/Entryport"
#define FMP_INIKEY_TAKEOUTENTRYSERVER "Takeout/Entryurl"
#define FMP_INIKEY_TAKEOUTAUTO "Takeout/AutoConfirm"
#define FMP_INIKEY_TAKEOUTSERVER "Takeout/Server"
#endif // FMP_TAKEOUT_DEF_H
......@@ -2,6 +2,9 @@
#define FMPTAKEOUTINTERFACE_H
#include <fmp_plugin_i.h>
#include "fmp_takeout_def.h"
/**
* 业务插件接口,必须继承自 FMPluginInterface
* @brief The FMPTakeoutInterface class
......@@ -14,8 +17,8 @@ class FMPTakeoutInterface : public QObject, public FMPluginInterface
public:
explicit FMPTakeoutInterface(ctkPluginContext *ctx) : FMPluginInterface(ctx)
{
connect(this, &FMPTakeoutInterface::TriggerInit, this, &FMPTakeoutInterface::OnTriggerInit);
connect(this, &FMPTakeoutInterface::TriggerUninit, this, &FMPTakeoutInterface::OnTriggerUninit);
connect(this, &FMPTakeoutInterface::TriggerInit, this, &FMPTakeoutInterface::OnTriggerInit, Qt::UniqueConnection);
connect(this, &FMPTakeoutInterface::TriggerUninit, this, &FMPTakeoutInterface::OnTriggerUninit, Qt::UniqueConnection);
}
signals:
......
......@@ -30,7 +30,6 @@ int FMPTakeoutPrivate::Init()
{
_Home = q->GetService<FMPHomeInterface>(q->_ctx);
_Printer= q->GetService<FMPPrinterInterface>(q->_ctx);
_Printer->StartService();
connect(&InitClass::GetInstance(),&InitClass::sgnHome,this,&FMPTakeoutPrivate::sltHome);
connect(&InitClass::GetInstance(),&InitClass::sgnStopRemind,this,&FMPTakeoutPrivate::sltStopBlink);
connect(this,&FMPTakeoutPrivate::sgnGetFromHome,&InitClass::GetInstance(),&InitClass::sgnMainUi);
......@@ -39,7 +38,6 @@ int FMPTakeoutPrivate::Init()
connect(this,&FMPTakeoutPrivate::sgnSendPrintName,&InitClass::GetInstance(),&InitClass::sgnSendPrintName);
connect(this,&FMPTakeoutPrivate::sgnReceiveStatus,&InitClass::GetInstance(),&InitClass::sgnReceStatus);
connect(this,&FMPTakeoutPrivate::sgnStopTime,&InitClass::GetInstance(),&InitClass::sgnGetThreadnet);
FMPStartEventHandler* handler = new FMPStartEventHandler(q->_ctx, q);
InitClass::GetInstance().inItGloal();
// InitClass::GetInstance().LoadDll();
InitClass::GetInstance().InitLogger();
......@@ -89,7 +87,7 @@ void FMPTakeoutPrivate::sltHome(QString path)
void FMPTakeoutPrivate::sltStopBlink(int type)
{
_Home->stopBlink(type);
_Home->stopBlink(q_ptr);
}
void FMPTakeoutPrivate::sltPrint(QString data)
......
No preview for this file type
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