summaryrefslogtreecommitdiff
path: root/muse2/muse/mixer
diff options
context:
space:
mode:
authorOrcan Ogetbil <oget.fedora@gmail.com>2010-11-27 11:32:13 +0000
committerOrcan Ogetbil <oget.fedora@gmail.com>2010-11-27 11:32:13 +0000
commita0ed94cfa536025b1c51b6b1c4dffe1683ea2808 (patch)
tree2554a80f8ec4a105a9779db59751ee8548a086c6 /muse2/muse/mixer
parent5969affc475d1abf1c34297b524b905490b05fe1 (diff)
ported .ui widgets to Qt4
Diffstat (limited to 'muse2/muse/mixer')
-rw-r--r--muse2/muse/mixer/CMakeLists.txt3
-rw-r--r--muse2/muse/mixer/routedialog.cpp51
-rw-r--r--muse2/muse/mixer/routedialog.h11
-rw-r--r--muse2/muse/mixer/routedialogbase.ui399
4 files changed, 203 insertions, 261 deletions
diff --git a/muse2/muse/mixer/CMakeLists.txt b/muse2/muse/mixer/CMakeLists.txt
index f2d4b012..979d57a5 100644
--- a/muse2/muse/mixer/CMakeLists.txt
+++ b/muse2/muse/mixer/CMakeLists.txt
@@ -19,8 +19,7 @@
#=============================================================================
QT4_WRAP_CPP ( mixer_mocs amixer.h strip.h astrip.h mstrip.h meter.h rack.h panknob.h auxknob.h routedialog.h )
-# QT4_WRAP_UI ( mixer_uis routedialogbase.ui )
-QT4_WRAP_UI3 ( mixer_uis routedialogbase.ui )
+QT4_WRAP_UI ( mixer_uis routedialogbase.ui )
add_library ( mixer STATIC
${mixer_mocs}
diff --git a/muse2/muse/mixer/routedialog.cpp b/muse2/muse/mixer/routedialog.cpp
index e56a15ba..29ff8946 100644
--- a/muse2/muse/mixer/routedialog.cpp
+++ b/muse2/muse/mixer/routedialog.cpp
@@ -6,11 +6,11 @@
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
//=========================================================
-#include <q3listbox.h>
-#include <q3listview.h>
-#include <qtoolbutton.h>
-//Added by qt3to4:
#include <QCloseEvent>
+#include <QDialog>
+#include <QListWidgetItem>
+#include <QTreeWidgetItem>
+
#include "routedialog.h"
#include "track.h"
#include "song.h"
@@ -22,11 +22,12 @@
//---------------------------------------------------------
RouteDialog::RouteDialog(QWidget* parent)
- : RouteDialogBase(parent)
+ : QDialog(parent)
{
- connect(routeList, SIGNAL(selectionChanged()), SLOT(routeSelectionChanged()));
- connect(newSrcList, SIGNAL(selectionChanged()), SLOT(srcSelectionChanged()));
- connect(newDstList, SIGNAL(selectionChanged()), SLOT(dstSelectionChanged()));
+ setupUi(this);
+ connect(routeList, SIGNAL(itemSelectionChanged()), SLOT(routeSelectionChanged()));
+ connect(newSrcList, SIGNAL(itemSelectionChanged()), SLOT(srcSelectionChanged()));
+ connect(newDstList, SIGNAL(itemSelectionChanged()), SLOT(dstSelectionChanged()));
connect(removeButton, SIGNAL(clicked()), SLOT(removeRoute()));
connect(connectButton, SIGNAL(clicked()), SLOT(addRoute()));
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
@@ -56,24 +57,24 @@ void RouteDialog::routingChanged()
AudioTrack* track = (AudioTrack*)(*i);
if (track->type() == Track::AUDIO_INPUT) {
for (int channel = 0; channel < track->channels(); ++channel)
- newDstList->insertItem(Route(track, channel).name());
+ newDstList->addItem(Route(track, channel).name());
const RouteList* rl = track->inRoutes();
for (ciRoute r = rl->begin(); r != rl->end(); ++r) {
//Route dst(track->name(), true, r->channel);
Route dst(track->name(), true, r->channel, Route::TRACK_ROUTE);
- new Q3ListViewItem(routeList, r->name(), dst.name());
+ new QTreeWidgetItem(routeList, QStringList() << r->name() << dst.name());
}
}
else if (track->type() != Track::AUDIO_AUX)
- newDstList->insertItem(Route(track, -1).name());
+ newDstList->addItem(Route(track, -1).name());
if (track->type() == Track::AUDIO_OUTPUT) {
for (int channel = 0; channel < track->channels(); ++channel) {
Route r(track, channel);
- newSrcList->insertItem(r.name());
+ newSrcList->addItem(r.name());
}
}
else
- newSrcList->insertItem(Route(track, -1).name());
+ newSrcList->addItem(Route(track, -1).name());
const RouteList* rl = track->outRoutes();
for (ciRoute r = rl->begin(); r != rl->end(); ++r) {
@@ -82,16 +83,16 @@ void RouteDialog::routingChanged()
Route s(src, false, r->channel);
src = s.name();
}
- new Q3ListViewItem(routeList, src, r->name());
+ new QTreeWidgetItem(routeList, QStringList() << src << r->name());
}
}
if (!checkAudioDevice()) return;
std::list<QString> sl = audioDevice->outputPorts();
for (std::list<QString>::iterator i = sl.begin(); i != sl.end(); ++i)
- newSrcList->insertItem(*i);
+ newSrcList->addItem(*i);
sl = audioDevice->inputPorts();
for (std::list<QString>::iterator i = sl.begin(); i != sl.end(); ++i)
- newDstList->insertItem(*i);
+ newDstList->addItem(*i);
routeSelectionChanged(); // init remove button
srcSelectionChanged(); // init select button
}
@@ -113,7 +114,7 @@ void RouteDialog::songChanged(int v)
void RouteDialog::routeSelectionChanged()
{
- Q3ListViewItem* item = routeList->selectedItem();
+ QTreeWidgetItem* item = routeList->currentItem();
removeButton->setEnabled(item != 0);
}
@@ -123,7 +124,7 @@ void RouteDialog::routeSelectionChanged()
void RouteDialog::removeRoute()
{
- Q3ListViewItem* item = routeList->selectedItem();
+ QTreeWidgetItem* item = routeList->currentItem();
if (item == 0)
return;
audio->msgRemoveRoute(Route(item->text(0), false, -1), Route(item->text(1), true, -1));
@@ -138,14 +139,14 @@ void RouteDialog::removeRoute()
void RouteDialog::addRoute()
{
- Q3ListBoxItem* srcItem = newSrcList->selectedItem();
- Q3ListBoxItem* dstItem = newDstList->selectedItem();
+ QListWidgetItem* srcItem = newSrcList->currentItem();
+ QListWidgetItem* dstItem = newDstList->currentItem();
if (srcItem == 0 || dstItem == 0)
return;
audio->msgAddRoute(Route(srcItem->text(), false, -1), Route(dstItem->text(), true, -1));
audio->msgUpdateSoloStates();
song->update(SC_SOLO);
- new Q3ListViewItem(routeList, srcItem->text(), dstItem->text());
+ new QTreeWidgetItem(routeList, QStringList() << srcItem->text() << dstItem->text());
}
//---------------------------------------------------------
@@ -154,8 +155,8 @@ void RouteDialog::addRoute()
void RouteDialog::srcSelectionChanged()
{
- Q3ListBoxItem* srcItem = newSrcList->selectedItem();
- Q3ListBoxItem* dstItem = newDstList->selectedItem();
+ QListWidgetItem* srcItem = newSrcList->currentItem();
+ QListWidgetItem* dstItem = newDstList->currentItem();
connectButton->setEnabled((srcItem != 0)
&& (dstItem != 0)
&& checkRoute(srcItem->text(), dstItem->text()));
@@ -167,8 +168,8 @@ void RouteDialog::srcSelectionChanged()
void RouteDialog::dstSelectionChanged()
{
- Q3ListBoxItem* dstItem = newDstList->selectedItem();
- Q3ListBoxItem* srcItem = newSrcList->selectedItem();
+ QListWidgetItem* dstItem = newDstList->currentItem();
+ QListWidgetItem* srcItem = newSrcList->currentItem();
connectButton->setEnabled((srcItem != 0)
&& (dstItem != 0)
&& checkRoute(srcItem->text(), dstItem->text()));
diff --git a/muse2/muse/mixer/routedialog.h b/muse2/muse/mixer/routedialog.h
index d819b2a1..39bbce2c 100644
--- a/muse2/muse/mixer/routedialog.h
+++ b/muse2/muse/mixer/routedialog.h
@@ -9,15 +9,16 @@
#ifndef __ROUTEDIALOG_H__
#define __ROUTEDIALOG_H__
-#include "routedialogbase.h"
-//Added by qt3to4:
-#include <QCloseEvent>
+#include "ui_routedialogbase.h"
+
+class QCloseEvent;
+class QDialog;
//---------------------------------------------------------
// RouteDialog
//---------------------------------------------------------
-class RouteDialog : public RouteDialogBase {
+class RouteDialog : public QDialog, public Ui::RouteDialogBase {
Q_OBJECT
virtual void closeEvent(QCloseEvent*);
@@ -35,7 +36,7 @@ class RouteDialog : public RouteDialogBase {
void closed();
public:
- RouteDialog(QWidget* parent);
+ RouteDialog(QWidget* parent=0);
};
diff --git a/muse2/muse/mixer/routedialogbase.ui b/muse2/muse/mixer/routedialogbase.ui
index 85c4f0d4..30087b9f 100644
--- a/muse2/muse/mixer/routedialogbase.ui
+++ b/muse2/muse/mixer/routedialogbase.ui
@@ -1,234 +1,175 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
-<class>RouteDialogBase</class>
-<widget class="QDialog">
- <property name="name">
- <cstring>RouteDialogBase</cstring>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>316</width>
- <height>383</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>7</vsizetype>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>RouteDialogBase</class>
+ <widget class="QDialog" name="RouteDialogBase">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>316</width>
+ <height>383</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle">
+ <string>MusE: Routing</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="groupBox4">
+ <property name="title">
+ <string>Add Route</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item>
+ <layout class="QHBoxLayout">
+ <item>
+ <widget class="QGroupBox" name="groupBox2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="caption">
- <string>MusE: Routing</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Source:</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QListWidget" name="newSrcList"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Destination:</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item>
+ <widget class="QListWidget" name="newDstList"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QToolButton" name="connectButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip">
+ <string>connect source to destination</string>
+ </property>
+ <property name="text">
+ <string>Connect</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox1">
+ <property name="title">
+ <string>Current Routes</string>
+ </property>
+ <layout class="QVBoxLayout">
+ <property name="spacing">
+ <number>4</number>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <item>
+ <widget class="QTreeWidget" name="routeList">
+ <column>
+ <property name="text">
+ <string>Source</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Destination</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ </widget>
+ </item>
+ <item>
+ <widget class="QToolButton" name="removeButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
- <property name="margin">
- <number>4</number>
+ <property name="toolTip">
+ <string>remove selected route</string>
</property>
- <property name="spacing">
- <number>4</number>
+ <property name="text">
+ <string>Remove</string>
</property>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox4</cstring>
- </property>
- <property name="title">
- <string>Add Route</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>4</number>
- </property>
- <property name="spacing">
- <number>4</number>
- </property>
- <widget class="QLayoutWidget">
- <property name="name">
- <cstring>layout1</cstring>
- </property>
- <hbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox2</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="lineWidth">
- <number>0</number>
- </property>
- <property name="title">
- <string>Source:</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>2</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <widget class="QListBox">
- <property name="name">
- <cstring>newSrcList</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox3</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>7</hsizetype>
- <vsizetype>7</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="lineWidth">
- <number>0</number>
- </property>
- <property name="title">
- <string>Destination:</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>2</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <widget class="QListBox">
- <property name="name">
- <cstring>newDstList</cstring>
- </property>
- </widget>
- </vbox>
- </widget>
- </hbox>
- </widget>
- <widget class="QToolButton">
- <property name="name">
- <cstring>connectButton</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Connect</string>
- </property>
- <property name="toolTip" stdset="0">
- <string>connect source to destination</string>
- </property>
- </widget>
- </vbox>
- </widget>
- <widget class="QGroupBox">
- <property name="name">
- <cstring>groupBox1</cstring>
- </property>
- <property name="lineWidth">
- <number>1</number>
- </property>
- <property name="title">
- <string>Current Routes</string>
- </property>
- <vbox>
- <property name="name">
- <cstring>unnamed</cstring>
- </property>
- <property name="margin">
- <number>4</number>
- </property>
- <property name="spacing">
- <number>4</number>
- </property>
- <widget class="QListView">
- <column>
- <property name="text">
- <string>Source</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <column>
- <property name="text">
- <string>Destination</string>
- </property>
- <property name="clickable">
- <bool>true</bool>
- </property>
- <property name="resizable">
- <bool>true</bool>
- </property>
- </column>
- <property name="name">
- <cstring>routeList</cstring>
- </property>
- <property name="selectionMode">
- <enum>Single</enum>
- </property>
- <property name="allColumnsShowFocus">
- <bool>true</bool>
- </property>
- <property name="resizeMode">
- <enum>AllColumns</enum>
- </property>
- </widget>
- <widget class="QToolButton">
- <property name="name">
- <cstring>removeButton</cstring>
- </property>
- <property name="sizePolicy">
- <sizepolicy>
- <hsizetype>4</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Remove</string>
- </property>
- <property name="toolTip" stdset="0">
- <string>remove selected route</string>
- </property>
- </widget>
- </vbox>
- </widget>
- </vbox>
-</widget>
-<layoutdefaults spacing="6" margin="11"/>
-</UI>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>