Merge lp:~rodrigo-moya/ubuntuone-client/same-selection-in-both-tabs into lp:ubuntuone-client

Proposed by Rodrigo Moya
Status: Merged
Approved by: Rodrigo Moya
Approved revision: 495
Merged at revision: not available
Proposed branch: lp:~rodrigo-moya/ubuntuone-client/same-selection-in-both-tabs
Merge into: lp:ubuntuone-client
Diff against target: 55 lines (+35/-2)
1 file modified
nautilus/contacts-view.c (+35/-2)
To merge this branch: bzr merge lp:~rodrigo-moya/ubuntuone-client/same-selection-in-both-tabs
Reviewer Review Type Date Requested Status
Eric Casteleijn (community) Approve
Rick McBride (community) Approve
Review via email: mp+23385@code.launchpad.net

Commit message

Match the selection in both views of the contacts picker

Description of the change

Match the selection in both views of the contacts picker

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) :
review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote :

looks good, tests pass.

review: Approve
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :
Download full text (33.7 KiB)

The attempt to merge lp:~rodrigo-moya/ubuntuone-client/same-selection-in-both-tabs into lp:ubuntuone-client failed.Below is the output from the failed tests.

/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
(B testing autoconf2.50... not found.
  testing autoconf... found 2.65
checking for automake >= 1.10...
(B testing automake-1.11... found 1.11.1
checking for libtool >= 1.5...
(B testing libtoolize... found 2.2.6b
checking for intltool >= 0.30...
(B testing intltoolize... found 0.41.0
checking for pkg-config >= 0.14.0...
(B testing pkg-config... found 0.22
Checking for required M4 macros...
(BChecking for forbidden M4 macros...
(BProcessing ./configure.ac
(BRunning libtoolize...
(Blibtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
Running intltoolize...
(BRunning aclocal-1.11...
(BRunning autoconf...
(BRunning autoheader...
(BRunning automake-1.11...
(BRunning ./configure --prefix=/usr ...
(Bchecking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files......

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/contacts-view.c'
2--- nautilus/contacts-view.c 2010-04-13 18:45:30 +0000
3+++ nautilus/contacts-view.c 2010-04-14 12:34:25 +0000
4@@ -129,10 +129,9 @@
5 {
6 GtkTreeModel *model;
7 GList *selected_items, *l;
8+ GtkWidget *other_icon_view = NULL;
9 ContactsView *cv = CONTACTS_VIEW (data);
10
11- g_debug ("Selection_changed called");
12-
13 /* We first remove all the previous selected items */
14 g_hash_table_remove_all (cv->selection);
15
16@@ -170,6 +169,40 @@
17 g_list_foreach (selected_items, (GFunc) gtk_tree_path_free, NULL);
18 g_list_free (selected_items);
19
20+ /* Set the same selection on the other view */
21+ if (GTK_ICON_VIEW (cv->recently_used_view) == icon_view)
22+ other_icon_view = cv->alphabetical_view;
23+ else if (GTK_ICON_VIEW (cv->alphabetical_view) == icon_view)
24+ other_icon_view = cv->recently_used_view;
25+
26+ if (other_icon_view != NULL) {
27+ GtkTreeModel *model;
28+ GtkTreeIter current_row;
29+
30+ g_signal_handlers_block_by_func (G_OBJECT (other_icon_view), selection_changed_cb, data);
31+
32+ model = gtk_icon_view_get_model (GTK_ICON_VIEW (other_icon_view));
33+ if (gtk_tree_model_get_iter_first (model, &current_row)) {
34+ gchar *current_name;
35+
36+ do {
37+ gtk_tree_model_get (model, &current_row,
38+ CONTACTS_VIEW_COLUMN_NAME, &current_name,
39+ -1);
40+ if (g_hash_table_lookup (cv->selection, current_name)) {
41+ gtk_icon_view_select_path (GTK_ICON_VIEW (other_icon_view),
42+ gtk_tree_model_get_path (model, &current_row));
43+ } else {
44+ gtk_icon_view_unselect_path (GTK_ICON_VIEW (other_icon_view),
45+ gtk_tree_model_get_path (model, &current_row));
46+ }
47+ } while (gtk_tree_model_iter_next (model, &current_row));
48+ }
49+
50+ g_signal_handlers_unblock_by_func (G_OBJECT (other_icon_view), selection_changed_cb, data);
51+ }
52+
53+ /* Notify listeners the selection has changed */
54 g_signal_emit_by_name (cv, "selection-changed", NULL);
55 }
56

Subscribers

People subscribed via source and target branches