/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* killev.c * * Copyright (C) 2003 Ximian, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "e-util/e-lang-utils.h" typedef struct { char *location; GPtrArray *names; } KillevComponent; GSList *languages; GHashTable *components; static gboolean kill_process (const char *proc_name, KillevComponent *comp) { int status, i; char *command; GString *desc; command = g_strdup_printf (KILL_PROCESS_CMD " -0 %s 2> /dev/null", proc_name); status = system (command); g_free (command); if (status == -1 || !WIFEXITED (status)) { /* This most likely means that KILL_PROCESS_CMD wasn't * found, so just bail completely. */ fprintf (stderr, _("Could not execute '%s': %s\n"), KILL_PROCESS_CMD, strerror (errno)); exit (1); } if (WEXITSTATUS (status) != 0) return FALSE; desc = g_string_new (NULL); for (i = 0; i < comp->names->len; i++) { if (i > 0) g_string_append (desc, " / "); g_string_append (desc, comp->names->pdata[i]); } printf (_("Shutting down %s (%s)\n"), proc_name, desc->str); g_string_free (desc, TRUE); command = g_strdup_printf (KILL_PROCESS_CMD " -9 %s 2> /dev/null", proc_name); system (command); g_free (command); return TRUE; }; static const char *patterns[] = { "%s", "%.16s", "lt-%s", "lt-%.13s" }; static const int n_patterns = G_N_ELEMENTS (patterns); static gboolean kill_component (gpointer key, gpointer value, gpointer data) { KillevComponent *comp = value; char *base_name, *exe_name, *dash; int i; base_name = g_strdup (comp->location); try_again: for (i = 0; i < n_patterns; i++) { exe_name = g_strdup_printf (patterns[i], base_name); if (kill_process (exe_name, comp)) { g_free (exe_name); g_free (base_name); return TRUE; } g_free (exe_name); } dash = strrchr (base_name, '-'); if (dash && !strcmp (dash + 1, BASE_VERSION)) { *dash = '\0'; goto try_again; } g_free (base_name); return TRUE; } static void add_matching_query (const char *query) { Bonobo_ServerInfoList *info_list; Bonobo_ServerInfo *info; CORBA_Environment ev; const char *location, *name; KillevComponent *comp; int i; CORBA_exception_init (&ev); info_list = bonobo_activation_query (query, NULL, &ev); if (ev._major != CORBA_NO_EXCEPTION) { printf ("Bonobo activation failure: %s\n", bonobo_exception_get_text (&ev)); CORBA_exception_free (&ev); return; } for (i = 0; i < info_list->_length; i++) { info = &info_list->_buffer[i]; if (strcmp (info->server_type, "exe") != 0) continue; location = info->location_info; if (strchr (location, '/')) location = strrchr (location, '/') + 1; comp = g_hash_table_lookup (components, location); if (!comp) { comp = g_new (KillevComponent, 1); comp->location = g_strdup (location); comp->names = g_ptr_array_new (); g_hash_table_insert (components, comp->location, comp); } name = bonobo_server_info_prop_lookup (info, "name", languages); if (name) g_ptr_array_add (comp->names, g_strdup (name)); } CORBA_free (info_list); CORBA_exception_free (&ev); } static void add_matching_repo_id (const char *repo_id) { char *query; query = g_strdup_printf ("repo_ids.has ('%s')", repo_id); add_matching_query (query); g_free (query); } static void add_matching_iid (const char *iid) { char *query; query = g_strdup_printf ("iid == '%s'", iid); add_matching_query (query); g_free (query); } int main (int argc, char **argv) { bindtextdomain (GETTEXT_PACKAGE, EVOLUTION_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); gnome_program_init (PACKAGE, VERSION, LIBGNOME_MODULE, argc, argv, GNOME_PROGRAM_STANDARD_PROPERTIES, NULL); languages = e_get_language_list (); components = g_hash_table_new (g_str_hash, g_str_equal); add_matching_repo_id ("IDL:GNOME/Evolution/Shell:" BASE_VERSION); g_hash_table_foreach_remove (components, kill_component, NULL); add_matching_repo_id ("IDL:GNOME/Evolution/ShellComponent:" BASE_VERSION); add_matching_repo_id ("IDL:GNOME/Evolution/Calendar/CalFactory:" BASE_VERSION); add_matching_repo_id ("IDL:GNOME/Evolution/BookFactory:" BASE_VERSION); add_matching_repo_id ("IDL:GNOME/Evolution/Importer:" BASE_VERSION); add_matching_repo_id ("IDL:GNOME/Evolution/IntelligentImporter:" BASE_VERSION); add_matching_repo_id ("IDL:GNOME/Spell/Dictionary:0.3"); add_matching_iid ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify:" BASE_VERSION); add_matching_iid ("OAFIID:GNOME_GtkHTML_Editor_Factory:3.1"); g_hash_table_foreach_remove (components, kill_component, NULL); return 0; } commitgraph'>* | Last scroll-pane, and manual sizing tweakMichael Meeks2010-04-072-1/+21 * | Get the new contact sizing right despite the scrolled regions.Michael Meeks2010-04-072-1/+11 * | Scrolled window for personal bits ...Michael Meeks2010-04-071-1/+19 * | Add a scrolled area to cope if we want to expand mail settignsMichael Meeks2010-04-071-0/+18 * | Add conditionally enabled expanders for 'Other' address and 'Misc'Michael Meeks2010-04-072-12/+24 * | Switch back to an older version with my changes.Michael Meeks2010-04-071-471/+1491 * | Adapt and further compact the UI with new expander-alikeMichael Meeks2010-04-071-39/+87 * | Add expander button to E-mail pieces.Michael Meeks2010-04-071-0/+66 * | Add vertical orientation properties to make glade-3 happy.Michael Meeks2010-04-071-0/+62 * | Refresh contact-editor.ui.Matthew Barnes2010-04-071-1558/+461 * | Compress new contact dialog (first page) a little; more to come.Michael Meeks2010-04-073-5/+31 |/ * Clean up GalView and related classes.Matthew Barnes2010-03-113-50/+56 * Strip whitespace off email addresses in contact editor.Matthew Barnes2010-03-111-2/+4 * Update win32 directory relocation and some consistency cleanupFridrich Strba2010-03-102-2/+1 * Remove a long lived win32 hackFridrich Strba2010-03-062-8/+1 * Work around recent GTK+ deprecations.Matthew Barnes2010-03-052-0/+8 * Bug #610382 - No addressbook selected on account disableMilan Crha2010-02-251-1/+3 * Bug #610658 - Contact is lost after moving to the same address bookMilan Crha2010-02-252-7/+12 * Bug #602996 - Prevent crash on certain circumstancesMilan Crha2010-02-221-2/+2 * Bug #610061 - Do not re-run book view on same book with same queryMilan Crha2010-02-191-5/+27 * Add DnD support to e-selection.c.Matthew Barnes2010-02-092-40/+19 * Coding style and whitespace cleanup.Matthew Barnes2010-02-081-16/+32 * Bug 607520 - 'Add to Address Book' fails when address has spaceMatthew Barnes2010-02-032-0/+27 * Coding style and whitespace cleanup.Matthew Barnes2010-01-3116-65/+65 * Coding style and whitespace cleanups.Matthew Barnes2010-01-231-1/+3 * Bug 607542 - Sometimes delete in pop up doesn't get displayedMatthew Barnes2010-01-211-0/+6 * Improve clipboard behavior.Matthew Barnes2010-01-182-8/+86 * Remove dead assignments found by clang.Matthew Barnes2010-01-169-49/+6 * Bug #604670 - addressbook-export segfaults when specifying addressbookMilan Crha2010-01-141-0/+2 * Cleanup delete actions in shell views.Matthew Barnes2010-01-111-0/+17 * Bug 606250 - Remove usage of deprecated GTK+ symbolsMatthew Barnes2010-01-081-1/+1 * Coding style and whitespace cleanup.Matthew Barnes2010-01-053-11/+30 * Kill e_popup_menu().Matthew Barnes2010-01-053-3/+0 * Coding style and whitespace cleanup.Matthew Barnes2010-01-045-31/+71 * Compiler and linker flag cleanups.Matthew Barnes2009-12-284-15/+25 * Coding style and whitespace cleanup.Matthew Barnes2009-12-262-8/+15 * Introduce ESelectable and EFocusTracker.Matthew Barnes2009-12-262-80/+154 * Bug 604822 - Drop more alert titlesPaul Bolle2009-12-201-3/+1 * Coding style and whitespace cleanup.Matthew Barnes2009-12-202-3/+2 * Fix some compiler warnings.Matthew Barnes2009-12-201-4/+0 * Bug #602998 - Contacts searches are supposed to be per address bookMilan Crha2009-12-112-0/+74 * Bug #499322 - Use extension for "Save as" suggested file nameMilan Crha2009-12-101-2/+5 * Kill ETableScrolled.Matthew Barnes2009-12-083-96/+55 * Port all error code to use GObject-ified EAlert / EAlertDialogJonathon Jongsma2009-12-087-8/+8 * Rename EError to EAlert to match general use betterJonathon Jongsma2009-12-017-22/+22 * port addressbook/ to use new EError APIJonathon Jongsma2009-12-018-15/+37 * Fixed bug 364618, solve the chinese character issue.Jeff Cai2009-11-301-36/+50 * Fixes a build break.Chenthill Palanisamy2009-11-301-1/+0 * Assemble HTML code in a GString instead of a GtkHTMLStream.Matthew Barnes2009-11-201-162/+248 * Remove some redundancy from EABContactDisplay.Matthew Barnes2009-11-181-274/+195 * Remove markup from translatable strings in ui filesClaude Paroz2009-11-172-22/+44 * Bug 360461 - Do not hardcode invisible_char in ui filesClaude Paroz2009-11-173-46/+0 * Bug 589153 - Use GtkBuilder instead of libgladeMatthew Barnes2009-11-1724-4897/+4587 * Bug 601769 - Print issues in address bookMatthew Barnes2009-11-142-6/+15 * Simplify clipboard handling in addressbook.Matthew Barnes2009-11-121-112/+40 * Kill more redundant save dialogs and related utilities.Matthew Barnes2009-11-112-10/+5 * Convert some "Save As" actions to run asynchronously.Matthew Barnes2009-11-084-220/+20 * Cleanup and rename filter classes.Matthew Barnes2009-10-271-1/+1 * Prefer G_N_ELEMENTS over sizeof calculations.Matthew Barnes2009-10-272-4/+2 * Bug #599131 - Crash on new contact adding with similar values as an oldMilan Crha2009-10-241-1/+4 * Bug #565306 - "Edit Full" in "Add to address book" searches firstMilan Crha2009-10-163-12/+92 * Bug #449520 - Adding a contact to a contact list fails when using a commaMilan Crha2009-10-161-1/+26 * Bug #594471 - Shouldn't call e_error_new/run with NULL 'parent'Milan Crha2009-10-138-28/+15 * Bug #498095 - Fixing mnemonicsMilan Crha2009-10-131-1/+3 * Bug 598027 - Use vCard instead of VCardMatthew Barnes2009-10-112-3/+3 * Build with GTK_DISABLE_DEPRECATED and fix resulting breakage.Matthew Barnes2009-10-021-6/+1 * Bug 596848 - Use per-target CPPFLAGS in automake filesH.Habighorst2009-10-019-39/+46 * Bug #596800 - Hang on contacts mergingMilan Crha2009-09-301-7/+8 * Fix duplicate symbols in Glade files.Matthew Barnes2009-09-251-1/+1 * Work around build break caused by gnome-pilot headers.Matthew Barnes2009-09-251-0/+2 * Bug #593633 - Runtime warnings trying to create a recurrence eventMilan Crha2009-09-242-4/+23 * Goodbye libgnome and libgnomeui!!Matthew Barnes2009-09-191-1/+3 * Finish killing Bonobo.Matthew Barnes2009-09-094-76/+90 * Bug 594284 - FTBFS: missing linksDiego Escalante Urrelo2009-09-061-0/+1 * Simplify EPlugin loading at startup.Matthew Barnes2009-08-302-61/+0 * Fix compiler warnings and deprecated GTK+ API usage.Matthew Barnes2009-08-161-0/+8 * Bug #205137 - Configurable date formats in componentsMilan Crha2009-08-121-1/+10 * Compiler warning fixes (as part of bug #424078)Milan Crha2009-08-111-1/+1 * Merge commit 'EVOLUTION_2_27_5' into kill-bonoboMatthew Barnes2009-07-282-2/+3 |\ | * Bug #589580 - Crashes when dragging an image to the contact editorMilan Crha2009-07-242-3/+4 | * More whitespace cleanup.Matthew Barnes2009-07-1918-141/+141 | * Bug #555326 - Suppress Del key press in Contacts source selectorMarcel Stimberg2009-07-131-1/+1 | * Fix excessive whitespace.Matthew Barnes2009-07-1347-112/+0 * | More whitespace cleanup.Matthew Barnes2009-07-1916-97/+97 * | Bug 579702 – Contact changes not shown until restartMatthew Barnes2009-07-182-4/+4 * | Fix excessive whitespace.Matthew Barnes2009-07-1437-88/+0 * | Add a "quit-requested" signal to the shutdown protocol.Matthew Barnes2009-07-137-243/+326 * | Merge branch 'master' into kill-bonoboMatthew Barnes2009-07-111-71/+135 |\| | * Bug #561300 - Edit contact's Notes on its own tab.Milan Crha2009-07-101-71/+135 | * Kill EConfigListener.Matthew Barnes2009-07-033-17/+0 * | Kill EConfigListener.Matthew Barnes2009-07-032-16/+0 * | Kill the last GtkOptionMenu instances.Matthew Barnes2009-07-031-11/+11 * | Merge branch 'master' into kill-bonoboMatthew Barnes2009-07-013-12/+19 |\| | * Use AM_CPPFLAGS instead of INCLUDE in all Makefile.am.Matthew Barnes2009-07-0110-10/+10 | * Fix "make check" errors.Matthew Barnes2009-06-201-25/+12 | * Remove an obsolete Makefile.am stanza.Matthew Barnes2009-06-191-6/+0 | * Stop abusing forward declarations.Matthew Barnes2009-06-194-16/+11 | * Use G_BEGIN_DECLS / G_END_DECLS macros.Matthew Barnes2009-06-196-42/+12 | * Fix coding style.Matthew Barnes2009-06-141-2/+2 | * Avoid the console popping while evolution running on windowsFridrich Strba2009-06-051-0/+4 | * Fix even more compiler warnings and disable one for format stringsMilan Crha2009-06-051-5/+5 | * libevolution-mail-shared is a new library, so reflect its existenceFridrich Strba2009-06-051-1/+1 | * More code cleanup.Matthew Barnes2009-06-0220-75/+75 | * Whitespace cleanup.Matthew Barnes2009-05-2919-96/+96 | * Prefer GLib basic types over C types.Matthew Barnes2009-05-2958-921/+921 | * Remove trailing whitespace, again.Matthew Barnes2009-05-2977-89/+89 * | Fix "make distcheck" errors and other build cleanups.Matthew Barnes2009-07-019-9/+9 * | Radically reorganize source code.Matthew Barnes2009-06-2538-9919/+12 * | Fix "make distcheck" errors.Matthew Barnes2009-06-202-4/+5 * | Stop abusing forward declarations.Matthew Barnes2009-06-191-7/+7 * | Use G_BEGIN_DECLS / G_END_DECLS macros.Matthew Barnes2009-06-187-49/+14 * | Fix coding style.Matthew Barnes2009-06-141-2/+2 * | Use key files for tracking widget states.Matthew Barnes2009-06-131-1/+7 * | Avoid the console popping while evolution running on windowsFridrich Strba2009-06-091-0/+4 * | Fix even more compiler warnings and disable one for format stringsMilan Crha2009-06-091-4/+5 * | libevolution-mail-shared is a new library, so reflect its existenceFridrich Strba2009-06-091-0/+4 * | Search bar improvements.Matthew Barnes2009-06-091-1/+24 * | More code cleanup.Matthew Barnes2009-06-0214-59/+59 * | Whitespace cleanup.Matthew Barnes2009-05-2920-93/+93 * | Prefer GLib basic types over C types.Matthew Barnes2009-05-2747-727/+727 * | Merge branch 'master' into kill-bonoboMatthew Barnes2009-05-2792-166/+166 |\ \ | * | Remove trailing whitespace, again.Matthew Barnes2009-05-2777-89/+89 | |/ | * Fix compiler warnings in addressbook.Matthew Barnes2009-05-2621-106/+106 | * Eliminate redundant E_ICON_SIZE_* enumeration.Matthew Barnes2009-05-245-21/+21 | * Merge branch 'vcard-inline'Matthew Barnes2009-05-214-350/+0 | |\ | | * Convert the vCard Bonobo control to an EMFormatHook plugin.Matthew Barnes2009-05-064-350/+0 | * | Bug 578176 – "Send message to contact" does not honor "always BCC"Matthew Barnes2009-05-171-3/+5 | * | Fix several types of pedantic compiler warnings.Matthew Barnes2009-05-1712-18/+18 | |/ * | Fix "make check" errors.Matthew Barnes2009-05-251-25/+13 * | Eliminate redundant E_ICON_SIZE_* enumeration.Matthew Barnes2009-05-254-4/+4 * | Fix several types of pedantic compiler warnings.Matthew Barnes2009-05-216-7/+7 * | Use -no-undefined on Linux tooMilan Crha2009-05-2018-25/+1133 * | Add G_MODULE_EXPORT to exported module functions.Matthew Barnes2009-05-111-2/+2 * | Use the proper idiom for loading types in a GTypeModule.Matthew Barnes2009-05-1112-162/+201 * | Fix bugs caused by EShellBackend changes.Matthew Barnes2009-05-101-1/+1 * | Adapt memos to EShellBackend changes.Matthew Barnes2009-05-091-0/+34 * | Adapt calendar to EShellBackend changes.Matthew Barnes2009-05-082-4/+4 * | Adapt mail to EShellBackend changes.Matthew Barnes2009-05-081-1/+1 * | Adapt addressbook to EShellBackend changes.Matthew Barnes2009-05-0712-185/+187 * | Convert EShellModule to EShellBackendMatthew Barnes2009-05-079-136/+239 * | Merge branch 'master' into kill-bonoboMatthew Barnes2009-05-042-2/+3 |\| | * ** BUGFIX: 355240 - String errorsSukhbir Singh2009-05-042-2/+3 | * Bug 572977 – Use g_strerror() instead of strerror()Matthew Barnes2009-05-031-1/+1 | * Use Behdad's brilliant git.mk to generate .gitignore files.Matthew Barnes2009-05-0212-0/+24 | * More gnome-init cleanup for bug #567283.Matthew Barnes2009-05-011-178/+0 | * Bug 580892 – Kill libgnomeui/gnome-app and gnome-app-helperMatthew Barnes2009-05-014-17/+9 | * Bug 580896 – Kill libgnome/gnome-programMatthew Barnes2009-05-01