* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
#include <string.h>
#include "gtkmountoperationprivate.h"
-#include "gtkalignment.h"
#include "gtkbox.h"
#include "gtkentry.h"
-#include "gtkhbox.h"
+#include "gtkbox.h"
#include "gtkintl.h"
#include "gtklabel.h"
-#include "gtkvbox.h"
#include "gtkmessagedialog.h"
-#include "gtkmisc.h"
#include "gtkmountoperation.h"
#include "gtkprivate.h"
#include "gtkradiobutton.h"
#include "gtkstock.h"
-#include "gtktable.h"
+#include "gtkgrid.h"
#include "gtkwindow.h"
#include "gtktreeview.h"
#include "gtktreeselection.h"
#include "gtkicontheme.h"
#include "gtkimagemenuitem.h"
#include "gtkmain.h"
-#include "gtkalias.h"
/**
* SECTION:filesystem
GtkWidget *label;
label = gtk_label_new_with_mnemonic (label_text);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+ gtk_widget_set_halign (label, GTK_ALIGN_START);
+ gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
+ gtk_widget_set_hexpand (label, TRUE);
entry = gtk_entry_new ();
if (value)
gtk_entry_set_text (GTK_ENTRY (entry), value);
- gtk_table_attach (GTK_TABLE (table), label,
- 0, 1, row, row + 1,
- GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
- gtk_table_attach_defaults (GTK_TABLE (table), entry,
- 1, 2, row, row + 1);
+ gtk_grid_attach (GTK_GRID (table), label, 0, row, 1, 1);
+ gtk_grid_attach (GTK_GRID (table), entry, 1, row, 1, 1);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
g_signal_connect (entry, "changed",
GtkWidget *widget;
GtkDialog *dialog;
GtkWindow *window;
- GtkWidget *entry_container;
GtkWidget *hbox, *main_vbox, *vbox, *icon;
GtkWidget *table;
GtkWidget *message_label;
+ GtkWidget *content_area, *action_area;
gboolean can_anonymous;
guint rows;
const gchar *secondary;
priv->dialog = dialog;
+ content_area = gtk_dialog_get_content_area (dialog);
+ action_area = gtk_dialog_get_action_area (dialog);
+
/* Set the dialog up with HIG properties */
- gtk_dialog_set_has_separator (dialog, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->vbox), 2); /* 2 * 5 + 2 = 12 */
- gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 5);
- gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+ gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
+ gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
+ gtk_box_set_spacing (GTK_BOX (action_area), 6);
gtk_window_set_resizable (window, FALSE);
gtk_window_set_title (window, "");
-1);
/* Build contents */
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
- gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE, 0);
icon = gtk_image_new_from_stock (GTK_STOCK_DIALOG_AUTHENTICATION,
GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (icon), 0.5, 0.0);
+ gtk_widget_set_halign (icon, GTK_ALIGN_CENTER);
+ gtk_widget_set_valign (icon, GTK_ALIGN_START);
gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, FALSE, 0);
- main_vbox = gtk_vbox_new (FALSE, 18);
+ main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 18);
gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0);
secondary = strstr (message, "\n");
message_label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (message_label), s);
- gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+ gtk_widget_set_halign (message_label, GTK_ALIGN_START);
+ gtk_widget_set_valign (message_label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
FALSE, TRUE, 0);
else
{
message_label = gtk_label_new (message);
- gtk_misc_set_alignment (GTK_MISC (message_label), 0.0, 0.5);
+ gtk_widget_set_halign (message_label, GTK_ALIGN_START);
+ gtk_widget_set_valign (message_label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (message_label), TRUE);
gtk_box_pack_start (GTK_BOX (main_vbox), GTK_WIDGET (message_label),
FALSE, FALSE, 0);
}
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (main_vbox), vbox, FALSE, FALSE, 0);
can_anonymous = flags & G_ASK_PASSWORD_ANONYMOUS_SUPPORTED;
GtkWidget *choice;
GSList *group;
- anon_box = gtk_vbox_new (FALSE, 6);
+ anon_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), anon_box,
FALSE, FALSE, 0);
rows++;
/* The table that holds the entries */
- entry_container = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
-
- gtk_alignment_set_padding (GTK_ALIGNMENT (entry_container),
- 0, 0, can_anonymous ? 12 : 0, 0);
+ table = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (table), 6);
+ gtk_grid_set_column_spacing (GTK_GRID (table), 6);
- gtk_box_pack_start (GTK_BOX (vbox), entry_container,
- FALSE, FALSE, 0);
- priv->entry_container = entry_container;
+ if (can_anonymous)
+ gtk_widget_set_margin_left (table, 12);
- table = gtk_table_new (rows, 2, FALSE);
- gtk_table_set_col_spacings (GTK_TABLE (table), 12);
- gtk_table_set_row_spacings (GTK_TABLE (table), 6);
- gtk_container_add (GTK_CONTAINER (entry_container), table);
+ gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
+ priv->entry_container = table;
rows = 0;
GSList *group;
GPasswordSave password_save;
- remember_box = gtk_vbox_new (FALSE, 6);
+ remember_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (vbox), remember_box,
FALSE, FALSE, 0);
&pixbuf);
if (name == NULL)
- name = g_strdup_printf (_("Unknown Application (pid %d)"), pid);
+ name = g_strdup_printf (_("Unknown Application (PID %d)"), pid);
if (command_line == NULL)
command_line = g_strdup ("");
ret = FALSE;
- /* Ignore double-clicks and triple-clicks */
- if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+ if (gdk_event_triggers_context_menu ((GdkEvent *) event))
{
ret = do_popup_menu_for_process_tree_view (widget, event, op);
}
return ret;
}
-static void
+static GtkWidget *
create_show_processes_dialog (GMountOperation *op,
const char *message,
const char *choices[])
if (priv->parent_window != NULL)
gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);
gtk_window_set_title (GTK_WINDOW (dialog), "");
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0);
g_object_add_weak_pointer (G_OBJECT (tree_view), (gpointer *) &priv->process_tree_view);
g_object_unref (list_store);
-
- gtk_widget_show_all (dialog);
g_object_ref (op);
+
+ return dialog;
}
static void
const char *choices[])
{
GtkMountOperationPrivate *priv;
+ GtkWidget *dialog = NULL;
g_return_if_fail (GTK_IS_MOUNT_OPERATION (op));
g_return_if_fail (message != NULL);
if (priv->process_list_store == NULL)
{
/* need to create the dialog */
- create_show_processes_dialog (op, message, choices);
+ dialog = create_show_processes_dialog (op, message, choices);
}
/* otherwise, we're showing the dialog, assume messages+choices hasn't changed */
update_process_list_store (GTK_MOUNT_OPERATION (op),
priv->process_list_store,
processes);
+
+ if (dialog != NULL)
+ {
+ gtk_widget_show_all (dialog);
+ }
}
static void
/**
* gtk_mount_operation_new:
- * @parent: transient parent of the window, or %NULL
+ * @parent: (allow-none): transient parent of the window, or %NULL
*
* Creates a new #GtkMountOperation
*
/**
* gtk_mount_operation_set_parent:
* @op: a #GtkMountOperation
- * @parent: transient parent of the window, or %NULL
+ * @parent: (allow-none): transient parent of the window, or %NULL
*
* Sets the transient parent for windows shown by the
* #GtkMountOperation.
*
* Gets the transient parent used by the #GtkMountOperation
*
- * Returns: the transient parent for windows shown by @op
+ * Returns: (transfer none): the transient parent for windows shown by @op
*
* Since: 2.14
*/
* gtk_mount_operation_get_screen:
* @op: a #GtkMountOperation
*
- * Gets the screen on which windows of the #GtkMountOperation
+ * Gets the screen on which windows of the #GtkMountOperation
* will be shown.
*
- * Returns: the screen on which windows of @op are shown
+ * Returns: (transfer none): the screen on which windows of @op are shown
*
* Since: 2.14
*/
else
return gdk_screen_get_default ();
}
-
-#define __GTK_MOUNT_OPERATION_C__
-#include "gtkaliasdef.c"