[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33387 - gnunet-gtk/src/conversation
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33387 - gnunet-gtk/src/conversation |
Date: |
Mon, 26 May 2014 10:59:30 +0200 |
Author: grothoff
Date: 2014-05-26 10:59:30 +0200 (Mon, 26 May 2014)
New Revision: 33387
Modified:
gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.h
Log:
-a bit more cleanup
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk.c 2014-05-26
08:47:02 UTC (rev 33386)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk.c 2014-05-26
08:59:30 UTC (rev 33387)
@@ -383,17 +383,13 @@
gpointer cl_caller;
gpointer cl_call;
- gtk_tree_model_get (GTK_TREE_MODEL(active_liststore), >kiter,
+ gtk_tree_model_get (GTK_TREE_MODEL (active_liststore),
+ >kiter,
AL_caller, &cl_caller,
AL_caller_id, &str_data,
AL_caller_num, &int_data,
AL_call, &cl_call,
-1);
- if (caller_selected == cl_caller)
- {
- currentlySelectedCallAddress = str_data;
- break;
- }
if (call_selected == cl_call)
{
GCG_log (_("info for active outgoing call:%s number: %u row: %u"),
@@ -1529,28 +1525,19 @@
main_window = GTK_WINDOW (GCG_get_main_window_object
("GNUNET_GTK_conversation_window"));
main_window =
GTK_WINDOW (GNUNET_GTK_plug_me
- ("GNUNET_CONVERSATION_GTK_PLUG", GTK_WIDGET (main_window)));
- gtk_window_set_default_size (main_window, 700, 700);
-
+ ("GNUNET_CONVERSATION_GTK_PLUG",
+ GTK_WIDGET (main_window)));
// active calls
active_liststore =
GTK_LIST_STORE (GCG_get_main_window_object
("gnunet_conversation_gtk_active_calls_liststore"));
active_treeview =
GTK_TREE_VIEW (GCG_get_main_window_object
("gnunet_conversation_gtk_active_calls_treeview"));
-
-
- // gtk_tree_view_set_activate_on_single_click(contacts_treeview, TRUE);
-
-
- // gtk_window_maximize (GTK_WINDOW (main_window));
-
if (NULL == getenv ("GNUNET_CONVERSATION_GTK_PLUG"))
GNUNET_GTK_tray_icon_create (ml, GTK_WINDOW (main_window),
"gnunet-conversation-gtk"
/* FIXME: different icon? */ ,
"gnunet-conversation-gtk");
-
/* make GUI visible */
if (!tray_only)
{
@@ -1559,33 +1546,26 @@
}
/* get gui objects */
-
- if(debug_box_enabled)
- {
-
gtk_widget_show(GTK_WIDGET(GCG_get_main_window_object("GNUNET_CONVERSATION_log_box")));
- }
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
+ if (debug_box_enabled)
+ gtk_widget_show (GTK_WIDGET (GCG_get_main_window_object
("GNUNET_CONVERSATION_log_box")));
+ GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
+ &shutdown_task,
NULL);
-
cfg = GNUNET_CONFIGURATION_dup (GCG_get_configuration ());
-
speaker = GNUNET_SPEAKER_create_from_hardware (cfg);
mic = GNUNET_MICROPHONE_create_from_hardware (cfg);
-
b_contact = GTK_WIDGET (GCG_get_main_window_object
("GNUNET_GTK_conversation_use_current_button"));
b_accept = GTK_WIDGET (GCG_get_main_window_object
("GNUNET_GTK_conversation_accept_button"));
b_hangup = GTK_WIDGET (GCG_get_main_window_object
("GNUNET_GTK_conversation_hangup_button"));
b_suspend = GTK_WIDGET (GCG_get_main_window_object
("GNUNET_GTK_conversation_suspend_button"));
b_resume = GTK_WIDGET (GCG_get_main_window_object
("GNUNET_GTK_conversation_resume_button"));
-
if (NULL == ego_name)
{
ego_name = "phone-ego";
GCG_log (_("No ego given, using default: %s "), ego_name);
-
}
- id = GNUNET_IDENTITY_connect (cfg, &identity_cb, NULL);
-
+ id = GNUNET_IDENTITY_connect (cfg,
+ &identity_cb, NULL);
GNUNET_CONVERSATION_GTK_CONTACTS_init ();
}
@@ -1604,34 +1584,35 @@
{'p', "phone", "LINE",
gettext_noop ("sets the LINE to use for the phone"),
1, &GNUNET_GETOPT_set_uint, &line},
-
{'e', "ego", "ego",
gettext_noop ("select ego to use"), 1,
&GNUNET_GETOPT_set_string, &ego_name},
-
{'d', "debug_box", "1 or 0",
gettext_noop ("enable debug box"), 1,
&GNUNET_GETOPT_set_uint, &debug_box_enabled},
-
-
{'t', "tray", NULL,
gettext_noop ("start in tray mode"), 0,
&GNUNET_GETOPT_set_one, &tray_only},
GNUNET_GETOPT_OPTION_END
};
+ int ret;
+
if (GNUNET_OK !=
GNUNET_GTK_main_loop_start ("gnunet-conversation-gtk",
- "GTK GUI for conversation", argc, argv,
+ "GTK GUI for conversation",
+ argc, argv,
options,
"gnunet_conversation_gtk_main_window.glade",
&run))
- return 1;
+ ret = 1;
+ else
+ ret = 0;
if (NULL != cfg)
{
GNUNET_CONFIGURATION_destroy (cfg);
cfg = NULL;
}
- return 0;
+ return ret;
}
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-05-26 08:47:02 UTC (rev 33386)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.c
2014-05-26 08:59:30 UTC (rev 33387)
@@ -26,61 +26,22 @@
*/
#include "gnunet-conversation-gtk.h"
-
-//#include "gnunet/gnunet_gnsrecord_lib.h"
-
-
-
-///////////////////
-//addressbook
-//#include "gnunet_gtk.h"
-
-//#include "gnunet/gnunet_identity_service.h"
-//#include "gnunet/gnunet_namestore_service.h"
-//#include "gnunet/gnunet_gnsrecord_lib.h"
-
-/*************
- * contacts *
- *************/
-
/**
* Our ego.
*/
static struct GNUNET_IDENTITY_Ego *contacts_ego;
-
-
-//static struct GNUNET_CONFIGURATION_Handle *cfg1;
-//static struct GNUNET_CONFIGURATION_Handle *cfg2;
-
-
-
-char *currentlySelectedCallAddress;
-
-//static void
-//identity_cb (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx,
-// const char *name);
-
-
/**
* List of contacts (records).
*/
static GtkListStore *contacts_liststore;
-
/**
* list of zones
*/
static GtkListStore *zone_liststore;
/**
- * zone treestore
- */
-/*
-static GtkTreeStore *zone_treestore;
-*/
-
-/**
* zone treeview
*/
static GtkTreeView *zone_treeview;
@@ -90,14 +51,7 @@
*/
static GtkTreeModel *zone_treemodel;
-
-
/**
- * List of contacts.
- */
-//static GtkTreeStore *contacts_treestore;
-
-/**
* The main tree view for 'gns' that shows the records.
*/
static GtkTreeView *contacts_treeview;
@@ -114,13 +68,12 @@
static struct GNUNET_IDENTITY_Ego *currentAddressBookEgo;
+
/**
* Handle to identity service.
*/
static struct GNUNET_IDENTITY_Handle *id;
-
-
/**
* Handle to the namestore.
*/
@@ -132,19 +85,9 @@
static struct GNUNET_CRYPTO_EcdsaPrivateKey zone_pkey;
/**
- * Public key of the zone we are currently editing.
- */
-/*
-static struct GNUNET_CRYPTO_EcdsaPublicKey pubkey;
-*/
-
-
-
-
-/**
* Name of the records to add/list/remove.
*/
- static char *name;
+static char *name;
/**
* Queue entry for the 'add' operation.
@@ -157,7 +100,6 @@
static struct GNUNET_NAMESTORE_QueueEntry *del_qe;
-
////////////////////////////
static void
display_record (void *cls,
@@ -166,10 +108,9 @@
unsigned int rd_len,
const struct GNUNET_GNSRECORD_Data *rd)
{
-/* const char *typestring;*/
- char *s, *type;
+ char *s;
+ char *type;
unsigned int i;
-/* const char *ets;*/
struct GNUNET_TIME_Absolute at;
struct GNUNET_TIME_Relative rt;
GtkTreeIter display_iter;
@@ -320,6 +261,7 @@
//test_finished ();
}
+
/**
* Continuation called to notify client about result of the
* operation.
@@ -347,13 +289,15 @@
// test_finished ();
}
-/*
+
+/**
* add a new contact
* @param name
* @param address
*/
static void
-add_contact (const gchar * name, const gchar * address)
+add_contact (const gchar *name,
+ const gchar *address)
{
// memmove(&address+1,&address+51,1);
GtkTreeIter iter;
@@ -469,17 +413,17 @@
}
}
+
void
-GNUNET_CONVERSATION_GTK_on_current_clicked (GtkButton * button,
- gpointer * user_data)
+GNUNET_CONVERSATION_GTK_on_current_clicked (GtkButton *button,
+ gpointer *user_data)
{
GtkEntry *addressEntry;
-// FPRINTF(stderr,"on current clicked %s\n",callerName);
- //char *strippedAddress;
- addressEntry = GTK_ENTRY (GCG_get_main_window_object
("GNUNET_GTK_conversation_addressAdd"));
- currentlySelectedCallAddress[52] = '\0';
- gtk_entry_set_text(addressEntry, currentlySelectedCallAddress);
+ addressEntry = GTK_ENTRY (GCG_get_main_window_object
("GNUNET_GTK_conversation_addressAdd"));
+ gtk_entry_set_text (addressEntry,
+ "FIXME");
+
}
@@ -606,20 +550,19 @@
//////
-extern void
+void
GNUNET_CONVERSATION_GTK_CONTACTS_init ()
{
GtkTreeIter iterContactsInit;
-
-
-
// contacts
contacts_liststore =
GTK_LIST_STORE (GCG_get_main_window_object
("gnunet_conversation_gtk_contacts_liststore"));
contacts_treeview =
GTK_TREE_VIEW (GCG_get_main_window_object
("gnunet_conversation_gtk_treeview"));
+
+ // gtk_tree_view_set_activate_on_single_click (contacts_treeview, TRUE);
contacts_treemodel = GTK_TREE_MODEL (contacts_liststore);
// zone list
@@ -646,7 +589,8 @@
}
-extern void
+
+void
GNUNET_CONVERSATION_GTK_CONTACTS_shutdown()
{
Modified: gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.h
===================================================================
--- gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.h
2014-05-26 08:47:02 UTC (rev 33386)
+++ gnunet-gtk/src/conversation/gnunet-conversation-gtk_contacts.h
2014-05-26 08:59:30 UTC (rev 33387)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2010-2013 Christian Grothoff (and other contributing authors)
+ (C) 2010-2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -19,11 +19,14 @@
*/
/**
- * @file src/conversation/gnunet-conversation-gtk_history.h
- * @brief
+ * @file src/conversation/gnunet-conversation-gtk_contacts.h
+ * @brief
* @author yids
* @author hark
*/
+#ifndef GNUNET_CONVERSATION_GTK_CONTACTS_H
+#define GNUNET_CONVERSATION_GTK_CONTACTS_H
+
/*
extern void
display_record (void *cls, const struct GNUNET_CRYPTO_EcdsaPrivateKey
*zone_key,
@@ -31,20 +34,17 @@
const struct GNUNET_GNSRECORD_Data *rd);
*/
-extern char *currentlySelectedCallAddress;
-
/**
* function to initialize the contact list
-*/
-
+ */
extern void
GNUNET_CONVERSATION_GTK_CONTACTS_init ();
-/**
+
+/**
* function to shutdown the contact list
-*/
-
+ */
extern void
GNUNET_CONVERSATION_GTK_CONTACTS_shutdown();
-
+#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33387 - gnunet-gtk/src/conversation,
gnunet <=