Skip to content
Snippets Groups Projects
Commit 5a9747aa authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Merge commit 'origin/release' into time_call

Conflicts:

	sflphone-gtk/src/Makefile.am
	sflphone-gtk/src/calltree.c
parents 3330ab60 b205434c
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ sflphone_gtk_SOURCES = \
menus.c \
calltab.c \
calltree.c \
historyfilter.c \
actions.c \
configwindow.c \
accountlist.c \
......@@ -25,7 +26,7 @@ sflphone_gtk_SOURCES = \
noinst_HEADERS = actions.h dbus.h sflnotify.h mainwindow.h calllist.h dialpad.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.h timestamp.h
historyfilter.h accountlist.h accountwindow.h marshaller.h sliders.h statusicon.h timestamp.h
EXTRA_DIST = marshaller.list
sflphone_gtk_LDADD = $(DEPS_LIBS) -lnotify
......
......@@ -25,6 +25,7 @@
#include <menus.h>
#include <statusicon.h>
#include <calltab.h>
#include <historyfilter.h>
#include <gtk/gtk.h>
#include <string.h>
......@@ -194,6 +195,7 @@ sflphone_init()
int i;
current_calls = calltab_init();
history = calltab_init();
histfilter = create_filter(GTK_TREE_MODEL(history->store));
account_list_init ();
codec_list_init();
if(!dbus_connect ()){
......
......@@ -23,6 +23,7 @@
#include <calllist.h>
#include <gtk/gtk.h>
GtkTreeModel* histfilter;
calltab_t* calltab_init();
......
......@@ -137,21 +137,22 @@ unhold( GtkWidget *widget, gpointer data )
toggle_history(GtkToggleToolButton *toggle_tool_button,
gpointer user_data)
{
GtkTreeSelection *sel;
if(history_shown){
active_calltree = current_calls;
gtk_widget_hide(history->tree);
gtk_widget_show(current_calls->tree);
history_shown = FALSE;
}else{
active_calltree = history;
gtk_widget_hide(current_calls->tree);
gtk_widget_show(history->tree);
history_shown = TRUE;
}
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view));
g_signal_emit_by_name(sel, "changed");
toolbar_update_buttons();
GtkTreeSelection *sel;
if(history_shown){
active_calltree = current_calls;
gtk_widget_hide(history->tree);
gtk_widget_show(current_calls->tree);
history_shown = FALSE;
}else{
active_calltree = history;
gtk_widget_hide(current_calls->tree);
gtk_widget_show(history->tree);
history_shown = TRUE;
}
sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (active_calltree->view));
g_signal_emit_by_name(sel, "changed");
toolbar_update_buttons();
gtk_tree_model_filter_refilter(histfilter);
}
......
......@@ -31,6 +31,8 @@
* @brief The GtkTreeView that list calls in the main window.
*/
GtkToolItem * historyButton;
calltab_t* active_calltree;
/**
* Create a new widget calltree
......
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Antoine Reversat <antoine.reversat@savoirfairelinux.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <gtk/gtk.h>
#include <historyfilter.h>
#include <calltree.h>
GtkTreeModel*
create_filter(GtkTreeModel* child)
{
GtkTreeModel* ret = gtk_tree_model_filter_new(child, NULL);
gtk_tree_model_filter_set_visible_func(GTK_TREE_MODEL_FILTER(ret), is_visible, NULL, NULL);
return GTK_TREE_MODEL(ret);
}
gboolean
is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data)
{
GValue val = {0, };
gchar* text;
gchar* search = gtk_entry_get_text(GTK_ENTRY(filter_entry));
gtk_tree_model_get_value(GTK_TREE_MODEL(model), iter, 1, &val);
if(G_VALUE_HOLDS_STRING(&val)){
text = (gchar *)g_value_get_string(&val);
}
if(text != NULL && g_ascii_strncasecmp(search, "Search", 6) != 0){
return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
}
return TRUE;
}
void
filter_entry_changed(GtkEntry* entry, gchar* arg1, gpointer data)
{
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(historyButton), TRUE);
gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(histfilter));
}
void
clear_filter_entry_if_default(GtkWidget* widget, gpointer user_data)
{
if(g_ascii_strncasecmp(gtk_entry_get_text(GTK_ENTRY(filter_entry)), "Search", 6) == 0)
gtk_entry_set_text(GTK_ENTRY(filter_entry), "");
}
void
clear_filter_entry(GtkButton* button,
gpointer user_data)
{
gtk_entry_set_text(GTK_ENTRY(filter_entry), "");
}
GtkWidget*
create_filter_entry()
{
GtkWidget* clear_button = gtk_button_new();
GtkWidget* ret = gtk_hbox_new(FALSE, 0);
GtkWidget* clear_img = gtk_image_new_from_stock(GTK_STOCK_CLEAR, GTK_ICON_SIZE_SMALL_TOOLBAR);
gtk_button_set_image(GTK_BUTTON(clear_button), clear_img);
g_signal_connect(GTK_BUTTON(clear_button), "clicked", G_CALLBACK(clear_filter_entry), NULL);
filter_entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(filter_entry), "Search");
g_signal_connect(GTK_ENTRY(filter_entry), "changed", G_CALLBACK(filter_entry_changed), NULL);
g_signal_connect(GTK_ENTRY(filter_entry), "grab-focus", G_CALLBACK(clear_filter_entry_if_default), NULL);
gtk_box_pack_start(GTK_BOX(ret), filter_entry, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(ret), clear_button, FALSE, FALSE, 0);
return ret;
}
/*
* Copyright (C) 2007 Savoir-Faire Linux inc.
* Author: Antoine Reversat <antoine.reversat@savoirfairelinux.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __HFILTER_H__
#define __HFILTER_H__
#include <calllist.h>
#include <gtk/gtk.h>
GtkWidget * filter_entry;
GtkTreeModel* create_filter(GtkTreeModel* child);
gboolean is_visible(GtkTreeModel* model, GtkTreeIter* iter, gpointer data);
GtkWidget* create_filter_entry();
#endif
......@@ -27,6 +27,7 @@
#include <mainwindow.h>
#include <menus.h>
#include <sliders.h>
#include <historyfilter.h>
#include <gtk/gtk.h>
......@@ -131,8 +132,8 @@ create_main_window ()
*/
g_signal_connect (G_OBJECT (window), "delete-event",
G_CALLBACK (on_delete), NULL);
g_signal_connect (G_OBJECT (window), "key-press-event",
G_CALLBACK (on_key_released), NULL);
//g_signal_connect (G_OBJECT (window), "key-press-event",
// G_CALLBACK (on_key_released), NULL);
/* Create an accel group for window's shortcuts */
accelGroup = gtk_accel_group_new ();
......@@ -146,7 +147,9 @@ create_main_window ()
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
widget = create_toolbar();
gtk_box_pack_start (GTK_BOX (vbox), widget, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), create_filter_entry(), FALSE /*expand*/, FALSE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), current_calls->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_box_pack_start (GTK_BOX (vbox), history->tree, TRUE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
......@@ -179,6 +182,7 @@ create_main_window ()
gtk_widget_hide(history->tree);
//gtk_widget_show(current_calls->tree);
gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(histfilter));
// Configuration wizard
if (account_list_get_size() == 0)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment