Commit 5b64e84b by guanghui.cui

1、小票重新打印

2、修复悬浮窗偶尔不显示bug
parent 254bed60
......@@ -10,10 +10,10 @@
#include "DataObject/DeliverObject.h"
#include "DeliversForm.h"
#include "MateChooser.h"
#include "../fmTakeaway_printer/Fmtakeaway_printer.h"
#include "MainForm.h"
#include "DrinkItem.h"
#include "Util/IniDataManger.h"
#include "Util/wbillcontrol.h"
#include <QFile>
#include <QFileInfo>
#include <QPointer>
......@@ -39,6 +39,8 @@ DetailsForm::DetailsForm(OrderObject *orderObj, QWidget *parent) :
this, SLOT(onError(QString,BillsManger::ErrorType)));
connect(ui->detailsTable, SIGNAL(itemClicked(QTreeWidgetItem*,int)), SLOT(onItemClicked(QTreeWidgetItem*,int)));
connect(this, SIGNAL(reprintLable(const OrderObject*)), &WBillControl::GetInstance(), SLOT(PrintLable(const OrderObject*)));
}
DetailsForm::~DetailsForm()
......@@ -786,5 +788,6 @@ void DetailsForm::onSucessful(const QString &msg, const QString &extra)
void DetailsForm::on_detailsBtn3_clicked()
{
QLOG_TRACE() << __FUNCTION__ << "reprinter";
FmTakeaway_printer::Instance().DoPrint(IniDataManger::Instance().GetPrinterName(), m_orderObj);
emit reprintLable(m_orderObj);
//WBillControl::GetInstance().PrintLable(m_orderObj);
}
......@@ -55,6 +55,7 @@ private slots:
signals:
void ntFormClose();
void orderMateChanged(const QString &order_id);
void reprintLable(const OrderObject *orderObj);
};
#endif // DETAILSFORM_H
......@@ -6,7 +6,7 @@
#include <QSettings>
#include <QApplication>
#include "Util/IniDataManger.h"
#include "XCBOperate.h"
#include <QDebug>
......@@ -151,3 +151,9 @@ void FloatForm::on_floatBtnLogo_clicked()
return;
}
void FloatForm::onShowFloatWnd()
{
XCBOperate oper;
oper.update(this->winId());
this->show();
}
......@@ -20,6 +20,7 @@ public:
public slots:
void onStartBlink(int table_id);
void onStopBlink();
void onShowFloatWnd();
private:
Ui::FloatForm *ui;
......
......@@ -357,7 +357,7 @@ void MainForm::onFloatMoved(QPoint pos)
void MainForm::_InitUI()
{
this->setWindowFlags(windowFlags()/* | Qt::WindowStaysOnTopHint |Qt::FramelessWindowHint*/);
this->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint |Qt::FramelessWindowHint);
//this->showFullScreen();
m_size = this->size();
......@@ -373,22 +373,22 @@ void MainForm::_InitUI()
// ui->btnCurOpe->setChecked(false);
// 初始化打印机选项
QString iniPrinterName = OBJREF(IniDataManger).GetPrinterName();
QStringList printerList;
QList<QPrinterInfo> printers = QPrinterInfo::availablePrinters();
foreach(QPrinterInfo p, printers) {
printerList << p.printerName();
}
// QString iniPrinterName = OBJREF(IniDataManger).GetPrinterName();
// QStringList printerList;
// QList<QPrinterInfo> printers = QPrinterInfo::availablePrinters();
// foreach(QPrinterInfo p, printers) {
// printerList << p.printerName();
// }
for(int i=0; i<printerList.count(); i++)
{
QString name = (QString)printerList.at(i);
ui->cbxPrinter->insertItem(i, name);
if(!name.compare(iniPrinterName))
{
ui->cbxPrinter->setCurrentIndex(i);
}
}
// for(int i=0; i<printerList.count(); i++)
// {
// QString name = (QString)printerList.at(i);
// ui->cbxPrinter->insertItem(i, name);
// if(!name.compare(iniPrinterName))
// {
// ui->cbxPrinter->setCurrentIndex(i);
// }
// }
ui->btnNew->setChecked(false);
// ui->btnNew->setEnabled(false);
......@@ -411,9 +411,12 @@ void MainForm::_InitUI()
}
//
//ui->labPrinter->hide();
//ui->cbxPrinter->hide();
//ui->btnTestPrint->hide();
ui->labPrinter->hide();
ui->cbxPrinter->hide();
ui->btnTestPrint->hide();
//ui->edtSearch->hide();
//ui->labSearch->hide();
ui->frmSearch->hide();
ui->lab_status->setText("<font color='#ff0000'>未登录</font>");
......@@ -595,23 +598,6 @@ void MainForm::on_btnHide_clicked()
// loop.exec();
this->hide();
//#ifdef Q_OS_LINUX
// xcb_connection_t *c;
// xcb_intern_atom_reply_t *reply;
// xcb_atom_t embedAtom;
// xcb_intern_atom_cookie_t atom_cookie;
// char * strAtomName = "_XEMBED_INFO";
// c = xcb_connect(NULL,NULL);
// atom_cookie = xcb_intern_atom(c, false, strlen(strAtomName), strAtomName);
// reply = xcb_intern_atom_reply(c, atom_cookie, 0);
// embedAtom = reply->atom;
// free(reply);
// xcb_delete_property(c, (xcb_window_t)floatWId, embedAtom);
// xcb_flush(c);
//#endif
//emit updateXCB(floatWId);
XCBOperate oper;
oper.update(floatWId);
emit floatFormShow();
return;
}
......
......@@ -97,7 +97,6 @@ signals:
void ntFormClose();
void operatorChanged(const FmTakeaway_db::OperatorInfo&);
void updateXCB(WId);
};
#endif // MAINFORM_H
......@@ -73,7 +73,7 @@ WBillControl::WBillControl()
comd3.productAmount=1;
comd3.price=789;
obj.proList.push_back(&comd3);
PrintLable(&obj);
//PrintLable(&obj);
//printMenu(&obj);
//printTakeout(&obj);
......
......@@ -51,9 +51,6 @@ public:
* */
void SetStoreInfo(const QString& partner_id, const QString& storeId, const QString& operaId, const QString& posId, const QString& dbusiness);
//打印小票
void PrintLable(const OrderObject *obj);
public slots:
/* 功能:写入销售单
* 参数:[1]订单对象[2]错误信息[3]是否是确认动作
......@@ -66,6 +63,9 @@ public slots:
* */
void RefundOrder(const QString& orderId);
//打印小票
void PrintLable(const OrderObject *obj);
private:
/* 功能:获取写入销售单数据
* 参数:[1]订单对象
......
......@@ -93,14 +93,10 @@ int main(int argc, char *argv[])
FloatForm f;
MainForm w;
XCBOperate oper;
w.setFloatWId(f.winId());
QObject::connect(&w, SIGNAL(updateXCB(WId)), &oper, SLOT(update(WId)));
// 链接信号槽
QObject::connect(&f, SIGNAL(mainFormShow()), &w, SLOT(onShow()));
QObject::connect(&f, SIGNAL(bMoved(QPoint)), &w, SLOT(onFloatMoved(QPoint)));
QObject::connect(&w, SIGNAL(floatFormShow()), &f,SLOT(show()));
QObject::connect(&w, SIGNAL(floatFormShow()), &f,SLOT(onShowFloatWnd()));
QObject::connect(&w, SIGNAL(floatStopBlink()), &f, SLOT(onStopBlink()));
QObject::connect(&w, SIGNAL(floatStartBlink(int)), &f, SLOT(onStartBlink(int)));
......@@ -110,6 +106,8 @@ int main(int argc, char *argv[])
QObject::connect(&SInfoControl::GetInstance(), SIGNAL(getNewStoreInfo(QJsonObject)), &BillsManger::Instance(), SLOT(onGetNewStoreInfo(QJsonObject)));
w.move (0,0);
XCBOperate oper;
oper.update(w.winId());
w.show();
......
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