Public Member Functions | |
void | init (const QString &message=QString()) |
QString | key () const |
QString | applicationName () const |
QString | organizationName () const |
int | showAgain () |
void | doNotShowAgain (int result) |
void | reset () |
Public Attributes | |
bool | remember |
QCheckBox * | confirm |
QString | overrideApp |
QString | overrideKey |
QString | overrideOrg |
Static Public Attributes | |
static QString | path |
static QSettings::Scope | scope = QSettings::UserScope |
static QSettings::Format | format = QSettings::NativeFormat |
Friends | |
class | QxtConfirmationMessage |
Definition at line 38 of file qxtconfirmationmessage.cpp.
QString QxtConfirmationMessagePrivate::applicationName | ( | ) | const |
Definition at line 107 of file qxtconfirmationmessage.cpp.
References DEFAULT_APPLICATION(), and overrideApp.
Referenced by doNotShowAgain(), reset(), and showAgain().
{ QString name = overrideApp; if (name.isEmpty()) name = QCoreApplication::applicationName(); if (name.isEmpty()) name = DEFAULT_APPLICATION; return name; }
void QxtConfirmationMessagePrivate::doNotShowAgain | ( | int | result ) |
Definition at line 135 of file qxtconfirmationmessage.cpp.
References applicationName(), format, key(), organizationName(), path, and scope.
{ QSettings settings(format, scope, organizationName(), applicationName()); if (!path.isEmpty()) settings.beginGroup(path); settings.setValue(key(), result); }
void QxtConfirmationMessagePrivate::init | ( | const QString & | message = QString() ) |
Definition at line 67 of file qxtconfirmationmessage.cpp.
References confirm, QxtPrivate< QxtConfirmationMessage >::qxt_p(), and remember.
{ remember = false; #if QT_VERSION >= 0x040200 confirm = new QCheckBox(&qxt_p()); if (!message.isNull()) confirm->setText(message); else confirm->setText(QxtConfirmationMessage::tr("Do not show again.")); QGridLayout* grid = qobject_cast<QGridLayout*>(qxt_p().layout()); QDialogButtonBox* buttons = qFindChild<QDialogButtonBox*>(&qxt_p()); if (grid && buttons) { const int idx = grid->indexOf(buttons); int row, column, rowSpan, columnSpan = 0; grid->getItemPosition(idx, &row, &column, &rowSpan, &columnSpan); QLayoutItem* buttonsItem = grid->takeAt(idx); grid->addWidget(confirm, row, column, rowSpan, columnSpan, Qt::AlignLeft | Qt::AlignTop); grid->addItem(buttonsItem, ++row, column, rowSpan, columnSpan); } #endif // QT_VERSION }
QString QxtConfirmationMessagePrivate::key | ( | ) | const |
Definition at line 91 of file qxtconfirmationmessage.cpp.
References overrideKey, and QxtPrivate< QxtConfirmationMessage >::qxt_p().
Referenced by doNotShowAgain(), reset(), and showAgain().
{ QString value = overrideKey; if (value.isEmpty()) { const QString all = qxt_p().windowTitle() + qxt_p().text() #if QT_VERSION >= 0x040200 + qxt_p().informativeText() #endif // QT_VERSION ; const QByteArray data = all.toLocal8Bit(); value = QString::number(qChecksum(data.constData(), data.length())); } return value; }
QString QxtConfirmationMessagePrivate::organizationName | ( | ) | const |
Definition at line 117 of file qxtconfirmationmessage.cpp.
References DEFAULT_ORGANIZATION(), and overrideOrg.
Referenced by doNotShowAgain(), reset(), and showAgain().
{ QString name = overrideOrg; if (name.isEmpty()) name = QCoreApplication::organizationName(); if (name.isEmpty()) name = DEFAULT_ORGANIZATION; return name; }
void QxtConfirmationMessagePrivate::reset | ( | ) |
Definition at line 143 of file qxtconfirmationmessage.cpp.
References applicationName(), format, key(), organizationName(), path, and scope.
{ QSettings settings(format, scope, organizationName(), applicationName()); if (!path.isEmpty()) settings.beginGroup(path); settings.remove(key()); }
int QxtConfirmationMessagePrivate::showAgain | ( | ) |
Definition at line 127 of file qxtconfirmationmessage.cpp.
References applicationName(), format, key(), organizationName(), path, and scope.
{ QSettings settings(format, scope, organizationName(), applicationName()); if (!path.isEmpty()) settings.beginGroup(path); return settings.value(key(), -1).toInt(); }
friend class QxtConfirmationMessage [friend] |
Definition at line 41 of file qxtconfirmationmessage.cpp.
QCheckBox* QxtConfirmationMessagePrivate::confirm |
Definition at line 53 of file qxtconfirmationmessage.cpp.
Referenced by init().
QSettings::Format QxtConfirmationMessagePrivate::format = QSettings::NativeFormat [static] |
Definition at line 60 of file qxtconfirmationmessage.cpp.
Referenced by doNotShowAgain(), reset(), and showAgain().
Definition at line 54 of file qxtconfirmationmessage.cpp.
Referenced by applicationName().
Definition at line 55 of file qxtconfirmationmessage.cpp.
Referenced by key().
Definition at line 56 of file qxtconfirmationmessage.cpp.
Referenced by organizationName().
QString QxtConfirmationMessagePrivate::path [static] |
Definition at line 58 of file qxtconfirmationmessage.cpp.
Referenced by doNotShowAgain(), reset(), and showAgain().
Definition at line 52 of file qxtconfirmationmessage.cpp.
Referenced by init().
QSettings::Scope QxtConfirmationMessagePrivate::scope = QSettings::UserScope [static] |
Definition at line 59 of file qxtconfirmationmessage.cpp.
Referenced by doNotShowAgain(), reset(), and showAgain().