~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

Viewing changes to terminal/src/terminal-menu-functions.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-08-26 21:07:39 UTC
  • Revision ID: james.westby@ubuntu.com-20090826210739-gyjuuqezrzuluao4
Tags: upstream-2.0.8.1
ImportĀ upstreamĀ versionĀ 2.0.8.1

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
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */
 
21
/*
 
22
** Login : <ctaf42@gmail.com>
 
23
** Started on  Fri Nov 30 05:31:31 2007 GESTES Cedric
 
24
** $Id$
 
25
**
 
26
** Author(s):
 
27
**  - Cedric GESTES <ctaf42@gmail.com>
 
28
**
 
29
** Copyright (C) 2007 GESTES Cedric
 
30
** This program is free software; you can redistribute it and/or modify
 
31
** it under the terms of the GNU General Public License as published by
 
32
** the Free Software Foundation; either version 3 of the License, or
 
33
** (at your option) any later version.
 
34
**
 
35
** This program is distributed in the hope that it will be useful,
 
36
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
37
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
38
** GNU General Public License for more details.
 
39
**
 
40
** You should have received a copy of the GNU General Public License
 
41
** along with this program; if not, write to the Free Software
 
42
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
43
*/
 
44
 
 
45
#include <stdlib.h>
 
46
#include <string.h>
 
47
#include <signal.h>
 
48
 
 
49
#include <vte/vte.h>
 
50
 
 
51
#include "terminal-init.h"
 
52
#include "terminal-callbacks.h"
 
53
#include "terminal-struct.h"
 
54
#include "terminal-widget.h"
 
55
#include "terminal-menu-functions.h"
 
56
 
 
57
 
 
58
 
 
59
 
 
60
CD_APPLET_ON_CLICK_BEGIN
 
61
{
 
62
        if (! myData.tab)
 
63
                terminal_build_and_show_tab ();
 
64
        else if (myDesklet)
 
65
                cairo_dock_show_desklet (myDesklet);
 
66
        else if (myData.dialog)
 
67
                cairo_dock_unhide_dialog(myData.dialog);
 
68
}
 
69
CD_APPLET_ON_CLICK_END
 
70
 
 
71
 
 
72
CD_APPLET_ON_MIDDLE_CLICK_BEGIN
 
73
{
 
74
        if (myData.tab)
 
75
        {
 
76
          if (myData.dialog)
 
77
            cairo_dock_hide_dialog (myData.dialog);
 
78
        }
 
79
}
 
80
CD_APPLET_ON_MIDDLE_CLICK_END
 
81
 
 
82
 
 
83
 
 
84
static void on_new_tab(GtkMenuItem *menu_item, gpointer *data)
 
85
{
 
86
        terminal_new_tab();
 
87
}
 
88
static void on_rename_tab(GtkMenuItem *menu_item, gpointer *data)
 
89
{
 
90
        terminal_rename_tab (NULL);
 
91
}
 
92
static void on_close_tab(GtkMenuItem *menu_item, gpointer *data)
 
93
{
 
94
        terminal_close_tab (NULL);
 
95
}
 
96
CD_APPLET_ON_BUILD_MENU_BEGIN
 
97
{
 
98
        GtkWidget *pSubMenu = CD_APPLET_CREATE_MY_SUB_MENU ();
 
99
        CD_APPLET_ADD_IN_MENU(D_("New Tab"), on_new_tab, pSubMenu);
 
100
        CD_APPLET_ADD_IN_MENU(D_("Rename current Tab"), on_rename_tab, pSubMenu);
 
101
        CD_APPLET_ADD_IN_MENU(D_("Close current Tab"), on_close_tab, pSubMenu);
 
102
        CD_APPLET_ADD_SEPARATOR(pSubMenu);
 
103
        CD_APPLET_ADD_ABOUT_IN_MENU (pSubMenu);
 
104
}
 
105
CD_APPLET_ON_BUILD_MENU_END