Check-in [8946855f9a]

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

Overview
Comment:Add status bar
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | improvements-to-main-menu
Files: files | file ages | folders
SHA1:8946855f9ab663af924b8e006475380dfaa8681b
User & Date: tion 2019-02-15 18:23:10
Context
2019-02-15
22:33
MainWindow: code improvements. PortalDialer: glyphs become disabled when 12-digit code entered check-in: 75df4b5141 user: tion tags: improvements-to-main-menu
18:23
Add status bar check-in: 8946855f9a user: tion tags: improvements-to-main-menu
06:09
Fix minor typo with author check-in: ec284f5af0 user: tion tags: trunk
Changes

Changes to src/MainWindow.cpp.

29
30
31
32
33
34
35

36
37
38
39
40
41
42
..
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
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
145
146
147
148
149
150
151





152
153
154
155
156
157
158
   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);

   createActions();

   createMenus();
   createToolBar();
}
//------------------------------------------------------------------
//////////////////
// PUBLIC SLOTS //
//////////////////
................................................................................
   //  actions. As it stands, these are text-only toolbar buttons
   QToolBar *mainToolBar;
   mainToolBar = addToolBar (tr ("Control"));
   mainToolBar -> setAllowedAreas (Qt::AllToolBarAreas);
   
   // Toggle glyph entry window (PortalAddressPickerWindow -- Glyphs)
   QAction *showPortalAction = new QAction (tr ("&Glyph entry"));

   QObject::connect (showPortalAction, &QAction::triggered, this, &MainWindow::showPortal);
   mainToolBar -> addAction (showPortalAction);
   mainToolBar -> addSeparator ();
   
   // Toggle portal address window (PortalAddressWindow -- PortalDialer)
   QAction *showGlyphInput = new QAction (tr ("&Portal Address"));

   QObject::connect (showGlyphInput, &QAction::triggered, this, &MainWindow::showGlyphs);
   mainToolBar -> addAction (showGlyphInput);
   mainToolBar -> addSeparator ();
   
   // Clear inputs of main window and portal address
   QAction *clearInputsAction = new QAction (tr ("Clear All"));

   QObject::connect (clearInputsAction, &QAction::triggered, this, &MainWindow::reset);
   mainToolBar -> addAction (clearInputsAction);
   mainToolBar -> addSeparator ();
}
//------------------------------------------------------------------
void MainWindow::createActions()
{
................................................................................
   about_action = new QAction (tr ("&About"));
   about_action -> setStatusTip (tr ("Show the application's About box"));
   QObject::connect (about_action, &QAction::triggered, this, &MainWindow::about);

   about_qt_action = new QAction (tr ("About &Qt"));
   about_qt_action -> setStatusTip (tr ("Show the Qt library's About box"));
   QObject::connect (about_qt_action, &QAction::triggered, qApp, &QApplication::aboutQt);
   
   // 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::codeChange, this, &MainWindow::updateGlyphsFromInputWindow);
   QObject::connect (conversion_screen, &Window::validCoordinate, this, &MainWindow::updatePortalAddressFromMainWindow);
   QObject::connect (conversion_screen, &Window::validGlyphCode, this, &MainWindow::updatePortalAddressFromMainWindow);
   QObject::connect (glyph_selector, &PortalDialer::codeReady, this, &MainWindow::conversion);
................................................................................
{
   fileMenu = menuBar() -> addMenu (tr ("&File"));
   fileMenu -> addAction (exit_action);

   helpMenu = menuBar() -> addMenu (tr ("&Help"));
   helpMenu -> addAction (about_action);
   helpMenu -> addAction (about_qt_action);





}
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void MainWindow::about()







>







 







>



|


>



|


>







 







|







 







>
>
>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
..
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
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
   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);

   createActions();
   createStatusBar();
   createMenus();
   createToolBar();
}
//------------------------------------------------------------------
//////////////////
// PUBLIC SLOTS //
//////////////////
................................................................................
   //  actions. As it stands, these are text-only toolbar buttons
   QToolBar *mainToolBar;
   mainToolBar = addToolBar (tr ("Control"));
   mainToolBar -> setAllowedAreas (Qt::AllToolBarAreas);
   
   // Toggle glyph entry window (PortalAddressPickerWindow -- Glyphs)
   QAction *showPortalAction = new QAction (tr ("&Glyph entry"));
   showPortalAction -> setStatusTip (tr ("Show/Hide glyph entry window"));
   QObject::connect (showPortalAction, &QAction::triggered, this, &MainWindow::showPortal);
   mainToolBar -> addAction (showPortalAction);
   mainToolBar -> addSeparator ();

   // Toggle portal address window (PortalAddressWindow -- PortalDialer)
   QAction *showGlyphInput = new QAction (tr ("&Portal Address"));
   showGlyphInput -> setStatusTip (tr ("Show/Hide portal address window"));
   QObject::connect (showGlyphInput, &QAction::triggered, this, &MainWindow::showGlyphs);
   mainToolBar -> addAction (showGlyphInput);
   mainToolBar -> addSeparator ();

   // Clear inputs of main window and portal address
   QAction *clearInputsAction = new QAction (tr ("Clear All"));
   clearInputsAction -> setStatusTip (tr ("Reset coordinates, glyph code, and glyphs."));
   QObject::connect (clearInputsAction, &QAction::triggered, this, &MainWindow::reset);
   mainToolBar -> addAction (clearInputsAction);
   mainToolBar -> addSeparator ();
}
//------------------------------------------------------------------
void MainWindow::createActions()
{
................................................................................
   about_action = new QAction (tr ("&About"));
   about_action -> setStatusTip (tr ("Show the application's About box"));
   QObject::connect (about_action, &QAction::triggered, this, &MainWindow::about);

   about_qt_action = new QAction (tr ("About &Qt"));
   about_qt_action -> setStatusTip (tr ("Show the Qt library's About box"));
   QObject::connect (about_qt_action, &QAction::triggered, qApp, &QApplication::aboutQt);

   // 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::codeChange, this, &MainWindow::updateGlyphsFromInputWindow);
   QObject::connect (conversion_screen, &Window::validCoordinate, this, &MainWindow::updatePortalAddressFromMainWindow);
   QObject::connect (conversion_screen, &Window::validGlyphCode, this, &MainWindow::updatePortalAddressFromMainWindow);
   QObject::connect (glyph_selector, &PortalDialer::codeReady, this, &MainWindow::conversion);
................................................................................
{
   fileMenu = menuBar() -> addMenu (tr ("&File"));
   fileMenu -> addAction (exit_action);

   helpMenu = menuBar() -> addMenu (tr ("&Help"));
   helpMenu -> addAction (about_action);
   helpMenu -> addAction (about_qt_action);
}
//------------------------------------------------------------------
void MainWindow::createStatusBar()
{
	statusBar() -> showMessage (tr ("Ready!"));
}
//------------------------------------------------------------------
///////////////////
// PRIVATE SLOTS //
///////////////////
//------------------------------------------------------------------
void MainWindow::about()

Changes to src/MainWindow.h.

58
59
60
61
62
63
64


65
66
67
68
69
70
71
   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();



      // MenuBar items
      /** \var QMenu *fileMenu
       *
       *  \brief Menu item for 'File'.
      */
      QMenu *fileMenu;







>
>







58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
   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;