Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ingame
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav
ingame
Commits
d2930daf
Commit
d2930daf
authored
Apr 23, 2024
by
Georgiy Yankovskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Game autorun
parent
b07b7b0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
App.py
src/models/App.py
+12
-7
No files found.
src/models/App.py
View file @
d2930daf
...
@@ -46,13 +46,13 @@ class App(QtCore.QObject):
...
@@ -46,13 +46,13 @@ class App(QtCore.QObject):
data
=
desktop_file
.
data
data
=
desktop_file
.
data
entry
=
data
[
'Desktop Entry'
]
entry
=
data
[
'Desktop Entry'
]
name
=
entry
[
'Name'
]
or
'generic'
_
name
=
entry
[
'Name'
]
or
'generic'
exec
=
'Exec'
in
entry
and
entry
[
'Exec'
]
or
''
_
exec
=
'Exec'
in
entry
and
entry
[
'Exec'
]
or
''
icon
=
entry
[
'Icon'
]
_
icon
=
entry
[
'Icon'
]
assert
(
isinstance
(
name
,
str
)
assert
(
isinstance
(
_
name
,
str
)
and
isinstance
(
exec
,
str
)
and
isinstance
(
exec
,
str
)
and
isinstance
(
icon
,
str
))
and
isinstance
(
_
icon
,
str
))
exec_split
=
exec
.
split
(
' '
)
exec_split
=
exec
.
split
(
' '
)
...
@@ -63,10 +63,15 @@ class App(QtCore.QObject):
...
@@ -63,10 +63,15 @@ class App(QtCore.QObject):
# TODO parse product name
# TODO parse product name
icon
=
(
os
.
path
.
isfile
(
icon
)
and
icon
_icon
=
(
os
.
path
.
isfile
(
_icon
)
and
_
icon
or
os
.
path
.
realpath
(
f
"{Path(__file__).resolve().parent}../../../qml/images/game_icon.png"
))
or
os
.
path
.
realpath
(
f
"{Path(__file__).resolve().parent}../../../qml/images/game_icon.png"
))
self
.
games_model
.
add_game
(
Game
(
name
=
name
,
icon
=
icon
,
exec
=
exec
))
# Автозапуск игры:
# PW_GUI_DISABLED_CS=1
# START_FROM_STEAM=1
_exec
=
f
"env START_FROM_STEAM=1 {_exec}"
self
.
games_model
.
add_game
(
Game
(
name
=
_name
,
icon
=
_icon
,
exec
=
_exec
))
except
FileNotFoundError
:
except
FileNotFoundError
:
print
(
'File not found'
)
print
(
'File not found'
)
...
...
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