~ubuntu-branches/ubuntu/saucy/cairo-dock-plug-ins/saucy

« back to all changes in this revision

Viewing changes to Recent-Events/src/applet-dialog.c

  • Committer: Matthieu Baerts
  • Date: 2011-08-09 19:51:45 UTC
  • mfrom: (1.1.12 upstream)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: matttbe@gmail.com-20110809195145-6t55jtykipujuyn5
* New upstream release. (LP: #823514)
* Upstream (short) ChangeLog:
 - The Power-Manager applet has been rewritten to work on any plateform.
 - Compiz-icon applet has been replaced by Composite-Manager.
 - Improved integration in the XFCE, LXDE and GNOME3 desktop.
 - Logout is now working even if there is no/an unknow session manager.
 - Several new DBus methods lets you interact on the dock more easily.
 - Added the possibility to shutdown/logout with GMenu.
 - Improved Status-Notifier and added its own watcher.
 - Added a new applet: Impulse (still need testing).
 - Fixed a few bugs as usual.
* debian/patches:
 - Removed all patches (they was already unapplied).
* debian/copyright:
 - Updated with new files/directory.
* debian/cairo-dock-plug-ins.install:
 - Added status-notifier-watcher used by Status-Notifier applet.
* debian/control:
 - Updated the version of cairo-dock-[core;data;dev].
 - Bump Standard-Version to 3.9.2.
 - Added fftw3, pulse (Impulse) and upower-glib (Logout)
    as new dependences for the build process.
 - Added indicator-[me;messages] as new recommendations
    for cairo-dock-plug-ins (needed for [Me;Messaging]Menu applets).
 - Removed gawk from the build dependences list (no longer needed).
* cairo-dock-plug-ins package needs to be recompiled (LP: #811579)

Show diffs side-by-side

added added

removed removed

Lines of Context:
354
354
        gtk_box_pack_start (GTK_BOX (pMainBox), pToolBar, TRUE, TRUE, MARGIN);
355
355
        
356
356
        int i = 0;
357
 
        GtkToolItem *group = _add_category_button (pToolBar, D_("All"), "stock_all", i++, NULL);
 
357
        GtkToolItem *group = _add_category_button (pToolBar, D_("All"), "stock_search", i++, NULL);
358
358
        _add_category_button (pToolBar, D_("Document"), "document", i++, group);
359
359
        ///_add_category_button (pToolBar, D_("Folder"), "folder", i++, group);
360
360
        _add_category_button (pToolBar, D_("Image"), "image", i++, group);
369
369
        gtk_box_pack_start (GTK_BOX (pMainBox), pFilterBox, FALSE, FALSE, MARGIN);
370
370
        
371
371
        GtkWidget *pFilterLabel = gtk_label_new (D_("Look for events"));
 
372
        cairo_dock_set_dialog_widget_text_color (GTK_WIDGET (pFilterLabel));
372
373
        gtk_box_pack_start (GTK_BOX (pFilterBox), pFilterLabel, FALSE, FALSE, MARGIN);
373
374
        
374
375
        GtkWidget *pEntry = gtk_entry_new ();
442
443
        return pMainBox;
443
444
}
444
445
 
445
 
/**static gboolean on_button_press_dialog (GtkWidget *widget, GdkEventButton *pButton, CairoDockModuleInstance *myApplet)
446
 
{
447
 
        CD_APPLET_ENTER;
448
 
        cairo_dock_dialog_unreference (myData.pDialog);
449
 
        myData.pDialog = NULL;
450
 
        CD_APPLET_LEAVE(FALSE);
451
 
}*/
452
446
static void _on_dialog_destroyed (CairoDockModuleInstance *myApplet)
453
447
{
454
448
        myData.pDialog = NULL;
456
450
        myData.iCurrentCaterogy = CD_EVENT_ALL;
457
451
        myData.pModel = NULL;   
458
452
}
 
453
static gboolean _show_dialog_delayed (gpointer data)
 
454
{
 
455
        cd_toggle_dialog ();
 
456
        return FALSE;
 
457
}
459
458
void cd_toggle_dialog (void)
460
459
{
461
 
        if (myData.pDialog != NULL)
 
460
        if (myData.pDialog != NULL)  // the dialog can be opened in the case it was called from the shortkey.
462
461
        {
463
462
                cairo_dock_dialog_unreference (myData.pDialog);
464
463
                myData.pDialog = NULL;
465
464
        }
466
465
        else
467
466
        {
 
467
                // establish the connection to Zeitgesit.
 
468
                if (myData.pLog == NULL)  // first search.
 
469
                {
 
470
                        g_print ("first search\n");
 
471
                        myData.pLog = zeitgeist_log_new ();  // may launch the Zeitgeist daemon if it's not yet running.
 
472
                        if (! zeitgeist_log_is_connected (myData.pLog))  // the connection may not be immediate (even if the daemon is already running), in this case come back in 1s.
 
473
                        {
 
474
                                g_print ("come back in 1s...\n");
 
475
                                g_timeout_add_seconds (1, _show_dialog_delayed, NULL);
 
476
                                return;
 
477
                        }
 
478
                }
 
479
                else if (! zeitgeist_log_is_connected (myData.pLog))
 
480
                {
 
481
                        cairo_dock_remove_dialog_if_any (myIcon);
 
482
                        cairo_dock_show_temporary_dialog_with_icon (D_("You need to install the Zeitgeist data engine."), myIcon, myContainer, 6000, "same icon");
 
483
                        return;
 
484
                }
 
485
                
 
486
                // build the dialog and the tree model.
468
487
                GtkWidget *pInteractiveWidget = cd_build_events_widget ();
469
488
                myData.pDialog = cairo_dock_show_dialog_full (D_("Browse and search in recent events"),
470
489
                        myIcon,
476
495
                        myApplet,
477
496
                        (GFreeFunc) _on_dialog_destroyed);
478
497
                gtk_widget_grab_focus (myData.pEntry);
479
 
                /**g_signal_connect (G_OBJECT (myData.pDialog->container.pWidget),
480
 
                        "button-press-event",
481
 
                        G_CALLBACK (on_button_press_dialog),
482
 
                        myApplet);*/
483
498
                
 
499
                // trigger the search that will fill the model.
484
500
                cd_trigger_search ();
485
501
        }
486
502
}