Skip to content

Commit 4b8fd3a

Browse files
committed
Merge branch 'release/0.4'
2 parents 05f9967 + f8f5fee commit 4b8fd3a

19 files changed

+454
-217
lines changed

55-spotlight.rules

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,5 @@
1313
SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c53e", MODE="660", GROUP="plugdev", ENV{USB_HUB_TYPE}="046d:c53e"
1414

1515
# Rule when connected via Bluetooth
16-
SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT", MODE="660", GROUP="plugdev""
17-
18-
16+
# Updated rule, thanks to Torsten Maehne (https://github.com/maehne)
17+
SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT*", MODE="660", GROUP="plugdev"

CMakeLists.txt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ elseif(QTDIR)
99
list(APPEND CMAKE_PREFIX_PATH ${QTDIR})
1010
endif()
1111

12+
# Set the default build type to release
13+
if( NOT CMAKE_BUILD_TYPE )
14+
message(STATUS "Setting build type to 'Release' as none was specified.")
15+
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build." FORCE)
16+
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
17+
endif()
18+
1219
project(Projecteur LANGUAGES CXX)
1320

1421
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -42,3 +49,29 @@ add_version_info(projecteur "${CMAKE_CURRENT_SOURCE_DIR}")
4249

4350
# Add target with non-source files for convenience when using IDEs like QtCreator and others
4451
add_custom_target(non-sources SOURCES README.md LICENSE.md 55-spotlight.rules)
52+
53+
# Install
54+
install(TARGETS projecteur DESTINATION bin)
55+
56+
# Use udev.pc pkg-config file to set the dir path
57+
if (NOT CMAKE_INSTALL_UDEVRULESDIR)
58+
set (UDEVDIR /lib/udev)
59+
find_package(PkgConfig)
60+
if(PKG_CONFIG_FOUND)
61+
pkg_check_modules(PKGCONFIG_UDEV udev)
62+
if(PKGCONFIG_UDEV_FOUND)
63+
execute_process(
64+
COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=udevdir udev
65+
OUTPUT_VARIABLE PKGCONFIG_UDEVDIR
66+
OUTPUT_STRIP_TRAILING_WHITESPACE
67+
)
68+
if(PKGCONFIG_UDEVDIR)
69+
file(TO_CMAKE_PATH "${PKGCONFIG_UDEVDIR}" UDEVDIR)
70+
endif(PKGCONFIG_UDEVDIR)
71+
endif(PKGCONFIG_UDEV_FOUND)
72+
endif(PKG_CONFIG_FOUND)
73+
endif(NOT CMAKE_INSTALL_UDEVRULESDIR)
74+
set (CMAKE_INSTALL_UDEVRULESDIR ${UDEVDIR}/rules.d CACHE PATH "Where to install udev rules")
75+
mark_as_advanced(CMAKE_INSTALL_UDEVRULESDIR)
76+
77+
install(FILES 55-spotlight.rules DESTINATION ${CMAKE_INSTALL_UDEVRULESDIR}/)

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ master: [![Build Status master](https://travis-ci.org/jahnf/Projecteur.svg?branc
55

66
Linux/X11 application for the Logitech Spotlight device.
77

8-
Copyright 2018 [Jahn Fuchs](mailto:[email protected])
8+
Copyright 2018-2019 [Jahn Fuchs](mailto:[email protected])
99

1010
## Motivation
1111

@@ -26,7 +26,7 @@ So here it is: a Linux application for the Logitech Spotlight.
2626

2727
## Supported Environments
2828

29-
The application was tested only on Ubuntu 18.04 (GNOME) and OpenSuse 42.3 (GNOME)
29+
The application was tested on Ubuntu 18.04 (GNOME) and OpenSuse 42.3 and 15 (GNOME)
3030
but should work on almost any Linux/X11 Desktop. Make sure you have the correct
3131
udev rules installed (see Installation Pre-requisites).
3232

@@ -51,10 +51,12 @@ For more details: Have a look at the source code ;)
5151

5252
* C++11 compiler
5353
* CMake 3.6 or later
54-
* Qt 5.6 (Might also work in earlier Qt5 versions - but not tested)
54+
* Qt 5.9 and later
5555

5656
### Build Example
5757

58+
Note: You can ommit setting the `QTDIR` variable, CMake will then usually find the Qt versin that comes with the distribution's packacke management.
59+
5860
> git clone https://github.com/jahnf/projecteur
5961
> cd projecteur
6062
> mkdir build && cd build

aboutdlg.cc

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <QIcon>
99
#include <QLabel>
1010
#include <QPushButton>
11+
#include <QTabWidget>
1112
#include <QVBoxLayout>
1213
#include <QDialogButtonBox>
1314

@@ -22,10 +23,29 @@ AboutDialog::AboutDialog(QWidget* parent)
2223
iconLabel->setPixmap(QIcon(":/icons/projecteur-tray.svg").pixmap(QSize(128,128)));
2324
hbox->addWidget(iconLabel);
2425

25-
auto vbox = new QVBoxLayout();
26-
vbox->addWidget(new QLabel(QString("<b>%1</b><br>Version %2")
26+
auto tabWidget = new QTabWidget(this);
27+
hbox->addWidget(tabWidget, 1);
28+
29+
tabWidget->addTab(createVersionInfoWidget(), tr("Version"));
30+
// tabWidget->addTab(createContributorInfoWidget(), tr("Contributors"));
31+
32+
auto bbox = new QDialogButtonBox(QDialogButtonBox::Ok, this);
33+
connect(bbox, &QDialogButtonBox::clicked, this, &QDialog::accept);
34+
35+
auto mainVbox = new QVBoxLayout(this);
36+
mainVbox->addLayout(hbox);
37+
mainVbox->addSpacing(10);
38+
mainVbox->addWidget(bbox);
39+
}
40+
41+
QWidget* AboutDialog::createVersionInfoWidget()
42+
{
43+
auto versionInfoWidget = new QWidget(this);
44+
auto vbox = new QVBoxLayout(versionInfoWidget);
45+
vbox->addWidget(new QLabel(QString("<b>%1</b><br>%2")
2746
.arg(QCoreApplication::applicationName())
28-
.arg(projecteur::version_string()), this));
47+
.arg(tr("Version %1", "%1=application version number")
48+
.arg(projecteur::version_string()))));
2949

3050
if (QString(projecteur::version_branch()) != "master")
3151
{
@@ -42,16 +62,19 @@ AboutDialog::AboutDialog(QWidget* parent)
4262
vbox->addWidget(weblinkLabel);
4363

4464
vbox->addSpacing(20);
45-
vbox->addWidget(new QLabel(QString("Qt Version: %1").arg(QT_VERSION_STR), this));
65+
vbox->addWidget(new QLabel(tr("Qt Version: %1", "%1=qt version number").arg(QT_VERSION_STR), this));
4666

4767
vbox->addStretch(1);
48-
hbox->addLayout(vbox);
68+
return versionInfoWidget;
69+
}
4970

50-
auto bbox = new QDialogButtonBox(QDialogButtonBox::Ok, this);
51-
connect(bbox, &QDialogButtonBox::clicked, this, &QDialog::accept);
71+
QWidget* AboutDialog::createContributorInfoWidget()
72+
{
73+
auto contributorWidget = new QWidget(this);
74+
auto vbox = new QVBoxLayout(contributorWidget);
5275

53-
auto mainVbox = new QVBoxLayout(this);
54-
mainVbox->addLayout(hbox);
55-
mainVbox->addSpacing(10);
56-
mainVbox->addWidget(bbox);
76+
// TODO: list contributors (scroll box)
77+
78+
vbox->addStretch(1);
79+
return contributorWidget;
5780
}

aboutdlg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ class AboutDialog : public QDialog
1010
public:
1111
explicit AboutDialog(QWidget* parent = nullptr);
1212
virtual ~AboutDialog() override = default;
13+
14+
private:
15+
QWidget* createVersionInfoWidget();
16+
QWidget* createContributorInfoWidget();
1317
};

icons/projecteur-tray-64.png

4.3 KB
Loading

0 commit comments

Comments
 (0)