diff --git a/CHANGELOG.md b/CHANGELOG.md index aac8d0ab99..161f7290ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,9 @@ # QOwnNotes Changelog ## 22.9.0 -- the settings dialog opening time was improved a bit (for [#2574](https://github.com/pbek/QOwnNotes/issues/2574), thank you, @Waqar144) +- the settings dialog opening time was improved a lot (for [#2574](https://github.com/pbek/QOwnNotes/issues/2574), thank you, @Waqar144) +- you can now specify file patterns of note files to ignore as regular expressions + in the *Panels settings* (for [#2580](https://github.com/pbek/QOwnNotes/issues/2580)) ## 22.8.4 - there now is a new scripting command `mainWindow.removeNoteTab(index)` to diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp index a48d71fff4..c6bf403325 100644 --- a/src/dialogs/settingsdialog.cpp +++ b/src/dialogs/settingsdialog.cpp @@ -1033,6 +1033,10 @@ void SettingsDialog::storePanelSettings() { settings.setValue(QStringLiteral("ignoreNoteSubFolders"), ui->ignoreNoteSubFoldersLineEdit->text()); + const QSignalBlocker blocker2(ui->ignoredNoteFilesLineEdit); + settings.setValue(QStringLiteral("ignoredNoteFiles"), + ui->ignoredNoteFilesLineEdit->text()); + // Tags Panel Options settings.setValue(QStringLiteral("tagsPanelHideSearch"), ui->tagsPanelHideSearchCheckBox->isChecked()); @@ -1653,6 +1657,9 @@ void SettingsDialog::readPanelSettings() { IGNORED_NOTE_SUBFOLDERS_DEFAULT) .toString()); + ui->ignoredNoteFilesLineEdit->setText( + settings.value(QStringLiteral("ignoredNoteFiles")).toString()); + // Navigation Panel Options ui->navigationPanelHideSearchCheckBox->setChecked( settings.value(QStringLiteral("navigationPanelHideSearch")).toBool()); diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui index 14ab524c64..35f77b3b1e 100644 --- a/src/dialogs/settingsdialog.ui +++ b/src/dialogs/settingsdialog.ui @@ -5632,13 +5632,6 @@ git config --global user.name "Your name" Note list panel - - - - Show notes in the note list with preview - - - @@ -5653,7 +5646,14 @@ git config --global user.name "Your name" - + + + + Show notes in the note list with preview + + + + Sort @@ -5676,7 +5676,14 @@ git config --global user.name "Your name" - + + + + Instead of a note list use a note tree with all the subfolders (if they are turned on for the note folder) + + + + true @@ -5705,11 +5712,26 @@ git config --global user.name "Your name" - - - - Instead of a note list use a note tree with all the subfolders (if they are turned on for the note folder) + + + + Regular expressions of note subfolders to ignore, separated by ";" + + Ignored note files + + + + + + Regular expressions of note files to ignore, separated by ";" + + + true + + + + @@ -6904,8 +6926,8 @@ Just test yourself if you get sync conflicts and set a higher value if so.enableSocketServerCheckBox - + diff --git a/src/entities/note.cpp b/src/entities/note.cpp index 6a3533a776..bc41966e23 100644 --- a/src/entities/note.cpp +++ b/src/entities/note.cpp @@ -4156,6 +4156,30 @@ QStringList Note::getHeadingList() { return headingList; } +bool Note::applyIgnoredNotesSetting(QStringList& fileNames) { + const QSettings settings; + const QStringList ignoredFileRegExpList = + settings.value(QStringLiteral("ignoredNoteFiles")).toString() + .split(QLatin1Char(';')); + + if (ignoredFileRegExpList.isEmpty()) { + return false; + } + + auto newFileNames = QStringList(); + + for (const QString &fileName : fileNames) { + if (!Utils::Misc::regExpInListMatches(fileName, + ignoredFileRegExpList)) { + newFileNames.append(fileName); + } + } + + fileNames = newFileNames; + + return true; +} + /** * Fetches all tags of the note */ diff --git a/src/entities/note.h b/src/entities/note.h index adcdbab127..ce0d4810d5 100644 --- a/src/entities/note.h +++ b/src/entities/note.h @@ -378,6 +378,8 @@ class Note { QStringList getHeadingList(); + static bool applyIgnoredNotesSetting(QStringList& fileNames); + protected: int _id; int _noteSubFolderId; diff --git a/src/languages/QOwnNotes_en.ts b/src/languages/QOwnNotes_en.ts index 7a2c58f194..df79ff4207 100644 --- a/src/languages/QOwnNotes_en.ts +++ b/src/languages/QOwnNotes_en.ts @@ -2049,7 +2049,7 @@ - + Add a tag to the current note @@ -2165,7 +2165,7 @@ - + Select &all notes @@ -2215,7 +2215,7 @@ - + Add a tag to the selected notes @@ -2604,7 +2604,7 @@ - + Remove current workspace @@ -2672,7 +2672,7 @@ - + Open note in different window @@ -2693,7 +2693,7 @@ - + Show note git versions @@ -2776,7 +2776,7 @@ - + Automatically detect @@ -3005,10 +3005,10 @@ Restore current note? - - - - + + + + &Cancel @@ -3151,7 +3151,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Move selected notes @@ -3165,7 +3165,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Copy selected notes @@ -3205,37 +3205,37 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Restart application - + You may need to restart the application to let the changes take effect. - + Restart - + PDF files - + Todo lists disabled! - + You have disabled the todo lists.<br />Please check your <strong>Todo</strong> configuration in the settings! - + Found <strong>%n</strong> occurrence(s) of any term of <strong>%1</strong> @@ -3243,79 +3243,79 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Note folders - + Note versions are currently loaded from your ownCloud server - + Trashed notes are currently loaded from your ownCloud server - + Inserted text as text attachment file - + Your note will be decrypted and stored as plain text again. Keep in mind that the unencrypted note will possibly be synced to your server and sensitive text may be exposed!<br />Do you want to decrypt your note? - + Markdown files - + Export attached files - + Do you also want to export media files and attachments of the note? Files may be overwritten in the destination folder! - + Bookmarked note position at slot %1 - + Jumped to bookmark position at slot %1 - - + + Inserting image - - + + Done inserting image - + Inserting attachment - + Done inserting attachment - + Copied %n note(s) to %1 @@ -3323,7 +3323,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Failed to copy %n note(s) (most likely already existing) @@ -3331,7 +3331,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Skipped copying of %n note(s) (no markdown or text file or not readable) @@ -3339,209 +3339,209 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Saving temporary image - - + + Temporary file can't be opened - + Downloading %1 - + Reset font size to %1 pt Will be shown after the font size is reset by 'Reset note text size' - + Remove tag '%1' from the current note - + Remove tag '%1' from the selected notes - + Rename tag - + Assign color - + Disable color - + &Move tags to… - + Move to the root to move a tag to the current tag in the tag context menu - + The scripting engine was reloaded - + HTML files - + Jump to the note's subfolder - + Open selected notes in tabs - + A script update was found! - + Script updates - + Updates to your scripts were found in the script repository! Do you want to update them? - + No script updates were found - + Toggle note stickiness - + Close other note tabs - - + + Rename note - + Show all notes (%1) - + Show all notes tagged with '%1' (%2) - + Allows you to rename the filename of the note - + &Move notes to… - + &Copy notes to… - + Move notes to subfolder… - + Copy notes to subfolder… - + &Tag selected notes with… - + &Remove tag from selected notes… - + Name: - + Note renaming not enabled! - + Create new workspace - - + + Workspace name: - + full full workspace - + minimal minimal workspace - + Remove the current workspace? - + Rename workspace - + %n chars characters @@ -3550,42 +3550,42 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Disallow all note editing - + Select text files to import - + Importing: %1 - + Note headline '%1' was copied to the clipboard - + Leave full-screen mode - + Custom editor width - + Characters: - + %n notes selected @@ -3594,7 +3594,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Allow all note editing @@ -3635,74 +3635,74 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Print note - + Letter - + Portrait - + Landscape - + Orientation - + Orientation: - + Export current note as PDF - + You have not selected any todo lists.<br />Please check your <strong>Todo</strong> configuration in the settings! - + Open QOwnNotes - - - + + + New note - + Recent notes - + Show todo lists - + Recent tasks - + Quit @@ -3714,31 +3714,31 @@ If the trash is enabled on your ownCloud server you should be able to restore th - - + + Copy to note folder - - + + Move to note folder - - + + Copy to this subfolder - - + + Move to this subfolder - + Move %n selected note(s) to note subfolder <strong>%2</strong>? @@ -3746,13 +3746,13 @@ If the trash is enabled on your ownCloud server you should be able to restore th - - + + Cancel - + %n note(s) were moved to note subfolder "%2" @@ -3760,7 +3760,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Copy %n selected note(s) to note subfolder <strong>%2</strong>? @@ -3768,7 +3768,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + %n note(s) were copied to note subfolder "%2" @@ -3776,47 +3776,47 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Open note in external editor - + Show note in file manager - + If you want to rename your note you have to enable the option to allow the note filename to be different from the headline. - + Create a new folder - + Folder name: - + show all untagged notes (%1) - + Untagged notes - + Export current note as HTML file - + Page size @@ -3826,22 +3826,22 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Page size: - + QOwnNotes will track anonymous usage data, that helps to decide what parts of QOwnNotes to improve next and to find and fix bugs. You can disable that behaviour in the settings. - + &Ok - + &Remove notes @@ -3857,7 +3857,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Stored current note to disk @@ -3880,47 +3880,47 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + All notes - + &Add tag - + Tag could not be created! - + Move to this tag - + Tag this - + Cannot move tag '%1' to this tag - + Moved tag '%1' to new tag - + &Remove tags - + No selected todo lists! @@ -4046,7 +4046,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Current note could not be stored to disk @@ -4087,7 +4087,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Found <strong>%n</strong> occurrence(s) of <strong>%1</strong> @@ -4095,61 +4095,61 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + Note headline - + Paste &HTML as markdown - + Paste as &text file attachment - + Downloading images finished - - - - + + + + Open &settings - + leave - + Please enter your <strong>password</strong> to encrypt the note.<br />Keep in mind that you have to <strong>remember</strong> your password to read the content of the note<br /> and that you can <strong>only</strong> do that <strong>in QOwnNotes</strong>! - + Decrypt note and store it as plain text - + &Decrypt - + <br />You will be able to edit your encrypted note. - + Export current note as Markdown file @@ -4678,17 +4678,17 @@ If the trash is enabled on your ownCloud server you should be able to restore th - + New connection - + Login flow succeeded - + Username and password were set successfully! @@ -5764,7 +5764,7 @@ Do you want to install it anyway? - + You might run into sync troubles with older versions of ownCloud sync when going far below 10 sec. Just test yourself if you get sync conflicts and set a higher value if so. @@ -5786,10 +5786,10 @@ Just test yourself if you get sync conflicts and set a higher value if so. - - - + + + Database @@ -5810,7 +5810,7 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Clear app data and exit @@ -6403,20 +6403,20 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Reset message boxes - - + + Import settings - + Export settings @@ -6731,138 +6731,149 @@ Just test yourself if you get sync conflicts and set a higher value if so. - - + + + Regular expressions of note subfolders to ignore, separated by ";" - + + Ignored note files + + + + + Regular expressions of note files to ignore, separated by ";" + + + + Ignored subfolders - + Reset ignored subfolders - + Restore open note tabs at application startup and when note folders are switched - + Auto-select items in navigation panel when changing cursor position - + Hide 'Note count' with tags (increases performance) - + Show the number of matches in each note - + Command snippets - + Tag name for commands notes - + Commands tag: - + Commands note name: - + Note name for adding new commands - + You can use the <a href="%1">QOwnNotes Web App</a> to be able to insert photos into QOwnNotes on your desktop from your mobile phone over the internet. - + QOwnNotes web application - + Server URL: - + Show QR code - + Security token: - + Install the <a href="%1">Web Companion browser extension</a> from the <a href="%2">Chrome Web Store</a> or <a href="%3">Firefox Add-ons page</a> to use QOwnNotes as web clipper or for bookmark management. - + Download the <a href="%1">Command-line snippet manager</a> to execute command snippets stored in notes in QOwnNotes from the command line. - + You can use notes with a special tag to store command snippets, which you can execute from the command-line snippet manager. For more information about the command snippet syntax click <a href="%1">here</a>. - + You need to enter this token in the QOwnNotes web application to be able to talk to your QOwnNotes desktop application. - + A web socket connetion to this server will be opened to act as bridge between the QOwnNotes web application and the QOwnNotes desktop application. - + Copy security token to clipboard - + Generate new security token - + Reset the URL to default - + QOwnNotes web application support - + Enable web application support @@ -6872,176 +6883,176 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Show notes in the note list with preview - + Instead of a note list use a note tree with all the subfolders (if they are turned on for the note folder) - + Note folder panel - + Show note folders as buttons instead of in a select box - + Enable local trash to keep a copy of trashed notes - + Panels can be turned on and off in the <i>Window / Panels</i> main menu and you can also configure different <i>Workspaces</i> for different panel configurations. - + Bookmarks - - + + Notes with this tag will be used for fetching bookmarks - + Tag name for bookmarks notes - + Bookmarks tag: - + By default the browser extension will show all links of the current note. You can also make it show special bookmark links of notes with a certain tag. For more information about the bookmark link syntax click <a href="%1">here</a>. - + Bookmarks note name: - - + + This note will be used for adding new bookmarks from the browser extension - + Note name for adding new bookmarks - + Web socket server - + Socket server port: - + Reset the socket server port - - + + Show security token - + Web socket server support - + Enable socket server - + Note edit panel - + If this is disabled you are able to create more complex panel layouts, but all panels will be resized if the window is resized - + Use the note edit panel as fixed central widget to be resized if the window or other panels are resized - + Note search panel - + Disable auto-completion of previous searches - + Navigation panel - + Hide navigation item search bar - + Local trash settings - + Remove trashed notes after: - + days seconds - + Automatically remove trashed notes after a certain time - + Local trash support - + Layout selector - + You can set a new layout here. Keep in mind that you always can modify the position of the panels with the <i>Unlock panels</i> button. @@ -7068,12 +7079,12 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Show all notes of a tag including the notes of their children-tags - + Show all notes in a folder including their subfolders (only works if subfolders are turned on) @@ -7088,35 +7099,35 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Tags panel - - - + + + Order - - - + + + Ascending - - - + + + Descending - - + + Sort @@ -7127,54 +7138,54 @@ Just test yourself if you get sync conflicts and set a higher value if so. - - + + Alphabetical - + By last change / use - + Hide 'Find or create tag' search - + Note subfolders panel - + Show with full path - + By last change - + Show root folder name - + Hide 'Find or create note subfolder' search - + Display note subfolders as full tree - + Search script repository @@ -7600,8 +7611,8 @@ Just test yourself if you get sync conflicts and set a higher value if so. - - + + Debug information @@ -7641,24 +7652,24 @@ Just test yourself if you get sync conflicts and set a higher value if so. - + Automatic (needs restart) - + Shortcut already assigned - + The connection was made successfully! Server version: %1 QOwnNotesAPI version: %2 - + There was an error connecting to the ownCloud Server! You also need to have the QOwnNotesAPI app installed and enabled! @@ -7666,143 +7677,143 @@ Connection error message: - + The Database was reinitialized. Please restart the application now! - + Please don't use this in the issue tracker, copy the debug information text directly into the issue. - + Markdown files - + Disable usage tracking - + Anonymous usage data helps to decide what parts of QOwnNotes to improve next and to find and fix bugs.<br />Please disable it only if you really can't live with it.<br /><br />Really disable usage tracking? - + new folder - + Remove note folder - + Remove the current note folder <strong>%1</strong>? - + Please select the folder where your notes will get stored to - + Loading folders from server - + No more folders were found in the current folder - + Loading folders in '%1' from server - + Take a look at the <a href="%1">Scripting documentation</a> to get started fast. - + If you need access to a certain functionality in QOwnNotes please open an issue on the <a href="%1"> QOwnNotes issue page</a>. - + Check for script updates - + Add local script - + Add an existing, local script - + Please enter a new note file extension: - + Markdown file - + Plain text file - + Remove note file extension - - + + INI files - + Do you really want to import settings? Your current settings will get removed and not every setting may get restored, like the note folder settings and which scripts you were using. You also will need to adjust some settings, especially across platforms, but your notes will stay intact! - + The application will be restarted after the import. - + The debug information was copied to the clipboard. - + The integrity of the disk database is valid. - + The integrity of the disk database is not valid! - + Find a script in the script repository @@ -7817,132 +7828,132 @@ Connection error message: - - + + Undefined shortcut - - + + Assign a new shortcut - - + + Reset to default shortcut - + Clear shortcut - + The shortcut <strong>%1</strong> is already assigned to <strong>%2</strong>! Do you want to jump to the shortcut? - + Remove script - + Remove the current script <strong>%1</strong>? - + QML files - + Please select your QML file - + Open repository - + Your script seems to be valid - + There were script errors: %1 - + File extension - + Do you really want to remove the note file extension <strong>%1</strong>? You will not see files with this extension in the note list any more! - + Calendar cache emptied - + Your calendar cache was emptied. - + Reset toolbars and exit - + Do you really want to reset all toolbars? The application will be closed in the process, the default toolbars will be restored when you start it again. - + Reset and &exit - + Log file cleared - + The log file <strong>%1</strong> was cleared. - + Executable files - - + + All files - + Please select the path of your git executable - + Do you really want to reset the overrides of all message boxes? @@ -7997,26 +8008,26 @@ Connection error message: - + Save debug information - + Do you really want to clear all settings, remove the database and exit QOwnNotes? Your notes will stay intact! - + Clear and &exit - - - + + + &Cancel @@ -8026,17 +8037,17 @@ Your notes will stay intact! - + Do you really want to clear the local database? This will also remove your configured note folders and your cached todo items! - + Clear &database - + Select editor application diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 35c8b682cb..89db8de87e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -3227,6 +3227,7 @@ bool MainWindow::buildNotesIndex(int noteSubFolderId, bool forceRebuild) { // show the newest entry first QStringList files = notesDir.entryList(filters, QDir::Files, QDir::Time); + Note::applyIgnoredNotesSetting(files); // qDebug() << __func__ << " - 'files': " << files; bool createDemoNotes = (files.count() == 0) && !hasNoteSubFolder;