~ubuntu-branches/ubuntu/trusty/anjuta/trusty

« back to all changes in this revision

Viewing changes to plugins/git/plugin.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-08-17 23:48:26 UTC
  • mfrom: (1.1.50)
  • Revision ID: package-import@ubuntu.com-20120817234826-fvk3rfp6nmfaqi9p
Tags: 2:3.5.5-0ubuntu1
* New upstream release.
* debian/control.in:
  - Bump vala dependency to 0.18 series
  - Drop graphviz from build-depends
* debian/watch: Watch for unstable releases

Show diffs side-by-side

added added

removed removed

Lines of Context:
648
648
                END_REGISTER_ICON
649
649
}
650
650
 
 
651
static void
 
652
on_dock_window_mapped (GtkWidget *dock_window, Git *plugin)
 
653
{
 
654
        anjuta_shell_present_widget (ANJUTA_PLUGIN (plugin)->shell,
 
655
                                     plugin->command_bar_window, NULL);
 
656
}
 
657
 
 
658
static void
 
659
on_dock_window_unmapped (GtkWidget *dock_window, Git *plugin)
 
660
{
 
661
        anjuta_shell_hide_dockable_widget (ANJUTA_PLUGIN (plugin)->shell,
 
662
                                           plugin->command_bar_window, NULL);
 
663
}
 
664
 
 
665
static void
 
666
on_shell_exiting (AnjutaShell *shell, Git *plugin)
 
667
{
 
668
        g_signal_handlers_disconnect_by_func (G_OBJECT (plugin->dock_window),
 
669
                                              G_CALLBACK (on_dock_window_mapped),
 
670
                                              plugin);
 
671
 
 
672
        g_signal_handlers_disconnect_by_func (G_OBJECT (plugin->dock_window),
 
673
                                              G_CALLBACK (on_dock_window_unmapped),
 
674
                                              plugin);
 
675
}
 
676
 
 
677
 
651
678
static gboolean
652
679
git_activate_plugin (AnjutaPlugin *plugin)
653
680
{
700
727
                                 _("Git"), "git-plugin", ANJUTA_SHELL_PLACEMENT_CENTER,
701
728
                                 NULL);
702
729
 
 
730
        g_signal_connect (G_OBJECT (git_plugin->dock_window), "map",
 
731
                          G_CALLBACK (on_dock_window_mapped),
 
732
                          git_plugin);
 
733
 
 
734
        g_signal_connect (G_OBJECT (git_plugin->dock_window), "unmap",
 
735
                          G_CALLBACK (on_dock_window_unmapped),
 
736
                          git_plugin);
 
737
 
703
738
        /* Create the branch list commands. There are two commands because some 
704
739
         * views need to be able to tell the difference between local and 
705
740
         * remote branches */
805
840
                                                                                                                   on_editor_added,
806
841
                                                                                                                   on_editor_removed,
807
842
                                                                                                                   NULL);
 
843
 
 
844
        g_signal_connect (G_OBJECT (plugin->shell), "exiting",
 
845
                          G_CALLBACK (on_shell_exiting),
 
846
                          git_plugin);
808
847
        
809
848
        
810
849
        /* Git needs a working directory to work with; it can't take full paths,
837
876
        anjuta_shell_remove_widget (plugin->shell, git_plugin->command_bar_window, NULL);
838
877
        anjuta_shell_remove_widget (plugin->shell, git_plugin->dock_window, NULL);
839
878
 
 
879
        g_signal_handlers_disconnect_by_func (G_OBJECT (git_plugin->dock_window),
 
880
                                              G_CALLBACK (on_dock_window_mapped),
 
881
                                              plugin);
 
882
 
 
883
        g_signal_handlers_disconnect_by_func (G_OBJECT (git_plugin->dock_window),
 
884
                                              G_CALLBACK (on_dock_window_unmapped),
 
885
                                              plugin);
 
886
 
 
887
        g_signal_handlers_disconnect_by_func (G_OBJECT (plugin->shell),
 
888
                                              G_CALLBACK (on_shell_exiting),
 
889
                                              git_plugin);
 
890
 
840
891
        g_object_unref (git_plugin->local_branch_list_command);
841
892
        g_object_unref (git_plugin->remote_branch_list_command);
842
893
        g_object_unref (git_plugin->commit_status_command);