KIO
widgetsaskuseractionhandler.cpp
40 bool gotPersistentUserReply(KIO::AskUserActionInterface::MessageDialogType type, const KConfigGroup &cg, const QString &dontAskAgainName);
41 void savePersistentUserReply(KIO::AskUserActionInterface::MessageDialogType type, KConfigGroup &cg, const QString &dontAskAgainName, int result);
50bool KIO::WidgetsAskUserActionHandlerPrivate::gotPersistentUserReply(KIO::AskUserActionInterface::MessageDialogType type,
54 // storage values matching the logic of FrameworkIntegration's KMessageBoxDontAskAgainConfigStorage
63 if ((value.compare(QLatin1String("yes"), Qt::CaseInsensitive) == 0) || (value.compare(QLatin1String("true"), Qt::CaseInsensitive) == 0)) {
67 if ((value.compare(QLatin1String("no"), Qt::CaseInsensitive) == 0) || (value.compare(QLatin1String("false"), Qt::CaseInsensitive) == 0)) {
90void KIO::WidgetsAskUserActionHandlerPrivate::savePersistentUserReply(KIO::AskUserActionInterface::MessageDialogType type,
165 auto *dlg = new KIO::RenameDialog(d->getParentWidget(job), title, src, dest, options, sizeSrc, sizeDest, ctimeSrc, ctimeDest, mtimeSrc, mtimeDest);
181void KIO::WidgetsAskUserActionHandler::askUserSkip(KJob *job, KIO::SkipDialog_Options options, const QString &errorText)
208static ProcessAskDeleteResult processAskDelete(const QList<QUrl> &urls, AskIface::DeletionType deletionType)
212 std::transform(urls.cbegin(), urls.cend(), std::back_inserter(res.prettyList), [](const auto &url) {
230 res.dialogType = KMessageDialog::QuestionTwoActions; // Using Question* so the Delete button is pre-selected. Bug 462845
246 res.acceptButton = KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete"));
268 res.acceptButton = KGuiItem(i18nc("@action:button", "Delete Permanently"), QStringLiteral("edit-delete"));
272 res.dialogType = KMessageDialog::QuestionTwoActions; // Using Question* so the Delete button is pre-selected.
277 res.acceptButton = KGuiItem(i18nc("@action:button", "Empty Trash"), QStringLiteral("user-trash"));
288 xi18ncp("@info", "Do you really want to move this %1 item to the Trash?", "Do you really want to move these %1 items to the Trash?", urlCount);
300void KIO::WidgetsAskUserActionHandler::askUserDelete(const QList<QUrl> &urls, DeletionType deletionType, ConfirmationType confirmationType, QWidget *parent)
324 KSharedConfigPtr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
334 const auto &[prettyList, dialogType, acceptButton, text, icon, title, singleUrl] = processAskDelete(urls, deletionType);
353 KSharedConfigPtr kioConfig = KSharedConfig::openConfig(QStringLiteral("kiorc"), KConfig::NoGlobals);
377 KSharedConfig::openConfig(QStringLiteral("kioslaverc"))->group(QStringLiteral("Notification Messages")),
478void KIO::WidgetsAskUserActionHandler::askIgnoreSslErrors(const QVariantMap &sslErrorData, QWidget *parent)
482 QString message = i18n("The server failed the authenticity check (%1).\n\n", sslErrorData[QLatin1String("hostname")].toString());
486 auto *dialog = new KMessageDialog(KMessageDialog::WarningTwoActionsCancel, message, parentWidget);
491 dialog->setButtons(KGuiItem{i18n("&Details"), QStringLiteral("documentinfo")}, KStandardGuiItem::cont(), KStandardGuiItem::cancel());
493 connect(dialog, &KMessageDialog::finished, this, [this, parentWidget, sslErrorData](int result) {
508void KIO::WidgetsAskUserActionHandler::showSslDetails(const QVariantMap &sslErrorData, QWidget *parentWidget)
533 KSslInfoDialog::certificateErrorsFromString(sslErrorData[QLatin1String("certificateErrors")].toStringList().join(QLatin1Char('\n'))));
547 auto *dialog = new KMessageDialog(KMessageDialog::Information, i18n("The peer SSL certificate chain appears to be corrupt."), parentWidget);
void writeEntry(const char *key, const char *value, WriteConfigFlags pFlags=Normal)
QString readEntry(const char *key, const char *aDefault=nullptr) const
bool sync() override
NoGlobals
The AskUserActionInterface class allows a KIO::Job to prompt the user for a decision when e....
MessageDialogType
Definition askuseractioninterface.h:161
@ WarningTwoActions
Definition askuseractioninterface.h:164
@ QuestionTwoActions
Definition askuseractioninterface.h:162
@ WarningTwoActionsCancel
Definition askuseractioninterface.h:165
@ QuestionTwoActionsCancel
Definition askuseractioninterface.h:163
@ Trash
Delete the files/directories directly, i.e. without moving them to Trash.
Definition askuseractioninterface.h:116
void messageBoxResult(int result)
Implementations of this interface must emit this signal when the dialog invoked by requestUserMessage...
MetaData is a simple map of key/value strings.
The dialog shown when a CopyJob realizes that a destination file already exists, and wants to offer t...
Definition skipdialog.h:24
void askUserSkip(KJob *job, KIO::SkipDialog_Options options, const QString &error_text) override
You need to connect to the askUserSkipResult signal to get the dialog's result.
Definition widgetsaskuseractionhandler.cpp:181
void askUserDelete(const QList< QUrl > &urls, DeletionType deletionType, ConfirmationType confirmationType, QWidget *parent=nullptr) override
Ask for confirmation before moving urls (files/directories) to the Trash, emptying the Trash,...
Definition widgetsaskuseractionhandler.cpp:300
void requestUserMessageBox(MessageDialogType type, const QString &text, const QString &title, const QString &primaryActionText, const QString &secondaryActionText, const QString &primaryActionIconName={}, const QString &secondaryActionIconName={}, const QString &dontAskAgainName={}, const QString &details={}, QWidget *parent=nullptr) override
This function allows for the delegation of user prompts from the KIO worker.
Definition widgetsaskuseractionhandler.cpp:365
void askUserRename(KJob *job, const QString &title, const QUrl &src, const QUrl &dest, KIO::RenameDialog_Options options, KIO::filesize_t sizeSrc=KIO::filesize_t(-1), KIO::filesize_t sizeDest=KIO::filesize_t(-1), const QDateTime &ctimeSrc={}, const QDateTime &ctimeDest={}, const QDateTime &mtimeSrc={}, const QDateTime &mtimeDest={}) override
Constructs a modal, parent-less "rename" dialog, to prompt the user for a decision in case of conflic...
Definition widgetsaskuseractionhandler.cpp:152
void finished(KJob *job)
bool isDontAskAgainChecked() const
void setListWidgetItems(const QStringList &strlist)
void setIcon(const QIcon &icon)
void setButtons(const KGuiItem &primaryAction=KGuiItem(), const KGuiItem &secondaryAction=KGuiItem(), const KGuiItem &cancelAction=KGuiItem())
void setDontAskAgainChecked(bool isChecked)
void setDontAskAgainText(const QString &dontAskAgainText)
QuestionTwoActions
WarningTwoActions
WarningTwoActionsCancel
QuestionTwoActionsCancel
WarningContinueCancel
Information
PrimaryAction
SecondaryAction
Cancel
void setCaption(const QString &caption)
void setSslInfo(const QList< QSslCertificate > &certificateChain, const QString &ip, const QString &host, const QString &sslProtocol, const QString &cipher, int usedBits, int bits, const QList< QList< QSslError::SslError > > &validationErrors)
Set information to display about the SSL connection.
Definition ksslinfodialog.cpp:102
static QList< QList< QSslError::SslError > > certificateErrorsFromString(const QString &errorsString)
Converts certificate errors as provided in the "ssl_cert_errors" meta data to a list of QSslError::Ss...
Definition ksslinfodialog.cpp:180
QString xi18ncp(const char *context, const char *singular, const char *plural, const TYPE &arg...)
QString xi18nc(const char *context, const char *text, const TYPE &arg...)
QString i18nc(const char *context, const char *text, const TYPE &arg...)
QString i18n(const char *text, const TYPE &arg...)
char * toString(const EngineQuery &query)
bool KIOWIDGETS_EXPORT askIgnoreSslErrors(const KSslErrorUiData &uiData, RulesStorage storedRules=RecallAndStoreRules)
If there are errors while establishing an SSL encrypted connection to a peer, usually due to certific...
Definition sslui.cpp:16
QWidget * window(QObject *job)
KGuiItem cont()
KGuiItem cancel()
KGuiItem ok()
void finished(int result)
virtual void reject()
QIcon fromTheme(const QString &name)
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
const_iterator cbegin() const const
const_iterator cend() const const
T & last()
void reserve(qsizetype size)
qsizetype size() const const
bool invokeMethod(QObject *context, Functor &&function, FunctorReturnType *ret)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
int compare(QLatin1StringView s1, const QString &s2, Qt::CaseSensitivity cs)
CaseInsensitive
WA_DeleteOnClose
WindowModal
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
void setAttribute(Qt::WidgetAttribute attribute, bool on)
void show()
void setWindowModality(Qt::WindowModality windowModality)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:28 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.