diff --git a/TODO b/TODO index f96c588ed3e975fe3c026c990660b0429a92f6d6..e0d513734857c1a4d84650e0704ae67a0b77be5c 100644 --- a/TODO +++ b/TODO @@ -10,8 +10,6 @@ ============================================================================ ================ TODO LIST ====================== ============================================================================ -Translations: - - remove <br> from some status strings (rangesettings.cpp, accidsettings.cpp) ============================================================================ ANDROID: @@ -31,7 +29,6 @@ To consideration: - full screen mode (TRUE by default) - home button actions -Test scaling of alpha under Windows - NotaData of Tartini might be cleaned @@ -107,6 +104,5 @@ TEXAMEXECUTOR TO CONSIDER: - In wizard: option for single note mode for very beginners - - simplify license text - take translations from Wine project diff --git a/changes b/changes index 83ad2a6f8e752fc9f13f2df3e550ba90c153ff26..dce159040ae5e07fce42d8a7feca10a44d4b41b5 100644 --- a/changes +++ b/changes @@ -2,6 +2,7 @@ - new method to make random melodies more... melodic - melody can be randomized from selected notes, i.e. pentatonic scale - so added level with pentatonic scales + - solfege or letter note names can be selected during first run wizard - improved look of sound views, better fit to high DPI screens ANDROID - reduced number of paint operations, works even 2-4 times faster diff --git a/src/plugins/wizard/tfirstrunwizard.cpp b/src/plugins/wizard/tfirstrunwizard.cpp index 59a58138344db09080f1e327aa763135eb7df9f6..1b87c2cd0bcff9096bc8d6ae248f4c57bbd3e613 100644 --- a/src/plugins/wizard/tfirstrunwizard.cpp +++ b/src/plugins/wizard/tfirstrunwizard.cpp @@ -35,9 +35,7 @@ #include <tscoreparams.h> #include <tlayoutparams.h> #include <tpath.h> -#if defined (Q_OS_ANDROID) - #include <qtr.h> -#endif +#include <qtr.h> #include <QtWidgets/QtWidgets> @@ -112,15 +110,14 @@ TfirstRunWizard::TfirstRunWizard(QWidget *parent) : addPage(helpPage); // grab 7-th note from translation + Tcore::gl()->S->seventhIs_B = m_page3->select7->is7th_B(); + Tcore::gl()->S->nameStyleInNoteName = m_page3->nameStyle(); if (TmiscTrans::note7txt().toLower() == QLatin1String("b")) { - Tcore::gl()->S->seventhIs_B = true; // rest S->nameStyleInNoteName if (TmiscTrans::keyNameStyle() == QLatin1String("solfege")) Tcore::gl()->S->nameStyleInKeySign = Tnote::e_italiano_Si; else Tcore::gl()->S->nameStyleInKeySign = Tnote::e_nederl_Bis; - } - else { - Tcore::gl()->S->seventhIs_B = false; + } else { Tcore::gl()->S->nameStyleInNoteName = Tnote::e_norsk_Hb; if (TmiscTrans::keyNameStyle() == QLatin1String("solfege")) Tcore::gl()->S->nameStyleInKeySign = Tnote::e_italiano_Si; @@ -145,27 +142,27 @@ void TfirstRunWizard::done(int result) { if (result == QDialog::Rejected) { // restore defaults Tcore::gl()->instrument = e_classicalGuitar; m_page3->select7->set7th_B(TmiscTrans::note7txt().toLower() == QLatin1String("b")); + if (m_page3->localization.name().contains(QLatin1String("ru"))) + m_page3->solfegeRadio->setChecked(true); m_page3->dblAccChB->setChecked(false); m_page3->enharmChB->setChecked(false); m_page3->useKeyChB->setChecked(false); } + Tcore::gl()->S->seventhIs_B = m_page3->select7->is7th_B(); + Tcore::gl()->S->nameStyleInNoteName = m_page3->nameStyle(); +// Tnote::defaultStyle = Tcore::gl()->S->nameStyleInNoteName; + Tcore::gl()->S->solfegeStyle = m_page3->localization.name().contains(QLatin1String("ru")) ? Tnote::e_russian_Ci : Tnote::e_italiano_Si; if (m_page3->select7->is7th_B()) { - Tcore::gl()->S->seventhIs_B = true; - Tcore::gl()->S->nameStyleInNoteName = Tnote::e_english_Bb; if (TmiscTrans::keyNameStyle() == QLatin1String("solfege")) Tcore::gl()->S->nameStyleInKeySign = Tnote::e_italiano_Si; else Tcore::gl()->S->nameStyleInKeySign = Tnote::e_nederl_Bis; } else { - Tcore::gl()->S->seventhIs_B = false; - Tcore::gl()->S->nameStyleInNoteName = Tnote::e_norsk_Hb; if (TmiscTrans::keyNameStyle() == QLatin1String("solfege")) Tcore::gl()->S->nameStyleInKeySign = Tnote::e_italiano_Si; else Tcore::gl()->S->nameStyleInKeySign = Tnote::e_deutsch_His; } - if (QLocale::system().name().contains(QLatin1String("ru"))) // override name style for Russian localization - Tcore::gl()->S->nameStyleInNoteName = Tnote::e_russian_Ci; Tcore::gl()->S->doubleAccidentalsEnabled = m_page3->dblAccChB->isChecked(); Tcore::gl()->S->showEnharmNotes = m_page3->enharmChB->isChecked(); Tcore::gl()->S->keySignatureEnabled = m_page3->useKeyChB->isChecked(); @@ -317,8 +314,24 @@ Tpage_3::Tpage_3(QWidget *parent) : headLab->setAlignment(Qt::AlignCenter); select7 = new Select7note(this); select7->set7th_B(TmiscTrans::note7txt().toLower() == QLatin1String("b")); - scaleLab = new TscalePreviewLabel(select7->is7th_B()? Tnote::e_english_Bb : Tnote::e_norsk_Hb, false, this); - connect(select7, SIGNAL(seventhIsBchanged(bool)), this, SLOT(seventhNoteChanged(bool))); + m_nameStyle = select7->is7th_B()? Tnote::e_english_Bb : Tnote::e_norsk_Hb; + scaleLab = new TscalePreviewLabel(m_nameStyle, false, this); + connect(select7, &Select7note::seventhIsBchanged, this, &Tpage_3::seventhNoteChanged); + + letterRadio = new QRadioButton(qTR("TnotationRadioGroup", "letter names"), this); + solfegeRadio = new QRadioButton(qTR("TnotationRadioGroup", "solfege names"), this); + + auto notationGr = new QButtonGroup(this); + notationGr->addButton(solfegeRadio); + notationGr->addButton(letterRadio); + connect(notationGr, static_cast<void(QButtonGroup::*)(int, bool)>(&QButtonGroup::buttonToggled), this, &Tpage_3::notationSlot); + + if (TmiscTrans::keyNameStyle() == QLatin1String("solfege")) + solfegeRadio->setChecked(true); + else + letterRadio->setChecked(true); + notationSlot(); + dblAccChB = new QCheckBox(tr("I know about double sharps (x) and double flats (bb)"), this); dblAccChB->setChecked(Tcore::gl()->S->doubleAccidentalsEnabled); @@ -335,6 +348,13 @@ Tpage_3::Tpage_3(QWidget *parent) : lay->addStretch(); lay->addWidget(select7); lay->addWidget(scaleLab, 0, Qt::AlignCenter); + auto notationLay = new QHBoxLayout; + notationLay->addStretch(); + notationLay->addWidget(letterRadio); + notationLay->addStretch(); + notationLay->addWidget(solfegeRadio); + notationLay->addStretch(); + lay->addLayout(notationLay); lay->addStretch(); lay->addWidget(dblAccChB, 0, Qt::AlignCenter); lay->addWidget(enharmChB, 0, Qt::AlignCenter); @@ -345,6 +365,21 @@ Tpage_3::Tpage_3(QWidget *parent) : } void Tpage_3::seventhNoteChanged(bool is7_B) { - scaleLab->changeStyle(is7_B? Tnote::e_english_Bb : Tnote::e_norsk_Hb); + m_nameStyle = is7_B ? Tnote::e_english_Bb : Tnote::e_norsk_Hb; + scaleLab->changeStyle(m_nameStyle); + letterRadio->setChecked(true); +} + + +void Tpage_3::notationSlot() { + if (solfegeRadio->isChecked()) + m_nameStyle = localization.name().contains(QLatin1String("ru")) ? Tnote::e_russian_Ci : Tnote::e_italiano_Si; + else + m_nameStyle = select7->is7th_B() ? Tnote::e_english_Bb : Tnote::e_norsk_Hb; + scaleLab->changeStyle(m_nameStyle); } + + + + diff --git a/src/plugins/wizard/tfirstrunwizard.h b/src/plugins/wizard/tfirstrunwizard.h index 12a1c5102a936a02eeb6432c303cb0e99a744e98..cf52e8057392db3dfdbe1b8a4d61ce209493aaa5 100644 --- a/src/plugins/wizard/tfirstrunwizard.h +++ b/src/plugins/wizard/tfirstrunwizard.h @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2011-2015 by Tomasz Bojczuk * - * seelook@gmail.com * + * Copyright (C) 2011-2016 by Tomasz Bojczuk * + * seelook@gmail.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -12,14 +12,17 @@ * 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 * + * You should have received a copy of the GNU General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ #ifndef TFIRSTRUNWIZZARD_H #define TFIRSTRUNWIZZARD_H + #include <QtWidgets/qwizard.h> +#include <music/tnote.h> +#include <QtCore/qlocale.h> class QVBoxLayout; @@ -101,9 +104,18 @@ public: Select7note *select7; QCheckBox *dblAccChB, *enharmChB, *useKeyChB; TscalePreviewLabel *scaleLab; + QRadioButton *solfegeRadio, *letterRadio; -protected slots: - void seventhNoteChanged(bool is7_B); + Tnote::EnameStyle nameStyle() { return m_nameStyle; } + + QLocale localization; + +protected: + void seventhNoteChanged(bool is7_B); + void notationSlot(); + +private: + Tnote::EnameStyle m_nameStyle; };