Commit 817d885a authored by HarishFulara07's avatar HarishFulara07 Committed by Alexandru Băluț
Browse files

greeter: Open project file dragged from Nautilus

parent 6db06472
Pipeline #23749 passed with stages
in 58 minutes and 26 seconds
......@@ -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
......@@ -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")
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:
uri = uris[0]
extension = os.path.splitext(uri)[1][1:]
if extension in self.__project_filter:
def __new_project_cb(self, unused_action, unused_param):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment