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
7a754a31
Commit
7a754a31
authored
Mar 28, 2026
by
Roman Alifanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix dialogs: set parent window, show error log in scrollable view
parent
be23b5bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
3 deletions
+24
-3
window.go
ui/window.go
+24
-3
No files found.
ui/window.go
View file @
7a754a31
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"context"
"context"
"fmt"
"fmt"
"log"
"log"
"strings"
gtksbuilder
"SystemUpdater/lib/gtks/builder"
gtksbuilder
"SystemUpdater/lib/gtks/builder"
"SystemUpdater/model"
"SystemUpdater/model"
...
@@ -170,7 +171,7 @@ func (w *Window) showUpdateDialog() {
...
@@ -170,7 +171,7 @@ func (w *Window) showUpdateDialog() {
state
:=
w
.
st
.
GetState
()
state
:=
w
.
st
.
GetState
()
dialog
:=
adw
.
NewMessageDialog
(
dialog
:=
adw
.
NewMessageDialog
(
nil
,
&
w
.
Window
.
Window
,
"Select Components to Update"
,
"Select Components to Update"
,
"Choose which components you want to update:"
,
"Choose which components you want to update:"
,
)
)
...
@@ -275,7 +276,7 @@ func (w *Window) runUpdate(categories []string) {
...
@@ -275,7 +276,7 @@ func (w *Window) runUpdate(categories []string) {
func
(
w
*
Window
)
onRebootClicked
()
{
func
(
w
*
Window
)
onRebootClicked
()
{
dialog
:=
adw
.
NewMessageDialog
(
dialog
:=
adw
.
NewMessageDialog
(
nil
,
&
w
.
Window
.
Window
,
"Reboot System?"
,
"Reboot System?"
,
"The system needs to be rebooted to complete the update."
,
"The system needs to be rebooted to complete the update."
,
)
)
...
@@ -318,7 +319,27 @@ func (w *Window) onNavigateToCategory(category string) {
...
@@ -318,7 +319,27 @@ func (w *Window) onNavigateToCategory(category string) {
}
}
func
(
w
*
Window
)
showError
(
title
,
message
string
)
{
func
(
w
*
Window
)
showError
(
title
,
message
string
)
{
dialog
:=
adw
.
NewMessageDialog
(
nil
,
title
,
message
)
lines
:=
strings
.
Split
(
message
,
"
\n
"
)
if
len
(
lines
)
>
20
{
lines
=
lines
[
len
(
lines
)
-
20
:
]
}
truncated
:=
strings
.
Join
(
lines
,
"
\n
"
)
dialog
:=
adw
.
NewMessageDialog
(
&
w
.
Window
.
Window
,
title
,
""
)
textView
:=
gtk
.
NewTextView
()
textView
.
SetEditable
(
false
)
textView
.
SetCursorVisible
(
false
)
textView
.
SetWrapMode
(
gtk
.
WrapWordChar
)
textView
.
Buffer
()
.
SetText
(
truncated
)
scrolled
:=
gtk
.
NewScrolledWindow
()
scrolled
.
SetHScrollbarPolicy
(
gtk
.
PolicyNever
)
scrolled
.
SetVScrollbarPolicy
(
gtk
.
PolicyAutomatic
)
scrolled
.
SetMinContentHeight
(
200
)
scrolled
.
SetChild
(
textView
)
dialog
.
SetExtraChild
(
scrolled
)
dialog
.
AddResponse
(
"ok"
,
"OK"
)
dialog
.
AddResponse
(
"ok"
,
"OK"
)
dialog
.
SetDefaultResponse
(
"ok"
)
dialog
.
SetDefaultResponse
(
"ok"
)
dialog
.
Present
()
dialog
.
Present
()
...
...
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