Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
pitivi
Commits
817d885a
Commit
817d885a
authored
Aug 04, 2018
by
HarishFulara07
Committed by
Alexandru Băluț
Aug 07, 2018
Browse files
greeter: Open project file dragged from Nautilus
parent
6db06472
Pipeline
#23749
passed with stages
in 58 minutes and 26 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
pitivi/greeterperspective.py
View file @
817d885a
...
...
@@ -35,6 +35,7 @@ from pitivi.utils.ui import beautify_last_updated_timestamp
from
pitivi.utils.ui
import
beautify_project_path
from
pitivi.utils.ui
import
fix_infobar
from
pitivi.utils.ui
import
GREETER_PERSPECTIVE_CSS
from
pitivi.utils.ui
import
URI_TARGET_ENTRY
MAX_RECENT_PROJECTS
=
10
...
...
@@ -120,6 +121,9 @@ class GreeterPerspective(Perspective):
builder
.
add_from_file
(
os
.
path
.
join
(
get_ui_dir
(),
"greeter.ui"
))
self
.
toplevel_widget
=
builder
.
get_object
(
"toplevel_vbox"
)
self
.
toplevel_widget
.
drag_dest_set
(
Gtk
.
DestDefaults
.
ALL
,
[
URI_TARGET_ENTRY
],
Gdk
.
DragAction
.
COPY
)
self
.
toplevel_widget
.
connect
(
"drag-data-received"
,
self
.
__drag_data_received_cb
)
self
.
__topvbox
=
builder
.
get_object
(
"topvbox"
)
self
.
__welcome_vbox
=
builder
.
get_object
(
"welcome_vbox"
)
...
...
@@ -298,6 +302,18 @@ class GreeterPerspective(Perspective):
assert
not
visible_options
return
menu_button
def
__drag_data_received_cb
(
self
,
unused_widget
,
unused_context
,
unused_x
,
unused_y
,
data
,
unused_info
,
unused_time
):
"""Opens the project file dragged from Nautilus."""
uris
=
data
.
get_uris
()
if
not
uris
:
return
uri
=
uris
[
0
]
extension
=
os
.
path
.
splitext
(
uri
)[
1
][
1
:]
if
extension
in
self
.
__project_filter
:
self
.
app
.
project_manager
.
loadProject
(
uri
)
def
__new_project_cb
(
self
,
unused_action
,
unused_param
):
self
.
app
.
project_manager
.
newBlankProject
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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