Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Pika Backup
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
36
Issues
36
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
World
Pika Backup
Commits
1769177a
Commit
1769177a
authored
Aug 23, 2020
by
Sophie Herold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some more status output
Fixes
#17
parent
19a014a4
Pipeline
#206892
passed with stage
in 19 minutes and 57 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
6 deletions
+42
-6
data/ui/main.ui
data/ui/main.ui
+2
-0
src/ui/detail.rs
src/ui/detail.rs
+16
-4
src/ui/new_backup.rs
src/ui/new_backup.rs
+24
-2
No files found.
data/ui/main.ui
View file @
1769177a
...
...
@@ -916,6 +916,8 @@ This might take a while.</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"halign"
>
start
</property>
<property
name=
"label"
>
<
placeholder
>
</property>
<property
name=
"ellipsize"
>
end
</property>
<property
name=
"single-line-mode"
>
True
</property>
<attributes>
<attribute
name=
"scale"
value=
"0.90000000000000002"
/>
</attributes>
...
...
src/ui/detail.rs
View file @
1769177a
...
...
@@ -369,7 +369,9 @@ fn add_exclude() {
}
pub
fn
refresh_statusx
()
{
main_ui
()
.backup_run
()
.set_sensitive
(
true
);
if
let
Some
(
communication
)
=
BACKUP_COMMUNICATION
.load
()
.get_active
()
{
main_ui
()
.backup_run
()
.set_sensitive
(
false
);
refresh_status
(
communication
);
}
else
if
let
Some
(
backup
)
=
SETTINGS
.load
()
.backups
.get_active
()
{
refresh_offline
(
&
backup
.last_run
);
...
...
@@ -450,7 +452,7 @@ pub fn refresh_status(communication: &borg::Communication) -> Continue {
main_ui
()
.archive_progress
()
.set_fraction
(
fraction
);
main_ui
()
.status_subtext
()
.set_text
(
&
forma
t!
(
"{:.1} % finished"
,
fraction
*
100.0
))
.set_text
(
&
gettex
t!
(
"{:.1} % finished"
,
fraction
*
100.0
))
}
else
{
main_ui
()
.archive_progress
()
.hide
();
}
...
...
@@ -466,10 +468,18 @@ pub fn refresh_status(communication: &borg::Communication) -> Continue {
}
Progress
::
Message
{
message
:
Some
(
ref
message
),
ref
msgid
,
..
}
=>
{
stack
.set_visible_child_name
(
"message"
);
main_ui
()
.message
()
.set_text
(
message
);
if
msgid
.as_ref
()
.map
(|
x
|
x
.starts_with
(
"cache."
))
==
Some
(
true
)
{
main_ui
()
.status_subtext
()
.set_text
(
&
gettext
(
"Updating repository information"
));
}
else
{
main_ui
()
.status_subtext
()
.set_text
(
message
);
}
}
Progress
::
Percent
{
current
:
Some
(
current
),
...
...
@@ -478,10 +488,12 @@ pub fn refresh_status(communication: &borg::Communication) -> Continue {
..
}
=>
{
stack
.set_visible_child_name
(
"percent"
);
main_ui
()
.progress
()
.set_fraction
(
current
as
f64
/
total
as
f64
);
let
fraction
=
current
as
f64
/
total
as
f64
;
main_ui
()
.progress
()
.set_fraction
(
fraction
);
main_ui
()
.percent_message
()
.set_text
(
message
);
main_ui
()
.status_subtext
()
.set_text
(
&
gettext!
(
"{:.1} % prepared"
,
fraction
*
100.0
))
}
// TODO: cover progress message?
_
=>
{}
...
...
src/ui/new_backup.rs
View file @
1769177a
...
...
@@ -132,7 +132,14 @@ fn add_repo_list_activated(row: >k::ListBoxRow, ui: Rc<builder::NewBackup>) {
ui
.add_button
()
.show
();
ui
.add_button
()
.grab_default
();
}
else
{
add_repo_config_local
(
std
::
path
::
Path
::
new
(
&
name
),
ui
);
let
path
=
match
glib
::
filename_from_uri
(
&
name
)
{
Ok
((
path
,
_
))
=>
path
,
Err
(
err
)
=>
{
ui
::
utils
::
dialog_error
(
format!
(
"URI conversion: {:?}"
,
err
));
return
;
}
};
add_repo_config_local
(
std
::
path
::
Path
::
new
(
&
path
),
ui
);
}
}
...
...
@@ -358,7 +365,22 @@ fn insert_backup_config_encryption_unknown(
)
{
let
mut
borg
=
borg
::
Borg
::
new
(
config
.clone
());
borg
.set_password
(
Zeroizing
::
new
(
vec!
[]));
config
.encrypted
=
borg
.peak
()
.is_err
();
// TODO: This is not async
if
let
Err
(
err
)
=
borg
.peak
()
{
if
matches!
(
err
,
shared
::
BorgErr
::
PasswordMissing
)
||
err
.has_borg_msgid
(
&
shared
::
MsgId
::
PassphraseWrong
)
{
config
.encrypted
=
true
;
}
else
{
ui
::
utils
::
dialog_error
(
gettext!
(
"There was an error with the specified repository:
\n\n
{}"
,
err
));
return
;
}
}
insert_backup_config_password_unknown
(
config
,
ui
);
}
...
...
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