[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-pim
Subject: Re: [Kde-pim] [PATCH] Add knode's "post article" action to kontacts
From: Don Sanders <sanders () kde ! org>
Date: 2003-12-31 4:43:34
Message-ID: 200312311443.34241.sanders () kde ! org
[Download RAW message or body]
On Wednesday 24 December 2003 02:15, Volker Krause wrote:
> Hi,
>
> knode doesn't show it's "post article" action in the toolbar when
> running in kontact. Beside that not having such a basic action in
> the toolbar is rather inconvenient, it gets even more confusing
> since there is a "new mail" item at the same place. So I see this
> more as a bug than a missing feature.
>
> The attached patch adds knode's "post article" action to the "new"
> list in kontact's toolbar. The code is mostly taken from the kmail
> plugin.
>
> The patch adds one string which is exactly copied from knode, so I
> hope this is not a problem.
>
> Please let me know if I can commit.
I'm not a KNode developer, but Volker wrote a good patch for KMail
that fixed a similar problem.
Don.
["knodeplugin_newaction.diff" (text/x-diff)]
? knodeplugin_newaction.diff
Index: Makefile.am
===================================================================
RCS file: /home/kde/kdepim/kontact/plugins/knode/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- Makefile.am 13 Aug 2003 13:14:47 -0000 1.2
+++ Makefile.am 23 Dec 2003 16:15:16 -0000
@@ -4,11 +4,11 @@
libkontact_knodeplugin_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN)
libkontact_knodeplugin_la_LIBADD = $(top_builddir)/kontact/interfaces/libkpinterfaces.la $(LIB_KPARTS)
-libkontact_knodeplugin_la_SOURCES = knode_plugin.cpp
+libkontact_knodeplugin_la_SOURCES = knode_plugin.cpp knodeiface.stub
METASOURCES = AUTO
servicedir = $(kde_servicesdir)/kontact
service_DATA = knodeplugin.desktop
-knodeIface_DIR = $(top_srcdir)/knode
+knodeiface_DIR = $(top_srcdir)/knode
Index: knode_plugin.cpp
===================================================================
RCS file: /home/kde/kdepim/kontact/plugins/knode/knode_plugin.cpp,v
retrieving revision 1.6
diff -u -r1.6 knode_plugin.cpp
--- knode_plugin.cpp 1 Dec 2003 22:11:52 -0000 1.6
+++ knode_plugin.cpp 23 Dec 2003 16:15:17 -0000
@@ -44,11 +44,13 @@
KNodePlugin::KNodePlugin( Kontact::Core *core, const char *, const QStringList& )
- : Kontact::Plugin( core, core, "knode" )
+ : Kontact::Plugin( core, core, "knode" ), mStub(0)
{
setInstance( KNodePluginFactory::instance() );
-}
+ insertNewAction( new KAction( i18n( "&Post to Newsgroup..." ), BarIcon( "mail_new" ),
+ 0, this, SLOT( slotPostArticle() ), actionCollection(), "post_article" ) );
+}
KNodePlugin::~KNodePlugin()
{
@@ -73,9 +75,21 @@
return QStringList( "article_postNew" );
}
+void KNodePlugin::slotPostArticle()
+{
+ (void) part(); // ensure part is loaded
+ Q_ASSERT( mStub );
+ if ( mStub )
+ mStub->postArticle();
+}
+
KParts::Part* KNodePlugin::createPart()
{
- return loadPart();
+ KParts::Part *part = loadPart();
+ if ( !part ) return 0;
+
+ mStub = new KNodeIface_stub( dcopClient(), "knode", "KNodeIface" );
+ return part;
}
#include "knode_plugin.moc"
Index: knode_plugin.h
===================================================================
RCS file: /home/kde/kdepim/kontact/plugins/knode/knode_plugin.h,v
retrieving revision 1.6
diff -u -r1.6 knode_plugin.h
--- knode_plugin.h 1 Dec 2003 22:11:52 -0000 1.6
+++ knode_plugin.h 23 Dec 2003 16:15:17 -0000
@@ -27,6 +27,7 @@
#include <klocale.h>
#include <kparts/part.h>
+#include "knodeiface_stub.h"
#include "plugin.h"
class KNodePlugin : public Kontact::Plugin
@@ -44,6 +45,12 @@
protected:
virtual KParts::Part* createPart();
+
+ protected slots:
+ void slotPostArticle();
+
+ private:
+ KNodeIface_stub *mStub;
};
#endif
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic