Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r3757 -
      trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src
      ([EMAIL PROTECTED])
   2. r3758 - in trunk/src/target/gsm: include/libgsmd src/gsmd
      ([EMAIL PROTECTED])
   3. r3759 - trunk/src/target/gsm/src/gsmd
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: mickey
Date: 2008-01-01 18:24:24 +0100 (Tue, 01 Jan 2008)
New Revision: 3757

Modified:
   
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
   
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
Log:
openmoko-terminal2: make it more usable
* add toolbar with buttons for
** new
** delete
** zoom in
** zoom out


Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala  
    2007-12-30 16:03:18 UTC (rev 3756)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mainwindow.vala  
    2008-01-01 17:24:24 UTC (rev 3757)
@@ -2,7 +2,7 @@
  * mainwindow.vala
  *
  * Authored by Michael 'Mickey' Lauer <[EMAIL PROTECTED]>
- * Copyright (C) 2007 OpenMoko, Inc.
+ * Copyright (C) 2007-2008 OpenMoko, 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
@@ -27,6 +27,15 @@
 
 public class OpenMokoTerminal2.MainWindow : Window
 {
+    private VBox _vbox;
+    private Toolbar _toolbar;
+    private Notebook _notebook;
+
+    private ToolButton _btn_new;
+    private ToolButton _btn_delete;
+    private ToolButton _btn_zoom_in;
+    private ToolButton _btn_zoom_out;
+
     public MainWindow()
     {
         title = "Terminal";
@@ -35,18 +44,85 @@
     construct
     {
         destroy += Gtk.main_quit;
-        var notebook = new Gtk.Notebook();
-        notebook.set_tab_pos( PositionType.BOTTOM );
-        add( notebook );
+        _vbox = new Gtk.VBox( false, 0 );
+        add( _vbox );
+        setup_toolbar();
+        setup_notebook();
+        update_toolbar();
+    }
 
-        for ( int i = 0; i < 3; ++i )
-        {
-            var terminal = new OpenMokoTerminal2.MokoTerminal();
-            notebook.append_page( terminal, Image.from_stock( STOCK_INDEX, 
IconSize.LARGE_TOOLBAR ) );
-            notebook.child_set (terminal, "tab-expand", true, null );
-        }
+    public void setup_toolbar()
+    {
+        _toolbar = new Gtk.Toolbar();
+        _vbox.add( _toolbar );
+
+        _btn_new = new Gtk.ToolButton.from_stock( STOCK_NEW );
+        _btn_new.clicked += on_new_clicked;
+        _toolbar.insert( _btn_new, 0 );
+
+        _btn_delete = new Gtk.ToolButton.from_stock( STOCK_DELETE );
+        _btn_delete.clicked += on_delete_clicked;
+        _toolbar.insert( _btn_delete, 1 );
+
+        _toolbar.insert( new Gtk.SeparatorToolItem(), 2 );
+
+        _btn_zoom_in = new Gtk.ToolButton.from_stock( STOCK_ZOOM_IN );
+        _btn_zoom_in.clicked += on_zoom_in_clicked;
+        _toolbar.insert( _btn_zoom_in, 3 );
+
+        _btn_zoom_out = new Gtk.ToolButton.from_stock( STOCK_ZOOM_OUT );
+        _btn_zoom_out.clicked += on_zoom_out_clicked;
+        _toolbar.insert( _btn_zoom_out, 4 );
     }
 
+    public void setup_notebook()
+    {
+        _notebook = new Gtk.Notebook();
+        _notebook.set_tab_pos( PositionType.BOTTOM );
+        _vbox.add( _notebook );
+
+        var terminal = new OpenMokoTerminal2.MokoTerminal();
+        _notebook.append_page( terminal, Image.from_stock( STOCK_INDEX, 
IconSize.LARGE_TOOLBAR ) );
+        _notebook.child_set (terminal, "tab-expand", true, null );
+    }
+
+    private void on_new_clicked( Gtk.ToolButton b )
+    {
+        stdout.printf( "on_new_clicked\n" );
+        var terminal = new OpenMokoTerminal2.MokoTerminal();
+        _notebook.append_page( terminal, Image.from_stock( STOCK_INDEX, 
IconSize.LARGE_TOOLBAR ) );
+        _notebook.child_set (terminal, "tab-expand", true, null );
+        _notebook.show_all();
+        update_toolbar();
+    }
+
+    private void on_delete_clicked( Gtk.ToolButton b )
+    {
+        stdout.printf( "on_delete_clicked\n" );
+        var page = _notebook.get_nth_page( _notebook.get_current_page() );
+        page.destroy();
+        update_toolbar();
+    }
+
+    private void on_zoom_in_clicked( Gtk.ToolButton b )
+    {
+        stdout.printf( "on_zoom_in_clicked\n" );
+        OpenMokoTerminal2.MokoTerminal terminal = _notebook.get_nth_page( 
_notebook.get_current_page() );
+        terminal.zoom_in();
+    }
+
+    private void on_zoom_out_clicked( Gtk.ToolButton b )
+    {
+        stdout.printf( "on_zoom_out_clicked\n" );
+        OpenMokoTerminal2.MokoTerminal terminal = _notebook.get_nth_page( 
_notebook.get_current_page() );
+        terminal.zoom_out();
+    }
+
+    public void update_toolbar()
+    {
+        _btn_delete.set_sensitive( _notebook.get_n_pages() > 1 );
+    }
+
     public void run()
     {
         show_all();

Modified: 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
===================================================================
--- 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
    2007-12-30 16:03:18 UTC (rev 3756)
+++ 
trunk/src/target/OM-2007.2/applications/openmoko-terminal2/src/mokoterminal.vala
    2008-01-01 17:24:24 UTC (rev 3757)
@@ -2,7 +2,7 @@
  * mokoterminal.vala
  *
  * Authored by Michael 'Mickey' Lauer <[EMAIL PROTECTED]>
- * Copyright (C) 2007 OpenMoko, Inc.
+ * Copyright (C) 2007-2008 OpenMoko, 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
@@ -27,12 +27,18 @@
 
 public class OpenMokoTerminal2.MokoTerminal : HBox
 {
+    private string _fontname;
+    private uint _fontsize;
     private Scrollbar _scrollbar;
     private Terminal _terminal;
 
     construct {
         stdout.printf( "moko-terminal constructed\n" );
 
+        // may read from gconf at some point?
+        _fontname = "LiberationMono";
+        _fontsize = 5;
+
         _terminal = new Vte.Terminal();
         _terminal.child_exited += term => { stdout.printf( "unhandled eof\n" 
); };
         _terminal.eof += term => { stdout.printf( "unhandled eof\n" ); };
@@ -56,13 +62,30 @@
 
         //_terminal.set_colors( fore, back, colors[0], 8 );
 
+        update_font();
         _terminal.set_scrollback_lines( 1000 );
-        _terminal.set_font_from_string_full( "LiberationMono 5", 
TerminalAntiAlias.FORCE_ENABLE );
         _terminal.set_mouse_autohide( true );
         _terminal.set_cursor_blinks( true );
-
         _terminal.set_backspace_binding( TerminalEraseBinding.ASCII_DELETE);
         _terminal.fork_command( null, null, null, Environment.get_variable( 
"HOME" ), true, true, true );
     }
+
+    public void update_font()
+    {
+        string font = "%s %d".printf( _fontname, _fontsize );
+        _terminal.set_font_from_string_full( font, 
TerminalAntiAlias.FORCE_ENABLE );
+    }
+
+    public void zoom_in()
+    {
+        ++_fontsize;
+        update_font();
+    }
+
+    public void zoom_out()
+    {
+        --_fontsize;
+        update_font();
+    }
 }
 




--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-01-02 04:09:03 +0100 (Wed, 02 Jan 2008)
New Revision: 3758

Modified:
   trunk/src/target/gsm/include/libgsmd/sms.h
   trunk/src/target/gsm/src/gsmd/sms_pdu.c
Log:
gsmd: add TP-STATUS return code table (Erin Yueh)



Modified: trunk/src/target/gsm/include/libgsmd/sms.h
===================================================================
--- trunk/src/target/gsm/include/libgsmd/sms.h  2008-01-01 17:24:24 UTC (rev 
3757)
+++ trunk/src/target/gsm/include/libgsmd/sms.h  2008-01-02 03:09:03 UTC (rev 
3758)
@@ -36,6 +36,50 @@
        enum lgsm_msg_sms_delflg delflg;
 };
 
+/* TP-Status from 3GPP TS 23.040 section 9.2.3.15 */
+enum lgsm_tp_status {
+  /* sms received sucessfully */
+  TP_STATUS_RECEIVED_OK                   = 0x00,
+  TP_STATUS_UNABLE_TO_CONFIRM_DELIVERY    = 0x01,
+  TP_STATUS_REPLACED                      = 0x02,
+  /* Reserved: 0x03 - 0x0f */
+  /* Values specific to each SC: 0x10 - 0x1f */
+  /* Temporary error, SC still trying to transfer SM: */
+  TP_STATUS_TRY_CONGESTION             = 0x20,
+  TP_STATUS_TRY_SME_BUSY               = 0x21,
+  TP_STATUS_TRY_NO_RESPONSE_FROM_SME   = 0x22,
+  TP_STATUS_TRY_SERVICE_REJECTED       = 0x23,
+  TP_STATUS_TRY_QOS_NOT_AVAILABLE      = 0x24,
+  TP_STATUS_TRY_SME_ERROR              = 0x25,
+  /* Reserved: 0x26 - 0x2f */
+  /* Values specific to each SC: 0x30 - 0x3f */
+  /* Permanent error, SC is not making any more transfer attempts:  */
+  TP_STATUS_PERM_REMOTE_PROCEDURE_ERROR   = 0x40,
+  TP_STATUS_PERM_INCOMPATIBLE_DEST        = 0x41,
+  TP_STATUS_PERM_REJECTED_BY_SME          = 0x42,
+  TP_STATUS_PERM_NOT_OBTAINABLE           = 0x43,
+  TP_STATUS_PERM_QOS_NOT_AVAILABLE        = 0x44,
+  TP_STATUS_PERM_NO_INTERWORKING          = 0x45,
+  TP_STATUS_PERM_VALID_PER_EXPIRED        = 0x46,
+  TP_STATUS_PERM_DELETED_BY_ORIG_SME      = 0x47,
+  TP_STATUS_PERM_DELETED_BY_SC_ADMIN      = 0x48,
+  TP_STATUS_PERM_SM_NO_EXIST              = 0x49,
+  /* Reserved: 0x4a - 0x4f */
+  /* Values specific to each SC: 0x50 - 0x5f */
+  /* Temporary error, SC is not making any more transfer attempts: */
+  TP_STATUS_TMP_CONGESTION               = 0x60,
+  TP_STATUS_TMP_SME_BUSY                 = 0x61,
+  TP_STATUS_TMP_NO_RESPONSE_FROM_SME     = 0x62,
+  TP_STATUS_TMP_SERVICE_REJECTED         = 0x63,
+  TP_STATUS_TMP_QOS_NOT_AVAILABLE        = 0x64,
+  TP_STATUS_TMP_SME_ERROR                = 0x65,
+  /* Reserved: 0x66 - 0x6f */
+  /* Values specific to each SC: 0x70 - 0x7f */
+  /* Reserved: 0x80 - 0xff */
+  TP_STATUS_NONE = 0xFF
+};
+
+
 /* Refer to GSM 03.40 subclause 9.2.2.2 */
 #define LGSM_SMS_ADDR_MAXLEN   12
 #define LGSM_SMS_DATA_MAXLEN   140

Modified: trunk/src/target/gsm/src/gsmd/sms_pdu.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/sms_pdu.c     2008-01-01 17:24:24 UTC (rev 
3757)
+++ trunk/src/target/gsm/src/gsmd/sms_pdu.c     2008-01-02 03:09:03 UTC (rev 
3758)
@@ -221,9 +221,9 @@
                        return 1;
 
                /* TP-MR set it gsmd_sms_list.index*/
-               dst->index = (int) src[1];
+               dst->index = (u_int8_t) src[1];
                /* TP-STATUS set it to coding_scheme */
-               dst->payload.coding_scheme = (int) src[len-1];
+               dst->payload.coding_scheme = (u_int8_t) src[len-1];
                /* TP-RA */
                i = sms_number_bytelen(src[3], src[2]);
                if (len < 13 + i)




--- End Message ---
--- Begin Message ---
Author: erin_yueh
Date: 2008-01-02 09:37:09 +0100 (Wed, 02 Jan 2008)
New Revision: 3759

Modified:
   trunk/src/target/gsm/src/gsmd/vendor_ti.c
Log:
gsmd: remove AT%CPHS from vendor_ti.c (Erin Yueh)



Modified: trunk/src/target/gsm/src/gsmd/vendor_ti.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/vendor_ti.c   2008-01-02 03:09:03 UTC (rev 
3758)
+++ trunk/src/target/gsm/src/gsmd/vendor_ti.c   2008-01-02 08:37:09 UTC (rev 
3759)
@@ -206,39 +206,6 @@
        /* %CGEV: reports GPRS network events */
 };
 
-static int cpmb_detect_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
-{
-       struct gsmd *g = ctx;
-       struct gsm_extrsp *er;
-       int rc;
-       char atcmd_buf[20];
-
-       if (strncmp(resp, "%CPMB: ", 7))
-               return -EINVAL;
-       resp += 7;
-       
-       er = extrsp_parse(cmd, resp);
-       if (!er)
-               return -ENOMEM;
-
-       extrsp_dump(er);
-
-       if (er->num_tokens == 5 &&
-           er->tokens[2].type == GSMD_ECMD_RTT_STRING &&
-               er->tokens[3].type == GSMD_ECMD_RTT_NUMERIC &&
-               er->tokens[4].type == GSMD_ECMD_RTT_STRING) {
-                snprintf(atcmd_buf, sizeof(atcmd_buf), "AT+CSVM=1,\"%s\",%d",
-                        er->tokens[2].u.string, er->tokens[3].u.numeric);
-                rc = gsmd_simplecmd(g, atcmd_buf);
-       } else {
-                rc = -EINVAL;
-       }
-
-       talloc_free(er);
-
-       return rc;
-}
-
 static int cpi_detect_cb(struct gsmd_atcmd *cmd, void *ctx, char *resp)
 {
        struct gsmd *g = ctx;
@@ -252,11 +219,6 @@
        if (!er)
                return -EINVAL;
        
-       /* retrieve voicemail number */
-       cmd = atcmd_fill("AT%CPMB=1", 10, &cpmb_detect_cb, g, 0, NULL);
-       if (cmd)
-               atcmd_submit(g, cmd);
-       
        if (extrsp_supports(er, 0, 3))
                return gsmd_simplecmd(g, "AT%CPI=3");
        else if (extrsp_supports(er, 0, 2))
@@ -291,9 +253,7 @@
        rc |= gsmd_simplecmd(g, "AT%CSQ=1");
        /* send unsolicited commands at any time */
        rc |= gsmd_simplecmd(g, "AT%CUNS=0");
-       /* enable %CPHS: Initialise CPHS Functionalities */
-       rc |= gsmd_simplecmd(g, "AT%CPHS=1");
-       
+
        /* enable %CPI: call progress indication */
        cmd = atcmd_fill("AT%CPI=?", 9, &cpi_detect_cb, g, 0, NULL);
        if (cmd)




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to