XML Mill  1.0.0
A GUI based XML editor with a memory.
Enumerations | Functions
GCMessageSpace Namespace Reference

Responsible for the display of error messages and messages requiring user input with the option to remember the user's preference. More...

Enumerations

enum  Icon {
  NoIcon, Information, Warning, Critical,
  Question
}
 Determines the type of icon that will be set on the message dialog. More...
enum  ButtonCombo { OKOnly, YesNo, OKCancel }
 Determines the combination of buttons that will be shown. More...
enum  Buttons { Yes, No, OK, Cancel }
 Represents the individual buttons available. More...

Functions

bool userAccepted (const QString &uniqueMessageKey, const QString &heading, const QString &text, ButtonCombo buttons, Buttons defaultButton, Icon icon=NoIcon, bool saveCancel=true)
 This function will return the saved user preference (if there is one), or prompt the user for a decision and return the user's choice.
void forgetAllPreferences ()
 Deletes all saved dialog preferences from the registry/XML/ini files.
void showErrorMessageBox (QWidget *parent, const QString &message)
 Displays a modal error message box with "message".

Detailed Description

Responsible for the display of error messages and messages requiring user input with the option to remember the user's preference.

Some message prompts displayed via this namespace contain the option to remember the user's preference. In cases where a user preference can be saved, GCMessageSpace will persist the changes to whatever medium exists on the platform it's running on (Windows registry, Mac XML, Unix ini).

This space is furthermore responsible for the display of all error messages, but not ALL messages (some messages always need to be shown and make more sense implemented in their respective classes)


Enumeration Type Documentation

Determines the combination of buttons that will be shown.

Enumerator:
OKOnly 

Only the "OK" button should be made available.

YesNo 

The buttons shown should be "Yes" and "No".

OKCancel 

The buttons shown should be "OK" and "Cancel".

Definition at line 59 of file gcmessagespace.h.

Represents the individual buttons available.

Definition at line 67 of file gcmessagespace.h.

Determines the type of icon that will be set on the message dialog.

Enumerator:
NoIcon 

No icon will be shown.

Information 

The message is of an informative nature.

Warning 

The message is a warning.

Critical 

The message contains critical information.

Question 

The message is a question and requires user input.

Definition at line 49 of file gcmessagespace.h.


Function Documentation

Deletes all saved dialog preferences from the registry/XML/ini files.

Definition at line 221 of file gcmessagespace.cpp.

void GCMessageSpace::showErrorMessageBox ( QWidget *  parent,
const QString &  message 
)

Displays a modal error message box with "message".

Definition at line 230 of file gcmessagespace.cpp.

bool GCMessageSpace::userAccepted ( const QString &  uniqueMessageKey,
const QString &  heading,
const QString &  text,
ButtonCombo  buttons,
Buttons  defaultButton,
Icon  icon = NoIcon,
bool  saveCancel = true 
)

This function will return the saved user preference (if there is one), or prompt the user for a decision and return the user's choice.

Parameters:
uniqueMessageKey- a unique name representing a specific message, this name is saved to the registry/xml/ini file
heading- the message box header
text- the actual message text
buttons- the buttons that should be displayed for this particular message
defaultButton- the button that should be highlighted as the default
icon- the icon associated with this particular message
saveCancel- if this value is set to "false", "Cancel"-ed user preferences will not be saved, irrespective of whether or not the user ticked the relevant box.

Definition at line 156 of file gcmessagespace.cpp.