aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-01-23 17:28:33 +0000
committerWeblate <noreply@weblate.org>2017-01-23 17:28:33 +0000
commit2463164f6a8b272de3380c799ad7edad7939cba2 (patch)
treebb7f54ef001c3b02ba2f7acd482bfb4e1d19595a /src-qt5/desktop-utils/lumina-textedit
parentTranslated using Weblate (lumina_FM@pt_br (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-2463164f6a8b272de3380c799ad7edad7939cba2.tar.gz
lumina-2463164f6a8b272de3380c799ad7edad7939cba2.tar.bz2
lumina-2463164f6a8b272de3380c799ad7edad7939cba2.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.cpp10
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.h1
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/MainUI.ui18
3 files changed, 28 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
index 88f7bf00..b5790cc5 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.cpp
@@ -50,6 +50,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
}
ui->actionLine_Numbers->setChecked( settings->value("showLineNumbers",true).toBool() );
ui->actionWrap_Lines->setChecked( settings->value("wrapLines",true).toBool() );
+ ui->actionShow_Popups->setChecked( settings->value("showPopupWarnings",true).toBool() );
+
//Setup any connections
connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(close()) );
connect(ui->actionNew_File, SIGNAL(triggered()), this, SLOT(NewFile()) );
@@ -62,6 +64,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), this, SLOT(tabClosed(int)) );
connect(ui->actionLine_Numbers, SIGNAL(toggled(bool)), this, SLOT(showLineNumbers(bool)) );
connect(ui->actionWrap_Lines, SIGNAL(toggled(bool)), this, SLOT(wrapLines(bool)) );
+ connect(ui->actionShow_Popups, SIGNAL(toggled(bool)), this, SLOT(showPopupWarnings(bool)) );
connect(ui->actionCustomize_Colors, SIGNAL(triggered()), this, SLOT(ModifyColors()) );
connect(ui->actionFind, SIGNAL(triggered()), this, SLOT(openFind()) );
connect(ui->actionReplace, SIGNAL(triggered()), this, SLOT(openReplace()) );
@@ -250,6 +253,10 @@ void MainUI::ModifyColors(){
colorDLG->showNormal();
}
+void MainUI::showPopupWarnings(bool show){
+ settings->setValue("showPopupWarnings",show);
+}
+
void MainUI::updateTab(QString file){
PlainTextEditor *cur = 0;
int index = -1;
@@ -284,7 +291,7 @@ void MainUI::tabChanged(){
void MainUI::tabClosed(int tab){
PlainTextEditor *edit = static_cast<PlainTextEditor*>(ui->tabWidget->widget(tab));
if(edit==0){ return; } //should never happen
- if(edit->hasChange()){
+ if(edit->hasChange() && ui->actionShow_Popups->isChecked() ){
//Verify if the user wants to lose any unsaved changes
if(QMessageBox::Yes != QMessageBox::question(this, tr("Lose Unsaved Changes?"), QString(tr("This file has unsaved changes.\nDo you want to close it anyway?\n\n%1")).arg(edit->currentFile()), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) ){ return; }
}
@@ -382,6 +389,7 @@ void MainUI::closeEvent(QCloseEvent *ev){
}
}
bool quitnow = unsaved.isEmpty();
+ if(!quitnow && !ui->actionShow_Popups->isChecked()){ quitnow = true; }
if(!quitnow){
quitnow = (QMessageBox::Yes == QMessageBox::question(this, tr("Lose Unsaved Changes?"), QString(tr("There are unsaved changes.\nDo you want to close the editor anyway?\n\n%1")).arg(unsaved.join("\n")), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) );
}
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.h b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
index d80793b0..097b747e 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.h
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.h
@@ -57,6 +57,7 @@ private slots:
void showLineNumbers(bool);
void wrapLines(bool);
void ModifyColors();
+ void showPopupWarnings(bool);
//Tab Interactions
void updateTab(QString);
diff --git a/src-qt5/desktop-utils/lumina-textedit/MainUI.ui b/src-qt5/desktop-utils/lumina-textedit/MainUI.ui
index f58644db..eb70184c 100644
--- a/src-qt5/desktop-utils/lumina-textedit/MainUI.ui
+++ b/src-qt5/desktop-utils/lumina-textedit/MainUI.ui
@@ -236,6 +236,7 @@
<addaction name="menuSyntax_Highlighting"/>
<addaction name="actionLine_Numbers"/>
<addaction name="actionWrap_Lines"/>
+ <addaction name="actionShow_Popups"/>
<addaction name="separator"/>
<addaction name="actionCustomize_Colors"/>
</widget>
@@ -388,6 +389,23 @@
<enum>Qt::ApplicationShortcut</enum>
</property>
</action>
+ <action name="actionShow_Popups">
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>Show Popup Warnings</string>
+ </property>
+ <property name="toolTip">
+ <string>Show warnings about unsaved changes</string>
+ </property>
+ <property name="statusTip">
+ <string>Show warnings about unsaved changes</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
bgstack15