Commit Graph

52 Commits

Author SHA1 Message Date
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
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
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
Tomaz Canabrava
c71a0b3f3e Move ProfileDialog to widgets
And fix build using OpenSUSE flags
2020-07-29 17:22:14 +02: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
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
c7ea0413ad Simplify redundant else logic 2020-04-26 18:39:50 -04:00
Kurt Hindenburg
92f03de922 Match variable names 2020-04-26 18:21:29 -04:00
Ahmad Samir
5f60bc5a6f Replace foreach (deprecated) with range-for
The code compiles and konsole seems to work as bofore.
2019-12-03 11:29:31 +02:00
Konstantin Kharlamov
c416043fe5 ProfileSettings.cpp: remove unused includes 2019-09-06 20:04:51 +03:00
Frederik Gladhorn
6a06431962 Port from QFontMetrics::width() to boundingRect().width()
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
2019-08-17 10:25:20 -04:00
Kurt Hindenburg
799fb46190 Use modernize-return-braced-init-list 2019-07-17 09:30:54 -04:00
Kurt Hindenburg
c8ad9ec5ae Add KUIT context marker 2019-07-15 20:21:16 -04:00
Mariusz Glebocki
716884e78e Restore compatibility with Qt < 5.11
Summary: Use QFontMetrics::Width() instead of QFontMetrics::horizontalAdvance().

Reviewers: #konsole

Subscribers: konsole-devel, #konsole

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D21840
2019-06-16 08:42:36 -04:00
Mariusz Glebocki
a8ec9ad28a Configure Konsole dialog GUI redesign
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
2019-06-15 12:52:43 -04:00
Kurt Hindenburg
d582a984ff Add fixme about changing icon for favorite column 2019-03-02 20:46:14 -05:00
Kurt Hindenburg
d187b43a65 Correctly set icon when changing default profile in Manage dialog
When changing the default profile, the previous default's profile icon
would not be displayed in the Manage Profiles dialog's row.
2019-02-19 22:54:47 -05:00
Kurt Hindenburg
421019de38 Change QStyleOptionViewItemV3 and V4 to QStyleOptionViewItem
QStyleOptionViewItemV3 and QStyleOptionViewItemV4 were depreciated in
Qt 5.7
2019-02-16 13:48:08 -05:00
Laurent Montel
f46c36bbb5 Const'ify where it's possible found by clazy 2019-01-11 07:29:12 +01:00
Kurt Hindenburg
8f44c36aec modernize use auto 2018-10-27 22:05:38 -04:00
Kurt Hindenburg
0cfbeb0458 add note about using pointer for dialog 2018-06-22 07:36:25 -04:00
Tomaz Canabrava
033d90a0d3 Revert "Stack when heap's uneeded."
This reverts commit 45cd5000d0.

At the time this code was due to possible crashes, revert for now.
https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0

https://phabricator.kde.org/D13620
2018-06-22 06:54:15 -04:00
Tomaz Canabrava
a9669bc3db Code cleanup on the Profile Settings
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
2018-06-17 16:32:31 +02:00
Tomaz Canabrava
45cd5000d0 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
2018-06-17 16:32:31 +02:00
Tomaz Canabrava
2ef1261066 Simplify Logic: use ternary when it improves readability 2018-06-17 16:32:31 +02:00
Tomaz Canabrava
788d3d5901 Use auto when types are explicit 2018-06-17 16:32:31 +02:00
Tomaz Canabrava
aa80b577cd Simplify Logic 2018-06-17 16:32:31 +02:00
Tomaz Canabrava
e782691e70 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.
2018-06-17 16:32:31 +02:00
Tomaz Canabrava
1462bb095d Use Initializer list instead of temporaries 2018-06-17 16:32:31 +02:00
Tomaz Canabrava
68ddd7b978 simplify isProfileDeletable
Summary: Maintenability ++

Reviewers: #konsole, hindenburg

Reviewed By: #konsole, hindenburg

Subscribers: ahmadsamir, konsole-devel

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D13516
2018-06-14 08:31:40 -04:00
Kurt Hindenburg
7f35a5af09 initialize members in the initialization list 2018-01-04 09:14:55 -05:00
Kurt Hindenburg
fbbf365e31 readability fixes - braces 2018-01-02 21:27:57 -05:00
Kurt Hindenburg
652e48cf6f Improvements to the Manage Profiles dialog
- 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
2017-12-14 10:31:41 -05:00
Kurt Hindenburg
016209c3ca modernize use nullptr 2017-07-01 21:54:48 -04:00
Kurt Hindenburg
5b5e464932 Remove unnecessary column width changes
When manage profiles had its own stand alone dialog, these were
needed to make sure the dialog was big enough.
2017-06-24 22:14:42 -04:00
Kurt Hindenburg
4ed43e23e6 More changes to QLatin1String, QLatin1Char and QStringLiteral 2017-05-08 10:15:44 -04:00
Kurt Hindenburg
eade05a4bd Do not specify Qt modules in includes 2017-04-26 21:33:34 -04:00
Kurt Hindenburg
a540e6fdd0 Fix readability-implicit-bool-cast issues using nullptr 2017-04-21 10:51:31 -04:00
Kurt Hindenburg
869c361602 constructors/decontructors use =default instead of {} 2017-04-01 14:01:41 -04:00
Kurt Hindenburg
dfafff97d4 remove QDebug/qWarning and use QCDebug 2017-03-31 21:06:18 -04:00
Kurt Hindenburg
2b586e6ff8 use auto 2017-03-28 11:25:26 -04:00
Martin T. H. Sandsmark
27dec8d02f Port away from kdelibs4support.
Original work by Dāvis Mosāns.

REVIEW: 127625
REVIEW: 126808
2016-06-11 17:24:12 +02:00
Kurt Hindenburg
296cfc4233 remove unneeded #includes and forward classes 2015-10-15 18:45:11 -04:00
Kurt Hindenburg
ff66b231bf Remove unneeded includes 2015-09-16 23:34:40 -04:00
Kurt Hindenburg
2c0013cc84 Use QList::reserve() 2015-09-15 09:30:55 -04:00