diff options
author | Weblate <noreply@weblate.org> | 2018-01-02 20:53:45 +0000 |
---|---|---|
committer | Weblate <noreply@weblate.org> | 2018-01-02 20:53:45 +0000 |
commit | 42e4f35c9a2ea2689b62ef8c5461b14a2b820e4f (patch) | |
tree | a92f81f73b37b7de76cc5238f1ec393ae5a18ecd /src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.h | |
parent | Translated using Weblate (Dutch) (diff) | |
parent | Updated project files for plugin system (diff) | |
download | lumina-42e4f35c9a2ea2689b62ef8c5461b14a2b820e4f.tar.gz lumina-42e4f35c9a2ea2689b62ef8c5461b14a2b820e4f.tar.bz2 lumina-42e4f35c9a2ea2689b62ef8c5461b14a2b820e4f.zip |
Merge remote-tracking branch 'origin/master'
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); |