diff options
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h index 0c83b7ce..b0a6cbc7 100644 --- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h +++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h @@ -21,7 +21,7 @@ class PlainTextEditor : public QPlainTextEdit{ public: PlainTextEditor(QSettings *set, QWidget *parent = 0); ~PlainTextEditor(); - + //Functions for setting up the editor void showLineNumbers(bool show = true); void LoadSyntaxRule(QString type); @@ -29,18 +29,19 @@ public: //File loading/setting options void LoadFile(QString filepath); - void SaveFile(bool newname = false); + bool SaveFile(bool newname = false); QString currentFile(); bool hasChange(); + bool readOnlyFile(); //Functions for managing the line number widget (internal - do not need to run directly) int LNWWidth(); //replacing the LNW size hint detection void paintLNW(QPaintEvent *ev); //forwarded from the LNW paint event - void updateLNW(); + void updateLNW(); QFontMetrics *metrics; - + private: QWidget *LNW; //Line Number Widget bool showLNW; @@ -55,8 +56,9 @@ private: void clearMatchData(); void highlightMatch(QChar ch, bool forward, int fromPos, QChar startch); - //Flags to keep track of changes - bool hasChanges; + //Flags to keep track of changes/status + bool hasChanges, readonly; + private slots: //Functions for managing the line number widget void LNW_updateWidth(); // Tied to the QPlainTextEdit::blockCountChanged() signal @@ -68,7 +70,7 @@ private slots: void textChanged(); void cursorMoved(); //Function for prompting the user if the file changed externally - void fileChanged(); + void fileChanged(); protected: void resizeEvent(QResizeEvent *ev); |