Commit Graph

73 Commits

Author SHA1 Message Date
Tomaz Canabrava
a158926ae8 Launch dolphin on "Open With File Manager" under a file 2022-02-05 15:13:58 +00:00
Tomaz Canabrava
b3eb91d3f7 Store the current hotspot under mouse
This is important if the actions need to access it later on
2022-02-05 15:13:58 +00:00
Kurt Hindenburg
465c89d5c4 Add KIO version checks for insertOpenWithActionsTo()
void KFileItemActions::insertOpenWithActionsTo(QAction*, QMenu*,
const QString) requires KF 5.78 while
void KFileItemActions::insertOpenWithActionsTo (QAction*, QMenu*,
const QStringList) requires KF 5.82.  For any KF version earlier, use
void KFileItemActions::addOpenWithActionsTo(QMenu*, const QString)

Fixes build on older systems after
https://invent.kde.org/utilities/konsole/-/merge_requests/527
2022-01-14 12:43:39 -05:00
Luis Javier Merino Morán
28bfbf1a9f Pass widget again to monitoring KNotifications
9f656939 introduced the possibility of showing a session in multiple
views, something which is no longer supported.  In doing so, it started
passing QApplication::activeWindow(), instead of TEWidget (nowadays
TerminalDisplay) to KNotification.

7592e894 split notifications for focused/unfocused terminals.
Unfortunately, QApplication::activeWindow() returns nothing for unmapped
windows, which results in issues when notifications are configured to
mark the task bar entry or run a command with %w/%t substitutions (for
window id and window title).

BUG: 443117
2022-01-11 15:57:29 +00:00
Tomaz Canabrava
1fa81f4e6e Remove random german variable name 2021-12-29 17:20:57 +00:00
Tomaz Canabrava
4503e7ef24 Do not delete the Open With action
But change the title so it matches what we want to do
2021-12-29 16:05:37 +00:00
Tomaz Canabrava
38bb7aa285 Remove Ghost Entries of the Open Folder With
There were two bugs with the previous implementation
one is that it didn't took in consideration the
Profile -> Mouse -> Advanced -> Underline Files
With that enabled, right click on the name of the folder
would give you a Open Folder With entry, so we would
end with two actions.

The other bug also triggered when that setting is enabled:
we never marked the Open Folder With for removal, after
inserting the menu for the underlined file.
2021-12-29 13:30:08 +00:00
Jan Blackquill
8022b26c3b Add ability to Open With the current working directory
This makes it convenient to open programs like VSCode in the current terminal window.
2021-12-28 11:14:14 +00:00
Luis Javier Merino Morán
5919c1fd0a Don't get the selection to check if it is empty
Every time the selection is changed, the selection text is retrieved to
check whether to enable or disable the copy actions. Besides that, the
selection text is also used for the web search context menu entries.

Better just check if the selection is empty and make a note that the
selection changed, so the next time the context menu is invoked it can
retrieve the current selection text, which should happen much less often
than selection changes.
2021-12-28 10:59:33 +00:00
Martin T. H. Sandsmark
1ee961e4e2 add config option for whether mouse tracking should be enabled by default 2021-11-24 14:55:00 +00:00
Martin T. H. Sandsmark
fb35320cdc add action to disable/enable mouse tracking 2021-11-24 14:55:00 +00:00
Kurt Hindenburg
13b2ed6697 Comment spelling corrections 2021-11-20 22:14:01 -05:00
Fushan Wen
49ccf099c1 Make "Find Next/Previous" icons in Edit menu consistent with those in the search bar
There is an inconsistence in "Find Next/Previous" icons in Edit menu and
the search bar. Make sure they are consistent whenever "Search backwards"
is checked or not.

BUG: 443244
2021-10-07 14:33:08 +00:00
Ahmad Samir
d1c826adc8 Tweak formatting after running clang-format
GIT_SILENT
2021-09-06 12:51:53 +02:00
Ahmad Samir
97569b764c Run clang-format on the whole repo
Also install the relevant git hook.

GIT_SILENT
2021-09-06 12:51:39 +02:00
Ahmad Samir
e3a5c10bb6 Make HotSpot::setupMenu() return a list of the added actions
Useful when removing the open-with actions from the session menu before
adding new ones.
2021-09-02 22:32:36 +02:00
Ahmad Samir
40cf8519d7 For the fallback profile change the menu text to "Create New Profile"
This is less confusing; also matches what the code actually does.

BUG: 440885
FIXED-IN: 21.12
2021-08-31 23:47:11 +00:00
Ahmad Samir
4cab54d2bb Don't connect more slots to EditProfileDialog::accepted() signal
This is similar to commit c413d543c1, EditProfileDialog's base class
(KPageDialog) already connects OK button clicked signal to accepted() signal;
creating another connection to accepted() in SessionController (which
creates the EditProfileDialog object), means the code will be run twice, not
ideal. Instead put the logic in EditProfileDialog::save() which is called by
the EditProfileDialog::accept() slot.

The same goes when ProfileSettings creates an EditProfileDialog.
2021-08-02 15:47:29 +00:00
Jonah Brüchert
4a5e7a5644 Revert "TerminalDisplay: Move out common pasting related code"
This reverts commit 8e8b924353.
2021-07-06 21:15:06 +02:00
Jonah Brüchert
8e8b924353 TerminalDisplay: Move out common pasting related code 2021-06-24 08:39:46 +00:00
Ahmad Samir
4ef7296b94 General code cleanup
- Add a type alias for QPointer<Session>
- Use TerminalDisplay::setSessionController() as early as possible
- Use Screen::setCurrentTerminalDisplay() in TerminalDisplay::mousePressEvent(),
  this matches what's being done in keyPressEvent()
- Add convenience function TerminalDisplay::currentSession()
- More const
2021-06-22 11:52:06 +02:00
Ahmad Samir
e805f086fe Change EditProfileDialog window title when creating a new profile
Now when creating a new profile, the title will be "Create new profile",
this is less confusing when the user tries to edit e.g. the Fallback profile,
which in effect will create a new profile as the Fallback one is immutable.
2021-04-04 14:40:30 +00:00
Ahmad Samir
94505d94d4 Make the "Edit Current Profile" dialog modal
This should prevent opening two instance of the EditProfileDialog in the
same process, i.e. if "run all konsole windows in a single process" option is:
- Enabled, then opening the dialog will block user interaction with all
  other konsole windows (including tabs).
- Disabled, then open the dialog will block user interactin with all
  other tabs in the same window

This simplifies the code since it checked if such a dialog was open
somewhere else to prevent crashes.
2021-03-23 16:55:35 +00:00
Ahmad Samir
61a7947adb Show dialogs with show() rather than exec()
exec() creates a nested eventloop, which could lead to some nasty
crashes ...etc.

ProfileSettings::editSelected(): since the dialog is modal, the user
can't interact with the konsole window at all, so no chance of opening
another instance of the EditProfileDialog.
2021-03-23 16:55:35 +00:00
Ahmad Samir
5ab8423139 Don't edit the Fallback profile, instead create a new one
This is a first step in simplifying the code; since the Fallback profile
doesn't have a file on disk, it's basically a corner-case that we have to
babysit in various places in the code.

Now when the user tries to "Edit current profile", if it's the Fallback
profile, a new profile is created, with a unique name "Profile 1",
"Profile 2" ...etc. This is similar to using the "New" button in the
ProfileSettings dialog.
2021-03-18 02:47:57 +00:00
Ahmad Samir
d06ea23903 Use Q_EMIT instead of emit
In C++20 there are new classes that have member functions named emit().
c.f.:
https://lists.qt-project.org/pipermail/development/2020-February/038812.html
https://en.cppreference.com/w/cpp/io/basic_osyncstream/emit

A similar change was done in the Frameworks:
https://invent.kde.org/frameworks/kio/-/merge_requests/315
2021-02-15 23:52:07 +00:00
Christoph Cullmann
0bc553fd51 delete client builder before d-pointer of KXMLGUIClient is killed
BUG: 432421
2021-02-06 09:43:49 +00:00
Carlos Alves
5bbb433494 Adding version checks to deprecated functions
Macros to check frameworks versions and switch from deprecated functions
to newer versions.
KProcess: pid -> processId
KCodecAction: setDelayed -> setPopupMode
KActionMenu: triggered -> codecTriggered
2021-01-03 07:31:52 -03:00
Carlos Alves
343d8595d7 Remove deprecated functions
Konsole minimum required version is QT 5.14 and KF5 5.71, there is no
need to keep support for those deprecated functions.
2021-01-02 14:12:09 +00:00
Gustavo Carneiro
fd59b50e6c Move font methods to a new TerminalFont class. 2020-12-23 03:48:30 +00:00
Gustavo Carneiro
1c0ed51e38 Rename extensions .hpp to .h in TerminalDisplay files. 2020-12-13 20:26:31 -03:00
Tomaz Canabrava
d7a411b8bc Fix wrong rebase / fix build. 2020-12-13 12:17:12 +00:00
Ahmad Samir
9eddcdb204 SessionController: use session() and view() member functions
They make reading the code easier than
_sessionDisplayConnection->view()/session().

GIT_SILENT
2020-12-13 14:08:52 +02:00
Gustavo Carneiro
72d604c6cc Move terminal color methods to a new class TerminalColor. 2020-12-12 21:07:49 +00:00
Laurent Montel
8242763fb3 operator+/- is disabled for QFlags in qt6 2020-12-09 07:57:05 +01:00
Ahmad Samir
7342cbea10 SessionController: use the same logic for the other if blocks
Make the code more readable by using some local vars.
2020-12-02 04:05:31 +00:00
Ahmad Samir
d74c0b1533 Fix if condition when updating filters
We want to delete the _escapedUrlFilter if allowEscapedLinks() is false.
2020-12-02 04:05:31 +00:00
Ahmad Samir
11987c7ae4 Minor code optimisation
Pass Profile::Ptr by reference. Make some local vars const.
2020-12-02 04:05:31 +00:00
Ahmad Samir
12c236c5fe FileFilter: update the QRE pattern if "word characters" change
Add a new function to update the regex pattern in FileFilter, rather than
recreating a FileFilter object.
2020-12-02 04:05:31 +00:00
Ahmad Samir
3711e884c9 SessionController: don't delete actions removed from QMenu manually
This isn't needed as QMenu takes care of deleting removed actions (that
are children of it). Confirmed with QObject::connect() call on
QObject::destroyed signal. And skimming the upstream QMenu::actionEvent()
code.
2020-11-30 15:16:15 +00:00
Ahmad Samir
0f6424497b SessionController: iterate over a const container
Also remove the action from the menu then delete it.
2020-11-26 00:20:10 +00:00
Ahmad Samir
043c424af5 SessionContoller: fix crash when closing session from Konsole KPart
_preventClose has to be set to false right at the end, so as to prevent
crashes if the user selects the "close session" action from the context
menu in a Konsole KPart (e.g. the terminal panel in Dolphin).

Check menu object isn't null before deleting actions from it.

BUG: 429538
2020-11-26 00:20:10 +00:00
Gustavo Carneiro
be969f454b Add a new color filter to preview color in hotspot. 2020-11-21 20:18:46 +00:00
Tomaz Canabrava
437d967625 Add bogus icons to Monitor* actions
This is just to help visualization, as there are no icons for this yet.
2020-11-13 17:18:51 +00:00
Tomaz Canabrava
f4f35e9fab Add the possibility to change the Profile from the Toolbar 2020-11-13 17:18:51 +00:00
Kurt Hindenburg
62f091f0a3 Convert session to use SPDX license/copyright
https://community.kde.org/Policies/Licensing_Policy#SPDX_Statements
https://community.kde.org/Guidelines_and_HOWTOs/Licensing
2020-11-12 21:34:59 -05:00
Carlos Alves
53af2a7fb9 Fix 'Copy Location' and 'Open With' issues with context menu
Update mouse events in mousePressEvent so the events are updated with the mouse stopped as well as moving.

BUG: 426359
BUG: 423860
FIXED-IN: 20.08.3
2020-10-26 00:06:53 +00:00
Kurt Hindenburg
9de3b239d5 Previous commit should be attributed to Yash Tiwari <yasht@mailbox.org> 2020-10-23 21:26:33 -04:00
Carlos Alves
44f00a490a Fix duplicates link-related entries in context menu
BUG: 426808
FIXED-IN: 20.08.3

!237
2020-10-23 21:11:55 -04:00
Laurent Montel
b626359501 If include is define in .h remove it if it's defined in .cpp too (scripted) 2020-10-23 07:45:13 +02:00