diff options
Diffstat (limited to 'src/gui/editors/notation/NotationView.cpp')
-rw-r--r-- | src/gui/editors/notation/NotationView.cpp | 310 |
1 files changed, 155 insertions, 155 deletions
diff --git a/src/gui/editors/notation/NotationView.cpp b/src/gui/editors/notation/NotationView.cpp index bd553ee..be96fdf 100644 --- a/src/gui/editors/notation/NotationView.cpp +++ b/src/gui/editors/notation/NotationView.cpp @@ -25,7 +25,7 @@ #include "NotationView.h" #include <list> -#include <tqlayout.h> +#include <layout.h> #include "misc/Debug.h" #include <kapplication.h> @@ -194,7 +194,7 @@ #include <ktempfile.h> #include <ktoolbar.h> #include <kxmlguiclient.h> -#include <tqbrush.h> +#include <brush.h> #include <tqcanvas.h> #include <tqcursor.h> #include <tqdialog.h> @@ -372,9 +372,9 @@ NotationView::NotationView(RosegardenGUIDoc *doc, m_pageMode(LinedStaff::LinearMode), m_leftGutter(20), m_notePixmapFactory(new NotePixmapFactory(m_fontName, m_fontSize)), - m_htqlayout(new NotationHLayout(&doc->getComposition(), m_notePixmapFactory, + m_hlayout(new NotationHLayout(&doc->getComposition(), m_notePixmapFactory, m_properties, TQT_TQOBJECT(this))), - m_vtqlayout(new NotationVLayout(&doc->getComposition(), m_notePixmapFactory, + m_vlayout(new NotationVLayout(&doc->getComposition(), m_notePixmapFactory, m_properties, TQT_TQOBJECT(this))), m_chordNameRuler(0), m_tempoRuler(0), @@ -409,7 +409,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, // Initialise the display-related defaults that will be needed - // by both the actions and the tqlayout toolbar + // by both the actions and the layout toolbar m_config->setGroup(NotationViewConfigGroup); @@ -435,15 +435,15 @@ NotationView::NotationView(RosegardenGUIDoc *doc, NoteFontFactory::getDefaultSize(m_fontName)); int defaultSpacing = m_config->readNumEntry("spacing", 100); - m_htqlayout->setSpacing(defaultSpacing); + m_hlayout->setSpacing(defaultSpacing); int defaultProportion = m_config->readNumEntry("proportion", 60); - m_htqlayout->setProportion(defaultProportion); + m_hlayout->setProportion(defaultProportion); delete m_notePixmapFactory; m_notePixmapFactory = new NotePixmapFactory(m_fontName, m_fontSize); - m_htqlayout->setNotePixmapFactory(m_notePixmapFactory); - m_vtqlayout->setNotePixmapFactory(m_notePixmapFactory); + m_hlayout->setNotePixmapFactory(m_notePixmapFactory); + m_vlayout->setNotePixmapFactory(m_notePixmapFactory); setupActions(); // setupAddControlRulerMenu(); - too early for notation, moved to end of ctor. @@ -460,19 +460,19 @@ NotationView::NotationView(RosegardenGUIDoc *doc, updateViewCaption(); m_chordNameRuler = new ChordNameRuler - (m_htqlayout, doc, segments, m_leftGutter, 20, getCentralWidget()); + (m_hlayout, doc, segments, m_leftGutter, 20, getCentralWidget()); addRuler(m_chordNameRuler); if (showProgressive) m_chordNameRuler->show(); m_tempoRuler = new TempoRuler - (m_htqlayout, doc, this, m_leftGutter, 24, false, getCentralWidget()); + (m_hlayout, doc, this, m_leftGutter, 24, false, getCentralWidget()); addRuler(m_tempoRuler); m_tempoRuler->hide(); static_cast<TempoRuler *>(m_tempoRuler)->connectSignals(); m_rawNoteRuler = new RawNoteRuler - (m_htqlayout, segments[0], m_leftGutter, 20, getCentralWidget()); + (m_hlayout, segments[0], m_leftGutter, 20, getCentralWidget()); addRuler(m_rawNoteRuler); m_rawNoteRuler->show(); @@ -484,7 +484,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, readOptions(); - setBottomStandardRuler(new StandardRuler(getDocument(), m_htqlayout, m_leftGutter, 25, + setBottomStandardRuler(new StandardRuler(getDocument(), m_hlayout, m_leftGutter, 25, true, getBottomWidget())); for (unsigned int i = 0; i < segments.size(); ++i) @@ -506,7 +506,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, m_canvasView->setLeftFixedWidget(m_headersGroupView); // Add a close button just above the track headers. - // The grid tqlayout is only here to maintain the button in a + // The grid layout is only here to maintain the button in a // right place m_headersTopFrame = new TQFrame(getCentralWidget()); TQGridLayout * headersTopGrid @@ -522,7 +522,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, TQToolTip::add(hideHeadersButton, i18n("Close track headers")); headersTopGrid->setMargin(4); setTopStandardRuler(new StandardRuler(getDocument(), - m_htqlayout, m_leftGutter, 25, + m_hlayout, m_leftGutter, 25, false, getCentralWidget()), m_headersTopFrame); m_topStandardRuler->getLoopRuler()->setBackgroundColor @@ -544,7 +544,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, // - // tqlayout + // layout // ProgressDialog* progressDlg = 0; @@ -585,7 +585,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, setPageMode(mode); for (unsigned int i = 0; i < m_staffs.size(); ++i) { - m_staffs[i]->getSegment().getRefreshtqStatus + m_staffs[i]->getSegment().getRefreshStatus (m_segmentsRefreshStatusIds[i]).setNeedsRefresh(false); } @@ -594,7 +594,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, } catch (ProgressReporter::Cancelled c) { // when cancelled, m_ok is false -- checked by calling method - NOTATION_DEBUG << "NotationView ctor : tqlayout Cancelled" << endl; + NOTATION_DEBUG << "NotationView ctor : layout Cancelled" << endl; } NOTATION_DEBUG << "NotationView ctor : m_ok = " << m_ok << endl; @@ -754,10 +754,10 @@ NotationView::NotationView(RosegardenGUIDoc *doc, slotSetInsertCursorPosition(0); slotSetPointerPosition(doc->getComposition().getPosition()); setCurrentSelection(0, false, true); - slotUpdateInsertModetqStatus(); - m_chordNameRuler->tqrepaint(); - m_tempoRuler->tqrepaint(); - m_rawNoteRuler->tqrepaint(); + slotUpdateInsertModeStatus(); + m_chordNameRuler->repaint(); + m_tempoRuler->repaint(); + m_rawNoteRuler->repaint(); m_inhibitRefresh = false; // slotCheckRendered(0, getCanvasView()->visibleWidth()); @@ -817,9 +817,9 @@ NotationView::NotationView(RosegardenGUIDoc *doc, m_pageMode(LinedStaff::LinearMode), m_leftGutter(0), m_notePixmapFactory(new NotePixmapFactory(m_fontName, m_fontSize)), - m_htqlayout(new NotationHLayout(&doc->getComposition(), m_notePixmapFactory, + m_hlayout(new NotationHLayout(&doc->getComposition(), m_notePixmapFactory, m_properties, TQT_TQOBJECT(this))), - m_vtqlayout(new NotationVLayout(&doc->getComposition(), m_notePixmapFactory, + m_vlayout(new NotationVLayout(&doc->getComposition(), m_notePixmapFactory, m_properties, TQT_TQOBJECT(this))), m_chordNameRuler(0), m_tempoRuler(0), @@ -850,7 +850,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, // Initialise the display-related defaults that will be needed - // by both the actions and the tqlayout toolbar + // by both the actions and the layout toolbar m_config->setGroup(NotationViewConfigGroup); @@ -871,20 +871,20 @@ NotationView::NotationView(RosegardenGUIDoc *doc, if (referenceView) { - m_htqlayout->setSpacing(referenceView->m_htqlayout->getSpacing()); - m_htqlayout->setProportion(referenceView->m_htqlayout->getProportion()); + m_hlayout->setSpacing(referenceView->m_hlayout->getSpacing()); + m_hlayout->setProportion(referenceView->m_hlayout->getProportion()); } else { int defaultSpacing = m_config->readNumEntry("spacing", 100); - m_htqlayout->setSpacing(defaultSpacing); + m_hlayout->setSpacing(defaultSpacing); int defaultProportion = m_config->readNumEntry("proportion", 60); - m_htqlayout->setProportion(defaultProportion); + m_hlayout->setProportion(defaultProportion); } delete m_notePixmapFactory; m_notePixmapFactory = new NotePixmapFactory(m_fontName, m_fontSize); - m_htqlayout->setNotePixmapFactory(m_notePixmapFactory); - m_vtqlayout->setNotePixmapFactory(m_notePixmapFactory); + m_hlayout->setNotePixmapFactory(m_notePixmapFactory); + m_vlayout->setNotePixmapFactory(m_notePixmapFactory); setBackgroundMode(PaletteBase); m_config->setGroup(NotationViewConfigGroup); @@ -930,7 +930,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, setPageMode(LinedStaff::MultiPageMode); // also positions and renders the staffs! for (unsigned int i = 0; i < m_staffs.size(); ++i) { - m_staffs[i]->getSegment().getRefreshtqStatus + m_staffs[i]->getSegment().getRefreshStatus (m_segmentsRefreshStatusIds[i]).setNeedsRefresh(false); } @@ -939,7 +939,7 @@ NotationView::NotationView(RosegardenGUIDoc *doc, } catch (ProgressReporter::Cancelled c) { // when cancelled, m_ok is false -- checked by calling method - NOTATION_DEBUG << "NotationView ctor : tqlayout Cancelled" << endl; + NOTATION_DEBUG << "NotationView ctor : layout Cancelled" << endl; } NOTATION_DEBUG << "NotationView ctor : m_ok = " << m_ok << endl; @@ -1223,7 +1223,7 @@ void NotationView::positionStaffs() } } - m_htqlayout->setPageWidth(pageWidth - leftMargin * 2); + m_hlayout->setPageWidth(pageWidth - leftMargin * 2); int topGutter = 0; @@ -1341,7 +1341,7 @@ void NotationView::positionPages() haveBackground = true; } // we're happy to ignore errors from this one: - deskBackground.load(TQString("%1/misc/bg-desktop.xpm").tqarg(pixmapDir)); + deskBackground.load(TQString("%1/misc/bg-desktop.xpm").arg(pixmapDir)); } int pageWidth = getPageWidth(); @@ -1365,14 +1365,14 @@ void NotationView::positionPages() if (m_pageMode != LinedStaff::MultiPageMode) { if (haveBackground) { - canvas()->tqsetBackgroundPixmap(background); + canvas()->setBackgroundPixmap(background); getCanvasView()->setBackgroundMode(TQt::FixedPixmap); getCanvasView()->setPaletteBackgroundPixmap(background); getCanvasView()->setErasePixmap(background); } } else { if (haveBackground) { - canvas()->tqsetBackgroundPixmap(deskBackground); + canvas()->setBackgroundPixmap(deskBackground); getCanvasView()->setBackgroundMode(TQt::FixedPixmap); getCanvasView()->setPaletteBackgroundPixmap(background); getCanvasView()->setErasePixmap(background); @@ -1389,7 +1389,7 @@ void NotationView::positionPages() int w = pageWidth - leftMargin / 2; int h = pageHeight; - TQString str = TQString("%1").tqarg(page + 1); + TQString str = TQString("%1").arg(page + 1); TQCanvasText *text = new TQCanvasText(str, pageNumberFont, canvas()); text->setX(m_leftGutter + pageWidth * page + pageWidth - pageNumberMetrics.width(str) - leftMargin); text->setY(y + h - pageNumberMetrics.descent() - topMargin); @@ -1482,13 +1482,13 @@ void NotationView::readOptions() opt = m_config->readBoolEntry("Show Annotations", true); m_annotationsVisible = opt; getToggleAction("show_annotations")->setChecked(opt); - slotUpdateAnnotationstqStatus(); + slotUpdateAnnotationsStatus(); // slotToggleAnnotations(); opt = m_config->readBoolEntry("Show LilyPond Directives", true); m_lilyPondDirectivesVisible = opt; getToggleAction("show_lilypond_directives")->setChecked(opt); - slotUpdateLilyPondDirectivestqStatus(); + slotUpdateLilyPondDirectivesStatus(); } void NotationView::setupActions() @@ -1549,7 +1549,7 @@ void NotationView::setupActions() KActionMenu *spacingActionMenu = new KActionMenu(i18n("S&pacing"), TQT_TQOBJECT(this), "stretch_actionmenu"); - int defaultSpacing = m_htqlayout->getSpacing(); + int defaultSpacing = m_hlayout->getSpacing(); std::vector<int> spacings = NotationHLayout::getAvailableSpacings(); for (std::vector<int>::iterator i = spacings.begin(); @@ -1557,9 +1557,9 @@ void NotationView::setupActions() KToggleAction *spacingAction = new KToggleAction - (TQString("%1%").tqarg(*i), 0, TQT_TQOBJECT(this), + (TQString("%1%").arg(*i), 0, TQT_TQOBJECT(this), TQT_SLOT(slotChangeSpacingFromAction()), - actionCollection(), TQString("spacing_%1").tqarg(*i).ascii()); + actionCollection(), TQString("spacing_%1").arg(*i).ascii()); spacingAction->setExclusiveGroup("spacing"); spacingAction->setChecked(*i == defaultSpacing); @@ -1571,13 +1571,13 @@ void NotationView::setupActions() KActionMenu *proportionActionMenu = new KActionMenu(i18n("Du&ration Factor"), TQT_TQOBJECT(this), "proportion_actionmenu"); - int defaultProportion = m_htqlayout->getProportion(); + int defaultProportion = m_hlayout->getProportion(); std::vector<int> proportions = NotationHLayout::getAvailableProportions(); for (std::vector<int>::iterator i = proportions.begin(); i != proportions.end(); ++i) { - TQString name = TQString("%1%").tqarg(*i); + TQString name = TQString("%1%").arg(*i); if (*i == 0) name = i18n("None"); @@ -1585,7 +1585,7 @@ void NotationView::setupActions() new KToggleAction (name, 0, TQT_TQOBJECT(this), TQT_SLOT(slotChangeProportionFromAction()), - actionCollection(), TQString("proportion_%1").tqarg(*i).ascii()); + actionCollection(), TQString("proportion_%1").arg(*i).ascii()); proportionAction->setExclusiveGroup("proportion"); proportionAction->setChecked(*i == defaultProportion); @@ -1820,7 +1820,7 @@ void NotationView::setupActions() TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); - TQCanvasPixmap pixmap(pixmapDir + "/toolbar/linear-tqlayout.xpm"); + TQCanvasPixmap pixmap(pixmapDir + "/toolbar/linear-layout.xpm"); icon = TQIconSet(pixmap); KRadioAction *linearModeAction = new KRadioAction (i18n("&Linear Layout"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotLinearMode()), @@ -1910,21 +1910,21 @@ void NotationView::setupActions() icon = TQIconSet(NotePixmapFactory::toTQPixmap (NotePixmapFactory::makeToolbarPixmap("triplet"))); (new KToggleAction(i18n("Trip&let Insert Mode"), icon, Key_G, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModetqStatus()), + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModeStatus()), actionCollection(), "triplet_mode"))-> setChecked(false); icon = TQIconSet(NotePixmapFactory::toTQPixmap (NotePixmapFactory::makeToolbarPixmap("chord"))); (new KToggleAction(i18n("C&hord Insert Mode"), icon, Key_H, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModetqStatus()), + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModeStatus()), actionCollection(), "chord_mode"))-> setChecked(false); icon = TQIconSet(NotePixmapFactory::toTQPixmap (NotePixmapFactory::makeToolbarPixmap("group-grace"))); (new KToggleAction(i18n("Grace Insert Mode"), icon, 0, - TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModetqStatus()), + TQT_TQOBJECT(this), TQT_SLOT(slotUpdateInsertModeStatus()), actionCollection(), "grace_mode"))-> setChecked(false); /*!!! @@ -2263,7 +2263,7 @@ void NotationView::setupActions() for (int i = 0; i <= 5; ++i) { new KAction(slashTitles[i], 0, TQT_TQOBJECT(this), TQT_SLOT(slotAddSlashes()), actionCollection(), - TQString("slashes_%1").tqarg(i).ascii()); + TQString("slashes_%1").arg(i).ascii()); } new KAction(ClefInsertionCommand::getGlobalName(), 0, TQT_TQOBJECT(this), @@ -2546,7 +2546,7 @@ NotationView::setupFontSizeMenu(std::string oldFontName) for (unsigned int i = 0; i < sizes.size(); ++i) { KAction *action = actionCollection()->action - (TQString("note_font_size_%1").tqarg(sizes[i]).ascii()); + (TQString("note_font_size_%1").arg(sizes[i]).ascii()); m_fontSizeActionMenu->remove (action); @@ -2560,7 +2560,7 @@ NotationView::setupFontSizeMenu(std::string oldFontName) for (unsigned int i = 0; i < sizes.size(); ++i) { - TQString actionName = TQString("note_font_size_%1").tqarg(sizes[i]); + TQString actionName = TQString("note_font_size_%1").arg(sizes[i]); KToggleAction *sizeAction = dynamic_cast<KToggleAction *> (actionCollection()->action(actionName.ascii())); @@ -2611,7 +2611,7 @@ void NotationView::initLayoutToolbar() if (!layoutToolbar) { std::cerr - << "NotationView::initLayoutToolbar() : tqlayout toolbar not found" + << "NotationView::initLayoutToolbar() : layout toolbar not found" << std::endl; return ; } @@ -2679,7 +2679,7 @@ void NotationView::initLayoutToolbar() // // spacing combo // - int defaultSpacing = m_htqlayout->getSpacing(); + int defaultSpacing = m_hlayout->getSpacing(); std::vector<int> spacings = NotationHLayout::getAvailableSpacings(); m_spacingCombo = new KComboBox(layoutToolbar, "spacing combo"); @@ -2786,17 +2786,17 @@ NotationView::setPageMode(LinedStaff::PageMode pageMode) int topMargin = 0, leftMargin = 0; getPageMargins(leftMargin, topMargin); - m_htqlayout->setPageMode(pageMode != LinedStaff::LinearMode); - m_htqlayout->setPageWidth(pageWidth - leftMargin * 2); + m_hlayout->setPageMode(pageMode != LinedStaff::LinearMode); + m_hlayout->setPageWidth(pageWidth - leftMargin * 2); - NOTATION_DEBUG << "NotationView::setPageMode: set tqlayout's page width to " + NOTATION_DEBUG << "NotationView::setPageMode: set layout's page width to " << (pageWidth - leftMargin * 2) << endl; positionStaffs(); bool layoutApplied = applyLayout(); if (!layoutApplied) - KMessageBox::sorry(0, "Couldn't apply tqlayout"); + KMessageBox::sorry(0, "Couldn't apply layout"); else { for (unsigned int i = 0; i < m_staffs.size(); ++i) { m_staffs[i]->markChanged(); @@ -2894,7 +2894,7 @@ void NotationView::scrollToTime(timeT t) { - double notationViewLayoutCoord = m_htqlayout->getXForTime(t); + double notationViewLayoutCoord = m_hlayout->getXForTime(t); // Doesn't appear to matter which staff we use //!!! actually it probably does matter, if they don't have the same extents @@ -2912,7 +2912,7 @@ NotationView::scrollToTime(timeT t) RulerScale* NotationView::getHLayout() { - return m_htqlayout; + return m_hlayout; } void @@ -2948,8 +2948,8 @@ NotationView::paintEvent(TQPaintEvent *e) getPageMargins(leftMargin, topMargin); if (m_pageMode == LinedStaff::ContinuousPageMode) { - // retqlayout if the window width changes significantly in continuous page mode - int diff = int(getPageWidth() - leftMargin * 2 - m_htqlayout->getPageWidth()); + // relayout if the window width changes significantly in continuous page mode + int diff = int(getPageWidth() - leftMargin * 2 - m_hlayout->getPageWidth()); if (diff < -10 || diff > 10) { setPageMode(m_pageMode); refreshSegment(0, 0, 0); @@ -2990,15 +2990,15 @@ NotationView::paintEvent(TQPaintEvent *e) } } - slotSetOperationNameAndtqStatus(i18n(" Ready.")); + slotSetOperationNameAndStatus(i18n(" Ready.")); } bool NotationView::applyLayout(int staffNo, timeT startTime, timeT endTime) { - slotSetOperationNameAndtqStatus(i18n("Laying out score...")); + slotSetOperationNameAndStatus(i18n("Laying out score...")); ProgressDialog::processEvents(); - m_htqlayout->setStaffCount(m_staffs.size()); + m_hlayout->setStaffCount(m_staffs.size()); Profiler profiler("NotationView::applyLayout"); unsigned int i; @@ -3008,20 +3008,20 @@ bool NotationView::applyLayout(int staffNo, timeT startTime, timeT endTime) if (staffNo >= 0 && (int)i != staffNo) continue; - slotSetOperationNameAndtqStatus(i18n("Laying out staff %1...").tqarg(i + 1)); + slotSetOperationNameAndStatus(i18n("Laying out staff %1...").arg(i + 1)); ProgressDialog::processEvents(); - m_htqlayout->resetStaff(*m_staffs[i], startTime, endTime); - m_vtqlayout->resetStaff(*m_staffs[i], startTime, endTime); - m_htqlayout->scanStaff(*m_staffs[i], startTime, endTime); - m_vtqlayout->scanStaff(*m_staffs[i], startTime, endTime); + m_hlayout->resetStaff(*m_staffs[i], startTime, endTime); + m_vlayout->resetStaff(*m_staffs[i], startTime, endTime); + m_hlayout->scanStaff(*m_staffs[i], startTime, endTime); + m_vlayout->scanStaff(*m_staffs[i], startTime, endTime); } - slotSetOperationNameAndtqStatus(i18n("Reconciling staffs...")); + slotSetOperationNameAndStatus(i18n("Reconciling staffs...")); ProgressDialog::processEvents(); - m_htqlayout->finishLayout(startTime, endTime); - m_vtqlayout->finishLayout(startTime, endTime); + m_hlayout->finishLayout(startTime, endTime); + m_vlayout->finishLayout(startTime, endTime); // find the last finishing staff for future use @@ -3194,8 +3194,8 @@ void NotationView::setCurrentSelection(EventSelection* s, bool preview, getLinedStaff(segment)->positionElements(std::min(startA, startB), std::max(endA, endB)); } else { - // mark refresh status and then request a tqrepaint - segment.getRefreshtqStatus + // mark refresh status and then request a repaint + segment.getRefreshStatus (m_segmentsRefreshStatusIds [getLinedStaff(segment)->getId()]). push(std::min(startA, startB), std::max(endA, endB)); @@ -3211,14 +3211,14 @@ void NotationView::setCurrentSelection(EventSelection* s, bool preview, getLinedStaff(s->getSegment())->positionElements(startB, endB); } else { - // mark refresh status and then request a tqrepaint + // mark refresh status and then request a repaint - oldSelection->getSegment().getRefreshtqStatus + oldSelection->getSegment().getRefreshStatus (m_segmentsRefreshStatusIds [getLinedStaff(oldSelection->getSegment())->getId()]). push(startA, endA); - s->getSegment().getRefreshtqStatus + s->getSegment().getRefreshStatus (m_segmentsRefreshStatusIds [getLinedStaff(s->getSegment())->getId()]). push(startB, endB); @@ -3349,10 +3349,10 @@ void NotationView::setNotePixmapFactory(NotePixmapFactory* f) { delete m_notePixmapFactory; m_notePixmapFactory = f; - if (m_htqlayout) - m_htqlayout->setNotePixmapFactory(m_notePixmapFactory); - if (m_vtqlayout) - m_vtqlayout->setNotePixmapFactory(m_notePixmapFactory); + if (m_hlayout) + m_hlayout->setNotePixmapFactory(m_notePixmapFactory); + if (m_vlayout) + m_vlayout->setNotePixmapFactory(m_notePixmapFactory); } Segment * @@ -3469,7 +3469,7 @@ NotationView::getStaffForCanvasCoords(int x, int y) const LinedStaff::LinedStaffCoords coords = s->getLayoutCoordsForCanvasCoords(x, y); - timeT t = m_htqlayout->getTimeForX(coords.first); + timeT t = m_hlayout->getTimeForX(coords.first); // In order to find the correct starting and ending bar of the segment, // make infinitesimal shifts (+1 and -1) towards its center. timeT t0 = getDocument()->getComposition().getBarStartForTime(m_staffs[m_currentStaff]->getSegment().getStartTime()+1); @@ -3488,7 +3488,7 @@ NotationView::getStaffForCanvasCoords(int x, int y) const LinedStaff::LinedStaffCoords coords = s->getLayoutCoordsForCanvasCoords(x, y); - timeT t = m_htqlayout->getTimeForX(coords.first); + timeT t = m_hlayout->getTimeForX(coords.first); // In order to find the correct starting and ending bar of the segment, // make infinitesimal shifts (+1 and -1) towards its center. timeT t0 = getDocument()->getComposition().getBarStartForTime(m_staffs[i]->getSegment().getStartTime()+1); @@ -3589,8 +3589,8 @@ void NotationView::print(bool previewOnly) LinedStaff::LinedStaffCoords cc1 = staff->getLayoutCoordsForCanvasCoords (pageRect.x() + pageRect.width(), pageRect.y() + pageRect.height()); - timeT t0 = m_htqlayout->getTimeForX(cc0.first); - timeT t1 = m_htqlayout->getTimeForX(cc1.first); + timeT t0 = m_hlayout->getTimeForX(cc0.first); + timeT t1 = m_hlayout->getTimeForX(cc1.first); m_staffs[i]->setPrintPainter(&printpainter); m_staffs[i]->checkRendered(t0, t1); @@ -3629,8 +3629,8 @@ void NotationView::print(bool previewOnly) LinedStaff::LinedStaffCoords cc1 = staff->getLayoutCoordsForCanvasCoords (pageRect.x() + pageRect.width(), pageRect.y() + pageRect.height()); - timeT t0 = m_htqlayout->getTimeForX(cc0.first); - timeT t1 = m_htqlayout->getTimeForX(cc1.first); + timeT t0 = m_hlayout->getTimeForX(cc0.first); + timeT t1 = m_hlayout->getTimeForX(cc1.first); m_staffs[i]->renderPrintable(t0, t1); } @@ -3745,7 +3745,7 @@ NotationView::updateThumbnails(bool complete) int w = pageWidth - leftMargin / 2; int h = pageHeight; - TQString str = TQString("%1").tqarg(page + 1); + TQString str = TQString("%1").arg(page + 1); thumbPainter.drawRect(x / thumbScale, y / thumbScale, w / thumbScale, h / thumbScale); @@ -3809,7 +3809,7 @@ void NotationView::refreshSegment(Segment *segment, } setMenuStates(); - slotSetOperationNameAndtqStatus(i18n(" Ready.")); + slotSetOperationNameAndStatus(i18n(" Ready.")); NOTATION_DEBUG << "*** " << endl; } @@ -3876,7 +3876,7 @@ void NotationView::readjustCanvasSize() double maxWidth = 0.0; int maxHeight = 0; - slotSetOperationNameAndtqStatus(i18n("Sizing and allocating canvas...")); + slotSetOperationNameAndStatus(i18n("Sizing and allocating canvas...")); ProgressDialog::processEvents(); int progressTotal = m_staffs.size() + 2; @@ -3886,7 +3886,7 @@ void NotationView::readjustCanvasSize() LinedStaff &staff = *m_staffs[i]; - staff.sizeStaff(*m_htqlayout); + staff.sizeStaff(*m_hlayout); UPDATE_PROGRESS(1); if (staff.getTotalWidth() + staff.getX() > maxWidth) { @@ -3944,7 +3944,7 @@ void NotationView::readjustCanvasSize() } } - // Give a correct vertical tqalignment to track headers + // Give a correct vertical alignment to track headers if ((m_pageMode == LinedStaff::LinearMode) && m_showHeadersGroup) { m_headersGroupView->setContentsPos(0, getCanvasView()->contentsY()); } @@ -4067,7 +4067,7 @@ void NotationView::initActionDataMaps() (NotationStrings::getReferenceName(Note(type, 0), false)); TQString shortName(TQString("change_%1%2") - .tqarg(notationOnly ? "notation_" : "").tqarg(refName)); + .arg(notationOnly ? "notation_" : "").arg(refName)); shortName.replace(TQRegExp("-"), "_"); TQString titleName @@ -4095,7 +4095,7 @@ void NotationView::initActionDataMaps() Mark mark = marks[i]; TQString markName(strtoqstr(mark)); - TQString actionName = TQString("add_%1").tqarg(markName); + TQString actionName = TQString("add_%1").arg(markName); m_markActionDataMap->insert (actionName, new MarkActionData @@ -4110,10 +4110,10 @@ void NotationView::setupProgress(KProgress* bar) if (bar) { NOTATION_DEBUG << "NotationView::setupProgress(bar)\n"; - connect(m_htqlayout, TQT_SIGNAL(setProgress(int)), + connect(m_hlayout, TQT_SIGNAL(setProgress(int)), bar, TQT_SLOT(setValue(int))); - connect(m_htqlayout, TQT_SIGNAL(incrementProgress(int)), + connect(m_hlayout, TQT_SIGNAL(incrementProgress(int)), bar, TQT_SLOT(advance(int))); connect(this, TQT_SIGNAL(setProgress(int)), @@ -4142,11 +4142,11 @@ void NotationView::setupProgress(ProgressDialog* dialog) setupProgress(dialog->progressBar()); connect(dialog, TQT_SIGNAL(cancelClicked()), - m_htqlayout, TQT_SLOT(slotCancel())); + m_hlayout, TQT_SLOT(slotCancel())); for (unsigned int i = 0; i < m_staffs.size(); ++i) { connect(m_staffs[i], TQT_SIGNAL(setOperationName(TQString)), - this, TQT_SLOT(slotSetOperationNameAndtqStatus(TQString))); + this, TQT_SLOT(slotSetOperationNameAndStatus(TQString))); connect(dialog, TQT_SIGNAL(cancelClicked()), m_staffs[i], TQT_SLOT(slotCancel())); @@ -4159,10 +4159,10 @@ void NotationView::setupProgress(ProgressDialog* dialog) } -void NotationView::slotSetOperationNameAndtqStatus(TQString name) +void NotationView::slotSetOperationNameAndStatus(TQString name) { emit setOperationName(name); - statusBar()->changeItem(TQString(" %1").tqarg(name), + statusBar()->changeItem(TQString(" %1").arg(name), KTmpStatusMsg::getDefaultId()); } @@ -4170,7 +4170,7 @@ void NotationView::disconnectProgress() { NOTATION_DEBUG << "NotationView::disconnectProgress()" << endl; - m_htqlayout->disconnect(); + m_hlayout->disconnect(); disconnect(TQT_SIGNAL(setProgress(int))); disconnect(TQT_SIGNAL(incrementProgress(int))); disconnect(TQT_SIGNAL(setOperationName(TQString))); @@ -4203,18 +4203,18 @@ void NotationView::updateViewCaption() trackPosition = track->getPosition(); // std::cout << std::endl << std::endl << std::endl << "DEBUG TITLE BAR: " << getDocument()->getTitle() << std::endl << std::endl << std::endl; setCaption(i18n("%1 - Segment Track #%2 - Notation") - .tqarg(getDocument()->getTitle()) - .tqarg(trackPosition + 1)); + .arg(getDocument()->getTitle()) + .arg(trackPosition + 1)); } else if (m_segments.size() == getDocument()->getComposition().getNbSegments()) { setCaption(i18n("%1 - All Segments - Notation") - .tqarg(getDocument()->getTitle())); + .arg(getDocument()->getTitle())); } else { setCaption(i18n("%1 - Segment - Notation", "%1 - %n Segments - Notation", m_segments.size()) - .tqarg(getDocument()->getTitle())); + .arg(getDocument()->getTitle())); } } @@ -4230,7 +4230,7 @@ NotationView::MarkActionDataMap* NotationView::m_markActionDataMap = 0; void -NotationView::slotUpdateInsertModetqStatus() +NotationView::slotUpdateInsertModeStatus() { TQString tripletMessage = i18n("Triplet"); TQString chordMessage = i18n("Chord"); @@ -4238,22 +4238,22 @@ NotationView::slotUpdateInsertModetqStatus() TQString message; if (isInTripletMode()) { - message = i18n("%1 %2").tqarg(message).tqarg(tripletMessage); + message = i18n("%1 %2").arg(message).arg(tripletMessage); } if (isInChordMode()) { - message = i18n("%1 %2").tqarg(message).tqarg(chordMessage); + message = i18n("%1 %2").arg(message).arg(chordMessage); } if (isInGraceMode()) { - message = i18n("%1 %2").tqarg(message).tqarg(graceMessage); + message = i18n("%1 %2").arg(message).arg(graceMessage); } m_insertModeLabel->setText(message); } void -NotationView::slotUpdateAnnotationstqStatus() +NotationView::slotUpdateAnnotationsStatus() { if (!areAnnotationsVisible()) { for (int i = 0; i < getStaffCount(); ++i) { @@ -4273,7 +4273,7 @@ NotationView::slotUpdateAnnotationstqStatus() } void -NotationView::slotUpdateLilyPondDirectivestqStatus() +NotationView::slotUpdateLilyPondDirectivesStatus() { if (!areLilyPondDirectivesVisible()) { for (int i = 0; i < getStaffCount(); ++i) { @@ -4317,22 +4317,22 @@ NotationView::slotChangeSpacingFromAction() } else { KMessageBox::sorry - (this, i18n("Unknown spacing action %1").tqarg(name)); + (this, i18n("Unknown spacing action %1").arg(name)); } } void NotationView::slotChangeSpacing(int spacing) { - if (m_htqlayout->getSpacing() == spacing) + if (m_hlayout->getSpacing() == spacing) return ; - m_htqlayout->setSpacing(spacing); + m_hlayout->setSpacing(spacing); // m_spacingSlider->setSize(spacing); KToggleAction *action = dynamic_cast<KToggleAction *> - (actionCollection()->action(TQString("spacing_%1").tqarg(spacing).ascii())); + (actionCollection()->action(TQString("spacing_%1").arg(spacing).ascii())); if (action) action->setChecked(true); else { @@ -4357,7 +4357,7 @@ NotationView::slotChangeSpacing(int spacing) void NotationView::slotChangeProportionFromIndex(int n) { - std::vector<int> proportions = m_htqlayout->getAvailableProportions(); + std::vector<int> proportions = m_hlayout->getAvailableProportions(); if (n >= (int)proportions.size()) n = proportions.size() - 1; slotChangeProportion(proportions[n]); @@ -4375,22 +4375,22 @@ NotationView::slotChangeProportionFromAction() } else { KMessageBox::sorry - (this, i18n("Unknown proportion action %1").tqarg(name)); + (this, i18n("Unknown proportion action %1").arg(name)); } } void NotationView::slotChangeProportion(int proportion) { - if (m_htqlayout->getProportion() == proportion) + if (m_hlayout->getProportion() == proportion) return ; - m_htqlayout->setProportion(proportion); + m_hlayout->setProportion(proportion); // m_proportionSlider->setSize(proportion); KToggleAction *action = dynamic_cast<KToggleAction *> - (actionCollection()->action(TQString("proportion_%1").tqarg(proportion).ascii())); + (actionCollection()->action(TQString("proportion_%1").arg(proportion).ascii())); if (action) action->setChecked(true); else { @@ -4422,7 +4422,7 @@ NotationView::slotChangeFontFromAction() slotChangeFont(name); } else { KMessageBox::sorry - (this, i18n("Unknown font action %1").tqarg(name)); + (this, i18n("Unknown font action %1").arg(name)); } } @@ -4440,11 +4440,11 @@ NotationView::slotChangeFontSizeFromAction() slotChangeFont(m_fontName, size); else { KMessageBox::sorry - (this, i18n("Unknown font size %1").tqarg(name)); + (this, i18n("Unknown font size %1").arg(name)); } } else { KMessageBox::sorry - (this, i18n("Unknown font size action %1").tqarg(name)); + (this, i18n("Unknown font size action %1").arg(name)); } } @@ -4581,7 +4581,7 @@ NotationView::slotChangeFont(std::string newName, int newSize) int topMargin = 0, leftMargin = 0; getPageMargins(leftMargin, topMargin); - m_htqlayout->setPageWidth(pageWidth - leftMargin * 2); + m_hlayout->setPageWidth(pageWidth - leftMargin * 2); } for (unsigned int i = 0; i < m_staffs.size(); ++i) { @@ -4594,7 +4594,7 @@ NotationView::slotChangeFont(std::string newName, int newSize) bool layoutApplied = applyLayout(); if (!layoutApplied) - KMessageBox::sorry(0, "Couldn't apply tqlayout"); + KMessageBox::sorry(0, "Couldn't apply layout"); else { for (unsigned int i = 0; i < m_staffs.size(); ++i) { m_staffs[i]->markChanged(); @@ -5357,7 +5357,7 @@ void NotationView::slotAddIndication(std::string type, TQString desc) setSingleSelectedEvent(m_currentEventSelection->getSegment(), command->getLastInsertedEvent()); } else { - KMessageBox::sorry(this, i18n("Can't add overlapping %1 indications").tqarg(desc)); // TODO PLURAL - how many 'indications' ? + KMessageBox::sorry(this, i18n("Can't add overlapping %1 indications").arg(desc)); // TODO PLURAL - how many 'indications' ? delete command; } } @@ -5568,7 +5568,7 @@ void NotationView::slotSetStyleFromAction() if (name.left(6) == "style_") { name = name.right(name.length() - 6); - KTmpStatusMsg msg(i18n("Changing to %1 style...").tqarg(name), + KTmpStatusMsg msg(i18n("Changing to %1 style...").arg(name), this); addCommandToHistory(new ChangeStyleCommand @@ -5576,7 +5576,7 @@ void NotationView::slotSetStyleFromAction() *m_currentEventSelection)); } else { KMessageBox::sorry - (this, i18n("Unknown style action %1").tqarg(name)); + (this, i18n("Unknown style action %1").arg(name)); } } @@ -5608,7 +5608,7 @@ void NotationView::slotInsertNoteFromAction() } catch (...) { KMessageBox::sorry - (this, i18n("Unknown note insert action %1").tqarg(name)); + (this, i18n("Unknown note insert action %1").arg(name)); return ; } @@ -6027,9 +6027,9 @@ NotationView::slotMakeOrnament() TQString name; int barNo = segment.getComposition()->getBarNumber(absTime); if (track) { - name = TQString(i18n("Ornament track %1 bar %2").tqarg(track->getPosition() + 1).tqarg(barNo + 1)); + name = TQString(i18n("Ornament track %1 bar %2").arg(track->getPosition() + 1).arg(barNo + 1)); } else { - name = TQString(i18n("Ornament bar %1").tqarg(barNo + 1)); + name = TQString(i18n("Ornament bar %1").arg(barNo + 1)); } MakeOrnamentDialog dialog(this, name, basePitch); @@ -6438,22 +6438,22 @@ NotationView::slotSetPointerPosition(timeT time, bool scroll) for (unsigned int i = 0; i < m_staffs.size(); ++i) { - double layoutX = m_htqlayout->getXForTimeByEvent(time); + double layoutX = m_hlayout->getXForTimeByEvent(time); Segment &seg = m_staffs[i]->getSegment(); bool good = true; - if (barNo >= m_htqlayout->getLastVisibleBarOnStaff(*m_staffs[i])) { + if (barNo >= m_hlayout->getLastVisibleBarOnStaff(*m_staffs[i])) { if (seg.isRepeating() && time < seg.getRepeatEndTime()) { timeT mappedTime = seg.getStartTime() + ((time - seg.getStartTime()) % (seg.getEndMarkerTime() - seg.getStartTime())); - layoutX = m_htqlayout->getXForTimeByEvent(mappedTime); + layoutX = m_hlayout->getXForTimeByEvent(mappedTime); } else { good = false; } - } else if (barNo < m_htqlayout->getFirstVisibleBarOnStaff(*m_staffs[i])) { + } else if (barNo < m_hlayout->getFirstVisibleBarOnStaff(*m_staffs[i])) { good = false; } @@ -6536,7 +6536,7 @@ NotationView::slotSetCurrentStaff(int staffNo) m_chordNameRuler->setCurrentSegment(segment); m_rawNoteRuler->setCurrentSegment(segment); - m_rawNoteRuler->tqrepaint(); + m_rawNoteRuler->repaint(); setControlRulersCurrentSegment(); updateView(); @@ -6750,7 +6750,7 @@ NotationView::doDeferredCursorMove() t == segment.getEndTime() || t == segment.getBarStartForTime(t)) { - staff->setInsertCursorPosition(*m_htqlayout, t); + staff->setInsertCursorPosition(*m_hlayout, t); if (type == CursorMoveAndMakeVisible) { double cx; @@ -6976,21 +6976,21 @@ void NotationView::slotMultiPageMode() void NotationView::slotToggleChordsRuler() { - if (m_htqlayout->isPageMode()) + if (m_hlayout->isPageMode()) return ; toggleWidget(m_chordNameRuler, "show_chords_ruler"); } void NotationView::slotToggleRawNoteRuler() { - if (m_htqlayout->isPageMode()) + if (m_hlayout->isPageMode()) return ; toggleWidget(m_rawNoteRuler, "show_raw_note_ruler"); } void NotationView::slotToggleTempoRuler() { - if (m_htqlayout->isPageMode()) + if (m_hlayout->isPageMode()) return ; toggleWidget(m_tempoRuler, "show_tempo_ruler"); } @@ -6998,7 +6998,7 @@ void NotationView::slotToggleTempoRuler() void NotationView::slotToggleAnnotations() { m_annotationsVisible = !m_annotationsVisible; - slotUpdateAnnotationstqStatus(); + slotUpdateAnnotationsStatus(); //!!! use refresh mechanism refreshSegment(0, 0, 0); } @@ -7006,7 +7006,7 @@ void NotationView::slotToggleAnnotations() void NotationView::slotToggleLilyPondDirectives() { m_lilyPondDirectivesVisible = !m_lilyPondDirectivesVisible; - slotUpdateLilyPondDirectivestqStatus(); + slotUpdateLilyPondDirectivesStatus(); //!!! use refresh mechanism refreshSegment(0, 0, 0); } @@ -7116,7 +7116,7 @@ void NotationView::slotNonNotationItemPressed(TQMouseEvent *e, TQCanvasItem *it) } else if (dynamic_cast<TQCanvasTimeSigSprite *>(it)) { double layoutX = (dynamic_cast<TQCanvasTimeSigSprite *>(it))->getLayoutX(); - emit editTimeSignature(m_htqlayout->getTimeForX(layoutX)); + emit editTimeSignature(m_hlayout->getTimeForX(layoutX)); } } @@ -7194,17 +7194,17 @@ NotationView::slotHoveredOverAbsoluteTimeChanged(unsigned int time) // TQString message; // TQString format("%ld (%ld.%03lds)"); - // format = i18n("Time: %1").tqarg(format); + // format = i18n("Time: %1").arg(format); // message.sprintf(format, t, rt.sec, ms); TQString message = i18n("Time: %1 (%2.%3s)") - .tqarg(TQString("%1-%2-%3-%4") - .tqarg(TQString("%1").tqarg(bar + 1).rightJustify(3, '0')) - .tqarg(TQString("%1").tqarg(beat).rightJustify(2, '0')) - .tqarg(TQString("%1").tqarg(fraction).rightJustify(2, '0')) - .tqarg(TQString("%1").tqarg(remainder).rightJustify(2, '0'))) - .tqarg(rt.sec) - .tqarg(TQString("%1").tqarg(ms).rightJustify(3, '0')); + .arg(TQString("%1-%2-%3-%4") + .arg(TQString("%1").arg(bar + 1).rightJustify(3, '0')) + .arg(TQString("%1").arg(beat).rightJustify(2, '0')) + .arg(TQString("%1").arg(fraction).rightJustify(2, '0')) + .arg(TQString("%1").arg(remainder).rightJustify(2, '0'))) + .arg(rt.sec) + .arg(TQString("%1").arg(ms).rightJustify(3, '0')); m_hoveredOverAbsoluteTime->setText(message); } @@ -7396,8 +7396,8 @@ NotationView::slotCheckRendered(double cx0, double cx1) LinedStaff::LinedStaffCoords cc1 = staff->getLayoutCoordsForCanvasCoords (cx1, staff->getTotalHeight() + staff->getY()); - timeT t0 = m_htqlayout->getTimeForX(cc0.first); - timeT t1 = m_htqlayout->getTimeForX(cc1.first); + timeT t0 = m_hlayout->getTimeForX(cc0.first); + timeT t1 = m_hlayout->getTimeForX(cc1.first); if (dynamic_cast<NotationStaff *>(staff)->checkRendered(t0, t1)) { something = true; //!!! |