1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Implementation of DAAP (iTunes Music Sharing) dialogs
4
* (password & name collision)
6
* Copyright (C) 2005 Charles Schmidt <cschmidt2@emich.edu>
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28
#include <glib/gi18n.h>
29
#include <glib/gprintf.h>
32
#include "rb-daap-dialog.h"
35
rb_daap_collision_dialog_new_run (GtkWindow *parent,
47
dialog = gtk_dialog_new_with_buttons (_("Invalid share name"),
49
GTK_DIALOG_DESTROY_WITH_PARENT,
53
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
54
gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
56
hbox = gtk_hbox_new (FALSE, 6);
57
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
58
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox, TRUE, TRUE, 0);
60
image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_DIALOG);
61
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
63
vbox = gtk_vbox_new (FALSE, 6);
64
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
66
s = g_strdup_printf (_("The shared music name '%s' is already taken. Please choose another."), old_name);
67
label = gtk_label_new (s);
68
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
71
hbox = gtk_hbox_new (FALSE, 12);
72
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
74
label = gtk_label_new_with_mnemonic (_("Shared music _name:"));
75
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
77
entry = gtk_entry_new ();
78
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
79
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
80
gtk_entry_set_text (GTK_ENTRY (entry), old_name);
81
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
83
gtk_widget_show_all (dialog);
86
resp = gtk_dialog_run (GTK_DIALOG (dialog));
87
} while (resp != GTK_RESPONSE_OK);
89
s = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry)));
90
gtk_widget_destroy (dialog);