Skip to content

Commit

Permalink
Merge pull request #678 from nuttyartist/version-2.2.2
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
nuttyartist committed Aug 30, 2024
2 parents d1f7fba + ffdbcf6 commit 78d35ff
Show file tree
Hide file tree
Showing 18 changed files with 381 additions and 610 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cmake_minimum_required(VERSION 3.10)

set(APP_VERSION 2.2.1)
set(APP_VERSION 2.3.0)
set(APP_ID "io.github.nuttyartist.notes")
set(APP_AUTHOR "Ruby Mamistvalove")
set(APP_AUTHOR_EMAIL "ruby.mamistvalove@gmail.com")
set(APP_WEBSITE "https://www.get-notes.com/")
set(APP_WEBSITE "https://www.notes-foss.com/")
set(APP_REPOSITORY "https://github.com/nuttyartist/notes")
string(TIMESTAMP CURRENT_YEAR "%Y")

Expand Down
26 changes: 13 additions & 13 deletions UPDATES.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"updates": {
"windows": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/NotesSetup_2.2.1.exe",
"latest-version": "2.2.1",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/NotesSetup_2.2.1.exe",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here with many bug fixes and improvements. To sustain and further our commitment to exceptional app development, we have transitioned to a subscription-based pricing model for the Pro version.</p><p>Improvements and bug fixes:</p><ul><li>Resolved a conflict within the Kanban interface: previously, editing a task would not conclude if a separate task was concurrently edited</li><li>Addressed an issue where editing was mistakenly permitted within the editor while the Trash folder was active</li><li>Fixed bug where icons didn't show up on some Linux distributions</li><li>Corrected an inconsistency where icons were not displayed on certain Linux distributions</li><li>Resolved display issues of specific windows on Ubuntu 23.04</li><li>Addressed an issue with the Editor Settings window failing to appear on Qt 5.12.2</li><li>For Pro users, the 'Pro' label within the Editor Settings has been made redundant and is now removed for a cleaner interface</li></ul><p>I want to thank the amazing people who contributed to this release! Thank you all. We have big plans for the future of Notes.</p><p>Join our <span><a href='https://discord.gg/RP6ReXRn5j'>Discord</a></span> for discussions, and feel free to email us. We love to hear from our users.</p></div><br>"
"open-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/DainoNotesSetup_3.0.0.exe",
"latest-version": "3.0.0",
"download-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/DainoNotesSetup_3.0.0.exe",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here! Notes 3.0.0 comes with a completely revamped editor, the ability to insert images, a Task Board to organize your tasks, and much more.</p><p>Notes is now called Daino Notes. We rebranded as part of our vision at <a href='https://www.daino.io?utm_source=app_update_window'>Daino</a> to help people actualize their potential. At Daino, we create tools for your mind so you can turn your potential into wonderful creations. Daino Notes is the first piece of much more to come.</p><p>New features in Daino Notes:</p><ul><li>New, completely revamped editor with fluid animations.</li><li>Add beautiful images to enhance your thoughts.</li><li>Use the Task Board to stay focused and prioritize your tasks more effectively.</li><li>Use the new Types Menu (by pressing the + button or typing '/') to quickly insert new content.</li><li>Drag and drop anything. Reorder lists, paragraphs, and arrange images effortlessly.</li><li>Distraction-free mode lets you focus only on what you want to see, so you can stay focused.</li><li>Daino Notes is lightning fast. It won't slow you down.</li><li>And much more...</li></ul><p>Join our <span><a href='https://discord.com/invite/D3KeTqeq6A'>Discord</a></span> for discussions, and feel free to <span><a href='mailto:contact@get-notes.com'>email us</a></span>. We love hearing from our users.</p><p>If you wish to download the previous open-source version of Notes, you can download it <a href='https://www.notes-foss.com?utm_source=app_update_window'>here</a>.</p><p>We have a lot more to show, so stay tuned.</p></div><br>"
},
"osx": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes.2.2.1.dmg",
"latest-version": "2.2.1",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes.2.2.1.dmg",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here with many bug fixes and improvements. To sustain and further our commitment to exceptional app development, we have transitioned to a subscription-based pricing model for the Pro version.</p><p>Improvements and bug fixes:</p><ul><li>Resolved a conflict within the Kanban interface: previously, editing a task would not conclude if a separate task was concurrently edited</li><li>Addressed an issue where editing was mistakenly permitted within the editor while the Trash folder was active</li><li>Fixed bug where icons didn't show up on some Linux distributions</li><li>Corrected an inconsistency where icons were not displayed on certain Linux distributions</li><li>Resolved display issues of specific windows on Ubuntu 23.04</li><li>Addressed an issue with the Editor Settings window failing to appear on Qt 5.12.2</li><li>For Pro users, the 'Pro' label within the Editor Settings has been made redundant and is now removed for a cleaner interface</li></ul><p>I want to thank the amazing people who contributed to this release! Thank you all. We have big plans for the future of Notes.</p><p>Join our <span><a href='https://discord.gg/RP6ReXRn5j'>Discord</a></span> for discussions, and feel free to email us. We love to hear from our users.</p></div><br>"
"open-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/DainoNotes.3.0.0.dmg",
"latest-version": "3.0.0",
"download-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/DainoNotes.3.0.0.dmg",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here! Notes 3.0.0 comes with a completely revamped editor, the ability to insert images, a Task Board to organize your tasks, and much more.</p><p>Notes is now called Daino Notes. We rebranded as part of our vision at <a href='https://www.daino.io?utm_source=app_update_window'>Daino</a> to help people actualize their potential. At Daino, we create tools for your mind so you can turn your potential into wonderful creations. Daino Notes is the first piece of much more to come.</p><p>New features in Daino Notes:</p><ul><li>New, completely revamped editor with fluid animations.</li><li>Add beautiful images to enhance your thoughts.</li><li>Use the Task Board to stay focused and prioritize your tasks more effectively.</li><li>Use the new Types Menu (by pressing the + button or typing '/') to quickly insert new content.</li><li>Drag and drop anything. Reorder lists, paragraphs, and arrange images effortlessly.</li><li>Distraction-free mode lets you focus only on what you want to see, so you can stay focused.</li><li>Daino Notes is lightning fast. It won't slow you down.</li><li>And much more...</li></ul><p>Join our <span><a href='https://discord.com/invite/D3KeTqeq6A'>Discord</a></span> for discussions, and feel free to <span><a href='mailto:contact@get-notes.com'>email us</a></span>. We love hearing from our users.</p><p>If you wish to download the previous open-source version of Notes, you can download it <a href='https://www.notes-foss.com?utm_source=app_update_window'>here</a>.</p><p>We have a lot more to show, so stay tuned.</p></div><br>"
},
"linux": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes_2.2.1-Qt6.4.3-x86_64.AppImage",
"latest-version": "2.2.1",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes_2.2.1-Qt6.4.3-x86_64.AppImage",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here with many bug fixes and improvements. To sustain and further our commitment to exceptional app development, we have transitioned to a subscription-based pricing model for the Pro version.</p><p>Improvements and bug fixes:</p><ul><li>Resolved a conflict within the Kanban interface: previously, editing a task would not conclude if a separate task was concurrently edited</li><li>Addressed an issue where editing was mistakenly permitted within the editor while the Trash folder was active</li><li>Fixed bug where icons didn't show up on some Linux distributions</li><li>Corrected an inconsistency where icons were not displayed on certain Linux distributions</li><li>Resolved display issues of specific windows on Ubuntu 23.04</li><li>Addressed an issue with the Editor Settings window failing to appear on Qt 5.12.2</li><li>For Pro users, the 'Pro' label within the Editor Settings has been made redundant and is now removed for a cleaner interface</li></ul><p>I want to thank the amazing people who contributed to this release! Thank you all. We have big plans for the future of Notes.</p><p>Join our <span><a href='https://discord.gg/RP6ReXRn5j'>Discord</a></span> for discussions, and feel free to email us. We love to hear from our users.</p></div><br>"
"open-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/daino_notes_3.0.0-Qt6.7.2-x86_64.AppImage",
"latest-version": "3.0.0",
"download-url": "https://github.com/nuttyartist/daino-notes-public/releases/download/v3.0.0/daino_notes_3.0.0-Qt6.7.2-x86_64.AppImage",
"changelog": "<style>div{color:#000}kbd{color:#24292f;background-color:#f6f8fa}ul{margin-left:-2em}</style><div><p>A new release is here! Notes 3.0.0 comes with a completely revamped editor, the ability to insert images, a Task Board to organize your tasks, and much more.</p><p>Notes is now called Daino Notes. We rebranded as part of our vision at <a href='https://www.daino.io?utm_source=app_update_window'>Daino</a> to help people actualize their potential. At Daino, we create tools for your mind so you can turn your potential into wonderful creations. Daino Notes is the first piece of much more to come.</p><p>New features in Daino Notes:</p><ul><li>New, completely revamped editor with fluid animations.</li><li>Add beautiful images to enhance your thoughts.</li><li>Use the Task Board to stay focused and prioritize your tasks more effectively.</li><li>Use the new Types Menu (by pressing the + button or typing '/') to quickly insert new content.</li><li>Drag and drop anything. Reorder lists, paragraphs, and arrange images effortlessly.</li><li>Distraction-free mode lets you focus only on what you want to see, so you can stay focused.</li><li>Daino Notes is lightning fast. It won't slow you down.</li><li>And much more...</li></ul><p>Join our <span><a href='https://discord.com/invite/D3KeTqeq6A'>Discord</a></span> for discussions, and feel free to <span><a href='mailto:contact@get-notes.com'>email us</a></span>. We love hearing from our users.</p><p>If you wish to download the previous open-source version of Notes, you can download it <a href='https://www.notes-foss.com?utm_source=app_update_window'>here</a>.</p><p>We have a lot more to show, so stay tuned.</p></div><br>"
}
}
}
}
22 changes: 22 additions & 0 deletions UPDATES_FOSS.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"updates": {
"windows": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/NotesSetup_2.2.1.exe",
"latest-version": "2.3.0",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/NotesSetup_2.2.1.exe",
"changelog": ""
},
"osx": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes.2.2.1.dmg",
"latest-version": "2.3.0",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes.2.2.1.dmg",
"changelog": ""
},
"linux": {
"open-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes_2.2.1-Qt6.4.3-x86_64.AppImage",
"latest-version": "2.3.0",
"download-url": "https://github.com/nuttyartist/notes/releases/download/v2.2.1/Notes_2.2.1-Qt6.4.3-x86_64.AppImage",
"changelog": ""
}
}
}
12 changes: 6 additions & 6 deletions notes_purchase_data.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"purchase_pro_url": "https://www.get-notes.com/pricing",
"purchaseApiBase": "https://api.lemonsqueezy.com",
"activateLicenseEndpoint": "/v1/licenses/activate",
"validateLicenseEndpoint": "/v1/licenses/validate",
"deactivateLicenseEndpoint": "/v1/licenses/deactivate"
}
"purchase_pro_url": "https://www.notes-foss.com/pricing",
"purchaseApiBase": "https://www.daino.io",
"activateLicenseEndpoint": "/api/notes_foss/activateLicense",
"validateLicenseEndpoint": "/api/notes_foss/validateLicense",
"deactivateLicenseEndpoint": "/api/notes_foss/deactivate"
}
2 changes: 1 addition & 1 deletion packaging/windows/Notes_Inno_Script_Github.iss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{44576435-E098-4581-A6D7-FD7FADC5B063}
AppId={{3C782395-4B68-4EA5-A2F4-C60E886CD71F}
AppName=Notes
AppVersion={#Version}
AppPublisher=Awesomeness
Expand Down
4 changes: 2 additions & 2 deletions src/aboutwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ void AboutWindow::setAboutText()
+ "<p>Notes was founded by <a href='https://rubymamistvalove.com'>Ruby "
"Mamistvalove</a>, "
"to create an elegant yet powerful cross-platform and open-source note-taking "
"app.</p><a href='https://www.get-notes.com'>Notes Website"
"app.</p><a href='https://www.notes-foss.com'>Notes Website"
"</a><br/><a href='https://github.com/nuttyartist/notes'>Source code on "
"Github</a><br/><a "
"href='https://www.get-notes.com/notes-app-terms-privacy-policy'>Terms and Privacy "
"href='https://www.notes-foss.com/notes-app-terms-privacy-policy'>Terms and Privacy "
"Policy</a><br/><br/><strong>Acknowledgments</strong><br/>This project couldn't "
"have "
"come this far without the help of these amazing "
Expand Down
153 changes: 153 additions & 0 deletions src/dbmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2369,3 +2369,156 @@ void DBManager::onChangeDatabasePathRequested(const QString &newPath)
QFile::rename(m_dbpath, newPath);
open(newPath, false);
}

void DBManager::addNotesToNewImportedFolder(const QList<QPair<QString, QDateTime>> &fileDatas)
{
NodeData newFolder;
newFolder.setNodeType(NodeData::Folder);
QDateTime currentDate = QDateTime::currentDateTime();
newFolder.setCreationDateTime(currentDate);
newFolder.setLastModificationDateTime(currentDate);
newFolder.setFullTitle("Imported Notes");
newFolder.setParentId(SpecialNodeID::RootFolder);

int newFolderId = addNode(newFolder);
if (newFolderId <= 0) {
qDebug() << "Failed to add 'Imported Notes' folder.";
return;
}

NodeData createdFolder = getNode(newFolderId);
QString parentAbsPath = createdFolder.absolutePath();

int nodeId = nextAvailableNodeId();
int notePos = 0;

for (const auto &noteData : fileDatas) {
NodeData note;
note.setFullTitle(noteData.first.section('\n', 0, 0, QString::SectionSkipEmpty));
note.setContent(noteData.first);
note.setId(nodeId++);
note.setRelativePosition(notePos++);
note.setAbsolutePath(parentAbsPath + PATH_SEPARATOR + QString::number(note.id()));
note.setNodeType(NodeData::Note);
note.setParentId(newFolderId);
note.setCreationDateTime(noteData.second);
note.setLastModificationDateTime(noteData.second);

addNode(note);
}

recalculateChildNotesCount();
onNodeTagTreeRequested();
}

void DBManager::exportNotes(const QString &baseExportPath, const QString &extension)
{
// Ensure the export directory exists
QString rootFolderName = QStringLiteral("Notes");
QString exportPathNew = baseExportPath + QDir::separator() + rootFolderName;
QDir directory;

int counter = 1;
while (directory.exists(exportPathNew)) {
exportPathNew = baseExportPath + QDir::separator() + rootFolderName + " "
+ QString::number(counter++);
}
qDebug() << "Exporting notes to:" << exportPathNew;
directory.mkpath(exportPathNew);

// Retrieve all folders first to create the directory structure
QVector<NodeData> folders = getAllFolders();

// Create directories for each folder
QMap<int, QString> folderPaths;
for (const NodeData &folder : folders) {
QString path = exportPathNew;
if (folder.id() != SpecialNodeID::RootFolder) { // Skip root folder
QStringList folderNames;
QString currentPath = folder.absolutePath();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QStringList pathParts = currentPath.split(QDir::separator(), Qt::SkipEmptyParts);
#else
QStringList pathParts = currentPath.split(QDir::separator(), QString::SkipEmptyParts);
#endif
for (const auto &part : pathParts) {
int id = part.toInt();
if (id == SpecialNodeID::RootFolder)
continue;
auto folderTemp = getNode(id);
folderNames << folderTemp.fullTitle();
}
QString relativePath = folderNames.join(QDir::separator());
path += QDir::separator() + relativePath;

counter = 1;
while (directory.exists(path)) {
path = exportPathNew + QDir::separator() + relativePath + " "
+ QString::number(counter++);
}

QDir().mkpath(path);
}
// qDebug() << "path: " << path;
folderPaths.insert(folder.id(), path);
}

// Retrieve all notes
QSqlQuery query(m_db);
query.prepare(
R"(SELECT "id", "title", "content", "parent_id" FROM node_table WHERE node_type = :note_type)");
query.bindValue(":note_type", static_cast<int>(NodeData::Type::Note));

if (!query.exec()) {
qDebug() << "Failed to retrieve notes for export:" << query.lastError();
return;
}

// Export each note as a .txt file in its corresponding directory
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QTextDocument doc;
#endif
while (query.next()) {
// int noteId = query.value(0).toInt();
QString title = query.value(1).toString();
QString content = query.value(2).toString();
int parentId = query.value(3).toInt();

QString notePath = folderPaths[parentId];
QString safeTitle = title;
if (safeTitle.contains("<br />"))
safeTitle = safeTitle.section("<br />", 0, 0, QString::SectionSkipEmpty);
safeTitle = safeTitle.simplified();
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
// Convert Markdown to plain text, only available in Qt 5.14+
doc.setMarkdown(safeTitle);
safeTitle = doc.toPlainText();
#endif
safeTitle.replace(QRegularExpression(R"([\/\\:*?"<>|])"),
"_"); // Make the title filesystem-safe
QString filePath = notePath + QDir::separator() + safeTitle + extension;

if (safeTitle.isEmpty()) {
safeTitle = QStringLiteral("Untitled Note");
}

counter = 1;
while (directory.exists(filePath)) {
filePath = notePath + QDir::separator() + safeTitle + " " + QString::number(counter++)
+ extension;
}

// qDebug() << "Exporting note:" << filePath;

QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream out(&file);
out << content;
file.close();
} else {
qDebug() << "Failed to export note:" << filePath;
}
}

qDebug() << "Export completed to:" << baseExportPath;
}
Loading

0 comments on commit 78d35ff

Please sign in to comment.