Re: [PATCHv2 FINAL 2/6] qv4l2: add hotkeys for common operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Bård/Hans,

Em Tue, 30 Jul 2013 10:15:20 +0200
Bård Eirik Winther <bwinther@xxxxxxxxx> escreveu:

> CTRL + V : When main window is selected start capture.
>            This gives an option other than the button to start recording,
>            as this is a frequent operation when using the utility.
> CTRL + W : When CaptureWin is selected close capture window
>            It makes it easier to deal with high resolutions video on
>            small screen, especially when the window close button may
>            be outside the monitor when repositioning the window.

It would be great if you could also add some documentation for qv4l2,
adding there the supported hot keys.

IMO, the better is to write it as a man page. If you need an example,
you could take a look at utils/keytable/ir-keytable.1.

At the building system, all that it is needed is to add something like
what's there at utils/keytable/Makefile.am:
	man_MANS = ir-keytable.1

Thanks,
Mauro

> 
> Signed-off-by: Bård Eirik Winther <bwinther@xxxxxxxxx>
> ---
>  utils/qv4l2/capture-win.cpp | 8 ++++++++
>  utils/qv4l2/capture-win.h   | 4 +++-
>  utils/qv4l2/qv4l2.cpp       | 1 +
>  3 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/qv4l2/capture-win.cpp b/utils/qv4l2/capture-win.cpp
> index 6798252..a94c73d 100644
> --- a/utils/qv4l2/capture-win.cpp
> +++ b/utils/qv4l2/capture-win.cpp
> @@ -35,6 +35,14 @@ CaptureWin::CaptureWin()
>  
>  	vbox->addWidget(m_label);
>  	vbox->addWidget(m_msg);
> +
> +	hotkeyClose = new QShortcut(Qt::CTRL+Qt::Key_W, this);
> +	QObject::connect(hotkeyClose, SIGNAL(activated()), this, SLOT(close()));
> +}
> +
> +CaptureWin::~CaptureWin()
> +{
> +	delete hotkeyClose;
>  }
>  
>  void CaptureWin::setImage(const QImage &image, const QString &status)
> diff --git a/utils/qv4l2/capture-win.h b/utils/qv4l2/capture-win.h
> index e861b12..4115d56 100644
> --- a/utils/qv4l2/capture-win.h
> +++ b/utils/qv4l2/capture-win.h
> @@ -21,6 +21,7 @@
>  #define CAPTURE_WIN_H
>  
>  #include <QWidget>
> +#include <QShortcut>
>  #include <sys/time.h>
>  
>  class QImage;
> @@ -32,7 +33,7 @@ class CaptureWin : public QWidget
>  
>  public:
>  	CaptureWin();
> -	virtual ~CaptureWin() {}
> +	~CaptureWin();
>  
>  	void setImage(const QImage &image, const QString &status);
>  
> @@ -45,6 +46,7 @@ signals:
>  private:
>  	QLabel *m_label;
>  	QLabel *m_msg;
> +	QShortcut *hotkeyClose;
>  };
>  
>  #endif
> diff --git a/utils/qv4l2/qv4l2.cpp b/utils/qv4l2/qv4l2.cpp
> index a8fcc65..bb1d84f 100644
> --- a/utils/qv4l2/qv4l2.cpp
> +++ b/utils/qv4l2/qv4l2.cpp
> @@ -78,6 +78,7 @@ ApplicationWindow::ApplicationWindow() :
>  	m_capStartAct->setStatusTip("Start capturing");
>  	m_capStartAct->setCheckable(true);
>  	m_capStartAct->setDisabled(true);
> +	m_capStartAct->setShortcut(Qt::CTRL+Qt::Key_V);
>  	connect(m_capStartAct, SIGNAL(toggled(bool)), this, SLOT(capStart(bool)));
>  
>  	m_snapshotAct = new QAction(QIcon(":/snapshot.png"), "&Make Snapshot", this);


-- 

Cheers,
Mauro
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux