Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
World
Design Tooling
App Icon Preview
Commits
4ce26500
Commit
4ce26500
authored
Aug 03, 2020
by
Bilal Elmoussaoui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: just update the exporter/previewer
parent
e73991a3
Pipeline
#201377
passed with stage
in 15 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
src/widgets/window.rs
src/widgets/window.rs
+12
-14
No files found.
src/widgets/window.rs
View file @
4ce26500
...
...
@@ -63,22 +63,20 @@ impl Window {
self
.monitor
.borrow_mut
()
.replace
(
monitor
);
self
.open_project
.borrow_mut
()
.replace
(
project
);
self
.monitor
.borrow
()
.as_ref
()
.unwrap
()
.connect_changed
(
clone!
(
@
strong
self
.sender
as
sender
,
@
strong
self
.open_project
as
project
=>
move
|
monitor
,
_
,
_
,
event
|
{
if
event
==
gio
::
FileMonitorEvent
::
Changed
{
let
file
=
project
.borrow
()
.as_ref
()
.unwrap
()
.file
.clone
();
match
Project
::
parse
(
file
)
{
Ok
(
project
)
=>
{
monitor
.cancel
();
send!
(
sender
,
Action
::
OpenProject
(
project
));
}
Err
(
err
)
=>
warn!
(
"Failed to parse the project {}"
,
err
),
self
.monitor
.borrow
()
.as_ref
()
.unwrap
()
.connect_changed
(
clone!
(
@
strong
self
.open_project
as
project
,
@
strong
self
.exporter
as
exporter
,
@
strong
self
.previewer
as
previewer
=>
move
|
monitor
,
_
,
_
,
event
|
{
if
event
==
gio
::
FileMonitorEvent
::
Changed
{
let
file
=
project
.borrow
()
.as_ref
()
.unwrap
()
.file
.clone
();
match
Project
::
parse
(
file
)
{
Ok
(
project
)
=>
{
monitor
.cancel
();
previewer
.preview
(
&
project
);
exporter
.set_project
(
&
project
);
}
Err
(
err
)
=>
warn!
(
"Failed to parse the project {}"
,
err
),
}
}));
}
}));
}
pub
fn
set_view
(
&
self
,
view
:
View
)
{
...
...
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