summaryrefslogtreecommitdiff
path: root/src/caja-connect-server-dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/caja-connect-server-dialog.c')
-rw-r--r--src/caja-connect-server-dialog.c170
1 files changed, 6 insertions, 164 deletions
diff --git a/src/caja-connect-server-dialog.c b/src/caja-connect-server-dialog.c
index 4d4a1a3a..6df18f66 100644
--- a/src/caja-connect-server-dialog.c
+++ b/src/caja-connect-server-dialog.c
@@ -40,11 +40,6 @@
#include <libcaja-private/caja-global-preferences.h>
#include <libcaja-private/caja-icon-names.h>
-#if GTK_CHECK_VERSION (3, 0, 0)
-#define gtk_hbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_HORIZONTAL,Y)
-#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y)
-#endif
-
/* TODO:
* - name entry + pre-fill
* - NetworkManager integration
@@ -54,11 +49,7 @@ struct _CajaConnectServerDialogDetails
{
CajaApplication *application;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *primary_grid;
-#else
- GtkWidget *primary_table;
-#endif
GtkWidget *user_details;
GtkWidget *port_spinbutton;
@@ -189,7 +180,7 @@ connect_dialog_set_connecting (CajaConnectServerDialog *dialog)
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (dialog->details->info_bar));
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
gtk_widget_show (hbox);
@@ -218,7 +209,7 @@ connect_dialog_gvfs_error (CajaConnectServerDialog *dialog)
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (dialog->details->info_bar));
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_container_add (GTK_CONTAINER (content_area), hbox);
gtk_widget_show (hbox);
@@ -232,11 +223,7 @@ connect_dialog_gvfs_error (CajaConnectServerDialog *dialog)
gtk_widget_show (label);
gtk_widget_set_sensitive (dialog->details->connect_button, FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_widget_set_sensitive (dialog->details->primary_grid, FALSE);
-#else
- gtk_widget_set_sensitive (dialog->details->primary_table, FALSE);
-#endif
gtk_widget_show (dialog->details->info_bar);
}
@@ -334,7 +321,7 @@ connect_dialog_set_info_bar_error (CajaConnectServerDialog *dialog,
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_widget_show (dialog->details->info_bar);
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 6);
gtk_widget_show (hbox);
@@ -410,7 +397,7 @@ connect_dialog_request_additional_details (CajaConnectServerDialog *self,
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (self->details->info_bar));
entry = NULL;
- hbox = gtk_hbox_new (FALSE, 6);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE, 6);
gtk_widget_show (hbox);
@@ -857,11 +844,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
GtkWidget *label;
GtkWidget *alignment;
GtkWidget *content_area;
-#if GTK_CHECK_VERSION (3, 0, 0)
GtkWidget *combo, *grid;
-#else
- GtkWidget *combo, *table;
-#endif
GtkWidget *vbox, *hbox, *connect_button, *checkbox;
GtkListStore *store;
GtkCellRenderer *renderer;
@@ -899,16 +882,6 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6);
gtk_widget_show (label);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* server settings alignment */
- alignment = gtk_alignment_new (0, 0, 0, 0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- 0, 0, 12, 0);
- gtk_box_pack_start (GTK_BOX (content_area), alignment, TRUE, TRUE, 0);
- gtk_widget_show (alignment);
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
grid = gtk_grid_new ();
gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL);
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
@@ -936,29 +909,6 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
gtk_grid_attach_next_to (GTK_GRID (grid), hbox, label,
GTK_POS_RIGHT,
1, 1);
-#else
- table = gtk_table_new (4, 2, FALSE);
- gtk_container_add (GTK_CONTAINER (alignment), table);
- gtk_widget_show (table);
-
- dialog->details->primary_table = table;
-
- /* first row: server entry + port spinbutton */
- label = gtk_label_new_with_mnemonic (_("_Server:"));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
- gtk_widget_show (label);
-
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox);
- gtk_table_attach (GTK_TABLE (table), hbox,
- 1, 2,
- 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
dialog->details->server_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->server_entry), TRUE);
@@ -995,14 +945,7 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
gtk_widget_show (label);
dialog->details->type_combo = combo = gtk_combo_box_new ();
@@ -1066,15 +1009,8 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
gtk_widget_show (combo);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), combo, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), combo,
- 1, 2,
- 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND, 6, 3);
-#endif
g_signal_connect_swapped (combo, "changed",
G_CALLBACK (connect_dialog_setup_for_type),
dialog);
@@ -1086,26 +1022,12 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 2, 3,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
dialog->details->share_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->share_entry), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->details->share_entry, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->details->share_entry,
- 1, 2,
- 2, 3,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
bind_visibility (dialog, dialog->details->share_entry, label);
@@ -1116,27 +1038,13 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 3, 4,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
gtk_widget_show (label);
dialog->details->folder_entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (dialog->details->folder_entry), "/");
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->folder_entry), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->details->folder_entry, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->details->folder_entry,
- 1, 2,
- 3, 4,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
gtk_widget_show (dialog->details->folder_entry);
/* user details label */
@@ -1151,18 +1059,6 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#endif
gtk_box_pack_start (GTK_BOX (content_area), label, FALSE, FALSE, 6);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- /* user details alignment */
- alignment = gtk_alignment_new (0, 0, 0, 0);
- gtk_alignment_set_padding (GTK_ALIGNMENT (alignment),
- 0, 0, 12, 0);
- gtk_box_pack_start (GTK_BOX (content_area), alignment, TRUE, TRUE, 0);
-
- bind_visibility (dialog, alignment, label);
- dialog->details->user_details = alignment;
-#endif
-
-#if GTK_CHECK_VERSION (3, 0, 0)
grid = gtk_grid_new ();
gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
gtk_grid_set_column_spacing (GTK_GRID (grid), 3);
@@ -1175,11 +1071,6 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
bind_visibility (dialog, grid, label);
dialog->details->user_details = grid;
-#else
- table = gtk_table_new (4, 2, FALSE);
- gtk_container_add (GTK_CONTAINER (alignment), table);
- gtk_widget_show (table);
-#endif
/* first row: domain entry */
label = gtk_label_new (_("Domain Name:"));
@@ -1188,26 +1079,12 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
dialog->details->domain_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->domain_entry), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->details->domain_entry, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->details->domain_entry,
- 1, 2,
- 0, 1,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
bind_visibility (dialog, dialog->details->domain_entry, label);
@@ -1218,26 +1095,12 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
dialog->details->user_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->user_entry), TRUE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->details->user_entry, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->details->user_entry,
- 1, 2,
- 1, 2,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
bind_visibility (dialog, dialog->details->user_entry, label);
@@ -1248,54 +1111,33 @@ caja_connect_server_dialog_init (CajaConnectServerDialog *dialog)
#else
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
#endif
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_container_add (GTK_CONTAINER (grid), label);
-#else
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1,
- 2, 3,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
dialog->details->password_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (dialog->details->password_entry), TRUE);
gtk_entry_set_visibility (GTK_ENTRY (dialog->details->password_entry), FALSE);
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), dialog->details->password_entry, label,
GTK_POS_RIGHT, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), dialog->details->password_entry,
- 1, 2,
- 2, 3,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 3);
-#endif
bind_visibility (dialog, dialog->details->password_entry, label);
/* fourth row: remember checkbox */
checkbox = gtk_check_button_new_with_label (_("Remember this password"));
-#if GTK_CHECK_VERSION (3, 0, 0)
gtk_grid_attach_next_to (GTK_GRID (grid), checkbox, dialog->details->password_entry,
GTK_POS_BOTTOM, 1, 1);
-#else
- gtk_table_attach (GTK_TABLE (table), checkbox,
- 1, 2,
- 3, 4,
- GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 6, 0);
-#endif
dialog->details->remember_checkbox = checkbox;
bind_visibility (dialog, dialog->details->password_entry, checkbox);
/* add as bookmark */
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (content_area), vbox, FALSE, FALSE, 6);
dialog->details->bookmark_checkbox = gtk_check_button_new_with_mnemonic (_("Add _bookmark"));
gtk_box_pack_start (GTK_BOX (vbox), dialog->details->bookmark_checkbox, TRUE, TRUE, 0);
gtk_widget_show (dialog->details->bookmark_checkbox);
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
label = gtk_label_new (_("Bookmark Name:"));