Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mpcs
dfss
Commits
bae90ef4
Commit
bae90ef4
authored
Apr 12, 2016
by
Loïck Bonniot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[gui] Add contractform mockup
TG-381 #ready
parent
9f90c21c
Pipeline
#575
passed with stage
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
184 additions
and
25 deletions
+184
-25
gui/application.qrc
gui/application.qrc
+1
-0
gui/authform/authform.ui
gui/authform/authform.ui
+10
-4
gui/contractform/contractform.go
gui/contractform/contractform.go
+18
-0
gui/contractform/contractform.ui
gui/contractform/contractform.ui
+133
-0
gui/main.go
gui/main.go
+12
-17
gui/userform/userform.ui
gui/userform/userform.ui
+10
-4
No files found.
gui/application.qrc
View file @
bae90ef4
...
...
@@ -2,5 +2,6 @@
<qresource prefix="/">
<file>userform/userform.ui</file>
<file>authform/authform.ui</file>
<file>contractform/contractform.ui</file>
</qresource>
</RCC>
gui/authform/authform.ui
View file @
bae90ef4
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
Calculator
Form
</class>
<widget
class=
"QWidget"
name=
"
Calculator
Form"
>
<class>
Auth
Form
</class>
<widget
class=
"QWidget"
name=
"
Auth
Form"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
...
...
@@ -9,8 +9,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
592
</width>
<height>
3
40
</height>
<width>
776
</width>
<height>
3
53
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -19,6 +19,12 @@
<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>
...
...
gui/contractform/contractform.go
0 → 100644
View file @
bae90ef4
package
contractform
import
(
"dfss/gui/config"
"github.com/visualfc/goqt/ui"
)
type
Widget
struct
{
*
ui
.
QWidget
}
func
NewWidget
(
conf
*
config
.
Config
)
*
Widget
{
file
:=
ui
.
NewFileWithName
(
":/contractform/contractform.ui"
)
loader
:=
ui
.
NewUiLoader
()
form
:=
loader
.
Load
(
file
)
return
&
Widget
{
QWidget
:
form
}
}
gui/contractform/contractform.ui
0 → 100644
View file @
bae90ef4
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
ContractForm
</class>
<widget
class=
"QWidget"
name=
"ContractForm"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
802
</width>
<height>
457
</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>
<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=
"QLabel"
name=
"fileLabel"
>
<property
name=
"text"
>
<string>
<
html
><
head/
><
body
><
p
><
span style=
"
font-weight:600;
">
Contract file
<
/span
><
/p
><
/body
><
/html
>
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"1"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLineEdit"
name=
"fileField"
>
<property
name=
"readOnly"
>
<bool>
true
</bool>
</property>
<property
name=
"placeholderText"
>
<string>
(none)
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QToolButton"
name=
"fileButton"
>
<property
name=
"text"
>
<string>
Select
</string>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"signersLabel"
>
<property
name=
"text"
>
<string>
<
html
><
head/
><
body
><
p
><
span style=
"
font-weight:600;
">
Signers
<
br/
><
/span
><
span style=
"
font-size:8pt; font-style:italic;
">
Space-separated
<
/span
><
/p
><
/body
><
/html
>
</string>
</property>
</widget>
</item>
<item
row=
"1"
column=
"1"
>
<widget
class=
"QPlainTextEdit"
name=
"signersField"
/>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"commentLabel"
>
<property
name=
"text"
>
<string>
Comment
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"1"
>
<widget
class=
"QPlainTextEdit"
name=
"commentField"
/>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QPushButton"
name=
"createButton"
>
<property
name=
"text"
>
<string>
Create contract
</string>
</property>
<property
name=
"default"
>
<bool>
true
</bool>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QLabel"
name=
"feedbackLabel"
>
<property
name=
"text"
>
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
gui/main.go
View file @
bae90ef4
...
...
@@ -4,47 +4,42 @@ import (
"dfss"
"dfss/gui/authform"
"dfss/gui/config"
"dfss/gui/contractform"
"dfss/gui/userform"
"github.com/visualfc/goqt/ui"
)
const
WIDTH
=
650
const
HEIGHT
=
350
func
main
()
{
// Load configuration
conf
:=
config
.
Load
()
// Start first window
ui
.
Run
(
func
()
{
layout
:=
ui
.
New
VBoxLayout
()
window
:=
ui
.
New
MainWindow
()
var
newuser
*
userform
.
Widget
var
newauth
*
authform
.
Widget
var
newcontract
*
contractform
.
Widget
newauth
=
authform
.
NewWidget
(
&
conf
,
func
()
{
layout
.
RemoveWidget
(
newauth
)
newauth
.
Hide
()
window
.
SetCentralWidget
(
newcontract
)
})
newuser
=
userform
.
NewWidget
(
&
conf
,
func
(
pwd
string
)
{
layout
.
RemoveWidget
(
newuser
)
newuser
.
Hide
()
layout
.
AddWidget
(
newauth
)
window
.
SetCentralWidget
(
newauth
)
})
newcontract
=
contractform
.
NewWidget
(
&
conf
)
if
conf
.
Authenticated
{
// TODO
window
.
SetCentralWidget
(
newcontract
)
}
else
if
conf
.
Registered
{
layout
.
Add
Widget
(
newauth
)
window
.
SetCentral
Widget
(
newauth
)
}
else
{
layout
.
Add
Widget
(
newuser
)
window
.
SetCentral
Widget
(
newuser
)
}
w
:=
ui
.
NewWidget
()
w
.
SetLayout
(
layout
)
w
.
SetWindowTitle
(
"DFSS Client v"
+
dfss
.
Version
)
w
.
SetFixedSizeWithWidthHeight
(
WIDTH
,
HEIGHT
)
w
.
Show
()
window
.
SetWindowTitle
(
"DFSS Client v"
+
dfss
.
Version
)
window
.
Show
()
})
}
gui/userform/userform.ui
View file @
bae90ef4
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
Calculato
rForm
</class>
<widget
class=
"QWidget"
name=
"
Calculato
rForm"
>
<class>
Use
rForm
</class>
<widget
class=
"QWidget"
name=
"
Use
rForm"
>
<property
name=
"enabled"
>
<bool>
true
</bool>
</property>
...
...
@@ -9,8 +9,8 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
408
</width>
<height>
31
6
</height>
<width>
731
</width>
<height>
44
6
</height>
</rect>
</property>
<property
name=
"sizePolicy"
>
...
...
@@ -19,6 +19,12 @@
<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>
...
...
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