/[svn]/qsampler/trunk/src/qsamplerDeviceForm.ui.h
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerDeviceForm.ui.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 452 by capela, Sun Mar 13 22:06:59 2005 UTC revision 487 by capela, Thu Mar 31 14:17:19 2005 UTC
# Line 24  Line 24 
24  #include <qfiledialog.h>  #include <qfiledialog.h>
25  #include <qfileinfo.h>  #include <qfileinfo.h>
26  #include <qlistbox.h>  #include <qlistbox.h>
27    #include <qptrlist.h>
28  #include <qpopupmenu.h>  #include <qpopupmenu.h>
29    
30  #include "qsamplerMainForm.h"  #include "qsamplerMainForm.h"
# Line 35  Line 36 
36  void qsamplerDeviceForm::init (void)  void qsamplerDeviceForm::init (void)
37  {  {
38          // Initialize locals.          // Initialize locals.
39          m_pMainForm   = (qsamplerMainForm *) QWidget::parentWidget();          m_pMainForm   = NULL;
40          m_pClient     = NULL;          m_pClient     = NULL;
41          m_iDirtySetup = 0;          m_iDirtySetup = 0;
42          m_bNewDevice  = false;          m_bNewDevice  = false;
43          m_deviceType  = qsamplerDevice::None;          m_deviceType  = qsamplerDevice::None;
44          m_pAudioItems = NULL;          m_pAudioItems = NULL;
45          m_pMidiItems  = NULL;          m_pMidiItems  = NULL;
46            
47          // This an outsider (from designer), but rather important.          // This an outsider (from designer), but rather important.
48          QObject::connect(DeviceParamTable, SIGNAL(valueChanged(int,int)),          QObject::connect(DeviceParamTable, SIGNAL(valueChanged(int,int)),
49                  this, SLOT(changeValue(int,int)));                  this, SLOT(changeDeviceParam(int,int)));
50                    QObject::connect(DevicePortParamTable, SIGNAL(valueChanged(int,int)),
51                    this, SLOT(changeDevicePortParam(int,int)));
52    
53            // Initial contents.
54            refreshDevices();
55          // Try to restore normal window positioning.          // Try to restore normal window positioning.
56          adjustSize();          adjustSize();
57  }  }
# Line 80  void qsamplerDeviceForm::hideEvent ( QHi Line 85  void qsamplerDeviceForm::hideEvent ( QHi
85  }  }
86    
87    
88    // Application main form settler (life depends on it).
89    void qsamplerDeviceForm::setMainForm ( qsamplerMainForm *pMainForm )
90    {
91       m_pMainForm = pMainForm;
92    }
93    
94    
95  // Device configuration dialog setup formal initializer.  // Device configuration dialog setup formal initializer.
96  void qsamplerDeviceForm::setClient ( lscp_client_t *pClient )  void qsamplerDeviceForm::setClient ( lscp_client_t *pClient )
97  {  {
# Line 95  void qsamplerDeviceForm::setClient ( lsc Line 107  void qsamplerDeviceForm::setClient ( lsc
107  }  }
108    
109    
110  // Create a new device from current table view.  // Set current selected device by type and id.
111  void qsamplerDeviceForm::createDevice (void)  void qsamplerDeviceForm::setDevice (
112            qsamplerDevice::qsamplerDeviceType deviceType, int iDeviceID )
113  {  {
114          QListViewItem *pItem = DeviceListView->selectedItem();          // Get the device view root item...
         if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)  
                 return;  
   
         qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();  
   
         // Build the parameter list...  
         qsamplerDeviceParamMap& params = device.params();  
         lscp_param_t *pParams = new lscp_param_t [params.count() + 1];  
         int iParam = 0;  
         qsamplerDeviceParamMap::ConstIterator iter;  
         for (iter = params.begin(); iter != params.end(); ++iter) {  
                 pParams[iParam].key   = (char *) iter.key().latin1();  
                 pParams[iParam].value = (char *) iter.data().value.latin1();  
                 ++iParam;  
         }  
         // Null terminated.  
         pParams[iParam].key   = NULL;  
         pParams[iParam].value = NULL;  
   
         // Now it depends on the device type...  
115          qsamplerDeviceItem *pRootItem = NULL;          qsamplerDeviceItem *pRootItem = NULL;
116          int iDeviceID = -1;          switch (deviceType) {
         switch (device.deviceType()) {  
117          case qsamplerDevice::Audio:          case qsamplerDevice::Audio:
118                  pRootItem = m_pAudioItems;                  pRootItem = m_pAudioItems;
                 if ((iDeviceID = ::lscp_create_audio_device(m_pClient,  
                                 device.driverName().latin1(), pParams)) < 0)  
                         m_pMainForm->appendMessagesClient("lscp_create_audio_device");  
119                  break;                  break;
120          case qsamplerDevice::Midi:          case qsamplerDevice::Midi:
121                  pRootItem = m_pMidiItems;                  pRootItem = m_pMidiItems;
                 if ((iDeviceID = ::lscp_create_midi_device(m_pClient,  
                                 device.driverName().latin1(), pParams)) < 0)  
                         m_pMainForm->appendMessagesClient("lscp_create_midi_device");  
122                  break;                  break;
123          case qsamplerDevice::None:          case qsamplerDevice::None:
124                  break;                  break;
125          }          }
126            
127            // Is the root present?
128            if (pRootItem == NULL)
129                return;
130    
131            // For each child, test for identity...
132            qsamplerDeviceItem *pDeviceItem =
133                    (qsamplerDeviceItem *) pRootItem->firstChild();
134            while (pDeviceItem) {
135                    // If identities match, select as current device item.
136                    if (pDeviceItem->device().deviceID() == iDeviceID) {
137                            DeviceListView->setSelected(pDeviceItem, true);
138                            break;
139                    }
140                    pDeviceItem = (qsamplerDeviceItem *) pDeviceItem->nextSibling();
141            }
142    }
143    
144    
         // Free used parameter array.  
         delete pParams;  
145    
146          // We're on to create the new device item.  // Create a new device from current table view.
147          if (iDeviceID >= 0) {  void qsamplerDeviceForm::createDevice (void)
148    {
149            if (m_pMainForm == NULL)
150                return;
151    
152            QListViewItem *pItem = DeviceListView->selectedItem();
153            if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)
154                    return;
155    
156            // About a brand new device instance...
157            qsamplerDevice device(((qsamplerDeviceItem *) pItem)->device());
158            if (device.createDevice()) {
159                    // Now it depends on the device type...
160                    qsamplerDeviceItem *pRootItem = NULL;
161                    switch (device.deviceType()) {
162                    case qsamplerDevice::Audio:
163                            pRootItem = m_pAudioItems;
164                            break;
165                    case qsamplerDevice::Midi:
166                            pRootItem = m_pMidiItems;
167                            break;
168                    case qsamplerDevice::None:
169                            break;
170                    }
171                  // Append the new device item.                  // Append the new device item.
172                  qsamplerDeviceItem *pDeviceItem = new qsamplerDeviceItem(pRootItem,                  qsamplerDeviceItem *pDeviceItem = new qsamplerDeviceItem(pRootItem,
173                          m_pClient, device.deviceType(), iDeviceID);                          m_pMainForm, device.deviceType(), device.deviceID());
174                  // Just make it the new selection...                  // Just make it the new selection...
175                  DeviceListView->setSelected(pDeviceItem, true);                  DeviceListView->setSelected(pDeviceItem, true);
                 // Done.  
                 m_pMainForm->appendMessages(pDeviceItem->device().deviceName() + ' '  
                         + tr("created."));  
176                  // Main session should be marked dirty.                  // Main session should be marked dirty.
177                  m_pMainForm->sessionDirty();                  m_pMainForm->sessionDirty();
178          }          }
# Line 160  void qsamplerDeviceForm::createDevice (v Line 182  void qsamplerDeviceForm::createDevice (v
182  // Delete current device in table view.  // Delete current device in table view.
183  void qsamplerDeviceForm::deleteDevice (void)  void qsamplerDeviceForm::deleteDevice (void)
184  {  {
185            if (m_pMainForm == NULL)
186                return;
187    
188          QListViewItem *pItem = DeviceListView->selectedItem();          QListViewItem *pItem = DeviceListView->selectedItem();
189          if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)          if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)
190                  return;                  return;
# Line 170  void qsamplerDeviceForm::deleteDevice (v Line 195  void qsamplerDeviceForm::deleteDevice (v
195          qsamplerOptions *pOptions = m_pMainForm->options();          qsamplerOptions *pOptions = m_pMainForm->options();
196          if (pOptions && pOptions->bConfirmRemove) {          if (pOptions && pOptions->bConfirmRemove) {
197                  if (QMessageBox::warning(this, tr("Warning"),                  if (QMessageBox::warning(this, tr("Warning"),
198                          tr("Delete %1 device:\n\n"                          tr("Delete device:\n\n"
199                          "%2\n\n"                          "%1\n\n"
200                          "Are you sure?")                          "Are you sure?")
                         .arg(device.deviceTypeName())  
201                          .arg(device.deviceName()),                          .arg(device.deviceName()),
202                          tr("OK"), tr("Cancel")) > 0)                          tr("OK"), tr("Cancel")) > 0)
203                          return;                          return;
204          }          }
205    
206          // Now it depends on the device type...          // Go and destroy...
207          lscp_status_t ret = LSCP_FAILED;          if (device.deleteDevice()) {
208          switch (device.deviceType()) {                  // Remove it from the device view...
         case qsamplerDevice::Audio:  
                 if ((ret = ::lscp_destroy_audio_device(m_pClient,  
                                 device.deviceID())) != LSCP_OK)  
                         m_pMainForm->appendMessagesClient("lscp_destroy_audio_device");  
                 break;  
         case qsamplerDevice::Midi:  
                 if ((ret = ::lscp_destroy_midi_device(m_pClient,  
                                 device.deviceID())) != LSCP_OK)  
                         m_pMainForm->appendMessagesClient("lscp_destroy_midi_device");  
                 break;  
         case qsamplerDevice::None:  
                 break;  
         }  
   
         // Show result.  
         if (ret == LSCP_OK) {  
                 // Show log message before loosing it.  
                 m_pMainForm->appendMessages(device.deviceName() + ' '  
                         + tr("deleted."));  
                 // Done.  
209                  delete pItem;                  delete pItem;
210                  // Main session should be marked dirty.                  // Main session should be marked dirty.
211                  m_pMainForm->sessionDirty();                  m_pMainForm->sessionDirty();
# Line 212  void qsamplerDeviceForm::deleteDevice (v Line 216  void qsamplerDeviceForm::deleteDevice (v
216  // Refresh all device list and views.  // Refresh all device list and views.
217  void qsamplerDeviceForm::refreshDevices (void)  void qsamplerDeviceForm::refreshDevices (void)
218  {  {
219            if (m_pMainForm == NULL)
220                return;
221    
222          // Avoid nested changes.          // Avoid nested changes.
223          m_iDirtySetup++;          m_iDirtySetup++;
224    
# Line 224  void qsamplerDeviceForm::refreshDevices Line 231  void qsamplerDeviceForm::refreshDevices
231          if (m_pClient) {          if (m_pClient) {
232                  int *piDeviceIDs;                  int *piDeviceIDs;
233                  // Grab and pop Audio devices...                  // Grab and pop Audio devices...
234                  m_pAudioItems = new qsamplerDeviceItem(DeviceListView, m_pClient,                  m_pAudioItems = new qsamplerDeviceItem(DeviceListView,
235                          qsamplerDevice::Audio);                          m_pMainForm, qsamplerDevice::Audio);
236                  if (m_pAudioItems) {                  if (m_pAudioItems) {
                         m_pAudioItems->setText(0, tr("Audio"));  
237                          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);                          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Audio);
238                          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {                          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {
239                                  new qsamplerDeviceItem(m_pAudioItems, m_pClient,                                  new qsamplerDeviceItem(m_pAudioItems, m_pMainForm,
240                                          qsamplerDevice::Audio, piDeviceIDs[i]);                                          qsamplerDevice::Audio, piDeviceIDs[i]);
241                          }                          }
242                          m_pAudioItems->setOpen(true);                          m_pAudioItems->setOpen(true);
243                  }                  }
244                  // Grab and pop MIDI devices...                  // Grab and pop MIDI devices...
245                  m_pMidiItems = new qsamplerDeviceItem(DeviceListView, m_pClient,                  m_pMidiItems = new qsamplerDeviceItem(DeviceListView,
246                          qsamplerDevice::Midi);                          m_pMainForm, qsamplerDevice::Midi);
247                  if (m_pMidiItems) {                  if (m_pMidiItems) {
                         m_pMidiItems->setText(0, tr("MIDI"));  
248                          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);                          piDeviceIDs = qsamplerDevice::getDevices(m_pClient, qsamplerDevice::Midi);
249                          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {                          for (int i = 0; piDeviceIDs && piDeviceIDs[i] >= 0; i++) {
250                                  new qsamplerDeviceItem(m_pMidiItems, m_pClient,                                  new qsamplerDeviceItem(m_pMidiItems, m_pMainForm,
251                                          qsamplerDevice::Midi, piDeviceIDs[i]);                                          qsamplerDevice::Midi, piDeviceIDs[i]);
252                          }                          }
253                          m_pMidiItems->setOpen(true);                          m_pMidiItems->setOpen(true);
# Line 276  void qsamplerDeviceForm::selectDriver ( Line 281  void qsamplerDeviceForm::selectDriver (
281          // Driver change is only valid for scratch devices...          // Driver change is only valid for scratch devices...
282          if (m_bNewDevice) {          if (m_bNewDevice) {
283                  m_iDirtySetup++;                  m_iDirtySetup++;
284                  device.setDriver(m_pClient, sDriverName);                  device.setDriver(sDriverName);
285                  DeviceParamTable->refresh(device);                  DeviceParamTable->refresh(device.params(), m_bNewDevice);
286                  m_iDirtySetup--;                  m_iDirtySetup--;
287                  // Done.                  // Done.
288                  stabilizeForm();                  stabilizeForm();
# Line 300  void qsamplerDeviceForm::selectDevice (v Line 305  void qsamplerDeviceForm::selectDevice (v
305                  m_deviceType = qsamplerDevice::None;                  m_deviceType = qsamplerDevice::None;
306                  DeviceNameTextLabel->setText(QString::null);                  DeviceNameTextLabel->setText(QString::null);
307                  DeviceParamTable->setNumRows(0);                  DeviceParamTable->setNumRows(0);
308                    DevicePortComboBox->clear();
309                    DevicePortParamTable->setNumRows(0);
310                    DevicePortComboBox->setEnabled(false);
311                    DevicePortParamTable->setEnabled(false);
312                  stabilizeForm();                  stabilizeForm();
313                  return;                  return;
314          }          }
315    
         m_iDirtySetup++;  
316          qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();          qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();
317    
318            m_iDirtySetup++;
319          // Flag whether this is a new device.          // Flag whether this is a new device.
320          m_bNewDevice = (device.deviceID() < 0);          m_bNewDevice = (device.deviceID() < 0);
321    
322          // Fill the device/driver heading...          // Fill the device/driver heading...
323          QString sPrefix;          DeviceNameTextLabel->setText(device.deviceName());
         if (!m_bNewDevice)  
                 sPrefix += device.deviceTypeName() + ' ';  
         DeviceNameTextLabel->setText(sPrefix + device.deviceName());  
324          // The driver combobox is only rebuilt if device type has changed...          // The driver combobox is only rebuilt if device type has changed...
325          if (device.deviceType() != m_deviceType) {          if (device.deviceType() != m_deviceType) {
326                  DriverNameComboBox->clear();                  DriverNameComboBox->clear();
# Line 324  void qsamplerDeviceForm::selectDevice (v Line 330  void qsamplerDeviceForm::selectDevice (v
330          }          }
331          // Do we need a driver name?          // Do we need a driver name?
332          if (m_bNewDevice || device.driverName().isEmpty())          if (m_bNewDevice || device.driverName().isEmpty())
333                  device.setDriver(m_pClient, DriverNameComboBox->currentText());                  device.setDriver(DriverNameComboBox->currentText());
334          const QString& sDriverName = device.driverName();          const QString& sDriverName = device.driverName();
335          if (DriverNameComboBox->listBox()->findItem(sDriverName, Qt::ExactMatch) == NULL)          if (DriverNameComboBox->listBox()->findItem(sDriverName, Qt::ExactMatch) == NULL)
336                  DriverNameComboBox->insertItem(sDriverName);                  DriverNameComboBox->insertItem(sDriverName);
# Line 332  void qsamplerDeviceForm::selectDevice (v Line 338  void qsamplerDeviceForm::selectDevice (v
338          DriverNameTextLabel->setEnabled(m_bNewDevice);          DriverNameTextLabel->setEnabled(m_bNewDevice);
339          DriverNameComboBox->setEnabled(m_bNewDevice);          DriverNameComboBox->setEnabled(m_bNewDevice);
340          // Fill the device parameter table...          // Fill the device parameter table...
341          DeviceParamTable->refresh(device);          DeviceParamTable->refresh(device.params(), m_bNewDevice);
342            // And now the device port/channel parameter table...
343            DevicePortComboBox->clear();
344            DevicePortParamTable->setNumRows(0);
345            if (m_bNewDevice) {
346                    DevicePortComboBox->setEnabled(false);
347                    DevicePortParamTable->setEnabled(false);
348            } else {
349                    QPixmap pixmap;
350                    switch (device.deviceType()) {
351                    case qsamplerDevice::Audio:
352                        pixmap = QPixmap::fromMimeSource("audio2.png");
353                        break;
354                    case qsamplerDevice::Midi:
355                        pixmap = QPixmap::fromMimeSource("midi2.png");
356                        break;
357                    case qsamplerDevice::None:
358                        break;
359                    }
360                    qsamplerDevicePortList& ports = device.ports();
361                    qsamplerDevicePort *pPort;
362                    for (pPort = ports.first(); pPort; pPort = ports.next()) {
363                DevicePortComboBox->insertItem(pixmap, device.deviceTypeName()
364                                    + ' ' + device.driverName()
365                                    + ' ' + pPort->portName());
366                    }
367                    bool bEnabled = (ports.count() > 0);
368                    DevicePortComboBox->setEnabled(bEnabled);
369                    DevicePortParamTable->setEnabled(bEnabled);
370            }
371          // Done.          // Done.
372          m_iDirtySetup--;          m_iDirtySetup--;
373            
374            // Make the device port/channel selection effective.
375            selectDevicePort(DevicePortComboBox->currentItem());
376    }
377    
378    
379    // Device port/channel selection slot.
380    void qsamplerDeviceForm::selectDevicePort ( int iPort )
381    {
382            if (m_iDirtySetup > 0)
383                    return;
384    
385            //
386            //  Device port/channel selection has changed...
387            //
388    
389            QListViewItem *pItem = DeviceListView->selectedItem();
390            if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)
391                    return;
392    
393            qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();
394            qsamplerDevicePort *pPort = device.ports().at(iPort);
395            if (pPort) {
396                    m_iDirtySetup++;
397                    DevicePortParamTable->refresh(pPort->params(), false);
398                    m_iDirtySetup--;
399            }
400            // Done.
401          stabilizeForm();          stabilizeForm();
402  }  }
403    
404    
405  // parameter value change slot.  // Device parameter value change slot.
406  void qsamplerDeviceForm::changeValue ( int iRow, int iCol )  void qsamplerDeviceForm::changeDeviceParam ( int iRow, int iCol )
407  {  {
408            if (m_pMainForm == NULL)
409                return;
410          if (m_iDirtySetup > 0)          if (m_iDirtySetup > 0)
411                  return;                  return;
412          if (iRow < 0 || iCol < 0)          if (iRow < 0 || iCol < 0)
# Line 355  void qsamplerDeviceForm::changeValue ( i Line 420  void qsamplerDeviceForm::changeValue ( i
420          if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)          if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)
421                  return;                  return;
422    
         m_iDirtySetup++;  
423          qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();          qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();
424    
425          // Table 1st column has the parameter name;          // Table 1st column has the parameter name;
         qsamplerDeviceParamMap& params = device.params();  
426          const QString sParam = DeviceParamTable->text(iRow, 0);          const QString sParam = DeviceParamTable->text(iRow, 0);
427          const QString sValue = DeviceParamTable->text(iRow, iCol);          const QString sValue = DeviceParamTable->text(iRow, iCol);
428          params[sParam].value = sValue;          // Set the local device parameter value.
429            if (device.setParam(sParam, sValue)) {
430          // Set proper device parameter, on existing device ...                  selectDevice();
431          if (device.deviceID() >= 0) {          } else {
432                  // Prepare parameter struct.                  stabilizeForm();
                 lscp_param_t param;  
                 param.key   = (char *) sParam.latin1();  
                 param.value = (char *) sValue.latin1();  
                 // Now it depends on the device type...  
                 lscp_status_t ret = LSCP_FAILED;  
                 switch (device.deviceType()) {  
                 case qsamplerDevice::Audio:  
                         if ((ret = ::lscp_set_audio_device_param(m_pClient,  
                                         device.deviceID(), &param)) != LSCP_OK)  
                                 m_pMainForm->appendMessagesClient("lscp_set_audio_device_param");  
                         break;  
                 case qsamplerDevice::Midi:  
                         if ((ret = ::lscp_set_midi_device_param(m_pClient,  
                                         device.deviceID(), &param)) != LSCP_OK)  
                                 m_pMainForm->appendMessagesClient("lscp_set_midi_device_param");  
                         break;  
                 case qsamplerDevice::None:  
                         break;  
                 }  
                 // Show result.  
                 if (ret == LSCP_OK) {  
                         m_pMainForm->appendMessages(device.deviceName() + ' '  
                                 + QString("%1: %2.").arg(sParam).arg(sValue));  
                 }  
433          }          }
434            // Main session should be dirtier...
435            m_pMainForm->sessionDirty();
436    }
437    
438    
439    // Device port/channel parameter value change slot.
440    void qsamplerDeviceForm::changeDevicePortParam ( int iRow, int iCol )
441    {
442            if (m_pMainForm == NULL)
443                return;
444            if (m_iDirtySetup > 0)
445                    return;
446            if (iRow < 0 || iCol < 0)
447                    return;
448    
449            //
450            //  Device port/channel parameter change...
451            //
452    
453            QListViewItem *pItem = DeviceListView->selectedItem();
454            if (pItem == NULL || pItem->rtti() != QSAMPLER_DEVICE_ITEM)
455                    return;
456    
457            qsamplerDevice& device = ((qsamplerDeviceItem *) pItem)->device();
458    
459            int iPort = DevicePortComboBox->currentItem();
460            qsamplerDevicePort *pPort = device.ports().at(iPort);
461            if (pPort == NULL)
462                return;
463    
464            // Table 1st column has the parameter name;
465            const QString sParam = DevicePortParamTable->text(iRow, 0);
466            const QString sValue = DevicePortParamTable->text(iRow, iCol);
467            // Set the local device port/channel parameter value.
468            pPort->setParam(sParam, sValue);
469          // Done.          // Done.
         m_iDirtySetup--;  
470          stabilizeForm();          stabilizeForm();
471          // Main session should be dirtier...          // Main session should be dirtier...
472          m_pMainForm->sessionDirty();          m_pMainForm->sessionDirty();
# Line 413  void qsamplerDeviceForm::contextMenu ( Q Line 485  void qsamplerDeviceForm::contextMenu ( Q
485          bool bEnabled = (pItem != NULL);          bool bEnabled = (pItem != NULL);
486          iItemID = pContextMenu->insertItem(          iItemID = pContextMenu->insertItem(
487                  QIconSet(QPixmap::fromMimeSource("deviceCreate.png")),                  QIconSet(QPixmap::fromMimeSource("deviceCreate.png")),
488                  tr("&Create"), this, SLOT(createDevice()));                  tr("&Create device"), this, SLOT(createDevice()));
489          pContextMenu->setItemEnabled(iItemID, bEnabled || (bClient && m_bNewDevice));          pContextMenu->setItemEnabled(iItemID, bEnabled || (bClient && m_bNewDevice));
490          iItemID = pContextMenu->insertItem(          iItemID = pContextMenu->insertItem(
491                  QIconSet(QPixmap::fromMimeSource("deviceDelete.png")),                  QIconSet(QPixmap::fromMimeSource("deviceDelete.png")),
492                  tr("&Delete"), this, SLOT(deleteDevice()));                  tr("&Delete device"), this, SLOT(deleteDevice()));
493          pContextMenu->setItemEnabled(iItemID, bEnabled && !m_bNewDevice);          pContextMenu->setItemEnabled(iItemID, bEnabled && !m_bNewDevice);
494          pContextMenu->insertSeparator();          pContextMenu->insertSeparator();
495          iItemID = pContextMenu->insertItem(          iItemID = pContextMenu->insertItem(
# Line 448  void qsamplerDeviceForm::stabilizeForm ( Line 520  void qsamplerDeviceForm::stabilizeForm (
520    
521    
522  // end of qsamplerDeviceForm.ui.h  // end of qsamplerDeviceForm.ui.h
523    
524    
525    

Legend:
Removed from v.452  
changed lines
  Added in v.487

  ViewVC Help
Powered by ViewVC