~ubuntu-branches/ubuntu/raring/gnome-bluetooth/raring-proposed

« back to all changes in this revision

Viewing changes to sendto/main.c

  • Committer: Package Import Robot
  • Author(s): Robert Ancell
  • Date: 2012-06-15 13:02:12 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20120615130212-uwb9s4x23r7w28a5
Tags: 3.4.1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
                                "approximately %'d hours", hours), hours);
179
179
}
180
180
 
181
 
static void
182
 
set_response_visible (GtkDialog *dialog,
183
 
                      int response_id,
184
 
                      gboolean visible)
185
 
{
186
 
        GtkWidget *widget;
187
 
 
188
 
        widget = gtk_dialog_get_widget_for_response (dialog, response_id);
189
 
        gtk_widget_set_no_show_all (widget, TRUE);
190
 
        gtk_widget_set_visible (widget, visible);
191
 
}
192
 
 
193
181
static void response_callback(GtkWidget *dialog,
194
182
                                        gint response, gpointer user_data)
195
183
{
197
185
                setup_agent ();
198
186
 
199
187
                /* Reset buttons */
200
 
                set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE, FALSE);
201
 
                set_response_visible (GTK_DIALOG (dialog), RESPONSE_RETRY, FALSE);
202
 
                set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL, TRUE);
 
188
                gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), RESPONSE_RETRY, FALSE);
203
189
 
204
190
                /* Reset status and progress bar */
205
191
                gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress),
245
231
        dialog = gtk_dialog_new_with_buttons(_("File Transfer"), NULL,
246
232
                                0,
247
233
                                GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
248
 
                                GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
249
234
                                _("_Retry"), RESPONSE_RETRY,
250
235
                                NULL);
251
 
        set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE, FALSE);
252
 
        set_response_visible (GTK_DIALOG (dialog), RESPONSE_RETRY, FALSE);
 
236
        gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), RESPONSE_RETRY, FALSE);
253
237
        gtk_window_set_type_hint(GTK_WINDOW(dialog),
254
238
                                                GDK_WINDOW_TYPE_HINT_NORMAL);
255
239
        gtk_window_set_position(GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
517
501
        time = format_time(remaining_time);
518
502
 
519
503
        if (transfer_rate >= 3000)
520
 
                rate = g_strdup_printf(_("%d KB/s"), transfer_rate / 1000);
 
504
                rate = g_strdup_printf(_("%d kB/s"), transfer_rate / 1000);
521
505
        else
522
506
                rate = g_strdup_printf(_("%d B/s"), transfer_rate);
523
507
 
579
563
        gtk_widget_show (image_status);
580
564
        gtk_label_set_markup(GTK_LABEL(label_status), message);
581
565
 
582
 
        set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL, TRUE);
583
 
        set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE, FALSE);
584
 
        set_response_visible (GTK_DIALOG (dialog), RESPONSE_RETRY, TRUE);
 
566
        gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), RESPONSE_RETRY, TRUE);
585
567
 
586
568
        g_object_unref (current_transfer);
587
569
        current_transfer = NULL;
614
596
                gtk_label_set_markup(GTK_LABEL(label_status), message);
615
597
                g_free (message);
616
598
 
617
 
                set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL, TRUE);
618
 
                set_response_visible (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE, FALSE);
619
 
                set_response_visible (GTK_DIALOG (dialog), RESPONSE_RETRY, TRUE);
 
599
                gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), RESPONSE_RETRY, TRUE);
 
600
 
620
601
                return;
621
602
        }
622
603
 
733
714
 
734
715
static GOptionEntry options[] = {
735
716
        { "device", 0, 0, G_OPTION_ARG_STRING, &option_device,
736
 
                                N_("Remote device to use"), "ADDRESS" },
 
717
                                N_("Remote device to use"), N_("ADDRESS") },
737
718
        { "name", 0, 0, G_OPTION_ARG_STRING, &option_device_name,
738
 
                                N_("Remote device's name"), NULL },
 
719
                                N_("Remote device's name"), N_("NAME") },
739
720
        { "dest", 0, G_OPTION_FLAG_HIDDEN,
740
721
                        G_OPTION_ARG_STRING, &option_device, NULL, NULL },
741
722
        { G_OPTION_REMAINING, 0, 0,
754
735
 
755
736
        error = NULL;
756
737
 
757
 
        if (gtk_init_with_args(&argc, &argv, "[FILE...]",
 
738
        if (gtk_init_with_args(&argc, &argv, _("[FILE...]"),
758
739
                                options, GETTEXT_PACKAGE, &error) == FALSE) {
759
740
                if (error != NULL) {
760
741
                        g_printerr("%s\n", error->message);
821
802
                                                        error->message);
822
803
                        g_error_free(error);
823
804
                } else
824
 
                        g_print("An unknown error occured\n");
 
805
                        g_print("An unknown error occurred\n");
825
806
 
826
807
                return 1;
827
808
        }