Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Code clean-up. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | v0.5.2 |
Files: | files | file ages | folders |
SHA1: |
9d7ea4c4678df3473f0b51838a0e5b4d |
User & Date: | tion 2018-10-10 22:05:47 |
References
2019-02-16
| ||
03:19 | • Wiki page "release_notes" artifact: cf2f198ba2 user: tion | |
Context
2018-10-13
| ||
05:29 | Improved UI. check-in: 1cd32bfbd4 user: tion tags: trunk | |
2018-10-10
| ||
22:05 | Code clean-up. check-in: 9d7ea4c467 user: tion tags: trunk, v0.5.2 | |
20:53 | UI: Added toolbar to replace some buttons check-in: 97f382bf85 user: tion tags: trunk, v0.5.2 | |
Changes
Changes to release_notes.
1 2 3 4 | # Release Notes # ## 0.5.2 ## - Improvements to UI | | | > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # Release Notes # ## 0.5.2 ## - Improvements to UI - Added toolbar for toggling glyph/portal address windows - Added menu bar to replace button group: Exit, About, glyph toggle, portal toggle. - Minor code clean-up. ## [0.5.1](/info/428631ea628c1082) ## - Added ability to select glyph symbols directly and convert into glyph code and coordinates. - Added button toggle to access this feature. - Minor adjustments to UI. |
︙ | ︙ |
Changes to src/MainWindow.cpp.
1 | //================================================================== | < < < > < < | | | < < | | | | < < | < < < < < < < < | | > > > > > > > > > > | | < > > > > < > > > > > > | < > | < < | < > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | //================================================================== #include <QtWidgets> #include "MainWindow.h" //================================================================== ///////////////// // CONSTRUCTOR // ///////////////// //================================================================== MainWindow::MainWindow() { setObjectName ("MainWindow"); setWindowTitle ("nmspd"); conversion_screen = new Window; setCentralWidget (conversion_screen); portal_address = new Glyphs; glyph_selector = new PortalDialer; QVBoxLayout *layout = new QVBoxLayout; layout -> setMargin (5); conversion_screen -> setLayout (layout); createActions(); createMenus(); createToolBar(); } //------------------------------------------------------------------ ////////////////// // PUBLIC SLOTS // ////////////////// //------------------------------------------------------------------ void MainWindow::show_portal() { if ( glyph_selector -> isVisible() == true ) glyph_selector -> hide(); else glyph_selector -> show(); } //------------------------------------------------------------------ void MainWindow::show_glyphs() { if ( portal_address -> isVisible() == true ) portal_address -> hide(); else portal_address -> show(); } //------------------------------------------------------------------ void MainWindow::update_glyphs_from_input_window() { conversion_screen -> set_glyph_code_preset (glyph_selector -> get_code()); conversion_screen -> GUI_convert_from_glyph_sequence(); } //------------------------------------------------------------------ void MainWindow::clear_values() { conversion_screen -> clear_values(); portal_address -> clear_values(); glyph_selector -> clear_values(); } //------------------------------------------------------------------ void MainWindow::conversion() { portal_address -> set_glyphs (conversion_screen -> get_glyph_code()); } //------------------------------------------------------------------ //------------------------------------------------------------------ /////////////////////// // PRIVATE FUNCTIONS // /////////////////////// void MainWindow::createToolBar() { // TODO: Find (or create) some icons to use for these toolbar // actions. As it stands, these are text-only toolbar buttons QToolBar *mainToolBar; mainToolBar = addToolBar (tr ("Control")); mainToolBar -> setAllowedAreas (Qt::AllToolBarAreas); |
︙ | ︙ | |||
89 90 91 92 93 94 95 | } //------------------------------------------------------------------ void MainWindow::createActions() { exit_action = new QAction (QIcon::fromTheme ("application-exit"), tr ("E&xit")); exit_action -> setShortcuts (QKeySequence::Quit); exit_action -> setStatusTip (tr ("Exit the application")); | | < < < < | < < < < < < < < < < < < < < < < < < < < < < < | | < | | | < < < < < < < < < < < < < < < < < < < < < < < < > > > < < < < < < < < < < < < < < < < < < < < | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | } //------------------------------------------------------------------ void MainWindow::createActions() { exit_action = new QAction (QIcon::fromTheme ("application-exit"), tr ("E&xit")); exit_action -> setShortcuts (QKeySequence::Quit); exit_action -> setStatusTip (tr ("Exit the application")); //connect (exit_action, &QAction::triggered, this, &QWidget::close); QObject::connect (exit_action, &QAction::triggered, this, &QApplication::quit); about_action = new QAction (tr ("&About")); about_action -> setStatusTip (tr ("Show the application's About box")); QObject::connect (about_action, &QAction::triggered, this, &MainWindow::about); about_qt_action = new QAction (tr ("About &Qt")); about_qt_action -> setStatusTip (tr ("Show the Qt library's About box")); QObject::connect (about_qt_action, &QAction::triggered, qApp, &QApplication::aboutQt); QObject::connect (glyph_selector, &PortalDialer::code_ready, this, &MainWindow::update_glyphs_from_input_window); QObject::connect (conversion_screen, &Window::valid_coordinate, this, &MainWindow::conversion); QObject::connect (conversion_screen, &Window::valid_glyph_code, this, &MainWindow::conversion); } //------------------------------------------------------------------ void MainWindow::createMenus() { fileMenu = menuBar() -> addMenu (tr ("&File")); //fileMenu -> addSeparator (); fileMenu -> addAction (exit_action); helpMenu = menuBar() -> addMenu (tr ("&Help")); helpMenu -> addAction (about_action); helpMenu -> addAction (about_qt_action); } //------------------------------------------------------------------ /////////////////// // PRIVATE SLOTS // /////////////////// //------------------------------------------------------------------ void MainWindow::about() { QMessageBox::about (this, tr ("About nmspd"), tr ("<center><h2>nmspd</h2>v0.5.2<br><br><br>" "Created by: " "tion<br>Contact: " "tion7680@protonmail.com</center>" "<hr />" "<p>" |
︙ | ︙ | |||
217 218 219 220 221 222 223 | "WITHOUT ANY WARRANTY; without even implied warranty of MERCHANTABILITY " "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License " "for more details.</p><p>" "You should have received a copy of the GNU General Public License along " "with this program. If not, see <" "<a href=\"http://www.gnu.org/licenses/\" target=\"_blank\">" "http//www.gnu.org/licenses/</a>>.</p>")); | | < < < < < | 156 157 158 159 160 161 162 163 164 165 | "WITHOUT ANY WARRANTY; without even implied warranty of MERCHANTABILITY " "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License " "for more details.</p><p>" "You should have received a copy of the GNU General Public License along " "with this program. If not, see <" "<a href=\"http://www.gnu.org/licenses/\" target=\"_blank\">" "http//www.gnu.org/licenses/</a>>.</p>")); } //------------------------------------------------------------------ //================================================================== |
Changes to src/MainWindow.h.
1 2 3 4 5 6 7 8 9 10 11 | //================================================================== #ifndef __NMS_CONVERT_MAIN_WINDOW_H__ #define __NMS_CONVERT_MAIN_WINDOW_H__ //================================================================== #include <QMainWindow> #include <QAction> #include <QMenu> #include "nmsDecoderMainWindow.h" #include "PortalAddressWindow.h" #include "PortalAddressPickerWindow.h" //================================================================== | | < | | | | | | < < < < < < < < < | < | | | < < < | < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | //================================================================== #ifndef __NMS_CONVERT_MAIN_WINDOW_H__ #define __NMS_CONVERT_MAIN_WINDOW_H__ //================================================================== #include <QMainWindow> #include <QAction> #include <QMenu> #include "nmsDecoderMainWindow.h" #include "PortalAddressWindow.h" #include "PortalAddressPickerWindow.h" //================================================================== //class ToolBar; //QT_FORWARD_DECLARE_CLASS (QMenu) class MainWindow : public QMainWindow { Q_OBJECT public: ///////////////// // CONSTRUCTOR // ///////////////// MainWindow(); signals: public slots: //void action_triggered (QAction *); // Show input portal address window void show_portal(); // Show resulting portal address window void show_glyphs(); void update_glyphs_from_input_window(); void conversion(); void clear_values(); private: void createMenus(); void createActions(); void createToolBar(); // MenuBar items QMenu *fileMenu; QMenu *editMenu; QMenu *helpMenu; // Actions for MenuBar items QAction *exit_action; QAction *about_action; QAction *about_qt_action; Window *conversion_screen; Glyphs *portal_address; PortalDialer *glyph_selector; private slots: // Respond to user activating any of the menu entries. void about(); }; //================================================================== #endif // __NMS_CONVERT_MAIN_WINDOW_H__ //================================================================== |
Changes to src/nmsDecoderMain.cpp.
︙ | ︙ | |||
8 9 10 11 12 13 14 | //================================================================== void to_glyphs (const QString code, const bool valid, QTextStream &outs, const bool verbosity) { Console *window = new Console(code, valid); window -> convert_to_glyph_sequence(); | | | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | //================================================================== void to_glyphs (const QString code, const bool valid, QTextStream &outs, const bool verbosity) { Console *window = new Console(code, valid); window -> convert_to_glyph_sequence(); if ( window -> get_glyph_sequence() != QString() ) outs << window -> get_glyph_sequence() << "\n"; else { if ( verbosity == true ) outs << "invalid code: " << window -> show_info() << "\n"; } } //------------------------------------------------------------------ void to_coords (const QString code, const bool valid, QTextStream &outs, const bool verbosity) { Console *guess = new Console (code, valid); guess -> convert_from_glyph_sequence(); if ( guess -> get_coordinate() != QString() ) outs << guess -> get_coordinate() << ", portal #" << guess -> get_portal() << "\n"; else { if ( verbosity == true ) outs << "invalid code: " << guess -> show_info() << "\n"; } } //------------------------------------------------------------------ inline void setApplicationSettings() { QCoreApplication::setOrganizationName ("tion"); QCoreApplication::setApplicationName ("nmspd"); |
︙ | ︙ | |||
52 53 54 55 56 57 58 | */ if ( argc > 1 && argv[1] != QString("-style") ) { // Use console/non-gui QCoreApplication app (argc, argv); setApplicationSettings(); QCommandLineParser parser; | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | */ if ( argc > 1 && argv[1] != QString("-style") ) { // Use console/non-gui QCoreApplication app (argc, argv); setApplicationSettings(); QCommandLineParser parser; parser.setApplicationDescription ("Converts coordinates to a portal glyph address, and vice versa. The GUI can be used instead when no options or arguments are specified."); parser.addHelpOption(); parser.addVersionOption(); parser.addPositionalArgument ("code", QCoreApplication::translate ("main", "Coordinate or glyph code sequence to convert.")); // Boolean option with multiple names (-V, --verbose) |
︙ | ︙ |
Changes to src/nmsDecoderUtility.cpp.
︙ | ︙ | |||
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | { result = false; errors.append (pad_with_zeros(coord, 4)); } } } else result = false; return (result); } //------------------------------------------------------------------ bool is_valid_glyph_code (const QString &_code, QStringList &error) { bool result = true; | > > > | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | { result = false; errors.append (pad_with_zeros(coord, 4)); } } } else { result = false; errors.append (__code); } return (result); } //------------------------------------------------------------------ bool is_valid_glyph_code (const QString &_code, QStringList &error) { bool result = true; |
︙ | ︙ |