1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-23 13:33:50 +03:00

remove deprecated code from settings dialog

This commit is contained in:
Michail Vourlakos 2020-03-15 16:28:29 +02:00
parent 45e3531ad3
commit d418abbeb4
2 changed files with 11 additions and 27 deletions

View File

@ -44,6 +44,7 @@
#include <QTemporaryDir>
// KDE
#include <KActivities/Controller>
#include <KArchive/KTar>
#include <KArchive/KArchiveEntry>
#include <KArchive/KArchiveDirectory>
@ -138,6 +139,13 @@ void Layouts::initView()
m_view->setItemDelegateForColumn(Model::Layouts::BORDERSCOLUMN, new Settings::Layout::Delegate::CheckBox(this));
m_view->setItemDelegateForColumn(Model::Layouts::ACTIVITYCOLUMN, new Settings::Layout::Delegate::Activities(this));
m_view->setItemDelegateForColumn(Model::Layouts::SHAREDCOLUMN, new Settings::Layout::Delegate::Shared(this));
//! update all layouts view when runningActivities changed. This way we update immediately
//! the running Activities in Activities checkboxes which are shown as bold
connect(m_corona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged,
this, [&]() {
m_view->update();
});
}
bool Layouts::dataAreChanged() const

View File

@ -41,19 +41,12 @@
#include <QDesktopServices>
#include <QDir>
#include <QFileDialog>
#include <QHeaderView>
#include <QMenuBar>
#include <QMessageBox>
#include <QProcess>
#include <QStandardItem>
#include <QStandardItemModel>
#include <QTemporaryDir>
// KDE
#include <KActivities/Controller>
#include <KArchive/KTar>
#include <KArchive/KArchiveEntry>
#include <KArchive/KArchiveDirectory>
#include <KLocalizedString>
#include <KNotification>
#include <KWindowSystem>
@ -61,19 +54,9 @@
namespace Latte {
const int IDCOLUMN = 0;
const int HIDDENTEXTCOLUMN = 1;
const int COLORCOLUMN = 2;
const int NAMECOLUMN = 3;
const int MENUCOLUMN = 4;
const int BORDERSCOLUMN = 5;
const int ACTIVITYCOLUMN = 6;
const int SHAREDCOLUMN = 7;
const int SCREENTRACKERDEFAULTVALUE = 2500;
const int OUTLINEDEFAULTWIDTH = 1;
const QChar CheckMark{0x2714};
SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
: QDialog(parent),
@ -208,9 +191,9 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
bool noBordersForMaximized = ui->noBordersForMaximizedChkBox->isChecked();
if (noBordersForMaximized) {
ui->layoutsView->setColumnHidden(BORDERSCOLUMN, false);
ui->layoutsView->setColumnHidden(Settings::Model::Layouts::BORDERSCOLUMN, false);
} else {
ui->layoutsView->setColumnHidden(BORDERSCOLUMN, true);
ui->layoutsView->setColumnHidden(Settings::Model::Layouts::BORDERSCOLUMN, true);
}
updateApplyButtonsState();
@ -232,13 +215,6 @@ SettingsDialog::SettingsDialog(QWidget *parent, Latte::Corona *corona)
connect(infoLayoutAction, &QAction::triggered, this, &SettingsDialog::showLayoutInformation);
connect(screensAction, &QAction::triggered, this, &SettingsDialog::showScreensInformation);
//! update all layouts view when runningActivities changed. This way we update immediately
//! the running Activities in Activities checkboxes which are shown as bold
connect(m_corona->activitiesConsumer(), &KActivities::Consumer::runningActivitiesChanged,
this, [&]() {
ui->layoutsView->update();
});
blockDeleteOnActivityStopped();
}
@ -581,7 +557,7 @@ void SettingsDialog::requestImagesDialog(int row)
void SettingsDialog::requestColorsDialog(int row)
{
QColorDialog dialog(this);
QString textColor = m_model->data(m_model->index(row, COLORCOLUMN), Qt::UserRole).toString();
QString textColor = m_model->data(m_model->index(row, Settings::Model::Layouts::BACKGROUNDCOLUMN), Qt::UserRole).toString();
dialog.setCurrentColor(QColor(textColor));
if (dialog.exec()) {