Skip to content

Commit 51af13a

Browse files
committed
some more work on settings
1 parent 84397e3 commit 51af13a

File tree

11 files changed

+105
-17
lines changed

11 files changed

+105
-17
lines changed

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
"options": ["hotfix", "update", "release"],
3434
"type": "pickString"
3535
},
36+
{
37+
"id": "guiSelection",
38+
"description": "Please choose GUI page",
39+
"default": "sync",
40+
"options": [
41+
"sync",
42+
"settings"
43+
],
44+
"type": "pickString"
45+
},
3646
{
3747
"id": "publishSelection",
3848
"description": "Please choose build type to publish",
@@ -77,6 +87,19 @@
7787
"program": "pbsync/pbsync.py",
7888
"console": "integratedTerminal"
7989
},
90+
{
91+
"name": "GUI",
92+
"args": [
93+
"--gui",
94+
"${input:guiSelection}",
95+
"--debugpath",
96+
"${input:debugPath}"
97+
],
98+
"type": "python",
99+
"request": "launch",
100+
"program": "pbsync/pbsync.py",
101+
"console": "integratedTerminal"
102+
},
80103
{
81104
"name": "Pull Binaries",
82105
"args": ["--sync", "binaries", "--debugpath", "${input:debugPath}"],

gui/css/app.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
color: var(--bs-light);
66
}
77

8+
#app-inner {
9+
margin-top: 1rem;
10+
}
11+
812
.flx-LineEdit {
913
width: 100%;
1014
border-radius: 0.25rem;
@@ -13,3 +17,19 @@
1317
.nav-pills .flx-Button {
1418
text-align: start;
1519
}
20+
21+
.flx-BaseButton {
22+
color: inherit;
23+
}
24+
25+
.flx-Widget:not(.flx-Layout) > .flx-Layout {
26+
position: initial;
27+
}
28+
29+
.flx-box {
30+
justify-content: initial;
31+
}
32+
33+
.flx-Label {
34+
align-self: center;
35+
}

gui/templates/settings.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<section id="app-inner">
33
<div class="content">
44
<div class="container-fluid">
5-
<x-flx el="CommitLogTable" id="commit-log"></x-flx>
5+
<x-flx el="Settings" id="settings"></x-flx>
66
</div>
77
</div>
88
</section>
File renamed without changes.

pbgui/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
asset_pkgs = [("webfonts/", gui.webfonts), ("img/", gui.img)]
2121

2222
m = None
23+
default_page = "sync"
2324
sync_fn = None
2425

2526
def load_flexx_static(data):
@@ -39,6 +40,10 @@ def load_static(pkg, filename):
3940
return load_flexx_static(data)
4041

4142

43+
def set_default_page(page):
44+
global default_page
45+
default_page = page
46+
4247

4348
for asset_dir, asset_pkg in asset_pkgs:
4449
for asset_name in pkg_resources.contents(asset_pkg):

pbgui/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def init(self):
1616
self.g = Gateway()
1717
self.fs = FileBrowserWidget()
1818
self.g.set_jfs(self.fs._jswidget)
19+
self.g.init_page(pbgui.default_page)
1920

2021
@flx.action
2122
def open_file(self, filename):

pbgui/gateway.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
from pbgui import load_static, load_template, widgets
1111

12-
DEFAULT_PAGE = "index"
1312
pages = {}
1413

1514

@@ -24,10 +23,12 @@ def load_templated_page(file, name, kwargs):
2423
# Jinja2 static properties to define per page
2524
page_props = {
2625
"d": {},
27-
"index": {
28-
"name": "Home",
29-
"type": "home"
26+
"sync": {
27+
"name": "Sync"
3028
},
29+
"settings": {
30+
"name": "Settings"
31+
}
3132
}
3233

3334
for resource in pkg_resources.contents(gui.templates):
@@ -74,9 +75,9 @@ def init(self):
7475
self.elements = {
7576
"Button": flx.Button,
7677
"FileWidget": None,
77-
"CommitLogTable": widgets.CommitLogTable,
78+
"CommitLogTable": widgets.CommitLogTableWidget,
79+
"Settings": widgets.SettingsWidget,
7880
}
79-
self.set_html(pages[DEFAULT_PAGE])
8081

8182
def _create_dom(self):
8283
return flx.create_element("div", {"id": "app", "onreact": self.react})
@@ -135,3 +136,7 @@ def set_jfs(self, filebrowser):
135136
@flx.action
136137
def update_commits(self, commits):
137138
self.get_widget("commit-log").update_commits(commits)
139+
140+
@flx.action
141+
def init_page(self, page):
142+
self.set_html(pages[page])

pbgui/widgets/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
from .commitlog import CommitLogTable
1+
from .commitlog import CommitLogTableWidget
2+
from .settings import SettingsWidget

pbgui/widgets/commitlog.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from flexx import flx
22

3-
4-
class CommitLogTable(flx.Widget):
3+
class CommitLogTableWidget(flx.Widget):
54

65
commits = flx.ListProp()
76
commit_nodes = flx.ListProp()

pbgui/widgets/settings.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
from flexx import flx
2+
3+
class SettingsWidget(flx.Widget):
4+
5+
def init(self):
6+
with flx.VBox():
7+
with flx.HBox():
8+
with flx.VBox():
9+
flx.Label(text='UE Download Folder')
10+
flx.Label(text='Project Version')
11+
self.symbols = flx.CheckBox(text="Download Symbols")
12+
self.autosync = flx.CheckBox(text="Always Auto-Sync")
13+
self.legacy = flx.CheckBox(text="Force Legacy Engine Archives")
14+
flx.Label(text='Git exe')
15+
flx.Label(text='Git LFS exe')
16+
with flx.VBox():
17+
self.download = flx.LineEdit(placeholder_text="Folder to download Unreal Engine to", minsize=(400, 28), flex=1)
18+
self.version = flx.LineEdit(text="latest", flex=1)
19+
flx.Widget(flex=1, minsize=(10, 28))
20+
flx.Widget(flex=1, minsize=(10, 28))
21+
flx.Widget(flex=1, minsize=(10, 28))
22+
self.exe_git = flx.LineEdit(placeholder_text="Custom Git exe to use instead of the default", minsize=(500, 28), flex=1)
23+
self.exe_git = flx.LineEdit(placeholder_text="Custom Git LFS exe to use instead of the default", minsize=(500, 28), flex=1)
24+
with flx.GroupWidget(title="Launch App"):
25+
with flx.VBox():
26+
self.launch_editor = flx.RadioButton(text="Unreal Editor", checked=True)
27+
self.launch_vs = flx.RadioButton(text="Visual Studio")
28+
self.launch_rider = flx.RadioButton(text="Rider")
29+
self.launch_non = flx.RadioButton(text="None")
30+
with flx.GroupWidget(title="Engine Bundle"):
31+
with flx.VBox():
32+
self.bundle_editor = flx.RadioButton(text="Editor (development only)", checked=True)
33+
self.bundle_engine = flx.RadioButton(text="Engine (can package game)")

0 commit comments

Comments
 (0)