Author: lslezak Date: Wed Mar 4 13:28:16 2009 New Revision: 55917 URL: http://svn.opensuse.org/viewcvs/yast?rev=55917&view=rev Log: - added KDE desktop integration example, see dbus_samba_export.README Added: branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.README branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.desktop branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.py (with props) Added: branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.README URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.README?rev=55917&view=auto ============================================================================== --- branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.README (added) +++ branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.README Wed Mar 4 13:28:16 2009 @@ -0,0 +1,18 @@ + +This example integrates the Yast DBus service into KDE desktop. + +Copy the desktop configuration and the DBus client script using these commands: + +cp dbus_samba_export.desktop /usr/share/kde4/services/ServiceMenus/ +cp dbus_samba_export.py /usr/bin + +If the Samba server has been configured (by the system administrator) users who +have org.opensuse.yast.modules.yapi-samba.addshare PolicyKit authorization can +simply export a directory using Konqueror or Dolphin file manager. + +Just right-click on a folder, select "Actions" -> "Export directory as a Samba +share" and that's it! The exported shares have by default read-only access. + +TODO: Samba service is not reloaded, the added share will be available _after_ +manual reload. + Added: branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.desktop URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.desktop?rev=55917&view=auto ============================================================================== --- branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.desktop (added) +++ branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.desktop Wed Mar 4 13:28:16 2009 @@ -0,0 +1,10 @@ +[Desktop Entry] +X-SuSE-translate=true +Type=Service +X-KDE-ServiceTypes=KonqPopupMenu/Plugin,inode/directory +Actions=samba_export; + +[Desktop Action samba_export] +Name=Export directory as a Samba share +Exec=dbus_samba_export.py %u + Added: branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.py URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.py?rev=55917&view=auto ============================================================================== --- branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.py (added) +++ branches/tmp/lslezak/core/dbus/namespace_service/doc/dbus_samba_export.py Wed Mar 4 13:28:16 2009 @@ -0,0 +1,33 @@ +#!/usr/bin/env python + +# a simple example showing how to integrate Yast Dbuse service into KDE desktop + +import dbus +import sys + +def main(): + + if len(sys.argv) > 1: + + directory = sys.argv[1] + + if len(directory) == 0: + print 'Error: empty argument' + exit(1) + + share_name = directory.replace('/','_') + + if share_name[0] == '_': + share_name = share_name[1:] + + bus = dbus.SystemBus() + samba = bus.get_object('org.opensuse.YaST.modules', '/org/opensuse/YaST/modules/YaPI__Samba') + print 'Exporting directory ' + directory + + result = samba.AddShare(share_name, {'path':directory, 'comment':'Exported directory ' + directory, 'read only':'Yes'}, dbus_interface='org.opensuse.YaST.Values'); + else: + print 'Error: missing argument' + exit(1) + +if __name__ == "__main__": + main() -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org