-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
PR: Create a unique instance of the file switcher attached to the main window #4626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
142e820
46f9751
af1d76f
d4ce253
a30e6df
690645d
d317713
4a7c9b0
7f45c7b
461c6de
9aa3053
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -766,9 +766,10 @@ def open_fileswitcher_dlg(self): | |
self.fileswitcher_dlg.hide() | ||
self.fileswitcher_dlg.is_visible = False | ||
return | ||
self.fileswitcher_dlg = FileSwitcher(self, self.tabs, self.data) | ||
self.fileswitcher_dlg = FileSwitcher(self, self, self.tabs, self.data, | ||
ima.icon('TextFileIcon')) | ||
self.fileswitcher_dlg.sig_goto_file.connect(self.set_stack_index) | ||
self.fileswitcher_dlg.sig_close_file.connect(self.close_file) | ||
self.fileswitcher_dlg.setup() | ||
self.fileswitcher_dlg.show() | ||
self.fileswitcher_dlg.is_visible = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we still need this instance of the file switcher here? I mean, can we remove it given that we have now a single and global instance? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left this for the windows that the editor could create, but I think it is possible to attach that windows to the file switcher too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, but how is the file switcher called for those windows? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As it is in this moment for those windows only by clicking in the action of the menu. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @goanpeca, what do you think? should we leave it or remove it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm not a strong opinion either way :-| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave it for now then ;-) |
||
|
||
|
@@ -782,6 +783,10 @@ def update_fileswitcher_dlg(self): | |
if self.fileswitcher_dlg: | ||
self.fileswitcher_dlg.setup() | ||
|
||
def get_current_tab_manager(self): | ||
"""Get the widget with the TabWidget attribute.""" | ||
return self | ||
|
||
def go_to_line(self): | ||
"""Go to line dialog""" | ||
if self.data: | ||
|
@@ -1104,8 +1109,9 @@ def get_current_editor(self): | |
def get_stack_count(self): | ||
return self.tabs.count() | ||
|
||
def set_stack_index(self, index): | ||
self.tabs.setCurrentIndex(index) | ||
def set_stack_index(self, index, instance=None): | ||
if instance == self or instance == None: | ||
self.tabs.setCurrentIndex(index) | ||
|
||
def set_tabbar_visible(self, state): | ||
self.tabs.tabBar().setVisible(state) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When opening the symbol switcher we should give focus to the Editor because it has no meaning for the other plugins, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍