1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-27 06:03:51 +03:00

rename function in settings handler

This commit is contained in:
Michail Vourlakos 2021-02-10 19:10:24 +02:00
parent 6f58d09d06
commit c57a69ae05
17 changed files with 28 additions and 28 deletions

View File

@ -76,7 +76,7 @@ Latte::Corona *DetailsDialog::corona() const
void DetailsDialog::updateApplyButtonsState()
{
if (m_handler->dataAreChanged()) {
if (m_handler->hasChangedData()) {
m_ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true);
m_ui->buttonBox->button(QDialogButtonBox::Reset)->setEnabled(true);
} else {

View File

@ -200,7 +200,7 @@ Latte::Data::Layout DetailsHandler::currentData() const
return c_data;
}
bool DetailsHandler::dataAreChanged() const
bool DetailsHandler::hasChangedData() const
{
return o_data != c_data;
}
@ -249,7 +249,7 @@ void DetailsHandler::onCurrentLayoutIndexChanged(int row)
{
bool switchtonewlayout{true};
if (dataAreChanged()) {
if (hasChangedData()) {
int result = saveChanges();
if (result == QMessageBox::Apply) {
@ -395,7 +395,7 @@ void DetailsHandler::updateWindowTitle()
int DetailsHandler::saveChanges()
{
if (dataAreChanged()) {
if (hasChangedData()) {
QString layoutName = c_data.name;
QString saveChangesText = i18n("The settings of <b>%0</b> layout have changed. Do you want to apply the changes or discard them?").arg(layoutName);

View File

@ -66,7 +66,7 @@ public:
DetailsHandler(Dialog::DetailsDialog *parentDialog);
~DetailsHandler();
bool dataAreChanged() const override;
bool hasChangedData() const override;
bool inDefaultValues() const override;
void reset() override;

View File

@ -51,7 +51,7 @@ Applets::~Applets()
{
}
bool Applets::dataAreChanged() const
bool Applets::hasChangedData() const
{
return c_applets != o_applets;
}

View File

@ -56,7 +56,7 @@ public:
explicit Applets(QObject *parent);
~Applets();
bool dataAreChanged() const;
bool hasChangedData() const;
int rowCount() const;
int rowCount(const QModelIndex &parent) const override;

View File

@ -121,14 +121,14 @@ void ExportTemplateHandler::onDeselectAll()
m_appletsModel->deselectAll();
}
bool ExportTemplateHandler::dataAreChanged() const
bool ExportTemplateHandler::hasChangedData() const
{
return m_appletsModel->dataAreChanged();
return m_appletsModel->hasChangedData();
}
bool ExportTemplateHandler::inDefaultValues() const
{
return !dataAreChanged();
return !hasChangedData();
}

View File

@ -68,7 +68,7 @@ public:
ExportTemplateHandler(Dialog::ExportTemplateDialog *parentDialog, Latte::View *view);
~ExportTemplateHandler();
bool dataAreChanged() const override;
bool hasChangedData() const override;
bool inDefaultValues() const override;
void reset() override;

View File

@ -57,7 +57,7 @@ public:
Generic(Dialog::GenericDialog *parent);
Generic(Dialog::GenericDialog *parentDialog, QObject *parent);
virtual bool dataAreChanged() const = 0;
virtual bool hasChangedData() const = 0;
virtual bool inDefaultValues() const = 0;
virtual void reset() = 0;

View File

@ -154,9 +154,9 @@ void Layouts::initView()
connect(m_view, &QObject::destroyed, this, &Controller::Layouts::storeColumnWidths);
}
bool Layouts::dataAreChanged() const
bool Layouts::hasChangedData() const
{
return m_model->dataAreChanged();
return m_model->hasChangedData();
}
bool Layouts::layoutsAreChanged() const

View File

@ -64,7 +64,7 @@ public:
QAbstractItemModel *baseModel() const;
QTableView *view() const;
bool dataAreChanged() const;
bool hasChangedData() const;
bool layoutsAreChanged() const;
bool modeIsChanged() const;

View File

@ -71,7 +71,7 @@ bool Layouts::containsCurrentName(const QString &name) const
return m_layoutsTable.containsName(name);
}
bool Layouts::dataAreChanged() const
bool Layouts::hasChangedData() const
{
return modeIsChanged() || layoutsAreChanged();
}

View File

@ -86,7 +86,7 @@ public:
bool containsCurrentName(const QString &name) const;
bool dataAreChanged() const;
bool hasChangedData() const;
bool layoutsAreChanged() const;
bool modeIsChanged() const;

View File

@ -441,8 +441,8 @@ void SettingsDialog::updateApplyButtonsState()
//! Ok, Apply Buttons
if ((currentPage() == LayoutPage && m_tabLayoutsHandler->dataAreChanged())
||(currentPage() == PreferencesPage && m_tabPreferencesHandler->dataAreChanged())) {
if ((currentPage() == LayoutPage && m_tabLayoutsHandler->hasChangedData())
||(currentPage() == PreferencesPage && m_tabPreferencesHandler->hasChangedData())) {
changed = true;
}
@ -471,8 +471,8 @@ void SettingsDialog::updateApplyButtonsState()
bool SettingsDialog::saveChanges()
{
if ((m_acceptedPage == LayoutPage && m_tabLayoutsHandler->dataAreChanged())
|| (m_acceptedPage == PreferencesPage && m_tabPreferencesHandler->dataAreChanged())) {
if ((m_acceptedPage == LayoutPage && m_tabLayoutsHandler->hasChangedData())
|| (m_acceptedPage == PreferencesPage && m_tabPreferencesHandler->hasChangedData())) {
QString tabName = m_ui->tabWidget->tabBar()->tabText(m_acceptedPage).remove("&");
QString saveChangesText = i18n("The settings of <b>%0</b> tab have changed. Do you want to apply the changes or discard them?").arg(tabName);
@ -495,8 +495,8 @@ void SettingsDialog::onCurrentTabChanged(int index)
{
//! Before switching into a new tab the user must confirm first if the data should be saved or not
if ((m_acceptedPage == LayoutPage && m_tabLayoutsHandler->dataAreChanged())
|| (m_acceptedPage == PreferencesPage && m_tabPreferencesHandler->dataAreChanged())) {
if ((m_acceptedPage == LayoutPage && m_tabLayoutsHandler->hasChangedData())
|| (m_acceptedPage == PreferencesPage && m_tabPreferencesHandler->hasChangedData())) {
if (index != m_acceptedPage) {
m_nextPage = index;

View File

@ -270,9 +270,9 @@ Ui::SettingsDialog *TabLayouts::ui() const
return m_ui;
}
bool TabLayouts::dataAreChanged() const
bool TabLayouts::hasChangedData() const
{
return m_layoutsController->dataAreChanged();
return m_layoutsController->hasChangedData();
}
bool TabLayouts::inDefaultValues() const

View File

@ -65,7 +65,7 @@ public:
TabLayouts(Dialog::SettingsDialog *parent);
~TabLayouts();
bool dataAreChanged() const override;
bool hasChangedData() const override;
bool inDefaultValues() const override;
bool isCurrentTab() const;

View File

@ -149,7 +149,7 @@ void TabPreferences::updateUi()
emit dataChanged();
}
bool TabPreferences::dataAreChanged() const
bool TabPreferences::hasChangedData() const
{
return o_preferences != m_preferences;
}

View File

@ -58,7 +58,7 @@ class TabPreferences : public Generic
public:
TabPreferences(Latte::Settings::Dialog::SettingsDialog *parent);
bool dataAreChanged() const override;
bool hasChangedData() const override;
bool inDefaultValues() const override;
void reset() override;