Commit d1f62c16 authored by Méven Car's avatar Méven Car

KCM/Component Revamp email config

Summary:
Simplify UI:
 * Select option in the available email clients
 * use mimeapps.list preferred service as source of truth regarding default email client
 * keep kmail as default email client when it is installed
 * Can select any service as email client alternatively
 * Ensure kbuildsycoca cache is updated after saving

BUG: 292606
FIXED-IN: 5.19

Test Plan:
Before:

{F7883144}

After:

{F7883141}

{F7883117}

Reviewers: ngraham, ervin, #plasma, bport, crossi, dvratil

Reviewed By: ngraham, ervin

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T12551

Differential Revision: https://phabricator.kde.org/D26565
parent a41f69f3
......@@ -203,6 +203,7 @@ void ComponentChooser::slotServiceSelected(QListWidgetItem* it) {
if (configWidget) {
configContainer->setCurrentWidget(configWidget);
const auto plugin = dynamic_cast<CfgPlugin*>(configWidget);
headerGroupBox->setTitle(it->text());
plugin->load(&cfg);
emit defaulted(plugin->isDefaults());
}
......
......@@ -15,7 +15,7 @@
<number>0</number>
</property>
<item row="2" column="1">
<widget class="QGroupBox" name="GroupBox1">
<widget class="QGroupBox" name="headerGroupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
......
......@@ -34,11 +34,11 @@ public:
private:
KEMailSettings *pSettings;
KService::Ptr m_emailClientService;
int m_currentIndex = -1;
int m_kmailIndex = -1;
protected Q_SLOTS:
void selectEmailClient();
void configChanged();
void selectEmailClient(int index);
Q_SIGNALS:
void changed(bool);
};
......
......@@ -2,76 +2,27 @@
<ui version="4.0">
<class>EmailClientConfig_UI</class>
<widget class="QWidget" name="EmailClientConfig_UI">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<height>148</height>
</rect>
</property>
<layout class="QVBoxLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QRadioButton" name="kmailCB">
<property name="whatsThis">
<string>Kmail is the standard Mail program for the Plasma desktop.</string>
</property>
<property name="text">
<string>&amp;Use KMail as preferred email client</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="otherCB">
<property name="whatsThis">
<string>Select this option if you want to use any other mail program.</string>
</property>
<property name="text">
<string>Use a different &amp;email client:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="KLineEdit" name="txtEMailClient">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Optional placeholders: &lt;ul&gt; &lt;li&gt;%t: Recipient's address&lt;/li&gt; &lt;li&gt;%s: Subject&lt;/li&gt; &lt;li&gt;%c: Carbon Copy (CC)&lt;/li&gt; &lt;li&gt;%b: Blind Carbon Copy (BCC)&lt;/li&gt; &lt;li&gt;%B: Template body text&lt;/li&gt; &lt;li&gt;%A: Attachment &lt;/li&gt; &lt;li&gt;%u: Full mailto: URL &lt;/li&gt;&lt;/ul&gt;</string>
</property>
<property name="whatsThis">
<string>Press this button to select your favorite email client. Please note that the file you select has to have the executable attribute set in order to be accepted.&lt;br/&gt; You can also use several placeholders which will be replaced with the actual values when the email client is called:&lt;ul&gt; &lt;li&gt;%t: Recipient's address&lt;/li&gt; &lt;li&gt;%s: Subject&lt;/li&gt; &lt;li&gt;%c: Carbon Copy (CC)&lt;/li&gt; &lt;li&gt;%b: Blind Carbon Copy (BCC)&lt;/li&gt; &lt;li&gt;%B: Template body text&lt;/li&gt; &lt;li&gt;%A: Attachment &lt;/li&gt; &lt;/ul&gt;</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnSelectEmail">
<property name="enabled">
<bool>false</bool>
</property>
<property name="whatsThis">
<string>Click here to browse for the mail program file.</string>
</property>
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
......@@ -91,17 +42,7 @@
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkRunTerminal">
<property name="enabled">
<bool>false</bool>
</property>
<property name="whatsThis">
<string>Activate this option if you want the selected email client to be executed in a terminal (e.g. &lt;em&gt;Konsole&lt;/em&gt;).</string>
</property>
<property name="text">
<string>&amp;Run in terminal</string>
</property>
</widget>
<widget class="QComboBox" name="emailClientsCombo"/>
</item>
</layout>
</item>
......@@ -123,62 +64,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header location="global">KLineEdit</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>otherCB</sender>
<signal>toggled(bool)</signal>
<receiver>chkRunTerminal</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>otherCB</sender>
<signal>toggled(bool)</signal>
<receiver>txtEMailClient</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
<connection>
<sender>otherCB</sender>
<signal>toggled(bool)</signal>
<receiver>btnSelectEmail</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>20</x>
<y>20</y>
</hint>
<hint type="destinationlabel">
<x>20</x>
<y>20</y>
</hint>
</hints>
</connection>
</connections>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment