Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-system-updater
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
Ximper Linux
ximper-system-updater
Commits
ee8ecd9d
Commit
ee8ecd9d
authored
Jan 23, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 'no updates' page and fix update loading logic
parent
6fd59cda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
5 deletions
+26
-5
main.go
main.go
+15
-5
window.ui
window.ui
+11
-0
No files found.
main.go
View file @
ee8ecd9d
...
@@ -40,16 +40,23 @@ func GetSystemUpdater() *SystemUpdater {
...
@@ -40,16 +40,23 @@ func GetSystemUpdater() *SystemUpdater {
}
}
var
updates
map
[
string
]
apm
.
PackageChanges
var
updates
map
[
string
]
apm
.
PackageChanges
var
updatesLoaded
bool
func
(
su
*
SystemUpdater
)
backgroundStart
()
{
func
(
su
*
SystemUpdater
)
backgroundStart
()
{
updatesSources
:=
apm
.
NewUpdatesSources
()
updatesSources
:=
apm
.
NewUpdatesSources
()
us
:=
make
(
map
[
string
]
apm
.
PackageChanges
)
us
:=
make
(
map
[
string
]
apm
.
PackageChanges
)
for
name
,
source
:=
range
updatesSources
{
for
name
,
source
:=
range
updatesSources
{
us
[
name
]
=
source
.
GetPackageChanges
()
changes
:=
source
.
GetPackageChanges
()
if
len
(
changes
.
UpgradedPackages
)
>
0
||
len
(
changes
.
NewInstalledPackages
)
>
0
||
len
(
changes
.
RemovedPackages
)
>
0
{
us
[
name
]
=
changes
}
}
}
updates
=
us
updates
=
us
updatesLoaded
=
true
}
}
func
(
su
*
SystemUpdater
)
onActivate
()
{
func
(
su
*
SystemUpdater
)
onActivate
()
{
...
@@ -61,17 +68,20 @@ func (su *SystemUpdater) onActivate() {
...
@@ -61,17 +68,20 @@ func (su *SystemUpdater) onActivate() {
window
.
Present
()
window
.
Present
()
// Это выглядит прям очень плохо... Потом надо бы переделать по уму
glib
.
TimeoutAdd
(
100
,
func
()
bool
{
glib
.
TimeoutAdd
(
100
,
func
()
bool
{
if
!
updatesLoaded
{
return
true
}
if
len
(
updates
)
>
0
{
if
len
(
updates
)
>
0
{
window
.
FillWithChanges
(
su
,
updates
)
window
.
FillWithChanges
(
su
,
updates
)
window
.
stack
.
SetVisibleChildName
(
"main"
)
window
.
stack
.
SetVisibleChildName
(
"main"
)
window
.
updateButton
.
ConnectActivated
(
window
.
StartUpdateProcess
)
window
.
updateButton
.
ConnectActivated
(
window
.
StartUpdateProcess
)
return
false
}
else
{
window
.
stack
.
SetVisibleChildName
(
"noupdates"
)
}
}
return
tru
e
return
fals
e
})
})
}
}
...
...
window.ui
View file @
ee8ecd9d
...
@@ -104,6 +104,17 @@
...
@@ -104,6 +104,17 @@
<property
name=
"name"
>
loading
</property>
<property
name=
"name"
>
loading
</property>
</object>
</object>
</child>
</child>
<child>
<object
class=
"GtkStackPage"
>
<property
name=
"child"
>
<object
class=
"AdwStatusPage"
>
<property
name=
"icon-name"
>
emblem-ok-symbolic
</property>
<property
name=
"title"
translatable=
"yes"
>
System is up to date
</property>
</object>
</property>
<property
name=
"name"
>
noupdates
</property>
</object>
</child>
</object>
</object>
</property>
</property>
<property
name=
"top-bar-style"
>
raised
</property>
<property
name=
"top-bar-style"
>
raised
</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