diff options
Diffstat (limited to 'src/gui/editors/parameters/SegmentParameterBox.cpp')
-rw-r--r-- | src/gui/editors/parameters/SegmentParameterBox.cpp | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/src/gui/editors/parameters/SegmentParameterBox.cpp b/src/gui/editors/parameters/SegmentParameterBox.cpp index c17cbe2..23fce12 100644 --- a/src/gui/editors/parameters/SegmentParameterBox.cpp +++ b/src/gui/editors/parameters/SegmentParameterBox.cpp @@ -24,7 +24,7 @@ #include "SegmentParameterBox.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> @@ -61,30 +61,30 @@ #include <kconfig.h> #include <klineeditdlg.h> #include <ktabwidget.h> -#include <qbutton.h> -#include <qcheckbox.h> -#include <qcolor.h> -#include <qdialog.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qframe.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qscrollview.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qvbox.h> -#include <qwidget.h> -#include <qwidgetstack.h> +#include <tqbutton.h> +#include <tqcheckbox.h> +#include <tqcolor.h> +#include <tqdialog.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqframe.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqscrollview.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqvbox.h> +#include <tqwidget.h> +#include <tqwidgetstack.h> namespace Rosegarden { SegmentParameterBox::SegmentParameterBox(RosegardenGUIDoc* doc, - QWidget *parent) + TQWidget *parent) : RosegardenParameterBox(i18n("Segment"), i18n("Segment Parameters"), parent), @@ -98,8 +98,8 @@ SegmentParameterBox::SegmentParameterBox(RosegardenGUIDoc* doc, m_doc->getComposition().addObserver(this); - connect(getCommandHistory(), SIGNAL(commandExecuted()), - this, SLOT(update())); + connect(getCommandHistory(), TQT_SIGNAL(commandExecuted()), + this, TQT_SLOT(update())); } SegmentParameterBox::~SegmentParameterBox() @@ -112,48 +112,48 @@ SegmentParameterBox::~SegmentParameterBox() void SegmentParameterBox::initBox() { - QFont font(m_font); + TQFont font(m_font); - QFontMetrics fontMetrics(font); + TQFontMetrics fontMetrics(font); // magic numbers: 13 is the height of the menu pixmaps, 10 is just 10 //int comboHeight = std::max(fontMetrics.height(), 13) + 10; int width = fontMetrics.width("12345678901234567890"); - // QFrame *frame = new QFrame(this); - QGridLayout *gridLayout = new QGridLayout(this, 8, 6, 4, 2); + // TQFrame *frame = new TQFrame(this); + TQGridLayout *gridLayout = new TQGridLayout(this, 8, 6, 4, 2); - QLabel *label = new QLabel(i18n("Label"), this); - QLabel *repeatLabel = new QLabel(i18n("Repeat"), this); - QLabel *quantizeLabel = new QLabel(i18n("Quantize"), this); - QLabel *transposeLabel = new QLabel(i18n("Transpose"), this); - QLabel *delayLabel = new QLabel(i18n("Delay"), this); - QLabel *colourLabel = new QLabel(i18n("Color"), this); -// m_autoFadeLabel = new QLabel(i18n("Audio auto-fade"), this); -// m_fadeInLabel = new QLabel(i18n("Fade in"), this); -// m_fadeOutLabel = new QLabel(i18n("Fade out"), this); -// m_rangeLabel = new QLabel(i18n("Range"), this); + TQLabel *label = new TQLabel(i18n("Label"), this); + TQLabel *repeatLabel = new TQLabel(i18n("Repeat"), this); + TQLabel *quantizeLabel = new TQLabel(i18n("Quantize"), this); + TQLabel *transposeLabel = new TQLabel(i18n("Transpose"), this); + TQLabel *delayLabel = new TQLabel(i18n("Delay"), this); + TQLabel *colourLabel = new TQLabel(i18n("Color"), this); +// m_autoFadeLabel = new TQLabel(i18n("Audio auto-fade"), this); +// m_fadeInLabel = new TQLabel(i18n("Fade in"), this); +// m_fadeOutLabel = new TQLabel(i18n("Fade out"), this); +// m_rangeLabel = new TQLabel(i18n("Range"), this); // Label .. - m_label = new QLabel(this); + m_label = new TQLabel(this); m_label->setFont(font); m_label->setFixedWidth(width); //m_label->setFixedHeight(comboHeight); - m_label->setFrameStyle(QFrame::Panel | QFrame::Sunken); + m_label->setFrameStyle(TQFrame::Panel | TQFrame::Sunken); // .. and edit button - m_labelButton = new QPushButton(i18n("Edit"), this); + m_labelButton = new TQPushButton(i18n("Edit"), this); m_labelButton->setFont(font); // m_labelButton->setFixedWidth(50); - connect(m_labelButton, SIGNAL(released()), - SLOT(slotEditSegmentLabel())); + connect(m_labelButton, TQT_SIGNAL(released()), + TQT_SLOT(slotEditSegmentLabel())); m_repeatValue = new TristateCheckBox(this); m_repeatValue->setFont(font); //m_repeatValue->setFixedHeight(comboHeight); // handle state changes - connect(m_repeatValue, SIGNAL(pressed()), SLOT(slotRepeatPressed())); + connect(m_repeatValue, TQT_SIGNAL(pressed()), TQT_SLOT(slotRepeatPressed())); // non-reversing motif style read-only combo m_quantizeValue = new KComboBox(this); @@ -161,8 +161,8 @@ SegmentParameterBox::initBox() //m_quantizeValue->setFixedHeight(comboHeight); // handle quantize changes from drop down - connect(m_quantizeValue, SIGNAL(activated(int)), - SLOT(slotQuantizeSelected(int))); + connect(m_quantizeValue, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotQuantizeSelected(int))); // reversing motif style read-write combo m_transposeValue = new KComboBox(this); @@ -170,12 +170,12 @@ SegmentParameterBox::initBox() //m_transposeValue->setFixedHeight(comboHeight); // handle transpose combo changes - connect(m_transposeValue, SIGNAL(activated(int)), - SLOT(slotTransposeSelected(int))); + connect(m_transposeValue, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotTransposeSelected(int))); // and text changes - connect(m_transposeValue, SIGNAL(textChanged(const QString&)), - SLOT(slotTransposeTextChanged(const QString&))); + connect(m_transposeValue, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(slotTransposeTextChanged(const TQString&))); // reversing motif style read-write combo m_delayValue = new KComboBox(this); @@ -183,16 +183,16 @@ SegmentParameterBox::initBox() //m_delayValue->setFixedHeight(comboHeight); // handle delay combo changes - connect(m_delayValue, SIGNAL(activated(int)), - SLOT(slotDelaySelected(int))); + connect(m_delayValue, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotDelaySelected(int))); // Detect when the document colours are updated - connect(m_doc, SIGNAL(docColoursChanged()), - this, SLOT(slotDocColoursChanged())); + connect(m_doc, TQT_SIGNAL(docColoursChanged()), + this, TQT_SLOT(slotDocColoursChanged())); // handle text changes for delay - connect(m_delayValue, SIGNAL(textChanged(const QString&)), - SLOT(slotDelayTextChanged(const QString &))); + connect(m_delayValue, TQT_SIGNAL(textChanged(const TQString&)), + TQT_SLOT(slotDelayTextChanged(const TQString &))); // set up combo box for colours m_colourValue = new KComboBox(false, this); @@ -202,55 +202,55 @@ SegmentParameterBox::initBox() m_colourValue->setSizeLimit(20); // handle colour combo changes - connect(m_colourValue, SIGNAL(activated(int)), - SLOT(slotColourSelected(int))); + connect(m_colourValue, TQT_SIGNAL(activated(int)), + TQT_SLOT(slotColourSelected(int))); // pre-set width of buttons so they don't grow later // width = fontMetrics.width(i18n("used internally for spacing", "High: ----")); // highest playable note // -// m_highButton = new QPushButton(i18n("High: ---"), this); -// QToolTip::add +// m_highButton = new TQPushButton(i18n("High: ---"), this); +// TQToolTip::add // (m_highButton, i18n("Choose the highest suggested playable note, using a staff")); // m_highButton->setFont(font); // m_highButton->setMinimumWidth(width); -// connect(m_highButton, SIGNAL(released()), -// SLOT(slotHighestPressed())); +// connect(m_highButton, TQT_SIGNAL(released()), +// TQT_SLOT(slotHighestPressed())); // lowest playable note // -// m_lowButton = new QPushButton(i18n("Low: ----"), this); -// QToolTip::add +// m_lowButton = new TQPushButton(i18n("Low: ----"), this); +// TQToolTip::add // (m_lowButton, i18n("Choose the lowest suggested playable note, using a staff")); // m_lowButton->setFont(font); // m_lowButton->setMinimumWidth(width); -// connect(m_lowButton, SIGNAL(released()), -// SLOT(slotLowestPressed())); +// connect(m_lowButton, TQT_SIGNAL(released()), +// TQT_SLOT(slotLowestPressed())); // Audio autofade enabled // -// m_autoFadeBox = new QCheckBox(this); -// connect(m_autoFadeBox, SIGNAL(stateChanged(int)), -// this, SLOT(slotAudioFadeChanged(int))); +// m_autoFadeBox = new TQCheckBox(this); +// connect(m_autoFadeBox, TQT_SIGNAL(stateChanged(int)), +// this, TQT_SLOT(slotAudioFadeChanged(int))); // Fade in and out times // -// m_fadeInSpin = new QSpinBox(this); +// m_fadeInSpin = new TQSpinBox(this); // m_fadeInSpin->setMinValue(0); // m_fadeInSpin->setMaxValue(5000); // m_fadeInSpin->setSuffix(i18n(" ms")); -// connect(m_fadeInSpin, SIGNAL(valueChanged(int)), -// this, SLOT(slotFadeInChanged(int))); +// connect(m_fadeInSpin, TQT_SIGNAL(valueChanged(int)), +// this, TQT_SLOT(slotFadeInChanged(int))); -// m_fadeOutSpin = new QSpinBox(this); +// m_fadeOutSpin = new TQSpinBox(this); // m_fadeOutSpin->setMinValue(0); // m_fadeOutSpin->setMaxValue(5000); // m_fadeOutSpin->setSuffix(i18n(" ms")); -// connect(m_fadeOutSpin, SIGNAL(valueChanged(int)), -// this, SLOT(slotFadeOutChanged(int))); +// connect(m_fadeOutSpin, TQT_SIGNAL(valueChanged(int)), +// this, TQT_SLOT(slotFadeOutChanged(int))); label->setFont(font); repeatLabel->setFont(font); @@ -315,14 +315,14 @@ SegmentParameterBox::initBox() // populate the quantize combo // - QPixmap noMap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("menu-no-note")); + TQPixmap noMap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeToolbarPixmap("menu-no-note")); for (unsigned int i = 0; i < m_standardQuantizations.size(); ++i) { timeT time = m_standardQuantizations[i]; timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel(time, true, error); - QPixmap pmap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeNoteMenuPixmap(time, error)); + TQString label = NotationStrings::makeNoteMenuLabel(time, true, error); + TQPixmap pmap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeNoteMenuPixmap(time, error)); m_quantizeValue->insertItem(error ? noMap : pmap, label); } m_quantizeValue->insertItem(noMap, i18n("Off")); @@ -333,7 +333,7 @@ SegmentParameterBox::initBox() // populate the transpose combo // for (int i = -m_transposeRange; i < m_transposeRange + 1; i++) { - m_transposeValue->insertItem(noMap, QString("%1").arg(i)); + m_transposeValue->insertItem(noMap, TQString("%1").arg(i)); if (i == 0) m_transposeValue->setCurrentItem(m_transposeValue->count() - 1); } @@ -355,8 +355,8 @@ SegmentParameterBox::initBox() // resolution it might not be) & include a note pixmap if so // timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel(time, true, error); - QPixmap pmap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeNoteMenuPixmap(time, error)); + TQString label = NotationStrings::makeNoteMenuLabel(time, true, error); + TQPixmap pmap = NotePixmapFactory::toQPixmap(NotePixmapFactory::makeNoteMenuPixmap(time, error)); m_delayValue->insertItem((error ? noMap : pmap), label); } @@ -384,14 +384,14 @@ void SegmentParameterBox::setDocument(RosegardenGUIDoc* doc) { if (m_doc != 0) - disconnect(m_doc, SIGNAL(docColoursChanged()), - this, SLOT(slotDocColoursChanged())); + disconnect(m_doc, TQT_SIGNAL(docColoursChanged()), + this, TQT_SLOT(slotDocColoursChanged())); m_doc = doc; // Detect when the document colours are updated - connect (m_doc, SIGNAL(docColoursChanged()), - this, SLOT(slotDocColoursChanged())); + connect (m_doc, TQT_SIGNAL(docColoursChanged()), + this, TQT_SLOT(slotDocColoursChanged())); slotDocColoursChanged(); // repopulate combo } @@ -428,8 +428,8 @@ SegmentParameterBox::slotDocColoursChanged() unsigned int i = 0; for (RCMap::const_iterator it = temp.begin(); it != temp.end(); ++it) { - QString qtrunc(strtoqstr(it->second.second)); - QPixmap colour(15, 15); + TQString qtrunc(strtoqstr(it->second.second)); + TQPixmap colour(15, 15); colour.fill(GUIPalette::convertColour(it->second.first)); if (qtrunc == "") { m_colourValue->insertItem(colour, i18n("Default"), i); @@ -666,11 +666,11 @@ SegmentParameterBox::populateBoxFromSegments() // 2nd arg of "true" means "add if necessary" case All: m_transposeValue-> - setCurrentItem(QString("%1").arg(transposeLevel), true); + setCurrentItem(TQString("%1").arg(transposeLevel), true); break; case Some: - m_transposeValue->setCurrentItem(QString(""), true); + m_transposeValue->setCurrentItem(TQString(""), true); break; case None: @@ -687,7 +687,7 @@ SegmentParameterBox::populateBoxFromSegments() case All: if (delayLevel >= 0) { timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel(delayLevel, + TQString label = NotationStrings::makeNoteMenuLabel(delayLevel, true, error); m_delayValue->setCurrentItem(label, true); @@ -834,12 +834,12 @@ void SegmentParameterBox::slotRepeatPressed() bool state = false; switch (m_repeatValue->state()) { - case QButton::Off: + case TQButton::Off: state = true; break; - case QButton::NoChange: - case QButton::On: + case TQButton::NoChange: + case TQButton::On: default: state = false; break; @@ -874,7 +874,7 @@ SegmentParameterBox::slotQuantizeSelected(int qLevel) } void -SegmentParameterBox::slotTransposeTextChanged(const QString &text) +SegmentParameterBox::slotTransposeTextChanged(const TQString &text) { if (text.isEmpty() || m_segments.size() == 0) return ; @@ -934,7 +934,7 @@ SegmentParameterBox::slotDelayTimeChanged(timeT delayValue) } void -SegmentParameterBox::slotDelayTextChanged(const QString &text) +SegmentParameterBox::slotDelayTextChanged(const TQString &text) { if (text.isEmpty() || m_segments.size() == 0) return ; @@ -978,9 +978,9 @@ SegmentParameterBox::slotColourSelected(int value) addCommandToHistory(command); } else { ColourMap newMap = m_doc->getComposition().getSegmentColourMap(); - QColor newColour; + TQColor newColour; bool ok = false; - QString newName = KLineEditDlg::getText(i18n("New Color Name"), i18n("Enter new name"), + TQString newName = KLineEditDlg::getText(i18n("New Color Name"), i18n("Enter new name"), i18n("New"), &ok); if ((ok == true) && (!newName.isEmpty())) { KColorDialog box(this, "", true); @@ -1019,8 +1019,8 @@ SegmentParameterBox::updateHighLow() //!!! FIXME this code is broken, and needs to be fixed after the fashion of //the TPB, but I'm not bothering with that at this time, because they are //going to be hidden for 1.3 anyway -// m_highButton->setText(QString("&High: %1%2").arg(highest.getNoteName(key)).arg(highest.getOctave(base))); -// m_lowButton->setText(QString("&Low: %1%2").arg(lowest.getNoteName(key)).arg(lowest.getOctave(base))); +// m_highButton->setText(TQString("&High: %1%2").arg(highest.getNoteName(key)).arg(highest.getOctave(base))); +// m_lowButton->setText(TQString("&Low: %1%2").arg(lowest.getNoteName(key)).arg(lowest.getOctave(base))); } void @@ -1031,7 +1031,7 @@ SegmentParameterBox::slotHighestPressed() PitchPickerDialog dialog(0, m_highestPlayable, i18n("Highest playable note")); std::vector<Segment*>::iterator it; - if (dialog.exec() == QDialog::Accepted) { + if (dialog.exec() == TQDialog::Accepted) { m_highestPlayable = dialog.getPitch(); updateHighLow(); @@ -1051,7 +1051,7 @@ SegmentParameterBox::slotLowestPressed() PitchPickerDialog dialog(0, m_lowestPlayable, i18n("Lowest playable note")); std::vector<Segment*>::iterator it; - if (dialog.exec() == QDialog::Accepted) { + if (dialog.exec() == TQDialog::Accepted) { m_lowestPlayable = dialog.getPitch(); updateHighLow(); @@ -1078,7 +1078,7 @@ SegmentParameterBox::addCommandToHistory(KCommand *command) void SegmentParameterBox::slotEditSegmentLabel() { - QString editLabel; + TQString editLabel; if (m_segments.size() == 0) return ; @@ -1091,11 +1091,11 @@ SegmentParameterBox::slotEditSegmentLabel() // Remove the asterisk if we're using it // - QString label = m_label->text(); + TQString label = m_label->text(); if (label == "*") label = ""; - QString newLabel = KLineEditDlg::getText(editLabel, + TQString newLabel = KLineEditDlg::getText(editLabel, i18n("Enter new label"), m_label->text(), &ok, @@ -1127,7 +1127,7 @@ SegmentParameterBox::slotAudioFadeChanged(int value) return ; bool state = false; - if (value == QButton::On) + if (value == TQButton::On) state = true; std::vector<Segment*>::iterator it; @@ -1147,9 +1147,9 @@ SegmentParameterBox::slotFadeInChanged(int value) return ; if (value == 0 && m_fadeOutSpin->value() == 0) - slotAudioFadeChanged(QButton::Off); + slotAudioFadeChanged(TQButton::Off); else - slotAudioFadeChanged(QButton::On); + slotAudioFadeChanged(TQButton::On); // Convert from ms // @@ -1174,9 +1174,9 @@ SegmentParameterBox::slotFadeOutChanged(int value) return ; if (value == 0 && m_fadeInSpin->value() == 0) - slotAudioFadeChanged(QButton::Off); + slotAudioFadeChanged(TQButton::Off); else - slotAudioFadeChanged(QButton::On); + slotAudioFadeChanged(TQButton::On); // Convert from ms // |