summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/segment/TrackButtons.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/editors/segment/TrackButtons.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz
rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/editors/segment/TrackButtons.cpp')
-rw-r--r--src/gui/editors/segment/TrackButtons.cpp158
1 files changed, 79 insertions, 79 deletions
diff --git a/src/gui/editors/segment/TrackButtons.cpp b/src/gui/editors/segment/TrackButtons.cpp
index 5cf9908..39e19d2 100644
--- a/src/gui/editors/segment/TrackButtons.cpp
+++ b/src/gui/editors/segment/TrackButtons.cpp
@@ -24,7 +24,7 @@
#include "TrackButtons.h"
-#include <qlayout.h>
+#include <tqlayout.h>
#include <klocale.h>
#include <kstddirs.h>
@@ -50,19 +50,19 @@
#include <kglobal.h>
#include <kled.h>
#include <kmessagebox.h>
-#include <qcursor.h>
-#include <qframe.h>
-#include <qiconset.h>
-#include <qlabel.h>
-#include <qobject.h>
-#include <qpixmap.h>
-#include <qpopupmenu.h>
-#include <qsignalmapper.h>
-#include <qstring.h>
-#include <qtimer.h>
-#include <qwidget.h>
-#include <qwidgetstack.h>
-#include <qtooltip.h>
+#include <tqcursor.h>
+#include <tqframe.h>
+#include <tqiconset.h>
+#include <tqlabel.h>
+#include <tqobject.h>
+#include <tqpixmap.h>
+#include <tqpopupmenu.h>
+#include <tqsignalmapper.h>
+#include <tqstring.h>
+#include <tqtimer.h>
+#include <tqwidget.h>
+#include <tqwidgetstack.h>
+#include <tqtooltip.h>
namespace Rosegarden
{
@@ -72,16 +72,16 @@ TrackButtons::TrackButtons(RosegardenGUIDoc* doc,
unsigned int trackLabelWidth,
bool showTrackLabels,
int overallHeight,
- QWidget* parent,
+ TQWidget* parent,
const char* name,
WFlags f)
- : QFrame(parent, name, f),
+ : TQFrame(parent, name, f),
m_doc(doc),
- m_layout(new QVBoxLayout(this)),
- m_recordSigMapper(new QSignalMapper(this)),
- m_muteSigMapper(new QSignalMapper(this)),
- m_clickedSigMapper(new QSignalMapper(this)),
- m_instListSigMapper(new QSignalMapper(this)),
+ m_layout(new TQVBoxLayout(this)),
+ m_recordSigMapper(new TQSignalMapper(this)),
+ m_muteSigMapper(new TQSignalMapper(this)),
+ m_clickedSigMapper(new TQSignalMapper(this)),
+ m_instListSigMapper(new TQSignalMapper(this)),
m_tracks(doc->getComposition().getNbTracks()),
m_offset(4),
m_cellSize(trackCellHeight),
@@ -108,18 +108,18 @@ TrackButtons::TrackButtons(RosegardenGUIDoc* doc,
m_layout->addStretch(20);
- connect(m_recordSigMapper, SIGNAL(mapped(int)),
- this, SLOT(slotToggleRecordTrack(int)));
+ connect(m_recordSigMapper, TQT_SIGNAL(mapped(int)),
+ this, TQT_SLOT(slotToggleRecordTrack(int)));
- connect(m_muteSigMapper, SIGNAL(mapped(int)),
- this, SLOT(slotToggleMutedTrack(int)));
+ connect(m_muteSigMapper, TQT_SIGNAL(mapped(int)),
+ this, TQT_SLOT(slotToggleMutedTrack(int)));
// connect signal mappers
- connect(m_instListSigMapper, SIGNAL(mapped(int)),
- this, SLOT(slotInstrumentSelection(int)));
+ connect(m_instListSigMapper, TQT_SIGNAL(mapped(int)),
+ this, TQT_SLOT(slotInstrumentSelection(int)));
- connect(m_clickedSigMapper, SIGNAL(mapped(int)),
- this, SIGNAL(trackSelected(int)));
+ connect(m_clickedSigMapper, TQT_SIGNAL(mapped(int)),
+ this, TQT_SIGNAL(trackSelected(int)));
// // Populate instrument popup menu just once at start-up
// //
@@ -149,7 +149,7 @@ TrackButtons::makeButtons()
Track *track = m_doc->getComposition().getTrackByPosition(i);
if (track) {
- QFrame *trackHBox = makeButton(track->getId());
+ TQFrame *trackHBox = makeButton(track->getId());
if (trackHBox) {
m_layout->addWidget(trackHBox);
@@ -161,7 +161,7 @@ TrackButtons::makeButtons()
populateButtons();
}
-void TrackButtons::setButtonMapping(QObject* obj, TrackId trackId)
+void TrackButtons::setButtonMapping(TQObject* obj, TrackId trackId)
{
m_clickedSigMapper->setMapping(obj, trackId);
m_instListSigMapper->setMapping(obj, trackId);
@@ -271,7 +271,7 @@ TrackButtons::removeButtons(unsigned int position)
delete m_trackHBoxes[position]; // deletes all child widgets (button, led, label...)
- std::vector<QFrame*>::iterator it = m_trackHBoxes.begin();
+ std::vector<TQFrame*>::iterator it = m_trackHBoxes.begin();
it += position;
m_trackHBoxes.erase(it);
@@ -293,7 +293,7 @@ TrackButtons::slotUpdateTracks()
for (unsigned int i = m_tracks; i < newNbTracks; ++i) {
track = m_doc->getComposition().getTrackByPosition(i);
if (track) {
- QFrame *trackHBox = makeButton(track->getId());
+ TQFrame *trackHBox = makeButton(track->getId());
if (trackHBox) {
trackHBox->show();
@@ -343,7 +343,7 @@ TrackButtons::slotUpdateTracks()
if (track) {
m_trackLabels[i]->setId(track->getId());
- QLabel *trackLabel = m_trackLabels[i]->getTrackLabel();
+ TQLabel *trackLabel = m_trackLabels[i]->getTrackLabel();
if (track->getLabel() == std::string("")) {
Instrument *ins =
@@ -530,7 +530,7 @@ TrackButtons::getHighlightedTracks()
}
void
-TrackButtons::slotRenameTrack(QString newName, TrackId trackId)
+TrackButtons::slotRenameTrack(TQString newName, TrackId trackId)
{
m_doc->getCommandHistory()->addCommand
(new RenameTrackCommand(&m_doc->getComposition(),
@@ -582,7 +582,7 @@ TrackButtons::slotInstrumentSelection(int trackId)
int position = comp.getTrackById(trackId)->getPosition();
- QString instrumentName = i18n("<no instrument>");
+ TQString instrumentName = i18n("<no instrument>");
Track *track = comp.getTrackByPosition(position);
Instrument *instrument = 0;
@@ -603,7 +603,7 @@ TrackButtons::slotInstrumentSelection(int trackId)
// Device/Bank dialog then we reload the whole menu here.
//
- QPopupMenu instrumentPopup(this);
+ TQPopupMenu instrumentPopup(this);
populateInstrumentPopup(instrument, &instrumentPopup);
@@ -611,7 +611,7 @@ TrackButtons::slotInstrumentSelection(int trackId)
//
m_popupItem = position;
- instrumentPopup.exec(QCursor::pos());
+ instrumentPopup.exec(TQCursor::pos());
// Restore the label back to what it was showing
m_trackLabels[position]->showLabel(m_trackInstrumentLabels);
@@ -634,30 +634,30 @@ TrackButtons::slotInstrumentSelection(int trackId)
}
void
-TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* instrumentPopup)
+TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, TQPopupMenu* instrumentPopup)
{
- static QPixmap connectedPixmap, unconnectedPixmap,
+ static TQPixmap connectedPixmap, unconnectedPixmap,
connectedUsedPixmap, unconnectedUsedPixmap,
connectedSelectedPixmap, unconnectedSelectedPixmap;
static bool havePixmaps = false;
if (!havePixmaps) {
- QString pixmapDir =
+ TQString pixmapDir =
KGlobal::dirs()->findResource("appdata", "pixmaps/");
connectedPixmap.load
- (QString("%1/misc/connected.xpm").arg(pixmapDir));
+ (TQString("%1/misc/connected.xpm").arg(pixmapDir));
connectedUsedPixmap.load
- (QString("%1/misc/connected-used.xpm").arg(pixmapDir));
+ (TQString("%1/misc/connected-used.xpm").arg(pixmapDir));
connectedSelectedPixmap.load
- (QString("%1/misc/connected-selected.xpm").arg(pixmapDir));
+ (TQString("%1/misc/connected-selected.xpm").arg(pixmapDir));
unconnectedPixmap.load
- (QString("%1/misc/unconnected.xpm").arg(pixmapDir));
+ (TQString("%1/misc/unconnected.xpm").arg(pixmapDir));
unconnectedUsedPixmap.load
- (QString("%1/misc/unconnected-used.xpm").arg(pixmapDir));
+ (TQString("%1/misc/unconnected-used.xpm").arg(pixmapDir));
unconnectedSelectedPixmap.load
- (QString("%1/misc/unconnected-selected.xpm").arg(pixmapDir));
+ (TQString("%1/misc/unconnected-selected.xpm").arg(pixmapDir));
havePixmaps = true;
}
@@ -668,7 +668,7 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
// clear the popup
instrumentPopup->clear();
- std::vector<QPopupMenu*> instrumentSubMenus;
+ std::vector<TQPopupMenu*> instrumentSubMenus;
// position index
int i = 0;
@@ -684,8 +684,8 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
if (! (*it))
continue; // sanity check
- QString iname(strtoqstr((*it)->getPresentationName()));
- QString pname(strtoqstr((*it)->getProgramName()));
+ TQString iname(strtoqstr((*it)->getPresentationName()));
+ TQString pname(strtoqstr((*it)->getProgramName()));
Device *device = (*it)->getDevice();
DeviceId devId = device->getId();
bool connected = false;
@@ -696,17 +696,17 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
(Instrument::SYNTH_PLUGIN_POSITION);
if (plugin) {
pname = strtoqstr(plugin->getProgram());
- QString identifier = strtoqstr(plugin->getIdentifier());
+ TQString identifier = strtoqstr(plugin->getIdentifier());
if (identifier != "") {
connected = true;
- QString type, soName, label;
+ TQString type, soName, label;
PluginIdentifier::parseIdentifier
(identifier, type, soName, label);
if (pname == "") {
pname = strtoqstr(plugin->getDistinctiveConfigurationText());
}
if (pname != "") {
- pname = QString("%1: %2").arg(label).arg(pname);
+ pname = TQString("%1: %2").arg(label).arg(pname);
} else {
pname = label;
}
@@ -753,7 +753,7 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
}
}
- QIconSet iconSet
+ TQIconSet iconSet
(connected ?
(deviceUsedByAnyone ?
connectedUsedPixmap : connectedPixmap) :
@@ -762,15 +762,15 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
currentDevId = int(devId);
- QPopupMenu *subMenu = new QPopupMenu(instrumentPopup);
- QString deviceName = strtoqstr(device->getName());
+ TQPopupMenu *subMenu = new TQPopupMenu(instrumentPopup);
+ TQString deviceName = strtoqstr(device->getName());
instrumentPopup->insertItem(iconSet, deviceName, subMenu);
instrumentSubMenus.push_back(subMenu);
// Connect up the submenu
//
- connect(subMenu, SIGNAL(activated(int)),
- SLOT(slotInstrumentPopupActivated(int)));
+ connect(subMenu, TQT_SIGNAL(activated(int)),
+ TQT_SLOT(slotInstrumentPopupActivated(int)));
} else if (!instrUsedByMe) {
@@ -785,7 +785,7 @@ TrackButtons::populateInstrumentPopup(Instrument *thisTrackInstr, QPopupMenu* in
}
}
- QIconSet iconSet
+ TQIconSet iconSet
(connected ?
(instrUsedByAnyone ?
instrUsedByMe ?
@@ -866,7 +866,7 @@ TrackButtons::changeTrackInstrumentLabels(TrackLabel::InstrumentTrackLabels labe
}
void
-TrackButtons::changeInstrumentLabel(InstrumentId id, QString label)
+TrackButtons::changeInstrumentLabel(InstrumentId id, TQString label)
{
Composition &comp = m_doc->getComposition();
Track *track;
@@ -895,7 +895,7 @@ TrackButtons::changeInstrumentLabel(InstrumentId id, QString label)
}
void
-TrackButtons::changeTrackLabel(TrackId id, QString label)
+TrackButtons::changeTrackLabel(TrackId id, TQString label)
{
Composition &comp = m_doc->getComposition();
Track *track;
@@ -932,7 +932,7 @@ TrackButtons::slotSynchroniseWithComposition()
Instrument *ins = studio.
getInstrumentById(track->getInstrument());
- QString instrumentName(i18n("<no instrument>"));
+ TQString instrumentName(i18n("<no instrument>"));
if (ins)
instrumentName = strtoqstr(ins->getPresentationName());
@@ -990,13 +990,13 @@ TrackButtons::slotTrackInstrumentSelection(TrackId trackId, int item)
slotInstrumentPopupActivated( item );
}
-QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
+TQFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
{
// The buttonGap sets up the sizes of the buttons
//
static const int buttonGap = 8;
- QFrame *trackHBox = 0;
+ TQFrame *trackHBox = 0;
KLedButton *mute = 0;
KLedButton *record = 0;
@@ -1020,8 +1020,8 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
// Create a horizontal box for each track
//
- trackHBox = new QFrame(this);
- QHBoxLayout *hblayout = new QHBoxLayout(trackHBox);
+ trackHBox = new TQFrame(this);
+ TQHBoxLayout *hblayout = new TQHBoxLayout(trackHBox);
trackHBox->setMinimumSize(labelWidth, m_cellSize * multiple - m_borderGap);
trackHBox->setFixedHeight(m_cellSize * multiple - m_borderGap);
@@ -1055,12 +1055,12 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
mute = new KLedButton(Rosegarden::GUIPalette::getColour
(Rosegarden::GUIPalette::MuteTrackLED), trackHBox);
- QToolTip::add(mute, i18n("Mute track"));
+ TQToolTip::add(mute, i18n("Mute track"));
hblayout->addWidget(mute);
record = new KLedButton(Rosegarden::GUIPalette::getColour
(Rosegarden::GUIPalette::RecordMIDITrackLED), trackHBox);
- QToolTip::add(record, i18n("Record on this track"));
+ TQToolTip::add(record, i18n("Record on this track"));
hblayout->addWidget(record);
record->setLook(KLed::Sunken);
@@ -1068,10 +1068,10 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
record->off();
// Connect them to their sigmappers
- connect(record, SIGNAL(stateChanged(bool)),
- m_recordSigMapper, SLOT(map()));
- connect(mute, SIGNAL(stateChanged(bool)),
- m_muteSigMapper, SLOT(map()));
+ connect(record, TQT_SIGNAL(stateChanged(bool)),
+ m_recordSigMapper, TQT_SLOT(map()));
+ connect(mute, TQT_SIGNAL(stateChanged(bool)),
+ m_muteSigMapper, TQT_SLOT(map()));
m_recordSigMapper->setMapping(record, track->getPosition());
m_muteSigMapper->setMapping(mute, track->getPosition());
@@ -1103,8 +1103,8 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
trackLabel->setFixedHeight(m_cellSize - buttonGap);
trackLabel->setIndent(7);
- connect(trackLabel, SIGNAL(renameTrack(QString, TrackId)),
- SLOT(slotRenameTrack(QString, TrackId)));
+ connect(trackLabel, TQT_SIGNAL(renameTrack(TQString, TrackId)),
+ TQT_SLOT(slotRenameTrack(TQString, TrackId)));
// Store the TrackLabel pointer
//
@@ -1113,10 +1113,10 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
// Connect it
setButtonMapping(trackLabel, trackId);
- connect(trackLabel, SIGNAL(changeToInstrumentList()),
- m_instListSigMapper, SLOT(map()));
- connect(trackLabel, SIGNAL(clicked()),
- m_clickedSigMapper, SLOT(map()));
+ connect(trackLabel, TQT_SIGNAL(changeToInstrumentList()),
+ m_instListSigMapper, TQT_SLOT(map()));
+ connect(trackLabel, TQT_SIGNAL(clicked()),
+ m_clickedSigMapper, TQT_SLOT(map()));
//
// instrument label
@@ -1124,7 +1124,7 @@ QFrame* TrackButtons::makeButton(Rosegarden::TrackId trackId)
Rosegarden::Instrument *ins =
m_doc->getStudio().getInstrumentById(track->getInstrument());
- QString instrumentName(i18n("<no instrument>"));
+ TQString instrumentName(i18n("<no instrument>"));
if (ins) instrumentName = strtoqstr(ins->getPresentationName());
// Set label to program change if it's being sent