Skip to content

Commit fca0b7d

Browse files
authored
V2025.4.0 (#29)
* feat: Bring backend up to date * fix: Qt build * feat: New Qt design * feat: Better backend API * feat: Add `Clear and Sync` option * fix: Bug fixes * feat(WIP): New Qt design * feat(WIP): Start new `MainWindow` * feat: Update design + deps * feat: New design * feat: Various fixes * feat: Version bump
1 parent 05dccae commit fca0b7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2642
-2075
lines changed

.github/workflows/windows.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,21 @@ jobs:
2323
with:
2424
submodules: recursive
2525
- name: "Setup Environment"
26+
shell: pwsh
2627
run: |
28+
$ProgressPreference = 'SilentlyContinue'
2729
mkdir build
28-
powershell -command "Invoke-WebRequest https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.21-v1.16/gettext0.21-iconv1.16-shared-64.zip -OutFile gettext.zip"
29-
powershell -command "Expand-Archive -Force 'gettext.zip'"
30+
Invoke-WebRequest https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.23-v1.17/gettext0.23-iconv1.17-shared-64.zip -OutFile gettext.zip
31+
Expand-Archive -Force 'gettext.zip'
3032
move gettext\bin\* C:\Windows\System32
3133
choco install innosetup
3234
- name: "Vcpkg"
3335
uses: johnwason/vcpkg-action@v6
3436
id: vcpkg
3537
with:
36-
pkgs: libnick libjpeg-turbo boost-gil qtbase qtsvg qttools
38+
pkgs: libnick libjpeg-turbo boost-gil qtbase qtsvg qttools qlementine qlementine-icons
3739
triplet: x64-windows
38-
revision: e590c2b30c08caf1dd8d612ec602a003f9784b7d
40+
revision: bc994510d2eb11aac7b43b03f67a7751d5bfe0e4
3941
token: ${{ secrets.GITHUB_TOKEN }}
4042
github-binarycache: true
4143
- name: "Build"
@@ -45,11 +47,13 @@ jobs:
4547
cmake --build . --config Release
4648
- name: "Create Installer"
4749
working-directory: ${{github.workspace}}/inno
50+
shell: pwsh
4851
run: |
49-
powershell -command "Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe"
52+
$ProgressPreference = 'SilentlyContinue'
53+
Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe
5054
iscc setup.iss
5155
- name: Upload
5256
uses: actions/upload-artifact@v4
5357
with:
5458
path: ${{github.workspace}}/inno/NickvisionSpotlightSetup.exe
55-
name: Windows-x64-Release
59+
name: Windows-x64-Release

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (POLICY CMP0141)
1515
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
1616
endif()
1717

18-
project("org.nickvision.spotlight" LANGUAGES C CXX VERSION 2024.8.0 DESCRIPTION "Find your favorite Windows spotlight images.")
18+
project("org.nickvision.spotlight" LANGUAGES C CXX VERSION 2025.4.0 DESCRIPTION "Find your favorite Windows spotlight images.")
1919
set(SHORT_NAME "spotlight")
2020
include(GNUInstallDirs)
2121

@@ -33,7 +33,7 @@ if(EXISTS "${GETTEXT_XGETTEXT_EXECUTABLE}")
3333
endif()
3434
endif()
3535

36-
add_subdirectory("libspotlight")
36+
add_subdirectory("lib${SHORT_NAME}")
3737
if(WIN32)
38-
add_subdirectory("org.nickvision.spotlight.qt")
39-
endif()
38+
add_subdirectory("${PROJECT_NAME}.qt")
39+
endif()

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ This project contains all of the code used by all platforms of the app:
142142

143143
##### org.nickvision.spotlight.qt
144144

145-
This project contains all of the code used for the QT platform (Windows) version of the app:
145+
This project contains all of the code used for the Qt platform (Windows) version of the app:
146146
- `controls` => Generic controls for the app.
147147
- These UI objects are separate from views in that they should not be backed by a controller and should be easily ported to any other app.
148-
- `helpers` => Useful objects and functions specific for the QT platform version of the app.
149-
- `resources` => Extra icons and other files specific for the QT platform version of the app.
148+
- `helpers` => Useful objects and functions specific for the Qt platform version of the app.
149+
- `resources` => Extra icons and other files specific for the Qt platform version of the app.
150150
- `views` => The views (pages, windows, dialogs, etc...) of the app.
151151

152152
#### Developing and Testing

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how can you help the proje
2020
## Screenshots
2121

2222
<details>
23-
<summary>QT</summary>
23+
<summary>Qt</summary>
2424

2525
![Main](resources/screenshots/qt/main.png)
2626
![Flip](resources/screenshots/qt/flip.png)
@@ -51,4 +51,4 @@ A C++20 compiler is also required to build Spotlight.
5151

5252
## Code of Conduct
5353

54-
This project follows the [GNOME Code of Conduct](https://wiki.gnome.org/Foundation/CodeOfConduct).
54+
This project follows the [GNOME Code of Conduct](https://conduct.gnome.org/).

inno/setup.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#define MyAppName "Nickvision Spotlight"
55
#define MyAppShortName "Spotlight"
6-
#define MyAppVersion "2024.8.0"
6+
#define MyAppVersion "2025.4.0"
77
#define MyAppPublisher "Nickvision"
88
#define MyAppURL "https://nickvision.org"
99
#define MyAppExeName "org.nickvision.spotlight.qt.exe"

libspotlight/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ add_library(libspotlight
66
"src/controllers/mainwindowcontroller.cpp"
77
"src/controllers/preferencesviewcontroller.cpp"
88
"src/models/configuration.cpp"
9-
"src/models/spotlightmanager.cpp")
9+
"src/models/spotlightmanager.cpp"
10+
"src/models/startupinformation.cpp")
1011
target_include_directories(libspotlight PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
1112
set_target_properties(libspotlight PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION}")
1213
if(MSVC)

libspotlight/include/controllers/mainwindowcontroller.h

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
#include <libnick/app/datafilemanager.h>
1414
#include <libnick/app/windowgeometry.h>
1515
#include <libnick/events/event.h>
16-
#include <libnick/logging/logger.h>
16+
#include <libnick/events/parameventargs.h>
1717
#include <libnick/notifications/notificationsenteventargs.h>
1818
#include <libnick/notifications/shellnotificationsenteventargs.h>
1919
#include <libnick/taskbar/taskbaritem.h>
2020
#include <libnick/update/updater.h>
2121
#include "controllers/preferencesviewcontroller.h"
2222
#include "models/spotlightmanager.h"
23+
#include "models/startupinformation.h"
2324
#include "models/theme.h"
24-
#include "models/viewmode.h"
2525

2626
namespace Nickvision::Spotlight::Shared::Controllers
2727
{
@@ -46,16 +46,11 @@ namespace Nickvision::Spotlight::Shared::Controllers
4646
* @return The notification sent event
4747
*/
4848
Nickvision::Events::Event<Nickvision::Notifications::NotificationSentEventArgs>& notificationSent();
49-
/**
50-
* @brief Gets the event for when a shell notification is sent.
51-
* @return The shell notification sent event
52-
*/
53-
Nickvision::Events::Event<Nickvision::Notifications::ShellNotificationSentEventArgs>& shellNotificationSent();
5449
/**
5550
* @brief Gets the event for when images are synced.
5651
* @return The images synced event
5752
*/
58-
Nickvision::Events::Event<Nickvision::Events::EventArgs>& imagesSynced();
53+
Nickvision::Events::Event<Nickvision::Events::ParamEventArgs<std::vector<std::filesystem::path>>>& imagesSynced();
5954
/**
6055
* @brief Gets the AppInfo object for the application
6156
* @return The current AppInfo object
@@ -66,22 +61,23 @@ namespace Nickvision::Spotlight::Shared::Controllers
6661
* @return The preferred theme
6762
*/
6863
Models::Theme getTheme();
69-
/**
70-
* @brief Gets the view mode for the application.
71-
* @return The view mode
72-
*/
73-
Models::ViewMode getViewMode();
7464
/**
7565
* @brief Gets the debugging information for the application.
7666
* @param extraInformation Extra, ui-specific, information to include in the debug info statement
7767
* @return The application's debug information
7868
*/
7969
std::string getDebugInformation(const std::string& extraInformation = "") const;
8070
/**
81-
* @brief Gets the list of paths to synced spotlight images.
82-
* @return The list of paths to synced spotlight images
71+
* @brief Gets the number of spotlight images synced.
72+
* @return The number of spotlight images synced
73+
*/
74+
size_t getSpotlightImageCount() const;
75+
/**
76+
* @brief Gets the path of a spotlight image.
77+
* @param index The index of the image
78+
* @return The path of the spotlight image
8379
*/
84-
const std::vector<std::filesystem::path>& getSpotlightImages() const;
80+
const std::filesystem::path& getSpotlightImagePath(int index) const;
8581
/**
8682
* @brief Gets whether or not the application can be shut down.
8783
* @return True if can shut down, else false
@@ -97,13 +93,12 @@ namespace Nickvision::Spotlight::Shared::Controllers
9793
* @brief Will only have an effect on the first time called.
9894
* @return The WindowGeometry to use for the application window at startup
9995
*/
100-
Nickvision::App::WindowGeometry startup(HWND hwnd);
96+
const Models::StartupInformation& startup(HWND hwnd);
10197
/**
10298
* @brief Shuts down the application.
10399
* @param geometry The window geometry to save
104-
* @param viewMode The view mode to save
105100
*/
106-
void shutdown(const Nickvision::App::WindowGeometry& geometry, Models::ViewMode viewMode);
101+
void shutdown(const Nickvision::App::WindowGeometry& geometry);
107102
/**
108103
* @brief Checks for an application update and sends a notification if one is available.
109104
*/
@@ -120,12 +115,9 @@ namespace Nickvision::Spotlight::Shared::Controllers
120115
*/
121116
void connectTaskbar(HWND hwnd);
122117
/**
123-
* @brief Logs a system message.
124-
* @param level The severity level of the message
125-
* @param message The message to log
126-
* @param source The source location of the log message
118+
* @brief Clears and syncs the spotlight images.
127119
*/
128-
void log(Logging::LogLevel level, const std::string& message, const std::source_location& source = std::source_location::current());
120+
void clearAndSync();
129121
/**
130122
* @brief Sets a spotlight image as the desktop background.
131123
* @param index The index of the image to set as the desktop background
@@ -148,13 +140,10 @@ namespace Nickvision::Spotlight::Shared::Controllers
148140
std::vector<std::string> m_args;
149141
Nickvision::App::AppInfo m_appInfo;
150142
Nickvision::App::DataFileManager m_dataFileManager;
151-
Nickvision::Logging::Logger m_logger;
152143
std::shared_ptr<Nickvision::Update::Updater> m_updater;
153144
Nickvision::Taskbar::TaskbarItem m_taskbar;
154-
Nickvision::Events::Event<Nickvision::Notifications::NotificationSentEventArgs> m_notificationSent;
155-
Nickvision::Events::Event<Nickvision::Notifications::ShellNotificationSentEventArgs> m_shellNotificationSent;
156145
Models::SpotlightManager m_spotlightManager;
157-
Nickvision::Events::Event<Nickvision::Events::EventArgs> m_imagesSynced;
146+
Nickvision::Events::Event<Nickvision::Events::ParamEventArgs<std::vector<std::filesystem::path>>> m_imagesSynced;
158147
};
159148
}
160149

libspotlight/include/models/configuration.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <libnick/app/datafilebase.h>
66
#include <libnick/app/windowgeometry.h>
77
#include "theme.h"
8-
#include "viewmode.h"
98

109
namespace Nickvision::Spotlight::Shared::Models
1110
{
@@ -51,17 +50,7 @@ namespace Nickvision::Spotlight::Shared::Models
5150
* @param check Whether or not to automatically check for updates
5251
*/
5352
void setAutomaticallyCheckForUpdates(bool check);
54-
/**
55-
* @brief Gets the view mode for the application.
56-
* @return The view mode
57-
*/
58-
ViewMode getViewMode() const;
59-
/**
60-
* @brief Sets the view mode for the application.
61-
* @param mode The new view mode
62-
*/
63-
void setViewMode(ViewMode mode);
6453
};
6554
}
6655

67-
#endif //CONFIGURATION_H
56+
#endif //CONFIGURATION_H

libspotlight/include/models/spotlightmanager.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
#include <filesystem>
55
#include <vector>
6-
#include <libnick/logging/logger.h>
76
#include "spotlightimagetype.h"
87
#include "spotlightsupport.h"
98

@@ -18,9 +17,8 @@ namespace Nickvision::Spotlight::Shared::Models
1817
/**
1918
* @brief Construct a SpotlightManager.
2019
* @param appName The name of the application
21-
* @param logger The application logger
2220
*/
23-
SpotlightManager(const std::string& appName, Logging::Logger& logger);
21+
SpotlightManager(const std::string& appName);
2422
/**
2523
* @brief Gets the list of paths to synced spotlight images.
2624
* @return The list of paths to synced spotlight images
@@ -36,6 +34,11 @@ namespace Nickvision::Spotlight::Shared::Models
3634
* @return The list of paths to synced spotlight images
3735
*/
3836
const std::vector<std::filesystem::path>& sync();
37+
/**
38+
* @brief Clears the cached images and resyncs spotlight images.
39+
* @return The list of paths to synced spotlight images
40+
*/
41+
const std::vector<std::filesystem::path>& clearAndSync();
3942
/**
4043
* @brief Exports a spotlight image.
4144
* @param index The index of the image to export
@@ -76,12 +79,11 @@ namespace Nickvision::Spotlight::Shared::Models
7679
* @param type The type of spotlight image
7780
*/
7881
void processEntry(const std::filesystem::directory_entry& entry, SpotlightImageType type);
82+
std::filesystem::path m_dataDir;
7983
std::filesystem::path m_spotlightLockScreenDir;
8084
std::filesystem::path m_spotlightDesktopDir;
81-
std::filesystem::path m_dataDir;
8285
std::vector<std::filesystem::path> m_images;
83-
Logging::Logger& m_logger;
8486
};
8587
}
8688

87-
#endif //SPOTLIGHTMANAGER_H
89+
#endif //SPOTLIGHTMANAGER_H
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#ifndef STARTUPINFORMATION_H
2+
#define STARTUPINFORMATION_H
3+
4+
#include <libnick/app/windowgeometry.h>
5+
6+
namespace Nickvision::Spotlight::Shared::Models
7+
{
8+
/**
9+
* @brief A model for the startup information of the application.
10+
*/
11+
class StartupInformation
12+
{
13+
public:
14+
/**
15+
* @brief Constructs a StartupInformation.
16+
*/
17+
StartupInformation();
18+
/**
19+
* @brief Constructs a StartupInformation.
20+
* @param windowGeometry The window geometry
21+
*/
22+
StartupInformation(const Nickvision::App::WindowGeometry& windowGeometry);
23+
/**
24+
* @brief Gets the window geometry.
25+
* @return The window geometry
26+
*/
27+
const Nickvision::App::WindowGeometry& getWindowGeometry() const;
28+
/**
29+
* @brief Sets the window geometry.
30+
* @param windowGeometry The window geometry to set
31+
*/
32+
void setWindowGeometry(const Nickvision::App::WindowGeometry& windowGeometry);
33+
34+
private:
35+
Nickvision::App::WindowGeometry m_windowGeometry;
36+
};
37+
}
38+
39+
#endif //STARTUPINFORMATION_H

0 commit comments

Comments
 (0)