More fixes.

work/plasma6
Lana Black 8 months ago
parent 475d200ef3
commit 7ba8f7bbfe

@ -70,6 +70,7 @@ target_link_libraries(latte-dock
KF6::GlobalAccel KF6::GlobalAccel
KF6::I18n KF6::I18n
KF6::IconThemes KF6::IconThemes
KF6::IconWidgets
KF6::KIOWidgets KF6::KIOWidgets
KF6::Notifications KF6::Notifications
KF6::NewStuffWidgets KF6::NewStuffWidgets

@ -27,7 +27,6 @@ public:
} }
} }
Q_DECLARE_METATYPE(Latte::Data::Generic)
Q_DECLARE_METATYPE(Latte::Data::GenericBasicTable) Q_DECLARE_METATYPE(Latte::Data::GenericBasicTable)
#endif #endif

@ -10,6 +10,7 @@
#include "generictable.h" #include "generictable.h"
// Qt // Qt
#include <QMetaType>
#include <QString> #include <QString>
namespace Latte { namespace Latte {
@ -37,6 +38,6 @@ public:
} }
} }
Q_DECLARE_METATYPE(Latte::Data::Generic)
#endif #endif

@ -26,6 +26,8 @@
// KDE // KDE
#include <KIconDialog> #include <KIconDialog>
#include <kmessagebox.h>
#include <qabstractbutton.h>
namespace Latte { namespace Latte {
namespace Settings { namespace Settings {
@ -73,11 +75,15 @@ void DetailsHandler::init()
m_ui->patternClearBtn->setFixedHeight(m_ui->backgroundBtn->height()+2); m_ui->patternClearBtn->setFixedHeight(m_ui->backgroundBtn->height()+2);
connect(m_backButtonsGroup, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), connect(m_backButtonsGroup, &QButtonGroup::buttonToggled,
[ = ](int id, bool checked) { [ this ](QAbstractButton *id, bool checked) {
if (checked) { if (checked) {
setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(id)); // FIXME:
// I've no idea wtf was going on here. This code was likely incorrect to begin with.
Latte::Layout::BackgroundStyle style = id
? Latte::Layout::PatternBackgroundStyle
: Latte::Layout::ColorBackgroundStyle;
setBackgroundStyle(static_cast<Latte::Layout::BackgroundStyle>(style));
} }
}); });
@ -264,11 +270,11 @@ void DetailsHandler::onCurrentLayoutIndexChanged(int row)
if (hasChangedData()) { //new layout was chosen but there are changes if (hasChangedData()) { //new layout was chosen but there are changes
KMessageBox::ButtonCode result = saveChangesConfirmation(); KMessageBox::ButtonCode result = saveChangesConfirmation();
if (result == KMessageBox::Yes) { if (result == KMessageBox::PrimaryAction) {
switchtonewlayout = true; switchtonewlayout = true;
m_lastConfirmedLayoutIndex = row; m_lastConfirmedLayoutIndex = row;
save(); save();
} else if (result == KMessageBox::No) { } else if (result == KMessageBox::SecondaryAction) {
switchtonewlayout = true; switchtonewlayout = true;
m_lastConfirmedLayoutIndex = row; m_lastConfirmedLayoutIndex = row;
} else if (result == KMessageBox::Cancel) { } else if (result == KMessageBox::Cancel) {

@ -141,7 +141,7 @@ void PatternWidget::paintEvent(QPaintEvent *event)
//! it is needed from Qt, otherwise QWidget is not updated //! it is needed from Qt, otherwise QWidget is not updated
//! https://wiki.qt.io/How_to_Change_the_Background_Color_of_QWidget //! https://wiki.qt.io/How_to_Change_the_Background_Color_of_QWidget
QStyleOption opt; QStyleOption opt;
opt.init(this); opt.initFrom(this);
QPainter p(this); QPainter p(this);
p.setRenderHint(QPainter::Antialiasing, true); p.setRenderHint(QPainter::Antialiasing, true);

@ -33,6 +33,7 @@
// Plasma // Plasma
#include <Plasma/Containment> #include <Plasma/Containment>
#include <kmessagebox.h>
namespace Latte { namespace Latte {
namespace Settings { namespace Settings {
@ -294,11 +295,11 @@ void ExportTemplateHandler::save()
bool ExportTemplateHandler::overwriteConfirmation(const QString &fileName) bool ExportTemplateHandler::overwriteConfirmation(const QString &fileName)
{ {
return (KMessageBox::warningYesNo(m_dialog, return (KMessageBox::warningTwoActions(m_dialog,
i18n("The file \"%1\" already exists. Do you wish to overwrite it?", fileName), i18n("The file \"%1\" already exists. Do you wish to overwrite it?", fileName),
i18n("Overwrite File?"), i18n("Overwrite File?"),
KStandardGuiItem::overwrite(), KStandardGuiItem::overwrite(),
KStandardGuiItem::cancel()) == KMessageBox::Yes); KStandardGuiItem::cancel()) == KMessageBox::PrimaryAction);
} }
} }

@ -16,6 +16,7 @@
// KDE // KDE
#include <KMessageBox> #include <KMessageBox>
#include <kmessagebox.h>
namespace Latte { namespace Latte {
namespace Settings { namespace Settings {
@ -129,12 +130,12 @@ void ScreensHandler::save()
bool ScreensHandler::removalConfirmation(const QStringList &screens) const bool ScreensHandler::removalConfirmation(const QStringList &screens) const
{ {
return (KMessageBox::warningYesNo(m_dialog, return (KMessageBox::warningContinueCancel(m_dialog,
i18np("You are going to <b>remove %2</b> reference completely.<br/>Would you like to continue?", i18np("You are going to <b>remove %2</b> reference completely.<br/>Would you like to continue?",
"You are going to <b>remove %2</b> references completely.<br/>Would you like to continue?", "You are going to <b>remove %2</b> references completely.<br/>Would you like to continue?",
screens.count(), screens.count(),
screens.join(", ")), screens.join(", ")),
i18n("Approve Removal")) == KMessageBox::Yes); i18n("Approve Removal")) == KMessageBox::PrimaryAction);
} }
} }

Loading…
Cancel
Save