5 |
5 |
6 """ |
6 """ |
7 Module implementing the listspace viewmanager class. |
7 Module implementing the listspace viewmanager class. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
|
11 |
10 |
12 import os |
11 import os |
13 |
12 |
14 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QFileInfo, QEvent, Qt |
13 from PyQt5.QtCore import pyqtSignal, pyqtSlot, QFileInfo, QEvent, Qt |
15 from PyQt5.QtWidgets import QStackedWidget, QSplitter, QListWidget, \ |
14 from PyQt5.QtWidgets import ( |
16 QListWidgetItem, QSizePolicy, QMenu, QApplication |
15 QStackedWidget, QSplitter, QListWidget, QListWidgetItem, QSizePolicy, |
|
16 QMenu, QApplication |
|
17 ) |
17 |
18 |
18 from ViewManager.ViewManager import ViewManager |
19 from ViewManager.ViewManager import ViewManager |
19 |
20 |
20 import QScintilla.Editor |
21 import QScintilla.Editor |
21 from QScintilla.Editor import Editor |
22 from QScintilla.Editor import Editor |
790 def __contextMenuCloseOthers(self): |
791 def __contextMenuCloseOthers(self): |
791 """ |
792 """ |
792 Private method to close the other editors. |
793 Private method to close the other editors. |
793 """ |
794 """ |
794 index = self.contextMenuIndex |
795 index = self.contextMenuIndex |
795 for i in list(range(self.viewlist.count() - 1, index, -1)) + \ |
796 for i in ( |
796 list(range(index - 1, -1, -1)): |
797 list(range(self.viewlist.count() - 1, index, -1)) + |
|
798 list(range(index - 1, -1, -1)) |
|
799 ): |
797 editor = self.editors[i] |
800 editor = self.editors[i] |
798 self.closeEditorWindow(editor) |
801 self.closeEditorWindow(editor) |
799 |
802 |
800 def __contextMenuCloseAll(self): |
803 def __contextMenuCloseAll(self): |
801 """ |
804 """ |
894 @param event the event that occurred |
897 @param event the event that occurred |
895 @type QEvent |
898 @type QEvent |
896 @return flag indicating, if we handled the event |
899 @return flag indicating, if we handled the event |
897 @rtype bool |
900 @rtype bool |
898 """ |
901 """ |
899 if event.type() == QEvent.MouseButtonPress and \ |
902 if ( |
900 not event.button() == Qt.RightButton: |
903 event.type() == QEvent.MouseButtonPress and |
|
904 not event.button() == Qt.RightButton |
|
905 ): |
901 switched = True |
906 switched = True |
902 if isinstance(watched, QStackedWidget): |
907 if isinstance(watched, QStackedWidget): |
903 switched = watched is not self.currentStack |
908 switched = watched is not self.currentStack |
904 self.currentStack = watched |
909 self.currentStack = watched |
905 elif isinstance(watched, QScintilla.Editor.Editor): |
910 elif isinstance(watched, QScintilla.Editor.Editor): |