Changeset View
Changeset View
Standalone View
Standalone View
src/Profile.h
Show All 25 Lines | |||||
26 | #include <QHash> | 26 | #include <QHash> | ||
27 | #include <QStringList> | 27 | #include <QStringList> | ||
28 | #include <QVariant> | 28 | #include <QVariant> | ||
29 | #include <QFont> | 29 | #include <QFont> | ||
30 | #include <QColor> | 30 | #include <QColor> | ||
31 | 31 | | |||
32 | // Konsole | 32 | // Konsole | ||
33 | #include "konsoleprivate_export.h" | 33 | #include "konsoleprivate_export.h" | ||
34 | #include "ColorScheme.h" | ||||
34 | 35 | | |||
35 | namespace Konsole { | 36 | namespace Konsole { | ||
36 | class ProfileGroup; | 37 | class ProfileGroup; | ||
37 | 38 | | |||
38 | /** | 39 | /** | ||
39 | * Represents a terminal set-up which can be used to | 40 | * Represents a terminal set-up which can be used to | ||
40 | * set the initial state of new terminal sessions or applied | 41 | * set the initial state of new terminal sessions or applied | ||
41 | * to existing sessions. Profiles consist of a number of named | 42 | * to existing sessions. Profiles consist of a number of named | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 74 | enum Property { | |||
115 | */ | 116 | */ | ||
116 | ShowTerminalSizeHint, | 117 | ShowTerminalSizeHint, | ||
117 | /** (QFont) The font to use in terminal displays using this profile. */ | 118 | /** (QFont) The font to use in terminal displays using this profile. */ | ||
118 | Font, | 119 | Font, | ||
119 | /** (QString) The name of the color scheme to use in terminal | 120 | /** (QString) The name of the color scheme to use in terminal | ||
120 | * displays using this profile. | 121 | * displays using this profile. | ||
121 | * Color schemes are managed by the ColorSchemeManager class. | 122 | * Color schemes are managed by the ColorSchemeManager class. | ||
122 | */ | 123 | */ | ||
123 | ColorScheme, | 124 | ColorSchemeName, | ||
124 | /** (QString) The name of the key bindings. | 125 | /** (QString) The name of the key bindings. | ||
125 | * Key bindings are managed by the KeyboardTranslatorManager class. | 126 | * Key bindings are managed by the KeyboardTranslatorManager class. | ||
126 | */ | 127 | */ | ||
127 | KeyBindings, | 128 | KeyBindings, | ||
128 | /** (HistoryModeEnum) Specifies the storage type used for keeping | 129 | /** (HistoryModeEnum) Specifies the storage type used for keeping | ||
129 | * the output produced by terminal sessions using this profile. | 130 | * the output produced by terminal sessions using this profile. | ||
130 | * | 131 | * | ||
131 | * See Enum::HistoryModeEnum | 132 | * See Enum::HistoryModeEnum | ||
▲ Show 20 Lines • Show All 309 Lines • ▼ Show 20 Line(s) | |||||
441 | 442 | | |||
442 | /** Convenience method for property<QFont>(Profile::Font) */ | 443 | /** Convenience method for property<QFont>(Profile::Font) */ | ||
443 | QFont font() const | 444 | QFont font() const | ||
444 | { | 445 | { | ||
445 | return property<QFont>(Profile::Font); | 446 | return property<QFont>(Profile::Font); | ||
446 | } | 447 | } | ||
447 | 448 | | |||
448 | /** Convenience method for property<QString>(Profile::ColorScheme) */ | 449 | /** Convenience method for property<QString>(Profile::ColorScheme) */ | ||
449 | QString colorScheme() const | 450 | QString colorSchemeName() const | ||
450 | { | 451 | { | ||
451 | return property<QString>(Profile::ColorScheme); | 452 | return property<QString>(Profile::ColorSchemeName); | ||
452 | } | 453 | } | ||
453 | 454 | | |||
454 | /** Convenience method for property<QStringList>(Profile::Environment) */ | 455 | /** Convenience method for property<QStringList>(Profile::Environment) */ | ||
455 | QStringList environment() const | 456 | QStringList environment() const | ||
456 | { | 457 | { | ||
457 | return property<QStringList>(Profile::Environment); | 458 | return property<QStringList>(Profile::Environment); | ||
458 | } | 459 | } | ||
459 | 460 | | |||
▲ Show 20 Lines • Show All 141 Lines • ▼ Show 20 Line(s) | |||||
601 | } | 602 | } | ||
602 | 603 | | |||
603 | /** Convenience method for property<QString>(Profile::MenuIndex) */ | 604 | /** Convenience method for property<QString>(Profile::MenuIndex) */ | ||
604 | QString menuIndex() const | 605 | QString menuIndex() const | ||
605 | { | 606 | { | ||
606 | return property<QString>(Profile::MenuIndex); | 607 | return property<QString>(Profile::MenuIndex); | ||
607 | } | 608 | } | ||
608 | 609 | | |||
610 | ColorScheme const* colorScheme() const; | ||||
611 | | ||||
609 | int menuIndexAsInt() const; | 612 | int menuIndexAsInt() const; | ||
610 | 613 | | |||
611 | /** Return a list of all properties names and their type | 614 | /** Return a list of all properties names and their type | ||
612 | * (for use with -p option). | 615 | * (for use with -p option). | ||
613 | */ | 616 | */ | ||
614 | const QStringList propertiesInfoList() const; | 617 | const QStringList propertiesInfoList() const; | ||
615 | 618 | | |||
616 | /** | 619 | /** | ||
Show All 31 Lines | 628 | private: | |||
648 | // which is used when saving/loading the profile. | 651 | // which is used when saving/loading the profile. | ||
649 | struct PropertyInfo { | 652 | struct PropertyInfo { | ||
650 | Property property; | 653 | Property property; | ||
651 | const char *name; | 654 | const char *name; | ||
652 | const char *group; | 655 | const char *group; | ||
653 | QVariant::Type type; | 656 | QVariant::Type type; | ||
654 | }; | 657 | }; | ||
655 | static const PropertyInfo DefaultPropertyNames[]; | 658 | static const PropertyInfo DefaultPropertyNames[]; | ||
659 | ColorScheme const *_colorScheme; | ||||
656 | }; | 660 | }; | ||
657 | 661 | | |||
658 | inline bool Profile::canInheritProperty(Property p) | 662 | inline bool Profile::canInheritProperty(Property p) | ||
659 | { | 663 | { | ||
660 | return p != Name && p != Path; | 664 | return p != Name && p != Path; | ||
661 | } | 665 | } | ||
662 | 666 | | |||
663 | template<class T> | 667 | template<class T> | ||
▲ Show 20 Lines • Show All 134 Lines • Show Last 20 Lines |