Changeset 7d416a0d in OpenModelica
- Timestamp:
- 2016-04-08T16:46:04+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 0a1303a
- Parents:
- 08c9f97
- Location:
- OMEdit/OMEditGUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
OMEdit/OMEditGUI/Options/NotificationsDialog.cpp
r08c9f97 r7d416a0d 39 39 40 40 /*! 41 \class NotificationsDialog42 \brief Creates a notification dialog.43 44 Define a new notification type if you want to add a new Dialog.\n45 Also add the notification to NotificationPage class.\n46 Save the notification in omedit.ini settings file by defining a new key in notifications section.47 48 49 /*! 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 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 */ 48 /*! 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 */ 54 54 NotificationsDialog::NotificationsDialog(NotificationType notificationType, NotificationIcon notificationIcon, MainWindow *pMainWindow) 55 55 : QDialog(pMainWindow) … … 94 94 95 95 /*! 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 */ 99 100 void NotificationsDialog::setNotificationLabelString(QString label) 100 101 { … … 103 104 104 105 /*! 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 */ 109 111 QPixmap NotificationsDialog::getNotificationIcon(NotificationsDialog::NotificationIcon notificationIcon) 110 112 { … … 112 114 int iconSize = pStyle->pixelMetric(QStyle::PM_MessageBoxIconSize, 0, this); 113 115 QIcon tmpIcon; 114 switch (notificationIcon) 115 { 116 switch (notificationIcon) { 116 117 case NotificationsDialog::InformationIcon: 117 118 tmpIcon = pStyle->standardIcon(QStyle::SP_MessageBoxInformation, 0, this); … … 128 129 break; 129 130 } 130 if (!tmpIcon.isNull()) 131 if (!tmpIcon.isNull()) { 131 132 return tmpIcon.pixmap(iconSize, iconSize); 133 } 132 134 return QPixmap(); 133 135 } 134 136 135 137 /*! 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 */ 139 142 QString NotificationsDialog::getNotificationTitleString() 140 143 { 141 switch (mNotificationType) 142 { 144 switch (mNotificationType) { 143 145 case NotificationsDialog::QuitApplication: 144 146 return tr("Confirm Quit"); … … 155 157 156 158 /*! 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 */ 160 163 QString NotificationsDialog::getNotificationLabelString() 161 164 { 162 QString tmpPath, OMCCommunicationLogFilePath, OMCCommandsLogFilePath, OMCOutputFile, stackTraceFile; 163 switch (mNotificationType) 164 { 165 switch (mNotificationType) { 165 166 case NotificationsDialog::QuitApplication: 166 167 return tr("Are you sure you want to quit?"); … … 179 180 180 181 /*! 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 */ 193 187 QString NotificationsDialog::getNotificationCheckBoxString() 194 188 { 195 switch (mNotificationType) 196 { 189 switch (mNotificationType) { 197 190 case NotificationsDialog::QuitApplication: 198 191 return tr("Always quit without prompt"); … … 209 202 210 203 /*! 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 */ 213 207 void NotificationsDialog::saveQuitNotificationSettings() 214 208 { … … 218 212 219 213 /*! 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 */ 223 218 void NotificationsDialog::saveItemDroppedOnItselfNotificationSettings() 224 219 { … … 229 224 230 225 /*! 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 */ 234 230 void NotificationsDialog::saveReplaceableIfPartialNotificationSettings() 235 231 { … … 240 236 241 237 /*! 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 */ 245 242 void NotificationsDialog::saveInnerModelNameChangedNotificationSettings() 246 243 { … … 251 248 252 249 /*! 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 */ 256 254 void NotificationsDialog::saveModelForBitmapInsertionNotificationSettings() 257 255 { … … 262 260 263 261 /*! 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 */ 267 266 void NotificationsDialog::saveNotification() 268 267 { -
OMEdit/OMEditGUI/Options/NotificationsDialog.h
r7639b9b6 r7d416a0d 55 55 NotificationsDialog(NotificationType notificationType, NotificationIcon notificationIcon, MainWindow *pMainWindow); 56 56 void setNotificationLabelString(QString label); 57 QCheckBox* getNotificationCheckBox() ;57 QCheckBox* getNotificationCheckBox() {mpNotificationCheckBox;} 58 58 private: 59 59 MainWindow *mpMainWindow; -
OMEdit/OMEditGUI/Resources/css/stylesheet.qss
r08c9f97 r7d416a0d 28 28 * See the full OSMC Public License conditions for more details. 29 29 * 30 */ 31 /* 32 * @author Adeel Asghar <adeel.asghar@liu.se> 30 33 */ 31 34
Note: See TracChangeset
for help on using the changeset viewer.