pbek / QOwnNotes

QOwnNotes is a plain-text file notepad and todo-list manager with Markdown support and Nextcloud / ownCloud integration.
https://www.qownnotes.org/
GNU General Public License v2.0
4.69k stars 414 forks source link

Disable opening directory after exporting as PDF #1789

Open AlfredoRamos opened 4 years ago

AlfredoRamos commented 4 years ago

Hi,

Thanks for this application, I find it very useful.

I would like to disable the option to open the container directory automatically after exporting the note as PDF.

I usually have that directory opened already, so I don't really need the application to open it again.

Besides, if I make a little modification and export again, I need to close it again and It can be a little annoying, even if not done so often.

Expected behaviour

Have an option to disable that behavior.

Actual behaviour

I looked at all the settings options. It seems that it can't be turned off.

https://github.com/pbek/QOwnNotes/blob/b9ae6cb8097a9cc05870a7b83d45c51bdd211285/src/mainwindow.cpp#L7174 https://github.com/pbek/QOwnNotes/blob/b9ae6cb8097a9cc05870a7b83d45c51bdd211285/src/utils/misc.cpp#L137-L179

Steps to reproduce

Output from the debug section in the settings dialog

Expand QOwnNotes Debug Information =========================== ## General Info **Current Date**: `Sun Jun 14 21:15:24 2020` **Version**: `20.6.5` **Build date**: `Jun 15 2020` **Build number**: `727` **Platform**: `linux` **Operating System**: `Arch Linux` **Build architecture**: `x86_64` **Current architecture**: `x86_64` **Release**: `AUR` **Qt Version (build)**: `5.15.0` **Qt Version (runtime)**: `5.15.0` **Portable mode**: `no` **Settings path / key**: `/home/alfredo/.config/PBE/QOwnNotes.conf` **Application database path**: `/home/alfredo/.local/share/PBE/QOwnNotes/QOwnNotes.sqlite` **Application arguments**: `/usr/bin/QOwnNotes` **Qt Debug**: `0` **Locale (system)**: `en_US` **Locale (interface)**: *empty* **Primary screen resolution**: `1920x1080` **Icon theme**: `breeze` **Notes in current note folder**: `2` **Calendar items**: `0` **Enabled scripts**: `0` ## Server Info **serverUrl**: *empty* **appIsValid**: `no` **notesPathExists**: *empty* **connectionErrorMessage**: *empty* ## Spellchecking **Enabled**: `true` **Selected language**: `auto` **Language codes**: `en_US, en_US-large, es_MX` **Language names**: `American English (United States), American English (United States) [large], español de México (México)` **Application dictionaries path**: `/home/alfredo/.local/share/PBE/QOwnNotes/dicts` ## Note folders **currentNoteFolderId**: `1` ### Note folder `default` **id**: `1` **isCurrent**: `yes` **activeTagId**: `0` **localPath**: `/home/alfredo/Documents/Notes` **remotePath**: `Notes` **cloudConnectionId**: `1` **isShowSubfolders**: `yes` **isUseGit**: `yes` **activeNoteSubFolder name**: *empty* **database file**: `/home/alfredo/Documents/Notes/notes.sqlite` ## Cloud connections ### Cloud connection `Default` **id**: `1` **isCurrent**: `yes` **serverUrl**: *empty* **username**: *empty* ## Enabled scripts ## Settings **AboutDialog/geometry** (QByteArray): `` **ActionDialog/geometry** (QByteArray): `` **ActiveNoteHistoryItem** (NoteHistoryItem): `` **Debug/fakeOldVersionNumber** (QString): `false` **Debug/fileLogging** (QString): `false` **Editor/CurrentSchemaKey** (QString): `EditorColorSchema-6033d61b-cb96-46d5-a3a8-20d5172017eb` **Editor/autoBracketClosing** (QString): `true` **Editor/autoBracketRemoval** (QString): `true` **Editor/disableCursorBlinking** (QString): `false` **Editor/editorWidthInDFMOnly** (QString): `true` **Editor/highlightCurrentLine** (QString): `true` **Editor/indentSize** (QString): `4` **Editor/removeTrainingSpaces** (QString): `false` **Editor/useTabIndent** (QString): `true` **Editor/vimMode** (QString): `false` **FileDialog/LastPath** (QString): `/home/alfredo/Downloads` **FileDialog/LastPath-NotePDFExport** (QString): `/home/alfredo/Downloads` **IssueAssistantDialog/geometry** (QByteArray): `` **LastUpdateCheck** (QDateTime): `2020-06-14T20:46:51.654` **MainWindow/geometry** (QByteArray): `` **MainWindow/mainToolBar.iconSize** (QString): `22` **MainWindow/menuBarGeometry** (QByteArray): `` **MainWindow/noteTextEdit.code.font** (QString): `PT Mono,12,-1,5,50,0,0,0,0,0,Regular` **MainWindow/noteTextEdit.font** (QString): `DejaVu Sans,10,-1,5,50,0,0,0,0,0,Book` **MainWindow/noteTextView.code.font** (QString): `Bitstream Vera Sans,12,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.font** (QString): `Sans,10,-1,5,50,0,0,0,0,0` **MainWindow/noteTextView.ignoreCodeFontSize** (QString): `true` **MainWindow/noteTextView.rtl** (QString): `false` **MainWindow/noteTextView.underline** (QString): `true` **MainWindow/noteTextView.useEditorStyles** (QString): `true` **MainWindow/noteTextView.useInternalExportStyling** (QString): `true` **MainWindow/showNotesFromAllNoteSubFolders** (bool): `true` **NoteFolder-1/NoteTabNameList** (QString): `Welcome to QOwnNotes` **NoteFolder-1/NoteTabStickinessList**: *empty* **NoteFolder-1/NoteTabSubFolderPathDataList** (QString): *empty* **NoteFolder-1/allowDifferentNoteFileName** (bool): `true` **NoteHistory-1** (QVariantList): `` **NoteHistoryCurrentIndex-1** (QString): `1` **PiwikClientId** (QString): `` **Printer/NotePDFExport** (QByteArray): `` **SearchEngineId** (QString): `2` **SettingsDialog/geometry** (QByteArray): `` **SettingsDialog/mainSplitterState** (QByteArray): `` **ShowSystemTray** (QString): `true` **StartHidden** (QString): `false` **WelcomeDialog/geometry** (QByteArray): `` **acceptAllExternalModifications** (QString): `false` **allowNoteEditing** (bool): `true` **allowOnlyOneAppInstance** (QString): `true` **appMetrics/disableAppHeartbeat** (QString): `true` **appMetrics/disableTracking** (QString): `true` **appMetrics/notificationShown** (QString): `true` **automaticNoteFolderDatabaseClosing** (QString): `false` **checkSpelling** (bool): `true` **closeTodoListAfterSave** (QString): `false` **cryptoKey** (QString): `` **currentNoteFolderId** (QString): `1` **currentWorkspace** (QString): `initial` **cursorWidth** (QString): `1` **customNoteFileExtensionList**: *empty* **darkMode** (QString): `false` **darkModeColors** (QString): `false` **darkModeIconTheme** (QString): `false` **darkModeTrayIcon** (QString): `false` **defaultNoteFileExtension** (QString): `md` **demoNotesCreated** (QString): `true` **disableAutomaticUpdateDialog** (QString): `true` **disableSavedSearchesAutoCompletion** (QString): `false` **dockWasInitializedOnce** (QString): `true` **enableNoteTree** (QString): `false` **enableSocketServer** (QString): `true` **externalEditorPath** (QString): *empty* **fullyHighlightedBlockquotes** (QString): `true` **gitCommitInterval** (QString): `30` **gitExecutablePath** (QString): *empty* **gitLogCommand** (QString): *empty* **guiFirstRunInit** (bool): `true` **ignoreAllExternalModifications** (QString): `false` **ignoreAllExternalNoteFolderChanges** (QString): `false` **ignoreNoteSubFolders** (QString): `^\.` **imageScaleDown** (QString): `false` **imageScaleDownMaximumHeight** (QString): `1024` **imageScaleDownMaximumWidth** (QString): `1024` **initialLayoutIdentifier** (QString): `full` **insertTimeFormat** (QString): *empty* **interfaceFontSize** (QString): `11` **interfaceLanguage** (QString): *empty* **internalIconTheme** (QString): `false` **itemHeight** (QString): `23` **legacyLinking** (QString): `false` **localTrash/autoCleanupDays** (QString): `30` **localTrash/autoCleanupEnabled** (QString): `true` **localTrash/supportEnabled** (QString): `true` **markdownHighlightingEnabled** (QString): `true` **navigationPanelHideSearch** (QString): `false` **networking/ignoreSSLErrors** (QString): `false` **networking/proxyType** (QString): `2` **newNoteAskHeadline** (QString): `false` **noteEditIsCentralWidget** (QString): `true` **noteListPreview** (QString): `false` **noteSaveIntervalTime** (QString): `10` **noteSubfoldersPanelDisplayAsFullTree** (QString): `true` **noteSubfoldersPanelHideSearch** (QString): `false` **noteSubfoldersPanelOrder** (QString): `0` **noteSubfoldersPanelShowFullPath** (QString): `false` **noteSubfoldersPanelShowNotesRecursively** (QString): `false` **noteSubfoldersPanelShowRootFolderName** (QString): `true` **noteSubfoldersPanelSort** (QString): `0` **notesPanelOrder** (QString): `0` **notesPanelSort** (QString): `1` **notesPath** (QString): `/home/alfredo/Documents/Notes` **notifyAllExternalModifications** (QString): `false` **overrideInterfaceFontSize** (QString): `false` **ownCloud/supportEnabled** (QString): `false` **ownCloud/todoCalendarBackend** (QString): `3` **ownCloud/todoCalendarCalDAVPassword** (QString): `` **ownCloud/todoCalendarCalDAVServerUrl** (QString): *empty* **ownCloud/todoCalendarCalDAVUsername** (QString): *empty* **ownCloud/todoCalendarCloudConnectionId** (QString): `1` **ownCloud/todoCalendarDisplayNameList**: *empty* **ownCloud/todoCalendarEnabledList**: *empty* **ownCloud/todoCalendarEnabledUrlList**: *empty* **ownCloud/todoCalendarUrlList**: *empty* **ownCloudInfo/appIsValid** (bool): `false` **ownCloudInfo/connectionErrorMessage** (QString): *empty* **ownCloudInfo/notesPathExistsText** (QString): *empty* **ownCloudInfo/serverVersion** (QString): *empty* **restoreCursorPosition** (QString): `true` **restoreLastNoteAtStartup** (QString): `true` **restoreNoteTabs** (QString): `true` **showMatches** (QString): `true` **showMenuBar** (bool): `true` **showStatusBar** (bool): `true` **spellCheckLanguage** (QString): `auto` **systemIconTheme** (QString): `false` **taggingShowNotesRecursively** (QString): `false` **tagsPanelHideSearch** (QString): `false` **tagsPanelOrder** (QString): `0` **tagsPanelSort** (QString): `0` **todoCalendarSupport** (QString): `true` **toolbar/1/items** (QStringList): `action_New_note, action_Find_note, action_Remove_note, action_Open_note_in_external_editor, actionShow_local_trash, actionAllow_note_editing, , action_Back_in_note_history, action_Forward_in_note_history, , action_Find_text_in_note, actionReplace_in_current_note, , actionShow_versions, actionShow_trash, actionShare_note, , actionOpen_List` **toolbar/1/name** (QString): `mainToolBar` **toolbar/1/title** (QString): `main toolbar` **toolbar/2/items** (QStringList): `actionFormat_text_bold, actionFormat_text_italic, actionStrike_out_text, actionInsert_code_block, actionInsert_block_quote` **toolbar/2/name** (QString): `formattingToolbar` **toolbar/2/title** (QString): `formatting toolbar` **toolbar/3/items** (QStringList): `actionInsert_Link_to_note, actionInsert_image, actionInsert_current_time` **toolbar/3/name** (QString): `insertingToolbar` **toolbar/3/title** (QString): `inserting toolbar` **toolbar/4/items** (QStringList): `action_Encrypt_note, actionEdit_encrypted_note, actionDecrypt_note` **toolbar/4/name** (QString): `encryptionToolbar` **toolbar/4/title** (QString): `encryption toolbar` **toolbar/5/items** (QStringList): `actionWorkspaceComboBox, actionStore_as_new_workspace, actionRemove_current_workspace, actionRename_current_workspace, actionSwitch_to_previous_workspace, actionUnlock_panels, , actionToggle_distraction_free_mode, action_Increase_note_text_size, action_Decrease_note_text_size, action_Reset_note_text_size` **toolbar/5/name** (QString): `windowToolbar` **toolbar/5/title** (QString): `window toolbar` **toolbar/6/items** (QString): `action_Quit` **toolbar/6/name** (QString): `quitToolbar` **toolbar/6/title** (QString): `quit toolbar` **toolbar/size** (QString): `6` **useNoteFolderButtons** (QString): `false` **useUNIXNewline** (QString): `false` **webSocketServerService/bookmarksNoteName** (QString): `Bookmarks` **webSocketServerService/bookmarksTag** (QString): `bookmarks` **webSocketServerService/port** (QString): `22222` **workspace-initial/name** (QString): `Full` **workspace-initial/noteSubFolderDockWidgetVisible** (QString): `true` **workspace-initial/windowState** (QByteArray): `` **workspaces** (QString): `initial` ## System environment **SHELL**: `/bin/bash` **XDG_CONFIG_DIRS**: `/etc:/etc/xdg:/usr/share` **XDG_SESSION_PATH**: `/org/freedesktop/DisplayManager/Session1` **XDG_MENU_PREFIX**: `lxqt-` **XDG_DATA_HOME**: `/home/alfredo/.local/share` **XDG_CONFIG_HOME**: `/home/alfredo/.config` **DESKTOP_SESSION**: `/usr/share/xsessions/lxqt` **GTK_MODULES**: `canberra-gtk-module` **XDG_SEAT**: `seat0` **PWD**: `/home/alfredo` **LOGNAME**: `alfredo` **XDG_SESSION_DESKTOP**: *empty* **QT_QPA_PLATFORMTHEME**: `lxqt` **XDG_SESSION_TYPE**: `x11` **XAUTHORITY**: `/home/alfredo/.Xauthority` **HOME**: `/home/alfredo` **LANG**: `en_US.UTF-8` **XDG_CURRENT_DESKTOP**: `LXQt` **XDG_SEAT_PATH**: `/org/freedesktop/DisplayManager/Seat0` **XDG_CACHE_HOME**: `/home/alfredo/.cache` **XDG_SESSION_CLASS**: `user` **USER**: `alfredo` **DISPLAY**: `:0` **SHLVL**: `0` **XDG_VTNR**: `1` **XDG_SESSION_ID**: `2` **XDG_RUNTIME_DIR**: `/run/user/1000` **QT_PLATFORM_PLUGIN**: `lxqt` **XDG_DATA_DIRS**: `/home/alfredo/.local/share:/usr/local/share:/usr/share` **PATH**: `/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl` **DBUS_SESSION_BUS_ADDRESS**: `unix:path=/run/user/1000/bus` **MAIL**: `/var/spool/mail/alfredo` **LXQT_SESSION_CONFIG**: `session` **GTK_CSD**: `0` **GTK_OVERLAY_SCROLLING**: `0` **TERM**: `qterminal`

Relevant log output in the Log panel

N/A

pbek commented 4 years ago

Thank you for your kind words and your suggestion. Any clever idea on how to achieve that (beside adding one more setting to the setting dialog)?

AlfredoRamos commented 4 years ago

Two options come to my mind, besides a new setting:

  1. Use QProcess::processId() or QProcess::state() to check that it is opened only once, though I don't know if that would work for Windows too since it doesn't seems to be using QProcess
  2. A check box somewhere in the export dialog to disable opening the directory. That dialog which is always opened anyways so a new setting would not be needed.
Example ![20200615_003543](https://user-images.githubusercontent.com/4165935/84621472-4131bb00-aea0-11ea-90c2-ec06a6ee0c4f.png)

It has been a while since I used Qt, I'll experiment a little bit.

pbek commented 4 years ago

Thank you for you input.

1) Use QProcess::processId() or QProcess::state() to check that it is opened only once, though I don't know if that would work for Windows too since it doesn't seems to be using QProcess

It would be hard to implement that for every (common?) file browser and operating system...

2) A check box somewhere in the export dialog to disable opening the directory. That dialog which is always opened anyways so a new setting would not be needed.

Those dialogs are the operating system's print dialogs. :grin: I can't modify them.