Check-in [9d7ea4c467]

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: 9d7ea4c4678df3473f0b51838a0e5b4d8303d6a1
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
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to release_notes.

1
2
3
4
5
6
7

8
9
10
11
12
13
14
# Release Notes #

## 0.5.2 ##
  - Improvements to UI
    - Added toolbar to for toggling glyph/portal address windows
    - Added menu bar to replace other_buttons_group: Exit, About, 
      glyph toggle, portal toggle.


## [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.
  




|
|

>







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
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
//==================================================================
// Refer to: /usr/share/qt5/qtwidets/qtwidgets-mainwindows-menus-mainwindow-cpp.html
// 			/usr/share/doc/qt5/qtwidgets/qtwidgets-mainwindows-mainwindow-example.html#
//==================================================================
#include <QtWidgets>

#include "MainWindow.h"
#include "nmsDecoderMainWindow.h"
#include "PortalAddressPickerWindow.h"
//==================================================================
///////////////////////
// CLASS: MainWindow //
///////////////////////
//==================================================================
MainWindow::MainWindow()
{
   setObjectName ("MainWindow");
   setWindowTitle ("nmspd");
   
   // QMainWindow MUST have a central widget -- this can be any 
   // standard Qt widget.
   centralWidget = new Window;
   setCentralWidget (centralWidget);

   glyph_window = new Glyphs;
   dialer = new PortalDialer;
   //QDockWidget *portal_address = new QDockWidget(this);
   //portal_address -> setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
  
   infoLabel = new QLabel (tr ("<i>Choose a menu option, or right-click to "
   								"invoke a context menu</i>"));
   infoLabel -> setFrameStyle (QFrame::StyledPanel | QFrame::Sunken);
   infoLabel -> setAlignment (Qt::AlignCenter);

   QVBoxLayout *layout = new QVBoxLayout;
   layout -> setMargin (5);
   //layout -> addWidget (portal_address);
   layout -> addWidget (infoLabel);
   //layout -> addWidget (bottomFiller);
   centralWidget -> setLayout (layout);

   createActions();
   createMenus();
   createToolBar();











   statusBar() -> showMessage (tr ("Awaiting input"));
}
//------------------------------------------------------------------
void MainWindow::action_triggered (QAction *action)
{
   qDebug("action '%s' triggered", action -> text().toLocal8Bit().data());




}
//------------------------------------------------------------------
#ifndef QT_NO_CONTEXTMENU






void MainWindow::contextMenuEvent (QContextMenuEvent *event)
{
   QMenu menu (this);

   menu.addAction (cut_action);
   menu.addAction (copy_action);
   menu.addAction (paste_action);
   menu.exec (event -> globalPos());
}
#endif	// QT_NO_CONTEXTMENU
//------------------------------------------------------------------









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);

<
<
<

>

<
<

|
|
|






<
<
|
|

|
|
<
<
|
<
<
<
<
<


<
<
<
|




|
>
>
>
>
>
>
>
>
>
>
|


|

<
>
>
>
>


<
>
>
>
>
>
>
|

<
>
|
<
<
|

<

>
>
>
>
>
>
>
>
>







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
96
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174



175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
}
//------------------------------------------------------------------
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);

   undo_action = new QAction (tr ("&Undo"));
   undo_action -> setShortcuts (QKeySequence::Undo);
   undo_action -> setStatusTip (tr ("Undo the last operation"));
   connect (undo_action, &QAction::triggered, this, &MainWindow::undo);

   redo_action = new QAction (tr ("&Redo"));
   redo_action -> setShortcuts (QKeySequence::Redo);
   redo_action -> setStatusTip (tr ("Redo the last operation"));
   connect (redo_action, &QAction::triggered, this, &MainWindow::redo);

   cut_action = new QAction (tr ("Cu&t"));
   cut_action -> setShortcuts (QKeySequence::Cut);
   cut_action -> setStatusTip (tr ("Cut the current selection's contents to the "
                              "clipboard"));
   connect (cut_action, &QAction::triggered, this, &MainWindow::cut);

   copy_action = new QAction (tr ("&Copy"));
   copy_action -> setShortcuts (QKeySequence::Copy);
   copy_action -> setStatusTip (tr ("Copy the current selection's contents to the "
                               "clipboard"));
   connect (copy_action, &QAction::triggered, this, &MainWindow::copy);

   paste_action = new QAction (tr ("&Paste"));
   paste_action -> setShortcuts (QKeySequence::Paste);
   paste_action -> setStatusTip (tr ("Paste the clipboard's contents into the current "
                                "selection"));
   connect (paste_action, &QAction::triggered, this, &MainWindow::paste);

   about_action = new QAction (tr ("&About"));
   about_action -> setStatusTip (tr ("Show the application's About box"));
   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"));
   connect (about_qt_action, &QAction::triggered, qApp, &QApplication::aboutQt);
   connect (about_qt_action, &QAction::triggered, this, &MainWindow::aboutQt);
   
   connect (dialer, &PortalDialer::code_ready, this, &MainWindow::update_glyphs_from_input_window);
   connect (centralWidget, &Window::valid_coordinate, this, &MainWindow::conversion);
   connect (centralWidget, &Window::valid_glyph_code, this, &MainWindow::conversion);
}
//------------------------------------------------------------------
void MainWindow::conversion()
{
   glyph_window -> set_glyphs (centralWidget -> get_glyph_code());
}
//------------------------------------------------------------------
//------------------------------------------------------------------
void MainWindow::createMenus()
{
   fileMenu = menuBar() -> addMenu (tr ("&File"));
   //fileMenu -> addSeparator ();
   fileMenu -> addAction (exit_action);

   editMenu = menuBar() -> addMenu (tr ("&Edit"));
   editMenu -> addAction (undo_action);
   editMenu -> addAction (redo_action);
   editMenu -> addSeparator ();
   editMenu -> addAction (cut_action);
   editMenu -> addAction (copy_action);
   editMenu -> addAction (paste_action);
   //editMenu -> addSeparator ();

   helpMenu = menuBar() -> addMenu (tr ("&Help"));
   helpMenu -> addAction (about_action);
   helpMenu -> addAction (about_qt_action);
}
//==================================================================
void MainWindow::undo()
{
   infoLabel -> setText (tr ("Invoked <b>Edit|Undo</b>"));
}
//------------------------------------------------------------------
void MainWindow::redo()
{
   infoLabel -> setText (tr ("Invoked <b>Edit|Redo</b>"));
}



//------------------------------------------------------------------
void MainWindow::cut()
{
   infoLabel -> setText (tr ("Invoked <b>Edit|Cut</b>"));
}
//------------------------------------------------------------------
void MainWindow::copy()
{
   infoLabel -> setText (tr ("Invoked <b>Edit|Copy</b>"));
}
//------------------------------------------------------------------
void MainWindow::paste()
{
   infoLabel -> setText (tr ("Invoked <b>Edit|Paste</b>"));
}
//------------------------------------------------------------------
void MainWindow::about()
{
   //infoLabel -> setText (tr ("Invoked <b>Help|About</b>"));
   //QMessageBox::about (this, tr ("About Menu"),
   //              tr("The <b>Menu</b> example shows how to create "
   //              "menu-bar menus and context menus."));
	// Set up and display QMessageBox::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>"







|
<
<
<
<
|

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


|



|
<

|
|
|

<
<
<
<
<
<







<
<
<
<
<
<
<
<
<




<
<
<
<
<

<
<
<
<
>
>
>

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<


<
<
<
<
<







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
224
225
226
227
228
229
230
231
					"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 &lt;"
					"<a href=\"http://www.gnu.org/licenses/\" target=\"_blank\">"
					"http//www.gnu.org/licenses/</a>&gt;.</p>"));

}
//------------------------------------------------------------------
void MainWindow::aboutQt()
{
   infoLabel -> setText (tr ("Invoked <b>Help|About Qt</b>"));
}
//==================================================================







|
<

<
<
<
<

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 &lt;"
					"<a href=\"http://www.gnu.org/licenses/\" target=\"_blank\">"
					"http//www.gnu.org/licenses/</a>&gt;.</p>"));
}

//------------------------------------------------------------------




//==================================================================

Changes to src/MainWindow.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//==================================================================
#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;
class QLabel;
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() { if ( dialer -> isVisible() ) dialer -> hide(); else dialer -> show(); }

      // Show resulting portal address window
      void show_glyphs() { if ( glyph_window -> isVisible() ) glyph_window -> hide(); else glyph_window -> show(); }

	  void update_glyphs_from_input_window() { centralWidget -> set_glyph_code_preset (dialer -> get_code()); centralWidget -> GUI_convert_from_glyph_sequence(); }
	  void conversion();
	  void clear_values() { centralWidget -> clear_values(); glyph_window -> clear_values(); dialer -> clear_values(); }

   private:
      void createMenus();
      void createActions();
	  void createToolBar();

      // MenuBar items
      QMenu *fileMenu;
      QMenu *editMenu;
      QMenu *helpMenu;

      // Actions for MenuBar items
      QAction *new_action;
      QAction *open_action;
      QAction *save_action;
      QAction *print_action;
      QAction *exit_action;
      QAction *undo_action;
      QAction *redo_action;
      QAction *cut_action;
      QAction *copy_action;
      QAction *paste_action;
      QAction *about_action;
      QAction *about_qt_action;

      QLabel *infoLabel;
      Window *centralWidget;
   Glyphs *glyph_window;
   PortalDialer *dialer;
      // A dock widget is a window that can be docked into the main window. 
      // You add dock widgets to a main window with addDockWidget()
      //QDockWidget *dockWidget;

   private slots:
      // Collection of slots to respond to user activating any of the 
      // menu entries.
      void undo();
      void redo();
      void cut();
      void copy();
      void paste();
      void about();
      void aboutQt();

   protected:
   // To implement a custom context menu reimplementing this function is 
   // necessary to receive the context menu events for our main window.
   #ifndef QT_NO_CONTEXTMENU
      void contextMenuEvent (QContextMenuEvent *event) override;
   #endif	// QT_NO_CONTEXTMENU
};
//==================================================================
#endif	// __NMS_CONVERT_MAIN_WINDOW_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
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().isEmpty() == false )
      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();
   else
   {
      if ( verbosity == true )
         outs << "invalid code: " << guess -> show_info();
   }
}
//------------------------------------------------------------------
inline void setApplicationSettings()
{
   QCoreApplication::setOrganizationName ("tion");
   QCoreApplication::setApplicationName ("nmspd");







|
















|



|







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
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 ("\nConverts coordinates to a portal glyph address, and vice versa.\n\nThe 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)







|







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;