Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-04-30 19:26:36 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-04-30 19:26:36 (GMT)
commit331d415bd0434f2d6f352e8dbb08d82896a03e8f (patch)
treee69d6ec83a683ef02dfeb3f69c65f49f4f394332
Add initial files from VncLauncher 6
Some unneded files where removed and directories to include binaries for arm architecture. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rwxr-xr-xactivity/activity-vnclauncher.svg38
-rwxr-xr-xactivity/activity.info8
-rwxr-xr-xbin/i586/lib/libvncserver.so.0bin0 -> 218352 bytes
-rwxr-xr-xbin/i586/x11vncbin0 -> 1402876 bytes
-rwxr-xr-xsetup.py23
-rwxr-xr-xvnclauncher.py220
6 files changed, 289 insertions, 0 deletions
diff --git a/activity/activity-vnclauncher.svg b/activity/activity-vnclauncher.svg
new file mode 100755
index 0000000..f0f9d74
--- /dev/null
+++ b/activity/activity-vnclauncher.svg
@@ -0,0 +1,38 @@
+<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' [
+ <!ENTITY stroke_color "#010101">
+ <!ENTITY fill_color "#FFFFFF">
+]><!-- Creator: CorelDRAW --><svg height="50px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" viewBox="0 0 3.78472 3.78472" width="50px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs style="">
+ <style style="" type="text/css">
+ <![CDATA[
+ .str0 {stroke:white;stroke-width:0.0481685}
+ .str1 {stroke:#010101;stroke-width:0.192674}
+ .str3 {stroke:#010101;stroke-width:0.192674}
+ .str2 {stroke:#010101;stroke-width:0.192674;stroke-linecap:round}
+ .fil0 {fill:#FFFFFF}
+ .fil2 {fill:#FFFFFF}
+ .fil1 {fill:#FFFFFF}
+ ]]>
+ </style>
+ </defs>
+ <g id="Layer_x0020_1" style="">
+ <metadata id="CorelCorpID_0Corel-Layer" style=""/>
+
+ <rect stroke="&stroke_color;" fill="&fill_color;"
+class="fill0 str0" stroke-width="0.192"
+height="2.20865" rx="0.196661"
+ry="0.196661" style=""
+width="2.91" x="0.653715" y="0.644322"/>
+
+ <rect stroke="&stroke_color;" fill="&fill_color;"
+stroke-width="0.192"
+height="2.20865" rx="0.196661" ry="0.196661" style="" width="2.91966" x="0.145106" y="1.09815"/>
+ <g id="_60706736" style="">
+ <g style="">
+ <line class="fil0 str2" id="_60781952" style="" x1="1.31819" x2="1.89165" y1="2.11687" y2="2.69034"/>
+ <line class="fil0 str2" id="_60615656" style="" x1="1.89168" x2="1.31822" y1="2.11687" y2="2.69034"/>
+ </g>
+ <circle class="fil2 str3" cx="1.60493" cy="1.82808" id="_60601288" r="0.113458" style=""/>
+ </g>
+ </g>
+</svg>
diff --git a/activity/activity.info b/activity/activity.info
new file mode 100755
index 0000000..58086dc
--- /dev/null
+++ b/activity/activity.info
@@ -0,0 +1,8 @@
+[Activity]
+name = VncLauncher
+activity_version = 6
+service_name = org.laptop.VncLauncher
+exec = sugar-activity vnclauncher.VncLauncherActivity
+icon = activity-vnclauncher
+mime_types =
+
diff --git a/bin/i586/lib/libvncserver.so.0 b/bin/i586/lib/libvncserver.so.0
new file mode 100755
index 0000000..eba15cd
--- /dev/null
+++ b/bin/i586/lib/libvncserver.so.0
Binary files differ
diff --git a/bin/i586/x11vnc b/bin/i586/x11vnc
new file mode 100755
index 0000000..f37061a
--- /dev/null
+++ b/bin/i586/x11vnc
Binary files differ
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..56174c0
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,23 @@
+#!/usr/bin/python
+
+# Copyright (C) 2006, Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+from sugar.activity import bundlebuilder
+bundlebuilder.start('VncLauncher')
+
+
+
diff --git a/vnclauncher.py b/vnclauncher.py
new file mode 100755
index 0000000..f5367a3
--- /dev/null
+++ b/vnclauncher.py
@@ -0,0 +1,220 @@
+# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com>.
+# Copyright (C) 2008, One Laptop Per Child
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+import os
+
+import logging
+from gettext import gettext as _
+
+import gtk
+import dbus
+
+from sugar.activity import activity
+from sugar import env
+from sugar.graphics.toolbutton import ToolButton
+from sugar.graphics.palette import Palette
+from sugar.graphics.roundbox import CanvasRoundBox
+import ConfigParser
+import os.path
+import vte
+import pango
+import commands
+import sys
+
+class VncLauncherActivity(activity.Activity):
+ def _ipaddr_(self,button):
+ #find ip address from protocal "eth0"
+ ifconfig="/sbin/ifconfig"
+ iface=['eth0','msh0']
+ for i in range(0,2):
+ inetaddr="inet addr:"
+ cmd="%s %s"%(ifconfig,iface[i])
+ output=commands.getoutput(cmd)
+ ipaddr="Error!!"
+ error="Error!! check wireless connection"
+ inet=output.find(inetaddr)
+ if inet>=0:
+ print iface[i]
+ start=inet+len(inetaddr)
+ end=output.find(" ",start)
+ if i==0:
+ ipaddr='Ethernet IP= '+ output[start:end]
+ else:
+ ipaddr='Mesh IP='+ output[start:end]
+ break
+ else:
+ ipaddr=error
+ button.set_label('Please Click to find current IP address \n\n'+ipaddr)
+
+
+ def __init__(self, handle):
+ activity.Activity.__init__(self, handle)
+
+
+ logging.debug('Starting the X11 VNC activity')
+
+ self.set_title(_('X11 VNC Server Activity'))
+ self.connect('key-press-event', self.__key_press_cb)
+ args="Please Click to find current IP address"
+ box = gtk.HBox(False, 10)
+ table=gtk.Table(4,1,True)
+ button=gtk.Button(args)
+ button.connect("clicked",self._ipaddr_)
+ table.attach(button,0,1,0,1,gtk.FILL|gtk.EXPAND,gtk.EXPAND|gtk.FILL,25,25)
+ button.show()
+ button=gtk.Button("Start X11 VNC Server")
+ button.connect("clicked",self.connectVNC)
+ table.attach(button,0,1,1,2,gtk.FILL|gtk.EXPAND,gtk.FILL|gtk.EXPAND,25,25)
+ button.show()
+
+ button=gtk.Button("Stop X11 VNC Server")
+ button.connect("clicked",self.stopVNC)
+ table.attach(button,0,1,2,3,gtk.FILL,gtk.FILL,25,25)
+ button.show()
+
+ button=gtk.Button("Exit VncLauncherActivity")
+ button.connect("clicked",lambda w:gtk.main_quit())
+ table.attach(button,0,1,3,4,gtk.FILL,gtk.FILL,25,25)
+ button.show()
+ table.show()
+
+ self._vte = VTE()
+ self._vte.show()
+
+ box.pack_start(self._vte)
+ box.pack_start(table, False, False, 0)
+
+ self.set_canvas(box)
+ box.show()
+
+ def stopVNC(self,button):
+
+ cmd = "kill" + commands.getoutput('pidof x11vnc')
+ self._vte.fork_command(cmd)
+
+ def connectVNC(self,button):
+ self._vte.grab_focus()
+ cmd = "/home/olpc/Activities/VncLauncher.activity/x11vnc"
+ self._vte.fork_command(cmd)
+
+ def __key_press_cb(self, window, event):
+ return False
+
+class VTE(vte.Terminal):
+ def __init__(self):
+ vte.Terminal.__init__(self)
+ self._configure_vte()
+ self.connect("child-exited", lambda term: term.fork_command())
+
+ os.chdir(os.environ["HOME"])
+ self.fork_command()
+
+ def _configure_vte(self):
+ conf = ConfigParser.ConfigParser()
+ conf_file = os.path.join(env.get_profile_path(), 'terminalrc')
+
+ if os.path.isfile(conf_file):
+ f = open(conf_file, 'r')
+ conf.readfp(f)
+ f.close()
+ else:
+ conf.add_section('terminal')
+
+ if conf.has_option('terminal', 'font'):
+ font = conf.get('terminal', 'font')
+ else:
+ font = 'Monospace 8'
+ conf.set('terminal', 'font', font)
+ self.set_font(pango.FontDescription(font))
+
+ if conf.has_option('terminal', 'fg_color'):
+ fg_color = conf.get('terminal', 'fg_color')
+ else:
+ fg_color = '#000000'
+ conf.set('terminal', 'fg_color', fg_color)
+ if conf.has_option('terminal', 'bg_color'):
+ bg_color = conf.get('terminal', 'bg_color')
+ else:
+ bg_color = '#FFFFFF'
+ conf.set('terminal', 'bg_color', bg_color)
+ self.set_colors(gtk.gdk.color_parse (fg_color),
+ gtk.gdk.color_parse (bg_color),
+ [])
+
+ if conf.has_option('terminal', 'cursor_blink'):
+ blink = conf.getboolean('terminal', 'cursor_blink')
+ else:
+ blink = False
+ conf.set('terminal', 'cursor_blink', blink)
+
+ self.set_cursor_blinks(blink)
+
+ if conf.has_option('terminal', 'bell'):
+ bell = conf.getboolean('terminal', 'bell')
+ else:
+ bell = False
+ conf.set('terminal', 'bell', bell)
+ self.set_audible_bell(bell)
+
+ if conf.has_option('terminal', 'scrollback_lines'):
+ scrollback_lines = conf.getint('terminal', 'scrollback_lines')
+ else:
+ scrollback_lines = 1000
+ conf.set('terminal', 'scrollback_lines', scrollback_lines)
+
+ self.set_scrollback_lines(scrollback_lines)
+ self.set_allow_bold(True)
+
+ if conf.has_option('terminal', 'scroll_on_keystroke'):
+ scroll_key = conf.getboolean('terminal', 'scroll_on_keystroke')
+ else:
+ scroll_key = False
+ conf.set('terminal', 'scroll_on_keystroke', scroll_key)
+ self.set_scroll_on_keystroke(scroll_key)
+
+ if conf.has_option('terminal', 'scroll_on_output'):
+ scroll_output = conf.getboolean('terminal', 'scroll_on_output')
+ else:
+ scroll_output = False
+ conf.set('terminal', 'scroll_on_output', scroll_output)
+ self.set_scroll_on_output(scroll_output)
+
+ if conf.has_option('terminal', 'emulation'):
+ emulation = conf.get('terminal', 'emulation')
+ else:
+ emulation = 'xterm'
+ conf.set('terminal', 'emulation', emulation)
+ self.set_emulation(emulation)
+
+ if conf.has_option('terminal', 'visible_bell'):
+ visible_bell = conf.getboolean('terminal', 'visible_bell')
+ else:
+ visible_bell = False
+ conf.set('terminal', 'visible_bell', visible_bell)
+ self.set_visible_bell(visible_bell)
+ conf.write(open(conf_file, 'w'))
+
+ def on_gconf_notification(self, client, cnxn_id, entry, what):
+ self.reconfigure_vte()
+
+ def on_vte_button_press(self, term, event):
+ if event.button == 3:
+ self.do_popup(event)
+ return True
+
+ def on_vte_popup_menu(self, term):
+ pass