Skip to content

Commit 7d416a0

Browse files
committed
documentation & formatting.
1 parent 08c9f97 commit 7d416a0

File tree

3 files changed

+66
-64
lines changed

3 files changed

+66
-64
lines changed

OMEdit/OMEditGUI/Options/NotificationsDialog.cpp

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@
3838
#include "NotificationsDialog.h"
3939

4040
/*!
41-
\class NotificationsDialog
42-
\brief Creates a notification dialog.
43-
44-
Define a new notification type if you want to add a new Dialog.\n
45-
Also add the notification to NotificationPage class.\n
46-
Save the notification in omedit.ini settings file by defining a new key in notifications section.
47-
*/
41+
* \class NotificationsDialog
42+
* \brief Creates a notification dialog.
4843
44+
* Define a new notification type if you want to add a new Dialog.\n
45+
* Also add the notification to NotificationPage class.\n
46+
* Save the notification in omedit.ini settings file by defining a new key in notifications section.
47+
*/
4948
/*!
50-
\param notificationType - specifies what type of notification dialog should be created.
51-
\param notificationIcon - specifies which icon should be used.
52-
\param pMainWindow - pointer to MainWindow.
53-
*/
49+
* \brief NotificationsDialog::NotificationsDialog
50+
* \param notificationType - specifies what type of notification dialog should be created.
51+
* \param notificationIcon - specifies which icon should be used.
52+
* \param pMainWindow - pointer to MainWindow.
53+
*/
5454
NotificationsDialog::NotificationsDialog(NotificationType notificationType, NotificationIcon notificationIcon, MainWindow *pMainWindow)
5555
: QDialog(pMainWindow)
5656
{
@@ -93,26 +93,27 @@ NotificationsDialog::NotificationsDialog(NotificationType notificationType, Noti
9393
}
9494

9595
/*!
96-
Sets the notification dialog message.
97-
\param label - the message to set.
98-
*/
96+
* \brief NotificationsDialog::setNotificationLabelString
97+
* Sets the notification dialog message.
98+
* \param label - the message to set.
99+
*/
99100
void NotificationsDialog::setNotificationLabelString(QString label)
100101
{
101102
mpNotificationLabel->setText(label);
102103
}
103104

104105
/*!
105-
Returns the notification icon.
106-
\param notificationIcon - the notificaiton icon to set.
107-
\return the notificaiton icon as QPixmap
108-
*/
106+
* \brief NotificationsDialog::getNotificationIcon
107+
* Returns the notification icon.
108+
* \param notificationIcon - the notificaiton icon to set.
109+
* \return the notificaiton icon as QPixmap
110+
*/
109111
QPixmap NotificationsDialog::getNotificationIcon(NotificationsDialog::NotificationIcon notificationIcon)
110112
{
111113
QStyle *pStyle = this->style();
112114
int iconSize = pStyle->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this);
113115
QIcon tmpIcon;
114-
switch (notificationIcon)
115-
{
116+
switch (notificationIcon) {
116117
case NotificationsDialog::InformationIcon:
117118
tmpIcon = pStyle->standardIcon(QStyle::SP_MessageBoxInformation, 0, this);
118119
break;
@@ -127,19 +128,20 @@ QPixmap NotificationsDialog::getNotificationIcon(NotificationsDialog::Notificati
127128
default:
128129
break;
129130
}
130-
if (!tmpIcon.isNull())
131+
if (!tmpIcon.isNull()) {
131132
return tmpIcon.pixmap(iconSize, iconSize);
133+
}
132134
return QPixmap();
133135
}
134136

135137
/*!
136-
Returns the notification dialog title.
137-
\return the title string.
138-
*/
138+
* \brief NotificationsDialog::getNotificationTitleString
139+
* Returns the notification dialog title.
140+
* \return the title string.
141+
*/
139142
QString NotificationsDialog::getNotificationTitleString()
140143
{
141-
switch (mNotificationType)
142-
{
144+
switch (mNotificationType) {
143145
case NotificationsDialog::QuitApplication:
144146
return tr("Confirm Quit");
145147
case NotificationsDialog::ItemDroppedOnItself:
@@ -154,14 +156,13 @@ QString NotificationsDialog::getNotificationTitleString()
154156
}
155157

156158
/*!
157-
Returns the notification dialog message.
158-
\return the message string.
159-
*/
159+
* \brief NotificationsDialog::getNotificationLabelString
160+
* Returns the notification dialog message.
161+
* \return the message string.
162+
*/
160163
QString NotificationsDialog::getNotificationLabelString()
161164
{
162-
QString tmpPath, OMCCommunicationLogFilePath, OMCCommandsLogFilePath, OMCOutputFile, stackTraceFile;
163-
switch (mNotificationType)
164-
{
165+
switch (mNotificationType) {
165166
case NotificationsDialog::QuitApplication:
166167
return tr("Are you sure you want to quit?");
167168
case NotificationsDialog::ItemDroppedOnItself:
@@ -178,22 +179,14 @@ QString NotificationsDialog::getNotificationLabelString()
178179
}
179180

180181
/*!
181-
Returns the notification dialog checkbox.
182-
\return the checkbox.
183-
*/
184-
QCheckBox* NotificationsDialog::getNotificationCheckBox()
185-
{
186-
return mpNotificationCheckBox;
187-
}
188-
189-
/*!
190-
Returns the notification dialog checkbox message.
191-
\return the checkbox message string.
192-
*/
182+
* \brief NotificationsDialog::getNotificationCheckBoxString
183+
* Returns the notification dialog checkbox message.
184+
* \return the checkbox message string.
185+
* \return
186+
*/
193187
QString NotificationsDialog::getNotificationCheckBoxString()
194188
{
195-
switch (mNotificationType)
196-
{
189+
switch (mNotificationType) {
197190
case NotificationsDialog::QuitApplication:
198191
return tr("Always quit without prompt");
199192
case NotificationsDialog::ItemDroppedOnItself:
@@ -208,18 +201,20 @@ QString NotificationsDialog::getNotificationCheckBoxString()
208201
}
209202

210203
/*!
211-
Saves the promptQuitApplication key settings to omedit.ini file.
212-
*/
204+
* \brief NotificationsDialog::saveQuitNotificationSettings
205+
* Saves the promptQuitApplication key settings to omedit.ini file.
206+
*/
213207
void NotificationsDialog::saveQuitNotificationSettings()
214208
{
215209
QSettings *pSettings = OpenModelica::getApplicationSettings();
216210
pSettings->setValue("notifications/promptQuitApplication", true);
217211
}
218212

219213
/*!
220-
Saves the notifications/itemDroppedOnItself key settings to omedit.ini file.\n
221-
Sets the notifications/itemDroppedOnItself notification checkbox on the NotificationsPage.
222-
*/
214+
* \brief NotificationsDialog::saveItemDroppedOnItselfNotificationSettings
215+
* Saves the notifications/itemDroppedOnItself key settings to omedit.ini file.\n
216+
* Sets the notifications/itemDroppedOnItself notification checkbox on the NotificationsPage.
217+
*/
223218
void NotificationsDialog::saveItemDroppedOnItselfNotificationSettings()
224219
{
225220
QSettings *pSettings = OpenModelica::getApplicationSettings();
@@ -228,9 +223,10 @@ void NotificationsDialog::saveItemDroppedOnItselfNotificationSettings()
228223
}
229224

230225
/*!
231-
Saves the notifications/replaceableIfPartial key settings to omedit.ini file.\n
232-
Sets the notifications/replaceableIfPartial notification checkbox on the NotificationsPage.
233-
*/
226+
* \brief NotificationsDialog::saveReplaceableIfPartialNotificationSettings
227+
* Saves the notifications/replaceableIfPartial key settings to omedit.ini file.\n
228+
* Sets the notifications/replaceableIfPartial notification checkbox on the NotificationsPage.
229+
*/
234230
void NotificationsDialog::saveReplaceableIfPartialNotificationSettings()
235231
{
236232
QSettings *pSettings = OpenModelica::getApplicationSettings();
@@ -239,9 +235,10 @@ void NotificationsDialog::saveReplaceableIfPartialNotificationSettings()
239235
}
240236

241237
/*!
242-
Saves the notifications/innerModelNameChanged key settings to omedit.ini file.\n
243-
Sets the notifications/innerModelNameChanged notification checkbox on the NotificationsPage.
244-
*/
238+
* \brief NotificationsDialog::saveInnerModelNameChangedNotificationSettings
239+
* Saves the notifications/innerModelNameChanged key settings to omedit.ini file.\n
240+
* Sets the notifications/innerModelNameChanged notification checkbox on the NotificationsPage.
241+
*/
245242
void NotificationsDialog::saveInnerModelNameChangedNotificationSettings()
246243
{
247244
QSettings *pSettings = OpenModelica::getApplicationSettings();
@@ -250,9 +247,10 @@ void NotificationsDialog::saveInnerModelNameChangedNotificationSettings()
250247
}
251248

252249
/*!
253-
Saves the notifications/saveModelForBitmapInsertion key settings to omedit.ini file.\n
254-
Sets the notifications/saveModelForBitmapInsertion notification checkbox on the NotificationsPage.
255-
*/
250+
* \brief NotificationsDialog::saveModelForBitmapInsertionNotificationSettings
251+
* Saves the notifications/saveModelForBitmapInsertion key settings to omedit.ini file.\n
252+
* Sets the notifications/saveModelForBitmapInsertion notification checkbox on the NotificationsPage.
253+
*/
256254
void NotificationsDialog::saveModelForBitmapInsertionNotificationSettings()
257255
{
258256
QSettings *pSettings = OpenModelica::getApplicationSettings();
@@ -261,9 +259,10 @@ void NotificationsDialog::saveModelForBitmapInsertionNotificationSettings()
261259
}
262260

263261
/*!
264-
Slot activated when mpOkButton clicked signal is raised.\n
265-
Checks the notification type and calls the appropriate method.
266-
*/
262+
* \brief NotificationsDialog::saveNotification
263+
* Slot activated when mpOkButton clicked signal is raised.\n
264+
* Checks the notification type and calls the appropriate method.
265+
*/
267266
void NotificationsDialog::saveNotification()
268267
{
269268
if (mpNotificationCheckBox->isChecked()) {

OMEdit/OMEditGUI/Options/NotificationsDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class NotificationsDialog : public QDialog
5454
enum NotificationIcon {NoIcon, QuestionIcon, InformationIcon, WarningIcon, CriticalIcon};
5555
NotificationsDialog(NotificationType notificationType, NotificationIcon notificationIcon, MainWindow *pMainWindow);
5656
void setNotificationLabelString(QString label);
57-
QCheckBox* getNotificationCheckBox();
57+
QCheckBox* getNotificationCheckBox() {mpNotificationCheckBox;}
5858
private:
5959
MainWindow *mpMainWindow;
6060
Label *mpNotificationLabel;

OMEdit/OMEditGUI/Resources/css/stylesheet.qss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
* See the full OSMC Public License conditions for more details.
2929
*
3030
*/
31+
/*
32+
* @author Adeel Asghar <adeel.asghar@liu.se>
33+
*/
3134

3235
QMainWindow::separator {
3336
width: 4px; /* when vertical */

0 commit comments

Comments
 (0)