Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcs
dfss
Commits
446405a2
Commit
446405a2
authored
Apr 22, 2016
by
Loïck Bonniot
Browse files
[gui] Add welcome screen
parent
44734fb9
Changes
6
Hide whitespace changes
Inline
Side-by-side
gui/application.qrc
View file @
446405a2
...
...
@@ -10,5 +10,6 @@
<file>images/digital_signature_pen.png</file>
<file>signform/signform.ui</file>
<file>showcontract/showcontract.ui</file>
<file>welcome/welcome.ui</file>
</qresource>
</RCC>
gui/config/config.go
View file @
446405a2
...
...
@@ -14,8 +14,8 @@ import (
// Config is the structure that will be persisted in the configuration file
type
Config
struct
{
Email
string
`json:
email`
Platform
string
`json:
platform`
Email
string
`json:
"
email
"
`
Platform
string
`json:
"
platform
"
`
}
// Load loads the configuration file into memory.
...
...
gui/main.go
View file @
446405a2
...
...
@@ -40,7 +40,7 @@ func main() {
if
viper
.
GetBool
(
"authenticated"
)
{
w
.
addActions
()
w
.
show
NewContractForm
()
w
.
show
Welcome
()
}
else
if
viper
.
GetBool
(
"registered"
)
{
w
.
showAuthForm
()
}
else
{
...
...
gui/screens.go
View file @
446405a2
...
...
@@ -8,10 +8,19 @@ import (
"dfss/gui/showcontract"
"dfss/gui/signform"
"dfss/gui/userform"
"dfss/gui/welcome"
"github.com/spf13/viper"
"github.com/visualfc/goqt/ui"
)
func
(
w
*
window
)
showWelcome
()
{
w
.
setScreen
(
welcome
.
NewWidget
(
w
.
showNewContractForm
,
func
()
{
w
.
showShowContract
(
""
)
},
w
.
showFetchForm
,
))
}
func
(
w
*
window
)
showUserForm
()
{
w
.
setScreen
(
userform
.
NewWidget
(
func
(
pwd
string
)
{
w
.
showAuthForm
()
...
...
gui/welcome/welcome.go
0 → 100644
View file @
446405a2
package
welcome
import
(
"github.com/visualfc/goqt/ui"
)
type
Widget
struct
{
*
ui
.
QWidget
}
func
NewWidget
(
onNew
,
onOpen
,
onFetch
func
())
*
Widget
{
file
:=
ui
.
NewFileWithName
(
":/welcome/welcome.ui"
)
loader
:=
ui
.
NewUiLoader
()
form
:=
loader
.
Load
(
file
)
(
ui
.
NewPushButtonFromDriver
(
form
.
FindChild
(
"createButton"
)))
.
OnClicked
(
onNew
)
(
ui
.
NewPushButtonFromDriver
(
form
.
FindChild
(
"openButton"
)))
.
OnClicked
(
onOpen
)
(
ui
.
NewPushButtonFromDriver
(
form
.
FindChild
(
"fetchButton"
)))
.
OnClicked
(
onFetch
)
return
&
Widget
{
QWidget
:
form
}
}
func
(
w
*
Widget
)
Q
()
*
ui
.
QWidget
{
return
w
.
QWidget
}
func
(
w
*
Widget
)
Tick
()
{}
gui/welcome/welcome.ui
0 → 100644
View file @
446405a2
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
Welcome
</class>
<widget
class=
"QWidget"
name=
"Welcome"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
776
</width>
<height>
353
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
650
</width>
<height>
350
</height>
</size>
</property>
<property
name=
"windowTitle"
>
<string>
Calculator Builder
</string>
</property>
<layout
class=
"QGridLayout"
>
<property
name=
"margin"
>
<number>
9
</number>
</property>
<property
name=
"spacing"
>
<number>
6
</number>
</property>
<item
row=
"0"
column=
"0"
>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"authLabel"
>
<property
name=
"minimumSize"
>
<size>
<width>
0
</width>
<height>
100
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
16777215
</width>
<height>
100
</height>
</size>
</property>
<property
name=
"text"
>
<string>
<
html
><
head/
><
body
><
p
><
span style=
"
font-size:20pt;
">
Welcome
<
/span
><
/p
><
p
>
The DFSS client is ready.
<
/p
><
/body
><
/html
>
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
<item>
<layout
class=
"QFormLayout"
name=
"formLayout"
>
<property
name=
"fieldGrowthPolicy"
>
<enum>
QFormLayout::AllNonFixedFieldsGrow
</enum>
</property>
<property
name=
"formAlignment"
>
<set>
Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
</set>
</property>
<property
name=
"horizontalSpacing"
>
<number>
30
</number>
</property>
<property
name=
"verticalSpacing"
>
<number>
10
</number>
</property>
<property
name=
"leftMargin"
>
<number>
50
</number>
</property>
<property
name=
"rightMargin"
>
<number>
50
</number>
</property>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"createButton"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Maximum"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"minimumSize"
>
<size>
<width>
200
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
200
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
Create a new contract
</string>
</property>
<property
name=
"default"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"openButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
200
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
200
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
Open a contract file
</string>
</property>
<property
name=
"autoDefault"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"fetchButton"
>
<property
name=
"minimumSize"
>
<size>
<width>
200
</width>
<height>
0
</height>
</size>
</property>
<property
name=
"maximumSize"
>
<size>
<width>
200
</width>
<height>
16777215
</height>
</size>
</property>
<property
name=
"text"
>
<string>
Download a contract file
</string>
</property>
<property
name=
"autoDefault"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QLabel"
name=
"createLabel"
>
<property
name=
"font"
>
<font>
<italic>
true
</italic>
</font>
</property>
<property
name=
"text"
>
<string>
Collaborate safely by proposing a new contract
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QLabel"
name=
"openLabel"
>
<property
name=
"font"
>
<font>
<italic>
true
</italic>
</font>
</property>
<property
name=
"text"
>
<string>
Look or sign at a saved contract
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QLabel"
name=
"fetchLabel"
>
<property
name=
"font"
>
<font>
<italic>
true
</italic>
</font>
</property>
<property
name=
"text"
>
<string>
Fetch a contract from the platform with its ID
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Write
Preview
Supports
Markdown
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