- further renaming from Litt to Noo

This commit is contained in:
Dmytro Bogovych 2022-06-01 21:12:16 +03:00
parent 2e5bda5d07
commit 6abfee0528
7 changed files with 43 additions and 31 deletions

View File

@ -271,7 +271,7 @@ bool activityTracker::ensureSmartTrackingIsPossible()
if (!result && QSysInfo::MacintoshVersion <= QSysInfo::MV_10_8)
{
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."),
QMessageBox::NoButton, nullptr);
msgbox.addButton(QT_TR_NOOP("Open System Preferences"), QMessageBox::AcceptRole);

View File

@ -33,6 +33,9 @@
#include "connectdb_widget.h"
#include "openorcreatedb_widget.h"
#include "qtkeychain/keychain.h"
#if defined(TARGET_LINUX)
# include "platforms/linux/autostart.h"
#endif
#include <QDesktopWidget>
#include <iostream>
@ -49,24 +52,15 @@ MainWindow::MainWindow(QWidget *parent) :
{
mSettings = QSharedPointer<Settings>(new Settings());
// Dark theme if needed
helper::theme::applyCurrent(*mSettings);
mAttachmentsAction = nullptr;
mAttachmentsLabel = nullptr;
this->setUpdatesEnabled(false);
mDuplicationSignalLabel = nullptr;
mCurrentIntervalLabel = nullptr;
mTrayIcon = nullptr;
QCoreApplication::setApplicationName(APPNAME);
// Restore window size & position from last run
setUpdatesEnabled(false);
loadGeometry();
setUpdatesEnabled(true);
this->setUpdatesEnabled(true);
// init event
// Other initialization will run in next event loop iteration
QApplication::postEvent(this, new ClientEvent<UiInitId>());
}
@ -402,6 +396,7 @@ void MainWindow::customEvent(QEvent *ev)
}
case static_cast<QEvent::Type>(UiInitId):
setupAppMenu();
setupMainUi();
loadGeometry();
break;
@ -1336,7 +1331,7 @@ void MainWindow::showTimeForTrackingTask()
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;
mTrayIcon->setToolTip(tooltip);
@ -1351,7 +1346,7 @@ void MainWindow::initTrayIcon()
mTrayIcon = new QSystemTrayIcon();
connect(mTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(iconActivated(QSystemTrayIcon::ActivationReason)));
updateTrayIcon(Tray_ShowMessage);
mTrayIcon->setIcon(getAppIcon());
mTrayIcon->setVisible(true);
}
}
@ -1376,33 +1371,33 @@ void MainWindow::updateTrayIcon(TrayShowMessage flag)
bool showSeconds = mSettings->data()[KEY_SHOW_SECONDS].toBool();
int spentSecondsToday = mCurrentTask->timeline()->today();
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;
}
else
{
tooltip = tr("Litt is not tracking now.");
tooltip = tr("Noo is not tracking now.");
}
mTrayIcon->setToolTip(tooltip);
if (mCurrentTask)
{
QIcon icon(TRAY_RUNNING_ICON_NAME);
/*QIcon icon(TRAY_RUNNING_ICON_NAME);
#if defined(TARGET_OSX)
icon.setIsMask(true);
#endif
mTrayIcon->setIcon(icon);
mTrayIcon->setIcon(icon);*/
if (flag == Tray_ShowMessage)
mTrayIcon->showMessage(tr("Time tracking started"), mCurrentTask->path());
}
else
{
QIcon icon(TRAY_DEFAULT_ICON_NAME);
/*QIcon icon(TRAY_DEFAULT_ICON_NAME);
#if defined(TARGET_OSX)
icon.setIsMask(true);
#endif
mTrayIcon->setIcon(icon);
mTrayIcon->setIcon(icon);*/
}
}
@ -1613,6 +1608,13 @@ void MainWindow::showMainWindow()
#endif
}
void MainWindow::setupAppMenu()
{
#if defined(TARGET_LINUX)
appmenu::install(QCoreApplication::applicationFilePath().toStdString());
#endif
}
void MainWindow::continueOnIdle()
{
// Disable idle detection at all - it is not needed in this session anymore

View File

@ -64,7 +64,7 @@ private:
QLabel* mDuplicationSignalLabel = nullptr;;
QSystemTrayIcon *mTrayIcon = nullptr;
QSharedPointer<Settings> mSettings;
bool mPasswordFailed;
bool mPasswordFailed = false;
PasswordDlg* mPasswordDlg = nullptr;
NewPasswordDlg* mNewPasswordDlg = nullptr;
QMessageBox* mAlertBox = nullptr;
@ -73,7 +73,7 @@ private:
QDateTime mLastTimelineFlush;
// Attachments action
QAction* mAttachmentsAction;
QAction* mAttachmentsAction = nullptr;
// Attachments label
QLabel* mAttachmentsLabel = nullptr;
@ -161,6 +161,8 @@ private:
void buildOpenOrCreateView();
void buildMainView();
void setupAppMenu();
void onDatabaseAvailable();
signals:
void onTimeFormatChanged();

View File

@ -72,6 +72,8 @@ SOURCES += main.cpp \
timereportwizard.cpp \
platforms/hidtracker.cpp \
platforms/hidtrackerimpl.cpp \
platforms/linux/autostart.cpp \
platforms/linux/idle_tracking.cpp \
logger.cpp \
timeintervaldlg.cpp \
aboutdlg.cpp \
@ -84,7 +86,9 @@ SOURCES += main.cpp \
startworkdialog.cpp \
twofish.cpp \
openorcreatedb_widget.cpp \
connectdb_widget.cpp
connectdb_widget.cpp \
runguard.cpp \
HEADERS += mainwindow.h \
storage.h \
@ -113,6 +117,8 @@ HEADERS += mainwindow.h \
sqlite3ext.h \
platforms/hidtracker.h \
platforms/hidtrackerimpl.h \
platforms/linux/autostart.h \
platforms/linux/idle_tracking.h \
logger.h \
timeintervaldlg.h \
aboutdlg.h \
@ -125,7 +131,8 @@ HEADERS += mainwindow.h \
startworkdialog.h \
twofish.h \
openorcreatedb_widget.h \
connectdb_widget.h
connectdb_widget.h \
runguard.h
macx {
HEADERS += platforms/osx/hidtrackerimpl_osx.h

View File

@ -45,7 +45,7 @@ void OpenOrCreateDbWidget::handleEnteredPasswords()
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())
{
mDbPath = path;

View File

@ -211,6 +211,6 @@
<file>rc/window_undock_pressed@2x.png</file>
</qresource>
<qresource prefix="qdarkstyle/dark">
<file>darkstyle.qss</file>
<file>style.qss</file>
</qresource>
</RCC>

View File

@ -43,6 +43,7 @@
#define KEY_DARK_THEME "DarkTheme"
#define KEY_ASK_BEFORE_DELETE "AskBeforeDelete"
class Settings
{
public: