antiright-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Antiright-devel] antiright ACE-desktop/ACE gtkshell/add_options....


From: Jeffrey Bedard
Subject: [Antiright-devel] antiright ACE-desktop/ACE gtkshell/add_options....
Date: Tue, 02 Oct 2007 14:35:37 +0000

CVSROOT:        /sources/antiright
Module name:    antiright
Changes by:     Jeffrey Bedard <jefbed> 07/10/02 14:35:37

Modified files:
        ACE-desktop    : ACE 
        gtkshell       : add_options.c applets.h terminal.c tree.c 

Log message:
        Added output support to list code based on GTK documentation example.
        Use list to display values in new View All Settings option in ACE 
Settings.
        Improved add_options commenting.  

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/antiright/ACE-desktop/ACE?cvsroot=antiright&r1=1.48&r2=1.49
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/add_options.c?cvsroot=antiright&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/applets.h?cvsroot=antiright&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/terminal.c?cvsroot=antiright&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/antiright/gtkshell/tree.c?cvsroot=antiright&r1=1.2&r2=1.3

Patches:
Index: ACE-desktop/ACE
===================================================================
RCS file: /sources/antiright/antiright/ACE-desktop/ACE,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- ACE-desktop/ACE     31 Jul 2007 13:55:25 -0000      1.48
+++ ACE-desktop/ACE     2 Oct 2007 14:35:36 -0000       1.49
@@ -428,16 +428,35 @@
        set_value $1 "$new_value"
     fi
 }
-Settings()
+
+View_Settings()
 {
+
+#      local CMD="exec $ARSHELL -or 10"
+       local LIST=" : "
+       local BEFORE_FIRST_FLAG="TRUE"
+
        # Ensure the existance of a configuration file.
     ACE_Check_Configuration_File
+       for title in $(ACE_record_titles); do
+               LIST="$LIST,$title:$(ACE -r $title)"
+       done
+       $ARSHELL -os -aL "$LIST" 1> /dev/null 2> /dev/null
+}
+
+Settings()
+{
     local CMD="exec $ARSHELL -or 10"
+
+       CMD="$CMD 'ACE -A View_Settings & # See_All_Values,gtk-preferences'"
+       # Ensure the existance of a configuration file.
+       ACE_Check_Configuration_File
     for title in $(ACE_record_titles); do
       CMD="$CMD \"ACE -A Settings_Node $title\""
     done
     exec sh -c "$CMD"
 }
+
 Load_Meter()
 {
        $ARSHELL -aul uptime

Index: gtkshell/add_options.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/add_options.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- gtkshell/add_options.c      13 Aug 2007 08:24:28 -0000      1.46
+++ gtkshell/add_options.c      2 Oct 2007 14:35:37 -0000       1.47
@@ -147,16 +147,20 @@
        case 'A': /* Add an internally updated applet.  */
                handle_applet_arguments(gsh, argc, argv, counter);
                break;
-       case 'b':
+
+       case 'b': /* Add a horizontal pane between previous widgets
+                    and following widgets.  */
                GSH_COUNT(argc, counter);
                gsh_setup_hpaned(gsh, argv[*counter]);
                break;
 
-       case 'C':
+       case 'C': /* Add a command execution widget.  This is primarily
+                    for systems failing to support VTE.  */
                add_command_shell(gsh, NULL);
                break;
 
-       case 'c':
+       case 'c': /* Add a widget with value initialized by execution
+                    of command, specified by option argument.  */
                handle_commanded_add_arguments(gsh, argc, argv, counter);
                break;
 

Index: gtkshell/applets.h
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/applets.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- gtkshell/applets.h  11 Jun 2007 21:32:38 -0000      1.3
+++ gtkshell/applets.h  2 Oct 2007 14:35:37 -0000       1.4
@@ -1,3 +1,8 @@
 
+#ifndef GSH_APPLET_H
+#define GSH_APPLET_H
+
 #include "clock.h"
 
+#endif /* GSH_APPLET_H */
+

Index: gtkshell/terminal.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/terminal.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- gtkshell/terminal.c 21 Jul 2007 16:16:39 -0000      1.27
+++ gtkshell/terminal.c 2 Oct 2007 14:35:37 -0000       1.28
@@ -154,6 +154,18 @@
 }
 
 static void
+connect_terminal_signals_with_data(GSH * gsh, GtkWidget * widget)
+{
+       struct GSHCBData * cb;
+
+       cb=ARNEW(gsh, GSHCBData, gsh, NULL);
+       GSHCONNECT(widget, "status-line-changed",
+               status_changed_cb, cb);
+       GSHCONNECT(widget, "window-title-changed", 
+               title_change_cb, cb);
+}
+
+static void
 setup_terminal_signals(struct GSH_Terminal * term)
 {
        GSH * gsh;
@@ -166,15 +178,7 @@
                return;
        /* Exit from the application if the terminal process dies.  */
        GSHCONNECT(widget, "child-exited", gtk_main_quit, NULL);
-       {
-               struct GSHCBData * cb;
-
-               cb=ARNEW(gsh, GSHCBData, gsh, NULL);
-               GSHCONNECT(widget, "status-line-changed",
-                       status_changed_cb, cb);
-               GSHCONNECT(widget, "window-title-changed", 
-                       title_change_cb, cb);
-       }
+       connect_terminal_signals_with_data(gsh, widget);
 }
 
 static GtkWidget *

Index: gtkshell/tree.c
===================================================================
RCS file: /sources/antiright/antiright/gtkshell/tree.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- gtkshell/tree.c     25 Jul 2007 04:42:39 -0000      1.2
+++ gtkshell/tree.c     2 Oct 2007 14:35:37 -0000       1.3
@@ -87,6 +87,28 @@
        gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),\
                -1, name, renderer, "text", id, NULL)
 
+static void
+selection_handler(GtkTreeSelection * selection, gpointer data)
+{
+       GtkTreeModel * model;
+       GtkTreeIter iter;
+       gchar * key;
+
+       gtk_tree_selection_get_selected(selection, &model, &iter);
+       gtk_tree_model_get(model, &iter, KEY_COLUMN, &key, -1);
+       puts(key);
+}
+
+static void
+setup_signals(GtkWidget * tree_view)
+{
+       GtkTreeSelection * selection;
+
+       selection=gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view));
+       gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
+       g_signal_connect(G_OBJECT(selection), "changed",
+               G_CALLBACK(selection_handler), NULL);
+}
 
 GtkWidget *
 gsh_tree_view_new(GSH * gsh, const gchar * input)
@@ -102,6 +124,7 @@
        ADD_COLUMN(view, "VALUE", VALUE_COLUMN);
        gtk_tree_view_set_model(GTK_TREE_VIEW(view), model);
        g_object_unref(model);
+       setup_signals(view);
 
        return view;
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]