2008-06-13 [wwp] 3.4.0cvs92

* src/addrduplicates.c
	* src/addressadd.c
	* src/addressbook.c
	* src/addressbook_foldersel.c
	* src/editgroup.c
		use tree decorations everywhere AB folders are used (AB tree pane,
		    add address to AB, select AB folder, edit group, custom attr, find dup
		    results), in order to match global style
		make double-clicks in AB's tree pane behave like in MW's folder tree pane:
		    double clicking on groups in tree pane does open the group edit dialog
		    double clicking on other items in tree pane does expand/collapse
		fix a missing space in AB's delete-folder dialog
		fix again edit button sensitivity (thanks to iwkse, this reworks cvs79)

	* src/foldersel.c
		make foldersel dialog show dotted lines according to global (hidden) prefs
This commit is contained in:
Tristan Chabredier 2008-06-13 06:08:31 +00:00
parent 8ff41787fc
commit a8af6b4776
9 changed files with 130 additions and 47 deletions

View file

@ -1,3 +1,22 @@
2008-06-13 [wwp] 3.4.0cvs92
* src/addrduplicates.c
* src/addressadd.c
* src/addressbook.c
* src/addressbook_foldersel.c
* src/editgroup.c
use tree decorations everywhere AB folders are used (AB tree pane,
add address to AB, select AB folder, edit group, custom attr, find dup
results), in order to match global style
make double-clicks in AB's tree pane behave like in MW's folder tree pane:
double clicking on groups in tree pane does open the group edit dialog
double clicking on other items in tree pane does expand/collapse
fix a missing space in AB's delete-folder dialog
fix again edit button sensitivity (thanks to iwkse, this reworks cvs79)
* src/foldersel.c
make foldersel dialog show dotted lines according to global (hidden) prefs
2008-06-12 [colin] 3.4.0cvs91
* src/compose.c

View file

@ -3387,3 +3387,4 @@
( cvs diff -u -r 1.100.2.61 -r 1.100.2.62 AUTHORS; cvs diff -u -r 1.25.2.26 -r 1.25.2.27 tools/Makefile.am; cvs diff -u -r 1.30.2.30 -r 1.30.2.31 tools/README; cvs diff -u -r -1.1.2.1 -r -1.1.2.2 tools/convert_mbox.sh; ) > 3.4.0cvs89.patchset
( cvs diff -u -r 1.213.2.183 -r 1.213.2.184 src/folder.c; ) > 3.4.0cvs90.patchset
( cvs diff -u -r 1.382.2.451 -r 1.382.2.452 src/compose.c; cvs diff -u -r 1.50.2.46 -r 1.50.2.47 src/compose.h; cvs diff -u -r 1.207.2.200 -r 1.207.2.201 src/folderview.c; ) > 3.4.0cvs91.patchset
( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/addrduplicates.c; cvs diff -u -r 1.9.2.22 -r 1.9.2.23 src/addressadd.c; cvs diff -u -r 1.60.2.117 -r 1.60.2.118 src/addressbook.c; cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/addressbook_foldersel.c; cvs diff -u -r 1.11.2.18 -r 1.11.2.19 src/editgroup.c; cvs diff -u -r 1.26.2.35 -r 1.26.2.36 src/foldersel.c; ) > 3.4.0cvs92.patchset

View file

@ -11,7 +11,7 @@ MINOR_VERSION=4
MICRO_VERSION=0
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=91
EXTRA_VERSION=92
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -445,6 +445,7 @@ static GtkWidget* create_email_view(GtkListStore *store)
GtkCellRenderer *renderer;
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), prefs_common.use_stripes_everywhere);
renderer = gtk_cell_renderer_text_new();
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view),
-1,
@ -464,6 +465,7 @@ static GtkWidget* create_detail_view(GtkListStore *store)
GList *walk;
view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), prefs_common.use_stripes_everywhere);
renderer = gtk_cell_renderer_text_new();
/* col 1 */

View file

@ -113,14 +113,15 @@ static void addressadd_cancel( GtkWidget *widget, gboolean *cancelled ) {
gtk_main_quit();
}
static void addressadd_folder_select( GtkCTree *ctree, gint row, gint column,
GdkEvent *event, gpointer data )
static void addressadd_folder_select( GtkCTree *ctree, GtkCTreeNode *node,
gint column, gpointer data )
{
addressadd_dlg.fiSelected = gtk_clist_get_row_data( GTK_CLIST(ctree), row );
addressadd_dlg.fiSelected = gtk_ctree_node_get_row_data( ctree, node );
}
static gboolean addressadd_tree_button( GtkCTree *ctree, GdkEventButton *event, gpointer data ) {
if( ! event ) return FALSE;
if( ! event )
return FALSE;
if( event->button == 1 ) {
/* Handle double click */
if( event->type == GDK_2BUTTON_PRESS ) {
@ -159,6 +160,7 @@ static void addressadd_create( void ) {
GtkWidget *cancel_btn;
gint top;
static GdkGeometry geometry;
gchar *titles[1];
window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "addressadd");
gtk_container_set_border_width( GTK_CONTAINER(window), VBOX_BORDER );
@ -235,13 +237,22 @@ static void addressadd_create( void ) {
GTK_POLICY_AUTOMATIC );
gtk_box_pack_start( GTK_BOX(vlbox), tree_win, TRUE, TRUE, 0 );
tree_folder = gtk_ctree_new( 1, 0 );
titles[0] = _( "Select Address Book Folder") ;
tree_folder = gtk_sctree_new_with_titles( 1, 0, titles );
gtk_container_add( GTK_CONTAINER(tree_win), tree_folder );
gtk_clist_column_titles_show( GTK_CLIST(tree_folder) );
gtk_clist_set_column_title( GTK_CLIST(tree_folder), 0, _( "Select Address Book Folder" ) );
gtk_ctree_set_line_style( GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED );
if (prefs_common.enable_dotted_lines) {
gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
GTK_CTREE_EXPANDER_SQUARE);
} else {
gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
GTK_CTREE_EXPANDER_TRIANGLE);
}
gtk_sctree_set_stripes(GTK_SCTREE(tree_folder), prefs_common.use_stripes_everywhere);
gtk_clist_set_selection_mode( GTK_CLIST(tree_folder), GTK_SELECTION_BROWSE );
gtk_ctree_set_expander_style( GTK_CTREE(tree_folder), GTK_CTREE_EXPANDER_SQUARE );
gtk_ctree_set_indent( GTK_CTREE(tree_folder), CTREE_INDENT );
gtk_clist_set_auto_sort( GTK_CLIST(tree_folder), TRUE );
@ -257,7 +268,7 @@ static void addressadd_create( void ) {
G_CALLBACK(addressadd_ok), NULL);
g_signal_connect(G_OBJECT(cancel_btn), "clicked",
G_CALLBACK(addressadd_cancel), NULL);
g_signal_connect(G_OBJECT(tree_folder), "select_row",
g_signal_connect(G_OBJECT(tree_folder), "tree_select_row",
G_CALLBACK(addressadd_folder_select), NULL);
g_signal_connect(G_OBJECT(tree_folder), "button_press_event",
G_CALLBACK(addressadd_tree_button), NULL);

View file

@ -973,9 +973,16 @@ static void addressbook_create(void)
gtk_container_add(GTK_CONTAINER(ctree_swin), ctree);
gtk_clist_set_selection_mode(GTK_CLIST(ctree), GTK_SELECTION_BROWSE);
gtk_clist_set_column_width(GTK_CLIST(ctree), 0, COL_FOLDER_WIDTH);
gtk_ctree_set_line_style(GTK_CTREE(ctree), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(ctree),
if (prefs_common.enable_dotted_lines) {
gtk_ctree_set_line_style(GTK_CTREE(ctree), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(ctree),
GTK_CTREE_EXPANDER_SQUARE);
} else {
gtk_ctree_set_line_style(GTK_CTREE(ctree), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(ctree),
GTK_CTREE_EXPANDER_TRIANGLE);
}
gtk_sctree_set_stripes(GTK_SCTREE(ctree), prefs_common.use_stripes_in_summaries);
gtk_ctree_set_indent(GTK_CTREE(ctree), CTREE_INDENT);
gtk_clist_set_compare_func(GTK_CLIST(ctree),
addressbook_treenode_compare_func);
@ -1021,8 +1028,16 @@ static void addressbook_create(void)
clist = gtk_sctree_new_with_titles(N_LIST_COLS, 0, list_titles);
gtk_container_add(GTK_CONTAINER(clist_swin), clist);
gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_EXTENDED);
gtk_ctree_set_line_style(GTK_CTREE(clist), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(clist), GTK_CTREE_EXPANDER_SQUARE);
if (prefs_common.enable_dotted_lines) {
gtk_ctree_set_line_style(GTK_CTREE(clist), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(clist),
GTK_CTREE_EXPANDER_SQUARE);
} else {
gtk_ctree_set_line_style(GTK_CTREE(clist), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(clist),
GTK_CTREE_EXPANDER_TRIANGLE);
}
gtk_sctree_set_stripes(GTK_SCTREE(ctree), prefs_common.use_stripes_in_summaries);
gtk_ctree_set_indent(GTK_CTREE(clist), CTREE_INDENT);
gtk_clist_set_column_width(GTK_CLIST(clist), COL_NAME,
COL_NAME_WIDTH);
@ -1750,7 +1765,6 @@ static void addressbook_menubar_set_sensitive( gboolean sensitive ) {
menu_set_sensitive( addrbook.menu_factory, "/Address/New Address", sensitive );
menu_set_sensitive( addrbook.menu_factory, "/Address/New Group", sensitive );
menu_set_sensitive( addrbook.menu_factory, "/Address/Mail To", sensitive );
gtk_widget_set_sensitive( addrbook.reg_btn, sensitive );
gtk_widget_set_sensitive( addrbook.edit_btn, sensitive );
gtk_widget_set_sensitive( addrbook.del_btn, sensitive );
}
@ -2372,14 +2386,10 @@ static void addressbook_list_row_unselected( GtkCTree *ctree,
addressbook_edit_person_invalidate(NULL, NULL, NULL);
}
/* from gdkevents.c */
#define DOUBLE_CLICK_TIME 250
static gboolean addressbook_list_button_pressed(GtkWidget *widget,
GdkEventButton *event,
gpointer data)
{
static guint32 lasttime = 0;
if( ! event ) return FALSE;
addressbook_list_menu_setup();
@ -2388,7 +2398,7 @@ static gboolean addressbook_list_button_pressed(GtkWidget *widget,
gtk_menu_popup( GTK_MENU(addrbook.list_popup), NULL, NULL, NULL, NULL,
event->button, event->time );
} else if (event->button == 1) {
if (event->time - lasttime < DOUBLE_CLICK_TIME) {
if (event->type == GDK_2BUTTON_PRESS) {
if (prefs_common.add_address_by_click &&
addrbook.target_compose)
addressbook_to_clicked(NULL, GINT_TO_POINTER(COMPOSE_TO));
@ -2401,10 +2411,7 @@ static gboolean addressbook_list_button_pressed(GtkWidget *widget,
if( obj && obj->type == ADDR_ITEM_GROUP )
addressbook_edit_address_cb(NULL, 0, NULL);
}
lasttime = 0;
} else
lasttime = event->time;
}
}
return FALSE;
@ -2438,7 +2445,30 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
gboolean canLookup = FALSE;
GtkCTreeNode *node = NULL;
if( ! event || event->type != GDK_BUTTON_PRESS) return FALSE;
if( ! event ) return FALSE;
/* if( ! event || event->type != GDK_BUTTON_PRESS) return FALSE;*/
if (event->button == 1) {
if (event->type == GDK_2BUTTON_PRESS) {
if( gtk_clist_get_selection_info( clist, event->x, event->y, &row, &column ) ) {
gtkut_clist_set_focus_row(clist, row);
obj = gtk_clist_get_row_data( clist, row );
}
if( obj == NULL )
return FALSE;
if (obj->type == ADDR_ITEM_GROUP) {
/* edit group */
addressbook_treenode_edit_cb(NULL, 0, NULL);
} else {
/* expand pr collapse */
node = gtk_ctree_node_nth(GTK_CTREE(ctree), row);
gtk_ctree_toggle_expansion(GTK_CTREE(ctree), node);
}
return FALSE;
}
}
addressbook_menubar_set_sensitive( FALSE );
if( gtk_clist_get_selection_info( clist, event->x, event->y, &row, &column ) ) {
@ -2448,12 +2478,13 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
menu_set_insensitive_all(GTK_MENU_SHELL(addrbook.tree_popup));
if( obj == NULL ) return FALSE;
if( obj == NULL )
return FALSE;
node = gtk_ctree_node_nth(GTK_CTREE(clist), row);
if( ! addrclip_is_empty( _clipBoard_ ) ) {
if( ! addrclip_is_empty( _clipBoard_ ) )
canTreePaste = TRUE;
}
if (obj->type == ADDR_INTERFACE) {
AdapterInterface *adapter = ADAPTER_INTERFACE(obj);
if( !adapter )
@ -2465,7 +2496,8 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
menu_set_sensitive( addrbook.tree_factory, "/New Book", TRUE );
gtk_widget_set_sensitive( addrbook.reg_btn, TRUE );
}
if( iface->externalQuery ) canLookup = TRUE;
if( iface->externalQuery )
canLookup = TRUE;
}
if (obj->type == ADDR_DATASOURCE) {
ads = ADAPTER_DSOURCE(obj);
@ -2483,7 +2515,8 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
}
canEdit = TRUE;
canTreeCopy = TRUE;
if( iface->externalQuery ) canLookup = TRUE;
if( iface->externalQuery )
canLookup = TRUE;
}
else if (obj->type == ADDR_ITEM_FOLDER) {
ds = addressbook_find_datasource( node );
@ -2523,10 +2556,8 @@ static gboolean addressbook_tree_button_pressed(GtkWidget *ctree,
}
}
if( canEdit ) {
if( ! addrselect_test_empty( _addressSelect_ ) )
canCut = TRUE;
}
if( canEdit && !addrselect_test_empty( _addressSelect_ ) )
canCut = TRUE;
if( ! addrselect_test_empty( _addressSelect_ ) )
canCopy = TRUE;
if( ! addrclip_is_empty( _clipBoard_ ) )
@ -2558,10 +2589,9 @@ just_set_sens:
addressbook_show_buttons(addrbook.target_compose == NULL, canLookup,
addrbook.target_compose != NULL);
if( event->button == 3 ) {
if( event->button == 3 )
gtk_menu_popup(GTK_MENU(addrbook.tree_popup), NULL, NULL, NULL, NULL,
event->button, event->time);
}
return FALSE;
}
@ -2611,7 +2641,6 @@ static void addressbook_new_folder_cb(gpointer data, guint action,
if( addrbook.treeSelected == addrbook.opened )
addressbook_set_clist(obj, TRUE);
}
}
static void addressbook_new_group_cb(gpointer data, guint action,
@ -2650,7 +2679,6 @@ static void addressbook_new_group_cb(gpointer data, guint action,
if( addrbook.treeSelected == addrbook.opened )
addressbook_set_clist(obj, TRUE);
}
}
static void addressbook_change_node_name(GtkCTreeNode *node, const gchar *name)
@ -2849,7 +2877,7 @@ static void addressbook_treenode_delete_cb(
}
else {
message = g_strdup_printf
( _( "Do you want to delete '%s' ?"
( _( "Do you want to delete '%s'? "
"If you delete the folder only, the addresses it contains will be moved into the parent folder." ),
obj->name );
aval = alertpanel( _("Delete folder"), message,

View file

@ -117,10 +117,10 @@ static void addressbook_foldersel_cancel( GtkWidget *widget, gboolean *cancelled
gtk_main_quit();
}
static void addressbook_foldersel_folder_select( GtkCTree *ctree, gint row, gint column,
GdkEvent *event, gpointer data )
static void addressbook_foldersel_folder_select( GtkCTree *ctree, GtkCTreeNode *node,
gint column, gpointer data )
{
addressbook_foldersel_dlg.fiSelected = gtk_clist_get_row_data( GTK_CLIST(ctree), row );
addressbook_foldersel_dlg.fiSelected = gtk_ctree_node_get_row_data( ctree, node );
}
static gboolean addressbook_foldersel_tree_button( GtkCTree *ctree, GdkEventButton *event, gpointer data )
@ -158,6 +158,7 @@ static void addressbook_foldersel_create( void )
GtkWidget *ok_btn;
GtkWidget *cancel_btn;
static GdkGeometry geometry;
gchar *titles[1];
window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "addressbook_foldersel" );
gtk_container_set_border_width( GTK_CONTAINER(window), 0 );
@ -186,13 +187,22 @@ static void addressbook_foldersel_create( void )
GTK_POLICY_AUTOMATIC );
gtk_box_pack_start( GTK_BOX(vlbox), tree_win, TRUE, TRUE, 0 );
tree_folder = gtk_ctree_new( 1, 0 );
titles[0] = _( "Address Book") ;
tree_folder = gtk_sctree_new_with_titles( 1, 0, titles );
gtk_container_add( GTK_CONTAINER(tree_win), tree_folder );
gtk_clist_column_titles_show( GTK_CLIST(tree_folder) );
gtk_clist_set_column_title( GTK_CLIST(tree_folder), 0, _( "Address Book" ) );
gtk_ctree_set_line_style( GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED );
if (prefs_common.enable_dotted_lines) {
gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
GTK_CTREE_EXPANDER_SQUARE);
} else {
gtk_ctree_set_line_style(GTK_CTREE(tree_folder), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(tree_folder),
GTK_CTREE_EXPANDER_TRIANGLE);
}
gtk_sctree_set_stripes(GTK_SCTREE(tree_folder), prefs_common.use_stripes_everywhere);
gtk_clist_set_selection_mode( GTK_CLIST(tree_folder), GTK_SELECTION_BROWSE );
gtk_ctree_set_expander_style( GTK_CTREE(tree_folder), GTK_CTREE_EXPANDER_SQUARE );
gtk_ctree_set_indent( GTK_CTREE(tree_folder), CTREE_INDENT );
gtk_clist_set_auto_sort( GTK_CLIST(tree_folder), TRUE );
@ -208,7 +218,7 @@ static void addressbook_foldersel_create( void )
G_CALLBACK(addressbook_foldersel_ok), NULL );
g_signal_connect( G_OBJECT(cancel_btn), "clicked",
G_CALLBACK(addressbook_foldersel_cancel), NULL );
g_signal_connect( G_OBJECT(tree_folder), "select_row",
g_signal_connect( G_OBJECT(tree_folder), "tree_select_row",
G_CALLBACK(addressbook_foldersel_folder_select), NULL );
g_signal_connect( G_OBJECT(tree_folder), "button_press_event",
G_CALLBACK(addressbook_foldersel_tree_button), NULL );

View file

@ -352,6 +352,16 @@ static void addressbook_edit_group_create( gboolean *cancelled ) {
clist_group = gtk_sctree_new_with_titles( GROUP_N_COLS, GROUP_N_COLS, titles );
gtk_container_add( GTK_CONTAINER(clist_swin), clist_group );
if (prefs_common.enable_dotted_lines) {
gtk_ctree_set_line_style(GTK_CTREE(clist_group), GTK_CTREE_LINES_DOTTED);
gtk_ctree_set_expander_style(GTK_CTREE(clist_group),
GTK_CTREE_EXPANDER_SQUARE);
} else {
gtk_ctree_set_line_style(GTK_CTREE(clist_group), GTK_CTREE_LINES_NONE);
gtk_ctree_set_expander_style(GTK_CTREE(clist_group),
GTK_CTREE_EXPANDER_TRIANGLE);
}
gtk_sctree_set_stripes(GTK_SCTREE(clist_group), prefs_common.use_stripes_in_summaries);
gtk_clist_set_selection_mode( GTK_CLIST(clist_group), GTK_SELECTION_EXTENDED );
gtk_clist_set_column_width( GTK_CLIST(clist_group), GROUP_COL_NAME, GROUP_COL_WIDTH_NAME );
gtk_clist_set_column_width( GTK_CLIST(clist_group), GROUP_COL_EMAIL, GROUP_COL_WIDTH_EMAIL );

View file

@ -269,6 +269,8 @@ static void foldersel_create(void)
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), FALSE);
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview),
prefs_common.use_stripes_everywhere);
gtk_tree_view_set_enable_tree_lines(GTK_TREE_VIEW(treeview),
prefs_common.enable_dotted_lines);
gtk_tree_view_set_search_column(GTK_TREE_VIEW(treeview),
FOLDERSEL_FOLDERNAME);