diff --git a/src/charts/main.cpp b/src/charts/main.cpp index 97e541a0b4f216690eeea5914e7410fc9b9a04a0..ba26d24870b4fe5e04acd3ecdea4ecc6fe7f1ed3 100644 --- a/src/charts/main.cpp +++ b/src/charts/main.cpp @@ -18,6 +18,7 @@ #include <QApplication> +#include <QTranslator> #include "tanalysdialog.h" #include <tinitcorelib.h> @@ -25,6 +26,9 @@ Tglobals *gl; int main(int argc, char *argv[]) { + QTranslator qtTranslator; + QTranslator qtbaseTranslator; + QTranslator nooTranslator; QApplication a(argc, argv); // #if defined (Q_OS_MAC) // QApplication::setStyle(new QPlastiqueStyle); @@ -32,7 +36,7 @@ int main(int argc, char *argv[]) gl = new Tglobals(); gl->path = Tglobals::getInstPath(qApp->applicationDirPath()); initCoreLibrary(gl); - prepareTranslations(&a); + prepareTranslations(&a, qtTranslator, qtbaseTranslator, nooTranslator); if (!loadNootkaFont(&a)) return 111; diff --git a/src/level/main.cpp b/src/level/main.cpp index e17b1664b95f6db7d62e47991fdb1905cfc14886..fc15e61c6af54d843b00efee57f15747f7c424db 100644 --- a/src/level/main.cpp +++ b/src/level/main.cpp @@ -18,6 +18,7 @@ #include <QApplication> +#include <QTranslator> #include "tlevelcreatordlg.h" #include <tinitcorelib.h> @@ -25,6 +26,9 @@ Tglobals *gl; int main(int argc, char *argv[]) { + QTranslator qtTranslator; + QTranslator qtbaseTranslator; + QTranslator nooTranslator; QApplication a(argc, argv); // #if defined (Q_OS_MAC) // QApplication::setStyle(new QPlastiqueStyle); @@ -34,7 +38,7 @@ int main(int argc, char *argv[]) return 112; } initCoreLibrary(gl); - prepareTranslations(&a); + prepareTranslations(&a, qtTranslator, qtbaseTranslator, nooTranslator); if (!loadNootkaFont(&a)) return 111; diff --git a/src/level/tmelodysettings.cpp b/src/level/tmelodysettings.cpp index 77b8fcfbaff42f50593acfa8b4cdec10406671fa..a90e9c588d33b0ab7c97b41d2805057f2914036c 100644 --- a/src/level/tmelodysettings.cpp +++ b/src/level/tmelodysettings.cpp @@ -38,7 +38,7 @@ TmelodySettings::TmelodySettings(TlevelCreatorDlg* creator) : m_finishOnChB = new QCheckBox(tr("Melody ends on tonic note."), this); m_finishOnChB->setStatusTip(tr("Determines the last note of a melody.<br>When set, melody will be finished on tonic note in actual key signature.")); m_equalTempoChB = new QCheckBox(tr("Require equal tempo"), this); - m_equalTempoChB->setStatusTip(tr("If set, doesn't matter how fast you will play but melody has to be played whole with the same tempo.")); + m_equalTempoChB->setStatusTip(tr("If set, doesn't matter how fast you will play but entire melody has to be played with the same tempo.")); TroundedLabel *qaLab = new TroundedLabel(tr("Melodies are available for the following questions-answers:") + "<br>" + TnooFont::span("s?", 25) + "<big> -> </big>" + TnooFont::span("n!", 25) + diff --git a/src/libs/core/music/tchunk.cpp b/src/libs/core/music/tchunk.cpp new file mode 100644 index 0000000000000000000000000000000000000000..796e412c2ecb62cc60d006c1f9e5e652968e3165 --- /dev/null +++ b/src/libs/core/music/tchunk.cpp @@ -0,0 +1,59 @@ +/*************************************************************************** + * Copyright (C) 2014 by Tomasz Bojczuk * + * tomaszbojczuk@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include "tchunk.h" +#include "trhythm.h" +#include "tnote.h" +#include <QXmlStreamWriter> + +Tchunk::Tchunk(const Tnote& pitch, const Trhythm& rhythm) : + m_pitch(new Tnote(pitch)), + m_rhythm(new Trhythm(rhythm)) +{} + + +Tchunk::~Tchunk() +{ + delete m_pitch; + delete m_rhythm; +} + + + +void Tchunk::toXml(QXmlStreamWriter& xml) { + xml.writeStartElement("note"); + if (m_rhythm->isRest() || m_pitch->note == 0) + xml.writeEmptyElement("rest"); + else + m_pitch->toXml(xml); + xml.writeTextElement("type", m_rhythm->xmlType()); + if (m_rhythm->hasDot()) + xml.writeEmptyElement("dot"); + xml.writeEndElement(); // note +} + + +bool Tchunk::fromXml(QXmlStreamReader& xml) { + +} + + + + + + diff --git a/src/libs/core/music/tchunk.h b/src/libs/core/music/tchunk.h new file mode 100644 index 0000000000000000000000000000000000000000..b1ddf8ddcb285a12489b739d541710c0c95515d1 --- /dev/null +++ b/src/libs/core/music/tchunk.h @@ -0,0 +1,57 @@ +/*************************************************************************** + * Copyright (C) 2014 by Tomasz Bojczuk * + * tomaszbojczuk@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#ifndef TCHUNK_H +#define TCHUNK_H + +class QXmlStreamReader; +class QXmlStreamWriter; +class Trhythm; +class Tnote; + + +/** + * This class represent a note: + * a pitch described by @p Tnote + * and its value (relative duration) described by @p Trhythm + */ +class Tchunk +{ + +public: + Tchunk(const Tnote& pitch, const Trhythm& rhythm); + ~Tchunk(); + + Tnote* p() { return m_pitch; } + void setPitch(const Tnote& pitch) { m_pitch = pitch; } + + Trhythm* r() { return m_rhythm; } + void setRhythm(const Trhythm& rhythm) { m_rhythm = rhythm; } + + + void toXml(QXmlStreamWriter& xml); + bool fromXml(QXmlStreamReader& xml); + + +private: + Tnote *m_pitch; + Trhythm *m_rhythm; + +}; + +#endif // TCHUNK_H diff --git a/src/libs/core/music/tnote.cpp b/src/libs/core/music/tnote.cpp index 452a49865174ee04fd97571c1948b11ef26f09fe..124e0da0e3d44fb60ea5d4049851bcb6d6a2603e 100644 --- a/src/libs/core/music/tnote.cpp +++ b/src/libs/core/music/tnote.cpp @@ -367,11 +367,13 @@ QString Tnote::toRichText(Tnote::EnameStyle notation, bool showOctave) { void Tnote::toXml(QXmlStreamWriter& xml) { xml.writeStartElement("pitch"); + if (note !=0) { // write <pitch> context only if note is valid Tnote bareNote = Tnote(note, octave, 0); xml.writeTextElement("step", bareNote.toText(Tnote::e_english_Bb, false)); xml.writeTextElement("octave", QVariant((int)octave + 3).toString()); if (acidental) xml.writeTextElement("alter", QVariant((int)acidental).toString()); + } xml.writeEndElement(); // pitch } @@ -379,6 +381,7 @@ void Tnote::toXml(QXmlStreamWriter& xml) { void Tnote::fromXml(QXmlStreamReader& xml) { if (xml.name() == "pitch") { while (xml.readNextStartElement()) { + note = 0; octave = 0; acidental = 0; // reset this note if (xml.name() == "step") { QString step = xml.readElementText().toUpper(); for (char i = 1; i < 8; i++) { diff --git a/src/libs/core/music/trhythm.h b/src/libs/core/music/trhythm.h new file mode 100644 index 0000000000000000000000000000000000000000..b47724c3599fae228a44d6940a9348c04e046912 --- /dev/null +++ b/src/libs/core/music/trhythm.h @@ -0,0 +1,73 @@ +/*************************************************************************** + * Copyright (C) 2014 by Tomasz Bojczuk * + * tomaszbojczuk@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 * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#ifndef TRHYTHM_H +#define TRHYTHM_H +#include <QString> + + +/** + * This class describes musical note value (relative duration) + */ +class Trhythm +{ + +public: + + enum EnoteValue { + e_none = 0, e_whole = 1, e_half = 2, e_quarter = 4, e_eighth = 8, e_sixteenth = 16 + }; /** Describes note duration */ + + /** Creates note value, by default it is quarter (without dot) */ + Trhythm(EnoteValue nVal = e_quarter, bool rest = false, bool dot = false) : + m_noteVal(nVal), m_isRest(rest), m_hasDot(dot) + {} + + /** Sets rhythm parameters */ + void setRhythm(EnoteValue nVal, bool rest = false, bool dot = false) { + m_noteVal = nVal; + m_isRest = rest; + m_hasDot = dot; + } + + EnoteValue rhythm() { return m_noteVal; } + void setNoteValue(EnoteValue nVal) { m_noteVal = nVal; } + + bool hasDot() { return m_hasDot; } + void setDot(bool dot) { m_hasDot = dot; } + + bool isRest() { return m_isRest; } + void setRest(bool rest) { m_isRest = rest; } + + QString xmlType() { + switch (m_noteVal) { + case e_whole: return "whole"; + case e_half: return "half"; + case e_quarter: return "quarter"; + case e_eighth: return "eighth"; + case e_sixteenth: return "16th"; + default: return "none"; + } + } + +private: + EnoteValue m_noteVal; + bool m_hasDot, m_isRest; +}; + +#endif // TRHYTHM_H diff --git a/src/libs/core/score/tscorestaff.cpp b/src/libs/core/score/tscorestaff.cpp index 7923c5c2dc845f94591ebc3663a0bfa4c05443a1..66e7fd5a4ae4e394fa2b209d4d2db0881b867414 100755 --- a/src/libs/core/score/tscorestaff.cpp +++ b/src/libs/core/score/tscorestaff.cpp @@ -363,11 +363,13 @@ int TscoreStaff::fixNotePos(int pianoPos) { void TscoreStaff::setViewWidth(qreal viewW) { - m_viewWidth = viewW; - int oldMax = m_maxNotesCount; - m_maxNotesCount = getMaxNotesNr(mapFromScene(viewW, 0.0).x()); - updateLines(); // calls updateWidth() as well - updateNotesPos(); + if (viewW != m_viewWidth) { + m_viewWidth = viewW; + int oldMax = m_maxNotesCount; + m_maxNotesCount = getMaxNotesNr(mapFromScene(viewW, 0.0).x()); + updateLines(); // calls updateWidth() as well + updateNotesPos(); + } } diff --git a/src/libs/core/score/tsimplescore.cpp b/src/libs/core/score/tsimplescore.cpp index da1aaade6dfd2b5f15ded2e47284166a5077410b..4c242622d08137bbeeb1e186732a82869ab387ca 100644 --- a/src/libs/core/score/tsimplescore.cpp +++ b/src/libs/core/score/tsimplescore.cpp @@ -90,7 +90,7 @@ Tnote TsimpleScore::getNote(int index) { } -void TsimpleScore::setNote(int index, Tnote note) { +void TsimpleScore::setNote(int index, const Tnote& note) { staff()->setNote(index, note); if (staff()->noteSegment(index)->pos().x() * m_score->transform().m11() > m_score->width() * 0.75) m_score->centerOn(staff()->noteSegment(index)->mapToScene(staff()->noteSegment(index)->pos())); diff --git a/src/libs/core/score/tsimplescore.h b/src/libs/core/score/tsimplescore.h index ca3e99e7e08376bda123eff40c47eaac9475846b..1aa622d9d9d673510d5f188cc2a5407519258b7d 100644 --- a/src/libs/core/score/tsimplescore.h +++ b/src/libs/core/score/tsimplescore.h @@ -43,7 +43,7 @@ public: TsimpleScore(int notesNumber, QWidget *parent = 0); ~TsimpleScore(); - virtual void setNote(int index, Tnote note); + virtual void setNote(int index, const Tnote& note); Tnote getNote(int index); /** It returns @p note with hope that index points existed Tnote element. */ void clearNote(int index); /** It hides pointed note and sets note to Tnote(0,0,0)*/ void setStringNumber(int index, int realNr); /** Adds string number @p realNr to note @p index. */ diff --git a/src/libs/core/tinitcorelib.cpp b/src/libs/core/tinitcorelib.cpp index 8d32535a9b8da127df9dd2459336f5a7f0e64d5e..eaeba98f9f1fbccbe94a3724d7dd50420a80a932 100755 --- a/src/libs/core/tinitcorelib.cpp +++ b/src/libs/core/tinitcorelib.cpp @@ -31,9 +31,6 @@ Tglobals* Tglob::m_gl = 0; -QTranslator qtTranslator; -QTranslator qtbaseTranslator; -QTranslator nooTranslator; void initCoreLibrary(Tglobals* gl) { @@ -50,24 +47,24 @@ void initCoreLibrary(Tglobals* gl) { } -void prepareTranslations(QApplication* a) { +void prepareTranslations(QApplication* a, QTranslator& qt, QTranslator& qtBase, QTranslator& noo) { QString ll = ""; if (Tglob::glob()) ll = Tglob::glob()->lang; if (ll == "") ll = QLocale::system().name(); #if defined(Q_OS_LINUX) - qtTranslator.load("qt_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); - qtbaseTranslator.load("qtbase_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + qt.load("qt_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + qtBase.load("qtbase_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); #else - qtTranslator.load("qt_" + ll, Tglob::glob()->path + "lang"); - qtbaseTranslator.load("qtbase_" + ll, Tglob::glob()->path + "lang"); + qt.load("qt_" + ll, Tglob::glob()->path + "lang"); + qtBase.load("qtbase_" + ll, Tglob::glob()->path + "lang"); #endif - a->installTranslator(&qtTranslator); - a->installTranslator(&qtbaseTranslator); + a->installTranslator(&qt); + a->installTranslator(&qtBase); - nooTranslator.load("nootka_" + ll, Tglob::glob()->path + "lang"); - a->installTranslator(&nooTranslator); + noo.load("nootka_" + ll, Tglob::glob()->path + "lang"); + a->installTranslator(&noo); TkeySignature::setNameStyle(Tglob::glob()->S->nameStyleInKeySign, Tglob::glob()->S->majKeyNameSufix, Tglob::glob()->S->minKeyNameSufix); } diff --git a/src/libs/core/tinitcorelib.h b/src/libs/core/tinitcorelib.h index bdaa2b1b779426db6ce50d9595cc86932ecef124..ab2796af1c27e78d549f9d6c88d889a438b9db13 100755 --- a/src/libs/core/tinitcorelib.h +++ b/src/libs/core/tinitcorelib.h @@ -22,6 +22,7 @@ #include "nootkacoreglobal.h" #include "tglobals.h" +class QTranslator; class QApplication; /** @@ -48,8 +49,9 @@ private: */ NOOTKACORE_EXPORT void initCoreLibrary(Tglobals *gl); -/** Loads translations files for appropriate language (system or user preferred) */ -NOOTKACORE_EXPORT void prepareTranslations(QApplication* a); +/** Loads translations files for appropriate language (system or user preferred) + * Translator object has to be created first. */ +NOOTKACORE_EXPORT void prepareTranslations(QApplication* a, QTranslator& qt, QTranslator& qtBase, QTranslator& noo); /** Checks nootka.ttf file and loads it. Returns true if successful. * libNootkaCore has to be initialized first by initCoreLibrary() */ diff --git a/src/main.cpp b/src/main.cpp index 3721653772570691a626efeca445282c0a7b146d..9efefe06573a108dcf329771c8e0579fb5431a48 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,23 +23,19 @@ #include <QSettings> #include <QApplication> #include <QDebug> +#include <QTranslator> -#if defined(Q_OS_WIN32) - #include <windows.h> - #define SLEEP(msecs) Sleep(msecs) -#else - #include <unistd.h> - #define SLEEP(msecs) usleep(msecs * 1000) -#endif Tglobals *gl; bool resetConfig; int main(int argc, char *argv[]) { - + QTranslator qtTranslator; + QTranslator qtbaseTranslator; + QTranslator nooTranslator; QPointer<QApplication> a = 0; - QPointer<MainWindow> w = 0; + MainWindow *w = 0; int exitCode; bool firstTime = true; QString confFile; @@ -60,7 +56,7 @@ int main(int argc, char *argv[]) gl->path = Tglobals::getInstPath(qApp->applicationDirPath()); confFile = gl->config->fileName(); initCoreLibrary(gl); - prepareTranslations(a); + prepareTranslations(a, qtTranslator, qtbaseTranslator, nooTranslator); if (!loadNootkaFont(a)) return 111; // creating main window @@ -80,9 +76,10 @@ int main(int argc, char *argv[]) firstTime = false; exitCode = a->exec(); delete w; + qDebug() << "Main Window successfully deleted"; } while (resetConfig); delete gl; - SLEEP(10); // delayed exit to avoid crash + qDebug() << "Settings object successfully deleted"; return exitCode; } diff --git a/src/notename/tnotename.cpp b/src/notename/tnotename.cpp index d7a7ab45856831a55b7c6e7df8b1cfb22163eec1..9a11d16df29c205fc9ed8a63de55210ac11b8318 100755 --- a/src/notename/tnotename.cpp +++ b/src/notename/tnotename.cpp @@ -176,8 +176,8 @@ TnoteName::TnoteName(QWidget *parent) : TnoteName::~TnoteName() { // setParent(0); //s release TnoteName to be able delete m_menu - if (m_menu) - delete m_menu; +// if (m_menu) +// delete m_menu; } diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp index 02f77e21155957977fb72808fb979c3295f0556e..48336adf6a0175a1ec36f91a20e12f8709f052bd 100644 --- a/src/score/tmainscore.cpp +++ b/src/score/tmainscore.cpp @@ -170,6 +170,13 @@ void TmainScore::acceptSettings() { } +void TmainScore::setNote(const Tnote& note) { + TmultiScore::setNote(note); + if (insertMode() == e_single) + m_nameMenu->setNoteName(note); +} + + void TmainScore::setInsertMode(TmainScore::EinMode mode) { if (mode != insertMode()) { TmultiScore::setInsertMode(mode); @@ -177,6 +184,9 @@ void TmainScore::setInsertMode(TmainScore::EinMode mode) { createNoteName(); m_currentNameSegment = staff()->noteSegment(0); m_nameMenu->setParent(0); + m_settCorner->hide(); + m_rhythmCorner->hide(); + m_delCorner->hide(); } else { } @@ -185,7 +195,6 @@ void TmainScore::setInsertMode(TmainScore::EinMode mode) { void TmainScore::noteWasClickedMain(int index) { - qDebug() << "noteWasClickedMain"; TscoreStaff *st = SENDER_TO_STAFF; Tnote note = *(st->getNote(index)); if (insertMode() == e_single) @@ -737,18 +746,18 @@ void TmainScore::createActions() { m_settBar->addAction(m_acts->staffDown()); #endif m_settBar->addAction(m_acts->lastNote()); - TcornerProxy *settCorner = new TcornerProxy(scoreScene(), m_settBar, Qt::BottomRightCorner); + m_settCorner = new TcornerProxy(scoreScene(), m_settBar, Qt::BottomRightCorner); m_clearBar = new QToolBar(); m_clearBar->addAction(m_acts->clearScore()); - TcornerProxy *delCorner = new TcornerProxy(scoreScene(), m_clearBar, Qt::BottomLeftCorner); - delCorner->setSpotColor(Qt::red); + m_delCorner = new TcornerProxy(scoreScene(), m_clearBar, Qt::BottomLeftCorner); + m_delCorner->setSpotColor(Qt::red); m_rhythmBar = new QToolBar(); QLabel *rl = new QLabel("Rhythms<br>not implemented yet", m_rhythmBar); m_rhythmBar->addWidget(rl); - TcornerProxy *rhythmCorner = new TcornerProxy(scoreScene(), m_rhythmBar, Qt::TopLeftCorner); - rhythmCorner->setSpotColor(Qt::yellow); + m_rhythmCorner = new TcornerProxy(scoreScene(), m_rhythmBar, Qt::TopLeftCorner); + m_rhythmCorner->setSpotColor(Qt::yellow); m_keys = new TscoreKeys(this); m_acts->assignKeys(m_keys); diff --git a/src/score/tmainscore.h b/src/score/tmainscore.h index 079db784c1f724bf9bd9abae15fc418b42471941..991bb5c5e1e2c55f784ce1f5768fc30d8db8d549 100644 --- a/src/score/tmainscore.h +++ b/src/score/tmainscore.h @@ -22,7 +22,7 @@ #include "tmultiscore.h" #include <QPointer> -class QMainWindow; +class TcornerProxy; class TscoreActions; class TscoreKeys; class QShortcut; @@ -57,6 +57,8 @@ public: int widthToHeight(int hi); /** Returns width of score when its height is @p hi. */ + virtual void setNote(const Tnote& note); + void setInsertMode(EinMode mode); /** Describes moving of selected note */ @@ -171,6 +173,7 @@ private: Tnote::EnameStyle m_corrStyle; QToolBar *m_settBar, *m_clearBar, *m_rhythmBar; + TcornerProxy *m_settCorner, *m_delCorner, *m_rhythmCorner; TnoteName *m_nameMenu; QPointer<TscoreNote> m_currentNameSegment; /** Currently edited TscoreNote by menu. */ bool m_scoreIsPlayed; diff --git a/src/score/tmultiscore.cpp b/src/score/tmultiscore.cpp index 9c67eaee57b03eeb3ae52aa4b16504b15cb6bc99..c7b9c4dff1ee160f956f607cfab7904ffaafc9ca 100644 --- a/src/score/tmultiscore.cpp +++ b/src/score/tmultiscore.cpp @@ -63,19 +63,21 @@ void TmultiScore::setInsertMode(TmultiScore::EinMode mode) { if (mode == e_single) { deleteNotes(); setControllersEnabled(true, false); - staff()->setStafNumber(-1); - staff()->setViewWidth(0.0); +// staff()->setStafNumber(-1); +// staff()->setViewWidth(0.0); score()->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); staff()->noteSegment(0)->left()->enableToAddNotes(false); m_currentIndex = 0; } else { setControllersEnabled(true, true); + staff()->noteSegment(0)->left()->enableToAddNotes(true); + score()->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); } } } -void TmultiScore::setNote(Tnote note) { +void TmultiScore::setNote(const Tnote& note) { if (insertMode() != e_single) { if (currentIndex() == -1) changeCurrentIndex(0); @@ -94,7 +96,6 @@ void TmultiScore::setNote(Tnote note) { } - void TmultiScore::setEnableKeySign(bool isEnabled) { if (isEnabled != (bool)staff()->scoreKey()) { for (int i = 0; i < m_staves.size(); ++i) { @@ -126,7 +127,6 @@ int TmultiScore::notesCount() { //#################################################################################################### void TmultiScore::noteWasClicked(int index) { - qDebug() << "noteWasClicked (multi)"; TscoreStaff *st = SENDER_TO_STAFF; Tnote note = *(st->getNote(index)); changeCurrentIndex(index + st->number() * st->maxNoteCount()); @@ -200,11 +200,11 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { } if (ww < 300) return; - if (m_inMode == e_single) { +// if (m_inMode == e_single) { // score()->setFixedSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - TsimpleScore::resizeEvent(event); +// TsimpleScore::resizeEvent(event); // score()->setFixedSize(score()->size()); - } else { +// } else { score()->resize(width() - 2, height() - 2); QList<TscoreNote*> allNotes; for (int i = 0; i < m_staves.size(); i++) { // grab all TscoreNote @@ -249,7 +249,7 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { } } updateSceneRect(); - } +// } } diff --git a/src/score/tmultiscore.h b/src/score/tmultiscore.h index 661a621e926c532e96a2cac0ec5362d96da48b1f..ba286a4d7974c4054d411e5e8c2f008289e36575 100644 --- a/src/score/tmultiscore.h +++ b/src/score/tmultiscore.h @@ -60,7 +60,7 @@ public: int staffCount() { return m_staves.size(); } - virtual void setNote(Tnote note); + virtual void setNote(const Tnote& note); virtual void setEnableKeySign(bool isEnabled); diff --git a/src/settings/main.cpp b/src/settings/main.cpp index 34cfa7c0b43b50a597d0f2e2a3864137bfc414bc..172901f5d379be8560282f9af8cd530dd9a1c39a 100644 --- a/src/settings/main.cpp +++ b/src/settings/main.cpp @@ -18,6 +18,7 @@ #include <QApplication> +#include <QTranslator> #include "tsettingsdialog.h" #include <tinitcorelib.h> #include <iostream> @@ -26,6 +27,9 @@ Tglobals *gl; int main(int argc, char *argv[]) { + QTranslator qtTranslator; + QTranslator qtbaseTranslator; + QTranslator nooTranslator; QApplication a(argc, argv); // #if defined (Q_OS_MAC) // QApplication::setStyle(new QPlastiqueStyle); @@ -35,7 +39,7 @@ int main(int argc, char *argv[]) return 112; } initCoreLibrary(gl); - prepareTranslations(&a); + prepareTranslations(&a, qtTranslator, qtbaseTranslator, nooTranslator); if (!loadNootkaFont(&a)) return 111;