• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

mailtransport

  • sources
  • kde-4.14
  • kdepimlibs
  • mailtransport
sendmailconfigwidget.cpp
1 /*
2  Copyright (c) 2013 Laurent Montel <montel@kde.org>
3  Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
4 
5  Based on MailTransport code by:
6  Copyright (c) 2006 - 2007 Volker Krause <vkrause@kde.org>
7  Copyright (c) 2007 KovoKs <kovoks@kovoks.nl>
8 
9  Based on KMail code by:
10  Copyright (c) 2001-2002 Michael Haeckel <haeckel@kde.org>
11 
12  This library is free software; you can redistribute it and/or modify it
13  under the terms of the GNU Library General Public License as published by
14  the Free Software Foundation; either version 2 of the License, or (at your
15  option) any later version.
16 
17  This library is distributed in the hope that it will be useful, but WITHOUT
18  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
20  License for more details.
21 
22  You should have received a copy of the GNU Library General Public License
23  along with this library; see the file COPYING.LIB. If not, write to the
24  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25  02110-1301, USA.
26 */
27 
28 #include "sendmailconfigwidget.h"
29 #include "transportconfigwidget_p.h"
30 #include "ui_sendmailsettings.h"
31 
32 #include <KStandardDirs>
33 #include <KLineEdit>
34 
35 using namespace MailTransport;
36 
37 class MailTransport::SendmailConfigWidgetPrivate : public TransportConfigWidgetPrivate
38 {
39  public:
40  ::Ui::SendmailSettings ui;
41 
42 };
43 
44 SendmailConfigWidget::SendmailConfigWidget( Transport *transport, QWidget *parent )
45  : TransportConfigWidget( *new SendmailConfigWidgetPrivate, transport, parent )
46 {
47  init();
48 }
49 
50 SendmailConfigWidget::SendmailConfigWidget( SendmailConfigWidgetPrivate &dd,
51  Transport *transport, QWidget *parent )
52  : TransportConfigWidget( dd, transport, parent )
53 {
54  init();
55 }
56 
57 void SendmailConfigWidget::init()
58 {
59  Q_D( SendmailConfigWidget );
60 
61  d->ui.setupUi( this );
62  d->ui.kcfg_host->setMode( KFile::File|KFile::ExistingOnly|KFile::LocalOnly );
63  d->ui.kcfg_host->setFocus();
64  d->manager->addWidget( this ); // otherwise it doesn't find out about these widgets
65  d->manager->updateWidgets();
66 
67  if ( d->ui.kcfg_host->url().isEmpty() ) {
68  // Locate sendmail.
69  // This is imperfect, because it shows the standard path if an empty path
70  // is saved in the config.
71  d->ui.kcfg_host->setText( KStandardDirs::findExe( QLatin1String( "sendmail" ) ) );
72  }
73  connect( d->ui.kcfg_host->lineEdit(), SIGNAL(textChanged(QString)),
74  SLOT(slotTextChanged(QString)) );
75  slotTextChanged( d->ui.kcfg_host->text() );
76 }
77 
78 void SendmailConfigWidget::slotTextChanged( const QString &text )
79 {
80  Q_EMIT enableButtonOk( !text.isEmpty() );
81 }
82 
83 bool SendmailConfigWidget::pathIsEmpty() const
84 {
85  Q_D( const SendmailConfigWidget );
86  return d->ui.kcfg_host->text().isEmpty();
87 }
QWidget
MailTransport::SendmailConfigWidget
Definition: sendmailconfigwidget.h:44
QString::isEmpty
bool isEmpty() const
QString
MailTransport::TransportConfigWidget
Definition: transportconfigwidget.h:59
QLatin1String
MailTransport::TransportConfigWidgetPrivate
Definition: transportconfigwidget_p.h:32
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
MailTransport::Transport
Represents the settings of a specific mail transport.
Definition: transport.h:50
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

mailtransport

Skip menu "mailtransport"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal