itom
Loading...
Searching...
No Matches
ito::PyCodeReferenceRenamer Class Reference
Inheritance diagram for ito::PyCodeReferenceRenamer:

Classes

struct  RenameItem
 

Public Types

enum  RenamerRetVal { CodeYetNotAvailable = 100 , CouldNotOpenFile = 101 }
 

Public Member Functions

 PyCodeReferenceRenamer (QWidget *parent=nullptr)
 
RetVal rename (const int &line, const int &column, const QString &filepath)
 starts a variable rename operation for the word under the given cursor position
 

Private Types

enum  RenamerRole {
  RoleFilePath = Qt::UserRole , RoleMainFile = Qt::UserRole + 1 , RoleFileOpened = Qt::UserRole + 2 , RoleFileModified = Qt::UserRole + 3 ,
  RoleFileRenameItem = Qt::UserRole + 4 , RoleFileUntitled = Qt::UserRole + 5
}
 

Private Slots

void onJediRenameResultAvailable (const QVector< ito::JediRename > &filesToChange, const QString &oldValue, bool success, QString errorText)
 
void onApply ()
 
void onCanceled ()
 
void onItemChanged (QTreeWidgetItem *item, int column)
 
void keyPressEvent (QKeyEvent *event)
 
void clearAndHideTreeWidget ()
 
void onItemDoubleClick (QTreeWidget *treeWidget, QTreeWidgetItem *item)
 
ito::RetVal replaceOccurencesInFile (const QString &filePath, const QString &newValue, const QVector< ito::FileRenameItem > &renameItems)
 

Private Member Functions

QStringList readFirstNLinesFromFile (const QString &filepath, int n) const
 

Private Attributes

QObject * m_pPythonEngine
 
QDialog * m_renameDialog
 
QLineEdit * m_newNameUserInput
 
QTreeWidget * m_treeWidgetReferences
 
QDialogButtonBox * m_dialogButtonBox
 
ito::JediRenameRequest m_request
 
QWidget * m_pParent
 

Member Function Documentation

◆ rename()

ito::RetVal ito::PyCodeReferenceRenamer::rename ( const int & line,
const int & column,
const QString & filepath )

starts a variable rename operation for the word under the given cursor position

setups connections to python engine and to get a notification about focus changes.

Parameters
filepathis the filepath of the word under the cursor or a NULL-string, if the script is unnamed, hence, has not been safed yet.

The documentation for this class was generated from the following files: