From 0918ffd1356049734cb107b0c9ed1dc1906bac4a Mon Sep 17 00:00:00 2001 From: Ernie Pasveer Date: Sat, 19 Feb 2022 10:54:26 -0600 Subject: [PATCH] Checkpoint: Key shortcuts. --- src/CMakeLists.txt | 4 + src/SeerConfigDialog.cpp | 8 + src/SeerConfigDialog.h | 2 + src/SeerConfigDialog.ui | 4 +- src/SeerKeySettings.cpp | 64 ++++++ src/SeerKeySettings.h | 38 ++++ src/SeerKeysConfigPage.cpp | 17 ++ src/SeerKeysConfigPage.h | 17 ++ src/SeerKeysConfigPage.ui | 396 +++++++++++++++++++++++++++++++++ src/resource.qrc | 1 + src/resources/README.icons | 1 + src/resources/keyboard-key.png | Bin 0 -> 1989 bytes 12 files changed, 550 insertions(+), 2 deletions(-) create mode 100644 src/SeerKeySettings.cpp create mode 100644 src/SeerKeySettings.h create mode 100644 src/SeerKeysConfigPage.cpp create mode 100644 src/SeerKeysConfigPage.h create mode 100644 src/SeerKeysConfigPage.ui create mode 100644 src/resources/keyboard-key.png diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e3144af..1d57b29 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,6 +34,7 @@ set(HEADER_FILES SeerEditorConfigPage.h SeerSourceConfigPage.h SeerSeerConfigPage.h + SeerKeysConfigPage.h SeerDebugDialog.h SeerDirectoryFilterProxyModel.h SeerEditorManagerEntry.h @@ -71,6 +72,7 @@ set(HEADER_FILES SeerAboutDialog.h SeerSlashProcDialog.h SeerHighlighterSettings.h + SeerKeySettings.h QProcessInfo.h QProcessInfoWidget.h QProgressIndicator.h @@ -95,6 +97,7 @@ set(SOURCE_FILES SeerEditorConfigPage.cpp SeerSourceConfigPage.cpp SeerSeerConfigPage.cpp + SeerKeysConfigPage.cpp SeerDebugDialog.cpp SeerEditorManagerWidget.cpp SeerEditorOptionsBarWidget.cpp @@ -133,6 +136,7 @@ set(SOURCE_FILES SeerAboutDialog.cpp SeerSlashProcDialog.cpp SeerHighlighterSettings.cpp + SeerKeySettings.cpp QProcessInfo.cpp QProcessInfoWidget.cpp QProgressIndicator.cpp diff --git a/src/SeerConfigDialog.cpp b/src/SeerConfigDialog.cpp index a8b1b70..e8f9aac 100644 --- a/src/SeerConfigDialog.cpp +++ b/src/SeerConfigDialog.cpp @@ -23,12 +23,14 @@ SeerConfigDialog::SeerConfigDialog(QWidget* parent) : QDialog(parent) { _gdbConfigPage = new SeerGdbConfigPage; _editorConfigPage = new SeerEditorConfigPage; _sourceConfigPage = new SeerSourceConfigPage; + _keysConfigPage = new SeerKeysConfigPage; _seerConfigPage = new SeerSeerConfigPage; // Add the pages to the stacked widget. pagesStackedWidget->addWidget(_gdbConfigPage); pagesStackedWidget->addWidget(_editorConfigPage); pagesStackedWidget->addWidget(_sourceConfigPage); + pagesStackedWidget->addWidget(_keysConfigPage); pagesStackedWidget->addWidget(_seerConfigPage); // Create icons. @@ -50,6 +52,12 @@ SeerConfigDialog::SeerConfigDialog(QWidget* parent) : QDialog(parent) { configSourceButton->setTextAlignment(Qt::AlignHCenter); configSourceButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + QListWidgetItem* configKeysButton = new QListWidgetItem(contentsListWidget); + configKeysButton->setIcon(QIcon(":/seer/resources/keyboard-key.png")); + configKeysButton->setText(tr("Keys")); + configKeysButton->setTextAlignment(Qt::AlignHCenter); + configKeysButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + QListWidgetItem* configSeerButton = new QListWidgetItem(contentsListWidget); configSeerButton->setIcon(QIcon(":/seer/resources/seer_128x128.png")); configSeerButton->setText(tr("Seer")); diff --git a/src/SeerConfigDialog.h b/src/SeerConfigDialog.h index d1f57c2..cede90c 100644 --- a/src/SeerConfigDialog.h +++ b/src/SeerConfigDialog.h @@ -3,6 +3,7 @@ #include "SeerGdbConfigPage.h" #include "SeerEditorConfigPage.h" #include "SeerSourceConfigPage.h" +#include "SeerKeysConfigPage.h" #include "SeerSeerConfigPage.h" #include @@ -74,6 +75,7 @@ class SeerConfigDialog : public QDialog, protected Ui::SeerConfigDialogForm { SeerGdbConfigPage* _gdbConfigPage; SeerEditorConfigPage* _editorConfigPage; SeerSourceConfigPage* _sourceConfigPage; + SeerKeysConfigPage* _keysConfigPage; SeerSeerConfigPage* _seerConfigPage; }; diff --git a/src/SeerConfigDialog.ui b/src/SeerConfigDialog.ui index 11d4784..ad119af 100644 --- a/src/SeerConfigDialog.ui +++ b/src/SeerConfigDialog.ui @@ -6,8 +6,8 @@ 0 0 - 634 - 542 + 736 + 569 diff --git a/src/SeerKeySettings.cpp b/src/SeerKeySettings.cpp new file mode 100644 index 0000000..a454fc9 --- /dev/null +++ b/src/SeerKeySettings.cpp @@ -0,0 +1,64 @@ +#include "SeerKeySettings.h" +#include + +SeerKeySettings::SeerKeySettings () { +} + +SeerKeySettings::SeerKeySettings (const SeerKeySettings& other) { + + *this = other; +} + +SeerKeySettings::~SeerKeySettings () { +} + +SeerKeySettings& SeerKeySettings::operator== (const SeerKeySettings& rhs) { + + _keys = rhs._keys; +} + +QStringList SeerKeySettings::keys () const { + + QList keylist = _keys.keys(); + + QStringList keys; + + for (int i=0; i +#include +#include +#include + +struct SeerKeySetting { + + SeerKeySetting(QString name, QKeySequence sequence, QString help) : _name(name), _sequence(sequence), _help(help) {} + SeerKeySetting() {}; + + QString _name; + QKeySequence _sequence; + QString _help; +}; + + +class SeerKeySettings { + + public: + SeerKeySettings (); + SeerKeySettings (const SeerKeySettings& other); + ~SeerKeySettings (); + + SeerKeySettings& operator== (const SeerKeySettings& rhs); + + QStringList keys () const; + bool has (const QString& name) const; + SeerKeySetting get (const QString& name) const; + void add (const QString& name, const SeerKeySetting& setting); + + static SeerKeySettings populate (); + + private: + QMap _keys; +}; + diff --git a/src/SeerKeysConfigPage.cpp b/src/SeerKeysConfigPage.cpp new file mode 100644 index 0000000..80b5c82 --- /dev/null +++ b/src/SeerKeysConfigPage.cpp @@ -0,0 +1,17 @@ +#include "SeerKeysConfigPage.h" +#include +#include + +SeerKeysConfigPage::SeerKeysConfigPage(QWidget* parent) : QWidget(parent) { + + // Set up the UI. + setupUi(this); + + // Setup the widgets + + // Connect things. +} + +SeerKeysConfigPage::~SeerKeysConfigPage() { +} + diff --git a/src/SeerKeysConfigPage.h b/src/SeerKeysConfigPage.h new file mode 100644 index 0000000..277927a --- /dev/null +++ b/src/SeerKeysConfigPage.h @@ -0,0 +1,17 @@ +#pragma once + +#include + +#include "ui_SeerKeysConfigPage.h" + +class SeerKeysConfigPage : public QWidget, protected Ui::SeerKeysConfigPage { + + Q_OBJECT + + public: + explicit SeerKeysConfigPage (QWidget* parent = 0); + ~SeerKeysConfigPage (); + + protected slots: +}; + diff --git a/src/SeerKeysConfigPage.ui b/src/SeerKeysConfigPage.ui new file mode 100644 index 0000000..0fb06d9 --- /dev/null +++ b/src/SeerKeysConfigPage.ui @@ -0,0 +1,396 @@ + + + SeerKeysConfigPage + + + + 0 + 0 + 887 + 817 + + + + SeerKeysConfigPage + + + + + + Gdb Keys + + + + + + Run + + + + + + + + 0 + 0 + + + + + + + + + + + Run the program again. Do not break in main(). + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Start + + + + + + + + 0 + 0 + + + + + + + + Run the program again. Break in main(). + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Continue + + + + + + + + 0 + 0 + + + + + + + + Continue execution of the program. + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Next + + + + + + + + 0 + 0 + + + + + + + + Execute the next line. Step over functions. + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Step + + + + + + + + 0 + 0 + + + + + + + + Execute the next line. Step into functions. + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Finish + + + + + + + + 0 + 0 + + + + + + + + Finish the current function. + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + Debug + + + + + + + + 0 + 0 + + + + + + + + Open the debug dialog. + + + + + + + Qt::Horizontal + + + + 308 + 20 + + + + + + + + + + + Editor Keys + + + + + + Qt::Horizontal + + + + 311 + 20 + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + + + + + Alternate Directory + + + + + + + Text Search + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 311 + 20 + + + + + + + + Search for text in the code editor. + + + + + + + Look for the source in an alternate directory. + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Noto Sans'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Specify key bindings for important Seer operations.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> + + + + + gdbKeysGroupBox + textBrowser + editorKeysGroupBox + + + + + + diff --git a/src/resource.qrc b/src/resource.qrc index 445346f..c9ad816 100644 --- a/src/resource.qrc +++ b/src/resource.qrc @@ -24,6 +24,7 @@ resources/gdb.png resources/editor.png resources/source.png + resources/keyboard-key.png resources/font.png resources/console.png resources/hide.png diff --git a/src/resources/README.icons b/src/resources/README.icons index a77a898..703990b 100644 --- a/src/resources/README.icons +++ b/src/resources/README.icons @@ -15,6 +15,7 @@ Most are 32x32. https://www.flaticon.com/premium-icon/close_3718000 https://www.flaticon.com/authors/flat-icons https://www.flaticon.com/free-icon/up-arrow_2223694 https://www.flaticon.com/authors/bqlqn https://www.flaticon.com/free-icon/down-arrow_2223613 https://www.flaticon.com/authors/bqlqn + https://www.flaticon.com/free-icons/keyboard https://www.flaticon.com/authors/freepik https://icon-icons.com/icon/GDB/132365 https://creativecommons.org/licenses/by/4.0/ John Gardner diff --git a/src/resources/keyboard-key.png b/src/resources/keyboard-key.png new file mode 100644 index 0000000000000000000000000000000000000000..fe765702b620b9e6e92b6ae692324d7acc21c6eb GIT binary patch literal 1989 zcmV;$2RitPP)uU7m`b|g0=-}TS{q5 z+wqU*3^O~O?HqPyHYx6tY-Z*==e*}T?|HA!_buZX$2i6@j&c0oqGycmGk_sXE_wa| z{2sfzHlqUFR=^3k2CHx%_LaPDDqeu^;Un1FmDzO}Q*kf8fmx%teim-PMoj78yv7Vy zU_vL5^hS9M}SV~s6%eh1_X;U684Gp3k|$2%mer;s(ZL-K~9w;MvyFOj^8lkvqS z=Usv;nv7ptTmzLtR(~fa*li4ASKaTa#qT){=WW8@4387@@L$8<_^v``$I&edXv99O z$D8WL7K=i9u%vE$6>e2NWwwQ}QUH8k9c$s~75r24%JFI80>re};S9s8yFW=x_?hJW;~s-X zZerDAN4M!Y@g-|bE-vK#qFm}XE$56F^2PEQ;7N_Cg zg{jL&0I zAkD=#;STrX!Q%T8dGkkfi688i0xDAVy&QkXh4Kbx$OF!ihdhK6h4Y(Tj6ES8;qKzt z>u^h#=Gj%8iif1~BM*3b@%^0Qb3l3lqO4v_my`(C;Ss}&rjDZ9(RC?)AgOGvnE7ga z8?P2VV4Dyl-^966AnnFw(l5LjzwXuq$0EJ-OFCStd|j{)_uwbuGF?M`445Rox=hTl z3?9etg#8_fyYDf&dZX1f)1|X~q4Ko(Udc+gNUV9%0*0hUe*m{@-pGtJiC2ivz7@Z0 zIKE6ez&{qp_LP)61LtEAE|T?ydc0CH%RRVDvPl^X-~!CY8)dP^Jc+)mOA2X*mDpi; zjlWRR-D}#AySk8ZYTekG#l6mHL+-`$%yZ$(_(B`Ps(7Dtb5-1gD?1?flZJB#x9JRL zaE%mbwuq^cycQ^d9QNFHw&v(<{A`g^pC(}aI;NCM!o&{y)NTO?=C6oR7_29#6M zqlL^SF77uCm*Xpv+DAkg1+2oIvQ+(!wx(Fa$&$YI z%bU1WI>&ZVP3s3G?Y>)-drVZsv_`_+qQym0woW|8x%Z2uj6{l7aki`xd`+zvI2Nj; z=)&S2&2WL#F!h)q@uOLcn}A9y3s@wC#(MmR%tEf2my6wwYvS8;T2Gg&O>Kdmlo<^p|EEma!+4&tN{ zWR-P+XEYhxA&hY|lyQL-5(Mk< z+(?+9ScIu)zJG5tT)|c~1(e;|R>tr5swrUWDCX4+lhwJvbDNy-RF|k`NM~8aG%?3k zIMU+yfGYNsC%(P-e72-Lcw6x~PnN9+wKPHA z%nnJNRa_;@VLf=QSV^B+4Y5M4M6Jp`NA?g^$9nK%e7a8VbwX-Z=XzQ3IiyCDRb$UW zq2KGro+(uOZ}0)~Ht&#aDs$^jT&b3uFE2jNQ``Pp9a|yfAwJ4(%bg)q*w^tX z9B7RC(>yhv{eZlUoh5F3hVt88_sc&_w4%`m#Uji8BSv){qb!X+j&Y1*9OD?r(;5E* XfTNUV2IEkc00000NkvXXu0mjf?JUPU literal 0 HcmV?d00001