diff options
Diffstat (limited to 'src/gui/dialogs/EventEditDialog.cpp')
-rw-r--r-- | src/gui/dialogs/EventEditDialog.cpp | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/src/gui/dialogs/EventEditDialog.cpp b/src/gui/dialogs/EventEditDialog.cpp index c9991f1..6446246 100644 --- a/src/gui/dialogs/EventEditDialog.cpp +++ b/src/gui/dialogs/EventEditDialog.cpp @@ -35,29 +35,29 @@ #include "gui/editors/notation/NotePixmapFactory.h" #include <kdialogbase.h> #include <kmessagebox.h> -#include <qcheckbox.h> -#include <qfont.h> -#include <qgrid.h> -#include <qgroupbox.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qobject.h> -#include <qobjectlist.h> -#include <qpushbutton.h> -#include <qscrollview.h> -#include <qsize.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qvbox.h> -#include <qwidget.h> +#include <tqcheckbox.h> +#include <tqfont.h> +#include <tqgrid.h> +#include <tqgroupbox.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqobject.h> +#include <tqobjectlist.h> +#include <tqpushbutton.h> +#include <tqscrollview.h> +#include <tqsize.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqvbox.h> +#include <tqwidget.h> namespace Rosegarden { -EventEditDialog::EventEditDialog(QWidget *parent, +EventEditDialog::EventEditDialog(TQWidget *parent, const Event &event, bool editable) : KDialogBase(parent, 0, true, i18n(editable ? "Advanced Event Edit" : "Advanced Event Viewer"), @@ -75,66 +75,66 @@ EventEditDialog::EventEditDialog(QWidget *parent, m_subOrdering(event.getSubOrdering()), m_modified(false) { - QVBox *vbox = makeVBoxMainWidget(); + TQVBox *vbox = makeVBoxMainWidget(); - QGroupBox *intrinsicBox = new QGroupBox + TQGroupBox *intrinsicBox = new QGroupBox (1, Horizontal, i18n("Intrinsics"), vbox); - QGrid *intrinsicGrid = new QGrid(4, QGrid::Horizontal, intrinsicBox); + TQGrid *intrinsicGrid = new TQGrid(4, TQGrid::Horizontal, intrinsicBox); - new QLabel(i18n("Event type: "), intrinsicGrid); - new QLabel("", intrinsicGrid); - new QLabel("", intrinsicGrid); - QLineEdit *lineEdit = new QLineEdit(intrinsicGrid); + new TQLabel(i18n("Event type: "), intrinsicGrid); + new TQLabel("", intrinsicGrid); + new TQLabel("", intrinsicGrid); + TQLineEdit *lineEdit = new TQLineEdit(intrinsicGrid); lineEdit->setText(strtoqstr(event.getType())); - new QLabel(i18n("Absolute time: "), intrinsicGrid); - new QLabel("", intrinsicGrid); - new QLabel("", intrinsicGrid); - QSpinBox *absoluteTime = new QSpinBox + new TQLabel(i18n("Absolute time: "), intrinsicGrid); + new TQLabel("", intrinsicGrid); + new TQLabel("", intrinsicGrid); + TQSpinBox *absoluteTime = new QSpinBox (INT_MIN, INT_MAX, Note(Note::Shortest).getDuration(), intrinsicGrid); absoluteTime->setValue(event.getAbsoluteTime()); - QObject::connect(absoluteTime, SIGNAL(valueChanged(int)), - this, SLOT(slotAbsoluteTimeChanged(int))); + TQObject::connect(absoluteTime, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotAbsoluteTimeChanged(int))); slotAbsoluteTimeChanged(event.getAbsoluteTime()); - new QLabel(i18n("Duration: "), intrinsicGrid); - m_durationDisplay = new QLabel("(note)", intrinsicGrid); + new TQLabel(i18n("Duration: "), intrinsicGrid); + m_durationDisplay = new TQLabel("(note)", intrinsicGrid); m_durationDisplay->setMinimumWidth(20); - m_durationDisplayAux = new QLabel("(note)", intrinsicGrid); + m_durationDisplayAux = new TQLabel("(note)", intrinsicGrid); m_durationDisplayAux->setMinimumWidth(20); - QSpinBox *duration = new QSpinBox + TQSpinBox *duration = new QSpinBox (0, INT_MAX, Note(Note::Shortest).getDuration(), intrinsicGrid); duration->setValue(event.getDuration()); - QObject::connect(duration, SIGNAL(valueChanged(int)), - this, SLOT(slotDurationChanged(int))); + TQObject::connect(duration, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotDurationChanged(int))); slotDurationChanged(event.getDuration()); - new QLabel(i18n("Sub-ordering: "), intrinsicGrid); - new QLabel("", intrinsicGrid); - new QLabel("", intrinsicGrid); + new TQLabel(i18n("Sub-ordering: "), intrinsicGrid); + new TQLabel("", intrinsicGrid); + new TQLabel("", intrinsicGrid); - QSpinBox *subOrdering = new QSpinBox( -100, 100, 1, intrinsicGrid); + TQSpinBox *subOrdering = new TQSpinBox( -100, 100, 1, intrinsicGrid); subOrdering->setValue(event.getSubOrdering()); - QObject::connect(subOrdering, SIGNAL(valueChanged(int)), - this, SLOT(slotSubOrderingChanged(int))); + TQObject::connect(subOrdering, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotSubOrderingChanged(int))); slotSubOrderingChanged(event.getSubOrdering()); - QGroupBox *persistentBox = new QGroupBox + TQGroupBox *persistentBox = new QGroupBox (1, Horizontal, i18n("Persistent properties"), vbox); - m_persistentGrid = new QGrid(4, QGrid::Horizontal, persistentBox); + m_persistentGrid = new TQGrid(4, TQGrid::Horizontal, persistentBox); - QLabel *label = new QLabel(i18n("Name"), m_persistentGrid); - QFont font(label->font()); + TQLabel *label = new TQLabel(i18n("Name"), m_persistentGrid); + TQFont font(label->font()); font.setItalic(true); label->setFont(font); - label = new QLabel(i18n("Type"), m_persistentGrid); + label = new TQLabel(i18n("Type"), m_persistentGrid); label->setFont(font); - label = new QLabel(i18n("Value"), m_persistentGrid); + label = new TQLabel(i18n("Value"), m_persistentGrid); label->setFont(font); - label = new QLabel("", m_persistentGrid); + label = new TQLabel("", m_persistentGrid); label->setFont(font); Event::PropertyNames p = event.getPersistentPropertyNames(); @@ -151,43 +151,43 @@ EventEditDialog::EventEditDialog(QWidget *parent, m_nonPersistentGrid = 0; } else { - QGroupBox *nonPersistentBox = new QGroupBox + TQGroupBox *nonPersistentBox = new QGroupBox (1, Horizontal, i18n("Non-persistent properties"), vbox); - new QLabel(i18n("These are cached values, lost if the event is modified."), + new TQLabel(i18n("These are cached values, lost if the event is modified."), nonPersistentBox); - m_nonPersistentView = new QScrollView(nonPersistentBox); - //m_nonPersistentView->setHScrollBarMode(QScrollView::AlwaysOff); - m_nonPersistentView->setResizePolicy(QScrollView::AutoOneFit); + m_nonPersistentView = new TQScrollView(nonPersistentBox); + //m_nonPersistentView->setHScrollBarMode(TQScrollView::AlwaysOff); + m_nonPersistentView->setResizePolicy(TQScrollView::AutoOneFit); m_nonPersistentGrid = new QGrid - (4, QGrid::Horizontal, m_nonPersistentView->viewport()); + (4, TQGrid::Horizontal, m_nonPersistentView->viewport()); m_nonPersistentView->addChild(m_nonPersistentGrid); m_nonPersistentGrid->setSpacing(4); m_nonPersistentGrid->setMargin(5); - label = new QLabel(i18n("Name "), m_nonPersistentGrid); + label = new TQLabel(i18n("Name "), m_nonPersistentGrid); label->setFont(font); - label = new QLabel(i18n("Type "), m_nonPersistentGrid); + label = new TQLabel(i18n("Type "), m_nonPersistentGrid); label->setFont(font); - label = new QLabel(i18n("Value "), m_nonPersistentGrid); + label = new TQLabel(i18n("Value "), m_nonPersistentGrid); label->setFont(font); - label = new QLabel("", m_nonPersistentGrid); + label = new TQLabel("", m_nonPersistentGrid); label->setFont(font); for (Event::PropertyNames::iterator i = p.begin(); i != p.end(); ++i) { - new QLabel(strtoqstr(*i), m_nonPersistentGrid, strtoqstr(*i)); - new QLabel(strtoqstr(event.getPropertyTypeAsString(*i)), m_nonPersistentGrid, strtoqstr(*i)); - new QLabel(strtoqstr(event.getAsString(*i)), m_nonPersistentGrid, strtoqstr(*i)); - QPushButton *button = new QPushButton("P", m_nonPersistentGrid, strtoqstr(*i)); - button->setFixedSize(QSize(24, 24)); - QToolTip::add + new TQLabel(strtoqstr(*i), m_nonPersistentGrid, strtoqstr(*i)); + new TQLabel(strtoqstr(event.getPropertyTypeAsString(*i)), m_nonPersistentGrid, strtoqstr(*i)); + new TQLabel(strtoqstr(event.getAsString(*i)), m_nonPersistentGrid, strtoqstr(*i)); + TQPushButton *button = new TQPushButton("P", m_nonPersistentGrid, strtoqstr(*i)); + button->setFixedSize(TQSize(24, 24)); + TQToolTip::add (button, i18n("Make persistent")); - QObject::connect(button, SIGNAL(clicked()), - this, SLOT(slotPropertyMadePersistent())); + TQObject::connect(button, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotPropertyMadePersistent())); } } } @@ -195,9 +195,9 @@ EventEditDialog::EventEditDialog(QWidget *parent, void EventEditDialog::addPersistentProperty(const PropertyName &name) { - QLabel *label = new QLabel(strtoqstr(name), m_persistentGrid, strtoqstr(name)); + TQLabel *label = new TQLabel(strtoqstr(name), m_persistentGrid, strtoqstr(name)); label->show(); - label = new QLabel(strtoqstr(m_originalEvent.getPropertyTypeAsString(name)), + label = new TQLabel(strtoqstr(m_originalEvent.getPropertyTypeAsString(name)), m_persistentGrid, strtoqstr(name)); label->show(); @@ -212,11 +212,11 @@ EventEditDialog::addPersistentProperty(const PropertyName &name) min = 0; max = 127; } - QSpinBox *spinBox = new QSpinBox + TQSpinBox *spinBox = new QSpinBox (min, max, 1, m_persistentGrid, strtoqstr(name)); spinBox->setValue(m_originalEvent.get<Int>(name)); - QObject::connect(spinBox, SIGNAL(valueChanged(int)), - this, SLOT(slotIntPropertyChanged(int))); + TQObject::connect(spinBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotIntPropertyChanged(int))); spinBox->show(); break; } @@ -227,28 +227,28 @@ case UInt: { min = 0; max = 65535; } - QSpinBox *spinBox = new QSpinBox + TQSpinBox *spinBox = new QSpinBox (min, max, 1, m_persistentGrid, strtoqstr(name)); spinBox->setValue(m_originalEvent.get<UInt>(name)); - QObject::connect(spinBox, SIGNAL(valueChanged(int)), - this, SLOT(slotIntPropertyChanged(int))); + TQObject::connect(spinBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotIntPropertyChanged(int))); spinBox->show(); break; } case RealTimeT: { RealTime realTime = m_originalEvent.get<RealTimeT>(name); - QHBox* hbox = new QHBox(m_persistentGrid); + TQHBox* hbox = new TQHBox(m_persistentGrid); // seconds // - QSpinBox *spinBox = new QSpinBox + TQSpinBox *spinBox = new QSpinBox (INT_MIN, INT_MAX, 1, hbox, strtoqstr(name) + "%sec"); spinBox->setValue(realTime.sec); - QObject::connect(spinBox, SIGNAL(valueChanged(int)), - this, SLOT(slotRealTimePropertyChanged(int))); + TQObject::connect(spinBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotRealTimePropertyChanged(int))); // nseconds // @@ -257,41 +257,41 @@ case UInt: { hbox, strtoqstr(name) + "%nsec"); spinBox->setValue(realTime.nsec); - QObject::connect(spinBox, SIGNAL(valueChanged(int)), - this, SLOT(slotRealTimePropertyChanged(int))); + TQObject::connect(spinBox, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotRealTimePropertyChanged(int))); spinBox->show(); break; } case Bool: { - QCheckBox *checkBox = new QCheckBox + TQCheckBox *checkBox = new QCheckBox ("", m_persistentGrid, strtoqstr(name)); checkBox->setChecked(m_originalEvent.get<Bool>(name)); - QObject::connect(checkBox, SIGNAL(activated()), - this, SLOT(slotBoolPropertyChanged())); + TQObject::connect(checkBox, TQT_SIGNAL(activated()), + this, TQT_SLOT(slotBoolPropertyChanged())); checkBox->show(); break; } case String: { - QLineEdit *lineEdit = new QLineEdit + TQLineEdit *lineEdit = new QLineEdit (strtoqstr(m_originalEvent.get<String>(name)), m_persistentGrid, strtoqstr(name)); - QObject::connect(lineEdit, SIGNAL(textChanged(const QString &)), - this, SLOT(slotStringPropertyChanged(const QString &))); + TQObject::connect(lineEdit, TQT_SIGNAL(textChanged(const TQString &)), + this, TQT_SLOT(slotStringPropertyChanged(const TQString &))); lineEdit->show(); break; } } - QPushButton *button = new QPushButton("X", m_persistentGrid, + TQPushButton *button = new TQPushButton("X", m_persistentGrid, strtoqstr(name)); - button->setFixedSize(QSize(24, 24)); - QToolTip::add + button->setFixedSize(TQSize(24, 24)); + TQToolTip::add (button, i18n("Delete this property")); - QObject::connect(button, SIGNAL(clicked()), - this, SLOT(slotPropertyDeleted())); + TQObject::connect(button, TQT_SIGNAL(clicked()), + this, TQT_SLOT(slotPropertyDeleted())); button->show(); } @@ -302,7 +302,7 @@ EventEditDialog::getEvent() const } void -EventEditDialog::slotEventTypeChanged(const QString &type) +EventEditDialog::slotEventTypeChanged(const TQString &type) { std::string t(qstrtostr(type)); if (t != m_type) { @@ -356,28 +356,28 @@ EventEditDialog::slotSubOrderingChanged(int value) void EventEditDialog::slotIntPropertyChanged(int value) { - const QObject *s = sender(); - const QSpinBox *spinBox = dynamic_cast<const QSpinBox *>(s); + const TQObject *s = sender(); + const TQSpinBox *spinBox = dynamic_cast<const TQSpinBox *>(s); if (!spinBox) return ; m_modified = true; - QString propertyName = spinBox->name(); + TQString propertyName = spinBox->name(); m_event.set<Int>(qstrtostr(propertyName), value); } void EventEditDialog::slotRealTimePropertyChanged(int value) { - const QObject *s = sender(); - const QSpinBox *spinBox = dynamic_cast<const QSpinBox *>(s); + const TQObject *s = sender(); + const TQSpinBox *spinBox = dynamic_cast<const TQSpinBox *>(s); if (!spinBox) return ; m_modified = true; - QString propertyFullName = spinBox->name(); + TQString propertyFullName = spinBox->name(); - QString propertyName = propertyFullName.section('%', 0, 0), + TQString propertyName = propertyFullName.section('%', 0, 0), nsecOrSec = propertyFullName.section('%', 1, 1); RealTime realTime = m_event.get<RealTimeT>(qstrtostr(propertyName)); @@ -393,40 +393,40 @@ EventEditDialog::slotRealTimePropertyChanged(int value) void EventEditDialog::slotBoolPropertyChanged() { - const QObject *s = sender(); - const QCheckBox *checkBox = dynamic_cast<const QCheckBox *>(s); + const TQObject *s = sender(); + const TQCheckBox *checkBox = dynamic_cast<const TQCheckBox *>(s); if (!checkBox) return ; m_modified = true; - QString propertyName = checkBox->name(); + TQString propertyName = checkBox->name(); bool checked = checkBox->isChecked(); m_event.set<Bool>(qstrtostr(propertyName), checked); } void -EventEditDialog::slotStringPropertyChanged(const QString &value) +EventEditDialog::slotStringPropertyChanged(const TQString &value) { - const QObject *s = sender(); - const QLineEdit *lineEdit = dynamic_cast<const QLineEdit *>(s); + const TQObject *s = sender(); + const TQLineEdit *lineEdit = dynamic_cast<const TQLineEdit *>(s); if (!lineEdit) return ; m_modified = true; - QString propertyName = lineEdit->name(); + TQString propertyName = lineEdit->name(); m_event.set<String>(qstrtostr(propertyName), qstrtostr(value)); } void EventEditDialog::slotPropertyDeleted() { - const QObject *s = sender(); - const QPushButton *pushButton = dynamic_cast<const QPushButton *>(s); + const TQObject *s = sender(); + const TQPushButton *pushButton = dynamic_cast<const TQPushButton *>(s); if (!pushButton) return ; - QString propertyName = pushButton->name(); + TQString propertyName = pushButton->name(); if (KMessageBox::warningContinueCancel (this, @@ -438,9 +438,9 @@ EventEditDialog::slotPropertyDeleted() return ; m_modified = true; - QObjectList *list = m_persistentGrid->queryList(0, propertyName, false); - QObjectListIt i(*list); - QObject *obj; + TQObjectList *list = m_persistentGrid->queryList(0, propertyName, false); + TQObjectListIt i(*list); + TQObject *obj; while ((obj = i.current()) != 0) { ++i; delete obj; @@ -453,12 +453,12 @@ EventEditDialog::slotPropertyDeleted() void EventEditDialog::slotPropertyMadePersistent() { - const QObject *s = sender(); - const QPushButton *pushButton = dynamic_cast<const QPushButton *>(s); + const TQObject *s = sender(); + const TQPushButton *pushButton = dynamic_cast<const TQPushButton *>(s); if (!pushButton) return ; - QString propertyName = pushButton->name(); + TQString propertyName = pushButton->name(); if (KMessageBox::warningContinueCancel (this, @@ -470,9 +470,9 @@ EventEditDialog::slotPropertyMadePersistent() i18n("Make &Persistent")) != KMessageBox::Continue) return ; - QObjectList *list = m_nonPersistentGrid->queryList(0, propertyName, false); - QObjectListIt i(*list); - QObject *obj; + TQObjectList *list = m_nonPersistentGrid->queryList(0, propertyName, false); + TQObjectListIt i(*list); + TQObject *obj; while ((obj = i.current()) != 0) { ++i; delete obj; |