Commit 97358d33 authored by Volker Krause's avatar Volker Krause

And finally extract the recipients editor itself, for reuse in

kmail-mobile.

svn path=/trunk/KDE/kdepim/kmail/; revision=1125525
parent b17184cc
......@@ -118,8 +118,6 @@ set(kmailprivate_LIB_SRCS
redirectdialog.cpp
foldershortcutdialog.cpp
folderrequester.cpp
recipientseditor.cpp
kwindowpositioner.cpp
expirypropertiesdialog.cpp
mailinglistpropertiesdialog.cpp
managesievescriptsdialog.cpp
......
......@@ -38,7 +38,6 @@
#include "kmreadermainwin.h"
//#include "mailcomposeradaptor.h" // TODO port all D-Bus stuff...
#include "objecttreeparser.h"
#include "recipientseditor.h"
#include "messageviewer/stl_util.h"
#include "messageviewer/util.h"
#include "messagecore/stringutil.h"
......@@ -72,6 +71,7 @@
#include <messagecomposer/signaturecontroller.h>
#include <messagecomposer/inserttextfilejob.h>
#include <messagecomposer/composerlineedit.h>
#include <messagecomposer/recipientseditor.h>
#include <messagecore/attachmentpart.h>
#include "messagecore/globalsettings.h"
#include <templateparser/templateparser.h>
......@@ -259,7 +259,7 @@ KMComposeWin::KMComposeWin( const KMime::Message::Ptr &aMsg, Composer::TemplateC
connect( mEdtReplyTo, SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
SLOT(slotCompletionModeChanged(KGlobalSettings::Completion)) );
mRecipientsEditor = new RecipientsEditor( mHeadersArea );
mRecipientsEditor = new MessageComposer::RecipientsEditor( mHeadersArea );
mRecipientsEditor->setRecentAddressConfig( KMKernel::config().data() );
connect( mRecipientsEditor,
SIGNAL( completionModeChanged( KGlobalSettings::Completion ) ),
......
......@@ -69,7 +69,6 @@ class KTempDir;
class KToggleAction;
class KUrl;
class KRecentFilesAction;
class RecipientsEditor;
class SnippetWidget;
namespace boost {
......@@ -114,6 +113,7 @@ namespace Message {
namespace MessageComposer
{
class ComposerLineEdit;
class RecipientsEditor;
}
namespace MailTransport{
......@@ -795,7 +795,7 @@ class KMComposeWin : public KMail::Composer
int mPendingQueueJobs;
int mPendingCreateItemJobs;
RecipientsEditor *mRecipientsEditor;
MessageComposer::RecipientsEditor *mRecipientsEditor;
int mLabelWidth;
QTimer *mAutoSaveTimer;
......
......@@ -38,16 +38,6 @@ kde4_add_executable(dbustest TEST ${dbustest_SRCS})
add_dependencies(dbustest kmail_xml)
target_link_libraries(dbustest ${KDE4_KIO_LIBS})
########### recipientseditor test ###############
set(recipienteditortest_SRCS recipientseditortest.cpp)
kde4_add_executable(recipienteditortest TEST ${recipienteditortest_SRCS})
target_link_libraries(recipienteditortest ${KDE4_KIO_LIBS} ${KDEPIMLIBS_AKONADI_KCAL_LIBS} kmailprivate kdepim)
###### TODO port storagelayer tests to QTestLib
#kunittest_storagelayermodule_la_SOURCES = storagelayermodule.cpp messagedicttests.cpp ../kmdict.cpp
......
......@@ -41,6 +41,8 @@ set( messagecomposer_src
recipient.cpp
distributionlistdialog.cpp
recipientspicker.cpp
recipientseditor.cpp
kwindowpositioner.cpp
)
if(KDEPIM_ENTERPRISE_BUILD)
......
......@@ -30,8 +30,7 @@ class QTreeWidget;
namespace MessageComposer {
// ### temporary, remove export once RecipientEditors extraction is complete
class MESSAGECOMPOSER_EXPORT DistributionListDialog : public KDialog
class DistributionListDialog : public KDialog
{
Q_OBJECT
public:
......
/*
This file is part of KMail.
Copyright (c) 2010 Volker Krause <vkrause@kde.org>
This file was part of KMail.
Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
......@@ -51,6 +51,8 @@
#include <boost/bind.hpp>
#include <algorithm>
using namespace MessageComposer;
RecipientComboBox::RecipientComboBox( QWidget *parent )
: KComboBox( parent )
{
......@@ -762,7 +764,7 @@ void SideWidget::setTotal( int recipients, int lines )
void SideWidget::updateTotalToolTip()
{
QString text = "<qt>";
QString text = QLatin1String( "<qt>" );
QString to;
QString cc;
......@@ -771,7 +773,7 @@ void SideWidget::updateTotalToolTip()
Recipient::List recipients = mView->recipients();
Recipient::List::ConstIterator it;
for( it = recipients.constBegin(); it != recipients.constEnd(); ++it ) {
QString emailLine = "&nbsp;&nbsp;" + Qt::escape( (*it).email() ) + "<br/>";
QString emailLine = QLatin1String("&nbsp;&nbsp;") + Qt::escape( (*it).email() ) + QLatin1String("<br/>");
switch( (*it).type() ) {
case Recipient::To:
to += emailLine;
......@@ -795,7 +797,7 @@ void SideWidget::updateTotalToolTip()
text += i18nc("@info:tooltip %1 list of emails", "<interface>BCC:</interface><nl/>%1", bcc);
}
text.append( "</qt>" );
text.append( QLatin1String("</qt>") );
mTotalLabel->setToolTip( text );
}
......@@ -903,7 +905,7 @@ QString RecipientsEditor::recipientString( Recipient::Type type )
Recipient::List::ConstIterator it;
for( it = recipients.constBegin(); it != recipients.constEnd(); ++it ) {
if ( (*it).type() == type ) {
if ( !str.isEmpty() ) str += ", ";
if ( !str.isEmpty() ) str += QLatin1String(", ");
str.append( (*it).email() );
}
}
......
/*
This file is part of KMail.
Copyright (c) 2010 Volker Krause <vkrause@kde.org>
This file was part of KMail.
Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
......@@ -21,10 +21,10 @@
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#ifndef RECIPIENTSEDITOR_H
#define RECIPIENTSEDITOR_H
#ifndef MESSAGECOMPOSER_RECIPIENTSEDITOR_H
#define MESSAGECOMPOSER_RECIPIENTSEDITOR_H
#include "kmail_export.h"
#include "messagecomposer_export.h"
#include <kcombobox.h>
......@@ -37,7 +37,6 @@ class KWindowPositioner;
class QLabel;
class QPushButton;
class SideWidget;
namespace KMime {
namespace Types {
......@@ -46,8 +45,9 @@ namespace KMime {
}
namespace MessageComposer {
class RecipientsPicker;
}
class RecipientsPicker;
class SideWidget;
class RecipientComboBox : public KComboBox
{
......@@ -279,7 +279,7 @@ class SideWidget : public QWidget
mutable KWindowPositioner *mPickerPositioner;
};
class KMAIL_EXPORT RecipientsEditor : public QWidget
class MESSAGECOMPOSER_EXPORT RecipientsEditor : public QWidget
{
Q_OBJECT
public:
......@@ -361,4 +361,6 @@ class KMAIL_EXPORT RecipientsEditor : public QWidget
bool mModified;
};
}
#endif
......@@ -77,3 +77,10 @@ set(testkmeditorwin_SRCS testkmeditorwin.cpp )
kde4_add_executable(testkmeditorwin TEST ${testkmeditorwin_SRCS})
target_link_libraries(testkmeditorwin messagecomposer ${KDE4_KDEUI_LIBS} )
########### recipientseditor test ###############
set(recipienteditortest_SRCS recipientseditortest.cpp)
kde4_add_executable(recipienteditortest TEST ${recipienteditortest_SRCS})
target_link_libraries(recipienteditortest ${KDE4_KIO_LIBS} ${KDEPIMLIBS_AKONADI_CONTACT_LIBS} kmailprivate kdepim)
......@@ -23,14 +23,14 @@
*/
#include "recipientseditortest.h"
#include "recipientseditor.h"
#include <messagecomposer/recipientseditor.h>
#include <kapplication.h>
#include <kdebug.h>
#include <klocale.h>
#include <kcmdlineargs.h>
#include <kmessagebox.h>
#include "aboutdata.h"
#include <kaboutdata.h>
#include <QPushButton>
#include <QLayout>
......@@ -39,6 +39,8 @@
#include <QTextEdit>
#include <QGridLayout>
using namespace MessageComposer;
Composer::Composer( QWidget *parent )
: QWidget( parent )
{
......@@ -46,7 +48,7 @@ Composer::Composer( QWidget *parent )
topLayout->setMargin( 4 );
topLayout->setSpacing( 4 );
QLabel *label = new QLabel( "From:", this );
QLabel *label = new QLabel( QLatin1String("From:"), this );
topLayout->addWidget( label, 0, 0 );
QLineEdit *edit = new QLineEdit( this );
topLayout->addWidget( edit, 0, 1 );
......@@ -62,7 +64,7 @@ Composer::Composer( QWidget *parent )
topLayout->addWidget( editor, 2, 0, 1, 2 );
topLayout->setRowStretch( 2, 1 );
QPushButton *button = new QPushButton( "&Close", this );
QPushButton *button = new QPushButton( QLatin1String("&Close"), this );
topLayout->addWidget( button, 3, 0, 1, 2 );
connect( button, SIGNAL( clicked() ), SLOT( slotClose() ) );
}
......
......@@ -26,7 +26,9 @@
#include <QWidget>
namespace MessageComposer {
class RecipientsEditor;
}
class Composer : public QWidget
{
......@@ -36,9 +38,9 @@ class Composer : public QWidget
public slots:
void slotClose();
private:
RecipientsEditor *mRecipients;
MessageComposer::RecipientsEditor *mRecipients;
};
#endif
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