Skip to content

Commit

Permalink
Merge pull request #1027 from FashionFreedom/issue-1026-fix-dialog-ma…
Browse files Browse the repository at this point in the history
…x-height

fix: Dialog max height issue
  • Loading branch information
DSCaskey authored Oct 8, 2023
2 parents 4e5ba16 + d1e1407 commit 2c2a7a4
Show file tree
Hide file tree
Showing 22 changed files with 3,129 additions and 2,458 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/***************************************************************************
* *
* Copyright (C) 2017 Seamly, LLC *
* *
* https://github.com/fashionfreedom/seamly2d *
* *
***************************************************************************
** @file preferencesconfigurationpage.cpp
** @author Douglas S Caskey
** @date 21 Seo, 2023
**
** @copyright
** Copyright (C) 2017 - 2023 Seamly, LLC
** https://github.com/fashionfreedom/seamly2d
**
** @brief
** Seamly2D is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,35 +19,34 @@
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************
** along with Seamly2D. if not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

************************************************************************
/************************************************************************
**
** @file preferencesconfigurationpage.cpp
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 12 4, 2017
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Seamly2D project
** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Seamly2D is free software: you can redistribute it and/or modify
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Seamly2D is distributed in the hope that it will be useful,
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
** along with Valentina. if not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/

Expand All @@ -66,7 +67,6 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
: QWidget(parent)
, ui(new Ui::PreferencesConfigurationPage)
, m_langChanged(false)
, m_systemChanged()
, m_unitChanged(false)
, m_labelLangChanged(false)
, m_selectionSoundChanged(false)
Expand Down Expand Up @@ -106,27 +106,6 @@ PreferencesConfigurationPage::PreferencesConfigurationPage(QWidget *parent)
// .arg("<a href=\"https://wiki.seamly.net/wiki/UserManual:Crash_reports\">")
// .arg("</a>"));

// Pattern Making System
InitPMSystems(ui->systemCombo);
ui->systemBookValueLabel->setFixedHeight(4 * QFontMetrics(ui->systemBookValueLabel->font()).lineSpacing());
connect(ui->systemCombo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, [this]()
{
m_systemChanged = true;
QString text = qApp->TrVars()->PMSystemAuthor(ui->systemCombo->currentData().toString());
ui->systemAuthorValueLabel->setText(text);
ui->systemAuthorValueLabel->setToolTip(text);

text = qApp->TrVars()->PMSystemBook(ui->systemCombo->currentData().toString());
ui->systemBookValueLabel->setPlainText(text);
});

// set default pattern making system
index = ui->systemCombo->findData(qApp->Seamly2DSettings()->GetPMSystemCode());
if (index != -1)
{
ui->systemCombo->setCurrentIndex(index);
}

// Default operations suffixes
ui->moveSuffix_ComboBox->addItem(tr("None"), "");
ui->moveSuffix_ComboBox->addItem(tr("_M"), "_M");
Expand Down Expand Up @@ -275,16 +254,12 @@ void PreferencesConfigurationPage::Apply()
settings->SetOsSeparator(ui->osOptionCheck->isChecked());
//settings->SetSendReportState(ui->sendReportCheck->isChecked());

if (m_langChanged || m_systemChanged)
if (m_langChanged)
{
const QString locale = qvariant_cast<QString>(ui->langCombo->currentData());
settings->SetLocale(locale);
m_langChanged = false;

const QString code = qvariant_cast<QString>(ui->systemCombo->currentData());
settings->SetPMSystemCode(code);
m_systemChanged = false;

qApp->loadTranslations(locale);
}
if (m_unitChanged)
Expand Down
36 changes: 18 additions & 18 deletions src/app/seamly2d/dialogs/configpages/preferencesconfigurationpage.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
/***************************************************************************
* *
* Copyright (C) 2017 Seamly, LLC *
* *
* https://github.com/fashionfreedom/seamly2d *
* *
***************************************************************************
** @file preferencesconfigurationpage.h
** @author Douglas S Caskey
** @date 21 Seo, 2023
**
** @copyright
** Copyright (C) 2017 - 2023 Seamly, LLC
** https://github.com/fashionfreedom/seamly2d
**
** @brief
** Seamly2D is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
Expand All @@ -17,35 +19,34 @@
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************
** along with Seamly2D. if not, see <http://www.gnu.org/licenses/>.
**************************************************************************/

************************************************************************
/************************************************************************
**
** @file preferencesconfigurationpage.h
** @author Roman Telezhynskyi <dismine(at)gmail.com>
** @date 12 4, 2017
**
** @brief
** @copyright
** This source code is part of the Valentine project, a pattern making
** This source code is part of the Valentina project, a pattern making
** program, whose allow create and modeling patterns of clothing.
** Copyright (C) 2017 Seamly2D project
** <https://github.com/fashionfreedom/seamly2d> All Rights Reserved.
** Copyright (C) 2017 Valentina project
** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
**
** Seamly2D is free software: you can redistribute it and/or modify
** Valentina is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** Seamly2D is distributed in the hope that it will be useful,
** Valentina is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
** along with Valentina. if not, see <http://www.gnu.org/licenses/>.
**
*************************************************************************/

Expand All @@ -68,15 +69,14 @@ class PreferencesConfigurationPage : public QWidget
virtual ~PreferencesConfigurationPage();

void Apply();

protected:
virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;

private:
Q_DISABLE_COPY(PreferencesConfigurationPage)
Ui::PreferencesConfigurationPage *ui;
bool m_langChanged;
bool m_systemChanged;
bool m_unitChanged;
bool m_labelLangChanged;
bool m_selectionSoundChanged;
Expand Down
Loading

0 comments on commit 2c2a7a4

Please sign in to comment.