gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r32076 - in gnunet-gtk: contrib src/conversation


From: gnunet
Subject: [GNUnet-SVN] r32076 - in gnunet-gtk: contrib src/conversation
Date: Wed, 29 Jan 2014 22:24:42 +0100

Author: hark
Date: 2014-01-29 22:24:42 +0100 (Wed, 29 Jan 2014)
New Revision: 32076

Modified:
   gnunet-gtk/contrib/gnunet_conversation_gtk_about_window.glade
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
   gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
Log:
compiler warnings about gtk, etc.


Modified: gnunet-gtk/contrib/gnunet_conversation_gtk_about_window.glade
===================================================================
--- gnunet-gtk/contrib/gnunet_conversation_gtk_about_window.glade       
2014-01-29 19:45:49 UTC (rev 32075)
+++ gnunet-gtk/contrib/gnunet_conversation_gtk_about_window.glade       
2014-01-29 21:24:42 UTC (rev 32076)
@@ -91,7 +91,7 @@
           <object class="GtkLabel" id="about_name_version_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label">GNUnet-Peerinfo-GTK r32008</property>
+            <property name="label">GNUnet-Peerinfo-GTK r32068</property>
             <attributes>
               <attribute name="weight" value="bold"/>
               <attribute name="size" value="200"/>

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-29 
19:45:49 UTC (rev 32075)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.c       2014-01-29 
21:24:42 UTC (rev 32076)
@@ -143,23 +143,27 @@
   GtkTreeIter iter;
   time_t t;
   char *event;
+  
   switch (type) 
   {
-   case 0: 
+   case CH_ACCEPTED: 
        event = "Accepted";
        break;
-   case 1: 
+   case CH_REJECTED: 
        event = "Rejected";
        break;
-   case 2: 
+   case CH_OUTGOING: 
        event = "Outgoing";
        break;
-   case 3:
+   case CH_HANGUP:
         event = "Hangup";
         break;
-   case 4:
+   case CH_MISSED:
         event = "Missed";
         break;
+    default:
+       event = "UNKNOWN";
+      break; 
   }
   time (&t);
   gtk_list_store_append (history_liststore, &iter);
@@ -358,8 +362,6 @@
 {
   struct GNUNET_GNSRECORD_Data rd;
 
-  LOG ("start_phone\n");
-
   if (NULL == caller_id)
   {
     LOG (_("Ego `%s' no longer available, phone is now down.\n"), ego_name);
@@ -495,7 +497,6 @@
 static void
 do_accept (const char *args)
 {
-  FPRINTF (stderr, "do_accept run");
   struct CallList *cl;
   char buf[32];
 
@@ -743,7 +744,6 @@
 static void
 do_reject (const char *args)
 {
-  FPRINTF (stderr, "doing reject");
   struct CallList *cl;
   char buf[32];
 
@@ -796,7 +796,6 @@
     phone_state = PS_LISTEN;
     break;
   }
-  //FPRINTF(stderr,"blaalalal %s",peer_name);
   history_add (1, peer_name);
 
 }
@@ -869,7 +868,7 @@
     {
       type = "PHONE";
     }
-    FPRINTF (stdout, "%s", rname);
+//    FPRINTF (stdout, "%s", rname);
     gtk_list_store_append (contacts_liststore, &iter);
     gtk_list_store_set (contacts_liststore, &iter, 1, type, 0, rname, -1);
 
@@ -885,7 +884,7 @@
     //gtk_widget_show(contacts_liststore);
     GNUNET_free (s);
   }
-  FPRINTF (stdout, "%s", "\n");
+//  FPRINTF (stdout, "%s", "\n");
   GNUNET_NAMESTORE_zone_iterator_next (list_it);
 }
 
@@ -1122,9 +1121,9 @@
   GNUNET_GTK_set_icon_search_path ();
   GNUNET_GTK_setup_nls ();
   /* setup main window */
-  main_window = GTK_WIDGET (get_object ("GNUNET_GTK_conversation_window"));
+  main_window = GTK_WINDOW (get_object ("GNUNET_GTK_conversation_window"));
   main_window =
-      GNUNET_GTK_plug_me ("GNUNET_CONVERSATION_GTK_PLUG", 
GTK_WIDGET(main_window));
+      GTK_WIDGET(GNUNET_GTK_plug_me ("GNUNET_CONVERSATION_GTK_PLUG", 
GTK_WIDGET(main_window)));
   gtk_window_set_default_size (main_window, 300, 700);
   contacts_liststore =
       GTK_LIST_STORE (get_object
@@ -1169,20 +1168,19 @@
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
 
+
   cfg = GIG_get_configuration ();
 //cfg = GNUNET_CONFIGURATION_dup (c);
 
-  speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
-  mic = GNUNET_MICROPHONE_create_from_hardware (cfg);
+  speaker = GNUNET_SPEAKER_create_from_hardware (GIG_get_configuration());
+  mic = GNUNET_MICROPHONE_create_from_hardware (GIG_get_configuration());
 
-//  ego_name = "phone_ego"; 
   if (NULL == ego_name)
   {
     ego_name = "phone-ego";
-    LOG ("%s", _("No ego given, using default \"phone-ego\" \n"));
-    //return;
+    LOG (_("No ego given, using default: %s "), ego_name);
+    
   }
-  FPRINTF(stderr, "ego: %s \n", ego_name);
 
   id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
 
@@ -1223,7 +1221,7 @@
                                   &run))
     return 1;
   return 0;
-  FPRINTF (stderr, "line %i", line);
+//  FPRINTF (stderr, "line %i", line);
 }
 
 /* gui stuff start */
@@ -1239,7 +1237,7 @@
 quick_message (gchar * message, const char *caller_id)
 {
     GtkWidget *caller_name, *notification, *content_area;
-    GtkDialog *dialog;
+    GtkWidget *dialog;
     GtkWindow *main_window;
     main_window = GTK_WINDOW(get_object("GNUNET_GTK_conversation_window"));
     // Create the widgets 
@@ -1267,7 +1265,7 @@
     gtk_container_add (GTK_CONTAINER (content_area), caller_name);
     gtk_widget_show_all (GTK_WIDGET(dialog));
 
-    switch(gtk_dialog_run(dialog)){
+    switch(gtk_dialog_run(GTK_DIALOG(dialog))){
        case GTK_RESPONSE_ACCEPT :
                 do_status("");
                gtk_widget_destroy(GTK_WIDGET(dialog));
@@ -1296,12 +1294,13 @@
 void
 GNUNET_CONVERSATION_GTK_on_call_clicked ()
 {
-  char *to_addr;
+  char *to_addr = malloc(MAX_TO_ADDR*sizeof(char));
   GtkEntry *address_entry;
 
   address_entry = GTK_ENTRY (get_object ("GNUNET_GTK_conversation_address"));
-  to_addr = gtk_entry_get_text (address_entry);
+//  to_addr = gtk_entry_get_text (address_entry);
 
+  strcpy(to_addr, gtk_entry_get_text (address_entry));
 //    FPRINTF (stderr, _("calling: %s \n"), to_addr ); 
 
   do_call (to_addr);
@@ -1381,43 +1380,19 @@
 GNUNET_CONVERSATION_GTK_on_status_clicked ()
 {
 
-  FPRINTF (stderr, "status clicked \n");
 
 //    do_accept("0"); 
   do_status (" ");
   //quick_message('hee blaaat you have a call from blaat');
 }
 
-/*
-void
-GNUNET_contact_test ()
-{
-FPRINTF (stderr, "gnunet contact test"
-}
-*/
 
-void
-use_current_incoming_address ()
-{
-  FPRINTF (stderr, "use cur addr");
-}
-
-
 /*
-void
-test_function (gint response_id)
-{
-  FPRINTF (stderr, "teest %u", response_id);
-}
-*/
-
-
-/*
  * add a new contact
  * @param name
  * @param address
  */
-void add_contact(char *name, char *address)
+void add_contact(const gchar *name, const gchar *address)
 {
 //      memmove(&address+1,&address+51,1);
   GtkTreeIter iter;
@@ -1474,31 +1449,31 @@
 {
 //  gint response_id;
 
-  FPRINTF (stderr, "add clicked \n");
   //unused:  *anotherArea, *labelName, *labelAddres *caller_name
 
   GtkLabel *notification; 
-  GtkHBox *content_area;
+//  GtkHBox *content_area;
+  GtkContainer *content_area;
   GtkButton  *currentCheckButton;
   GtkEntry *nameEntry, *addressEntry;
   GtkDialog *dialog;
   GtkWindow *main_window;
 
   currentCheckButton =
-      gtk_button_new_with_label ("use currently incoming addres");
+      GTK_BUTTON(gtk_button_new_with_label ("use currently incoming addres"));
 
-  nameEntry = gtk_entry_new ();
+  nameEntry = GTK_ENTRY(gtk_entry_new ());
   gtk_entry_set_text (nameEntry, "Name of contact");
-  addressEntry = gtk_entry_new ();
+  addressEntry = GTK_ENTRY(gtk_entry_new ());
   gtk_entry_set_text (addressEntry, "Address of contact");
 
-  main_window = get_object ("GNUNET_GTK_conversation_window");
+  main_window = GTK_WINDOW(get_object ("GNUNET_GTK_conversation_window"));
 
   dialog =
-      gtk_dialog_new_with_buttons ("Adding contact", main_window,
+      GTK_DIALOG(gtk_dialog_new_with_buttons ("Adding contact", main_window,
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                    _("Add contact"), GTK_RESPONSE_ACCEPT,
-                                   _("Cancel"), GTK_RESPONSE_CANCEL, NULL);
+                                   _("Cancel"), GTK_RESPONSE_CANCEL, NULL));
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(currentCheckButton), 
GTK_RESPONSE_OK);
 //  FPRINTF (stderr, "response id : %u", response_id);
 //  g_signal_connect (GTK_BUTTON (currentCheckButton), "clicked",
@@ -1508,10 +1483,10 @@
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(nameEntry), 2);
   gtk_dialog_add_action_widget (dialog, GTK_WIDGET(addressEntry), 3);
 
-  content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+  content_area = GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG 
(dialog)));
 
 
-  notification = gtk_label_new ("Adding contact");
+  notification = GTK_LABEL(gtk_label_new ("Adding contact"));
 //    caller_name = gtk_label_new (caller_id);
 
   // Add the labels, and show everything we've added to the dialog 
@@ -1522,7 +1497,6 @@
   switch (gtk_dialog_run (dialog))
   {
   case GTK_RESPONSE_ACCEPT:
-    FPRINTF (stderr, "accept clicked");
     do_status ("");
     add_contact (gtk_entry_get_text (nameEntry),
                  gtk_entry_get_text (addressEntry));
@@ -1552,7 +1526,6 @@
 GNUNET_CONVERSATION_GTK_on_remove_clicked (GtkButton * button,
                gpointer * user_data)
 {
-  FPRINTF (stderr, "remove clicked \n");
   GtkTreeSelection *selection;
   GtkTreeModel     *model;
   GtkTreeIter       iter;
@@ -1566,14 +1539,14 @@
   {
     gtk_tree_model_get (model, &iter, 0, &name, -1);
     FPRINTF(stderr, "selected %s \n", name);
-    main_window = get_object ("GNUNET_GTK_conversation_window");
+    main_window = GTK_WINDOW(get_object ("GNUNET_GTK_conversation_window"));
     confirm =
-        gtk_dialog_new_with_buttons ("Removing contact", main_window,
+        GTK_DIALOG(gtk_dialog_new_with_buttons ("Removing contact", 
main_window,
                                      GTK_DIALOG_DESTROY_WITH_PARENT,
                                      _("Yes"), GTK_RESPONSE_ACCEPT,
-                                     _("No"), GTK_RESPONSE_CANCEL, NULL); 
-    content_area = gtk_dialog_get_content_area (GTK_DIALOG (confirm));
-    notification = gtk_label_new ("Do you really want to remove this 
contact?");
+                                     _("No"), GTK_RESPONSE_CANCEL, NULL)); 
+    content_area = GTK_CONTAINER(gtk_dialog_get_content_area (GTK_DIALOG 
(confirm)));
+    notification = GTK_LABEL(gtk_label_new ("Do you really want to remove this 
contact?"));
     gtk_container_add (GTK_CONTAINER (content_area), GTK_WIDGET(notification));
     gtk_widget_show_all (GTK_WIDGET(confirm));
     switch (gtk_dialog_run(confirm))

Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-01-29 
19:45:49 UTC (rev 32075)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.h       2014-01-29 
21:24:42 UTC (rev 32076)
@@ -38,9 +38,9 @@
 
 #define LOG(format, ...) log_message(g_strdup_printf (format, ## __VA_ARGS__))
 
+#define MAX_TO_ADDR 124
 
 
-
 /**
  * Get our configuration.
  *
@@ -122,8 +122,17 @@
   CS_SUSPENDED
 };
 
+enum CallHistoryType
+{
+   CH_ACCEPTED,
+   CH_REJECTED,
+   CH_OUTGOING,
+   CH_HANGUP,
+   CH_MISSED
+};
 
 
+
 /**
  * List of incoming calls
  */




reply via email to

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