~ubuntu-branches/ubuntu/raring/gnome-session/raring

« back to all changes in this revision

Viewing changes to .pc/103_kill_the_fail_whale.patch/gnome-session/gsm-fail-whale-dialog.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-05-07 11:22:35 UTC
  • mfrom: (1.1.75) (2.2.14 sid)
  • Revision ID: package-import@ubuntu.com-20120507112235-z9pe25ur5d8zt4c6
Tags: 3.4.1-1ubuntu1
* Merge with Debian. Remaining changes:
 - debian/control.in:
   + gnome-session
     - Recommend nautilus and either unity, unity-2d or gnome-shell
     - Only suggest gnome-session-fallback (we don't want it to be installed
       by default)
     - Drop the Recommends on gnome-power-manager, the code gnome-session uses
       has moved to gnome-settings-daemon
   + gnome-session-fallback
     - Recommend cups-pk-helper for gnome-session-fallback so that
       System Settings>Printers works
 - debian/gnome-session-bin.postinst, debian/gnome-session-bin.prerm:
    Moved registering gnome-session binary as a session manager to 
    gnome-session-bin package
 - debian/postinst, postrm:
    set the default lightdm session as ubuntu if none already set
 - don't install defaults.list (installed by desktop-file-utils in ubuntu):
    debian/gnome-session-common.dirs and gnome-session-common.install
 - add debian/gnome-session-common.gsettings-override:
   set ubuntu as the default session if nothing is provided
 - debian/55gnome-session_gnomerc:
    Use POSIX string substitutions (shell internal) instead of external
    basename and cut for startup speed.
 - debian/patches/20_hide_nodisplay.patch:
    Don't show applications in the Sessions properties dialog that have
    NoDisplay=true.
 - debian/patches/21_up_start_on_demand.patch:
    Don't call dkp_client_new() until actually needed. This blocks
    for some time whilst DK-Power is started, if it wasn't running already
    (which is the case during auto-login). This can delay the whole
    session from starting.
 - debian/patches/22_support_autostart_delay.patch:
    Bugzilla patch to support adding a delay to autostart apps, using
    a "X-GNOME-Autostart-Delay" key in the desktop file
 - debian/patches/50_ubuntu_sessions.patch:
    + Add Ubuntu & Ubuntu 2D sessions
    + Add GNOME Classic (Without Effects session). Use notify-osd for
      notifications, but don't add it to RequiredComponents since notify-osd
      doesn't have an autostart .desktop file
    + gnome-shell.desktop adds --session=gnome now that the "ubuntu" session
      is the default. Use TryExec to test if gnome-shell is installed.
 - debian/patches/51_remove_session_saving_from_gui.patch:
    add GNOME_SESSION_SAVE environment variable for people wanting to
    use the save session still, knowing that it can break your system
    if used unwisely (LP: #771896)
 - debian/patches/52_xdg_current_desktop.patch:
    Set XDG_CURRENT_DESKTOP inside gnome-session based on a
    new key 'DesktopName' in gnome-session .desktop files.
 - debian/patches/80_new_upstream_session_dialog.patch:
    Bugzilla patch to change the session dialog. (Deactivated, see bug 807503)
 - debian/patches/95_dbus_request_shutdown.patch:
    Add "RequestShutdown" and "RequestReboot" DBus methods to allow other
    applications to shutdown or reboot the machine via the session manager.
 - debian/patches/96_no_catch_sigsegv.patch:
    Don't register a handler for SIGSEGV. We want Apport to catch these
    crashes so that users can submit useful crash reports.
 - debian/patches/101_screen_lock_on_suspend.patch:
    Use the same logic as gnome-power-manager for deciding the "screen
    lock on suspend" policy. This restores the Jaunty behaviour rather
    than just using the screensaver settings, which is surprising for
    users.
    This patch is deactivated for now, we'll see with the new screensaver and
    screen locking experience what to do (not rebased on gsettings as well)
  - debian/patches/103_kill_the_fail_whale.patch:
    seems that the fail whale try to come back and resist from his removal
    refreshed the patch to ensure it's killed and won't come back ever ever
    again.
  - 104_dont_show_fallback_warning.patch:
    Disable GNOME Fallback warning. It doesn't really explain anything
    and assumes that there aren't people that want to run Fallback.
  - debian/patches/105_hide_session_startup_help.patch:
    Hide Help button on Startup Applications dialog, as it is broken
    and the help documentation hasn't been written for 3.x yet.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        gboolean debug_mode;
43
43
        gboolean allow_logout;
44
44
        GdkRectangle geometry;
45
 
        gboolean show_extensions;
46
45
        GsmShellExtensions *extensions;
47
 
        GtkWidget *extensions_box;
48
46
};
49
47
 
50
48
G_DEFINE_TYPE (GsmFailWhaleDialog, gsm_fail_whale_dialog, GTK_TYPE_WINDOW);
179
177
                                    GtkRequisition *requisition)
180
178
{
181
179
        GsmFailWhaleDialog *fail_dialog;
182
 
        GtkBin        *bin;
183
180
        GdkRectangle   old_geometry;
184
181
        int            position_changed = FALSE;
185
182
        int            size_changed = FALSE;
186
183
 
187
184
        fail_dialog = GSM_FAIL_WHALE_DIALOG (widget);
188
 
        bin = GTK_BIN (widget);
189
 
 
190
 
        if (gtk_bin_get_child (bin) &&
191
 
            gtk_widget_get_visible (gtk_bin_get_child (bin))) {
192
 
                gtk_widget_size_request (gtk_bin_get_child (bin), requisition);
193
 
        }
194
185
 
195
186
        old_geometry = fail_dialog->priv->geometry;
196
187
 
276
267
}
277
268
 
278
269
static void
279
 
on_extension_switched (GObject            *object,
280
 
                       GParamSpec         *spec,
281
 
                       GsmFailWhaleDialog *fail_dialog)
282
 
{
283
 
        gchar *uuid;
284
 
        gboolean enabled;
285
 
 
286
 
        uuid = g_object_get_data (object, "uuid");
287
 
        g_object_get (object, "active", &enabled, NULL);
288
 
 
289
 
        gsm_shell_extensions_set_enabled (fail_dialog->priv->extensions,
290
 
                                          uuid,
291
 
                                          enabled);
292
 
}
293
 
 
294
 
static void
295
 
build_extension_toggle (GsmShellExtensions *extensions,
296
 
                        GsmShellExtension  *extension,
297
 
                        gpointer            data)
298
 
{
299
 
        GsmFailWhaleDialog *fail_dialog = GSM_FAIL_WHALE_DIALOG (data);
300
 
        GtkWidget *hbox;
301
 
        GtkWidget *label;
302
 
        GtkWidget *sw;
303
 
 
304
 
        hbox = gtk_hbox_new (FALSE, 0);
305
 
        gtk_widget_set_size_request (hbox, 600, -1);
306
 
        gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER);
307
 
        gtk_widget_show (hbox);
308
 
        gtk_box_pack_start (GTK_BOX (fail_dialog->priv->extensions_box),
309
 
                            hbox, FALSE, FALSE, 0);
310
 
 
311
 
        label = gtk_label_new (gsm_shell_extension_get_name (extension));
312
 
 
313
 
        gtk_widget_show (label);
314
 
        gtk_widget_set_halign (label, GTK_ALIGN_START);
315
 
        gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
316
 
 
317
 
        sw = gtk_switch_new ();
318
 
        gtk_switch_set_active (GTK_SWITCH (sw),
319
 
                               gsm_shell_extension_get_is_enabled (extension));
320
 
 
321
 
        g_object_set_data (G_OBJECT (sw),
322
 
                           "uuid",
323
 
                           gsm_shell_extension_get_uuid (extension));
324
 
        g_signal_connect (G_OBJECT (sw),
325
 
                          "notify::active",
326
 
                          G_CALLBACK (on_extension_switched),
327
 
                          fail_dialog);
328
 
        gtk_widget_set_halign (label, GTK_ALIGN_END);
329
 
        gtk_widget_show (sw);
330
 
        gtk_box_pack_end (GTK_BOX (hbox), sw, FALSE, FALSE, 0);
331
 
}
332
 
 
333
 
static void
334
270
setup_window (GsmFailWhaleDialog *fail_dialog)
335
271
{
336
272
        GsmFailWhaleDialogPrivate *priv;
341
277
        GtkWidget *message_label;
342
278
        GtkWidget *button_box;
343
279
        GtkWidget *button;
344
 
        GtkWidget *extensions_scroll;
345
 
        GtkWidget *extensions_vbox;
346
280
        char *markup;
347
281
 
348
282
        priv = fail_dialog->priv;
364
298
        gtk_container_add (GTK_CONTAINER (fail_dialog), alignment);
365
299
        g_object_set (alignment, "valign", GTK_ALIGN_CENTER, NULL);
366
300
 
367
 
        box = gtk_vbox_new (FALSE, 10);
 
301
        box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10);
368
302
        gtk_widget_show (box);
369
303
        gtk_container_add (GTK_CONTAINER (alignment), box);
370
304
 
382
316
 
383
317
        if (!priv->allow_logout)
384
318
                message_label = gtk_label_new (_("A problem has occurred and the system can't recover. Please contact a system administrator"));
385
 
        else if (priv->show_extensions && gsm_shell_extensions_n_extensions (priv->extensions) > 0)
386
 
                message_label = gtk_label_new (_("A problem has occurred and the system can't recover. Some of the extensions below may have caused this.\nPlease try disabling some of these, and then log out and try again."));
 
319
        else if (priv->extensions != NULL && gsm_shell_extensions_n_extensions (priv->extensions) > 0)
 
320
                message_label = gtk_label_new (_("A problem has occurred and the system can't recover. All extensions have been disabled as a precaution."));
387
321
        else
388
322
                message_label = gtk_label_new (_("A problem has occurred and the system can't recover.\nPlease log out and try again."));
389
323
 
393
327
        gtk_box_pack_start (GTK_BOX (box),
394
328
                            message_label, FALSE, FALSE, 0);
395
329
 
396
 
        if (priv->allow_logout && priv->show_extensions) {
397
 
                extensions_vbox = gtk_vbox_new (TRUE, 6);
398
 
                gtk_widget_show (extensions_vbox);
399
 
                fail_dialog->priv->extensions_box = extensions_vbox;
400
 
 
401
 
                extensions_scroll = gtk_scrolled_window_new (NULL, NULL);
402
 
                gtk_widget_show (extensions_scroll);
403
 
 
404
 
                gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (extensions_scroll),
405
 
                                                       extensions_vbox);
406
 
 
407
 
                gtk_box_pack_start (GTK_BOX (box),
408
 
                                    extensions_scroll, FALSE, FALSE, 0);
409
 
 
410
 
                gsm_shell_extensions_foreach (priv->extensions,
411
 
                                              build_extension_toggle,
412
 
                                              (gpointer) fail_dialog);
413
 
        }
414
 
 
415
 
        button_box = gtk_hbutton_box_new ();
 
330
        button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
416
331
        gtk_container_set_border_width (GTK_CONTAINER (button_box), 20);
417
332
        gtk_widget_show (button_box);
418
333
        gtk_box_pack_end (GTK_BOX (box),
432
347
gsm_fail_whale_dialog_init (GsmFailWhaleDialog *fail_dialog)
433
348
{
434
349
        fail_dialog->priv = GSM_FAIL_WHALE_DIALOG_GET_PRIVATE (fail_dialog);
435
 
        fail_dialog->priv->extensions = g_object_new (GSM_TYPE_SHELL_EXTENSIONS, NULL);
436
350
}
437
351
 
438
352
void
439
 
gsm_fail_whale_dialog_we_failed (gboolean debug_mode,
440
 
                                 gboolean allow_logout,
441
 
                                 gboolean show_extensions)
 
353
gsm_fail_whale_dialog_we_failed (gboolean            debug_mode,
 
354
                                 gboolean            allow_logout,
 
355
                                 GsmShellExtensions *extensions)
442
356
 
443
357
{
444
358
        static GsmFailWhaleDialog *current_dialog = NULL;
451
365
        fail_dialog = g_object_new (GSM_TYPE_FAIL_WHALE_DIALOG, NULL);
452
366
        fail_dialog->priv->debug_mode = debug_mode;
453
367
        fail_dialog->priv->allow_logout = allow_logout;
454
 
        fail_dialog->priv->show_extensions = show_extensions;
 
368
        fail_dialog->priv->extensions = extensions;
 
369
 
455
370
        setup_window (fail_dialog);
456
371
 
457
372
        current_dialog = fail_dialog;