[Commits] [SCM] claws branch, gtk3, updated. 3.16.0-871-gb01b38e72

paul at claws-mail.org paul at claws-mail.org
Sun Dec 1 12:32:09 CET 2019


The branch, gtk3 has been updated
       via  b01b38e726e853be9e82d3892e9b544b4bd87329 (commit)
      from  6dfe91124fa6b67c91a9998e9d9f69e39f0a1c60 (commit)

Summary of changes:
 src/image_viewer.c | 42 ++++++++--------------------
 src/import.c       | 35 ++++++++++-------------
 src/importldif.c   | 82 ++++++++++++++++++++++--------------------------------
 src/importmutt.c   | 25 +++++++++--------
 src/importpine.c   | 23 +++++++--------
 src/password_gtk.c | 30 ++++++++++----------
 6 files changed, 100 insertions(+), 137 deletions(-)


- Log -----------------------------------------------------------------
commit b01b38e726e853be9e82d3892e9b544b4bd87329
Author: paul <paul at claws-mail.org>
Date:   Sun Dec 1 11:32:04 2019 +0000

    replace deprecated GtkTable

diff --git a/src/image_viewer.c b/src/image_viewer.c
index da7a86623..10b178b37 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -297,74 +297,56 @@ static MimeViewer *image_viewer_create(void)
 	gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook), FALSE);
 	gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook), FALSE);
 
-	table1 = gtk_table_new(5, 3, FALSE);
+	table1 = gtk_grid_new();
 	gtk_widget_show(table1);
 	gtk_container_add(GTK_CONTAINER(notebook), table1);
 	gtk_container_set_border_width(GTK_CONTAINER(table1), 8);
-	gtk_table_set_row_spacings(GTK_TABLE(table1), 4);
-	gtk_table_set_col_spacings(GTK_TABLE(table1), 4);
+	gtk_grid_set_row_spacing(GTK_GRID(table1), 4);
+	gtk_grid_set_column_spacing(GTK_GRID(table1), 4);
 
 	label3 = gtk_label_new(_("Filename:"));
 	gtk_widget_show(label3);
-	gtk_table_attach(GTK_TABLE(table1), label3, 0, 1, 0, 1,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label3), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), label3, 0, 0, 1, 1);
 
 	label4 = gtk_label_new(_("Filesize:"));
 	gtk_widget_show(label4);
-	gtk_table_attach(GTK_TABLE(table1), label4, 0, 1, 1, 2,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label4), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), label4, 0, 1, 1, 1);
 
 	filename = gtk_label_new("");
 	gtk_widget_show(filename);
-	gtk_table_attach(GTK_TABLE(table1), filename, 1, 3, 0, 1,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(filename), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), filename, 1, 0, 0, 1);
 
 	filesize = gtk_label_new("");
 	gtk_widget_show(filesize);
-	gtk_table_attach(GTK_TABLE(table1), filesize, 1, 3, 1, 2,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(filesize), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), filesize, 1, 1, 0, 1);
 
 	label5 = gtk_label_new(_("Content-Type:"));
 	gtk_widget_show(label5);
-	gtk_table_attach(GTK_TABLE(table1), label5, 0, 1, 2, 3,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label5), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), label5, 0, 2, 0, 1);
 
 	content_type = gtk_label_new("");
 	gtk_widget_show(content_type);
-	gtk_table_attach(GTK_TABLE(table1), content_type, 1, 3, 2, 3,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(content_type), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), content_type, 1, 2, 0, 1);
 
 	error_lbl = gtk_label_new("");
 	gtk_widget_show(error_lbl);
-	gtk_table_attach(GTK_TABLE(table1), error_lbl, 0, 1, 3, 4,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(error_lbl), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), error_lbl, 0, 3, 0, 1);
 
 	error_msg = gtk_label_new("");
 	gtk_widget_show(error_msg);
-	gtk_table_attach(GTK_TABLE(table1), error_msg, 1, 3, 3, 4,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(error_msg), 0.0);
+	gtk_grid_attach(GTK_GRID(table1), error_msg, 1, 3, 0, 1);
 
 	load_button = gtk_button_new_with_label(_("Load Image"));
 	gtk_widget_show(load_button);
-	gtk_table_attach(GTK_TABLE(table1), load_button, 0, 1, 4, 5,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
+	gtk_grid_attach(GTK_GRID(table1), load_button, 0, 4, 0, 1);
 
 	scrolledwin = gtk_scrolled_window_new(NULL, NULL);
 	gtk_widget_show(scrolledwin);
diff --git a/src/import.c b/src/import.c
index fa083662e..e89df3b6d 100644
--- a/src/import.c
+++ b/src/import.c
@@ -132,45 +132,40 @@ static void import_create(void)
 	gtk_label_set_line_wrap(GTK_LABEL(desc_label), TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), desc_label, FALSE, FALSE, 0);
 
-	table = gtk_table_new(2, 3, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 	gtk_container_set_border_width(GTK_CONTAINER(table), 8);
-	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+	gtk_grid_set_row_spacing(GTK_GRID(table), 8);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 	gtk_widget_set_size_request(table, 420, -1);
 
 	file_label = gtk_label_new(_("Mbox file:"));
-	gtk_table_attach(GTK_TABLE(table), file_label, 0, 1, 0, 1,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(file_label), 1.0);
+	gtk_grid_attach(GTK_GRID(table), file_label, 0, 0, 1, 1);
 
 	dest_label = gtk_label_new(_("Destination folder:"));
-	gtk_table_attach(GTK_TABLE(table), dest_label, 0, 1, 1, 2,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (GTK_EXPAND|GTK_FILL), 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(dest_label), 1.0);
+	gtk_grid_attach(GTK_GRID(table), dest_label, 0, 1, 1, 1);
 
 	file_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), file_entry, 1, 2, 0, 1,
-			 (GtkAttachOptions) (GTK_EXPAND|GTK_SHRINK|GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
+	gtk_grid_attach(GTK_GRID(table), file_entry, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(file_entry, TRUE);
+	gtk_widget_set_halign(file_entry, GTK_ALIGN_FILL);
 
 	dest_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), dest_entry, 1, 2, 1, 2,
-			 GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), dest_entry, 1, 1, 1, 1);
+	gtk_widget_set_hexpand(dest_entry, TRUE);
+	gtk_widget_set_halign(dest_entry, GTK_ALIGN_FILL);
 
 	file_button = gtkut_get_browse_file_btn(_("_Browse"));
-	gtk_table_attach(GTK_TABLE(table), file_button, 2, 3, 0, 1,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
+	gtk_grid_attach(GTK_GRID(table), file_button, 2, 0, 1, 1);
+
 	g_signal_connect(G_OBJECT(file_button), "clicked",
 			 G_CALLBACK(import_filesel_cb), NULL);
 
 	dest_button = gtkut_get_browse_directory_btn(_("B_rowse"));
-	gtk_table_attach(GTK_TABLE(table), dest_button, 2, 3, 1, 2,
-			 (GtkAttachOptions) (GTK_FILL),
-			 (GtkAttachOptions) (0), 0, 0);
+	gtk_grid_attach(GTK_GRID(table), dest_button, 2, 1, 1, 1);
+
 	g_signal_connect(G_OBJECT(dest_button), "clicked",
 			 G_CALLBACK(import_destsel_cb), NULL);
 
diff --git a/src/importldif.c b/src/importldif.c
index b66cfce17..105077955 100644
--- a/src/importldif.c
+++ b/src/importldif.c
@@ -516,7 +516,6 @@ static void imp_ldif_page_file( gint pageNum, gchar *pageLbl ) {
 	GtkWidget *entryFile;
 	GtkWidget *entryName;
 	GtkWidget *btnFile;
-	gint top;
 
 	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
 	gtk_container_add( GTK_CONTAINER( impldif_dlg.notebook ), vbox );
@@ -530,44 +529,41 @@ static void imp_ldif_page_file( gint pageNum, gchar *pageLbl ) {
 			GTK_NOTEBOOK( impldif_dlg.notebook ), pageNum ),
 		label );
 
-	table = gtk_table_new(2, 3, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
-	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
+	gtk_grid_set_row_spacing(GTK_GRID(table), 8);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
 	/* First row */
-	top = 0;
 	label = gtk_label_new(_("Address Book"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
-		GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	entryName = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), entryName, 1, 2, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entryName, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(entryName, TRUE);
+	gtk_widget_set_halign(entryName, GTK_ALIGN_FILL);
 
 	CLAWS_SET_TIP(entryName, _( 
 		"Specify the name for the address book that will " \
 		"be created from the LDIF file data." ));
 
 	/* Second row */
-	top = 1;
 	label = gtk_label_new(_("File Name"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
-		GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 
 	entryFile = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), entryFile, 1, 2, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entryFile, 1, 1, 1, 1);
+	gtk_widget_set_hexpand(entryFile, TRUE);
+	gtk_widget_set_halign(entryFile, GTK_ALIGN_FILL);
 
 	CLAWS_SET_TIP(entryFile,
 		_( "The full file specification of the LDIF file to import." ));
 
 	btnFile = gtkut_get_browse_file_btn(_("B_rowse"));
-	gtk_table_attach(GTK_TABLE(table), btnFile, 2, 3, top, (top + 1),
-		GTK_FILL, 0, 3, 0);
+	gtk_grid_attach(GTK_GRID(table), btnFile, 2, 1, 1, 1);
 
 	CLAWS_SET_TIP(btnFile,
 		_( "Select the LDIF file to import." ));
@@ -730,25 +726,23 @@ static void imp_ldif_page_fields( gint pageNum, gchar *pageLbl ) {
 	gtk_box_pack_end(GTK_BOX(vbox), vboxb, FALSE, FALSE, 2);
 
 	/* Data entry area */
-	table = gtk_table_new( 3, 3, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vboxb), 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), 4);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 4);
 
 	/* First row */
-	top = 0;
 	label = gtk_label_new(_("LDIF Field"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1),
-		GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	entryField = gtk_label_new( "" );
 	gtk_label_set_xalign(GTK_LABEL(entryField), 0.0);
-	gtk_table_attach(GTK_TABLE(table), entryField, 1, 3, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entryField, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(entryField, TRUE);
+	gtk_widget_set_halign(entryField, GTK_ALIGN_FILL);
 
 	/* Second row */
-	++top;
 	label = gtk_label_new(_("Attribute"));
 	/*
 	 * Use an event box to attach some help in the form of a tooltip.
@@ -757,8 +751,7 @@ static void imp_ldif_page_fields( gint pageNum, gchar *pageLbl ) {
 	eventBox = gtk_event_box_new();
 	gtk_container_add( GTK_CONTAINER(eventBox), label );
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
-	gtk_table_attach(GTK_TABLE(table), eventBox, 0, 1, top, (top + 1),
-		GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), eventBox, 0, 1, 1, 1);
 
 	CLAWS_SET_TIP(eventBox, _(
 		"Choose the LDIF field that will be renamed or selected " \
@@ -772,25 +765,22 @@ static void imp_ldif_page_fields( gint pageNum, gchar *pageLbl ) {
 		"select the field for import."));
 
 	entryAttrib = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), entryAttrib, 1, 3, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entryAttrib, 1, 1, 1, 1);
+	gtk_widget_set_hexpand(entryAttrib, TRUE);
+	gtk_widget_set_halign(entryAttrib, GTK_ALIGN_FILL);
 
 	CLAWS_SET_TIP(entryAttrib,
 		_( "The LDIF field can be renamed to the User Attribute name." ));
 
 	/* Next row */
-	++top;
-
 	checkSelect = gtk_check_button_new_with_label( _( "Select for Import" ) );
-	gtk_table_attach(GTK_TABLE(table), checkSelect, 1, 2, top, (top + 1),
-		GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), checkSelect, 1, 2, 1, 1);
 
 	CLAWS_SET_TIP(checkSelect,
 		_( "Select the LDIF field for import into the address book." ));
 
 	btnModify = gtk_button_new_with_label( _(" Modify "));
-	gtk_table_attach(GTK_TABLE(table), btnModify, 2, 3, top, (top + 1),
-		GTK_FILL, 0, 3, 0);
+	gtk_grid_attach(GTK_GRID(table), btnModify, 2, 2, 1, 1);
 
 	CLAWS_SET_TIP(btnModify,
 		_( "This button will update the list above with the data supplied." ));
@@ -826,7 +816,6 @@ static void imp_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
 	GtkWidget *labelBook;
 	GtkWidget *labelFile;
 	GtkWidget *labelRecs;
-	gint top;
 
 	vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 8);
 	gtk_container_add( GTK_CONTAINER( impldif_dlg.notebook ), vbox );
@@ -839,41 +828,38 @@ static void imp_ldif_page_finish( gint pageNum, gchar *pageLbl ) {
 		gtk_notebook_get_nth_page( GTK_NOTEBOOK( impldif_dlg.notebook ), pageNum ),
 		label );
 
-	table = gtk_table_new(3, 2, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
-	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8);
+	gtk_grid_set_row_spacing(GTK_GRID(table), 8);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
 	/* First row */
-	top = 0;
 	label = gtk_label_new( _( "Address Book:" ) );
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	labelBook = gtk_label_new("");
-	gtk_table_attach(GTK_TABLE(table), labelBook, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(labelBook), 0.0);
+	gtk_grid_attach(GTK_GRID(table), labelBook, 1, 0, 1, 1);
 
 	/* Second row */
-	top++;
 	label = gtk_label_new( _( "File Name:" ) );
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 
 	labelFile = gtk_label_new("");
-	gtk_table_attach(GTK_TABLE(table), labelFile, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(labelFile), 0.0);
+	gtk_grid_attach(GTK_GRID(table), labelFile, 1, 1, 1, 1);
 
 	/* Third row */
-	top++;
 	label = gtk_label_new( _("Records Imported:") );
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 1.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
 
 	labelRecs = gtk_label_new("");
-	gtk_table_attach(GTK_TABLE(table), labelRecs, 1, 2, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(labelRecs), 0.0);
+	gtk_grid_attach(GTK_GRID(table), labelRecs, 1, 2, 1, 1);
 
 	impldif_dlg.labelBook    = labelBook;
 	impldif_dlg.labelFile    = labelFile;
diff --git a/src/importmutt.c b/src/importmutt.c
index 2293aa4de..d82cd58b9 100644
--- a/src/importmutt.c
+++ b/src/importmutt.c
@@ -195,7 +195,6 @@ static void imp_mutt_create( gboolean *cancelled ) {
 	GtkWidget *file_btn;
 	GtkWidget *statusbar;
 	GtkWidget *hsbox;
-	gint top;
 
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "importmutt");
 	gtk_widget_set_size_request(window, 450, -1);
@@ -212,32 +211,34 @@ static void imp_mutt_create( gboolean *cancelled ) {
 	gtk_container_add(GTK_CONTAINER(window), vbox);
 	gtk_container_set_border_width( GTK_CONTAINER(vbox), 0 );
 
-	table = gtk_table_new(2, 3, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
-	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
+	gtk_grid_set_row_spacing(GTK_GRID(table), 8);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
 	/* 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_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	name_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), name_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
-
+	gtk_grid_attach(GTK_GRID(table), name_entry, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(name_entry, TRUE);
+	gtk_widget_set_halign(name_entry, GTK_ALIGN_FILL);
+	
 	/* Second row */
-	top = 1;
 	label = gtk_label_new(_("File"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 
 	file_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), file_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), file_entry, 1, 1, 1, 1);
+	gtk_widget_set_hexpand(file_entry, TRUE);
+	gtk_widget_set_halign(file_entry, GTK_ALIGN_FILL);
 
 	file_btn = gtkut_get_browse_file_btn(_("_Browse"));
-	gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
+	gtk_grid_attach(GTK_GRID(table), file_btn, 2, 1, 1, 1);
 
 	/* Status line */
 	hsbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/src/importpine.c b/src/importpine.c
index 0141fb4dc..8c50045bf 100644
--- a/src/importpine.c
+++ b/src/importpine.c
@@ -194,7 +194,6 @@ static void imp_pine_create( gboolean *cancelled ) {
 	GtkWidget *file_btn;
 	GtkWidget *statusbar;
 	GtkWidget *hsbox;
-	gint top;
 
 	window = gtkut_window_new(GTK_WINDOW_TOPLEVEL, "importpine");
 	gtk_widget_set_size_request(window, 450, -1);
@@ -211,32 +210,34 @@ static void imp_pine_create( gboolean *cancelled ) {
 	gtk_container_add(GTK_CONTAINER(window), vbox);
 	gtk_container_set_border_width( GTK_CONTAINER(vbox), 0 );
 
-	table = gtk_table_new(2, 3, FALSE);
+	table = gtk_grid_new();
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 	gtk_container_set_border_width( GTK_CONTAINER(table), 8 );
-	gtk_table_set_row_spacings(GTK_TABLE(table), 8);
-	gtk_table_set_col_spacings(GTK_TABLE(table), 8 );
+	gtk_grid_set_row_spacing(GTK_GRID(table), 8);
+	gtk_grid_set_column_spacing(GTK_GRID(table), 8);
 
 	/* 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_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	name_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), name_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), name_entry, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(name_entry, TRUE);
+	gtk_widget_set_halign(name_entry, GTK_ALIGN_FILL);
 
 	/* Second row */
-	top = 1;
 	label = gtk_label_new(_("File"));
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, top, (top + 1), GTK_FILL, 0, 0, 0);
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 1, 1, 1);
 
 	file_entry = gtk_entry_new();
-	gtk_table_attach(GTK_TABLE(table), file_entry, 1, 2, top, (top + 1), GTK_EXPAND|GTK_SHRINK|GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), file_entry, 1, 1, 1, 1);
+	gtk_widget_set_hexpand(file_entry, TRUE);
+	gtk_widget_set_halign(file_entry, GTK_ALIGN_FILL);
 
 	file_btn = gtkut_get_browse_file_btn(_("_Browse"));
-	gtk_table_attach(GTK_TABLE(table), file_btn, 2, 3, top, (top + 1), GTK_FILL, 0, 3, 0);
+	gtk_grid_attach(GTK_GRID(table), file_btn, 2, 1, 1, 1);
 
 	/* Status line */
 	hsbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
diff --git a/src/password_gtk.c b/src/password_gtk.c
index 0002046bd..27bfb7e17 100644
--- a/src/password_gtk.c
+++ b/src/password_gtk.c
@@ -169,45 +169,43 @@ void master_passphrase_change_dialog()
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 	gtk_widget_show(label);
 
-	table = gtk_table_new(4, 2, FALSE);
+	table = gtk_grid_new();
 
 	/* Old passphrase */
 	label = gtk_label_new(_("Old passphrase:"));
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 1,
-			GTK_EXPAND | GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 0, 1, 1);
 
 	entry_old = gtk_entry_new();
 	gtk_entry_set_visibility(GTK_ENTRY(entry_old), FALSE);
-	gtk_table_attach(GTK_TABLE(table), entry_old, 1, 2, 0, 1,
-			GTK_FILL | GTK_EXPAND, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entry_old, 1, 0, 1, 1);
+	gtk_widget_set_hexpand(entry_old, TRUE);
+	gtk_widget_set_halign(entry_old, GTK_ALIGN_FILL);
 
 	/* Separator */
-	gtk_table_attach(GTK_TABLE(table),
-			gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), 0, 2, 1, 2,
-			GTK_FILL | GTK_EXPAND, 0, 0, 5);
+	gtk_grid_attach(GTK_GRID(table), gtk_separator_new(GTK_ORIENTATION_HORIZONTAL), 0, 1, 1, 1);
 
 	/* New passphrase */
 	label = gtk_label_new(_("New passphrase:"));
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3,
-			GTK_EXPAND | GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 2, 1, 1);
 
 	entry_new1 = gtk_entry_new();
 	gtk_entry_set_visibility(GTK_ENTRY(entry_new1), FALSE);
-	gtk_table_attach(GTK_TABLE(table), entry_new1, 1, 2, 2, 3,
-			GTK_FILL | GTK_EXPAND, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entry_new1, 1, 2, 1, 1);
+	gtk_widget_set_hexpand(entry_new1, TRUE);
+	gtk_widget_set_halign(entry_new1, GTK_ALIGN_FILL);
 
 	/* New passphrase again */
 	label = gtk_label_new(_("Confirm passphrase:"));
 	gtk_label_set_xalign(GTK_LABEL(label), 0.0);
-	gtk_table_attach(GTK_TABLE(table), label, 0, 1, 3, 4,
-			GTK_EXPAND | GTK_FILL, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), label, 0, 3, 1, 1);
 
 	entry_new2 = gtk_entry_new();
 	gtk_entry_set_visibility(GTK_ENTRY(entry_new2), FALSE);
-	gtk_table_attach(GTK_TABLE(table), entry_new2, 1, 2, 3, 4,
-			GTK_FILL | GTK_EXPAND, 0, 0, 0);
+	gtk_grid_attach(GTK_GRID(table), entry_new2, 1, 3, 1, 1);
+	gtk_widget_set_hexpand(entry_new2, TRUE);
+	gtk_widget_set_halign(entry_new2, GTK_ALIGN_FILL);
 
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list