2
This file is part of darktable,
3
copyright (c) 2011 tobias ellinghaus.
5
darktable is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
10
darktable is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with darktable. If not, see <http://www.gnu.org/licenses/>.
19
#include "common/darktable.h"
20
#include "common/debug.h"
21
#include "control/control.h"
22
#include "control/conf.h"
30
typedef struct dt_lib_file_manager_t
33
VteTerminal *terminal;
35
dt_lib_file_manager_t;
39
// FIXME: Hack to get a translated name without the need to touch the .po files
40
// char* n = _("zoomable light table\nfile manager");
41
// while(*n != '\n') n++; n++;
43
return _("file manager");
48
return DT_LIGHTTABLE_VIEW|DT_CAPTURE_VIEW;
51
void gui_reset(dt_lib_module_t *self)
53
dt_lib_file_manager_t *d = (dt_lib_file_manager_t*) self->data;
56
d->pid = vte_terminal_fork_command(d->terminal, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE);
58
char* argv[2] = {g_strdup(g_getenv("SHELL")), NULL};
59
vte_terminal_fork_command_full(d->terminal, VTE_PTY_DEFAULT, NULL, argv, NULL, 0, NULL, NULL, &d->pid, NULL);
62
vte_terminal_reset(d->terminal, TRUE, TRUE);
70
void gui_init(dt_lib_module_t *self)
72
dt_lib_file_manager_t *d = (dt_lib_file_manager_t *)g_malloc(sizeof(dt_lib_file_manager_t));
73
self->data = (void *)d;
75
d->terminal = VTE_TERMINAL(vte_terminal_new());
76
self->widget = GTK_WIDGET(d->terminal);
77
dt_gui_key_accel_block_on_focus(GTK_WIDGET(d->terminal));
78
#if defined(__MACH__) || defined(__APPLE__)
79
vte_terminal_set_font_from_string(d->terminal, "Monospace 11");
81
vte_terminal_set_font_from_string(d->terminal, "Monospace 8");
84
d->pid = vte_terminal_fork_command(d->terminal, NULL, NULL, NULL, NULL, FALSE, FALSE, FALSE);
86
char* argv[2] = {g_strdup(g_getenv("SHELL")), NULL};
87
vte_terminal_fork_command_full(d->terminal, VTE_PTY_DEFAULT, NULL, argv, NULL, 0, NULL, NULL, &d->pid, NULL);
90
g_object_set(G_OBJECT(d->terminal), "tooltip-text", _("\
91
ls\t\t\t\t\tlist content of directory\n\
92
cd <dir>\t\t\tchange directory\n\
93
mkdir <dir>\t\t\tcreate directory\n\
94
mv <src> <dst>\tmove <src> to <dst>\n\
95
cp <src> <dst>\t\tcopy <src> to <dst>\n\
96
rm <file>\t\t\tdelete <file>\n\
97
rmdir <dir>\t\t\tdelete empty directory"), (char *)NULL);
101
void gui_cleanup(dt_lib_module_t *self)
103
darktable.gui->redraw_widgets = g_list_remove(darktable.gui->redraw_widgets, self->widget);
104
dt_lib_file_manager_t *d = (dt_lib_file_manager_t*) self->data;
105
kill(d->pid, SIGKILL);
110
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-space on;