Commit Graph

164 Commits

Author SHA1 Message Date
Waqar Ahmed
2d0fad18dc Fix crash in ProfileSettings
Fixes the following crash

- Open Settings -> Manage Profiles...
- Click on a non default profile and edit it
- In "Edit Profile Dialog", check "Default" to make this profile default
- Click Ok, Now we are back in "Manage Profiles" dialog.
- See that "Set as Default" is still clickable, clicking it crashes konsole

BUG: 423136
BUG: 445173
BUG: 454986
2023-03-13 23:31:00 +05:00
Waqar Ahmed
acedd2804e Fix konsoleapp inconsistent dll linkage errors 2023-03-09 11:16:35 +05:00
Nate Graham
d4ff52d03e Put tabs on top by default
Currently Konsole has its tabs on the bottom of the window. This is
nonstandard; few to no other main views in KDE apps have their tabs on
the bottom in the same manner.

In a productivity-focused app like Konsole, there could be an argument
for this being more Fitts' Law compliant, because tabs on the bottom
would touch the bottom screen edge when the window is maximized or
tiled and there is no bottom panel, making access via pointing device
fast. But... Plasma does have a bottom panel by default, so a person
would have to change their settings to realize this gain anyway. Such
a person could change their tabs to be on the bottom themselves.

There aren't strong reasons for putting the tabs on the bottom, so
let's move them to the top to match the behavior and appearance in
other KDE apps.
2022-12-02 05:32:49 +00:00
Jose Flores
87e25c62a4 Checks if a profile is editable before showing the edit profile menu action 2022-09-30 16:54:36 +00:00
Laurent Montel
2ddb680bee Remove unused includes 2022-09-28 04:50:24 +00:00
Ahmad Samir
6cade8efa4 Remove method for hiding shortcut column in ProfileSettings
Konsole::Part was the only user of that method, but since 5168fa3c24
this whole dialog can't be opened from the Part.
2022-08-10 13:04:59 +00:00
ivan tkachenko
fca0f4f9d7 Rename "fallback" profile to Built-in
* Rename everything related to built-in profile both in code and UI.

* Unified style for [Read-only] and [Default] badges in profile
  manager's list model.

* Change --fallback-profile option to --builtin-profile.

* Backward compatibility: yes. If a user happened to name their
  profile "Built-in", it would continue to work as normal, and even
  load with `--profile "Built-in"` command line flag. It will let them
  modify any property including Name; but changing the name back
  to "Built-in" shows a warning and reverts the change as usual.

* Remove "This option is a shortcut for" sentence. While it is still
  technically possible to pass built-in profile's magic path, this
  option is not a shortcut, nor implemented as such.

* Delete extra naming conditions in ProfileManager::changeProfile,
  because they could never be triggered anyway, due to pre-flight
  checks in EditProfileDialog::isProfileNameValid. Automatic unique
  profile names generation has been done even earlier in either
  SessionController or ProfileSettings. Just as before, users will
  continue experiencing a generic "A profile with the name \"%1\"
  already exists." message.

Tests:

* Improve test for uncreatable file name of built-in profile.

* Add backward compatibility test for loading existing profile
  named "Built-in" which also references real built-in as its parent.

BUG: 438309
2022-05-25 11:15:17 +00:00
Oswald Buddenhagen
f315950361 remove pretenses of windows support
kpty code is (as of now) unix-only, so konsole as a whole cannot
possibly work on windows (without a thick emulation layer). therefore,
remove the pointless #ifdefs that only reduce the code's legibility.
2022-05-02 09:54:32 +00:00
Ahmad Samir
c24a0876f7 Optimise saving profile shortcuts
- Call ProfileSettings::slotAccepted() when the parent ConfigurationDialog
  is accepted, so that ProfileManager::saveSettings() is called
- don't delete the ProfileSettings dialog on accept, it'll be destroyed when
  the parent ConfigurationDialog is destroyed
- save the profiles' shorcuts if they were actually changed

With this commit and the previous one, there is no need for ~Part() or
~Application() to call saveSettings(), shorcuts settings are saved when
the ProfileSettings dialog is accepted and saving the default profile is
done in setDefaultProfile(). This fixes an issue where changing e.g. the
default profile is only saved to the konsolerc file when the main window is
closed.
2021-10-21 20:05:20 +00:00
Ahmad Samir
0cf3a751a4 Rename ProfileSettings::profilesList to profileListView
To differentiate between it and the ProfileList class.
2021-10-19 18:54:23 +00:00
Eugene Popov
5fc0c180f1 Use one option to control menubar visibility
Currently there are two options to control menubar visibility: the first in the menu and the second in the preferences dialog, moreover the second option makes the changes persistent. This MR removes the second option (from the preferences dialog) and makes the first option (from the menu) make the changes persistent.

BUG: 440328
2021-09-20 18:54:38 +00:00
Ahmad Samir
e587f9dcaa Rename SaveGeometryOnExit to RememberWindowSize
And migrate the old key name to the new one.
2021-09-15 20:26:25 +00: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
aba8bb0303 Add an option to disable thumbnails generation 2021-08-05 14:54:54 +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
Carlos Alves
49692c0f14 Fix crash showing Settings Dialog
When you open settings and close it, than open a new window, than
close the old window, the MainWindow with the settings will
delete the configDialog. If you try to open settings againg it crashes.

Fix is each MainWindow now has its own configDialog.

BUG: 436366
2021-05-01 13:02:28 -03: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
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
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
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
6cb301bdbe ProfileManager dialog: improve handling profiles
- Differentiate between a profile being deleteable and writable:
  - Disable the Edit key for read-only profiles, i.e. a '.profile' that
    doesn't have write permissions for the user
  - Disable the Delete key for a '.profile' that is in a directory that
    isn't writable for the user (i.e. a .profile can be read-only, but
    still deleteable by the user)

- Change the model selection mode to single selection, that simplifies
  the code, besides it looks like editing more than one profile at the
  same time hasn't worked for a while, and there are no complaints AFAICS;
  remove the now redundant selectedProfiles() method.
2021-03-02 14:54:46 +00:00
Jonathan Marten
cf8316bb1f Manage Profiles dialogue: Add icons to buttons 2021-02-18 14:44:13 +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
Kurt Hindenburg
618a750881 Fix bool implicit conversions 2020-12-01 23:18:32 -05:00
Kurt Hindenburg
05c908e2a3 Convert settings 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:52:24 -05:00
Gustavo Carneiro
5c9c22fab3 Move TerminalDisplay to terminalDisplay folder. 2020-10-07 03:12:43 +00:00
Kurt Hindenburg
7af52b23a5 Better explain option needed to be enabled for thunbnails to work 2020-09-27 21:27:57 -04:00
Lucas Januario
13d54e6d72 For using thumbnails, insert note about extra action required. 2020-09-20 18:23:00 +00:00
Tomaz Canabrava
9d8e47298c Fix Profile "Set default" not working
This was harder than I tought. Because of the static initialization
static linkage order, we ended up having two different values of
a static variable on the code, that where supposedly only one.

https://stackoverflow.com/questions/26547454/static-variable-is-initialized-twice

The choosen change: Use OBJECT instead of STATIC for linking also
made me fix a few other profile headers to use the correct folder.
2020-09-15 15:51:54 +00:00
Tomaz Canabrava
28ba920c82 Remove 'Favorite Profile'
The only real thing a favorite profile does is to be accessible
from the Settings -> Profile menu. This simplifies a lot of code
and makes the flow of settings more what the user expects.

Next: Merge ProfileManager & ProfileModel
2020-09-15 15:51:54 +00:00
Tomaz Canabrava
8aaf43185d New class: ProfileModel
The code that managed the profile model currently is done
inside of the ProfileSettings, and thus unusable out
of it. Since I want to make it easier to select a profile
this needs to split.

It's also a bad code style to mix interface and code
2020-09-15 15:51:54 +00:00
Luc Dufresne
befddfcd92 BUG : 364098 - add focus following mouse feature 2020-09-15 13:47:23 +00:00
Kurt Hindenburg
212f4e15cf Set a minimum thumbnail size
BUG: 425544
2020-09-02 08:25:29 -04:00
Tomaz Canabrava
c71a0b3f3e Move ProfileDialog to widgets
And fix build using OpenSUSE flags
2020-07-29 17:22:14 +02:00
Gustavo Carneiro
7adfa6fb50 Move ConfigDialogButtonGroupManager class to a new file. 2020-07-29 11:25:01 +00:00
Tomaz Canabrava
0478529c6f Move Profile related classes to it's own folder
This also allowed me to remove a few includes of Profile.h
around the codebase, that used Profile::Ptr. now the compilation
is a bit faster and also does not recompile things as often.
2020-07-27 19:14:53 +02:00
Kurt Hindenburg
048f686849 Adjust context markers 2020-07-22 08:26:33 -04:00
Kurt Hindenburg
c9ef79c00e Add some context markers 2020-07-21 21:41:12 -04:00
Kurt Hindenburg
e87c868b7a kcfg use Bool, not bool 2020-07-21 09:32:16 -04:00
Kurt Hindenburg
44c655d2fe Revert "Update kcfg URLS to https"
Note there's a typo here and using https doesn't seem to work.

This reverts commit df8b60268e.
2020-07-21 09:26:50 -04:00
Tomaz Canabrava
d07af953aa Port ConfigurationDialog away from Qt4 style connect 2020-07-15 19:26:09 +02:00
Gustavo Carneiro
9b2e9731e0 move Session files to a new folder. 2020-07-15 09:30:42 +00:00
Gustavo Carneiro
b5fbbd81c7 Move widgets to a new folder. 2020-07-12 12:33:39 +00:00
Kurt Hindenburg
9b39939b9e Change the initial 'Tab Bar / Splitters' tab back to the first tab 2020-07-04 21:21:02 -04:00
Nate Graham
ce180bdada Correct formatting of new strings for header settings 2020-07-02 17:35:18 -06:00
Yuri Chornoivan
180aeb45d3 Remove extra spaces 2020-07-02 11:52:59 +03:00
Tomaz Canabrava
51883380af Add Split Settings: Toggle Visiblity and Dragger Size
The Splitter is a great addition to konsole, but it lacked one
thing that always made KDE software proud: Configurability.
Some people like to have the header bar, some people don't,
some people prefer to have thin lines separating the views, some people
prefer to have the lines a bit thicker so it's easy to drag them with
the mouse.

This patch introduces those two settings in a new Tab on the Settings.

FIXED-IN: 20.08

FEATURE:

GUI:

CHANGELOG: Add Splitter settings for visibility and drag size
2020-07-02 08:30:46 +00:00
Kurt Hindenburg
df8b60268e Update kcfg URLS to https 2020-06-19 21:04:18 -04:00
Kurt Hindenburg
f4959efe01 License urls change to https 2020-06-19 20:41:26 -04:00
Pino Toscano
1027e127f9 fixuifiles 2020-06-07 08:24:17 +02:00