Package node_manager_fkie :: Package editor :: Module editor :: Class Editor
[frames] | no frames]

Class Editor

source code

python_qt_binding.QtWidgets.QMainWindow --+
                                          |
                                         Editor

Creates a dialog to edit a launch file.

Instance Methods
 
__init__(self, filenames, search_text='', parent=None) source code
 
keyPressEvent(self, event)
Enable the shortcats for search and replace
source code
 
readSettings(self) source code
 
storeSetting(self) source code
 
on_load_request(self, filename, search_text='', insert_index=-1, goto_line=-1)
Loads a file in a new tab or focus the tab, if the file is already open.
source code
 
on_graph_load_file(self, path, insert_after=True) source code
 
on_graph_goto(self, path, linenr) source code
 
on_text_changed(self, value="") source code
 
on_tab_changed(self, index) source code
 
on_close_tab(self, tab_index)
Signal handling to close single tabs.
source code
 
reject(self) source code
 
closeEvent(self, event)
Test the open files for changes and save this if needed.
source code
 
on_editor_modificationChanged(self, value=None)
If the content was changed, a '*' will be shown in the tab name.
source code
 
on_editor_positionChanged(self)
Shows the number of the line and column in a label.
source code
 
on_upperButton_clicked(self)
Opens the file which include the current open file
source code
 
on_saveButton_clicked(self)
Saves the current document.
source code
 
on_shortcut_find(self) source code
 
on_toggled_graph(self, value)
Shows the search frame
source code
 
on_toggled_find(self, value)
Shows the search frame
source code
 
on_toggled_replace(self, value)
Shows the replace lineedit in the search frame
source code
 
on_shortcut_goto(self)
Opens a goto dialog.
source code
 
on_search_result(self, search_text, found, path, index)
A slot to handle a found text.
source code
 
on_search_result_on_open(self, search_text, found, path, index)
Like on_search_result, but skips the text in comments.
source code
 
on_replace(self, search_text, path, index, replaced_text)
A slot to handle a text replacement of the TextSearchFrame.
source code
Class Variables
  finished_signal = Signal(list)
finished_signal has as parameter the filenames of the initialization and is emitted, if this dialog was closed.
Method Details

__init__(self, filenames, search_text='', parent=None)
(Constructor)

source code 
Parameters:
  • filenames ([str, ...]) - a list with filenames. The last one will be activated.
  • search_text (str (Default: Empty String)) - if not empty, searches in new document for first occurrence of the given text

on_load_request(self, filename, search_text='', insert_index=-1, goto_line=-1)

source code 

Loads a file in a new tab or focus the tab, if the file is already open.

Parameters:
  • filename (str) - the path to file
  • search_text (str (Default: Empty String)) - if not empty, searches in new document for first occurrence of the given text

on_close_tab(self, tab_index)

source code 

Signal handling to close single tabs.

Parameters:
  • tab_index (int) - tab index to close

on_saveButton_clicked(self)

source code 

Saves the current document. This method is called if the save button was clicked.

on_search_result(self, search_text, found, path, index)

source code 

A slot to handle a found text. It goes to the position in the text and select the searched text. On new file it will be open. :param search_text: the searched text :type search_text: str :param found: the text was found or not :type found: bool :param path: the path of the file the text was found :type path: str :param index: the position in the text :type index: int

on_replace(self, search_text, path, index, replaced_text)

source code 

A slot to handle a text replacement of the TextSearchFrame. :param search_text: the searched text :type search_text: str :param path: the path of the file the text was found :type path: str :param index: the position in the text :type index: int :param replaced_text: the new text :type replaced_text: str