mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kdeui: format and indent
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9d2994fad0
commit
093ad1d84d
2 changed files with 865 additions and 926 deletions
|
@ -109,7 +109,7 @@ static QIcon themedMessageBoxIcon(QMessageBox::Icon icon)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sendNotification( QString message, //krazy:exclude=passbyvalue
|
static void sendNotification( QString message,
|
||||||
const QStringList& strlist,
|
const QStringList& strlist,
|
||||||
QMessageBox::Icon icon,
|
QMessageBox::Icon icon,
|
||||||
WId parent_id )
|
WId parent_id )
|
||||||
|
@ -983,32 +983,34 @@ void KMessageBox::informationList(QWidget *parent,const QString &text, const QSt
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::informationListWId(WId parent_id,const QString &text, const QStringList & strlist,
|
void KMessageBox::informationListWId(WId parent_id,const QString &text, const QStringList & strlist,
|
||||||
const QString &caption, const QString &dontShowAgainName, Options options)
|
const QString &caption, const QString &dontShowAgainName, Options options)
|
||||||
{
|
{
|
||||||
if ( !shouldBeShownContinue(dontShowAgainName) ) {
|
if (!shouldBeShownContinue(dontShowAgainName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget* parent = QWidget::find( parent_id );
|
QWidget* parent = QWidget::find( parent_id );
|
||||||
KDialog *dialog = new KDialog(parent, Qt::Dialog);
|
KDialog *dialog = new KDialog(parent, Qt::Dialog);
|
||||||
dialog->setCaption( caption.isEmpty() ? i18n("Information") : caption );
|
dialog->setCaption(caption.isEmpty() ? i18n("Information") : caption);
|
||||||
dialog->setButtons( KDialog::Ok );
|
dialog->setButtons(KDialog::Ok);
|
||||||
dialog->setObjectName( "information" );
|
dialog->setObjectName("information");
|
||||||
dialog->setDefaultButton( KDialog::Ok );
|
dialog->setDefaultButton(KDialog::Ok);
|
||||||
dialog->setEscapeButton( KDialog::Ok);
|
dialog->setEscapeButton(KDialog::Ok);
|
||||||
applyOptions( dialog, options );
|
applyOptions( dialog, options );
|
||||||
if ( options & KMessageBox::PlainCaption ) {
|
if (options & KMessageBox::PlainCaption) {
|
||||||
dialog->setWindowTitle( caption );
|
dialog->setWindowTitle(caption);
|
||||||
}
|
}
|
||||||
if ( parent == NULL && parent_id ) {
|
if (!parent && parent_id) {
|
||||||
KWindowSystem::setMainWindow( dialog, parent_id );
|
KWindowSystem::setMainWindow(dialog, parent_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool checkboxResult = false;
|
bool checkboxResult = false;
|
||||||
|
|
||||||
createKMessageBox(dialog, QMessageBox::Information, text, strlist,
|
createKMessageBox(
|
||||||
dontShowAgainName.isEmpty() ? QString() : i18n("Do not show this message again"),
|
dialog, QMessageBox::Information, text, strlist,
|
||||||
&checkboxResult, options);
|
dontShowAgainName.isEmpty() ? QString() : i18n("Do not show this message again"),
|
||||||
|
&checkboxResult, options
|
||||||
|
);
|
||||||
|
|
||||||
if (checkboxResult) {
|
if (checkboxResult) {
|
||||||
saveDontShowAgainContinue(dontShowAgainName);
|
saveDontShowAgainContinue(dontShowAgainName);
|
||||||
|
@ -1036,15 +1038,14 @@ void KMessageBox::enableAllMessages()
|
||||||
|
|
||||||
void KMessageBox::enableMessage(const QString &dontShowAgainName)
|
void KMessageBox::enableMessage(const QString &dontShowAgainName)
|
||||||
{
|
{
|
||||||
KConfig *config = KMessageBox_againConfig ? KMessageBox_againConfig : KGlobal::config().data();
|
KConfig *config = KMessageBox_againConfig ? KMessageBox_againConfig : KGlobal::config().data();
|
||||||
if (!config->hasGroup("Notification Messages")) {
|
if (!config->hasGroup("Notification Messages")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KConfigGroup cg( config, "Notification Messages" );
|
KConfigGroup cg(config, "Notification Messages");
|
||||||
|
cg.deleteEntry(dontShowAgainName);
|
||||||
cg.deleteEntry(dontShowAgainName);
|
config->sync();
|
||||||
config->sync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::about(QWidget *parent, const QString &text,
|
void KMessageBox::about(QWidget *parent, const QString &text,
|
||||||
|
@ -1070,71 +1071,92 @@ void KMessageBox::about(QWidget *parent, const QString &text,
|
||||||
createKMessageBox(dialog, qApp->windowIcon(), text, QStringList(), QString(), 0, options);
|
createKMessageBox(dialog, qApp->windowIcon(), text, QStringList(), QString(), 0, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
int KMessageBox::messageBox( QWidget *parent, DialogType type, const QString &text,
|
int KMessageBox::messageBox(QWidget *parent, DialogType type, const QString &text,
|
||||||
const QString &caption, const KGuiItem &buttonYes,
|
const QString &caption, const KGuiItem &buttonYes,
|
||||||
const KGuiItem &buttonNo, const KGuiItem &buttonCancel,
|
const KGuiItem &buttonNo, const KGuiItem &buttonCancel,
|
||||||
const QString &dontShowAskAgainName, Options options )
|
const QString &dontShowAskAgainName, Options options)
|
||||||
{
|
{
|
||||||
return messageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, caption,
|
return messageBoxWId(
|
||||||
buttonYes, buttonNo, buttonCancel, dontShowAskAgainName, options );
|
parent ? parent->effectiveWinId() : 0, type, text, caption,
|
||||||
|
buttonYes, buttonNo, buttonCancel, dontShowAskAgainName, options
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
int KMessageBox::messageBoxWId( WId parent_id, DialogType type, const QString &text,
|
int KMessageBox::messageBoxWId(WId parent_id, DialogType type, const QString &text,
|
||||||
const QString &caption, const KGuiItem &buttonYes,
|
const QString &caption, const KGuiItem &buttonYes,
|
||||||
const KGuiItem &buttonNo, const KGuiItem &buttonCancel,
|
const KGuiItem &buttonNo, const KGuiItem &buttonCancel,
|
||||||
const QString &dontShow, Options options )
|
const QString &dontShow, Options options)
|
||||||
{
|
{
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QuestionYesNo:
|
case QuestionYesNo: {
|
||||||
return KMessageBox::questionYesNoWId( parent_id,
|
return KMessageBox::questionYesNoWId(
|
||||||
text, caption, buttonYes, buttonNo, dontShow, options );
|
parent_id,
|
||||||
case QuestionYesNoCancel:
|
text, caption, buttonYes, buttonNo, dontShow, options
|
||||||
return KMessageBox::questionYesNoCancelWId( parent_id,
|
);
|
||||||
text, caption, buttonYes, buttonNo, buttonCancel, dontShow, options );
|
}
|
||||||
case WarningYesNo:
|
case QuestionYesNoCancel: {
|
||||||
return KMessageBox::warningYesNoWId( parent_id,
|
return KMessageBox::questionYesNoCancelWId(
|
||||||
text, caption, buttonYes, buttonNo, dontShow, options );
|
parent_id,
|
||||||
|
text, caption, buttonYes, buttonNo, buttonCancel, dontShow, options
|
||||||
|
);
|
||||||
|
}
|
||||||
|
case WarningYesNo: {
|
||||||
|
return KMessageBox::warningYesNoWId(
|
||||||
|
parent_id,
|
||||||
|
text, caption, buttonYes, buttonNo, dontShow, options
|
||||||
|
);
|
||||||
|
}
|
||||||
case WarningContinueCancel:
|
case WarningContinueCancel:
|
||||||
return KMessageBox::warningContinueCancelWId( parent_id,
|
return KMessageBox::warningContinueCancelWId(
|
||||||
text, caption, KGuiItem(buttonYes.text()), buttonCancel, dontShow, options );
|
parent_id,
|
||||||
|
text, caption, KGuiItem(buttonYes.text()), buttonCancel, dontShow, options
|
||||||
|
);
|
||||||
case WarningYesNoCancel:
|
case WarningYesNoCancel:
|
||||||
return KMessageBox::warningYesNoCancelWId( parent_id,
|
return KMessageBox::warningYesNoCancelWId(
|
||||||
text, caption, buttonYes, buttonNo, buttonCancel, dontShow, options );
|
parent_id,
|
||||||
|
text, caption, buttonYes, buttonNo, buttonCancel, dontShow, options
|
||||||
|
);
|
||||||
case Information:
|
case Information:
|
||||||
KMessageBox::informationWId( parent_id,
|
KMessageBox::informationWId(parent_id, text, caption, dontShow, options);
|
||||||
text, caption, dontShow, options );
|
|
||||||
return KMessageBox::Ok;
|
return KMessageBox::Ok;
|
||||||
|
|
||||||
case Error:
|
case Error:
|
||||||
KMessageBox::errorWId( parent_id, text, caption, options );
|
KMessageBox::errorWId(parent_id, text, caption, options);
|
||||||
return KMessageBox::Ok;
|
return KMessageBox::Ok;
|
||||||
|
|
||||||
case Sorry:
|
case Sorry:
|
||||||
KMessageBox::sorryWId( parent_id, text, caption, options );
|
KMessageBox::sorryWId(parent_id, text, caption, options);
|
||||||
return KMessageBox::Ok;
|
return KMessageBox::Ok;
|
||||||
}
|
}
|
||||||
return KMessageBox::Cancel;
|
return KMessageBox::Cancel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::queuedMessageBox( QWidget *parent, DialogType type, const QString &text, const QString &caption, Options options )
|
void KMessageBox::queuedMessageBox(QWidget *parent, DialogType type, const QString &text,
|
||||||
|
const QString &caption, Options options)
|
||||||
{
|
{
|
||||||
return queuedMessageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, caption, options );
|
return queuedMessageBoxWId(parent ? parent->effectiveWinId() : 0, type, text, caption, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::queuedMessageBoxWId( WId parent_id, DialogType type, const QString &text, const QString &caption, Options options )
|
void KMessageBox::queuedMessageBoxWId(WId parent_id, DialogType type, const QString &text,
|
||||||
|
const QString &caption, Options options )
|
||||||
{
|
{
|
||||||
KMessageBox_queue = true;
|
KMessageBox_queue = true;
|
||||||
(void) messageBoxWId(parent_id, type, text, caption, KStandardGuiItem::yes(),
|
(void) messageBoxWId(
|
||||||
KStandardGuiItem::no(), KStandardGuiItem::cancel(), QString(), options);
|
parent_id,
|
||||||
|
type, text, caption, KStandardGuiItem::yes(),
|
||||||
|
KStandardGuiItem::no(), KStandardGuiItem::cancel(), QString(), options
|
||||||
|
);
|
||||||
KMessageBox_queue = false;
|
KMessageBox_queue = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::queuedMessageBox( QWidget *parent, DialogType type, const QString &text, const QString &caption )
|
void KMessageBox::queuedMessageBox(QWidget *parent, DialogType type, const QString &text,
|
||||||
|
const QString &caption)
|
||||||
{
|
{
|
||||||
return queuedMessageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, caption );
|
return queuedMessageBoxWId( parent ? parent->effectiveWinId() : 0, type, text, caption);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KMessageBox::queuedMessageBoxWId( WId parent_id, DialogType type, const QString &text, const QString &caption )
|
void KMessageBox::queuedMessageBoxWId(WId parent_id, DialogType type, const QString &text,
|
||||||
|
const QString &caption)
|
||||||
{
|
{
|
||||||
KMessageBox_queue = true;
|
KMessageBox_queue = true;
|
||||||
(void) messageBoxWId(parent_id, type, text, caption);
|
(void) messageBoxWId(parent_id, type, text, caption);
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue