2
* This file is a part of the Cairo-Dock project
4
* Copyright : (C) see the 'copyright' file.
5
* E-mail : see the 'copyright' file.
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.
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/>.
21
** Login : <ctaf42@gmail.com>
22
** Started on Fri Nov 30 05:31:31 2007 GESTES Cedric
25
** Copyright (C) 2007 GESTES Cedric
26
** This program is free software; you can redistribute it and/or modify
27
** it under the terms of the GNU General Public License as published by
28
** the Free Software Foundation; either version 3 of the License, or
29
** (at your option) any later version.
31
** This program is distributed in the hope that it will be useful,
32
** but WITHOUT ANY WARRANTY; without even the implied warranty of
33
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34
** GNU General Public License for more details.
36
** You should have received a copy of the GNU General Public License
37
** along with this program; if not, write to the Free Software
38
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43
#include "terminal-config.h"
44
#include "terminal-menu-functions.h"
45
#include "terminal-struct.h"
46
#include "terminal-widget.h"
47
#include "terminal-init.h"
50
CD_APPLET_DEFINITION ("terminal",
52
CAIRO_DOCK_CATEGORY_ACCESSORY,
53
N_("Add a terminal to your dock !\n"
54
"Left/middle click to show/hide terminal (you can bind a keyboard shortcut for it.)\n"
55
"You can drag'n'drop files or text and select an action.\n"
56
"You can open many tabs, rename them, change their color (right-click on a tab to interact on it)\n"
57
"To open a new tab : type 'CTRL+t' or double-click next to the last tab\n"
58
"To close a tab : type 'CTRL+w' or middle-click on it."),
59
"Ctaf (Cedric Gestes) & Fabounet (Fabrice Rey)")
64
CD_APPLET_REGISTER_FOR_CLICK_EVENT;
65
CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
66
CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT;
68
if (myDesklet != NULL) // on cree le terminal pour avoir qqch a afficher dans le desklet.
70
terminal_build_and_show_tab ();
71
CD_APPLET_SET_STATIC_DESKLET;
73
if (myDock) // en mode desklet, on n'a pas besoin de l'icone.
75
CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE; // set the default icon if none is specified in conf.
83
CD_APPLET_UNREGISTER_FOR_CLICK_EVENT;
84
CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
85
CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT;
90
CD_APPLET_RELOAD_BEGIN
92
if (CD_APPLET_MY_CONFIG_CHANGED)
96
if (myDesklet != NULL) // on cree le terminal pour avoir qqch a afficher dans le desklet.
97
terminal_build_and_show_tab ();
99
else if (CD_APPLET_MY_CONTAINER_TYPE_CHANGED)
101
if (myDesklet != NULL) // il faut passer du dialogue au desklet.
103
myData.tab = cairo_dock_steal_widget_from_its_container (myData.tab);
104
cairo_dock_dialog_unreference (myData.dialog);
105
myData.dialog = NULL;
106
cairo_dock_add_interactive_widget_to_desklet (myData.tab, myDesklet);
107
cairo_dock_set_desklet_renderer_by_name (myDesklet, NULL, NULL, ! CAIRO_DOCK_LOAD_ICONS_FOR_DESKLET, NULL);
108
CD_APPLET_SET_STATIC_DESKLET;
110
else // il faut passer du desklet au dialogue
112
myData.dialog = cd_terminal_build_dialog ();
113
cairo_dock_hide_dialog (myData.dialog);
119
term_apply_settings();
122
if (myDock) // en mode desklet, on n'a pas besoin de l'icone.
124
CD_APPLET_SET_DEFAULT_IMAGE_ON_MY_ICON_IF_NONE; // set the default icon if none is specified in conf.