| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2018 Edouard Griffiths, F4EXB                                   //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 14:43:33 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // 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_GUI_EDITCOMMANDDIALOG_H_
 | 
					
						
							|  |  |  | #define SDRGUI_GUI_EDITCOMMANDDIALOG_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QDialog>
 | 
					
						
							|  |  |  | #include <vector>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | namespace Ui { | 
					
						
							|  |  |  |     class EditCommandDialog; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Command; | 
					
						
							| 
									
										
										
										
											2018-01-05 09:59:37 +01:00
										 |  |  | class CommandKeyReceiver; | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | class SDRGUI_API EditCommandDialog : public QDialog { | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  |     Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     explicit EditCommandDialog(const QStringList& groups, const QString& group, QWidget* parent = 0); | 
					
						
							|  |  |  |     ~EditCommandDialog(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QString getGroup() const; | 
					
						
							|  |  |  |     void setGroup(const QString& group); | 
					
						
							|  |  |  |     QString getDescription() const; | 
					
						
							|  |  |  |     void setDescription(const QString& description); | 
					
						
							|  |  |  |     QString getCommand() const; | 
					
						
							|  |  |  |     void setCommand(const QString& command); | 
					
						
							|  |  |  |     QString getArguments() const; | 
					
						
							|  |  |  |     void setArguments(const QString& arguments); | 
					
						
							|  |  |  |     Qt::Key getKey() const; | 
					
						
							|  |  |  |     Qt::KeyboardModifiers getKeyModifiers() const; | 
					
						
							|  |  |  |     void setKey(Qt::Key key, Qt::KeyboardModifiers modifiers); | 
					
						
							|  |  |  |     bool getAssociateKey() const; | 
					
						
							|  |  |  |     void setAssociateKey(bool associate); | 
					
						
							|  |  |  |     bool getRelease() const; | 
					
						
							|  |  |  |     void setRelease(bool release); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void toCommand(Command& command) const; | 
					
						
							|  |  |  |     void fromCommand(const Command& command); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     Ui::EditCommandDialog* ui; | 
					
						
							|  |  |  |     Qt::Key m_key; | 
					
						
							|  |  |  |     Qt::KeyboardModifiers m_keyModifiers; | 
					
						
							| 
									
										
										
										
											2018-01-05 09:59:37 +01:00
										 |  |  |     CommandKeyReceiver *m_commandKeyReceiver; | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void setKeyLabel(); | 
					
						
							|  |  |  |     void setKeyAssociate(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							|  |  |  |     void on_showFileDialog_clicked(bool checked); | 
					
						
							|  |  |  |     void on_keyCapture_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2018-01-05 09:59:37 +01:00
										 |  |  |     void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release); | 
					
						
							| 
									
										
										
										
											2018-01-04 11:11:53 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* SDRGUI_GUI_EDITCOMMANDDIALOG_H_ */
 |