Author Topic: Tree!explorer Obex Gui For Send-to Function  (Read 3298 times)

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Tree!explorer Obex Gui For Send-to Function
« on: December 28, 2006, 01:08:15 am »
modified Meanies bluetooth-gui script to work for Tree!Exploreer Plus Send-To functionality

#!/bin/sh
#
######################################################################
APPNAME="OBEX GUI"
BNAME=`basename $0`
BLUECONTROL=/etc/pcmcia/bluetooth
BTLIST=/etc/bluetooth/devices
BTDEV=/etc/bluetooth/device
SUDO=`which sudo`

sFile=$1

init()
{
  export QSHDLG_APP=$BNAME$1
  INPUT=/var/spool/qshdlg/input_${QSHDLG_APP}
  OUTPUT=/var/spool/qshdlg/output_${QSHDLG_APP}
  CONTROL=/var/spool/qshdlg/control_${QSHDLG_APP}
}

get_device()
{
  if [ -f $BTDEV ] && [ "$DEVICE" = "" ]; then
    DEVICE=`cat $BTDEV`
  fi
 
}


  init dc
  qshdlg custom -C "message,reply"  -A -f lcfont -t "$APPNAME : control" -v "Scan,Start,Stop" &
  while [ ! -p $CONTROL ]
  do
    echo >/dev/null
  done
  if [ "`hciconfig`" = "" ]; then
    echo "Bluetooth service is not started" > $OUTPUT
  else
    echo "Bluetooth service is running" > $OUTPUT
    if [ -f $BTLIST ]; then
      for NODE in `grep ':' $BTLIST`
      do
        if [ "$NODE" != "Scanning" ] && [ "$NODE" != "..." ]; then
          if [ "`echo $NODE |grep ':'`" != "" ]; then
            NODEADDRESS=$NODE
          else
            echo 'item(QString)' "$NODEADDRESS---[$NODE]" > $CONTROL
            FOUND=1
          fi
        fi
      done
      if [ "$FOUND" = "1" ]; then
        echo 'showSelect()' > $CONTROL
        echo "Please select Bluetooth device" > $OUTPUT
      fi
    fi
  fi
  while read RET < $INPUT
  do
    case $RET in
      Start)
         if [ "`hciconfig`" != "" ]; then
           echo "stopping Bluetooth service..." > $OUTPUT
           $SUDO $BLUECONTROL stop
           CARDID=`cardctl ident 0 |grep manfid|cut -d: -f2 2>/dev/null`
           if [ "$CARDID" != "" ] && [ "`grep $CARDID /etc/pcmcia/bluetooth.conf 2>/dev/null`" != "" ]; then
             $SUDO cardctl eject 0
           fi
         fi
         if [ "`cardctl status 0|grep 'no card'`" != "" ]; then
           echo "inserting card..." > $OUTPUT
           $SUDO cardctl insert 0
         fi
         if [ "`cardctl status 0|grep suspended`" != "" ]; then
           echo "resuming card..." > $OUTPUT
           $SUDO cardctl resume 0
         fi
         echo "starting Bluetooth service..." > $OUTPUT
         if [ "`hciconfig`" = "" ]; then
           echo "Bluetooth started" > $OUTPUT
           $SUDO $BLUECONTROL start
         else
           echo "Bluetooth failed to start" > $OUTPUT
         fi
         ;;
      Stop)
         echo "stopping Bluetooth service..." > $OUTPUT
         $SUDO $BLUECONTROL stop
         CARDID=`cardctl ident 0 |grep manfid|cut -d: -f2 2>/dev/null`
         if [ "$CARDID" != "" ] && [ "`grep $CARDID /etc/pcmcia/bluetooth.conf 2>/dev/null`" != "" ]; then
           $SUDO cardctl eject 0
         fi
         if [ "`hciconfig`" = "" ]; then
           echo "Bluetooth stopped" > $OUTPUT
         else
           echo "Bluetooth failed to stop" > $OUTPUT
         fi
         ;;
      Scan)
         if [ "`hciconfig`" = "" ]; then
           echo "Cannot scan. Bluetooth is not enabled." > $OUTPUT
         else
           echo "Scanning for Bluetooth devices..." > $OUTPUT
           FOUND=0
           for NODE in `hcitool scan | $SUDO tee $BTLIST`
           do
             if [ "$NODE" != "Scanning" ] && [ "$NODE" != "..." ]; then
               if [ "`echo $NODE |grep ':'`" != "" ]; then
                 NODEADDRESS=$NODE
               else
                 echo 'item(QString)' "$NODEADDRESS---[$NODE]" > $CONTROL
                 FOUND=1
               fi
             fi
           done
           if [ "$FOUND" = "1" ]; then
             echo 'showSelect()' > $CONTROL
             echo "Please select Bluetooth device" > $OUTPUT
           else
             echo "No Bluetooth device found" > $OUTPUT
           fi
         fi
         ;;
      *)
   if [ "`echo $RET|grep ':'`" != "" ]; then
      DEVICE=`echo $RET|cut -d- -f1`
              echo "selected device is $DEVICE" |tee $OUTPUT
           
              get_device
      echo "Connecting to Device..." > $OUTPUT
 
           if [ -f /etc/bluetooth/obex ]; then
                OFTP=`cat /etc/bluetooth/obex`
           else
                OFTP=`sdptool search FTP|grep Channel|cut -d: -f2`
           fi

        echo 'Connected' > $OUTPUT
          echo "transferring $sFile ..." > $OUTPUT
          obextool push $sFile $DEVICE $OFTP
          echo "Transfer Complete" > $OUTPUT          
              $SUDO touch $BTDEV
              $SUDO chown zaurus:qpe $BTDEV
              echo $DEVICE > $BTDEV
   else
           echo "nothing selected" |tee $OUTPUT
   fi
         
         echo 'reject()' > $CONTROL
         ;;
    esac
  done


make sure to add a command in Tree!Explorer Plus Send-to
select command, then the name of this script "obex-gui %1 &", no quotes. Then you should be able to liong tap->send to->obex-gui. The dialog box pops-up select the device and press ok. thanks to Meanie for the original bluetooth-gui script.
« Last Edit: December 28, 2006, 01:46:00 am by bam »
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Tree!explorer Obex Gui For Send-to Function
« Reply #1 on: December 28, 2006, 02:50:19 am »
I sure wish I could get my hands on Tree!Explorer+
Anywhere I can send a money order?
I would drop my other filemanagers if I could click and launch documents from Tree!Explorer.
« Last Edit: December 28, 2006, 02:50:34 am by Jon_J »
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers

bam

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • http://thegrinder.ws
Tree!explorer Obex Gui For Send-to Function
« Reply #2 on: December 28, 2006, 02:47:24 pm »
I thinki I got it at handango
SL-C3100 current: Stock/Tetsu 18h
Socket BT CF Card
Linksys WCF-12 802.11b/Cheapie USB Ethernet

The Grinder

dougeeebear

  • Hero Member
  • *****
  • Posts: 537
    • View Profile
    • http://
Tree!explorer Obex Gui For Send-to Function
« Reply #3 on: December 28, 2006, 03:30:30 pm »
Jon,
Maybe   this will help.

Or you could send me a money order for $50,000,000,000.00  
« Last Edit: December 28, 2006, 03:34:37 pm by dougeeebear »
Zaurus SL-C1000 and SL-5500
NetWalker PC-T1 (tablet)

Jon_J

  • Hero Member
  • *****
  • Posts: 1853
    • View Profile
    • http://
Tree!explorer Obex Gui For Send-to Function
« Reply #4 on: December 28, 2006, 03:39:26 pm »
handango link is dead
" Error
The product you were looking for is not available."

I don't think handango will take money orders.
I'll ask Stephen at StreamlineCPUs if he can get it for me when I order my new C3200 next month.
C3100 Multiboot-->Angstrom 2007.12-r18 | Cacko 1.23 | ArchLinuxARM
C3200 pdaxii13v2-5.5-alpha4 Akita on NAND

Ambicom WL1100C-CF Wifi - Ambicom CF modem - Ambicom CF GPS - Belkin-F5D5050 USB LAN
Socket CF Bluetooth rev K - Iogear 4 port USB micro hub - pocket CF card reader
Targus mini USB optical mouse - 2 Targus SD card readers