Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
axelstudios committed Feb 16, 2017
1 parent 81da9fa commit dade9e8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 18 deletions.
12 changes: 7 additions & 5 deletions AboutBox.hpp.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#ifndef MOUSESIM_ABOUTBOX

#define MOUSESIM_ABOUTBOX \
"<h2>MouseSim</h2> \
<p>Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}</p> \
<p>Build Number: ${PROJECT_VERSION_TWEAK}</p> \
<p>Copyright &copy; 2017 Alex Swindler</p> \
<p><a href='https://github.com/axelstudios/MouseSim'>MouseSim</a> is a simple tool to simulate mouse movement and avoid computer inactivity.</p>"
"<div style=\"margin-right: 20px; text-align: center;\"> \
<h2>MouseSim</h2> \
<p>Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}</p> \
<p>Build Number: ${PROJECT_VERSION_TWEAK}</p> \
<p>Copyright &copy; 2017 Alex Swindler</p> \
<p><a href='https://github.com/axelstudios/MouseSim'>MouseSim</a> is a simple tool to simulate mouse movement and avoid computer inactivity.</p> \
</div>"

#endif // MOUSESIM_ABOUTBOX
12 changes: 5 additions & 7 deletions MouseSim.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "MouseSim.hpp"
#include <AboutBox.hpp>
#include "AboutBox.hpp"

#include <QAction>
#include <QCoreApplication>
#include <QMenu>
#include <QMessageBox>
Expand Down Expand Up @@ -70,7 +69,7 @@ MouseSim::MouseSim() :
m_trayIcon->show();
}

void MouseSim::iconActivated(QSystemTrayIcon::ActivationReason reason)
void MouseSim::iconActivated(QSystemTrayIcon::ActivationReason reason) const
{
if (reason == QSystemTrayIcon::Trigger || reason == QSystemTrayIcon::DoubleClick) {
if (m_timer->isActive()) {
Expand All @@ -95,7 +94,7 @@ void MouseSim::sendInput()
SendInput(1, &input, sizeof(INPUT));
}

void MouseSim::enable()
void MouseSim::enable() const
{
m_timer->start(1000);
m_trayIcon->setIcon(*m_activated);
Expand All @@ -105,7 +104,7 @@ void MouseSim::enable()
m_disableAction->setEnabled(true);
}

void MouseSim::disable()
void MouseSim::disable() const
{
m_timer->stop();

Expand All @@ -115,7 +114,7 @@ void MouseSim::disable()
m_enableAction->setEnabled(true);
}

void MouseSim::autostart(bool enabled)
void MouseSim::autostart(const bool enabled) const
{
if (enabled) {
m_settings->setValue("MouseSim", m_appPath);
Expand All @@ -128,7 +127,6 @@ void MouseSim::about()
{
QMessageBox about(nullptr);
about.setText(MOUSESIM_ABOUTBOX);
about.setStyleSheet("qproperty-alignment: AlignCenter;");
about.setWindowTitle("About MouseSim");
about.exec();
}
2 changes: 2 additions & 0 deletions MouseSim.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!--The ID below indicates application support for Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!--The ID below indicates application support for Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</assembly>
12 changes: 6 additions & 6 deletions MouseSim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class MouseSim : public QWidget
virtual ~MouseSim() override = default;

private slots:
void iconActivated(QSystemTrayIcon::ActivationReason reason);
void sendInput();
void enable();
void disable();
void autostart(bool enabled);
void about();
void iconActivated(QSystemTrayIcon::ActivationReason reason) const;
static void sendInput();
void enable() const;
void disable() const;
void autostart(const bool enabled) const;
static void about();

private:
const QString m_appPath;
Expand Down
1 change: 1 addition & 0 deletions MouseSim.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ BEGIN
VALUE "FileDescription", "MouseSim\0"
VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.0\0"
VALUE "InternalName", "MouseSim\0"
VALUE "LegalCopyright", "Copyright � 2017 Alex Swindler\0"
VALUE "OriginalFilename", "MouseSim.exe\0"
VALUE "ProductName", "MouseSim\0"
VALUE "ProductVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\0"
Expand Down
Binary file modified icons/mouse_16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit dade9e8

Please sign in to comment.