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
dcf50ec3
Commit
dcf50ec3
authored
Apr 28, 2017
by
1139102985@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加外卖的设置,相关修改逻辑
parent
1926f363
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
175 additions
and
8 deletions
+175
-8
fmp_settings.cpp
+4
-1
fmp_settings.h
+6
-2
fmp_settings_def.h
+22
-1
fmp_settings_i.h
+1
-1
ui/window.cpp
+124
-2
ui/window.h
+18
-1
ui/window.ui
+0
-0
No files found.
fmp_settings.cpp
View file @
dcf50ec3
#include "fmp_settings.h"
#
include
"fmp_settings.h"
#include <QSettings>
#include <QSettings>
#include <fmp_logger_i.h>
#include <fmp_logger_i.h>
#include <ctkServiceReference.h>
#include <ctkServiceReference.h>
...
@@ -69,6 +69,7 @@ FMPSettingsPrivate::FMPSettingsPrivate(ctkPluginContext *ctx)
...
@@ -69,6 +69,7 @@ FMPSettingsPrivate::FMPSettingsPrivate(ctkPluginContext *ctx)
:
_ctx
(
ctx
),
:
_ctx
(
ctx
),
_sets
(
0
)
_sets
(
0
)
{
{
}
}
int
FMPSettingsPrivate
::
Init
()
int
FMPSettingsPrivate
::
Init
()
...
@@ -78,7 +79,9 @@ int FMPSettingsPrivate::Init()
...
@@ -78,7 +79,9 @@ int FMPSettingsPrivate::Init()
}
}
else
{
else
{
FMPSettingsWindow
*
set_dlg
=
new
FMPSettingsWindow
;
FMPSettingsWindow
*
set_dlg
=
new
FMPSettingsWindow
;
set_dlg
->
setsettings
(
_sets
);
set_dlg
->
show
();
set_dlg
->
show
();
connect
(
set_dlg
,
&
FMPSettingsWindow
::
settingChanged
,
this
,
&
FMPSettingsPrivate
::
SetValue
);
}
}
return
FMP_SUCCESS
;
return
FMP_SUCCESS
;
...
...
fmp_settings.h
View file @
dcf50ec3
#
ifndef
FMP_SETTINGS_H
#ifndef FMP_SETTINGS_H
#define FMP_SETTINGS_H
#define FMP_SETTINGS_H
#include "fmp_settings_i.h"
#include "fmp_settings_i.h"
#include "ui./window.h"
class
ctkPluginContext
;
class
ctkPluginContext
;
class
FMPSettingsPrivate
;
class
FMPSettingsPrivate
;
...
@@ -40,8 +41,9 @@ class QSettings;
...
@@ -40,8 +41,9 @@ class QSettings;
/**
/**
* @brief The FMPSettingsPrivate class
* @brief The FMPSettingsPrivate class
*/
*/
class
FMPSettingsPrivate
class
FMPSettingsPrivate
:
public
QObject
{
{
Q_OBJECT
Q_DECLARE_PUBLIC
(
FMPSettings
)
Q_DECLARE_PUBLIC
(
FMPSettings
)
public
:
public
:
explicit
FMPSettingsPrivate
(
ctkPluginContext
*
ctx
);
explicit
FMPSettingsPrivate
(
ctkPluginContext
*
ctx
);
...
@@ -55,6 +57,8 @@ public:
...
@@ -55,6 +57,8 @@ public:
FMPSettings
*
q_ptr
;
FMPSettings
*
q_ptr
;
ctkPluginContext
*
_ctx
;
ctkPluginContext
*
_ctx
;
QSettings
*
_sets
;
QSettings
*
_sets
;
private
:
FMPSettingsWindow
*
settingwindow
;
};
};
#endif // FMP_SETTINGS_H
#endif // FMP_SETTINGS_H
fmp_settings_def.h
View file @
dcf50ec3
...
@@ -15,14 +15,24 @@
...
@@ -15,14 +15,24 @@
#define FMP_INIKEY_PLUGINPATH "Plugin/Path"
#define FMP_INIKEY_PLUGINPATH "Plugin/Path"
#define FMP_INIKEY_ANIMATION "Plugin/Animation"
#define FMP_INIKEY_ANIMATION "Plugin/Animation"
#define FMP_INIKEY_EPAYTIMEOUT "Epay/Timeout"
#define FMP_INIKEY_EPAYURL "Epay/URL"
#define FMP_INIKEY_LOGPATH "Log/Path"
#define FMP_INIKEY_LOGPATH "Log/Path"
#define FMP_INIKEY_LOGSIZE "Log/Size"
#define FMP_INIKEY_LOGSIZE "Log/Size"
#define FMP_INIKEY_LOGLEVEL "Log/Level"
#define FMP_INIKEY_LOGLEVEL "Log/Level"
#define FMP_INIKEY_LOGINSERVER "Home/Server"
#define FMP_INIKEY_LOGINSERVER "Home/Server"
#define FMP_INIKEY_LOGINPWD "Home/Pwd"
#define FMP_INIKEY_LOGINSTOREID "Home/StoreId"
#define FMP_INIKEY_LOGINSTOREID "Home/StoreId"
#define FMP_INIKEY_LOGINPOSID "Home/PosId"
#define FMP_INIKEY_LOGINBUSINESS "Home/Business"
#define FMP_INIKEY_LOGINCASHIER "Home/CashierId"
#define FMP_INIKEY_LOGINPARTNERID "Home/PartnerId"
#define FMP_INIKEY_LOGINPARTNERID "Home/PartnerId"
#define FMP_INIKEY_HOMEPOSITION "Home/Position"
#define FMP_INIKEY_HOMEPOSITION "Home/Position"
#define FMP_INIKEY_HOMEAUTOLOGIN "Home/Autologin"
#define FMP_INIKEY_HOMEACCOUNT "Home/Account"
#define FMP_INIKEY_VIPSERVER "Vip/Server"
#define FMP_INIKEY_VIPSERVER "Vip/Server"
...
@@ -30,6 +40,17 @@
...
@@ -30,6 +40,17 @@
#define FMP_APPNAME "非码POS"
#define FMP_APPNAME "非码POS"
#define FMP_INIKEY_PRINTER "Printer/printname"
#define FMP_INIKEY_PRINTERNAME "Printer/Printname"
#define FMP_INIKEY_PRINTERSIZE "Printer/Printsize"
#define FMP_INIKEY_TAKEOUTCUSTOMER "FMTAKEOOUT/Customer"
#define fmp_INIKEY_TAKEOUTDELIVER "FMTAKEOOUT/Deliver"
#define FMP_INIKEY_TAKEOUTSTORE "FMTAKEOOUT/Store"
#define FMP_INIKEY_TAKEOUTPWD "FMTAKEOOUT/Passwd"
#define fmp_INIKEY_TAKEOUTENTRYPORT "FMTAKEOOUT/Entryport"
#define FMP_INIKEY_TAKEOUTENTRYSERVER "FMTAKEOOUT/Entryurl"
#define fmp_INIKEY_TAKEOUTAUTO "FMTAKEOOUT/Autoconfirm"
#define FMP_INIKEY_TAKEOUTSERVER "FMTAKEOOUT/Url"
#define FMP_INIKEY_TAKEOUTSTOREID "FMTAKEOOUT/StoreId"
#endif // FMP_SETTINGS_DEF_H
#endif // FMP_SETTINGS_DEF_H
fmp_settings_i.h
View file @
dcf50ec3
#
ifndef
FMP_SETTINGS_I_H
#ifndef FMP_SETTINGS_I_H
#define FMP_SETTINGS_I_H
#define FMP_SETTINGS_I_H
#include <QVariant>
#include <QVariant>
...
...
ui/window.cpp
View file @
dcf50ec3
#include "window.h"
#
include
"window.h"
#include "ui_window.h"
#include "ui_window.h"
#include <QLineEdit>
#include <QCheckBox>
#include <QComboBox>
#include "fmp_settings_def.h"
#include <qDebug>
#include <QScrollBar>
FMPSettingsWindow
::
FMPSettingsWindow
(
QWidget
*
parent
)
:
FMPSettingsWindow
::
FMPSettingsWindow
(
QWidget
*
parent
)
:
FMPWindow
(
parent
),
FMPWindow
(
parent
),
ui
(
new
Ui
::
FMPSettingsWindow
)
ui
(
new
Ui
::
FMPSettingsWindow
)
...
@@ -13,3 +18,120 @@ FMPSettingsWindow::~FMPSettingsWindow()
...
@@ -13,3 +18,120 @@ FMPSettingsWindow::~FMPSettingsWindow()
{
{
delete
ui
;
delete
ui
;
}
}
void
FMPSettingsWindow
::
setsettings
(
QSettings
*
set
)
{
m_set
=
set
;
ui
->
edt_posid
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINPOSID
).
toString
());
ui
->
edt_pwd
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINPWD
).
toString
());
ui
->
edt_pwd_2
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINPWD
).
toString
());
ui
->
edt_partnerid
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINPARTNERID
).
toString
());
ui
->
edt_account
->
setText
(
m_set
->
value
(
FMP_INIKEY_HOMEACCOUNT
).
toString
());
ui
->
edt_pluginpath
->
setText
(
m_set
->
value
(
FMP_INIKEY_PLUGINPATH
).
toString
());
ui
->
edt_logpath
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGPATH
).
toString
());
ui
->
edt_loginsvr
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINSERVER
).
toString
());
ui
->
edt_storeid
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINSTOREID
).
toString
());
ui
->
edt_logsize
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGSIZE
).
toString
());
ui
->
switch_animation
->
setChecked
(
m_set
->
value
(
FMP_INIKEY_ANIMATION
).
toBool
());
ui
->
switch_autologin
->
setChecked
(
m_set
->
value
(
FMP_INIKEY_HOMEAUTOLOGIN
).
toBool
());
ui
->
select_loglevel
->
setCurrentIndex
(
m_set
->
value
(
FMP_INIKEY_LOGLEVEL
).
toInt
());
ui
->
select_printer
->
setCurrentText
(
m_set
->
value
(
FMP_INIKEY_PRINTERNAME
).
toString
());
ui
->
select_printersize
->
setCurrentText
(
m_set
->
value
(
FMP_INIKEY_PRINTERSIZE
).
toString
());
ui
->
check_autoconfirm
->
setChecked
(
m_set
->
value
(
fmp_INIKEY_TAKEOUTAUTO
).
toBool
());
ui
->
check_customer
->
setCheckable
(
m_set
->
value
(
FMP_INIKEY_TAKEOUTCUSTOMER
).
toBool
());
ui
->
check_deliver
->
setCheckable
(
m_set
->
value
(
fmp_INIKEY_TAKEOUTDELIVER
).
toBool
());
ui
->
check_store
->
setCheckable
(
m_set
->
value
(
FMP_INIKEY_TAKEOUTSTORE
).
toBool
());
ui
->
edt_orderurl
->
setText
(
m_set
->
value
(
FMP_INIKEY_TAKEOUTSERVER
).
toString
());
ui
->
edt_entryport
->
setText
(
m_set
->
value
(
fmp_INIKEY_TAKEOUTENTRYPORT
).
toString
());
ui
->
edt_entryurl
->
setText
(
m_set
->
value
(
FMP_INIKEY_TAKEOUTENTRYSERVER
).
toString
());
ui
->
edt_storeid_2
->
setText
(
m_set
->
value
(
FMP_INIKEY_TAKEOUTSTOREID
).
toString
());
ui
->
edt_cashierid
->
setText
(
m_set
->
value
(
FMP_INIKEY_LOGINCASHIER
).
toString
());
/*--------------------------------------------------------------*/
ui
->
edt_posid
->
home
(
false
);
ui
->
edt_pwd
->
home
(
false
);
ui
->
edt_pwd_2
->
home
(
false
);
ui
->
edt_partnerid
->
home
(
false
);
ui
->
edt_account
->
home
(
false
);
ui
->
edt_pluginpath
->
home
(
false
);
ui
->
edt_logpath
->
home
(
false
);
ui
->
edt_loginsvr
->
home
(
false
);
ui
->
edt_storeid
->
home
(
false
);
ui
->
edt_logsize
->
home
(
false
);
ui
->
edt_orderurl
->
home
(
false
);
ui
->
edt_entryport
->
home
(
false
);
ui
->
edt_entryurl
->
home
(
false
);
ui
->
edt_storeid_2
->
home
(
false
);
ui
->
edt_cashierid
->
home
(
false
);
}
QWidget
*
FMPSettingsWindow
::
getwidget
(
QString
widgetname
)
{
if
(
!
widgetname
.
compare
(
"general"
))
{
return
ui
->
general
;
}
if
(
!
widgetname
.
compare
(
"pay"
))
{
return
ui
->
pay
;
}
if
(
!
widgetname
.
compare
(
"takeout"
))
{
return
ui
->
takeout
;
}
}
void
FMPSettingsWindow
::
onSettingeditingFinished
()
{
QLineEdit
*
edt
=
(
QLineEdit
*
)
sender
();
edt
->
home
(
false
);
qDebug
()
<<
edt
->
property
(
"key"
).
toString
()
<<
edt
->
text
();
emit
settingChanged
(
edt
->
property
(
"key"
).
toString
(),
edt
->
text
());
}
void
FMPSettingsWindow
::
onsettingcombo_currentIndex
(
QString
content
)
{
QComboBox
*
combox
=
(
QComboBox
*
)
sender
();
emit
settingChanged
(
combox
->
property
(
"key"
).
toString
(),
content
);
}
void
FMPSettingsWindow
::
onsettingcombo_currentIndex
(
int
content
)
{
QComboBox
*
combox
=
(
QComboBox
*
)
sender
();
emit
settingChanged
(
combox
->
property
(
"key"
).
toString
(),
content
);
}
void
FMPSettingsWindow
::
onSettingcheck_clicked
(
bool
checked
)
{
QCheckBox
*
check
=
(
QCheckBox
*
)
sender
();
emit
settingChanged
(
check
->
property
(
"key"
).
toString
(),(
int
)
checked
);
}
//void FMPSettingsWindow::on_btn_pluginpath_clicked()
//{
// QString pluginpath = QFileDialog::getExistingDirectory(this, "路径选择",NULL, QFileDialog::ShowDirsOnly);
// if(!logpath.isEmpty())
// {
// ui->edt_pluginpath->setText(pluginpath);
// }
//
//}
void
FMPSettingsWindow
::
on_btn_logpath_clicked
()
{
QString
logpath
=
QFileDialog
::
getExistingDirectory
(
this
,
"路径选择"
,
NULL
,
NULL
);
if
(
!
logpath
.
isEmpty
())
{
ui
->
edt_logpath
->
setText
(
logpath
);
ui
->
edt_logpath
->
editingFinished
();
}
}
void
FMPSettingsWindow
::
on_btn_showwidget_clicked
()
{
QPushButton
*
btn
=
(
QPushButton
*
)
sender
();
QWidget
*
presentwidget
=
getwidget
(
btn
->
property
(
"widget"
).
toString
());
ui
->
scrollArea
->
verticalScrollBar
()
->
setValue
(
presentwidget
->
y
());
}
ui/window.h
View file @
dcf50ec3
#ifndef FMP_SETS_DLG_H
#
ifndef
FMP_SETS_DLG_H
#define FMP_SETS_DLG_H
#define FMP_SETS_DLG_H
#include <fmp_window.hpp>
#include <fmp_window.hpp>
#include <QWidget>
#include <QWidget>
#include <QFileDialog>
#include <QSettings>
#include <QPushButton>
namespace
Ui
{
namespace
Ui
{
class
FMPSettingsWindow
;
class
FMPSettingsWindow
;
...
@@ -15,9 +18,23 @@ class FMPSettingsWindow : public FMPWindow
...
@@ -15,9 +18,23 @@ class FMPSettingsWindow : public FMPWindow
public
:
public
:
explicit
FMPSettingsWindow
(
QWidget
*
parent
=
0
);
explicit
FMPSettingsWindow
(
QWidget
*
parent
=
0
);
~
FMPSettingsWindow
();
~
FMPSettingsWindow
();
void
setsettings
(
QSettings
*
set
);
signals
:
bool
settingChanged
(
const
QString
&
,
QVariant
);
private
:
private
:
Ui
::
FMPSettingsWindow
*
ui
;
Ui
::
FMPSettingsWindow
*
ui
;
QSettings
*
m_set
;
QWidget
*
getwidget
(
QString
widgetname
);
private
slots
:
void
onSettingeditingFinished
();
void
onSettingcheck_clicked
(
bool
checked
);
void
onsettingcombo_currentIndex
(
QString
content
);
void
onsettingcombo_currentIndex
(
int
content
);
//void on_btn_pluginpath_clicked();
void
on_btn_logpath_clicked
();
void
on_btn_showwidget_clicked
();
};
};
#endif // FMP_SETS_DLG_H
#endif // FMP_SETS_DLG_H
ui/window.ui
View file @
dcf50ec3
This diff is collapsed.
Click to expand it.
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