Commit 7e38acac authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 342593 - During address completion, cannot exclude 'recent addresses'

FIXED-IN: 14.12.1
BUG: 342593
parent 0f5b1b4d
......@@ -369,6 +369,17 @@ ComposerPageGeneralTab::ComposerPageGeneralTab( QWidget * parent )
groupGridLayout->setRowMinimumHeight( row, KDialog::spacingHint() );
++row;
// "Use Baloo seach in composer" checkbox
mShowBalooSearchAddressesInComposer = new QCheckBox(
MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposerItem()->label(),
this);
connect( mShowBalooSearchAddressesInComposer, SIGNAL(stateChanged(int)),
this, SLOT(slotEmitChanged()) );
groupGridLayout->addWidget( mShowBalooSearchAddressesInComposer, row, 0, 1, -1 );
++row;
#ifdef KDEPIM_ENTERPRISE_BUILD
// "Warn if too many recipients" checkbox/spinbox
mRecipientCheck = new QCheckBox(
......@@ -520,7 +531,7 @@ void ComposerPage::GeneralTab::doResetToDefaultsOther()
const bool showRecentAddress = MessageComposer::MessageComposerSettings::self()->showRecentAddressesInComposer();
const int maximumRecipient = MessageComposer::MessageComposerSettings::self()->maximumRecipients();
const bool improvePlainText = MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessage();
const bool showBalooSearchInComposer = MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposer();
MessageComposer::MessageComposerSettings::self()->useDefaults( bUseDefaults );
mAutoAppSignFileCheck->setChecked( autoAppSignFile );
......@@ -531,6 +542,7 @@ void ComposerPage::GeneralTab::doResetToDefaultsOther()
mWrapColumnSpin->setValue( wrapColumn );
mMaximumRecipients->setValue( maximumRecipient );
mShowRecentAddressesInComposer->setChecked( showRecentAddress );
mShowBalooSearchAddressesInComposer->setChecked(showBalooSearchInComposer);
mImprovePlainTextOfHtmlMessage->setChecked(improvePlainText);
mMaximumRecentAddress->setValue( 40 );
......@@ -556,6 +568,7 @@ void ComposerPage::GeneralTab::doLoadFromGlobalSettings()
loadWidget(mMaximumRecipients, MessageComposer::MessageComposerSettings::self()->maximumRecipientsItem() );
mAutoSave->setValue( GlobalSettings::self()->autosaveInterval() );
loadWidget(mShowRecentAddressesInComposer, MessageComposer::MessageComposerSettings::self()->showRecentAddressesInComposerItem() );
loadWidget(mShowBalooSearchAddressesInComposer, MessageComposer::MessageComposerSettings::self()->showBalooSearchInComposerItem() );
mImprovePlainTextOfHtmlMessage->setChecked(MessageComposer::MessageComposerSettings::self()->improvePlainTextOfHtmlMessage());
#ifdef KDEPIM_ENTERPRISE_BUILD
......@@ -589,6 +602,7 @@ void ComposerPage::GeneralTab::save() {
saveSpinBox(mMaximumRecipients, MessageComposer::MessageComposerSettings::self()->maximumRecipientsItem() );
GlobalSettings::self()->setAutosaveInterval( mAutoSave->value() );
MessageComposer::MessageComposerSettings::self()->setShowRecentAddressesInComposer( mShowRecentAddressesInComposer->isChecked() );
MessageComposer::MessageComposerSettings::self()->setShowBalooSearchInComposer( mShowBalooSearchAddressesInComposer->isChecked() );
MessageComposer::MessageComposerSettings::self()->setImprovePlainTextOfHtmlMessage( mImprovePlainTextOfHtmlMessage->isChecked() );
#ifdef KDEPIM_ENTERPRISE_BUILD
GlobalSettings::self()->setTooManyRecipients( mRecipientCheck->isChecked() );
......
......@@ -64,6 +64,7 @@ private:
void doResetToDefaultsOther();
private:
QCheckBox *mShowBalooSearchAddressesInComposer;
QCheckBox *mAutoAppSignFileCheck;
QCheckBox *mTopQuoteCheck;
QCheckBox *mDashDashCheck;
......
......@@ -336,8 +336,6 @@ void AddresseeLineEdit::Private::init()
KConfigGroup group( KGlobal::config(), "AddressLineEdit" );
m_showOU = group.readEntry( "ShowOU", false );
m_enableBalooSearch = group.readEntry( "EnabledBalooSearch", true );
}
}
......@@ -1040,6 +1038,11 @@ void AddresseeLineEdit::setFont( const QFont &font )
}
}
void AddresseeLineEdit::setEnableBalooSearch(bool enable)
{
d->m_enableBalooSearch = enable;
}
void AddresseeLineEdit::allowSemicolonAsSeparator( bool useSemicolonAsSeparator )
{
d->m_useSemicolonAsSeparator = useSemicolonAsSeparator;
......
......@@ -79,6 +79,9 @@ public:
* Reimplemented for setting the @p font for line edit and completion box.
*/
void setFont( const QFont &font );
void setEnableBalooSearch(bool enable);
Q_SIGNALS:
void textCompleted();
......
......@@ -56,6 +56,7 @@ ComposerLineEdit::ComposerLineEdit(bool useCompletion, QWidget *parent)
{
allowSemicolonAsSeparator( MessageComposerSettings::allowSemicolonAsAddressSeparator() );
loadContacts();
setEnableBalooSearch( MessageComposerSettings::showBalooSearchInComposer() );
}
......@@ -227,8 +228,6 @@ void ComposerLineEdit::editRecentAddresses()
//-----------------------------------------------------------------------------
void ComposerLineEdit::loadContacts()
{
//AddresseeLineEdit::loadContacts();
const QString recentAddressGroupName = i18n( "Recent Addresses" );
if ( MessageComposerSettings::self()->showRecentAddressesInComposer() ){
const QStringList recent =
......
......@@ -60,6 +60,12 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<default>true</default>
</entry>
<entry name="ShowBalooSearchInComposer" type="Bool" key="showBalooSearchInComposer">
<label>Use Baloo search for autocompletion</label>
<whatsthis>Disable this option if you do not want baloo search addresses to appear in the autocompletion list in the composer's address fields.</whatsthis>
<default>true</default>
</entry>
<entry name="AllowSemicolonAsAddressSeparator" type="Bool">
<default>${ALLOW_SEMICOLON_AS_ADDRESS_SEPARATOR_DEFAULT}</default>
<label>Allow the semicolon character (';') to be used as separator in the message composer</label>
......
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