Skip to content

Commit

Permalink
Fix for uncomment keyboard shortcut.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dman95 committed Feb 3, 2020
1 parent f6d9dfa commit 47a6bd6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion BSD/share/sasm/keys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ paste=default
delete=default
selectAll=default
comment=Shift+Ctrl+A
uncomment=Shift+Ctrl+S
uncomment=Shift+Ctrl+Q
deleteTab=Shift+Tab
build=Ctrl+F9
run=F9
Expand Down
2 changes: 1 addition & 1 deletion Linux/share/sasm/keys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ paste=default
delete=default
selectAll=default
comment=Shift+Ctrl+A
uncomment=Shift+Ctrl+S
uncomment=Shift+Ctrl+Q
deleteTab=Shift+Tab
build=Ctrl+F9
run=F9
Expand Down
2 changes: 1 addition & 1 deletion Windows/keys.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ paste=default
delete=default
selectAll=default
comment=Shift+Ctrl+A
uncomment=Shift+Ctrl+S
uncomment=Shift+Ctrl+Q
deleteTab=Shift+Tab
build=Ctrl+F9
run=F9
Expand Down
4 changes: 2 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void MainWindow::createActions()

uncommentAction = new QAction(tr("Remove comment"), this);
key = keySettings.value("uncomment", "default").toString();
stdKey = QKeySequence(QString("Shift+Ctrl+S"));
stdKey = QKeySequence(QString("Shift+Ctrl+Q"));
if (key == "default")
key = stdKey.toString();
uncommentAction->setShortcut(key);
Expand Down Expand Up @@ -2226,7 +2226,7 @@ void MainWindow::openAbout()
tr("simple Open Source IDE for NASM, MASM, GAS and FASM assembler languages.") + '\n' +
tr("Licensed under the GNU GPL v3.0") + '\n' +
tr("Based on the Qt.") + '\n' +
tr("Copyright © 2013 Dmitriy Manushin") + '\n' +
tr("Copyright (c) 2013 Dmitriy Manushin") + '\n' +
tr("Development and idea - Dmitriy Manushin") + '\n' +
tr("Icon and advices - Alick Gaybullaev") + '\n' + '\n' +
tr("Wishes and error messages are sent to the e-mail: [email protected]") + '\n' +
Expand Down
14 changes: 12 additions & 2 deletions ruqplaintextedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,22 @@ RuQPlainTextEdit::RuQPlainTextEdit(QWidget *parent) :

setDebugDisabled();

QSettings keySettings(Common::applicationDataPath() + "/keys.ini", QSettings::IniFormat);

commentAction = new QAction(tr("Comment"), this);
commentAction->setShortcut(QString("Ctrl+Shift+Q"));
QString key = keySettings.value("comment", "default").toString();
QKeySequence stdKey = QKeySequence(QString("Shift+Ctrl+A"));
if (key == "default")
key = stdKey.toString();
commentAction->setShortcut(key);
connect(commentAction, SIGNAL(triggered()), this, SLOT(commentSelectedCode()));

uncommentAction = new QAction(tr("Remove comment"), this);
uncommentAction->setShortcut(QString("Ctrl+Shift+A"));
key = keySettings.value("uncomment", "default").toString();
stdKey = QKeySequence(QString("Shift+Ctrl+Q"));
if (key == "default")
key = stdKey.toString();
uncommentAction->setShortcut(key);
connect(uncommentAction, SIGNAL(triggered()), this, SLOT(uncommentSelectedCode()));

undoAction = new QAction(tr("Undo"), this);
Expand Down
1 change: 1 addition & 0 deletions ruqplaintextedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <QTextStream>
#include <QPointer>
#include <QSettings>
#include "common.h"

/**
* @file ruqplaintextedit.h
Expand Down

0 comments on commit 47a6bd6

Please sign in to comment.