- 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.
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.
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
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
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.
Summary:
In all the cases that were changed, the bounding rect is needed. A few
places were not ported, since they need more careful investigation.
This reduces deprecation warnings.
Reviewers: #konsole, hindenburg
Reviewed By: #konsole, hindenburg
Subscribers: hindenburg, konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D23144
Summary:
* Use custom dialog and configuraton classes, as counterparts from KF5
are bugged. The KF5 versions should be fixed and used here.
* Create new KConfigDialog-like class and use it to show existing
configuration pages.
* Create KConfigDialogManager-like class for managing QButtonGroups.
* Remove help button from configuration dialog. There is nothing about
configuration dialog options in the help.
* Profile Settings:
* Use QTreeView instead of QTableView - it highlights whole lines,
aligns header names to the left, etc. Basically it looks like lists
in file manager or e.g. plugin list in Kate.
* Use (default) QStyledItemDelegate with checkbox instead of custom
delegate (tick mark) in favorite/show column.
* Change default profile item style - it now has italics font and
"(default)" suffix.
* Disable "Delete" button when default profile is selected
* Use slightly extended QKeySequenceEditor. KKeySequenceWidget looks
heavily out of place in a tree view. New editor supports some
control keys:
* Esc key cancels key capture.
* Del/backspace removes shortcut.
* Enter confirms shortcut immediately.
* Tab/backtab commits currently edited shorcut and moves to
next/previous shortcut.
* Shortcuts for non visible profiles use disabled text color.
* Note about visibility and shortcuts
* Rename "File Location" to "Temporary Files"
* Enable path selector only when "custom" is selected
* Place paths directly in labels
* Disable all tabbar settings except visibility when visibility is set
to "Never"
* Minor string changes.
**Screenshots**
{F6893460}
{F6893461}
{F6893462}
{F6893463}
BUG: 404096
FIXED-IN: 19.08.0
Reviewers: #konsole, #vdg, ngraham
Reviewed By: #vdg, ngraham
Subscribers: ngraham, hindenburg, #vdg, konsole-devel, #konsole
Tags: #konsole, #vdg
Differential Revision: https://phabricator.kde.org/D20816
Summary:
Favor manual list creator over for loop for small list
Three items, create them manually, cleaner and less
computationally expensive.
Btw - this is ugly, both ways. I blame QStandardItemModel.
Simplify Logic
Use auto when types are explicit
Simplify Logic: use ternary when it improves readability
Stack when heap's uneeded.
There's absolutely no point on creating a QPointer
and manually deleting the item later. Just create
the variable on the stack
Auto when type's explicit
Subscribers: konsole-devel
Tags: #konsole
Differential Revision: https://phabricator.kde.org/D13532
- Double-clicking on name opens Edit Profile dialog
- Only allow renaming from the Edit Profile dialog
- Upon renaming of a profile, change shortcut to new profile name
- Upon renaming of a profile, delete old named profile file.
- Do not allow renaming of a profile if that name already exists.
Patch by ahmadsamir; I made a few changes (name/const).
Differential Revision: https://phabricator.kde.org/D9272