Move chiasmuskeyselector in messageviewer

svn path=/branches/work/akonadi-ports/kdepim/; revision=1053146
wilder-work
Laurent Montel 17 years ago
parent d149db9116
commit 1ea1ddcaf7
  1. 1
      CMakeLists.txt
  2. 73
      chiasmuskeyselector.cpp
  3. 31
      chiasmuskeyselector.h
  4. 1
      kmcommands.cpp
  5. 4
      kmcomposewin.cpp

@ -158,7 +158,6 @@ set(kmailprivate_LIB_SRCS
mailinglistpropertiesdialog.cpp
textsource.cpp
#managesievescriptsdialog.cpp
chiasmuskeyselector.cpp
util.cpp
kmmessagetag.cpp
templateparser.cpp

@ -1,73 +0,0 @@
#include "chiasmuskeyselector.h"
#include <KLineEdit>
#include <KListWidget>
#include <KLocale>
#include <KPushButton>
#include <QLayout>
#include <QLabel>
#include <QVBoxLayout>
ChiasmusKeySelector::ChiasmusKeySelector( QWidget* parent, const QString& caption,
const QStringList& keys, const QString& currentKey,
const QString& lastOptions )
: KDialog( parent )
{
setCaption( caption );
setButtons( Ok | Cancel );
setObjectName( "chiasmusKeySelector" );
QWidget *page = new QWidget( this );
setMainWidget(page);
QVBoxLayout *layout = new QVBoxLayout(page);
layout->setSpacing(KDialog::spacingHint());
mLabel = new QLabel( i18n( "Please select the Chiasmus key file to use:" ), page );
layout->addWidget( mLabel );
mListBox = new KListWidget( page );
mListBox->addItems( keys );
const int current = keys.indexOf( currentKey );
mListBox->setCurrentRow( qMax( 0, current ) );
mListBox->scrollToItem( mListBox->item( qMax( 0, current ) ) );
layout->addWidget( mListBox, 1 );
QLabel* optionLabel = new QLabel( i18n( "Additional arguments for chiasmus:" ), page );
layout->addWidget( optionLabel );
mOptions = new KLineEdit( lastOptions, page );
optionLabel->setBuddy( mOptions );
layout->addWidget( mOptions );
layout->addStretch();
connect( mListBox, SIGNAL( itemDoubleClicked( QListWidgetItem * ) ), this, SLOT( accept() ) );
connect( mListBox, SIGNAL( itemSelectionChanged() ), this, SLOT( slotItemSelectionChanged() ) );
slotItemSelectionChanged();
mListBox->setFocus();
}
void ChiasmusKeySelector::slotItemSelectionChanged()
{
button( Ok )->setEnabled( mListBox->selectedItems().size() > 0 );
}
QString ChiasmusKeySelector::key() const
{
if (mListBox->selectedItems().size() > 0) {
return mListBox->currentItem()->text();
} else {
return QString();
}
}
QString ChiasmusKeySelector::options() const
{
return mOptions->text();
}
#include "chiasmuskeyselector.moc"

@ -1,31 +0,0 @@
#ifndef CHIASMUSKEYSELECTOR_H
#define CHIASMUSKEYSELECTOR_H
#include <kdialog.h>
#include <QLabel>
class KListWidget;
class KLineEdit;
class QLabel;
class ChiasmusKeySelector : public KDialog
{
Q_OBJECT
public:
ChiasmusKeySelector( QWidget* parent, const QString& caption,
const QStringList& keys, const QString& currentKey,
const QString& lastOptions );
QString key() const;
QString options() const;
private Q_SLOTS:
void slotItemSelectionChanged();
private:
QLabel* mLabel;
KListWidget* mListBox;
KLineEdit* mOptions;
};
#endif

@ -90,7 +90,6 @@ using KMail::ActionScheduler;
#include "messageviewer/csshelper.h"
using KMail::ObjectTreeParser;
//using KMail::FolderJob;
#include "chiasmuskeyselector.h"
#include "messageviewer/mailsourceviewer.h"
using namespace MessageViewer;
#include "kmreadermainwin.h"

@ -65,7 +65,7 @@ using MailTransport::Transport;
#include "attachmentcontroller.h"
#include "attachmentmodel.h"
#include "attachmentview.h"
#include "chiasmuskeyselector.h"
#include "messageviewer/chiasmuskeyselector.h"
#include "codecaction.h"
#include "kleo_util.h"
#include "kmcommands.h"
@ -4096,7 +4096,7 @@ void KMComposeWin::slotEncryptChiasmusToggled( bool on )
return;
}
ChiasmusKeySelector selectorDlg( this, i18n( "Chiasmus Encryption Key Selection" ),
MessageViewer::ChiasmusKeySelector selectorDlg( this, i18n( "Chiasmus Encryption Key Selection" ),
keys, GlobalSettings::chiasmusKey(),
GlobalSettings::chiasmusOptions() );

Loading…
Cancel
Save