23 |
#include "qsamplerDeviceForm.h" |
#include "qsamplerDeviceForm.h" |
24 |
|
|
25 |
#include "qsamplerAbout.h" |
#include "qsamplerAbout.h" |
26 |
|
#include "qsamplerMainForm.h" |
27 |
|
|
28 |
namespace QSampler { |
namespace QSampler { |
29 |
|
|
58 |
adjustSize(); |
adjustSize(); |
59 |
|
|
60 |
QObject::connect(ui.DeviceListView, |
QObject::connect(ui.DeviceListView, |
61 |
SIGNAL(selectionChanged()), |
SIGNAL(itemSelectionChanged()), |
62 |
SLOT(selectDevice())); |
SLOT(selectDevice())); |
63 |
QObject::connect(ui.DeviceListView, |
QObject::connect(ui.DeviceListView, |
64 |
SIGNAL(contextMenuRequested(QListViewItem*,const QPoint&,int)), |
SIGNAL(customContextMenuRequested(const QPoint&)), |
65 |
SLOT(contextMenu(QListViewItem*,const QPoint&,int))); |
SLOT(deviceListViewContextMenu(const QPoint&))); |
66 |
QObject::connect(ui.RefreshDevicesPushButton, |
QObject::connect(ui.RefreshDevicesPushButton, |
67 |
SIGNAL(clicked()), |
SIGNAL(clicked()), |
68 |
SLOT(refreshDevices())); |
SLOT(refreshDevices())); |
69 |
QObject::connect(ui.DriverNameComboBox, |
QObject::connect(ui.DriverNameComboBox, |
70 |
SIGNAL(activated(const QString&)), |
SIGNAL(activated(const QString&)), |
71 |
SLOT(selectDriver(const QString&))); |
SLOT(selectDriver(const QString&))); |
72 |
QObject::connect(ui.DevicePortComboBox, |
QObject::connect(ui.DevicePortComboBox, |
73 |
SIGNAL(activated(int)), |
SIGNAL(activated(int)), |
74 |
SLOT(selectDevicePort(int))); |
SLOT(selectDevicePort(int))); |
135 |
// Device driver name setup formal initializer. |
// Device driver name setup formal initializer. |
136 |
void DeviceForm::setDriverName ( const QString& sDriverName ) |
void DeviceForm::setDriverName ( const QString& sDriverName ) |
137 |
{ |
{ |
138 |
if (ui.DriverNameComboBox->findText(sDriverName) == 0) { |
if (ui.DriverNameComboBox->findText(sDriverName) < 0) { |
139 |
ui.DriverNameComboBox->insertItem(sDriverName); |
ui.DriverNameComboBox->insertItem(sDriverName); |
140 |
} |
} |
141 |
ui.DriverNameComboBox->setCurrentText(sDriverName); |
ui.DriverNameComboBox->setCurrentText(sDriverName); |
554 |
|
|
555 |
|
|
556 |
// Device list view context menu handler. |
// Device list view context menu handler. |
557 |
void DeviceForm::contextMenu ( QTreeWidgetItem* pItem, const QPoint& pos, int ) |
void DeviceForm::deviceListViewContextMenu ( const QPoint& pos ) |
558 |
{ |
{ |
559 |
MainForm *pMainForm = MainForm::getInstance(); |
MainForm *pMainForm = MainForm::getInstance(); |
560 |
if (pMainForm == NULL) |
if (pMainForm == NULL) |
561 |
return; |
return; |
562 |
|
|
563 |
|
QTreeWidgetItem* pItem = ui.DeviceListView->itemAt(pos); |
564 |
|
if (pItem == NULL) |
565 |
|
return; |
566 |
|
|
567 |
int iItemID; |
int iItemID; |
568 |
|
|
569 |
// Build the device context menu... |
// Build the device context menu... |