Skip to content

Commit

Permalink
QT - Load Grid View
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Aug 12, 2024
1 parent cda9231 commit 40bb1fa
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 210 deletions.
20 changes: 20 additions & 0 deletions org.nickvision.spotlight.qt/src/views/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "views/mainwindow.h"
#include "ui_mainwindow.h"
#include <cmath>
#include <format>
#include <QDesktopServices>
#include <QFileDialog>
Expand Down Expand Up @@ -313,6 +314,25 @@ namespace Nickvision::Spotlight::QT::Views
lblStatus->setText(QString::fromStdString(std::vformat(_("Total Number of Images: {}"), std::make_format_args(CodeHelpers::unmove(m_controller->getSpotlightImages().size())))));
m_ui->statusBar->addWidget(lblStatus);
//Setup Grid Page
int rowCount{ static_cast<int>(std::ceil(m_controller->getSpotlightImages().size() / static_cast<double>(m_ui->tblImages->columnCount()))) };
m_ui->tblImages->setRowCount(rowCount);
for(int i = 0; i < rowCount; i++)
{
for(int j = 0; j < m_ui->tblImages->columnCount(); j++)
{
int index{ i * m_ui->tblImages->columnCount() + j };
if(index >= m_controller->getSpotlightImages().size())
{
break;
}
QPixmap pixmap{ QString::fromStdString(m_controller->getSpotlightImages()[index].string()) };
QLabel* lbl{ new QLabel() };
lbl->setPixmap(pixmap.scaled(m_ui->tblImages->horizontalHeader()->defaultSectionSize(), m_ui->tblImages->verticalHeader()->defaultSectionSize(), Qt::KeepAspectRatio, Qt::FastTransformation));
lbl->setScaledContents(true);
m_ui->tblImages->setCellWidget(i, j, lbl);
qApp->processEvents();
}
}
//Setup Flip Page
m_ui->sliderFlip->setMaximum(m_controller->getSpotlightImages().size() - 1);
m_ui->sliderFlip->setValue(0);
Expand Down
60 changes: 30 additions & 30 deletions resources/po/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-11 20:36-0400\n"
"POT-Creation-Date: 2024-08-11 21:51-0400\n"
"PO-Revision-Date: 2024-08-11 20:09+0000\n"
"Last-Translator: Ettore Atalan <[email protected]>\n"
"Language-Team: German <https://hosted.weblate.org/projects/nickvision-"
Expand All @@ -20,7 +20,7 @@ msgstr ""
"X-Generator: Weblate 5.7-dev\n"

#: libspotlight/src/controllers/mainwindowcontroller.cpp:36
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:35
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:36
msgid "Spotlight"
msgstr ""

Expand Down Expand Up @@ -81,7 +81,7 @@ msgid "Unable to export images"
msgstr "Bilder können nicht exportiert werden"

#: org.nickvision.spotlight.qt/src/controls/aboutdialog.cpp:31
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:54
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:55
#, fuzzy
msgid "About Spotlight"
msgstr "Keine Spotlight-Bilder"
Expand Down Expand Up @@ -111,121 +111,121 @@ msgstr ""
"Künstler:\n"
"{}"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:35
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:36
msgid "Spotlight (Preview)"
msgstr ""

#. Localize Menu Strings
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:37
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:38
msgid "File"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:38
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:39
msgid "Export"
msgstr "Exportieren"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:39
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:40
msgid "Export All"
msgstr "Alle exportieren"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:40
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:41
msgid "Exit"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:41
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:42
msgid "Edit"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:42
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:43
#: org.nickvision.spotlight.qt/src/views/settingsdialog.cpp:16
msgid "Settings"
msgstr "Einstellungen"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:43
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:44
msgid "View"
msgstr "Ansicht"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:44
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:45
msgid "Mode"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:45
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:46
msgid "Grid"
msgstr "Raster"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:46
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:47
msgid "Flip"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:47
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:48
#, fuzzy
msgid "Image"
msgstr "Bilder"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:48
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:49
msgid "Set as Background"
msgstr "Als Hintergrund festlegen"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:49
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:50
msgid "Help"
msgstr "Hilfe"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:50
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:51
msgid "Check for Updates"
msgstr "Auf Aktualisierungen prüfen"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:51
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:52
msgid "GitHub Repo"
msgstr "GitHub-Repo"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:52
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:53
msgid "Report a Bug"
msgstr "Problem melden"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:53
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:54
msgid "Discussions"
msgstr "Diskussionen"

#. Localize Grid Page
#. Localize Flip Page
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:57
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:58
#, fuzzy
msgid "Previous"
msgstr "Vorschau"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:58
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:59
msgid "Next"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:135
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:136
#, fuzzy
msgid "Export Image"
msgstr "Exportieren"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:149
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:150
#, fuzzy
msgid "Export All Images"
msgstr "Alle exportieren"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:288
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:289
msgid "Update"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:300
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:301
msgid "Open"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:308
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:309
msgid "No Spotlight Images Found"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:308
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:309
msgid ""
"Ensure Windows Spotlight is enabled and come back later to try again. The "
"application will now close."
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:313
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:314
msgid "Total Number of Images: {}"
msgstr "Gesamtzahl der Bilder: {}"

Expand Down
60 changes: 30 additions & 30 deletions resources/po/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-11 20:36-0400\n"
"POT-Creation-Date: 2024-08-11 21:51-0400\n"
"PO-Revision-Date: 2024-06-04 18:22+0000\n"
"Last-Translator: Nick Logozzo <[email protected]>\n"
"Language-Team: Italian <https://hosted.weblate.org/projects/nickvision-"
Expand All @@ -20,7 +20,7 @@ msgstr ""
"X-Generator: Weblate 5.6-dev\n"

#: libspotlight/src/controllers/mainwindowcontroller.cpp:36
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:35
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:36
msgid "Spotlight"
msgstr "Spotlight"

Expand Down Expand Up @@ -81,7 +81,7 @@ msgid "Unable to export images"
msgstr ""

#: org.nickvision.spotlight.qt/src/controls/aboutdialog.cpp:31
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:54
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:55
#, fuzzy
msgid "About Spotlight"
msgstr "Spotlight"
Expand All @@ -104,119 +104,119 @@ msgid ""
"{}"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:35
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:36
#, fuzzy
msgid "Spotlight (Preview)"
msgstr "Spotlight"

#. Localize Menu Strings
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:37
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:38
msgid "File"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:38
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:39
msgid "Export"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:39
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:40
msgid "Export All"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:40
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:41
msgid "Exit"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:41
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:42
msgid "Edit"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:42
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:43
#: org.nickvision.spotlight.qt/src/views/settingsdialog.cpp:16
msgid "Settings"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:43
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:44
msgid "View"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:44
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:45
msgid "Mode"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:45
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:46
msgid "Grid"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:46
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:47
msgid "Flip"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:47
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:48
msgid "Image"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:48
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:49
#, fuzzy
msgid "Set as Background"
msgstr "La foto impostata come sfondo"

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:49
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:50
msgid "Help"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:50
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:51
msgid "Check for Updates"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:51
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:52
msgid "GitHub Repo"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:52
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:53
msgid "Report a Bug"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:53
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:54
msgid "Discussions"
msgstr ""

#. Localize Grid Page
#. Localize Flip Page
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:57
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:58
msgid "Previous"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:58
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:59
msgid "Next"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:135
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:136
msgid "Export Image"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:149
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:150
msgid "Export All Images"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:288
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:289
msgid "Update"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:300
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:301
msgid "Open"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:308
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:309
msgid "No Spotlight Images Found"
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:308
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:309
msgid ""
"Ensure Windows Spotlight is enabled and come back later to try again. The "
"application will now close."
msgstr ""

#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:313
#: org.nickvision.spotlight.qt/src/views/mainwindow.cpp:314
msgid "Total Number of Images: {}"
msgstr ""

Expand Down
Loading

0 comments on commit 40bb1fa

Please sign in to comment.