Check-in [1cd32bfbd4]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Improved UI.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 1cd32bfbd4596d6e3775f03cc8a8681da2d93f2d
User & Date: tion 2018-10-13 05:29:27
References
2019-02-16
03:19 Wiki page release_notes artifact: cf2f198ba2 user: tion
Context
2018-10-13
05:59
Some code clean-up. check-in: d203627723 user: tion tags: trunk
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
Changes

Changes to nmspd.pro.

1
2
3
4
5
6
7


8
9
10
11
12
13

14
15

16
17
18
19
20
21
TEMPLATE = app
TARGET = nmspd
QT = core gui
QT += widgets
DEFINES += QT_DEPRECATED_WARNINGS

# Inputs


HEADERS += src/nmsDecoder.h src/nmsDecoderMainWindow.h \
			src/nmsDecoderUtility.h \
			src/PortalAddressWindow.h \
			src/PortalAddressPickerWindow.h

SOURCES += src/nmsDecoderMain.cpp src/nmsDecoder.cpp \

			src/nmsDecoderUtility.cpp \
			src/nmsDecoderMainWindow.cpp \

		  	src/PortalAddressWindow.cpp \
		  	src/PortalAddressPickerWindow.cpp

RESOURCES += src/nmsDecoderResources.qrc

VERSION=0.5.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
TEMPLATE = app
TARGET = nmspd
QT = core gui
QT += widgets
DEFINES += QT_DEPRECATED_WARNINGS

# Inputs
HEADERS += src/MainWindow.h \
			src/nmsDecoder.h \
			src/nmsDecoderMainWindow.h \
			src/nmsDecoderUtility.h \
			src/PortalAddressWindow.h \
			src/PortalAddressPickerWindow.h

SOURCES += src/nmsDecoderMain.cpp \
			src/MainWindow.cpp \
			src/nmsDecoder.cpp \
			src/nmsDecoderMainWindow.cpp \
			src/nmsDecoderUtility.cpp \
		  	src/PortalAddressWindow.cpp \
		  	src/PortalAddressPickerWindow.cpp \

RESOURCES += src/nmsDecoderResources.qrc

VERSION=0.5.3

Changes to release_notes.

1
2
3





4
5
6
7
8
9
10
# 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) ##


|
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Release Notes #

## [0.5.3]() ##
  - Improvements to UI
    - Glyph input and portal address are now a part of the main window. 
      They can be moved and/or minimized.

## [0.5.2](/info/9d7ea4c4678df347) ##
  - 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) ##

Changes to src/MainWindow.cpp.

13
14
15
16
17
18
19





20







21
22
23
24
25
26
27
28
29
30
..
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
...
108
109
110
111
112
113
114


115
116
117


118
119
120
121
122
123
124
...
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
   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();
}
//------------------------------------------------------------------
//////////////////
................................................................................
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 
................................................................................
   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);
................................................................................
///////////////////
// 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>"
					"The glyph symbols used in this program are slightly modified "
					"from images on "







>
>
>
>
>

>
>
>
>
>
>
>
|
|
|







 







>
>
>
>
>
>
>



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







|

<
<
<
<
<
<







 







>
>
|
|
|
>
>







 







|







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
..
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
93
94
95
96
97
98
...
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
   setWindowTitle ("nmspd");
   
   conversion_screen = new Window;
   setCentralWidget (conversion_screen);

   portal_address = new Glyphs;
   glyph_selector = new PortalDialer;
   QDockWidget *topWidget = new QDockWidget(tr ("Portal Address"), this);
   topWidget -> setAllowedAreas (Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
   topWidget -> setFeatures (QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
   topWidget -> setWidget (portal_address);
   addDockWidget (Qt::TopDockWidgetArea, topWidget);


   QDockWidget *bottomWidget = new QDockWidget (tr ("Glyph Entry"), this);
   bottomWidget -> setAllowedAreas (Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea);
   bottomWidget -> setFeatures (QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable);
   bottomWidget -> setWidget (glyph_selector);
   addDockWidget (Qt::BottomDockWidgetArea, bottomWidget);

   //QVBoxLayout *layout = new QVBoxLayout;
   //layout -> setMargin (5);
   //setLayout (layout);

   createActions();
   createMenus();
   createToolBar();
}
//------------------------------------------------------------------
//////////////////
................................................................................
void MainWindow::show_glyphs()
{
   if ( portal_address -> isVisible() == true )
      portal_address -> hide();
   else
      portal_address -> show(); 
}
//------------------------------------------------------------------
void MainWindow::update_glyphs_to_input_window()
{
   //qDebug() << "Glyph entry was:" << glyph_selector -> get_code();
   glyph_selector -> set_glyphs (conversion_screen -> get_glyph_code());
   //qDebug() << "Setting glyph entry to:" << glyph_selector -> get_code();
}
//------------------------------------------------------------------
void MainWindow::update_glyphs_from_input_window()
{
   //if ( glyph_selector -> get_code().isEmpty() == false )
      conversion_screen -> set_glyph_code_preset (glyph_selector -> get_code());
}
//------------------------------------------------------------------
void MainWindow::update_portal_address_from_main_window()
{
   portal_address -> set_glyphs (conversion_screen -> get_glyph_code());
}
//------------------------------------------------------------------
void MainWindow::conversion()
{
   update_glyphs_from_input_window();
   conversion_screen -> GUI_convert_from_glyph_sequence();
}
//------------------------------------------------------------------
void MainWindow::clear_values()
{
   conversion_screen -> clear_values();
   portal_address -> clear_values();
   glyph_selector -> clear_values();
}






//------------------------------------------------------------------
///////////////////////
// PRIVATE FUNCTIONS //
///////////////////////
void MainWindow::createToolBar()
{
   // TODO: Find (or create) some icons to use for these toolbar 
................................................................................
   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);
   
   // TODO: Update glyph code from conversion_screen to glyph_selector because right now it syncs one 
   // way: glyph_selector -> conversion_screen.
   QObject::connect (glyph_selector, &PortalDialer::code_change, this, &MainWindow::update_glyphs_from_input_window);
   QObject::connect (conversion_screen, &Window::valid_coordinate, this, &MainWindow::update_portal_address_from_main_window);
   QObject::connect (conversion_screen, &Window::valid_glyph_code, this, &MainWindow::update_portal_address_from_main_window);
   QObject::connect (glyph_selector, &PortalDialer::code_ready, this, &MainWindow::conversion);
   QObject::connect (conversion_screen, &Window::glyph_change, this, &MainWindow::update_glyphs_to_input_window);
}
//------------------------------------------------------------------
void MainWindow::createMenus()
{
   fileMenu = menuBar() -> addMenu (tr ("&File"));
   //fileMenu -> addSeparator ();
   fileMenu -> addAction (exit_action);
................................................................................
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void MainWindow::about()
{
	QMessageBox::about (this, tr ("About nmspd"),
					tr ("<center><h2>nmspd</h2>v0.5.3<br><br><br>" 
					"Created by: "
					"tion<br>Contact: " 
					"tion7680@protonmail.com</center>"
					"<hr />"
					"<p>"
					"The glyph symbols used in this program are slightly modified "
					"from images on "

Changes to src/MainWindow.h.

28
29
30
31
32
33
34

35

36
37
38
39
40
41
42
      //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();







>

>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
      //void action_triggered (QAction *);
      // Show input portal address window
      void show_portal();

      // Show resulting portal address window
      void show_glyphs();

      void update_glyphs_to_input_window();
	  void update_glyphs_from_input_window();
	  void update_portal_address_from_main_window();
	  void conversion();
	  void clear_values();

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

Changes to src/PortalAddressPickerWindow.cpp.

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
..
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
205
206
207
208
209
210
211
212
213
214
215
216
217
218
   {
      glyph_input[i] = new QPushButton;
      glyph_input[i] -> setIconSize (QSize(40, 40));
      glyph_input[i] -> setAutoFillBackground (false);
      glyph_input[i] -> setCheckable (false);
      glyph_input[i] -> setFlat (false);
      glyph_input[i] -> setIcon (QIcon (QString (":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg"))));
      
      if ( i < 12 ) {
         glyph_select[i] = new QPushButton;
         glyph_select[i] -> setFlat (false);
         glyph_select[i] -> setCheckable (false);
         glyph_select[i] -> setAutoFillBackground (true);
         glyph_select[i] -> setIconSize (QSize(60, 60));
         glyph_select[i] -> setIcon (QIcon (QString (":empty.png")));
      }

   }
}
//------------------------------------------------------------------
void PortalDialer::set_glyphs (const QString &_code)
{

   QString fileName = QString();






   for (int i = 0; i < 12; i++)
   {
      if ( _code.isEmpty() == true ) {
         fileName = ":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg");
      }
      else {


         code -> push(_code.at(i).toUpper());


         fileName = ":" + QString(_code.at(i)).toUpper() + ".jpg";
      }

      glyph_select[i] -> setIcon (QIcon (QString (fileName)));









   }
}
//------------------------------------------------------------------
QString PortalDialer::get_code()
{
   QString result = QString();
   for (int i = 0; i < code -> size(); i++) {
................................................................................
   if ( code -> size() < 12 ) {
   int i = (code -> size());
   QChar result = convert_integer_to_hex(index).at(0);
   if ( i < 0 )
      i = 0;

   if ( i < 12  ) {
      glyph_select[i] -> setIcon (QIcon (QString (":" + QString(result) + ".jpg")));
      code -> push(result);
      glyph_code -> setText (get_code());
      emit code_incomplete();
      //qDebug() << "Code:" << get_code();
   }
   }

   // Update status of code after (any) change
   if ( code -> size() == 12 )
      emit code_ready();
   else
      emit code_incomplete();


}
//------------------------------------------------------------------
void PortalDialer::clear_values()
{

   code -> clear();
   glyph_code -> clear();
   //qDebug() << "Cleared QStack";
   
   for (int i = 0; i < 12; i++)
   {
      glyph_select[i] -> setIcon (QIcon (QString (":empty.png")));
   }
   emit code_incomplete();
   //qDebug() << "Cleared QPushButtons";
}
//------------------------------------------------------------------
void PortalDialer::clear_one()
{
   if ( code -> isEmpty() == false )
   {
      code -> pop();
   
      glyph_select[code -> size()] -> setIcon (QIcon (QString (":empty.png")));
      glyph_code -> setText (get_code());
      //qDebug() << "Code:" << get_code();
   }
   emit code_incomplete();
}
//------------------------------------------------------------------
void PortalDialer::run_gui()
{
   /*
      Create horizontal layout.

      row_one:
       +--------+---------+-----+--------+
       | Glyph1 |  Glyph2 | ... | Glyph6 |
       +--------+---------+-----+--------+

      row_two:
       +--------+--------+-----+---------+
       | Glyph7 | Glyph8 | ... | Glyph12 |
       +--------+--------+-----+---------+
   */
/*
   QGroupBox *row_one = new QGroupBox;
   QGroupBox *row_two = new QGroupBox;
   QHBoxLayout *row_one_layout = new QHBoxLayout;
   for (int i = 0; i < 8; i++) {
      row_one_layout -> addWidget (glyph_input[i]);
   }
   row_one -> setLayout (row_one_layout);

   QHBoxLayout *row_two_layout = new QHBoxLayout;
   for (int i = 8; i < 16; i++) {
      row_two_layout -> addWidget (glyph_input[i]);
   }
   row_two -> setLayout (row_two_layout);
*/
   glyph_code = new QLineEdit;
   glyph_code -> setMaxLength (12);
   glyph_code -> setReadOnly (true);

   QPushButton *back_button = new QPushButton;
   back_button -> setText (tr ("Delete"));
   back_button -> setToolTip (tr ("Backspace/Delete one digit to the left"));
   back_button -> setCheckable (false);
   QPushButton *reset_button = new QPushButton;
   reset_button -> setText (tr ("Clear"));
   reset_button -> setToolTip (tr ("Reset all glyphs entered"));
   reset_button -> setCheckable (false);
   QPushButton *close_button = new QPushButton;
   close_button -> setText (tr ("Close"));


   close_button -> setToolTip (tr ("Close this window"));
   close_button -> setCheckable (false);








   QGroupBox *control_group = new QGroupBox;

   QGridLayout *buttons = new QGridLayout;
   buttons -> addWidget (back_button, 0, 0, 1, 1);
   buttons -> addWidget (reset_button, 0, 1, 1, 1);
   //buttons -> addWidget (close_button, 1, 0, 1, 1);
   buttons -> addWidget (glyph_code, 1, 0, 1, 2);
   control_group -> setLayout (buttons);


   QGridLayout *box = new QGridLayout;
   for (int i = 0; i < 12; i++) {

      box -> addWidget (glyph_select[i], 0, (i+1), 1, 1);



   }















   for (int i = 0; i < 8; i++)
      box -> addWidget (glyph_input[i], 1, (i+3), 1, 1);


   for (int i = 8, j = 0; i < 16; i++, j++) {
         box -> addWidget (glyph_input[i], 2, (j+3), 1, 1);
   }
   box -> addWidget (control_group, 1, 0, 2, 2);
   //box -> addWidget (back_button, 1, 0, 1, 1);
   //box -> addWidget (reset_button, 1, 1, 1, 1);
   //box -> addWidget (close_button, 2, 0, 1, 1);
   //box -> addWidget (the_code, 0, 0, 1, 1);

   setLayout (box);

   /*
     Handle pushing the buttons 
   */
   // Delete glyph previously selected
   QObject::connect (back_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_one()));
   QObject::connect (reset_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_values()));

   // If part of a larger program, use hide(). If standalone, 
   // use close() or quit()
   //QObject::connect (close_button, SIGNAL (clicked(bool)),
   //					 this, SLOT (hide()));
   					 
   // Glyph buttons
   QObject::connect (glyph_input[0], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_zero()));
   QObject::connect (glyph_input[1], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_one()));
   QObject::connect (glyph_input[2], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_two()));







|








>





>

>
>
>
>
>
>






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







 







|


|
<






|
|
>
>




>


<
|
|
<
<

|
<








|

|

|




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












<
<
>
>
|
<
|
>
>
>
>
>
>
>

>



<



>
|
<
>
|
>
>
>
|
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
|
|
|
>

|

|
<
<
<
<






|





<
<
<
<
<







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
..
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
205
206
207




208
209
210
211
212
213
214
215
216
217
218
219





220
221
222
223
224
225
226
   {
      glyph_input[i] = new QPushButton;
      glyph_input[i] -> setIconSize (QSize(40, 40));
      glyph_input[i] -> setAutoFillBackground (false);
      glyph_input[i] -> setCheckable (false);
      glyph_input[i] -> setFlat (false);
      glyph_input[i] -> setIcon (QIcon (QString (":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg"))));
/*      
      if ( i < 12 ) {
         glyph_select[i] = new QPushButton;
         glyph_select[i] -> setFlat (false);
         glyph_select[i] -> setCheckable (false);
         glyph_select[i] -> setAutoFillBackground (true);
         glyph_select[i] -> setIconSize (QSize(60, 60));
         glyph_select[i] -> setIcon (QIcon (QString (":empty.png")));
      }
*/
   }
}
//------------------------------------------------------------------
void PortalDialer::set_glyphs (const QString &_code)
{
   if ( _code.size() <= 12 ) {
   QString fileName = QString();
   if ( code -> isEmpty() == false && (_code.toLower() != glyph_code -> text().toLower()) ) {
	  clear_values();
	  QStack<QChar> temp;
	  temp.clear();
	   const QRegularExpression validHex ("[0-9A-F]");
	   QRegularExpressionMatch isValidHex;
   for (int i = 0; i < 12; i++)
   {
      if ( _code.isEmpty() == true ) {
         fileName = ":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg");
      }
      else {
		  isValidHex = validHex.match (_code.at(i).toUpper());
		  if ( isValidHex.hasMatch() == true ) {
         //code -> push(_code.at(i).toUpper());
            temp.push(_code.at(i).toUpper());
		 //emit code_change();
            fileName = ":" + QString(_code.at(i)).toUpper() + ".jpg";
	  }
      }
      //glyph_select[i] -> setIcon (QIcon (QString (fileName)));
   }
   glyph_code -> setText (get_code());
   code -> swap (temp);
   emit code_change();
   if ( glyph_code -> text().size() == 12 )
      emit code_ready();
   }
   else
      emit code_incomplete();
   }
}
//------------------------------------------------------------------
QString PortalDialer::get_code()
{
   QString result = QString();
   for (int i = 0; i < code -> size(); i++) {
................................................................................
   if ( code -> size() < 12 ) {
   int i = (code -> size());
   QChar result = convert_integer_to_hex(index).at(0);
   if ( i < 0 )
      i = 0;

   if ( i < 12  ) {
      //glyph_select[i] -> setIcon (QIcon (QString (":" + QString(result) + ".jpg")));
      code -> push(result);
      glyph_code -> setText (get_code());
	  emit code_change();

   }
   }

   // Update status of code after (any) change
   if ( code -> size() == 12 )
      emit code_ready();
   else {
	  emit code_incomplete();
      emit code_change();
   }
}
//------------------------------------------------------------------
void PortalDialer::clear_values()
{
   if ( code -> isEmpty() == false ) {
   code -> clear();
   glyph_code -> clear();


   emit code_incomplete();


   }
   emit code_change();

}
//------------------------------------------------------------------
void PortalDialer::clear_one()
{
   if ( code -> isEmpty() == false )
   {
      code -> pop();
   
      //glyph_select[code -> size()] -> setIcon (QIcon (QString (":empty.png")));
      glyph_code -> setText (get_code());
	  emit code_incomplete();
   }
   emit code_change();
}
//------------------------------------------------------------------
void PortalDialer::run_gui()
{




























   glyph_code = new QLineEdit;
   glyph_code -> setMaxLength (12);
   glyph_code -> setReadOnly (true);

   QPushButton *back_button = new QPushButton;
   back_button -> setText (tr ("Delete"));
   back_button -> setToolTip (tr ("Backspace/Delete one digit to the left"));
   back_button -> setCheckable (false);
   QPushButton *reset_button = new QPushButton;
   reset_button -> setText (tr ("Clear"));
   reset_button -> setToolTip (tr ("Reset all glyphs entered"));
   reset_button -> setCheckable (false);



   /*
      Create vertical layout.

	  
	  control_group:
	   +--------+
	   | delete |
	   +--------+
	   |  clear |
	   +--------+
   */
   QGroupBox *control_group = new QGroupBox;
   //QVBoxLayout *buttons = new QVBoxLayout;
   QGridLayout *buttons = new QGridLayout;
   buttons -> addWidget (back_button, 0, 0, 1, 1);
   buttons -> addWidget (reset_button, 0, 1, 1, 1);

   buttons -> addWidget (glyph_code, 1, 0, 1, 2);
   control_group -> setLayout (buttons);

   /*
      Create horizontal layout.


      row_one:
       +--------+---------+-----+--------+
       | Glyph1 |  Glyph2 | ... | Glyph6 |
       +--------+---------+-----+--------+

      row_two:
       +--------+--------+-----+---------+
       | Glyph7 | Glyph8 | ... | Glyph12 |
       +--------+--------+-----+---------+
	   
	         essentially:
	   
	   +----------+---------+
	   |  delete  | row_one |
	   +----------+---------+
	   |  clear   | row_two |
	   +----------+---------+
   */

   QGridLayout *box = new QGridLayout;
   for (int i = 0; i < 8; i++) {
      box -> addWidget (glyph_input[i], 0, (i+1), 1, 1);
   }

   for (int i = 8, j = 0; i < 16; i++, j++) {
         box -> addWidget (glyph_input[i], 1, (j+1), 1, 1);
   }
   box -> addWidget (control_group, 0, 0, 2, 1);





   setLayout (box);

   /*
     Handle pushing the buttons 
   */
   // Delete glyph(s) previously selected
   QObject::connect (back_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_one()));
   QObject::connect (reset_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_values()));






   // Glyph buttons
   QObject::connect (glyph_input[0], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_zero()));
   QObject::connect (glyph_input[1], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_one()));
   QObject::connect (glyph_input[2], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_two()));

Changes to src/PortalAddressPickerWindow.h.

16
17
18
19
20
21
22

23
24
25
26
27
28
29
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
       PortalDialer(const QString &);

       void run_gui();
       void set_glyphs(const QString &);
       QString get_code();

   signals:

      void code_incomplete();
      void code_ready();

   public slots:
      void clear_one();
      void clear_values();
      void get_glyph(const int &);
................................................................................
      void glyph_thirteen () { get_glyph(13); }
      void glyph_fourteen () { get_glyph(14); }
      void glyph_fifteen () { get_glyph(15); }      
   private:
      void initialize_glyphs();
       
      QPushButton *glyph_input[16];
      QPushButton *glyph_select[12];
      QStack<QChar> *code;
      QLineEdit *glyph_code;
};
//==================================================================
#endif	// __NMS_PORTAL_DIAL_H__
//==================================================================







>







 







|






16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
44
45
46
47
48
49
50
51
52
53
54
55
56
57
       PortalDialer(const QString &);

       void run_gui();
       void set_glyphs(const QString &);
       QString get_code();

   signals:
      void code_change();
      void code_incomplete();
      void code_ready();

   public slots:
      void clear_one();
      void clear_values();
      void get_glyph(const int &);
................................................................................
      void glyph_thirteen () { get_glyph(13); }
      void glyph_fourteen () { get_glyph(14); }
      void glyph_fifteen () { get_glyph(15); }      
   private:
      void initialize_glyphs();
       
      QPushButton *glyph_input[16];
      //QPushButton *glyph_select[12];
      QStack<QChar> *code;
      QLineEdit *glyph_code;
};
//==================================================================
#endif	// __NMS_PORTAL_DIAL_H__
//==================================================================

Changes to src/PortalAddressWindow.cpp.

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
      Create horizontal layout.

      the_glyphs:
       +--------+--------+-----+---------+
       | glyph1 | glyph2 | ... | glyph12 |
       +--------+--------+-----+---------+
   */
   QGroupBox *the_glyphs = new QGroupBox (tr ("Portal Address"));
   QHBoxLayout *sequence = new QHBoxLayout;

   for (int i = 0; i < 12; i++)
      sequence -> addWidget (glyph[i]);

   the_glyphs -> setLayout (sequence);








|







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
      Create horizontal layout.

      the_glyphs:
       +--------+--------+-----+---------+
       | glyph1 | glyph2 | ... | glyph12 |
       +--------+--------+-----+---------+
   */
   QGroupBox *the_glyphs = new QGroupBox;
   QHBoxLayout *sequence = new QHBoxLayout;

   for (int i = 0; i < 12; i++)
      sequence -> addWidget (glyph[i]);

   the_glyphs -> setLayout (sequence);

Changes to src/nmsDecoderMain.cpp.

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
   }
}
//------------------------------------------------------------------
inline void setApplicationSettings()
{
   QCoreApplication::setOrganizationName ("tion");
   QCoreApplication::setApplicationName ("nmspd");
   QCoreApplication::setApplicationVersion ("0.5.2");
}
//------------------------------------------------------------------
int main (int argc, char *argv[])
{
   /*
     Use console-only if more than one (1) argument is given, or
     if the style option is not supplied (which is for GUI anyway)
................................................................................
      {
         qDebug() << gui_look << "cannot be used. Defaulting to" <<
                  used;
         qDebug() << "Available options for \'-style\':" <<
                  QStyleFactory::keys().join(", ");
      }

      MainWindow window;
      window.show();
      return app.exec ();
   }

   return (0);
}







|







 







|
|





37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
   }
}
//------------------------------------------------------------------
inline void setApplicationSettings()
{
   QCoreApplication::setOrganizationName ("tion");
   QCoreApplication::setApplicationName ("nmspd");
   QCoreApplication::setApplicationVersion ("0.5.3");
}
//------------------------------------------------------------------
int main (int argc, char *argv[])
{
   /*
     Use console-only if more than one (1) argument is given, or
     if the style option is not supplied (which is for GUI anyway)
................................................................................
      {
         qDebug() << gui_look << "cannot be used. Defaulting to" <<
                  used;
         qDebug() << "Available options for \'-style\':" <<
                  QStyleFactory::keys().join(", ");
      }

      MainWindow main_screen;
      main_screen.show();
      return app.exec ();
   }

   return (0);
}

Changes to src/nmsDecoderMainWindow.cpp.

246
247
248
249
250
251
252


253
254
255
256
257
258
259
                     this, SLOT (GUI_convert_to_glyph_sequence()));
   QObject::connect (coordinates_input, SIGNAL (returnPressed()),
   					 this, SLOT (GUI_convert_to_glyph_sequence()));
   QObject::connect (convert_from_glyph_button, SIGNAL (clicked(bool)),
                     this, SLOT (GUI_convert_from_glyph_sequence()));
   QObject::connect (glyph_sequence, SIGNAL (returnPressed()),
   					 this, SLOT (GUI_convert_from_glyph_sequence()));


   QObject::connect (this, SIGNAL (have_errors()),
                     this, SLOT (show_messages()));

   // Presets
   QObject::connect (hub_button, SIGNAL (clicked(bool)),
   					 this, SLOT (preset_hub()));
   QObject::connect (amino_button, SIGNAL (clicked(bool)),







>
>







246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
                     this, SLOT (GUI_convert_to_glyph_sequence()));
   QObject::connect (coordinates_input, SIGNAL (returnPressed()),
   					 this, SLOT (GUI_convert_to_glyph_sequence()));
   QObject::connect (convert_from_glyph_button, SIGNAL (clicked(bool)),
                     this, SLOT (GUI_convert_from_glyph_sequence()));
   QObject::connect (glyph_sequence, SIGNAL (returnPressed()),
   					 this, SLOT (GUI_convert_from_glyph_sequence()));
   QObject::connect (glyph_sequence, SIGNAL (textEdited(QString)),
					 this, SLOT (sync_glyph_code()));
   QObject::connect (this, SIGNAL (have_errors()),
                     this, SLOT (show_messages()));

   // Presets
   QObject::connect (hub_button, SIGNAL (clicked(bool)),
   					 this, SLOT (preset_hub()));
   QObject::connect (amino_button, SIGNAL (clicked(bool)),

Changes to src/nmsDecoderMainWindow.h.

34
35
36
37
38
39
40

41
42
43
44

45
46
47
48
49
50
51
      void set_coordinate_preset(const QString &_code, const int &_portal = 1);
      void set_glyph_code_preset(const QString &);

   signals:
      void have_errors();
	  void valid_glyph_code();
	  void valid_coordinate();


   public slots:
      void GUI_convert_to_glyph_sequence();
      void GUI_convert_from_glyph_sequence();

      //void about();
/*
      // Show input portal address window
      void show_portal(bool);
      void hide_portal() { dialer -> hide(); }
      void update_glyph() { glyph_sequence -> setText (dialer -> get_code()); }








>




>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
      void set_coordinate_preset(const QString &_code, const int &_portal = 1);
      void set_glyph_code_preset(const QString &);

   signals:
      void have_errors();
	  void valid_glyph_code();
	  void valid_coordinate();
	  void glyph_change();

   public slots:
      void GUI_convert_to_glyph_sequence();
      void GUI_convert_from_glyph_sequence();
	  void sync_glyph_code () { emit glyph_change(); }
      //void about();
/*
      // Show input portal address window
      void show_portal(bool);
      void hide_portal() { dialer -> hide(); }
      void update_glyph() { glyph_sequence -> setText (dialer -> get_code()); }