aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/ColorDialog.h8
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.cpp9
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.h1
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp7
4 files changed, 17 insertions, 8 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/ColorDialog.h b/src-qt5/desktop-utils/lumina-textedit/ColorDialog.h
index 2cddd7cf..0608e381 100644
--- a/src-qt5/desktop-utils/lumina-textedit/ColorDialog.h
+++ b/src-qt5/desktop-utils/lumina-textedit/ColorDialog.h
@@ -25,9 +25,9 @@ private:
public:
ColorDialog(QSettings *set, QWidget *parent);
~ColorDialog(){}
-
+
void LoadColors();
-
+
public slots:
void updateIcons();
@@ -44,5 +44,5 @@ protected:
this->hide();
}
};
-
-#endif \ No newline at end of file
+
+#endif
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
index 50b83ee8..71c4d173 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
@@ -194,6 +194,13 @@ PlainTextEditor* MainUI::currentEditor(){
return static_cast<PlainTextEditor*>( tabWidget->currentWidget() );
}
+QString MainUI::currentFile(){
+ PlainTextEditor* cur = currentEditor();
+ if(cur!=0){
+ return cur->currentFile();
+ }
+ return "";
+}
QString MainUI::currentFileDir(){
PlainTextEditor* cur = currentEditor();
QString dir;
@@ -228,7 +235,7 @@ void MainUI::OpenFile(QString file){
QStringList files;
if(file.isEmpty()){
//Prompt for a file to open
- files = QFileDialog::getOpenFileNames(this, tr("Open File(s)"), currentFileDir(), tr("Text Files (*)") );
+ files = QFileDialog::getOpenFileNames(this, tr("Open File(s)"), currentFile(), tr("Text Files (*)") );
if(files.isEmpty()){ return; } //cancelled
}else{
files << file;
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.h b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
index c9c4e534..600cd917 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
@@ -46,6 +46,7 @@ private:
//Simplification functions
PlainTextEditor* currentEditor();
+ QString currentFile();
QString currentFileDir();
QStringList unsavedFiles();
diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
index f96efef1..69dc2eab 100644
--- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp
@@ -53,21 +53,22 @@ void PlainTextEditor::showLineNumbers(bool show){
}
void PlainTextEditor::LoadSyntaxRule(QString type){
- qDebug() << "Load SyntaxRule";
+ //qDebug() << "Load SyntaxRule";
QList<SyntaxFile> files = SyntaxFile::availableFiles(settings);
for(int i=0; i<files.length(); i++){
if(files[i].name() == type){
files[i].SetupDocument(this);
SYNTAX->loadRules(files[i]);
break;
+ }else if(i==files.length()-1){
+ SyntaxFile dummy; SYNTAX->loadRules(dummy);
}
- if(i==files.length()-1){ SyntaxFile dummy; SYNTAX->loadRules(dummy); }
}
SYNTAX->rehighlight();
}
void PlainTextEditor::updateSyntaxColors(){
- qDebug() << "Update Syntax Colors";
+ //qDebug() << "Update Syntax Colors";
SYNTAX->reloadRules();
SYNTAX->rehighlight();
}
bgstack15