~ubuntu-branches/ubuntu/trusty/cairo-dock-plug-ins/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/bzr3051_Logout_Added_support_of_Cinnamon.patch/gnome-integration/src/applet-utils.c

  • Committer: Package Import Robot
  • Author(s): Matthieu Baerts (matttbe)
  • Date: 2014-04-07 00:48:03 UTC
  • mfrom: (48.1.3 cairo-dock-plug-ins)
  • Revision ID: package-import@ubuntu.com-20140407004803-5s5leqg9iplbngje
Tags: 3.3.99.beta1.2.really.3.3.2-0ubuntu1
* Revert back to the 3.3.2 version: (LP: #1302246)
  Unfortunately, due to the lack of time, we have to revert back to the
  latest stable version. Sorry for that but feel free to help us ;-)
* debian/patches: cherry-pick patches from upstream BZR repo, all 'bug-fix'
  and changes that were already in the 3.3.99.beta1 version except all
  changes linked to the new style, the menu and the configuration.
  - bzr3008_GMenu_new_apps_in_the_list.patch: GMenu: New Apps: if there are
    new apps when the 'new apps' dialogue is opened, add these new apps in
    the list
  - bzr3010_GMenu_option_hide_new_apps_dialogue.patch: GMenu: Config: Added
    the possibility to not display notification to quickly launch new apps
  - bzr3021_Terminal_launch_default_terminal_middle_click.patch: Terminal:
    middle click: launch the default terminal
  - bzr3031-3032_GMenu_remove_empty_submenus.patch: GMenu: do not add empty
    submenus when creating them and remove empty submenus
  - bzr3035_DND2Share_History_was_empty.patch: DnD2Share: history menu was
    empty
  - bzr3036-3040_Shortcuts_removed_disk_usage_on_bookmarks_and_support_
    x-nautilus_URI.patch: Shortcuts: correctly removed an old bookmark ;
    added support for x-nautilus-(...) URI ; avoid duplicated code +
    bookmarks doesn't have a disk usage ; translated a few sentences from
    French to English
  - bzr3043_Fixed_typo_with_some_sentences.patch: Fixed typo with some
    sentences which were not correctly translated
  - bzr3045-3046_GVFS_support_x-nautilus-desktop_and_fixed_typos_and_memory_
    leaks.patch: gvfs: fixed typo and tiny memory leak ; GTK3: 'x-nautilus-
    desktop' is just an URI where the root is the path to the desktop
  - bzr3047-3048_Status-Notifier_Added_support_of_middle_click_and_scroll:
    Status-Notifier: IAS (ubuntu): added the support of the middle click ;
    Scroll signals were not catched
  - bzr3051_Logout_Added_support_of_Cinnamon.patch: logout: added support of
    Cinnamon
  - bzr3057_GMenu_new_apps_show_dialog_after_installation.patch: GMenu: new
    apps: show the dialog only after the end of the installation
  - bzr3065_Impulse_do_not_redraw_icon_when_not_needed.patch: Impulse: stop
    animations: do not redraw the icon if it's not needed (e.g. when
    disabling the applet)
  - bzr3067_AlsaMixer_support_cinnamon_settings.patch: AlsaMixer: added the
    support of cinnamon-settings
  - bzr3068_Clock_fixed_a_crash_when_configuring_when_not_enabled.patch:
    Clock: fixed a crash when configuring the applet if it's not activated
  - bzr3069_Indicator_Generic_no_need_to_hide_the_icon_before_removing_it:
    Indicator Generic: stop: no need to hide the icon before removing it
* debian/control: bumped Core versions

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
* This file is a part of the Cairo-Dock project
 
3
*
 
4
* Copyright : (C) see the 'copyright' file.
 
5
* E-mail    : see the 'copyright' file.
 
6
*
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation; either version 3
 
10
* of the License, or (at your option) any later version.
 
11
*
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
* You should have received a copy of the GNU General Public License
 
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
*/
 
19
 
 
20
#include <stdlib.h>
 
21
#include <cairo-dock.h>
 
22
 
 
23
#include "applet-utils.h"
 
24
 
 
25
 
 
26
void env_backend_logout (void)
 
27
{
 
28
        // since Gnome 3, gnome-session-save has been replaced by gnome-session-quit
 
29
        gchar *cResult = cairo_dock_launch_command_sync ("which gnome-session-quit");
 
30
        if (cResult != NULL && *cResult == '/')
 
31
                cairo_dock_launch_command ("gnome-session-quit --logout");
 
32
        else
 
33
                cairo_dock_launch_command ("gnome-session-save --kill --gui");
 
34
        g_free (cResult);
 
35
}
 
36
 
 
37
void env_backend_shutdown (void)
 
38
{
 
39
        // since Gnome 3, gnome-session-save has been replaced by gnome-session-quit
 
40
        gchar *cResult = cairo_dock_launch_command_sync ("which gnome-session-quit");
 
41
        if (cResult != NULL && *cResult == '/')
 
42
                cairo_dock_launch_command ("gnome-session-quit --power-off");
 
43
        else
 
44
                cairo_dock_launch_command ("gnome-session-save --shutdown-dialog");
 
45
        g_free (cResult);
 
46
}
 
47
 
 
48
void env_backend_lock_screen (void)
 
49
{
 
50
        cairo_dock_launch_command (MY_APPLET_SHARE_DATA_DIR"/../shared-files/scripts/lock-screen.sh");
 
51
}
 
52
 
 
53
void env_backend_setup_time (void)
 
54
{
 
55
        static gboolean bChecked = FALSE;
 
56
        static const gchar *cCmd = NULL;
 
57
        if (!bChecked)
 
58
        {
 
59
                bChecked = TRUE;
 
60
                gchar *cResult = cairo_dock_launch_command_sync ("which gnome-control-center");  // Gnome3
 
61
                if (cResult != NULL && *cResult == '/')
 
62
                {
 
63
                        cCmd = "gnome-control-center datetime";
 
64
                }
 
65
                else
 
66
                {
 
67
                        g_free (cResult);
 
68
                        cResult = cairo_dock_launch_command_sync ("which time-admin");  // Gnome2
 
69
                        if (cResult != NULL && *cResult == '/')
 
70
                                cCmd = "time-admin";  // it uses PolicyKit => no gksudo.
 
71
                }
 
72
                g_free (cResult);
 
73
        }
 
74
        if (cCmd)
 
75
                cairo_dock_launch_command (cCmd);
 
76
        else
 
77
                cd_warning ("couldn't guess what program to use to setup the time and date.");
 
78
}
 
79
 
 
80
void env_backend_show_system_monitor (void)
 
81
{
 
82
        cairo_dock_launch_command ("gnome-system-monitor");
 
83
}