Commit Graph

7777 Commits

Author SHA1 Message Date
Tomaz Canabrava
41023f92e1 Connect on the SSH server 2021-04-19 16:48:10 +01:00
Tomaz Canabrava
8fb63f0368 Send the current view to the plugin when focus in 2021-04-19 16:26:44 +01:00
Tomaz Canabrava
eb34069dc5 Boilerplate code for the console session change 2021-04-19 15:47:54 +01:00
Tomaz Canabrava
61373a7895 Remove ssh configurations 2 2021-04-19 12:52:15 +01:00
Tomaz Canabrava
c43d6c521d Remove ssh configurations, part 1 2021-04-19 12:44:49 +01:00
Tomaz Canabrava
f4ab82aec9 Link ssh and profiles 2021-04-19 12:30:35 +01:00
Tomaz Canabrava
c2ab90c521 Do not allow the model to be edited 2021-04-19 12:29:43 +01:00
Tomaz Canabrava
8f6ada4b78 Validate the hostname and port 2021-04-19 12:01:08 +01:00
Tomaz Canabrava
85fe753684 Add support for Folders 2021-04-19 11:47:26 +01:00
Tomaz Canabrava
e056e25234 Fix JSON generation 2021-04-19 11:26:40 +01:00
Tomaz Canabrava
cebd893130 Save and restore the SSH Profiles 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
b8d11820bb Load data on the model 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
8450af6f0d Add panel with the needed ssh info 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
4613ea3b2e Start to implement the model that will hold the ssh information 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
81fb9cdf5f Add the base code for the SSHManagerWidget 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
d459b7b6f3 Fix the plugin system to load the plugins 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
f36d4f4b7b Enable building the plugins 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
73af772d6a Add Base code for a new plugin
This doesn't do anything yet, just prepares the code
2021-04-13 09:39:28 +01:00
Tomaz Canabrava
f1db2bbc2b Plugins should have a name. 2021-04-13 09:39:28 +01:00
Tomaz Canabrava
7cfb5d2804 Add a the base needed for a PluginSystem
Konsole really could have a plugin system to simplify parts
of it's codebase.

I'll use this code to implement a plugin for a "PuTTY" like SSH
access manager
2021-04-13 09:39:28 +01:00
Ahmad Samir
c413d543c1 Fix QDialogButtonBox connections in the edit profile dialog
KPageDialog already creates the accepted()/rejected() connections, since
the code here created another connection, the accept() slot was being
called twice for each OK button click, with e.g. the profile name empty,
clicking Ok:
- the first time isProfileNameValid() would return false, and the saving
  would abort, as it should
- the second time around, isProfileNameValid() would return true since
  the name has been reverted to the original value in the Name line edit

The same goes for the reject() slot.

Also use a lambda instead of apply(), it's a very small method and this
was the code is more readable, since we don't need to jump back and forth.
2021-04-06 12:52:07 +02:00
Nate Graham
1c8db8a3fc Correct corrected string
It needed a few more tweaks to be fully consistent and gramatically
correct in English.
2021-04-05 08:27:50 -06:00
Nate Graham
a7efdb650f Correct gammar in "profile with this name already exists" message 2021-04-05 08:16:47 -06:00
Ahmad Samir
acd265efab Less delete calls in destructors
- If the QObject has a parent, the parent will take care of deleting it
- Use std::unique_ptr to manage pointer member variable
- Use '= default' with empty destructors
- Fix initialization of QTimer in constructor initialization list
2021-04-04 17:21:22 +00:00
Ahmad Samir
a7363fa53f Better management of member variables destruction in TerminalDisplay
Always pass a parent to a QObject constructor; this is always a good
idea, as it enforces the parent/child relationship, and it also means
the parent QObject will take care of deleting its children, less manual
'delete' calls.

_terminalPainter already has a TerminalDisplay parent object.

Use a std::unique_ptr to manage _printManager (it's not a QObject).
2021-04-04 15:33:05 +00:00
Ahmad Samir
46b56ecfa5 Use a KMessageWidget for profile-name related errors in the Edit dialog
A KMessageWidget is nicer than a modal dialog, and now we also
automatically switch to the General page when the user tries to save
the settings while there is an issue with the profile name.
2021-04-04 14:40:30 +00: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
Tomaz Canabrava
ba81c56a5b Let the QObject hierarchy delete a QObject child
The terminalColor is a QWidget, created with the terminal display
as parent. if we are in the destructor that means that the
TerminalDisplay will delete this object when it's needed,
do not call delete directly.
2021-03-31 22:50:44 +00:00
Kai Uwe Broulik
c3982cfb12 Show display title in notifications
Makes it easier to identify the tab the notification came from, rather than
the usual "Session Default" or "Session Profile 1"
2021-03-31 19:49:52 +00:00
Ahmad Samir
8cd1dd0564 Don't find_package() KCompletion, it isn't used here
GIT_SILENT
2021-03-28 21:29:04 +02:00
Ahmad Samir
4b3dca80f3 Port away from KInit, which is going to be removed in KF6
For details see: https://phabricator.kde.org/T12140
2021-03-28 21:29:04 +02:00
Carlos Alves
ec170136cc Fix comparing different types
Warns while comparing int and size_t
2021-03-26 06:22:24 -03:00
Carlos Alves
3b0a81feed Screen and HistoryScroll pointers to smart pointer
Those Classes are not QObject, so most of it's pointers could be changed
 to smart pointers with no problems.
Problem found when using QList<std::unique_ptr>: it wasn't possible to
use it. I'm using std containers instead.
2021-03-26 06:22:24 -03:00
Carlos Alves
73dabe19a2 Pointer to smart pointer in HighlighScrolledLines
Using std::unique_ptr
2021-03-26 06:22:24 -03:00
Carlos Alves
93380119ce Pointer to smart pointer in ColorSchemeWallpaper
Using std::unique_ptr
2021-03-26 06:22:24 -03:00
Carlos Alves
3bfe6125bd Change CompactHistoryBlockList pointer to unique pointer
Obs.: Qt containers can't use unique_ptr, I'm using std container.
2021-03-26 06:22:24 -03: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
Kurt Hindenburg
9ec6f0aac0 Add a bunch of authors to the credits
This is long overdue as I haven't been keeping this up to date.
2021-03-23 11:11:25 -04:00
Ahmad Samir
1f480e36c7 Always sort the profiles by name in 'File -> New Tab'
With the Fallback profile always sorted at the top.
2021-03-19 02:18:23 +00:00
Ahmad Samir
bc41efd855 Fix crash in ProfileSettings; clone selected profile settings to new profile
- If there is no selection only enable the "New" button, this fixes a
  crash if you select a profile, then Ctrl+Click to unselect it, the set
  as default button would still be enabled and clicking it caused a crash

- If a profile is selected, clone its properties, otherwise the fallback
  profile properties will be used, this more expected
2021-03-19 02:13:20 +00:00
Carlos Alves
27cedc46e2 Change the content of HistoryLine using setCellsVectorAt
In compact history, instead of delete and add a new line, it will try
to change the line before delete and allocate memory.
2021-03-18 14:44:05 +00:00
Jan Paul Batrina
9d4df20536 Unmaximize terminal before moving to new tab
This ensures that all the other terminals (in other splits)
will still be visible after moving the maximized terminal
to a new tab.
2021-03-18 03:02:57 +00:00
Ahmad Samir
9cab175859 ProfileSettings: use generateUniqueName() when creating new profiles
This makes new profile name generation consistent everywhere.
2021-03-18 02:47:57 +00:00
Ahmad Samir
238a8b45ed ProfileManager: remove some fallback-profile-related code
After the previous commit the Fallback profile shouldn't be editable
at all.
2021-03-18 02:47:57 +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
646408dd97 Clean up some more "favourite profile"-related code
- Since the favourite profile feature was removed in commit 28ba920c82,
there is no need to sort profiles by menu index, this simlifies the code
some more.

- Remove Profile::menuIndexAsInt() method, now it's not used anywhere

- This also fixes an issue with sorting the the Default/fallback profile,
since commit ce31d0e235 it would be always sorted at the top of the
list (to signify that it's a special, read-only profile...etc), sorting
by menu index breaks that behaviour:
 - create a new profile by editing the Defualt/fallback profile, and give
   the new profile a name (Defualt is reserved of course)
 - open the profile manager dialog, you'll find the Default/fallback
   profile not at the top of the list, until you restart Konsole

This issue was reported by Kurt in
https://invent.kde.org/utilities/konsole/-/merge_requests/351#note_197432
2021-03-18 02:39:40 +00:00
Kurt Hindenburg
7a0fb9c390 Ignore .clang-format 2021-03-15 10:39:53 -04:00
Kurt Hindenburg
152ff13e75 Add code and notes for using clang-format 2021-03-15 10:38:19 -04:00
Albert Astals Cid
4d94931f06 GIT_SILENT Upgrade release service version to 21.07.70. 2021-03-13 22:00:34 +01:00