Commit 597458d8 by Carwyn

1. 设置支持打印测试

parent fe08ef27
...@@ -78,7 +78,8 @@ int FMPSettingsPrivate::Init() ...@@ -78,7 +78,8 @@ int FMPSettingsPrivate::Init()
_sets = new QSettings(_ctx->getProperty(FMP_PROPKEY_CFG).toString(), QSettings::IniFormat); _sets = new QSettings(_ctx->getProperty(FMP_PROPKEY_CFG).toString(), QSettings::IniFormat);
} }
else { else {
FMPSettingsWindow * set_dlg = new FMPSettingsWindow; FMPSettingsWindow * set_dlg = new FMPSettingsWindow(q_ptr);
set_dlg->SetPluginContext(_ctx);
set_dlg->setsettings(_sets); set_dlg->setsettings(_sets);
set_dlg->show(); set_dlg->show();
connect(set_dlg,&FMPSettingsWindow::settingChanged,this,&FMPSettingsPrivate::SetValue); connect(set_dlg,&FMPSettingsWindow::settingChanged,this,&FMPSettingsPrivate::SetValue);
......
...@@ -10,19 +10,23 @@ ...@@ -10,19 +10,23 @@
#include <fmp_epay_i.h> #include <fmp_epay_i.h>
#include <fmp_takeout_i.h> #include <fmp_takeout_i.h>
#include <fmp_printer_i.h> #include <fmp_printer_i.h>
#include <fmp_settings_i.h>
#include "window.h" #include "window.h"
#include "ui_window.h" #include "ui_window.h"
#include "../fmp_home/version.h"
FMPSettingsWindow::FMPSettingsWindow(QWidget *parent) : FMPSettingsWindow::FMPSettingsWindow(FMPSettingsInterface *fmp_sets, QWidget *parent) :
FMPWindow(parent), FMPWindow(parent),
ui(new Ui::FMPSettingsWindow) ui(new Ui::FMPSettingsWindow),
_fmp_sets(fmp_sets)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(ui->btn_close, SIGNAL(clicked(bool)), SLOT(close())); connect(ui->btn_close, SIGNAL(clicked(bool)), SLOT(close()));
connect(ui->btn_testprint, SIGNAL(clicked(bool)), SLOT(OnTestPrintClicked()));
} }
FMPSettingsWindow::~FMPSettingsWindow() FMPSettingsWindow::~FMPSettingsWindow()
...@@ -60,6 +64,8 @@ void FMPSettingsWindow::setsettings(QSettings* set) ...@@ -60,6 +64,8 @@ void FMPSettingsWindow::setsettings(QSettings* set)
ui->edt_epayurl->setText(m_set->value(FMP_INIKEY_EPAYURL).toString()); ui->edt_epayurl->setText(m_set->value(FMP_INIKEY_EPAYURL).toString());
ui->edt_epaytimeout->setText(m_set->value(FMP_INIKEY_EPAYTIMEOUT).toString()); ui->edt_epaytimeout->setText(m_set->value(FMP_INIKEY_EPAYTIMEOUT).toString());
ui->label_version->setText(RES_STR_PRODUCT_VER);
/*--------------------------------------------------------------*/ /*--------------------------------------------------------------*/
ui->edt_posid->home(false); ui->edt_posid->home(false);
// ui->edt_pwd->home(false); // ui->edt_pwd->home(false);
...@@ -153,3 +159,14 @@ void FMPSettingsWindow::on_btn_showwidget_clicked() ...@@ -153,3 +159,14 @@ void FMPSettingsWindow::on_btn_showwidget_clicked()
animation->setEndValue(scroll->maximum() * 1.0 / ui->scrollAreaWidgetContents->height() * presentwidget->y()); animation->setEndValue(scroll->maximum() * 1.0 / ui->scrollAreaWidgetContents->height() * presentwidget->y());
animation->start(QPropertyAnimation::DeleteWhenStopped); animation->start(QPropertyAnimation::DeleteWhenStopped);
} }
void FMPSettingsWindow::OnTestPrintClicked()
{
if (_fmp_sets) {
FMPPrinterInterface *printer = _fmp_sets->GetService<FMPPrinterInterface>(_ctx);
if (printer) {
printer->GetPrintName();
printer->DoPrint("这是一个测试页看到此页说明打印正常!\r\n\r\n\r\n");
}
}
}
...@@ -11,14 +11,18 @@ namespace Ui { ...@@ -11,14 +11,18 @@ namespace Ui {
class FMPSettingsWindow; class FMPSettingsWindow;
} }
class FMPSettingsInterface;
class ctkPluginContext;
class FMPSettingsWindow : public FMPWindow class FMPSettingsWindow : public FMPWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit FMPSettingsWindow(QWidget *parent = 0); explicit FMPSettingsWindow(FMPSettingsInterface *fmp_sets, QWidget *parent = 0);
~FMPSettingsWindow(); ~FMPSettingsWindow();
void setsettings(QSettings *set); void setsettings(QSettings *set);
void SetPluginContext(ctkPluginContext *ctx) { _ctx = ctx; }
signals: signals:
bool settingChanged(const QString&,QVariant); bool settingChanged(const QString&,QVariant);
...@@ -26,6 +30,8 @@ private: ...@@ -26,6 +30,8 @@ private:
Ui::FMPSettingsWindow *ui; Ui::FMPSettingsWindow *ui;
QSettings *m_set; QSettings *m_set;
QWidget *getwidget(QString widgetname); QWidget *getwidget(QString widgetname);
FMPSettingsInterface *_fmp_sets;
ctkPluginContext *_ctx;
private slots: private slots:
void onSettingeditingFinished(); void onSettingeditingFinished();
...@@ -35,6 +41,7 @@ private slots: ...@@ -35,6 +41,7 @@ private slots:
//void on_btn_pluginpath_clicked(); //void on_btn_pluginpath_clicked();
void on_btn_logpath_clicked(); void on_btn_logpath_clicked();
void on_btn_showwidget_clicked(); void on_btn_showwidget_clicked();
void OnTestPrintClicked();
}; };
#endif // FMP_SETS_DLG_H #endif // FMP_SETS_DLG_H
...@@ -35,11 +35,17 @@ ...@@ -35,11 +35,17 @@
border: 1 solid silver; border: 1 solid silver;
} }
#label_copyright #label_copyright,#label_version,#label_ver_desc
{ {
font: normal 16px &quot;微软雅黑&quot;; font: normal 16px &quot;微软雅黑&quot;;
color: rgb(200,200,200); color: rgb(200,200,200);
} }
#label_ver_desc
{
margin-left: 20px;
}
/**************** 滚动条 ****************/ /**************** 滚动条 ****************/
#scrollArea #scrollArea
{ {
...@@ -484,7 +490,7 @@ QComboBox::down-arrow ...@@ -484,7 +490,7 @@ QComboBox::down-arrow
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>-259</y> <y>0</y>
<width>630</width> <width>630</width>
<height>790</height> <height>790</height>
</rect> </rect>
...@@ -1138,14 +1144,64 @@ QComboBox::down-arrow ...@@ -1138,14 +1144,64 @@ QComboBox::down-arrow
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="label_copyright"> <layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="text"> <property name="spacing">
<string>由 非码© 提供技术支持</string> <number>0</number>
</property> </property>
<property name="alignment"> <item>
<set>Qt::AlignCenter</set> <spacer name="horizontalSpacer_2">
</property> <property name="orientation">
</widget> <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="label_copyright">
<property name="text">
<string>由 非码© 提供技术支持</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_ver_desc">
<property name="text">
<string>版本</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_version">
<property name="text">
<string>0.1.0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#define VER_MINOR 1 #define VER_MINOR 1
#define VER_REVISION 0 #define VER_REVISION 0
#define VER_BUILD 10 #define VER_BUILD 11
//! Convert version numbers to string //! Convert version numbers to string
#define _STR(S) #S #define _STR(S) #S
......
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