Le Thursday 25 November 2010, Thomas Olsen a écrit :
> Hi
> 
> I'm trying to add the Notification Config to my Plasma Applets settings.
> 
> It's getting embedded just fine if I use (in Python):
> 
>     def createConfigurationInterface(self, dialog):
> 
>         # Get a proxy to the KCM
>         self.notify_widget = KCModuleProxy("kcmnotify", dialog,
> ["currency-converter",]) # Get the module
>         real_module = self.notify_widget.realModule()
>         print "Module: " + str(real_module)
>         p = dialog.addPage(self.notify_widget, i18n("Notifications") )
>         p.setIcon( KIcon("dialog-information") )
> 
> But I have found no way of specifying which app it should load
> notifications for. Tried to add it to the args to no avail.
> 
> Basically I just wan't a KNotifyConfigElement [*] but I see no way to
> access that.
> 
> Any ideas?


You indeed need to use KNotifyWidget, preferably in a KDialog. 
Something like (in C++, because i can't write python)

KDialog *dlg = new KDialog;
KNotifyConfigWidget *notifyWidget = new KNotifyConfigWidget(dialog);
//by default, the application is set automatically to the current application
dlg->setMainWidget(notifyWidget);
connect(dlg, SIGNAL(accepted()), notifyWidget, SLOT(save()));
dlg->show();


But there is a convinience function to do that it is just to call
KNotifyConfigWidget::configure();


You need to link against knotifyconfig library. And hopefully there is python 
bindings for that.



 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to