[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-docbook
Subject:    KDE/kdenetwork/kopete/plugins/cryptography
From:       Charles Connell <charles () connells ! org>
Date:       2007-07-18 15:13:34
Message-ID: 1184771614.597389.4552.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 689558 by cconnell:

Warn user if they are about to use a protocol unfriendly with encryption
Cleanup includes
Delete unneeded files
GUI:


 M  +0 -4      CMakeLists.txt  
 M  +14 -5     cryptographyguiclient.cpp  
 M  +0 -1      cryptographyguiclient.h  
 M  +8 -7      cryptographyplugin.cpp  
 M  +4 -3      cryptographyplugin.h  
 M  +1 -5      gpginterface.cpp  
 D             icons (directory)  
 M  +1 -0      popuppublic.cpp  
 M  +33 -34    popuppublic.h  
 D             selectkeydialog.cpp  
 D             selectkeydialog.h  


--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/CMakeLists.txt #689557:689558
@@ -13,7 +13,6 @@
    cryptographyguiclient.cpp 
    cryptographyselectuserkey.cpp 
    popuppublic.cpp 
-   selectkeydialog.cpp
    cryptographyconfig.cpp )
 
 kde4_add_ui_files(kopete_cryptography_PART_SRCS 
@@ -22,7 +21,6 @@
 
 kde4_add_plugin(kopete_cryptography ${kopete_cryptography_PART_SRCS})
 
-
 target_link_libraries(kopete_cryptography  ${KDE4_KDECORE_LIBS} \
${KDE4_KDE3SUPPORT_LIBS} kopete )  
 install(TARGETS kopete_cryptography  DESTINATION ${PLUGIN_INSTALL_DIR})
@@ -34,10 +32,8 @@
 
 kde4_add_ui_files(kcm_kopete_cryptography_PART_SRCS cryptographyprefsbase.ui )
 
-
 kde4_add_plugin(kcm_kopete_cryptography ${kcm_kopete_cryptography_PART_SRCS})
 
-
 target_link_libraries(kcm_kopete_cryptography ${KDE4_KUTILS_LIBS} kopete kleo-gpl )
 
 install(TARGETS kcm_kopete_cryptography  DESTINATION ${PLUGIN_INSTALL_DIR})
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/cryptographyguiclient.cpp \
#689557:689558 @@ -17,14 +17,14 @@
 #include "cryptographyguiclient.h"
 #include "cryptographyplugin.h"
 
-
 #include "kopetemetacontact.h"
 #include "kopetecontact.h"
 #include "kopetechatsession.h"
 #include "kopeteview.h"
+#include "kopeteuiglobal.h"
+#include "kopeteprotocol.h"
 
 #include <kaction.h>
-#include <kconfig.h>
 #include <klocale.h>
 #include <kgenericfactory.h>
 #include <kicon.h>
@@ -110,18 +110,27 @@
 			keyless.append(mc->displayName());
 	}
 
+	if ( m_encAction->isChecked() )
+	{
+		QString protocol ( csn->protocol()->metaObject()->className());
+		if ( m_encAction->isChecked() )
+			if ( ! CryptographyPlugin::supportedProtocols().contains (protocol) )
+				if (KMessageBox::warningYesNo ( 0L, i18n ("This protocol may not work with \
messages that are encrypted. Do you still want to encrypt messages?"), i18n \
("Cryptography Plugin"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "Dont warn \
about unsupported protocols") == KMessageBox::No ) +					m_encAction->setChecked \
(false); +		
+	}
+	
 	if( m_encAction->isChecked() && !keyless.isEmpty() )
 	{
 		QWidget *w = 0;
 		if ( csn->view() )
 			w = csn->view()->mainWidget();
 
-		KMessageBox::sorry( w,
-							i18np("To send encrypted messages to %2, you still need to select a public \
key for this contact.", "To send encrypted messages to them, you still need to select \
a public key for each of these contacts:\n%2", keyless.count() , keyless.join( "\n" ) \
                ),
-							i18np( "Missing public key", "Missing public keys", keyless.count() ) );
+		KMessageBox::sorry( w, i18np("To send encrypted messages to %2, you still need to \
select a public key for this contact.", "To send encrypted messages to them, you \
still need to select a public key for each of these contacts:\n%2", keyless.count() , \
keyless.join( "\n" ) ), i18np( "Missing public key", "Missing public keys", \
keyless.count() ) );  
 		m_encAction->setChecked( false );
 	}
+	
 
         if (first)
             first->setPluginData( CryptographyPlugin::plugin() , "encrypt_messages" \
                ,
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/cryptographyguiclient.h \
#689557:689558 @@ -37,7 +37,6 @@
 	bool signing() { return m_signAction->isChecked(); }
 	bool encrypting() { return m_encAction->isChecked(); }
 
-private:
 	KToggleAction *m_encAction;
 	KToggleAction *m_signAction;
 
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/cryptographyplugin.cpp \
#689557:689558 @@ -15,18 +15,13 @@
     ***************************************************************************
 */
 
-#include <QTextDocument>
-#include <qtimer.h>
-#include <qregexp.h>
 #include <QList>
+#include <QTimer>
 
 #include <kdebug.h>
 #include <kaction.h>
-#include <kconfig.h>
 #include <kgenericfactory.h>
-#include <kdeversion.h>
 #include <kaboutdata.h>
-#include <kicon.h>
 #include <kiconloader.h>
 #include <kmessagebox.h>
 #include <kpassworddialog.h>
@@ -38,6 +33,7 @@
 #include "kopetesimplemessagehandler.h"
 #include "kopeteuiglobal.h"
 #include "kopetecontact.h"
+#include "kopeteprotocol.h"
 
 #include "cryptographyplugin.h"
 #include "cryptographyselectuserkey.h"
@@ -52,7 +48,6 @@
 //In Jabber, the JEP says it's not. so we don't use richtext in our message, but \
some client did.  //We limit the html to some basis tag to limit security problem \
(bad links)  //    - Olivier
-const QRegExp CryptographyPlugin::isHTML ( QString::fromLatin1 ( \
"^[^<>]*(</?(html|body|br|p|font|center|b|i|u|span|div|pre)(>|[\\s/][^><]*>)[^><]*)+$" \
) , Qt::CaseInsensitive );  
 typedef KGenericFactory<CryptographyPlugin> CryptographyPluginFactory;
 static const KAboutData aboutdata ( "kopete_cryptography", 0, ki18n ( "Cryptography" \
) , "1.1" ); @@ -263,6 +258,12 @@
 {
 	connect ( this , SIGNAL ( destroyed ( QObject* ) ) ,
 	          mGui = new CryptographyGUIClient ( KMM ) , SLOT ( deleteLater() ) );
+	
+	QString protocol (KMM->protocol()->metaObject()->className());
+	if ( mGui->m_encAction->isChecked() )
+		if ( ! supportedProtocols().contains (protocol) )
+			if (KMessageBox::warningYesNo ( 0L, i18n ("This protocol may not work with \
messages that are encrypted. Do you still want to encrypt messages?"), i18n \
("Cryptography Plugin"), KStandardGuiItem::yes(), KStandardGuiItem::no(), "Dont warn \
about unsupported protocols") == KMessageBox::No ) +				mGui->m_encAction->setChecked \
(false);  }
 
 #include "cryptographyplugin.moc"
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/cryptographyplugin.h \
#689557:689558 @@ -15,8 +15,8 @@
     ***************************************************************************
 */
 
-#ifndef CryptographyPLUGIN_H
-#define CryptographyPLUGIN_H
+#ifndef CRYPTOGRAPHYPLUGIN_H
+#define CRYPTOGRAPHYPLUGIN_H
 
 
 #include "kopeteplugin.h"
@@ -48,7 +48,8 @@
 	static CryptographyPlugin  *plugin();
 	static QString cachedPass();
 	static void setCachedPass(const QString &pass);
-	static const QRegExp isHTML;
+	
+	static QStringList supportedProtocols() { QStringList l; return l << "MSNProtocol" \
<< "MessengerProtocol" << "JabberProtocol"; }  
 	CryptographyPlugin( QObject *parent, const QStringList &args );
 	~CryptographyPlugin();
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/gpginterface.cpp #689557:689558
@@ -20,12 +20,8 @@
 
 
 #include <klocale.h>
-#include <KDE/KPasswordDialog>
+#include <KPasswordDialog>
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
 #include <QProcess>
 
 #include <ktemporaryfile.h>
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/popuppublic.cpp #689557:689558
@@ -24,6 +24,7 @@
 #include <KIconLoader>
 #include <KActionCollection>
 #include <KAction>
+#include <QPixmap>
 #include "popuppublic.h"
 #include "ui_popuppublicbase.h"
 #include "gpginterface.h"
--- trunk/KDE/kdenetwork/kopete/plugins/cryptography/popuppublic.h #689557:689558
@@ -22,7 +22,6 @@
 
 #include <KDialog>
 #include <KShortcut>
-#include <QPixmap>
 
 namespace Ui
 {
@@ -34,44 +33,44 @@
 
 class PopupPublic : public KDialog
 {
-        Q_OBJECT
-public:
+		Q_OBJECT
+	public:
 
-        explicit PopupPublic(QWidget *parent = 0, const KShortcut& \
                goDefaultKey=KShortcut(QKeySequence(Qt::CTRL+Qt::Key_Home)));
-	~PopupPublic();
-        bool trusted;
-        QPixmap keyPair;
-	QPixmap keySingle;
-	QPixmap keyGroup;
-        QString seclist;
-	QStringList untrustedList;
+		explicit PopupPublic ( QWidget *parent = 0, const KShortcut& \
goDefaultKey=KShortcut ( QKeySequence ( Qt::CTRL+Qt::Key_Home ) ) ); \
+		~PopupPublic(); +		bool trusted;
+		QPixmap keyPair;
+		QPixmap keySingle;
+		QPixmap keyGroup;
+		QString seclist;
+		QStringList untrustedList;
 
-private:
-        KConfig *config;
-        QString customOptions;
-	Ui::PopupPublicBase *ui;
+	private:
+		KConfig *config;
+		QString customOptions;
+		Ui::PopupPublicBase *ui;
 
-private slots:
-        void customOpts(const QString &);
-        void slotprocread(K3ProcIO *);
-        void slotpreselect();
-        void refreshkeys();
-        void refresh(bool state);
-        void sort();
-        void enable();
-	void slotGotoDefaultKey();
-	
-public slots:
-void slotAccept();
-void slotSetVisible();
+	private slots:
+		void customOpts ( const QString & );
+		void slotprocread ( K3ProcIO * );
+		void slotpreselect();
+		void refreshkeys();
+		void refresh ( bool state );
+		void sort();
+		void enable();
+		void slotGotoDefaultKey();
 
-protected slots:
-virtual void slotOk();
-	
-signals:
-        void selectedKey(const QString & ,QString,bool,bool);
-	void keyListFilled();
+	public slots:
+		void slotAccept();
+		void slotSetVisible();
 
+	protected slots:
+		virtual void slotOk();
+
+	signals:
+		void selectedKey ( const QString & ,QString,bool,bool );
+		void keyListFilled();
+
 };
 
 #endif // POPUPPUBLIC_H
_______________________________________________
kde-docbook mailing list
kde-docbook@kde.org
https://mail.kde.org/mailman/listinfo/kde-docbook


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic