[pitivi: 8/9] medialibrary: Fix traceback due to right click



commit 4bf15d15ace1c0e7ca08b206bbdb76f4ee898e33
Author: Ritwik Puri <ritwikpuri5678 gmail com>
Date:   Tue Jan 21 00:03:52 2020 +0530

    medialibrary: Fix traceback due to right click
    
    fixes #2411

 pitivi/medialibrary.py     |  2 +-
 tests/test_medialibrary.py | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index e8587d6e..d6ca480a 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -1341,7 +1341,7 @@ class MediaLibraryWidget(Gtk.Box, Loggable):
         subprocess.Popen([sys.argv[0], path])
 
     def __create_menu_model(self):
-        if self.app.proxy_manager.proxyingUnsupported:
+        if self.app.proxy_manager.proxying_unsupported:
             return None, None
 
         assets = self.get_selected_assets()
diff --git a/tests/test_medialibrary.py b/tests/test_medialibrary.py
index 5d06ece1..a05a38e0 100644
--- a/tests/test_medialibrary.py
+++ b/tests/test_medialibrary.py
@@ -20,12 +20,14 @@ import os
 import tempfile
 from unittest import mock
 
+from gi.repository import Gdk
 from gi.repository import GES
 from gi.repository import Gst
 
 from pitivi import medialibrary
 from pitivi.project import ProjectManager
 from pitivi.utils.proxy import ProxyingStrategy
+from pitivi.utils.validate import create_event
 from tests import common
 
 
@@ -447,3 +449,11 @@ class TestMediaLibrary(BaseTestMediaLibrary):
         with common.created_project_file(asset_uri) as uri:
             self._custom_set_up(project_uri=uri)
         self.assertTrue(self.medialibrary._import_warning_infobar.props.visible)
+
+    def test_right_click_on_media_library(self):
+        self._custom_set_up()
+        mlib = self.medialibrary
+
+        # Release click
+        event = create_event(Gdk.EventType.BUTTON_RELEASE, button=3)
+        mlib._iconview_button_release_event_cb(mlib.iconview, event)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]