Check-in [612332f50d]

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

Overview
Comment:cleanup: the rest of the tab to spaces
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | improvements-to-main-menu
Files: files | file ages | folders
SHA1:612332f50d2b49a926d9d4203857ef6e9606992a
User & Date: tion 2019-02-16 02:11:51
Context
2019-02-16
02:17
Merge: improvements-to-main-menu check-in: b456644aa7 user: tion
02:11
cleanup: the rest of the tab to spaces Closed-Leaf check-in: 612332f50d user: tion tags: improvements-to-main-menu
01:28
cleanup: tab to spaces check-in: 27ce672990 user: tion tags: improvements-to-main-menu
Changes

Changes to src/CoordinateData.cpp.

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
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
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
...
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
...
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
//------------------------------------------------------------------
////////////////
// DESTRUCTOR //
////////////////
//------------------------------------------------------------------
coordinateData::~coordinateData()
{
	coordinates.clear();
	glyph_code.clear();
	error_info.clear();
	portal = -1;
}
//------------------------------------------------------------------
///////////////////////
// COPY CONSTRUCTORS //
///////////////////////
//------------------------------------------------------------------
coordinateData::coordinateData (const coordinateData &other)
................................................................................
//------------------------------------------------------------------
//////////////////////
// PUBLIC FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
QString coordinateData::getGlyphCode() const
{
	return (glyph_code.toUpper());
}
//------------------------------------------------------------------
QString coordinateData::getCoordinate() const
{
	return (coordinates.toUpper());
}
//------------------------------------------------------------------
QString coordinateData::getCoordinates() const
{
	return (getCoordinate());
}
//------------------------------------------------------------------
QStringList coordinateData::getErrorInfo() const
{
	return (error_info);
}
//------------------------------------------------------------------
QString coordinateData::showErrorInfo() const
{
   QString result = QString();

   if ( error_info.isEmpty() == false )
................................................................................
      result.append( QString("[" + getErrorInfo().join("] [") + "]") );

   return (result);
}
//------------------------------------------------------------------
QString coordinateData::toString() const
{
	QString result = QString();

	if ( (coordinates.isEmpty() == true && glyph_code.isEmpty() == true) 
	  || (coordinates == ":::" && glyph_code.isEmpty() == true) )
	{
		result += "No coordinate data found." + QString ("\n");
	}
	else
	{
		if ( coordinates.isEmpty() == false
		  && coordinates != ":::" )
		{
			result += coordinates;
			result += ", portal #" + QString::number (portal);
			result += QString ("\n");
		}
	
		if ( glyph_code.isEmpty() == false )
			result += glyph_code + QString ("\n");
	}

	return (result);
}
//------------------------------------------------------------------
int coordinateData::getPortal() const
{
	return (portal);
}
//------------------------------------------------------------------
void coordinateData::setCoordinate (const QString &_code)
{
	if ( _code != coordinates )
		coordinates = _code;
}
//------------------------------------------------------------------
void coordinateData::setPortal (const int _number)
{
   if ( is_valid_portal(_number) == true )
      portal = (_number);
   else
      portal = 1;
}
//------------------------------------------------------------------
void coordinateData::setGlyphCode (const QString &_code)
{
	if ( _code != glyph_code )
		glyph_code = _code;
}
//------------------------------------------------------------------
void coordinateData::addToErrorInfo (const QString &error_data)
{
	if ( error_data.size() > 0 && error_data.at (0) != ':' )
		error_info += error_data;
}
//------------------------------------------------------------------
void coordinateData::reset()
{
   clearCoordinates();
   clearGlyphCode();
   clearErrorInfo();
}
//------------------------------------------------------------------
void coordinateData::clearCoordinates()
{
	coordinates.clear();
	portal = 1;
}
//------------------------------------------------------------------
void coordinateData::clearGlyphCode()
{
	glyph_code.clear();
}
//------------------------------------------------------------------
void coordinateData::clearErrorInfo()
{
	error_info.clear();
}
//------------------------------------------------------------------
void coordinateData::convertFromGlyph()
{
   // Verify glyph code is valid hexadecimal and is valid
   // glyph code sequence.
   clearErrorInfo();
................................................................................
//------------------------------------------------------------------
///////////////////////
// PRIVATE FUNCTIONS //
///////////////////////
//------------------------------------------------------------------
void coordinateData::createGlyphs()
{
	glyph_code = QString();
}
//------------------------------------------------------------------
void coordinateData::createCoordinates()
{
	coordinates = QString();
	portal = int(1);
	error_info = QStringList();
}
//------------------------------------------------------------------
//////////////////////
// FRIEND FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
QTextStream &operator >> (QTextStream &readInputInto, coordinateData &target)
................................................................................
   readInputInto >> target.glyph_code;

   return (readInputInto);
}
//------------------------------------------------------------------
QTextStream &operator << (QTextStream &outs, const coordinateData &the_data)
{
	outs << the_data.toString();

   return (outs);
}
//------------------------------------------------------------------
QTextStream &operator << (QTextStream &outs, coordinateData &the_data)
{
	outs << the_data.toString();

   return (outs);
}
//------------------------------------------------------------------
QDebug operator << (QDebug dbg, const coordinateData &the_data)
{
	QDebug outs = dbg.nospace();

	outs << "[DEBUG][coordinateData]";

	if ( (the_data.coordinates.isEmpty() == true
	  && the_data.glyph_code.isEmpty() == true)
	  || (the_data.coordinates == ":::" && the_data.glyph_code.isEmpty() == true) )
	{
		outs << ": No coordinate data found.\n";
	}
	else
	{
   	if ( the_data.coordinates.size() > 0
   	  && the_data.coordinates != ":::" )
   	{
	   	outs << "\nCoordinates: ";
   	   outs.noquote() << the_data.coordinates.toUpper();
      	outs << ", portal #" << the_data.portal;
      }

	   if ( the_data.glyph_code.isEmpty() == false )
	   {
	   	outs << "\nGlyph code: ";
	      outs.noquote() << the_data.glyph_code.toUpper();
	   }

	   if ( the_data.error_info.isEmpty() == false )
	   {
	      outs << "\ninvalid segments: ";
	      outs.noquote() << the_data.showErrorInfo();
	   }
   }

	return (dbg);
}
//------------------------------------------------------------------
QDebug operator << (QDebug dbg, coordinateData &the_data)
{
	QDebug outs = dbg.nospace();

	outs << "[DEBUG][coordinateData]";

	if ( (the_data.coordinates.isEmpty() == true
	  && the_data.glyph_code.isEmpty() == true)
	  || (the_data.coordinates == ":::" && the_data.glyph_code.isEmpty() == true) )
	{
		outs << ": No coordinate data found.\n";
	}
	else
	{
   	if ( the_data.coordinates.size() > 0
   	  && the_data.coordinates != ":::" )
   	{
	   	outs << "\nCoordinates: ";
   	   outs.noquote() << the_data.coordinates.toUpper();
      	outs << ", portal #" << the_data.portal;
      }

	   if ( the_data.glyph_code.isEmpty() == false )
	   {
	   	outs << "\nGlyph code: ";
	      outs.noquote() << the_data.glyph_code.toUpper();
	   }

	   if ( the_data.error_info.isEmpty() == false )
	   {
	      outs << "\ninvalid segments: ";
	      outs.noquote() << the_data.showErrorInfo();
	   }
   }

	return (dbg);
}
//------------------------------------------------------------------
std::ostream &operator << (std::ostream &outs, const coordinateData &the_data)
{
	outs << the_data.toString().toStdString();

   return (outs);
}
//------------------------------------------------------------------
std::ostream &operator << (std::ostream &outs, coordinateData &the_data)
{
	outs << the_data.toString().toStdString();

   return (outs);
}
//------------------------------------------------------------------
//////////////////////////
// COMPARISON OPERATORS //
//////////////////////////
................................................................................
   }

   return (result);
}
//------------------------------------------------------------------
bool operator != (const coordinateData &a, const coordinateData &b)
{
	bool result = false;

	if ( !(a == b) )
		result = true;

   return (result);
}
//------------------------------------------------------------------
bool operator != (coordinateData &a, coordinateData &b)
{
	bool result = false;

	if ( !(a == b) )
		result = true;

   return (result);
}
//------------------------------------------------------------------
bool operator < (const coordinateData &a, const coordinateData &b)
{
   bool result = false;







|
|
|
|







 







|




|




|




|







 







|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|




|




|
|












|
|




|
|











|
|




|




|







 







|




|
|
|







 







|






|






|

|

|
|
|
|
|
|
|
|
|
|
|
|
|
|


|
|
|
|
|

|
|
|
|
|


|




|

|

|
|
|
|
|
|
|
|
|
|
|
|
|
|


|
|
|
|
|

|
|
|
|
|


|




|






|







 







|

|
|






|

|
|







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
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
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
...
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
...
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
//------------------------------------------------------------------
////////////////
// DESTRUCTOR //
////////////////
//------------------------------------------------------------------
coordinateData::~coordinateData()
{
   coordinates.clear();
   glyph_code.clear();
   error_info.clear();
   portal = -1;
}
//------------------------------------------------------------------
///////////////////////
// COPY CONSTRUCTORS //
///////////////////////
//------------------------------------------------------------------
coordinateData::coordinateData (const coordinateData &other)
................................................................................
//------------------------------------------------------------------
//////////////////////
// PUBLIC FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
QString coordinateData::getGlyphCode() const
{
   return (glyph_code.toUpper());
}
//------------------------------------------------------------------
QString coordinateData::getCoordinate() const
{
   return (coordinates.toUpper());
}
//------------------------------------------------------------------
QString coordinateData::getCoordinates() const
{
   return (getCoordinate());
}
//------------------------------------------------------------------
QStringList coordinateData::getErrorInfo() const
{
   return (error_info);
}
//------------------------------------------------------------------
QString coordinateData::showErrorInfo() const
{
   QString result = QString();

   if ( error_info.isEmpty() == false )
................................................................................
      result.append( QString("[" + getErrorInfo().join("] [") + "]") );

   return (result);
}
//------------------------------------------------------------------
QString coordinateData::toString() const
{
   QString result = QString();

   if ( (coordinates.isEmpty() == true && glyph_code.isEmpty() == true) 
     || (coordinates == ":::" && glyph_code.isEmpty() == true) )
   {
      result += "No coordinate data found." + QString ("\n");
   }
   else
   {
      if ( coordinates.isEmpty() == false
        && coordinates != ":::" )
      {
         result += coordinates;
         result += ", portal #" + QString::number (portal);
         result += QString ("\n");
      }

      if ( glyph_code.isEmpty() == false )
         result += glyph_code + QString ("\n");
   }

   return (result);
}
//------------------------------------------------------------------
int coordinateData::getPortal() const
{
   return (portal);
}
//------------------------------------------------------------------
void coordinateData::setCoordinate (const QString &_code)
{
   if ( _code != coordinates )
      coordinates = _code;
}
//------------------------------------------------------------------
void coordinateData::setPortal (const int _number)
{
   if ( is_valid_portal(_number) == true )
      portal = (_number);
   else
      portal = 1;
}
//------------------------------------------------------------------
void coordinateData::setGlyphCode (const QString &_code)
{
   if ( _code != glyph_code )
      glyph_code = _code;
}
//------------------------------------------------------------------
void coordinateData::addToErrorInfo (const QString &error_data)
{
   if ( error_data.size() > 0 && error_data.at (0) != ':' )
      error_info += error_data;
}
//------------------------------------------------------------------
void coordinateData::reset()
{
   clearCoordinates();
   clearGlyphCode();
   clearErrorInfo();
}
//------------------------------------------------------------------
void coordinateData::clearCoordinates()
{
   coordinates.clear();
   portal = 1;
}
//------------------------------------------------------------------
void coordinateData::clearGlyphCode()
{
   glyph_code.clear();
}
//------------------------------------------------------------------
void coordinateData::clearErrorInfo()
{
   error_info.clear();
}
//------------------------------------------------------------------
void coordinateData::convertFromGlyph()
{
   // Verify glyph code is valid hexadecimal and is valid
   // glyph code sequence.
   clearErrorInfo();
................................................................................
//------------------------------------------------------------------
///////////////////////
// PRIVATE FUNCTIONS //
///////////////////////
//------------------------------------------------------------------
void coordinateData::createGlyphs()
{
   glyph_code = QString();
}
//------------------------------------------------------------------
void coordinateData::createCoordinates()
{
   coordinates = QString();
   portal = int(1);
   error_info = QStringList();
}
//------------------------------------------------------------------
//////////////////////
// FRIEND FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
QTextStream &operator >> (QTextStream &readInputInto, coordinateData &target)
................................................................................
   readInputInto >> target.glyph_code;

   return (readInputInto);
}
//------------------------------------------------------------------
QTextStream &operator << (QTextStream &outs, const coordinateData &the_data)
{
   outs << the_data.toString();

   return (outs);
}
//------------------------------------------------------------------
QTextStream &operator << (QTextStream &outs, coordinateData &the_data)
{
   outs << the_data.toString();

   return (outs);
}
//------------------------------------------------------------------
QDebug operator << (QDebug dbg, const coordinateData &the_data)
{
   QDebug outs = dbg.nospace();

   outs << "[DEBUG][coordinateData]";

   if ( (the_data.coordinates.isEmpty() == true
     && the_data.glyph_code.isEmpty() == true)
     || (the_data.coordinates == ":::" && the_data.glyph_code.isEmpty() == true) )
   {
      outs << ": No coordinate data found.\n";
   }
   else
   {
      if ( the_data.coordinates.size() > 0
        && the_data.coordinates != ":::" )
      {
         outs << "\nCoordinates: ";
         outs.noquote() << the_data.coordinates.toUpper();
         outs << ", portal #" << the_data.portal;
      }

      if ( the_data.glyph_code.isEmpty() == false )
      {
         outs << "\nGlyph code: ";
         outs.noquote() << the_data.glyph_code.toUpper();
      }

      if ( the_data.error_info.isEmpty() == false )
      {
         outs << "\ninvalid segments: ";
         outs.noquote() << the_data.showErrorInfo();
      }
   }

   return (dbg);
}
//------------------------------------------------------------------
QDebug operator << (QDebug dbg, coordinateData &the_data)
{
   QDebug outs = dbg.nospace();

   outs << "[DEBUG][coordinateData]";

   if ( (the_data.coordinates.isEmpty() == true
     && the_data.glyph_code.isEmpty() == true)
     || (the_data.coordinates == ":::" && the_data.glyph_code.isEmpty() == true) )
   {
      outs << ": No coordinate data found.\n";
   }
   else
   {
      if ( the_data.coordinates.size() > 0
        && the_data.coordinates != ":::" )
      {
         outs << "\nCoordinates: ";
         outs.noquote() << the_data.coordinates.toUpper();
         outs << ", portal #" << the_data.portal;
      }

      if ( the_data.glyph_code.isEmpty() == false )
      {
         outs << "\nGlyph code: ";
         outs.noquote() << the_data.glyph_code.toUpper();
      }

      if ( the_data.error_info.isEmpty() == false )
      {
         outs << "\ninvalid segments: ";
         outs.noquote() << the_data.showErrorInfo();
      }
   }

   return (dbg);
}
//------------------------------------------------------------------
std::ostream &operator << (std::ostream &outs, const coordinateData &the_data)
{
   outs << the_data.toString().toStdString();

   return (outs);
}
//------------------------------------------------------------------
std::ostream &operator << (std::ostream &outs, coordinateData &the_data)
{
   outs << the_data.toString().toStdString();

   return (outs);
}
//------------------------------------------------------------------
//////////////////////////
// COMPARISON OPERATORS //
//////////////////////////
................................................................................
   }

   return (result);
}
//------------------------------------------------------------------
bool operator != (const coordinateData &a, const coordinateData &b)
{
   bool result = false;

   if ( !(a == b) )
      result = true;

   return (result);
}
//------------------------------------------------------------------
bool operator != (coordinateData &a, coordinateData &b)
{
   bool result = false;

   if ( !(a == b) )
      result = true;

   return (result);
}
//------------------------------------------------------------------
bool operator < (const coordinateData &a, const coordinateData &b)
{
   bool result = false;

Changes to src/CoordinateData.h.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
       *  \param[in] isCoordinate Defines the input type.
       *
       *  \warning No error-checking that isCoordinate correctly
       *  corresponds to the type of input _code is.
      */
      explicit coordinateData(const QString &_code, bool isCoordinate = true);

		/** Default destructor **/
		~coordinateData();

      // Copy Constructors
      /** \details Copy constructor for const CoordinateData object.
       * 
       *  \param[in] other An initialized CoordinateData object to
       *  copy data from.
      */
................................................................................
       *  \param[in] the_data The data to read data from.
      */
      friend QTextStream &operator << (QTextStream &outs, coordinateData &the_data);
      /** \overload operator<<(QDebug, const coordinateData &)
       *
       *  Allows output to QDebug stream. For example:
       *
       *			coordinateData b;
       *			b.setCoordinate ("0123:0045:0678:009a");
       *			qDebug() << b;
       *
       *  \param[in,out] dbg The QDebug stream to output data into.
       *  \param[in] the_data The data to read data from.
      */
      friend QDebug operator << (QDebug dbg, const coordinateData &the_data);
      /** \overload operator<<(QDebug, coordinateData &)
       * 







|
|







 







|
|
|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
       *  \param[in] isCoordinate Defines the input type.
       *
       *  \warning No error-checking that isCoordinate correctly
       *  corresponds to the type of input _code is.
      */
      explicit coordinateData(const QString &_code, bool isCoordinate = true);

      /** Default destructor **/
      ~coordinateData();

      // Copy Constructors
      /** \details Copy constructor for const CoordinateData object.
       * 
       *  \param[in] other An initialized CoordinateData object to
       *  copy data from.
      */
................................................................................
       *  \param[in] the_data The data to read data from.
      */
      friend QTextStream &operator << (QTextStream &outs, coordinateData &the_data);
      /** \overload operator<<(QDebug, const coordinateData &)
       *
       *  Allows output to QDebug stream. For example:
       *
       *	      coordinateData b;
       *	      b.setCoordinate ("0123:0045:0678:009a");
       *	      qDebug() << b;
       *
       *  \param[in,out] dbg The QDebug stream to output data into.
       *  \param[in] the_data The data to read data from.
      */
      friend QDebug operator << (QDebug dbg, const coordinateData &the_data);
      /** \overload operator<<(QDebug, coordinateData &)
       * 

Changes to src/CoordinateMain.cpp.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

   if ( window -> getGlyphCode().isEmpty() == false )
      outs << window -> getGlyphCode() << "\n";
   else
   {
      if ( verbosity == true )
      {
      	if ( window -> getErrorInfo().size() > 0 )
	      	outs << window -> showErrorInfo();
	      else
	      {
	      	if ( window -> getCoordinates().isEmpty() == false )
	      		outs << *window;
	      	else
		      	outs << "No coordinates provided.";
	      }
      }
   }
}
//------------------------------------------------------------------
void to_coords (const QString &code, const bool valid,
                QTextStream &outs, const bool verbosity)
{
................................................................................
   {
      if ( verbosity == true )
      {
      	if ( guess -> getErrorInfo().size() > 0 )
      		outs << guess -> showErrorInfo();
      	else
      	{
      		if ( guess -> getGlyphCode().isEmpty() == false )
		      	outs << *guess;
		      else
		      	outs << "No glyph code provided.";
		   }
		}
   }
}
//------------------------------------------------------------------
inline void setApplicationSettings()
{
   QCoreApplication::setOrganizationName ("tion");
   QCoreApplication::setApplicationName ("nmspd");
................................................................................

      // Exit properly rather than waiting for input.
      app.quit();
   }
   else
   {
      QApplication app (argc, argv);
	  	setApplicationSettings();

      qDebug() << "Available options for \'-style\':" <<
                  QStyleFactory::keys().join(", ");

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

   return (0);
}







|
|
|
|
|
|
|
|
|







 







|
|
|
|
|
|







 







|











14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178

   if ( window -> getGlyphCode().isEmpty() == false )
      outs << window -> getGlyphCode() << "\n";
   else
   {
      if ( verbosity == true )
      {
         if ( window -> getErrorInfo().size() > 0 )
            outs << window -> showErrorInfo();
         else
         {
            if ( window -> getCoordinates().isEmpty() == false )
               outs << *window;
            else
               outs << "No coordinates provided.";
         }
      }
   }
}
//------------------------------------------------------------------
void to_coords (const QString &code, const bool valid,
                QTextStream &outs, const bool verbosity)
{
................................................................................
   {
      if ( verbosity == true )
      {
      	if ( guess -> getErrorInfo().size() > 0 )
      		outs << guess -> showErrorInfo();
      	else
      	{
            if ( guess -> getGlyphCode().isEmpty() == false )
               outs << *guess;
            else
               outs << "No glyph code provided.";
         }
      }
   }
}
//------------------------------------------------------------------
inline void setApplicationSettings()
{
   QCoreApplication::setOrganizationName ("tion");
   QCoreApplication::setApplicationName ("nmspd");
................................................................................

      // Exit properly rather than waiting for input.
      app.quit();
   }
   else
   {
      QApplication app (argc, argv);
      setApplicationSettings();

      qDebug() << "Available options for \'-style\':" <<
                  QStyleFactory::keys().join(", ");

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

   return (0);
}

Changes to src/CoordinateMainWindow.cpp.

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
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
#include "CoordinateMainWindow.h"
//==================================================================
///////////////////
// CLASS: Window //
///////////////////
//==================================================================
Window::Window (QWidget *parent)
	: QWidget (parent)
{
   createCoordinates();
   createGlyphs();

   createLayout();
}
//------------------------------------------------------------------
Window::Window (const QString &_code, bool isCoordinate, QWidget *parent)
	: QWidget (parent)
{
   createCoordinates();
   createGlyphs();

   if ( isCoordinate == false )
      glyph_sequence -> setText (_code);
   else
      coordinates_input -> setText (_code);

	createLayout();
}
//------------------------------------------------------------------
QString Window::getGlyphCode()
{
	return (glyph_sequence -> text());
}
//------------------------------------------------------------------
QString Window::getCoordinate()
{
	return (coordinates_input -> text());
}
//------------------------------------------------------------------
QString Window::getCoordinates()
{
	return (getCoordinate());
}
//------------------------------------------------------------------
int Window::getPortal()
{
	return (portal_number -> value());
}
//------------------------------------------------------------------
void Window::createLayout()
{
   // Set minimum size of window
   setMinimumSize(415, 50);
   
................................................................................
void Window::showMessages (QStringList the_errors)
{
   // Set up QMessageBox::warning describing what is wrong with the
   // coordinate/glyph code
   QMessageBox *invalid_messages = new QMessageBox;
   QString text = QString();

	if ( the_errors.isEmpty() == true || QString(the_errors.join("")) == ":::" )
		text += QString (tr ("No code provided."));
	else
   {
	   text += QString(tr ("Problematic section: "));
   	text += QString ("[" + the_errors.join ("] [") + "]");
   	text += "\n\n";
   	text += QString(tr ("Please adjust."));
   }

   invalid_messages -> setText ( QString("<center> " +
                                         tr("INVALID CODE") + " </center") );
................................................................................
{
   clearCoordinates();
   clearGlyphCode();
}
//------------------------------------------------------------------
void Window::clearCoordinates()
{
	coordinates_input -> clear();
	portal_number -> setValue (1);
}
//------------------------------------------------------------------
void Window::clearGlyphCode()
{
	glyph_sequence -> clear();
}
//------------------------------------------------------------------
void Window::GUI_convertFromGlyph()
{
   if ( glyph_sequence -> text().size() == 12 )
   {
   	coordinateData blackbox = coordinateData();

      // Move user input into blackbox for conversion
      blackbox.setGlyphCode (glyph_sequence -> text());

      // Perform conversion: glyph code -> coordinates
      blackbox.convertFromGlyph();

................................................................................
         coordinates_input -> setText (blackbox.getCoordinate());
         glyph_sequence -> setText (blackbox.getGlyphCode());
         portal_number -> setValue (blackbox.getPortal());
         emit validCoordinate();
      }
      else
      {
      	qDebug() << blackbox;
         emit haveErrors (blackbox.getErrorInfo());
      }
   }
}
//------------------------------------------------------------------
void Window::GUI_convertToGlyph()
{
   if ( coordinates_input -> text().isEmpty() == false
     && coordinates_input -> text() != ":::" )
   {
   	coordinateData blackbox = coordinateData();

      // Move user inputs to blackbox for conversion
      blackbox.setPortal (portal_number -> value());
      blackbox.setCoordinate (coordinates_input -> text());

      // Perform conversion: coordinates -> glyph code
      blackbox.convertToGlyph();
................................................................................
         glyph_sequence -> setText (blackbox.getGlyphCode());
         coordinates_input -> setText (blackbox.getCoordinate());
         portal_number -> setValue (blackbox.getPortal());
         emit validGlyphCode();
      }
      else
      {
      	qDebug() << blackbox;
         emit haveErrors (blackbox.getErrorInfo());
      }
   }
}
//------------------------------------------------------------------
void Window::syncGlyphCode()
{
	emit glyphChange();
}
//------------------------------------------------------------------







|








|









|




|




|




|




|







 







|
|
|

|







 







|
|




|






|







 







|










|







 







|







|


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
...
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
...
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
#include "CoordinateMainWindow.h"
//==================================================================
///////////////////
// CLASS: Window //
///////////////////
//==================================================================
Window::Window (QWidget *parent)
   : QWidget (parent)
{
   createCoordinates();
   createGlyphs();

   createLayout();
}
//------------------------------------------------------------------
Window::Window (const QString &_code, bool isCoordinate, QWidget *parent)
   : QWidget (parent)
{
   createCoordinates();
   createGlyphs();

   if ( isCoordinate == false )
      glyph_sequence -> setText (_code);
   else
      coordinates_input -> setText (_code);

   createLayout();
}
//------------------------------------------------------------------
QString Window::getGlyphCode()
{
   return (glyph_sequence -> text());
}
//------------------------------------------------------------------
QString Window::getCoordinate()
{
   return (coordinates_input -> text());
}
//------------------------------------------------------------------
QString Window::getCoordinates()
{
   return (getCoordinate());
}
//------------------------------------------------------------------
int Window::getPortal()
{
   return (portal_number -> value());
}
//------------------------------------------------------------------
void Window::createLayout()
{
   // Set minimum size of window
   setMinimumSize(415, 50);
   
................................................................................
void Window::showMessages (QStringList the_errors)
{
   // Set up QMessageBox::warning describing what is wrong with the
   // coordinate/glyph code
   QMessageBox *invalid_messages = new QMessageBox;
   QString text = QString();

   if ( the_errors.isEmpty() == true || QString(the_errors.join("")) == ":::" )
      text += QString (tr ("No code provided."));
   else
   {
      text += QString(tr ("Problematic section: "));
   	text += QString ("[" + the_errors.join ("] [") + "]");
   	text += "\n\n";
   	text += QString(tr ("Please adjust."));
   }

   invalid_messages -> setText ( QString("<center> " +
                                         tr("INVALID CODE") + " </center") );
................................................................................
{
   clearCoordinates();
   clearGlyphCode();
}
//------------------------------------------------------------------
void Window::clearCoordinates()
{
   coordinates_input -> clear();
   portal_number -> setValue (1);
}
//------------------------------------------------------------------
void Window::clearGlyphCode()
{
   glyph_sequence -> clear();
}
//------------------------------------------------------------------
void Window::GUI_convertFromGlyph()
{
   if ( glyph_sequence -> text().size() == 12 )
   {
      coordinateData blackbox = coordinateData();

      // Move user input into blackbox for conversion
      blackbox.setGlyphCode (glyph_sequence -> text());

      // Perform conversion: glyph code -> coordinates
      blackbox.convertFromGlyph();

................................................................................
         coordinates_input -> setText (blackbox.getCoordinate());
         glyph_sequence -> setText (blackbox.getGlyphCode());
         portal_number -> setValue (blackbox.getPortal());
         emit validCoordinate();
      }
      else
      {
         qDebug() << blackbox;
         emit haveErrors (blackbox.getErrorInfo());
      }
   }
}
//------------------------------------------------------------------
void Window::GUI_convertToGlyph()
{
   if ( coordinates_input -> text().isEmpty() == false
     && coordinates_input -> text() != ":::" )
   {
      coordinateData blackbox = coordinateData();

      // Move user inputs to blackbox for conversion
      blackbox.setPortal (portal_number -> value());
      blackbox.setCoordinate (coordinates_input -> text());

      // Perform conversion: coordinates -> glyph code
      blackbox.convertToGlyph();
................................................................................
         glyph_sequence -> setText (blackbox.getGlyphCode());
         coordinates_input -> setText (blackbox.getCoordinate());
         portal_number -> setValue (blackbox.getPortal());
         emit validGlyphCode();
      }
      else
      {
         qDebug() << blackbox;
         emit haveErrors (blackbox.getErrorInfo());
      }
   }
}
//------------------------------------------------------------------
void Window::syncGlyphCode()
{
   emit glyphChange();
}
//------------------------------------------------------------------

Changes to src/CoordinateMainWindow.h.

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
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
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
...
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
 * 
*/
class Window : public QWidget
{
   // Macro to allow for custom slots and signals
   Q_OBJECT

	public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      /** Default constructor */
      explicit Window(QWidget *parent = 0);
      /** \overload Window(const QString &, bool)
       * 
................................................................................

      ////////////////////////////////
      // ACCESSING MEMBER FUNCTIONS //
      ////////////////////////////////
      /** Initialize GUI objects/elements */
      void createLayout();

		/** \returns The glyph code. */
		QString getGlyphCode();
		/** \returns The coordinates. */
	   QString getCoordinate();
	   /** Convenience function for getCoordinate.
	    * 
	    *  \returns The coordinates.
	    * 
	    *  \see getCoordinate
	   */
	   QString getCoordinates();
	   /** \returns The portal number. */
	   int getPortal();

		/** Sets the coordinate and portal value. Intended for location
		 *  presets and as such has no error-checking of the provided
		 *  inputs.
		 * 
		 *  \param[in] _code A valid coordinate.
		 *  \param[in] _portal A valid portal number.
		*/
      void setCoordinatePreset(const QString &_code, const int _portal = 1);
      /** Sets the glyph code value. Intended for location presets
       *  and as such has no error-checking of the provided _code.
       * 
       *  \param[in] _code A valid glyph code.
      */
      void setGlyphCodePreset(const QString &_code);

   signals:
   	/** This signal is emitted when the coordinate or glyph code
   	 *  is invalid.
   	*/
      void haveErrors (QStringList);
      /** This signal is emitted when the glyph code has been
       *  validated.
      */
	  	void validGlyphCode();
	  	/** This signal is emitted when the coordinate has been
	  	 *  validated.
	  	*/
	  	void validCoordinate();
	  	/** This signal is emitted when there is a change to the 
	  	 *  glyphs.
	  	*/
	  	void glyphChange();

   public slots:
   	/** Calls the method to convert the current coordinates into 
   	 *  a glyph code.
   	 * 
   	 *  \see CoordinateData::convertToGlyph
   	*/
      void GUI_convertToGlyph();
      /** Calls the method to convert the current glyph code into
       *  coordinates.
       * 
       *  \see CoordinateData::convertFromGlyph
      */
      void GUI_convertFromGlyph();
      /** Emits the signal glyphChange. */
	  	void syncGlyphCode();
      //void about();
      /** Show errors in a QMessageBox about the supplied code
       *  preventing conversion.
      */
      void showMessages (QStringList);

      // Show coordinates/portal address for location preset
      /** Pre-fills coordinate data for the preset: HUB. */
      void preset_hub();
      /** Pre-fills coordinate data for the preset: Amino. */
      void preset_amino();
      /** Pre-fills coordinate data for the preset: DTT. */
................................................................................
      void reset(); 
      /** Clears coordinates value. */
      void clearCoordinates();
      /** Clears all glyph images. */
      void clearGlyphCode();

   private:



   	/** Removes any existing glyphs. */
      void createGlyphs();
      /** Sets coordinates and portal number to default value:
       *  empty, 1.
      */
      void createCoordinates();

		/** \var coordinateData *blackbox

		 * 
		 *  \brief Holds temporary coordinate data.
		*/
      //coordinateData *blackbox;

      // GUI-specific objects
      /** \var QLineEdit *coordinates_input
       * 
       *  \brief Holds the coordinates value.
      */
      QLineEdit *coordinates_input;
      /** \var QLineEdit *glyph_sequence







|







 







|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|









|
|
|
|



|
|
|
|
|
|
|
|
|


|
|
|
|
|




|



|
<



|







 







>
>
>
|






|
>
|
<
<
<
<







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
..
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
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
...
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
 * 
*/
class Window : public QWidget
{
   // Macro to allow for custom slots and signals
   Q_OBJECT

   public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      /** Default constructor */
      explicit Window(QWidget *parent = 0);
      /** \overload Window(const QString &, bool)
       * 
................................................................................

      ////////////////////////////////
      // ACCESSING MEMBER FUNCTIONS //
      ////////////////////////////////
      /** Initialize GUI objects/elements */
      void createLayout();

      /** \returns The glyph code. */
      QString getGlyphCode();
      /** \returns The coordinates. */
      QString getCoordinate();
      /** Convenience function for getCoordinate.
       * 
       *  \returns The coordinates.
       * 
       *  \see getCoordinate
       */
      QString getCoordinates();
      /** \returns The portal number. */
      int getPortal();

      /** Sets the coordinate and portal value. Intended for location
       *  presets and as such has no error-checking of the provided
       *  inputs.
       * 
       *  \param[in] _code A valid coordinate.
       *  \param[in] _portal A valid portal number.
      */
      void setCoordinatePreset(const QString &_code, const int _portal = 1);
      /** Sets the glyph code value. Intended for location presets
       *  and as such has no error-checking of the provided _code.
       * 
       *  \param[in] _code A valid glyph code.
      */
      void setGlyphCodePreset(const QString &_code);

   signals:
      /** This signal is emitted when the coordinate or glyph code
       *  is invalid.
      */
      void haveErrors(QStringList errorList);
      /** This signal is emitted when the glyph code has been
       *  validated.
      */
      void validGlyphCode();
      /** This signal is emitted when the coordinate has been
       *  validated.
      */
      void validCoordinate();
      /** This signal is emitted when there is a change to the 
       *  glyphs.
      */
      void glyphChange();

   public slots:
      /** Calls the method to convert the current coordinates into 
       *  a glyph code.
       * 
       *  \see coordinateData::convertToGlyph
      */
      void GUI_convertToGlyph();
      /** Calls the method to convert the current glyph code into
       *  coordinates.
       * 
       *  \see coordinateData::convertFromGlyph
      */
      void GUI_convertFromGlyph();
      /** Emits the signal glyphChange. */
      void syncGlyphCode();

      /** Show errors in a QMessageBox about the supplied code
       *  preventing conversion.
      */
      void showMessages(QStringList the_errors);

      // Show coordinates/portal address for location preset
      /** Pre-fills coordinate data for the preset: HUB. */
      void preset_hub();
      /** Pre-fills coordinate data for the preset: Amino. */
      void preset_amino();
      /** Pre-fills coordinate data for the preset: DTT. */
................................................................................
      void reset(); 
      /** Clears coordinates value. */
      void clearCoordinates();
      /** Clears all glyph images. */
      void clearGlyphCode();

   private:
      /*
         PRIVATE FUNCTIONS
      */
      /** Removes any existing glyphs. */
      void createGlyphs();
      /** Sets coordinates and portal number to default value:
       *  empty, 1.
      */
      void createCoordinates();

      /*
         PRIVATE VARIABLES
      */




      // GUI-specific objects
      /** \var QLineEdit *coordinates_input
       * 
       *  \brief Holds the coordinates value.
      */
      QLineEdit *coordinates_input;
      /** \var QLineEdit *glyph_sequence

Changes to src/HelperFunctions.cpp.

89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
            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)
{







|







89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
            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)
{

Changes to src/MainWindow.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
...
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
///////////////////////
//------------------------------------------------------------------
/////////////////
// CONSTRUCTOR //
/////////////////
//------------------------------------------------------------------
MainWindow::MainWindow (QWidget *parent)
	: QMainWindow (parent),
	conversion_screen (new Window(this))
{
   setCentralWidget (conversion_screen);
   setWindowTitle ("nmspd");

	// Create dock widget: Top
   portal_address = new Glyphs;
   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);

	// Create dock widget: Bottom
   glyph_selector = new PortalDialer;
   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);

................................................................................
   helpMenu = menuBar() -> addMenu (tr ("&Help"));
   helpMenu -> addAction (about_action);
   helpMenu -> addAction (about_qt_action);
}
//------------------------------------------------------------------
void MainWindow::createStatusBar()
{
	statusBar() -> showMessage (tr ("Ready!"), 5000);
}
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void MainWindow::about()
{
	QMessageBox::about (this, tr ("About nmspd"),
					tr ("<center><h2>nmspd</h2>v0.6.0<br><br><br>" 
					"Author: <a href=\"https://codeberg.org/tfnm/nmspd\">tion</a>"
					"</center>"
					"<hr />"
					"<p>"
					"The glyph symbols used in this program are slightly modified "
					"from images on "
					"<a href=\"https://nomanssky.gamepedia.com/Glyph\">"
					"https://nomanssky.gamepedia.com</a>. These images are "
					"property of Hello Games. The use of "
					"these images is for educational purposes only.</p><hr /><p>"
					"This program is free software: you can redistribute it "
					"and/or modify it under the terms of the GNU General "
					"Public License as published by the Free Software "
					"Foundation, either version 3 of the License, or (at your option) "
					"any later version.</p><p>"
					"This program is distributed in the hope that it will be useful, but "
					"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>"));
}
//------------------------------------------------------------------







|
|




|







|







 







|








|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|


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
...
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
///////////////////////
//------------------------------------------------------------------
/////////////////
// CONSTRUCTOR //
/////////////////
//------------------------------------------------------------------
MainWindow::MainWindow (QWidget *parent)
   : QMainWindow (parent),
   conversion_screen (new Window(this))
{
   setCentralWidget (conversion_screen);
   setWindowTitle ("nmspd");

   // Create dock widget: Top
   portal_address = new Glyphs;
   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);

   // Create dock widget: Bottom
   glyph_selector = new PortalDialer;
   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);

................................................................................
   helpMenu = menuBar() -> addMenu (tr ("&Help"));
   helpMenu -> addAction (about_action);
   helpMenu -> addAction (about_qt_action);
}
//------------------------------------------------------------------
void MainWindow::createStatusBar()
{
   statusBar() -> showMessage (tr ("Ready!"), 5000);
}
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void MainWindow::about()
{
   QMessageBox::about (this, tr ("About nmspd"),
            tr ("<center><h2>nmspd</h2>v0.6.0<br><br><br>" 
            "Author: <a href=\"https://codeberg.org/tfnm/nmspd\">tion</a>"
            "</center>"
            "<hr />"
            "<p>"
            "The glyph symbols used in this program are slightly modified "
            "from images on "
            "<a href=\"https://nomanssky.gamepedia.com/Glyph\">"
            "https://nomanssky.gamepedia.com</a>. These images are "
            "property of Hello Games. The use of "
            "these images is for educational purposes only.</p><hr /><p>"
            "This program is free software: you can redistribute it "
            "and/or modify it under the terms of the GNU General "
            "Public License as published by the Free Software "
            "Foundation, either version 3 of the License, or (at your option) "
            "any later version.</p><p>"
            "This program is distributed in the hope that it will be useful, but "
            "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.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
..
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
/** \class MainWindow
 * 
 *  \brief The main window to handle coordinate/glyph code
 *  conversion.
 * 
 *  To create a MainWindow:
 * 
 * 		MainWindow example;
 *			example.show();
 * 
*/
class MainWindow : public QMainWindow
{
   Q_OBJECT

   public:
................................................................................

   public slots:
      //void action_triggered (QAction *);
      /** Show input portal address window. */
      void showPortal();
      /** Show resulting portal address window. */
      void showGlyphs();
		/** Updates changes to glyphs into glyph code input field. */
      void updateGlyphsToInputWindow();
      /** Updates changes from input field to glyphs. */
	  	void updateGlyphsFromInputWindow();
	  	/** Updates changes from input fields to portal address. */
	  	void updatePortalAddressFromMainWindow();
	  	/** Calls the methods to convert the coordinates or glyph code
	  	 *  into a portal address.
	  	*/
	  	void conversion();
	  	/** Clears all input fields, glyphs, and portal address. */
	  	void reset();

   private:
   	/** Initializes and sets the menu items. */
      void createMenus();
      /** Initializes actions for menu items and private variables. */
      void createActions();
      /** Initializes and sets the toolbar items. */
	  	void createToolBar();
	  	/** Initializes the status bar. */
	  	void createStatusBar();

      // MenuBar items
      /** \var QMenu *fileMenu
       *
       *  \brief Menu item for 'File'.
      */
      QMenu *fileMenu;
................................................................................
      QAction *about_action;
      /** \var QAction *about_qt_action
       *
       *  \brief Action to view information about Qt.
      */
      QAction *about_qt_action;

		/** \var Window *conversion_screen
		 *
		 *  \brief Central widget showing the input fields for
		 *  coordinates and glyph code.
		 *
		 *  \see Window
		*/
	  	Window *conversion_screen;
	  	/** \var Glyphs *portal_address
	  	 *
	  	 *  \brief Top dock widget showing the resulting portal
	  	 *  address.
	  	*/
	  	Glyphs *portal_address;
	  	/** \var PortalDialer *glyph_selector
	  	 *
	  	 *  \brief Bottom dock widget showing the glyph selection
	  	 *  window.
	  	*/
      PortalDialer *glyph_selector;

   private slots:
      // Respond to user activating the menu entries.
      /** Show a QMessageBox with information about this program. */
      void about();
};
//==================================================================
#endif	// __NMS_CONVERT_MAIN_WINDOW_H__
//==================================================================







|
|







 







|


|
|
|
|
|
|
|
|
|


|




|
|
|







 







|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|










9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
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
..
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
/** \class MainWindow
 * 
 *  \brief The main window to handle coordinate/glyph code
 *  conversion.
 * 
 *  To create a MainWindow:
 * 
 *       MainWindow example;
 *	      example.show();
 * 
*/
class MainWindow : public QMainWindow
{
   Q_OBJECT

   public:
................................................................................

   public slots:
      //void action_triggered (QAction *);
      /** Show input portal address window. */
      void showPortal();
      /** Show resulting portal address window. */
      void showGlyphs();
      /** Updates changes to glyphs into glyph code input field. */
      void updateGlyphsToInputWindow();
      /** Updates changes from input field to glyphs. */
      void updateGlyphsFromInputWindow();
      /** Updates changes from input fields to portal address. */
      void updatePortalAddressFromMainWindow();
      /** Calls the methods to convert the coordinates or glyph code
       *  into a portal address.
      */
      void conversion();
      /** Clears all input fields, glyphs, and portal address. */
      void reset();

   private:
      /** Initializes and sets the menu items. */
      void createMenus();
      /** Initializes actions for menu items and private variables. */
      void createActions();
      /** Initializes and sets the toolbar items. */
      void createToolBar();
      /** Initializes the status bar. */
      void createStatusBar();

      // MenuBar items
      /** \var QMenu *fileMenu
       *
       *  \brief Menu item for 'File'.
      */
      QMenu *fileMenu;
................................................................................
      QAction *about_action;
      /** \var QAction *about_qt_action
       *
       *  \brief Action to view information about Qt.
      */
      QAction *about_qt_action;

      /** \var Window *conversion_screen
       *
       *  \brief Central widget showing the input fields for
       *  coordinates and glyph code.
       *
       *  \see Window
      */
      Window *conversion_screen;
      /** \var Glyphs *portal_address
       *
       *  \brief Top dock widget showing the resulting portal
       *  address.
      */
      Glyphs *portal_address;
      /** \var PortalDialer *glyph_selector
       *
       *  \brief Bottom dock widget showing the glyph selection
       *  window.
      */
      PortalDialer *glyph_selector;

   private slots:
      // Respond to user activating the menu entries.
      /** Show a QMessageBox with information about this program. */
      void about();
};
//==================================================================
#endif	// __NMS_CONVERT_MAIN_WINDOW_H__
//==================================================================

Changes to src/PortalAddressPickerWindow.cpp.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
...
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
#include "HelperFunctions.h"
//==================================================================
/////////////////////////
// CLASS: PortalDialer //
/////////////////////////
//------------------------------------------------------------------
PortalDialer::PortalDialer (QWidget *parent)
	: QWidget (parent)
{
   createGlyphs();
   createActions();
   createLayout();
}
//------------------------------------------------------------------
PortalDialer::PortalDialer (const QString &_code)

{
   createGlyphs();
   setGlyphs(_code);
   createActions();
   createLayout();
}
//------------------------------------------------------------------
................................................................................
}
//------------------------------------------------------------------
void PortalDialer::createActions()
{
   // Glyph buttons
   for (int i = 0; i < 16; i++)
   {
   	QObject::connect (glyph_input[i], &QPushButton::clicked, this, [=] { getGlyph (i); });
   }

	// Block further input once full code has been entered
	QObject::connect (this, &PortalDialer::codeReady, this, &PortalDialer::disableGlyphInput);

	// Re-enable input for less than full code
	QObject::connect (this, &PortalDialer::codeIncomplete, this, &PortalDialer::enableGlyphInput);
}
//------------------------------------------------------------------
void PortalDialer::createLayout()
{
   QPushButton *back_button = new QPushButton;
   back_button -> setText (tr ("Delete"));
   back_button -> setToolTip (
................................................................................
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void PortalDialer::disableGlyphInput()
{
	for (int i = 0; i < 16; i++)
	{
		glyph_input[i] -> setDisabled (true);
	}
}
//------------------------------------------------------------------
void PortalDialer::enableGlyphInput()
{
	for (int i = 0; i < 16; i++)
	{
		glyph_input[i] -> setDisabled (false);
	}
}
//------------------------------------------------------------------







|






|
>







 







|


|
|

|
|







 







|
|
|
|




|
|
|
|


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
#include "HelperFunctions.h"
//==================================================================
/////////////////////////
// CLASS: PortalDialer //
/////////////////////////
//------------------------------------------------------------------
PortalDialer::PortalDialer (QWidget *parent)
   : QWidget (parent)
{
   createGlyphs();
   createActions();
   createLayout();
}
//------------------------------------------------------------------
PortalDialer::PortalDialer (const QString &_code, QWidget *parent)
   : QWidget (parent)
{
   createGlyphs();
   setGlyphs(_code);
   createActions();
   createLayout();
}
//------------------------------------------------------------------
................................................................................
}
//------------------------------------------------------------------
void PortalDialer::createActions()
{
   // Glyph buttons
   for (int i = 0; i < 16; i++)
   {
      QObject::connect (glyph_input[i], &QPushButton::clicked, this, [=] { getGlyph (i); });
   }

   // Block further input once full code has been entered
   QObject::connect (this, &PortalDialer::codeReady, this, &PortalDialer::disableGlyphInput);

   // Re-enable input for less than full code
   QObject::connect (this, &PortalDialer::codeIncomplete, this, &PortalDialer::enableGlyphInput);
}
//------------------------------------------------------------------
void PortalDialer::createLayout()
{
   QPushButton *back_button = new QPushButton;
   back_button -> setText (tr ("Delete"));
   back_button -> setToolTip (
................................................................................
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void PortalDialer::disableGlyphInput()
{
   for (int i = 0; i < 16; i++)
   {
      glyph_input[i] -> setDisabled (true);
   }
}
//------------------------------------------------------------------
void PortalDialer::enableGlyphInput()
{
   for (int i = 0; i < 16; i++)
   {
      glyph_input[i] -> setDisabled (false);
   }
}
//------------------------------------------------------------------

Changes to src/PortalAddressPickerWindow.h.

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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 *  to in-game portals.
 * 
 *  \details Displays a list of possible glyphs and accepts any 
 *  sequence of glyphs the user may wish to input.
 * 
 *  To create a PortalDialer:
 * 
 *  		// Create an empty object
 * 		PortalDialer example;
 * 
 * 		// Show a specific glyph code sequence
 * 		example.setGlyphs ("00234567890AB");
 * 		example.show();
 * 
*/
class PortalDialer : public QWidget
{
   Q_OBJECT
    
	public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      /** Default constructor */
      explicit PortalDialer(QWidget *parent = 0);
      /** \overload PortalDialer(const QString &)
       * 
       *  \param[in] _code A valid glyph code to set as.
      */
		PortalDialer(const QString &_code);

		/**
		 *  \details Sets the glyph code along with its corresponding glyphs.
		 * 
		 *  \param[in] _code A valid glyph code.
		*/
      void setGlyphs(const QString &_code);
      /** \returns The glyph code. */
      QString getCode();

	signals:
		/** This signal is emitted when there is a change to the glyph code. */
		void codeChange();
		/** This signal is emitted when the glyph code has not been filled to 
		 *  twelve (12) hex characters. Indicates the glyph code is between 0
		 *  and 11 characters.
		*/
		void codeIncomplete();
		/** This signal is emitted when the glyph code has been filled to twelve
		 *  (12) hex characters. Indicates the glyph code is ready to be 
		 *  validated.
		*/
		void codeReady();

	public slots:
		/** Removes the most recent/last glyph selected. */
		void clearOne();
		/** Clears the glyphs and glyph code. */
      void reset();
      /** Selects the glyph image corresponding to the value of index.
       *
       *  \param[in] index An integer between 0 - 15.
      */
		void getGlyph(const int index);

	private:



		/** Initializes glyph_input to empty QPushButtons. */
      void createGlyphs();
      /** Initializes the layout. */
      void createLayout();
      /** Initializes actions for the private variables. */
      void createActions();




      /** \var QPushButton *glyph_input[16]
       *
       *  Holds the glyph image for each possible glyph.
      */
     	QPushButton *glyph_input[16];
     	/** \var QStack<QChar> *code
     	 *
     	 *  Stores the selected glyph code.
     	*/
     	QStack<QChar> *code;
     	/** \var QLineEdit *glyph_code
     	 *
     	 *  Displays the current glyph code.
     	*/
     	QLineEdit *glyph_code;
     	//QPushButton *glyph_select[12];

	private slots:
		/** Disables all glyph input. Useful when 12 codes have been 
		 *  entered.
		 *
		 *  Should only be called when codeReady is emitted.
		*/
		void disableGlyphInput();
		/** Enables all glyph input. This is the default state of the
		 *  object.
		*/
		void enableGlyphInput();
};
//==================================================================
#endif	// __NMS_PORTAL_DIAL_H__
//==================================================================







|
|

|
|
|






|









|

|
|
|
|
|




|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|





|

|
>
>
>
|






>
>
>




|
|
|
|
|
|
|
|
|
|
|
<

|
|
|
|
|
|
|
|
|
|
|




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
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
 *  to in-game portals.
 * 
 *  \details Displays a list of possible glyphs and accepts any 
 *  sequence of glyphs the user may wish to input.
 * 
 *  To create a PortalDialer:
 * 
 *       // Create an empty object
 *       PortalDialer example;
 * 
 *       // Show a specific glyph code sequence
 *       example.setGlyphs ("00234567890AB");
 *       example.show();
 * 
*/
class PortalDialer : public QWidget
{
   Q_OBJECT
    
   public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      /** Default constructor */
      explicit PortalDialer(QWidget *parent = 0);
      /** \overload PortalDialer(const QString &)
       * 
       *  \param[in] _code A valid glyph code to set as.
      */
      explicit PortalDialer(const QString &_code, QWidget *parent = 0);

      /**
       *  \details Sets the glyph code along with its corresponding glyphs.
       * 
       *  \param[in] _code A valid glyph code.
      */
      void setGlyphs(const QString &_code);
      /** \returns The glyph code. */
      QString getCode();

   signals:
      /** This signal is emitted when there is a change to the glyph code. */
      void codeChange();
      /** This signal is emitted when the glyph code has not been filled to 
       *  twelve (12) hex characters. Indicates the glyph code is between 0
       *  and 11 characters.
      */
      void codeIncomplete();
      /** This signal is emitted when the glyph code has been filled to twelve
       *  (12) hex characters. Indicates the glyph code is ready to be 
       *  validated.
      */
      void codeReady();

   public slots:
      /** Removes the most recent/last glyph selected. */
      void clearOne();
      /** Clears the glyphs and glyph code. */
      void reset();
      /** Selects the glyph image corresponding to the value of index.
       *
       *  \param[in] index An integer between 0 - 15.
      */
      void getGlyph(const int index);

   private:
      /*
         PRIVATE FUNCTIONS
      */
      /** Initializes glyph_input to empty QPushButtons. */
      void createGlyphs();
      /** Initializes the layout. */
      void createLayout();
      /** Initializes actions for the private variables. */
      void createActions();

      /*
         PRIVATE VARIABLES
      */
      /** \var QPushButton *glyph_input[16]
       *
       *  Holds the glyph image for each possible glyph.
      */
      QPushButton *glyph_input[16];
      /** \var QStack<QChar> *code
       *
       *  Stores the selected glyph code.
      */
      QStack<QChar> *code;
      /** \var QLineEdit *glyph_code
       *
       *  Displays the current glyph code.
      */
      QLineEdit *glyph_code;


   private slots:
      /** Disables all glyph input. Useful when 12 codes have been 
       *  entered.
       *
       *  Should only be called when codeReady is emitted.
      */
      void disableGlyphInput();
      /** Enables all glyph input. This is the default state of the
       *  object.
      */
      void enableGlyphInput();
};
//==================================================================
#endif	// __NMS_PORTAL_DIAL_H__
//==================================================================

Changes to src/PortalAddressWindow.cpp.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

18
19
20
21
22
23
24
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "HelperFunctions.h"
//------------------------------------------------------------------
///////////////////
// CLASS: Glyphs //
///////////////////
//------------------------------------------------------------------
Glyphs::Glyphs (QWidget *parent)
	: QWidget (parent)
{
   createGlyphs();
   setGlyphs (QString());
   createLayout();
}
//------------------------------------------------------------------
Glyphs::Glyphs (const QString &_code)

{
   createGlyphs();
   setGlyphs (_code);
   createLayout();
}
//------------------------------------------------------------------
void Glyphs::createGlyphs()
................................................................................
   // Do not change glyph code if provided code is the same as 
   // what we already have; just redraw it. Also must be a valid 
   // glyph code.
   if ( glyph_code.toLower() != _code.toLower() &&
        (is_valid_glyph_code (_code, ignoreThis) == true) )
   {
      glyph_code = _code;
	}

   for (int i = 0; i < 12; i++)
   {
      // Using aliases from qrc
      if ( _code.isEmpty() == false )
      {
         glyph[i] -> setIcon (QIcon (QString(":" + QString(glyph_code.at(
................................................................................
      glyph[i] -> setCheckable (false);
      glyph[i] -> setFlat (true);
   }
}
//------------------------------------------------------------------
void Glyphs::showGlyphs()
{
	setGlyphs (glyph_code);
}
//------------------------------------------------------------------
void Glyphs::showGlyphs (const QString &_code)
{
	setGlyphs (_code);
}
//------------------------------------------------------------------
void Glyphs::reset()
{
   glyph_code.clear();
   for (int i = 0; i < 12; i++)
      glyph[i] -> setIcon (QIcon (":empty.png"));







|






|
>







 







|







 







|




|







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
..
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include "HelperFunctions.h"
//------------------------------------------------------------------
///////////////////
// CLASS: Glyphs //
///////////////////
//------------------------------------------------------------------
Glyphs::Glyphs (QWidget *parent)
   : QWidget (parent)
{
   createGlyphs();
   setGlyphs (QString());
   createLayout();
}
//------------------------------------------------------------------
Glyphs::Glyphs (const QString &_code, QWidget *parent)
   : QWidget (parent)
{
   createGlyphs();
   setGlyphs (_code);
   createLayout();
}
//------------------------------------------------------------------
void Glyphs::createGlyphs()
................................................................................
   // Do not change glyph code if provided code is the same as 
   // what we already have; just redraw it. Also must be a valid 
   // glyph code.
   if ( glyph_code.toLower() != _code.toLower() &&
        (is_valid_glyph_code (_code, ignoreThis) == true) )
   {
      glyph_code = _code;
   }

   for (int i = 0; i < 12; i++)
   {
      // Using aliases from qrc
      if ( _code.isEmpty() == false )
      {
         glyph[i] -> setIcon (QIcon (QString(":" + QString(glyph_code.at(
................................................................................
      glyph[i] -> setCheckable (false);
      glyph[i] -> setFlat (true);
   }
}
//------------------------------------------------------------------
void Glyphs::showGlyphs()
{
   setGlyphs (glyph_code);
}
//------------------------------------------------------------------
void Glyphs::showGlyphs (const QString &_code)
{
   setGlyphs (_code);
}
//------------------------------------------------------------------
void Glyphs::reset()
{
   glyph_code.clear();
   for (int i = 0; i < 12; i++)
      glyph[i] -> setIcon (QIcon (":empty.png"));

Changes to src/PortalAddressWindow.h.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
..
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
 *
 *  \brief Holds graphical data about a glyph sequence.
 * 
 *  \details Displays the glyphs in a given a glyph code sequence.
 * 
 *  To create a Glyphs:
 * 
 * 		// Create empty glyph sequence
 * 		Glyphs example;
 * 
 * 		// Show sequence: 200d01345678
 * 		example.showGlyphs ("200d01345678");
 * 		example.show();
 * 
 *  \see CoordinateData::glyph_code
*/
class Glyphs : public QWidget
{
   // Macro to allow for custom slots and signals
   Q_OBJECT

   public:
................................................................................
       * 
       *  Initializes class with a given glyph sequence.
       * 
       *  \param[in] _code A valid glyph code.
       * 
       *  \see CoordinateData::glyph_code
      */
      Glyphs(const QString &_code);

      /** Initializes the GUI elements */
      void createLayout();

      ////////////////////////////////
      // ACCESSING MEMBER FUNCTIONS //
      ////////////////////////////////
      /** Sets the glyph code sequence to be displayed.
       * 
       *  \param[in] _code A valid glyph code.
................................................................................
       *  the same as what is currently set.
       * 
       *  \param[in] _code A valid glyph code.
      */
      void showGlyphs(const QString &_code);

   private:



   	/** \var QString glyph_code
   	 * 
   	 *  The glyph code sequence to be displayed.
   	 * 
   	 *  \see CoordinateData::glyph_code
   	*/
      QString glyph_code;
      /** \var QPushButton *glyph[12]
       * 
       *  The actual glyphs corresponding to the glyph code.
      */
      QPushButton *glyph[12];




		/** Initializes private variables:
		 * 
		 *  glyph_code of size zero, and empty QPushButtons for the glyphs.
		*/
      void createGlyphs();


};
//==================================================================
#endif	// __NMS_GLYPHS_H__
//==================================================================







|
|

|
|
|

|







 







|
<
<
<







 







>
>
>
|
|
|
|
|
|







>
>
>
|
|
|
|

>
>




8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
36
37
38
39
40
41
42
43



44
45
46
47
48
49
50
..
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
99
100
101
102
 *
 *  \brief Holds graphical data about a glyph sequence.
 * 
 *  \details Displays the glyphs in a given a glyph code sequence.
 * 
 *  To create a Glyphs:
 * 
 *       // Create empty glyph sequence
 *       Glyphs example;
 * 
 *       // Show sequence: 200d01345678
 *       example.showGlyphs ("200d01345678");
 *       example.show();
 * 
 *  \see coordinateData::glyph_code
*/
class Glyphs : public QWidget
{
   // Macro to allow for custom slots and signals
   Q_OBJECT

   public:
................................................................................
       * 
       *  Initializes class with a given glyph sequence.
       * 
       *  \param[in] _code A valid glyph code.
       * 
       *  \see CoordinateData::glyph_code
      */
      explicit Glyphs(const QString &_code, QWidget *parent = 0);




      ////////////////////////////////
      // ACCESSING MEMBER FUNCTIONS //
      ////////////////////////////////
      /** Sets the glyph code sequence to be displayed.
       * 
       *  \param[in] _code A valid glyph code.
................................................................................
       *  the same as what is currently set.
       * 
       *  \param[in] _code A valid glyph code.
      */
      void showGlyphs(const QString &_code);

   private:
      /*
         PRIVATE VARIABLES
      */
      /** \var QString glyph_code
       * 
       *  The glyph code sequence to be displayed.
       * 
       *  \see CoordinateData::glyph_code
      */
      QString glyph_code;
      /** \var QPushButton *glyph[12]
       * 
       *  The actual glyphs corresponding to the glyph code.
      */
      QPushButton *glyph[12];

      /*
         PRIVATE FUNCTIONS
      */
      /** Initializes private variables:
       * 
       *  glyph_code of size zero, and empty QPushButtons for the glyphs.
      */
      void createGlyphs();
      /** Initializes the GUI elements */
      void createLayout();
};
//==================================================================
#endif	// __NMS_GLYPHS_H__
//==================================================================