Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fmp_settings
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_settings
Commits
597458d8
Commit
597458d8
authored
May 04, 2017
by
Carwyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 设置支持打印测试
parent
fe08ef27
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
14 deletions
+95
-14
fmp_settings.cpp
+2
-1
ui/window.cpp
+19
-2
ui/window.h
+8
-1
ui/window.ui
+65
-9
version.h
+1
-1
No files found.
fmp_settings.cpp
View file @
597458d8
...
...
@@ -78,7 +78,8 @@ int FMPSettingsPrivate::Init()
_sets
=
new
QSettings
(
_ctx
->
getProperty
(
FMP_PROPKEY_CFG
).
toString
(),
QSettings
::
IniFormat
);
}
else
{
FMPSettingsWindow
*
set_dlg
=
new
FMPSettingsWindow
;
FMPSettingsWindow
*
set_dlg
=
new
FMPSettingsWindow
(
q_ptr
);
set_dlg
->
SetPluginContext
(
_ctx
);
set_dlg
->
setsettings
(
_sets
);
set_dlg
->
show
();
connect
(
set_dlg
,
&
FMPSettingsWindow
::
settingChanged
,
this
,
&
FMPSettingsPrivate
::
SetValue
);
...
...
ui/window.cpp
View file @
597458d8
...
...
@@ -10,19 +10,23 @@
#include <fmp_epay_i.h>
#include <fmp_takeout_i.h>
#include <fmp_printer_i.h>
#include <fmp_settings_i.h>
#include "window.h"
#include "ui_window.h"
#include "../fmp_home/version.h"
FMPSettingsWindow
::
FMPSettingsWindow
(
QWidget
*
parent
)
:
FMPSettingsWindow
::
FMPSettingsWindow
(
FMPSettingsInterface
*
fmp_sets
,
QWidget
*
parent
)
:
FMPWindow
(
parent
),
ui
(
new
Ui
::
FMPSettingsWindow
)
ui
(
new
Ui
::
FMPSettingsWindow
),
_fmp_sets
(
fmp_sets
)
{
ui
->
setupUi
(
this
);
connect
(
ui
->
btn_close
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
close
()));
connect
(
ui
->
btn_testprint
,
SIGNAL
(
clicked
(
bool
)),
SLOT
(
OnTestPrintClicked
()));
}
FMPSettingsWindow
::~
FMPSettingsWindow
()
...
...
@@ -60,6 +64,8 @@ void FMPSettingsWindow::setsettings(QSettings* set)
ui
->
edt_epayurl
->
setText
(
m_set
->
value
(
FMP_INIKEY_EPAYURL
).
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_pwd->home(false);
...
...
@@ -153,3 +159,14 @@ void FMPSettingsWindow::on_btn_showwidget_clicked()
animation
->
setEndValue
(
scroll
->
maximum
()
*
1.0
/
ui
->
scrollAreaWidgetContents
->
height
()
*
presentwidget
->
y
());
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
"
);
}
}
}
ui/window.h
View file @
597458d8
...
...
@@ -11,14 +11,18 @@ namespace Ui {
class
FMPSettingsWindow
;
}
class
FMPSettingsInterface
;
class
ctkPluginContext
;
class
FMPSettingsWindow
:
public
FMPWindow
{
Q_OBJECT
public
:
explicit
FMPSettingsWindow
(
QWidget
*
parent
=
0
);
explicit
FMPSettingsWindow
(
FMPSettingsInterface
*
fmp_sets
,
QWidget
*
parent
=
0
);
~
FMPSettingsWindow
();
void
setsettings
(
QSettings
*
set
);
void
SetPluginContext
(
ctkPluginContext
*
ctx
)
{
_ctx
=
ctx
;
}
signals
:
bool
settingChanged
(
const
QString
&
,
QVariant
);
...
...
@@ -26,6 +30,8 @@ private:
Ui
::
FMPSettingsWindow
*
ui
;
QSettings
*
m_set
;
QWidget
*
getwidget
(
QString
widgetname
);
FMPSettingsInterface
*
_fmp_sets
;
ctkPluginContext
*
_ctx
;
private
slots
:
void
onSettingeditingFinished
();
...
...
@@ -35,6 +41,7 @@ private slots:
//void on_btn_pluginpath_clicked();
void
on_btn_logpath_clicked
();
void
on_btn_showwidget_clicked
();
void
OnTestPrintClicked
();
};
#endif // FMP_SETS_DLG_H
ui/window.ui
View file @
597458d8
...
...
@@ -35,11 +35,17 @@
border: 1 solid silver;
}
#label_copyright
#label_copyright,#label_version,#label_ver_desc
{
font: normal 16px
"
微软雅黑
"
;
color: rgb(200,200,200);
}
#label_ver_desc
{
margin-left: 20px;
}
/**************** 滚动条 ****************/
#scrollArea
{
...
...
@@ -484,7 +490,7 @@ QComboBox::down-arrow
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
-259
</y>
<y>
0
</y>
<width>
630
</width>
<height>
790
</height>
</rect>
...
...
@@ -1138,14 +1144,64 @@ QComboBox::down-arrow
</widget>
</item>
<item>
<
widget
class=
"QLabel"
name=
"label_copyright
"
>
<property
name=
"
text
"
>
<
string>
由 非码© 提供技术支持
</string
>
<
layout
class=
"QHBoxLayout"
name=
"horizontalLayout_4
"
>
<property
name=
"
spacing
"
>
<
number>
0
</number
>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
<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=
"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>
</layout>
</widget>
...
...
version.h
View file @
597458d8
...
...
@@ -5,7 +5,7 @@
#define VER_MINOR 1
#define VER_REVISION 0
#define VER_BUILD 1
0
#define VER_BUILD 1
1
//! Convert version numbers to string
#define _STR(S) #S
...
...
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