#include <cachingguiserver.h>
Public Member Functions | |
CachingGuiServer (GuiServer_Interface *) | |
void | message (const QString &title, const QString &text) const |
bool | messageYesNo (const QString &title, const QString &text) const |
bool | messageOkCancel (const QString &title, const QString &text) const |
double | getDouble (const QString &title, const QString &text, double, double, double) const |
int | getInt (const QString &, const QString &, int, int, int) const |
QString | getString (const QString &title, const QString &label, const QString &initvalue) const |
QString | getItem (const QString &title, const QString &label, const QStringList &list) const |
QString | getItem (const QString &title, const QString &desc, const QList< ListItem > items) const |
QString | getFileName (const QString &title, const QString &dir, const QString &filter, const FileType &) |
Private Attributes | |
GuiServer_Interface * | _gui |
struct { | |
uint last | |
QString title | |
QString text | |
} | _msg_cache |
struct { | |
uint last | |
QString title | |
QString text | |
bool ret | |
} | _msgOkCancel_cache |
struct { | |
uint last | |
QString title | |
QString text | |
double value | |
double min | |
double max | |
double ret | |
} | _getDouble_cache |
struct { | |
uint last | |
QString title | |
QString text | |
int value | |
int min | |
int max | |
int ret | |
} | _getInt_cache |
struct { | |
uint last | |
QString title | |
QString text | |
QString value | |
QString ret | |
} | _getString_cache |
struct { | |
uint last | |
QString title | |
QString text | |
QString ret | |
QStringList list | |
} | _getItemStringList_cache |
struct { | |
uint last | |
QString title | |
QString text | |
QString ret | |
QList< ListItem > list | |
} | _getItem_cache |
struct { | |
uint last | |
QString title | |
QString dir | |
QString filter | |
QString ret | |
FileType type | |
} | _getFileName_cache |
When using the same tree of objects in multiple threads, the same questions for the gui will be asked. This class caches the results of the first question and gives the result to the subsequent questions.
Which means when one question is asked two times in a row (by multiple objects in different threads on user interaction) the user will be asked only once.
NSCore::CachingGuiServer::CachingGuiServer | ( | GuiServer_Interface * | ) |
void NSCore::CachingGuiServer::message | ( | const QString & | title, | |
const QString & | text | |||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
bool NSCore::CachingGuiServer::messageYesNo | ( | const QString & | title, | |
const QString & | text | |||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
bool NSCore::CachingGuiServer::messageOkCancel | ( | const QString & | title, | |
const QString & | text | |||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
double NSCore::CachingGuiServer::getDouble | ( | const QString & | title, | |
const QString & | text, | |||
double | , | |||
double | , | |||
double | ||||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
int NSCore::CachingGuiServer::getInt | ( | const QString & | , | |
const QString & | , | |||
int | , | |||
int | , | |||
int | ||||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
QString NSCore::CachingGuiServer::getString | ( | const QString & | title, | |
const QString & | label, | |||
const QString & | initvalue | |||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
QString NSCore::CachingGuiServer::getItem | ( | const QString & | title, | |
const QString & | label, | |||
const QStringList & | list | |||
) | const [virtual] |
Implements NSCore::GuiServer_Interface.
QString NSCore::CachingGuiServer::getItem | ( | const QString & | title, | |
const QString & | desc, | |||
const QList< ListItem > | items | |||
) | const |
QString NSCore::CachingGuiServer::getFileName | ( | const QString & | title, | |
const QString & | dir, | |||
const QString & | filter, | |||
const FileType & | ||||
) | [virtual] |
Implements NSCore::GuiServer_Interface.
QString NSCore::CachingGuiServer::title |
QString NSCore::CachingGuiServer::text |
struct { ... } NSCore::CachingGuiServer::_msg_cache [private] |
struct { ... } NSCore::CachingGuiServer::_msgOkCancel_cache [private] |
struct { ... } NSCore::CachingGuiServer::_getDouble_cache [private] |
struct { ... } NSCore::CachingGuiServer::_getInt_cache [private] |
QString NSCore::CachingGuiServer::value |
QString NSCore::CachingGuiServer::ret |
struct { ... } NSCore::CachingGuiServer::_getString_cache [private] |
QStringList NSCore::CachingGuiServer::list |
struct { ... } NSCore::CachingGuiServer::_getItemStringList_cache [private] |
QList<ListItem> NSCore::CachingGuiServer::list |
struct { ... } NSCore::CachingGuiServer::_getItem_cache [private] |
QString NSCore::CachingGuiServer::dir |
QString NSCore::CachingGuiServer::filter |
struct { ... } NSCore::CachingGuiServer::_getFileName_cache [private] |