diff --git a/.gitignore b/.gitignore index 7fe1d65caaba9365f636aa817de17497b3886575..4dbef9703df26348cb48869747c39ea40690170d 100644 --- a/.gitignore +++ b/.gitignore @@ -83,7 +83,9 @@ libs/utilspp/functor/Makefile libs/utilspp/singleton/Makefile sflphone-gtk/Makefile sflphone-gtk/src/Makefile -sflphone-gtk/src/contactlist/Makefile +sflphone-gtk/src/config/Makefile +sflphone-gtk/src/contacts/Makefile +sflphone-gtk/src/contacts/addressbook/Makefile sflphone-gtk/pixmaps/Makefile diff --git a/sflphone-gtk/configure.ac b/sflphone-gtk/configure.ac index e6e25412930a5348f41dd659386bd3fe14909bb8..74de68eefd4d95ae2265b51fc8ce547a3385d02b 100644 --- a/sflphone-gtk/configure.ac +++ b/sflphone-gtk/configure.ac @@ -42,8 +42,10 @@ AC_SUBST(DEPS_LIBS) AC_OUTPUT([ Makefile -src/Makefile -src/contactlist/Makefile +src/Makefile +src/config/Makefile +src/contacts/Makefile +src/contacts/addressbook/Makefile pixmaps/Makefile sflphone.desktop ]) diff --git a/sflphone-gtk/globals.mak b/sflphone-gtk/globals.mak new file mode 100644 index 0000000000000000000000000000000000000000..a19cd4c570209bf7f9301d321f9cb665ed3a991a --- /dev/null +++ b/sflphone-gtk/globals.mak @@ -0,0 +1,14 @@ +# Global variables +src = $(top_srcdir) + +# Preprocessor flags +AM_CPPFLAGS = $(DEPS_CFLAGS) \ + -I$(src)/src \ + -I$(src)/src/config \ + -I$(src)/src/contacts \ + -I$(src)/src/addressbook \ + -DICONS_DIR=\""$(prefix)/share/sflphone"\" \ + -DCODECS_DIR=\""$(prefix)/lib/sflphone/codecs"\" + -DPREFIX=\"$(prefix)\" \ + $(ZEROCONFFLAGS) \ + -DENABLE_TRACE diff --git a/sflphone-gtk/src/Makefile.am b/sflphone-gtk/src/Makefile.am index 5947dcd0830475723a046da865e58f49e7c15ce1..cabb4c20952f61e5d806a282ec74eed28bb983e1 100644 --- a/sflphone-gtk/src/Makefile.am +++ b/sflphone-gtk/src/Makefile.am @@ -1,19 +1,13 @@ +include ../globals.mak + bin_PROGRAMS = sflphone-gtk -SUBDIRS=contactlist +SUBDIRS = config contacts -# noinst_LTLIBRARIES = libsflphonegtk.la - -NOFIFY_LIBS=-lnotify -SEXY_LIBS=-lsexy +NOFIFY_LIBS = -lnotify +SEXY_LIBS = -lsexy -#if GTK_CHECK_VERSION(2,10,0) -STATUSICON_HEADER = statusicon.h -STATUSICON_SOURCE = statusicon.c -#elif -#STATUSICON_HEADER = -#STATUSICON_SOURCE = -#endif +SFLPHONEGTK_LIBS=./contacts/libcontacts.la ./config/libconfig.la sflphone_gtk_SOURCES = \ main.c \ @@ -28,33 +22,25 @@ sflphone_gtk_SOURCES = \ menus.c \ calltab.c \ calltree.c \ - searchfilter.c \ actions.c \ configwindow.c \ accountlist.c \ accountwindow.c \ marshaller.c \ sliders.c \ - $(STATUSICON_SOURCE) \ + statusicon.c \ codeclist.c \ timestamp.c \ reqaccount.c \ - addressbook-config.c \ hooks-config.c noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.h audioconf.h codeclist.h assistant.h \ callmanager-glue.h errors.h sflphone_const.h configurationmanager-glue.h instance-glue.h menus.h calltab.h calltree.h configwindow.h \ - accountlist.h accountwindow.h marshaller.h sliders.h $(STATUSICON_HEADER) timestamp.h searchfilter.h reqaccount.h addressbook-config.h hooks-config.h + accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h timestamp.h reqaccount.h hooks-config.h EXTRA_DIST = marshaller.list -sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS) \ - ./contactlist/libcontact.la - - -AM_CPPFLAGS = $(DEPS_CFLAGS) \ - -DICONS_DIR=\""$(prefix)/share/sflphone"\" \ - -DCODECS_DIR=\""$(prefix)/lib/sflphone/codecs"\" +sflphone_gtk_LDADD = $(DEPS_LIBS) $(NOTIFY_LIBS) $(SEXY_LIBS) $(SFLPHONEGTK_LIBS) # add symbolic link install-exec-local: diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c index 4e850958329d331bf6b2c030b496f1a8a426a722..cc27d4aa1f73c0a23e19168a1a452df792820fde 100644 --- a/sflphone-gtk/src/actions.c +++ b/sflphone-gtk/src/actions.c @@ -25,8 +25,8 @@ #include <menus.h> #include <statusicon.h> #include <calltab.h> -#include <searchfilter.h> -#include <contactlist/eds.h> +#include <contacts/searchfilter.h> +#include <contacts/addressbook/eds.h> #include <gtk/gtk.h> #include <string.h> @@ -296,7 +296,7 @@ sflphone_hang_up() void sflphone_pick_up() { - + call_t * selectedCall = call_get_selected(active_calltree); if(selectedCall) { @@ -370,7 +370,7 @@ sflphone_off_hold () break; } } - + if(dbus_get_is_recording(selectedCall)) g_print("Currently recording! \n"); else @@ -489,7 +489,7 @@ process_dialing(call_t * c, guint keyval, gchar * key) c->from = g_strconcat("\"\" <", c->to, ">", NULL); } update_call_tree(current_calls,c); - } + } else if(strlen(c->to) == 0) { if(c->state != CALL_STATE_TRANSFERT) @@ -506,7 +506,7 @@ process_dialing(call_t * c, guint keyval, gchar * key) default: // if (keyval < 255 || (keyval >65453 && keyval < 65466)) if (keyval < 127 || (keyval > 65400 && keyval < 65466)) - { + { if(c->state != CALL_STATE_TRANSFERT) dbus_play_dtmf( key ); @@ -530,7 +530,7 @@ process_dialing(call_t * c, guint keyval, gchar * key) call_t * sflphone_new_call() { - + call_t *c; gchar *from, *to; @@ -684,9 +684,9 @@ sflphone_place_call ( call_t * c ) if(c->state == CALL_STATE_DIALING && strcmp(c->to, "") != 0) { - - //format_phone_number (&c->to); - + + //format_phone_number (&c->to); + if( account_list_get_size() == 0 ) { notify_no_accounts(); @@ -701,8 +701,8 @@ sflphone_place_call ( call_t * c ) else { - - + + account_t * current; if(g_strcasecmp(c->accountID, "") != 0) { @@ -713,11 +713,11 @@ sflphone_place_call ( call_t * c ) // printf("sflphone_place_call :: c->accountID : %i \n",c->accountID); // account_t * current = c->accountID; - - + + if( current ) { - + if(g_strcasecmp(g_hash_table_lookup( current->properties, "Status"),"REGISTERED")==0) { // OK, everything alright - the call is made with the current account @@ -740,7 +740,7 @@ sflphone_place_call ( call_t * c ) } else { - + // No current accounts have been setup. // So we place a call with the first registered account // and we change the current account @@ -763,7 +763,7 @@ sflphone_place_call ( call_t * c ) void sflphone_display_selected_codec (const gchar* codecName) { - + call_t * selectedCall = call_get_selected(current_calls); gchar* msg; account_t* acc; diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c index 4a9b15268d4053a12d3cb81df00e5001d7680442..c0ef4fb5ca3fa335c1b66798540e3c5c078ebdc0 100644 --- a/sflphone-gtk/src/calltree.c +++ b/sflphone-gtk/src/calltree.c @@ -27,10 +27,10 @@ #include <calllist.h> #include <calltab.h> #include <menus.h> -#include <searchfilter.h> +#include <contacts/searchfilter.h> +#include <contacts/addressbook/eds.h> #include <dbus.h> -#include <contactlist/eds.h> -#include "addressbook-config.h" +#include <addressbook-config.h> GtkWidget * toolbar; GtkToolItem * pickupButton; diff --git a/sflphone-gtk/src/config/Makefile.am b/sflphone-gtk/src/config/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..1d6d5eafec4bc41dd1f0737f38e3e2896227c4f6 --- /dev/null +++ b/sflphone-gtk/src/config/Makefile.am @@ -0,0 +1,9 @@ +include ../../globals.mak + +noinst_LTLIBRARIES = libconfig.la + +libconfig_la_SOURCES = addressbook-config.c + +libconfig_la_LDFLAGS = @DEPS_LDFLAGS@ + +libconfig_la_CFLAGS = @DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/addressbook-config.c b/sflphone-gtk/src/config/addressbook-config.c similarity index 100% rename from sflphone-gtk/src/addressbook-config.c rename to sflphone-gtk/src/config/addressbook-config.c diff --git a/sflphone-gtk/src/addressbook-config.h b/sflphone-gtk/src/config/addressbook-config.h similarity index 100% rename from sflphone-gtk/src/addressbook-config.h rename to sflphone-gtk/src/config/addressbook-config.h diff --git a/sflphone-gtk/src/contactlist/Makefile.am b/sflphone-gtk/src/contactlist/Makefile.am deleted file mode 100644 index d603d369c831b92052444431560433b399f92747..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/contactlist/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -noinst_LTLIBRARIES = libcontact.la - -libcontact_la_SOURCES = \ - eds.c - -libcontact_la_LDFLAGS=@DEPS_LDFLAGS@ - -libcontact_la_CFLAGS=@DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/contactlist/TODO b/sflphone-gtk/src/contactlist/TODO deleted file mode 100644 index d520dd99e7feff8a03b173935df27517818fb38f..0000000000000000000000000000000000000000 --- a/sflphone-gtk/src/contactlist/TODO +++ /dev/null @@ -1,7 +0,0 @@ -Ref trac http://dev.savoirfairelinux.net/sflphone/report/3 - -* Ticket #163 -* Ticket #164 -* Ticket #165 -* Ticket #166 - diff --git a/sflphone-gtk/src/contacts/Makefile.am b/sflphone-gtk/src/contacts/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..92ec35f743827933eb7be34d05fbfd710d16b165 --- /dev/null +++ b/sflphone-gtk/src/contacts/Makefile.am @@ -0,0 +1,13 @@ +include ../../globals.mak + +SUBDIRS = addressbook + +noinst_LTLIBRARIES = libcontacts.la + +libcontacts_la_SOURCES = searchfilter.c + +libcontacts_la_LDFLAGS = @DEPS_LDFLAGS@ + +libcontacts_la_CFLAGS = @DEPS_CFLAGS@ + +libcontacts_la_LIBADD = ./addressbook/libaddressbook.la \ No newline at end of file diff --git a/sflphone-gtk/src/contacts/addressbook/Makefile.am b/sflphone-gtk/src/contacts/addressbook/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..9864cf7e3bca2eda4da100ae545187c8364893dd --- /dev/null +++ b/sflphone-gtk/src/contacts/addressbook/Makefile.am @@ -0,0 +1,9 @@ +include ../../../globals.mak + +noinst_LTLIBRARIES = libaddressbook.la + +libaddressbook_la_SOURCES = eds.c + +libaddressbook_la_LDFLAGS = @DEPS_LDFLAGS@ + +libaddressbook_la_CFLAGS = @DEPS_CFLAGS@ diff --git a/sflphone-gtk/src/contactlist/eds.c b/sflphone-gtk/src/contacts/addressbook/eds.c similarity index 100% rename from sflphone-gtk/src/contactlist/eds.c rename to sflphone-gtk/src/contacts/addressbook/eds.c diff --git a/sflphone-gtk/src/contactlist/eds.h b/sflphone-gtk/src/contacts/addressbook/eds.h similarity index 100% rename from sflphone-gtk/src/contactlist/eds.h rename to sflphone-gtk/src/contacts/addressbook/eds.h diff --git a/sflphone-gtk/src/searchfilter.c b/sflphone-gtk/src/contacts/searchfilter.c similarity index 99% rename from sflphone-gtk/src/searchfilter.c rename to sflphone-gtk/src/contacts/searchfilter.c index ce8df3d5c3526c3a83c5d6b2227e277272963b22..bf29fc1c88c4d825a5ac3bc08f2ae55c666e596b 100644 --- a/sflphone-gtk/src/searchfilter.c +++ b/sflphone-gtk/src/contacts/searchfilter.c @@ -23,7 +23,7 @@ #include <searchfilter.h> #include <calltree.h> -#include <contactlist/eds.h> +#include <addressbook/eds.h> #include "addressbook-config.h" static void handler_async_search (GList *hits, gpointer user_data UNUSED); diff --git a/sflphone-gtk/src/searchfilter.h b/sflphone-gtk/src/contacts/searchfilter.h similarity index 100% rename from sflphone-gtk/src/searchfilter.h rename to sflphone-gtk/src/contacts/searchfilter.h diff --git a/sflphone-gtk/src/mainwindow.c b/sflphone-gtk/src/mainwindow.c index 4473a53176133923eff6fda2f3dd2b4e146c42bf..aa72b57116be3281933b1c540688eac6698687a7 100644 --- a/sflphone-gtk/src/mainwindow.c +++ b/sflphone-gtk/src/mainwindow.c @@ -27,7 +27,7 @@ #include <mainwindow.h> #include <menus.h> #include <sliders.h> -#include <searchfilter.h> +#include <contacts/searchfilter.h> #include <assistant.h> #include <gtk/gtk.h> @@ -141,13 +141,13 @@ create_main_window () gtk_box_pack_start (GTK_BOX (vbox), subvbox, FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/); - + // if( SHOW_SEARCHBAR ){ // filterEntry = create_filter_entry(); // gtk_box_pack_start (GTK_BOX (subvbox), filterEntry, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); // gtk_widget_show_all ( filterEntry ); // } - + if( SHOW_VOLUME ){ speaker_control = create_slider("speaker");