- further renaming from Litt to Noo
This commit is contained in:
parent
2e5bda5d07
commit
6abfee0528
@ -271,7 +271,7 @@ bool activityTracker::ensureSmartTrackingIsPossible()
|
|||||||
if (!result && QSysInfo::MacintoshVersion <= QSysInfo::MV_10_8)
|
if (!result && QSysInfo::MacintoshVersion <= QSysInfo::MV_10_8)
|
||||||
{
|
{
|
||||||
QMessageBox msgbox(QMessageBox::Question, QT_TR_NOOP("Permission required"),
|
QMessageBox msgbox(QMessageBox::Question, QT_TR_NOOP("Permission required"),
|
||||||
QT_TR_NOOP("To use smart time tracking Litt needs access to OS X accessibility features.\
|
QT_TR_NOOP("To use smart time tracking Noo needs access to OS X accessibility features.\
|
||||||
Please grant access in Security & Privacy preferences, location in System Preferences."),
|
Please grant access in Security & Privacy preferences, location in System Preferences."),
|
||||||
QMessageBox::NoButton, nullptr);
|
QMessageBox::NoButton, nullptr);
|
||||||
msgbox.addButton(QT_TR_NOOP("Open System Preferences"), QMessageBox::AcceptRole);
|
msgbox.addButton(QT_TR_NOOP("Open System Preferences"), QMessageBox::AcceptRole);
|
||||||
|
|||||||
@ -33,6 +33,9 @@
|
|||||||
#include "connectdb_widget.h"
|
#include "connectdb_widget.h"
|
||||||
#include "openorcreatedb_widget.h"
|
#include "openorcreatedb_widget.h"
|
||||||
#include "qtkeychain/keychain.h"
|
#include "qtkeychain/keychain.h"
|
||||||
|
#if defined(TARGET_LINUX)
|
||||||
|
# include "platforms/linux/autostart.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -49,24 +52,15 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
mSettings = QSharedPointer<Settings>(new Settings());
|
mSettings = QSharedPointer<Settings>(new Settings());
|
||||||
|
|
||||||
|
// Dark theme if needed
|
||||||
helper::theme::applyCurrent(*mSettings);
|
helper::theme::applyCurrent(*mSettings);
|
||||||
|
|
||||||
mAttachmentsAction = nullptr;
|
// Restore window size & position from last run
|
||||||
mAttachmentsLabel = nullptr;
|
setUpdatesEnabled(false);
|
||||||
|
|
||||||
this->setUpdatesEnabled(false);
|
|
||||||
|
|
||||||
mDuplicationSignalLabel = nullptr;
|
|
||||||
mCurrentIntervalLabel = nullptr;
|
|
||||||
mTrayIcon = nullptr;
|
|
||||||
|
|
||||||
QCoreApplication::setApplicationName(APPNAME);
|
|
||||||
|
|
||||||
loadGeometry();
|
loadGeometry();
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
|
||||||
this->setUpdatesEnabled(true);
|
// Other initialization will run in next event loop iteration
|
||||||
|
|
||||||
// init event
|
|
||||||
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
QApplication::postEvent(this, new ClientEvent<UiInitId>());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,6 +396,7 @@ void MainWindow::customEvent(QEvent *ev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
case static_cast<QEvent::Type>(UiInitId):
|
case static_cast<QEvent::Type>(UiInitId):
|
||||||
|
setupAppMenu();
|
||||||
setupMainUi();
|
setupMainUi();
|
||||||
loadGeometry();
|
loadGeometry();
|
||||||
break;
|
break;
|
||||||
@ -445,8 +440,8 @@ void MainWindow::preferences()
|
|||||||
if (mSettings->data()[KEY_SHOW_TRAY_ICON].toBool() && !mTrayIcon && QSystemTrayIcon::isSystemTrayAvailable())
|
if (mSettings->data()[KEY_SHOW_TRAY_ICON].toBool() && !mTrayIcon && QSystemTrayIcon::isSystemTrayAvailable())
|
||||||
initTrayIcon();
|
initTrayIcon();
|
||||||
else
|
else
|
||||||
if (!mSettings->data()[KEY_SHOW_TRAY_ICON].toBool() && mTrayIcon)
|
if (!mSettings->data()[KEY_SHOW_TRAY_ICON].toBool() && mTrayIcon)
|
||||||
removeTrayIcon();
|
removeTrayIcon();
|
||||||
|
|
||||||
updateData();
|
updateData();
|
||||||
}
|
}
|
||||||
@ -1336,7 +1331,7 @@ void MainWindow::showTimeForTrackingTask()
|
|||||||
|
|
||||||
if (mTrayIcon)
|
if (mTrayIcon)
|
||||||
{
|
{
|
||||||
QString tooltip = tr("Litt is tracking ") + mCurrentTask->title() + ".\n" +
|
QString tooltip = tr("Noo is tracking ") + mCurrentTask->title() + ".\n" +
|
||||||
tr("Time spent today for this task is ") + timeString;
|
tr("Time spent today for this task is ") + timeString;
|
||||||
|
|
||||||
mTrayIcon->setToolTip(tooltip);
|
mTrayIcon->setToolTip(tooltip);
|
||||||
@ -1351,7 +1346,7 @@ void MainWindow::initTrayIcon()
|
|||||||
mTrayIcon = new QSystemTrayIcon();
|
mTrayIcon = new QSystemTrayIcon();
|
||||||
connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
|
connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
|
||||||
updateTrayIcon(Tray_ShowMessage);
|
updateTrayIcon(Tray_ShowMessage);
|
||||||
|
mTrayIcon->setIcon(getAppIcon());
|
||||||
mTrayIcon->setVisible(true);
|
mTrayIcon->setVisible(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1376,33 +1371,33 @@ void MainWindow::updateTrayIcon(TrayShowMessage flag)
|
|||||||
bool showSeconds = mSettings->data()[KEY_SHOW_SECONDS].toBool();
|
bool showSeconds = mSettings->data()[KEY_SHOW_SECONDS].toBool();
|
||||||
int spentSecondsToday = mCurrentTask->timeline()->today();
|
int spentSecondsToday = mCurrentTask->timeline()->today();
|
||||||
QString timeString = QString::fromStdString(helper::chrono::secondsToDisplay(spentSecondsToday, showSeconds));
|
QString timeString = QString::fromStdString(helper::chrono::secondsToDisplay(spentSecondsToday, showSeconds));
|
||||||
tooltip = tr("Litt is tracking ") + mCurrentTask->title() + ".\n" +
|
tooltip = tr("Noo is tracking ") + mCurrentTask->title() + ".\n" +
|
||||||
tr("Time spent today for this task is ") + timeString;
|
tr("Time spent today for this task is ") + timeString;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tooltip = tr("Litt is not tracking now.");
|
tooltip = tr("Noo is not tracking now.");
|
||||||
}
|
}
|
||||||
|
|
||||||
mTrayIcon->setToolTip(tooltip);
|
mTrayIcon->setToolTip(tooltip);
|
||||||
|
|
||||||
if (mCurrentTask)
|
if (mCurrentTask)
|
||||||
{
|
{
|
||||||
QIcon icon(TRAY_RUNNING_ICON_NAME);
|
/*QIcon icon(TRAY_RUNNING_ICON_NAME);
|
||||||
#if defined(TARGET_OSX)
|
#if defined(TARGET_OSX)
|
||||||
icon.setIsMask(true);
|
icon.setIsMask(true);
|
||||||
#endif
|
#endif
|
||||||
mTrayIcon->setIcon(icon);
|
mTrayIcon->setIcon(icon);*/
|
||||||
if (flag == Tray_ShowMessage)
|
if (flag == Tray_ShowMessage)
|
||||||
mTrayIcon->showMessage(tr("Time tracking started"), mCurrentTask->path());
|
mTrayIcon->showMessage(tr("Time tracking started"), mCurrentTask->path());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QIcon icon(TRAY_DEFAULT_ICON_NAME);
|
/*QIcon icon(TRAY_DEFAULT_ICON_NAME);
|
||||||
#if defined(TARGET_OSX)
|
#if defined(TARGET_OSX)
|
||||||
icon.setIsMask(true);
|
icon.setIsMask(true);
|
||||||
#endif
|
#endif
|
||||||
mTrayIcon->setIcon(icon);
|
mTrayIcon->setIcon(icon);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1613,6 +1608,13 @@ void MainWindow::showMainWindow()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setupAppMenu()
|
||||||
|
{
|
||||||
|
#if defined(TARGET_LINUX)
|
||||||
|
appmenu::install(QCoreApplication::applicationFilePath().toStdString());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::continueOnIdle()
|
void MainWindow::continueOnIdle()
|
||||||
{
|
{
|
||||||
// Disable idle detection at all - it is not needed in this session anymore
|
// Disable idle detection at all - it is not needed in this session anymore
|
||||||
|
|||||||
@ -64,7 +64,7 @@ private:
|
|||||||
QLabel* mDuplicationSignalLabel = nullptr;;
|
QLabel* mDuplicationSignalLabel = nullptr;;
|
||||||
QSystemTrayIcon *mTrayIcon = nullptr;
|
QSystemTrayIcon *mTrayIcon = nullptr;
|
||||||
QSharedPointer<Settings> mSettings;
|
QSharedPointer<Settings> mSettings;
|
||||||
bool mPasswordFailed;
|
bool mPasswordFailed = false;
|
||||||
PasswordDlg* mPasswordDlg = nullptr;
|
PasswordDlg* mPasswordDlg = nullptr;
|
||||||
NewPasswordDlg* mNewPasswordDlg = nullptr;
|
NewPasswordDlg* mNewPasswordDlg = nullptr;
|
||||||
QMessageBox* mAlertBox = nullptr;
|
QMessageBox* mAlertBox = nullptr;
|
||||||
@ -73,7 +73,7 @@ private:
|
|||||||
QDateTime mLastTimelineFlush;
|
QDateTime mLastTimelineFlush;
|
||||||
|
|
||||||
// Attachments action
|
// Attachments action
|
||||||
QAction* mAttachmentsAction;
|
QAction* mAttachmentsAction = nullptr;
|
||||||
|
|
||||||
// Attachments label
|
// Attachments label
|
||||||
QLabel* mAttachmentsLabel = nullptr;
|
QLabel* mAttachmentsLabel = nullptr;
|
||||||
@ -161,6 +161,8 @@ private:
|
|||||||
void buildOpenOrCreateView();
|
void buildOpenOrCreateView();
|
||||||
void buildMainView();
|
void buildMainView();
|
||||||
|
|
||||||
|
void setupAppMenu();
|
||||||
|
|
||||||
void onDatabaseAvailable();
|
void onDatabaseAvailable();
|
||||||
signals:
|
signals:
|
||||||
void onTimeFormatChanged();
|
void onTimeFormatChanged();
|
||||||
|
|||||||
@ -72,6 +72,8 @@ SOURCES += main.cpp \
|
|||||||
timereportwizard.cpp \
|
timereportwizard.cpp \
|
||||||
platforms/hidtracker.cpp \
|
platforms/hidtracker.cpp \
|
||||||
platforms/hidtrackerimpl.cpp \
|
platforms/hidtrackerimpl.cpp \
|
||||||
|
platforms/linux/autostart.cpp \
|
||||||
|
platforms/linux/idle_tracking.cpp \
|
||||||
logger.cpp \
|
logger.cpp \
|
||||||
timeintervaldlg.cpp \
|
timeintervaldlg.cpp \
|
||||||
aboutdlg.cpp \
|
aboutdlg.cpp \
|
||||||
@ -84,7 +86,9 @@ SOURCES += main.cpp \
|
|||||||
startworkdialog.cpp \
|
startworkdialog.cpp \
|
||||||
twofish.cpp \
|
twofish.cpp \
|
||||||
openorcreatedb_widget.cpp \
|
openorcreatedb_widget.cpp \
|
||||||
connectdb_widget.cpp
|
connectdb_widget.cpp \
|
||||||
|
runguard.cpp \
|
||||||
|
|
||||||
|
|
||||||
HEADERS += mainwindow.h \
|
HEADERS += mainwindow.h \
|
||||||
storage.h \
|
storage.h \
|
||||||
@ -113,6 +117,8 @@ HEADERS += mainwindow.h \
|
|||||||
sqlite3ext.h \
|
sqlite3ext.h \
|
||||||
platforms/hidtracker.h \
|
platforms/hidtracker.h \
|
||||||
platforms/hidtrackerimpl.h \
|
platforms/hidtrackerimpl.h \
|
||||||
|
platforms/linux/autostart.h \
|
||||||
|
platforms/linux/idle_tracking.h \
|
||||||
logger.h \
|
logger.h \
|
||||||
timeintervaldlg.h \
|
timeintervaldlg.h \
|
||||||
aboutdlg.h \
|
aboutdlg.h \
|
||||||
@ -125,7 +131,8 @@ HEADERS += mainwindow.h \
|
|||||||
startworkdialog.h \
|
startworkdialog.h \
|
||||||
twofish.h \
|
twofish.h \
|
||||||
openorcreatedb_widget.h \
|
openorcreatedb_widget.h \
|
||||||
connectdb_widget.h
|
connectdb_widget.h \
|
||||||
|
runguard.h
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
HEADERS += platforms/osx/hidtrackerimpl_osx.h
|
HEADERS += platforms/osx/hidtrackerimpl_osx.h
|
||||||
|
|||||||
@ -45,7 +45,7 @@ void OpenOrCreateDbWidget::handleEnteredPasswords()
|
|||||||
|
|
||||||
void OpenOrCreateDbWidget::askForDatabase()
|
void OpenOrCreateDbWidget::askForDatabase()
|
||||||
{
|
{
|
||||||
QString path = QFileDialog::getOpenFileName(this, "Please select existing database", QString(), "*.litt");
|
QString path = QFileDialog::getOpenFileName(this, "Please select existing database", QString(), "*.noo");
|
||||||
if (path.size())
|
if (path.size())
|
||||||
{
|
{
|
||||||
mDbPath = path;
|
mDbPath = path;
|
||||||
|
|||||||
@ -211,6 +211,6 @@
|
|||||||
<file>rc/window_undock_pressed@2x.png</file>
|
<file>rc/window_undock_pressed@2x.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="qdarkstyle/dark">
|
<qresource prefix="qdarkstyle/dark">
|
||||||
<file>darkstyle.qss</file>
|
<file>style.qss</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@ -43,6 +43,7 @@
|
|||||||
#define KEY_DARK_THEME "DarkTheme"
|
#define KEY_DARK_THEME "DarkTheme"
|
||||||
#define KEY_ASK_BEFORE_DELETE "AskBeforeDelete"
|
#define KEY_ASK_BEFORE_DELETE "AskBeforeDelete"
|
||||||
|
|
||||||
|
|
||||||
class Settings
|
class Settings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user