aboutsummaryrefslogtreecommitdiff
path: root/desktop-utilities/lumina-textedit/MainUI.cpp
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2016-04-19 12:18:55 -0400
committerKen Moore <moorekou@gmail.com>2016-04-19 12:18:55 -0400
commit8c57d6137818cbd6a766e11e8e1799afb692002d (patch)
tree5701f8822b238ec676b6d8999a01d036da1ab29f /desktop-utilities/lumina-textedit/MainUI.cpp
parentGet a lot more of lumina-textedit done. Almost everything is complete now exc... (diff)
downloadlumina-8c57d6137818cbd6a766e11e8e1799afb692002d.tar.gz
lumina-8c57d6137818cbd6a766e11e8e1799afb692002d.tar.bz2
lumina-8c57d6137818cbd6a766e11e8e1799afb692002d.zip
Some more work on lumina-textedit.
Diffstat (limited to 'desktop-utilities/lumina-textedit/MainUI.cpp')
-rw-r--r--desktop-utilities/lumina-textedit/MainUI.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop-utilities/lumina-textedit/MainUI.cpp b/desktop-utilities/lumina-textedit/MainUI.cpp
index 53fa0ca6..d477071d 100644
--- a/desktop-utilities/lumina-textedit/MainUI.cpp
+++ b/desktop-utilities/lumina-textedit/MainUI.cpp
@@ -27,6 +27,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
ui->menuSyntax_Highlighting->addAction(smodes[i]);
}
ui->actionLine_Numbers->setChecked( settings->value("showLineNumbers",true).toBool() );
+ ui->actionWrap_Lines->setChecked( settings->value("wrapLines",true).toBool() );
//Setup any connections
connect(ui->actionClose, SIGNAL(triggered()), this, SLOT(close()) );
connect(ui->actionNew_File, SIGNAL(triggered()), this, SLOT(NewFile()) );
@@ -38,6 +39,7 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged()) );
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->actionCustomize_Colors, SIGNAL(triggered()), this, SLOT(ModifyColors()) );
updateIcons();
//Now load the initial size of the window
@@ -115,6 +117,7 @@ void MainUI::OpenFile(QString file){
connect(edit, SIGNAL(UnsavedChanges(QString)), this, SLOT(updateTab(QString)) );
ui->tabWidget->addTab(edit, files[i].section("/",-1));
edit->showLineNumbers(ui->actionLine_Numbers->isChecked());
+ edit->setLineWrapMode( ui->actionWrap_Lines->isChecked() ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);
ui->tabWidget->setCurrentWidget(edit);
edit->LoadFile(files[i]);
edit->setFocus();
@@ -153,6 +156,14 @@ void MainUI::showLineNumbers(bool show){
}
}
+void MainUI::wrapLines(bool wrap){
+ settings->setValue("wrapLines",wrap);
+ for(int i=0; i<ui->tabWidget->count(); i++){
+ PlainTextEditor *edit = static_cast<PlainTextEditor*>(ui->tabWidget->widget(i));
+ edit->setLineWrapMode( wrap ? QPlainTextEdit::WidgetWidth : QPlainTextEdit::NoWrap);
+ }
+}
+
void MainUI::ModifyColors(){
}
bgstack15