[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-868-gc7b5d4de0

paul at claws-mail.org paul at claws-mail.org
Fri Nov 29 18:59:38 CET 2019


The branch, gtk3 has been updated
       via  c7b5d4de0650270ac4ef3b26c817fa48dbf7f542 (commit)
      from  125c18d5052b9354cd2d535625c1e2ec2118f2d6 (commit)

Summary of changes:
 src/addressadd.c | 28 ++++++++++++++--------------
 src/addrgather.c | 37 +++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 34 deletions(-)


- Log -----------------------------------------------------------------
commit c7b5d4de0650270ac4ef3b26c817fa48dbf7f542
Author: paul <paul at claws-mail.org>
Date:   Fri Nov 29 17:59:33 2019 +0000

    replace deprecated GtkTable

diff --git a/src/addressadd.c b/src/addressadd.c
index bb5c01507..31967f57c 100644
--- a/src/addressadd.c
+++ b/src/addressadd.c
@@ -179,7 +179,6 @@ static void addressadd_create( void ) {
 	GtkWidget *hbbox;
 	GtkWidget *ok_btn;
 	GtkWidget *cancel_btn;
-	gint top;
 	static GdkGeometry geometry;
 	GtkTreeStore *store;
 	GtkTreeViewColumn *col;
@@ -206,10 +205,10 @@ static void addressadd_create( void ) {
 	picture = gtk_image_new();
 	gtk_box_pack_start(GTK_BOX(hbox), picture, FALSE, FALSE, 0);
 
-	table = gtk_table_new(3, 2, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(hbox), table, TRUE, TRUE, 0);
-	gtk_table_set_row_spacings(GTK_TABLE(table), VSPACING_NARROW);
-	gtk_table_set_col_spacings(GTK_TABLE(table), HSPACING_NARROW);
+	gtk_grid_set_row_spacing(GTK_GRID(table), VSPACING_NARROW);
+	gtk_grid_set_column_spacing(GTK_GRID(table), HSPACING_NARROW);
 
 	frame = gtk_frame_new(_("Contact"));
 	gtk_frame_set_label_align(GTK_FRAME(frame), 0.01, 0.5);
@@ -218,38 +217,39 @@ static void addressadd_create( void ) {
 	gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
 
 	/* First row */
-	top = 0;
 	label = gtk_label_new(_("Name"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
 
 	entry_name = gtk_entry_new();
 	gtk_widget_set_size_request(entry_name, 150, -1);
 	gtk_entry_set_text (GTK_ENTRY(entry_name),"");
 	
-	gtk_table_attach(GTK_TABLE(table), entry_name, 1, 2, top, (top + 1), GTK_FILL | GTK_EXPAND , 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entry_name, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(entry_name, TRUE);
+	gtk_widget_set_halign(entry_name, GTK_ALIGN_FILL);
 
 	/* Second row */
-	top = 1;
 	label = gtk_label_new(_("Address"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
 
 	label_addr = gtk_label_new("");
 	gtk_widget_set_size_request(label_addr, 150, -1);
-	gtk_table_attach(GTK_TABLE(table), label_addr, 1, 2, top, (top + 1), GTK_FILL | GTK_EXPAND, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label_addr, 1, 1, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label_addr), 0.0);
 
 	/* Third row */
-	top = 2;
 	label = gtk_label_new(_("Remarks"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
 
 	entry_rems = gtk_entry_new();
 	gtk_widget_set_size_request(entry_rems, 150, -1);
-	gtk_table_attach(GTK_TABLE(table), entry_rems, 1, 2, top, (top + 1), GTK_FILL | GTK_EXPAND, 0, 0, 0);
-	
+	gtk_grid_attach(GTK_GRID(table), entry_rems, 1, 2, 1, 1);
+	gtk_widget_set_hexpand(entry_rems, TRUE);
+	gtk_widget_set_halign(entry_rems, GTK_ALIGN_FILL);
+
 	/* Address book/folder tree */
 	vlbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, VBOX_BORDER);
 	gtk_box_pack_start(GTK_BOX(vbox), vlbox, TRUE, TRUE, 0);
diff --git a/src/addrgather.c b/src/addrgather.c
index 5996c968e..5a1ce8849 100644
--- a/src/addrgather.c
+++ b/src/addrgather.c
@@ -330,7 +330,6 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
 	GtkAdjustment *adjFolder;
 #endif
 	GtkWidget *checkRecurse;
-	gint top;
 	gint i;
 #ifdef USE_ALT_ADDRBOOK
 	GError* error = NULL;
@@ -350,26 +349,23 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
 							     pageNum), label);
 
 	/* Upper area - Field list */
-	table = gtk_table_new(4, 2, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
-	gtk_table_set_row_spacings(GTK_TABLE(table), 4);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 4);
+	gtk_grid_set_row_spacing(GTK_GRID(table), VSPACING_NARROW);
+	gtk_grid_set_column_spacing(GTK_GRID(table), HSPACING_NARROW);
 
 	/* First row */
-	top = 0;
 	label = gtk_label_new(_("Current folder:"));
-	gtk_table_attach( GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
 
 	labelFolder = gtk_label_new("");
-	gtk_table_attach( GTK_TABLE(table), labelFolder, 1, 2, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), labelFolder, 1, 0, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(labelFolder), 0.0);
 
 	/* Second row */
-	top = 1;
 	label = gtk_label_new(_("Address book name:"));
-	gtk_table_attach( GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
 
 #ifndef USE_ALT_ADDRBOOK
@@ -389,14 +385,15 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
             gtk_combo_box_text_prepend_text(GTK_COMBO_BOX_TEXT(entryBook), "");
         gtk_combo_box_set_active(GTK_COMBO_BOX(entryBook), 0);
 #endif
-	gtk_table_attach( GTK_TABLE(table), entryBook, 1, 2, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), entryBook, 1, 1, 2, 1);
+	gtk_widget_set_hexpand(entryBook, TRUE);
+	gtk_widget_set_halign(entryBook, GTK_ALIGN_FILL);
+
 
 #ifndef USE_ALT_ADDRBOOK
 	/* Third row */
-	top = 2;
 	label = gtk_label_new(_("Address book folder size:"));
-	gtk_table_attach( GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
 	CLAWS_SET_TIP(label,
 			_("Maximum amount of entries per folder within the newly created address book"));
@@ -406,15 +403,17 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
 	spinbtnFolder = gtk_spin_button_new(GTK_ADJUSTMENT(adjFolder), 1, 0);
 	gtk_box_pack_start(GTK_BOX(hboxs), spinbtnFolder, FALSE, FALSE, 0);
 	gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(spinbtnFolder), TRUE);
-	gtk_table_attach(GTK_TABLE(table), hboxs, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), hboxs, 1, 2, 1, 1);
+
 	CLAWS_SET_TIP(spinbtnFolder,
 			_("Maximum amount of entries per folder within the newly created address book"));
 #endif
 	/* Fourth row */
-	top = 3;
 	frameHeader = gtk_frame_new(_("Process these mail header fields"));
 	gtk_widget_show(frameHeader);
-	gtk_table_attach(GTK_TABLE(table), frameHeader, 0, 2, top, (top + 4), GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), frameHeader, 0, 3, 1, 1);
+	gtk_widget_set_hexpand(frameHeader, TRUE);
+	gtk_widget_set_halign(frameHeader, GTK_ALIGN_FILL);
 	gtk_frame_set_label_align(GTK_FRAME(frameHeader), 0.01, 0.5);
 
 	/* Check boxes */
@@ -430,10 +429,8 @@ static void addrgather_page_fields(gint pageNum, gchar *pageLbl)
 	}
 
 	/* Recurse folders */
-	top += 4;
 	checkRecurse = gtk_check_button_new_with_label( _("Include subfolders" ) );
-	gtk_table_attach( GTK_TABLE(table), checkRecurse, 0, 2, top, (top + 1),
-			GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0 );
+	gtk_grid_attach(GTK_GRID(table), checkRecurse, 0, 4, 1, 1);
 
 	addrgather_dlg.labelFolder   = labelFolder;
 	addrgather_dlg.entryBook     = entryBook;

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list