mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	Added missing files for DeviceStreamSettingsDialog
This commit is contained in:
		
							parent
							
								
									71de6774c4
								
							
						
					
					
						commit
						222005c189
					
				
							
								
								
									
										56
									
								
								sdrgui/gui/devicestreamselectiondialog.cpp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										56
									
								
								sdrgui/gui/devicestreamselectiondialog.cpp
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,56 @@
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
// Copyright (C) 2019 F4EXB                                                      //
 | 
			
		||||
// written by Edouard Griffiths                                                  //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// This program is free software; you can redistribute it and/or modify          //
 | 
			
		||||
// it under the terms of the GNU General Public License as published by          //
 | 
			
		||||
// the Free Software Foundation as version 3 of the License, or                  //
 | 
			
		||||
// (at your option) any later version.                                           //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// This program is distributed in the hope that it will be useful,               //
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
			
		||||
// GNU General Public License V3 for more details.                               //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// You should have received a copy of the GNU General Public License             //
 | 
			
		||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#include "ui_devicestreamselectiondialog.h"
 | 
			
		||||
#include "devicestreamselectiondialog.h"
 | 
			
		||||
 | 
			
		||||
DeviceStreamSelectionDialog::DeviceStreamSelectionDialog(QWidget *parent) :
 | 
			
		||||
    QDialog(parent),
 | 
			
		||||
    ui(new Ui::DeviceStreamSelectionDialog),
 | 
			
		||||
    m_hasChanged(false),
 | 
			
		||||
    m_streamIndex(0)
 | 
			
		||||
{
 | 
			
		||||
    ui->setupUi(this);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
DeviceStreamSelectionDialog::~DeviceStreamSelectionDialog()
 | 
			
		||||
{
 | 
			
		||||
    delete ui;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DeviceStreamSelectionDialog::setNumberOfStreams(int nbStreams)
 | 
			
		||||
{
 | 
			
		||||
    ui->deviceStream->clear();
 | 
			
		||||
 | 
			
		||||
    for (int i = 0; i < nbStreams; i++) {
 | 
			
		||||
        ui->deviceStream->addItem(tr("%1").arg(i));
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DeviceStreamSelectionDialog::setStreamIndex(int index)
 | 
			
		||||
{
 | 
			
		||||
    ui->deviceStream->setCurrentIndex(index);
 | 
			
		||||
    m_streamIndex = ui->deviceStream->currentIndex();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void DeviceStreamSelectionDialog::accept()
 | 
			
		||||
{
 | 
			
		||||
    m_streamIndex = ui->deviceStream->currentIndex();
 | 
			
		||||
    m_hasChanged = true;
 | 
			
		||||
     QDialog::accept();
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										50
									
								
								sdrgui/gui/devicestreamselectiondialog.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								sdrgui/gui/devicestreamselectiondialog.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,50 @@
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
// Copyright (C) 2019 F4EXB                                                      //
 | 
			
		||||
// written by Edouard Griffiths                                                  //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// This program is free software; you can redistribute it and/or modify          //
 | 
			
		||||
// it under the terms of the GNU General Public License as published by          //
 | 
			
		||||
// the Free Software Foundation as version 3 of the License, or                  //
 | 
			
		||||
// (at your option) any later version.                                           //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// This program is distributed in the hope that it will be useful,               //
 | 
			
		||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
			
		||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
			
		||||
// GNU General Public License V3 for more details.                               //
 | 
			
		||||
//                                                                               //
 | 
			
		||||
// You should have received a copy of the GNU General Public License             //
 | 
			
		||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
			
		||||
///////////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
#ifndef _SDRGUI_DEVICESTREAMSELECTIONDIALOG_H_
 | 
			
		||||
#define _SDRGUI_DEVICESTREAMSELECTIONDIALOG_H_
 | 
			
		||||
 | 
			
		||||
#include <QDialog>
 | 
			
		||||
 | 
			
		||||
#include "../../exports/export.h"
 | 
			
		||||
 | 
			
		||||
namespace Ui {
 | 
			
		||||
    class DeviceStreamSelectionDialog;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class SDRGUI_API DeviceStreamSelectionDialog : public QDialog
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
public:
 | 
			
		||||
    explicit DeviceStreamSelectionDialog(QWidget *parent = nullptr);
 | 
			
		||||
    ~DeviceStreamSelectionDialog();
 | 
			
		||||
    bool hasChanged() const { return m_hasChanged; }
 | 
			
		||||
    void setNumberOfStreams(int nbStreams);
 | 
			
		||||
    void setStreamIndex(int index);
 | 
			
		||||
    int getSelectedStreamIndex() const { return m_streamIndex; };
 | 
			
		||||
 | 
			
		||||
private slots:
 | 
			
		||||
    void accept();
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    Ui::DeviceStreamSelectionDialog *ui;
 | 
			
		||||
    bool m_hasChanged;
 | 
			
		||||
    int m_streamIndex;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // _SDRGUI_DEVICESTREAMSELECTIONDIALOG_H_
 | 
			
		||||
							
								
								
									
										101
									
								
								sdrgui/gui/devicestreamselectiondialog.ui
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								sdrgui/gui/devicestreamselectiondialog.ui
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,101 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<ui version="4.0">
 | 
			
		||||
 <class>DeviceStreamSelectionDialog</class>
 | 
			
		||||
 <widget class="QDialog" name="DeviceStreamSelectionDialog">
 | 
			
		||||
  <property name="geometry">
 | 
			
		||||
   <rect>
 | 
			
		||||
    <x>0</x>
 | 
			
		||||
    <y>0</y>
 | 
			
		||||
    <width>400</width>
 | 
			
		||||
    <height>135</height>
 | 
			
		||||
   </rect>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="font">
 | 
			
		||||
   <font>
 | 
			
		||||
    <family>Liberation Sans</family>
 | 
			
		||||
    <pointsize>9</pointsize>
 | 
			
		||||
   </font>
 | 
			
		||||
  </property>
 | 
			
		||||
  <property name="windowTitle">
 | 
			
		||||
   <string>Select device stream</string>
 | 
			
		||||
  </property>
 | 
			
		||||
  <layout class="QVBoxLayout" name="verticalLayout">
 | 
			
		||||
   <item>
 | 
			
		||||
    <layout class="QHBoxLayout" name="deviceStreamLayout">
 | 
			
		||||
     <item>
 | 
			
		||||
      <widget class="QLabel" name="deviceStreamLabel">
 | 
			
		||||
       <property name="text">
 | 
			
		||||
        <string>Stream</string>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item>
 | 
			
		||||
      <widget class="QComboBox" name="deviceStream">
 | 
			
		||||
       <property name="toolTip">
 | 
			
		||||
        <string>Devcie stream index</string>
 | 
			
		||||
       </property>
 | 
			
		||||
      </widget>
 | 
			
		||||
     </item>
 | 
			
		||||
     <item>
 | 
			
		||||
      <spacer name="horizontalSpacer">
 | 
			
		||||
       <property name="orientation">
 | 
			
		||||
        <enum>Qt::Horizontal</enum>
 | 
			
		||||
       </property>
 | 
			
		||||
       <property name="sizeHint" stdset="0">
 | 
			
		||||
        <size>
 | 
			
		||||
         <width>40</width>
 | 
			
		||||
         <height>20</height>
 | 
			
		||||
        </size>
 | 
			
		||||
       </property>
 | 
			
		||||
      </spacer>
 | 
			
		||||
     </item>
 | 
			
		||||
    </layout>
 | 
			
		||||
   </item>
 | 
			
		||||
   <item>
 | 
			
		||||
    <widget class="QDialogButtonBox" name="buttonBox">
 | 
			
		||||
     <property name="orientation">
 | 
			
		||||
      <enum>Qt::Horizontal</enum>
 | 
			
		||||
     </property>
 | 
			
		||||
     <property name="standardButtons">
 | 
			
		||||
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
 | 
			
		||||
     </property>
 | 
			
		||||
    </widget>
 | 
			
		||||
   </item>
 | 
			
		||||
  </layout>
 | 
			
		||||
 </widget>
 | 
			
		||||
 <resources/>
 | 
			
		||||
 <connections>
 | 
			
		||||
  <connection>
 | 
			
		||||
   <sender>buttonBox</sender>
 | 
			
		||||
   <signal>accepted()</signal>
 | 
			
		||||
   <receiver>DeviceStreamSelectionDialog</receiver>
 | 
			
		||||
   <slot>accept()</slot>
 | 
			
		||||
   <hints>
 | 
			
		||||
    <hint type="sourcelabel">
 | 
			
		||||
     <x>248</x>
 | 
			
		||||
     <y>254</y>
 | 
			
		||||
    </hint>
 | 
			
		||||
    <hint type="destinationlabel">
 | 
			
		||||
     <x>157</x>
 | 
			
		||||
     <y>274</y>
 | 
			
		||||
    </hint>
 | 
			
		||||
   </hints>
 | 
			
		||||
  </connection>
 | 
			
		||||
  <connection>
 | 
			
		||||
   <sender>buttonBox</sender>
 | 
			
		||||
   <signal>rejected()</signal>
 | 
			
		||||
   <receiver>DeviceStreamSelectionDialog</receiver>
 | 
			
		||||
   <slot>reject()</slot>
 | 
			
		||||
   <hints>
 | 
			
		||||
    <hint type="sourcelabel">
 | 
			
		||||
     <x>316</x>
 | 
			
		||||
     <y>260</y>
 | 
			
		||||
    </hint>
 | 
			
		||||
    <hint type="destinationlabel">
 | 
			
		||||
     <x>286</x>
 | 
			
		||||
     <y>274</y>
 | 
			
		||||
    </hint>
 | 
			
		||||
   </hints>
 | 
			
		||||
  </connection>
 | 
			
		||||
 </connections>
 | 
			
		||||
</ui>
 | 
			
		||||
@ -322,7 +322,6 @@ void RollupWidget::mousePressEvent(QMouseEvent* event)
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	// close button right
 | 
			
		||||
	if(QRectF(width() - 3.5 - fm.ascent(), 3.5, fm.ascent(), fm.ascent()).contains(event->pos())) {
 | 
			
		||||
		close();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user