Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cd94beb376 | ||
|
350e3ffc29 | ||
|
52ee1591f7 | ||
|
db60af5efb | ||
|
dde92eecbf | ||
|
7bdc217e8c | ||
|
2520d1c087 | ||
|
116bfc2ac1 | ||
|
1820d0db69 | ||
|
17062aaa18 | ||
|
aa7dabad39 | ||
|
15ec9b4e65 | ||
|
612f36cea9 | ||
|
e7328ad12e | ||
|
172f323b4b | ||
|
4044529191 | ||
|
992ca7a3ec | ||
|
67892da099 | ||
|
2ebff67c9c | ||
|
43ee0436d8 | ||
|
fb0002bdcd | ||
|
2e3f337e84 | ||
|
d208cae3bc | ||
|
05b68fb5f5 | ||
|
42da8bc289 |
48
debian/changelog
vendored
48
debian/changelog
vendored
@@ -1,3 +1,51 @@
|
||||
xed (2.2.0) tina; urgency=medium
|
||||
|
||||
[ Eli Schwartz ]
|
||||
* meson: require itstool command to be available (#266)
|
||||
|
||||
[ JosephMcc ]
|
||||
* statusbar: Fix the menu button styling (#281)
|
||||
* cleanup: Remove an unused Makefile.am (#280)
|
||||
|
||||
[ Stephen Collins ]
|
||||
* print preview: fix layout drawing for 1X2 and 2X1 layouts (#291)
|
||||
* Filebrowser: Kill the click policy property with fire (#293)
|
||||
|
||||
[ JosephMcc ]
|
||||
* xed-window: Fix the tabs/spaces label in the statusbar (#283)
|
||||
* xed-notebook: Always show the main notebook tabs (#285)
|
||||
|
||||
[ Stephen Collins ]
|
||||
* Fix some deprecation warnings (#289)
|
||||
* print preview: fix logic for forward button sensitivity (#292)
|
||||
* Add toggle comment and toggle comment block actions w/ keybindings (#290)
|
||||
|
||||
[ Clement Lefebvre ]
|
||||
* l10n: Update POT
|
||||
|
||||
[ Stephen Collins ]
|
||||
* print job: replace some deprecated font button functions (#294)
|
||||
* Replace deprecated gdk_cursor_new with gdk_cursor_new_for_display (#295)
|
||||
* Print preview: remove a couple calls to gtk_adjustment_value_changed (#296)
|
||||
* Search: replace a few functions that were deprecated in Gtk 3.22 (#297)
|
||||
* Fix stuttering and disappearing of the toolbar when fullscreen (#300)
|
||||
* Switch deprecated gtk_icon_info_free to g_object_unref (#301)
|
||||
* Remove references to deprecated GTK_STOCK_* (#298)
|
||||
* Remove deprecated call to gtk_widget_override_background_color (#299)
|
||||
* Tab width popup: only select a menu item when the menu is open (#311)
|
||||
* Simplify an if statement. The logic is identical, but easier to read (#314)
|
||||
|
||||
[ Leigh Scott ]
|
||||
* Add minimum required version for xapp (#313)
|
||||
|
||||
[ Stephen Collins ]
|
||||
* Prevent a warning when closing the window while print preview is open (#315)
|
||||
|
||||
[ Clement Lefebvre ]
|
||||
* l10n: Update POT
|
||||
|
||||
-- Clement Lefebvre <root@linuxmint.com> Sat, 29 Jun 2019 17:23:48 +0200
|
||||
|
||||
xed (2.0.2) tessa; urgency=medium
|
||||
|
||||
[ Clement Lefebvre ]
|
||||
|
@@ -458,8 +458,6 @@ xed_help_display
|
||||
GBOOLEAN_TO_POINTER
|
||||
GPOINTER_TO_BOOLEAN
|
||||
IS_VALID_BOOLEAN
|
||||
xed_utils_menu_position_under_widget
|
||||
xed_utils_menu_position_under_tree_view
|
||||
xed_gtk_button_new_with_stock_icon
|
||||
xed_dialog_add_button
|
||||
xed_utils_escape_underscores
|
||||
@@ -474,8 +472,6 @@ xed_warning
|
||||
xed_utils_make_valid_utf8
|
||||
xed_utils_uri_get_dirname
|
||||
xed_utils_replace_home_dir_with_tilde
|
||||
xed_utils_get_current_workspace
|
||||
xed_utils_get_window_workspace
|
||||
xed_utils_activate_url
|
||||
xed_utils_is_valid_uri
|
||||
xed_utils_get_glade_widgets
|
||||
|
@@ -1,4 +1,4 @@
|
||||
project('xed', 'c', version : '2.0.2')
|
||||
project('xed', 'c', version : '2.2.0')
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
@@ -33,7 +33,7 @@ libpeas = dependency('libpeas-1.0', version: '>= 1.12.0')
|
||||
libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.12.0')
|
||||
gir_dep = dependency('gobject-introspection-1.0', version: '>= 0.6.7', required: false)
|
||||
gmodule = dependency('gmodule-2.0')
|
||||
xapp = dependency('xapp')
|
||||
xapp = dependency('xapp', version: '>= 1.4.0')
|
||||
X11 = dependency('x11')
|
||||
pango = dependency('pango')
|
||||
|
||||
@@ -55,6 +55,7 @@ cc = meson.get_compiler('c')
|
||||
math = cc.find_library('m', required: false)
|
||||
|
||||
intltool_merge = find_program('intltool-merge')
|
||||
itstool = find_program('itstool')
|
||||
|
||||
# generate config.h
|
||||
config_h_file = configure_file(
|
||||
|
@@ -91,7 +91,7 @@ xed_file_browser_utils_pixbuf_from_icon (GIcon *icon,
|
||||
}
|
||||
|
||||
ret = gtk_icon_info_load_icon (info, NULL);
|
||||
gtk_icon_info_free (info);
|
||||
g_object_unref (info);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@@ -44,8 +44,6 @@ struct _XedFileBrowserViewPrivate
|
||||
GtkTreeModel *model;
|
||||
GtkTreeRowReference *editable;
|
||||
|
||||
/* CLick policy */
|
||||
XedFileBrowserViewClickPolicy click_policy;
|
||||
GtkTreePath *double_click_path[2]; /* Both clicks in a double click need to be on the same row */
|
||||
GtkTreePath *hover_path;
|
||||
GdkCursor *hand_cursor;
|
||||
@@ -64,7 +62,6 @@ enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_CLICK_POLICY,
|
||||
PROP_RESTORE_EXPAND_STATE
|
||||
};
|
||||
|
||||
@@ -227,139 +224,6 @@ row_collapsed (GtkTreeView *tree_view,
|
||||
_xed_file_browser_store_iter_collapsed (XED_FILE_BROWSER_STORE (view->priv->model), iter);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
leave_notify_event (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE &&
|
||||
view->priv->hover_path != NULL)
|
||||
{
|
||||
gtk_tree_path_free (view->priv->hover_path);
|
||||
view->priv->hover_path = NULL;
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->leave_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
enter_notify_event (GtkWidget *widget,
|
||||
GdkEventCrossing *event)
|
||||
{
|
||||
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
{
|
||||
if (view->priv->hover_path != NULL)
|
||||
{
|
||||
gtk_tree_path_free (view->priv->hover_path);
|
||||
}
|
||||
|
||||
gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
|
||||
event->x, event->y,
|
||||
&view->priv->hover_path,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if (view->priv->hover_path != NULL)
|
||||
{
|
||||
gdk_window_set_cursor (gtk_widget_get_window (widget), view->priv->hand_cursor);
|
||||
}
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->enter_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
motion_notify_event (GtkWidget *widget,
|
||||
GdkEventMotion *event)
|
||||
{
|
||||
GtkTreePath *old_hover_path;
|
||||
XedFileBrowserView *view = XED_FILE_BROWSER_VIEW (widget);
|
||||
|
||||
if (view->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
{
|
||||
old_hover_path = view->priv->hover_path;
|
||||
gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget),
|
||||
event->x, event->y,
|
||||
&view->priv->hover_path,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
if ((old_hover_path != NULL) != (view->priv->hover_path != NULL))
|
||||
{
|
||||
if (view->priv->hover_path != NULL)
|
||||
{
|
||||
gdk_window_set_cursor (gtk_widget_get_window (widget), view->priv->hand_cursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (old_hover_path != NULL)
|
||||
{
|
||||
gtk_tree_path_free (old_hover_path);
|
||||
}
|
||||
}
|
||||
|
||||
// Chainup
|
||||
return GTK_WIDGET_CLASS (xed_file_browser_view_parent_class)->motion_notify_event (widget, event);
|
||||
}
|
||||
|
||||
static void
|
||||
set_click_policy_property (XedFileBrowserView *obj,
|
||||
XedFileBrowserViewClickPolicy click_policy)
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
GdkDisplay *display;
|
||||
GdkWindow *win;
|
||||
|
||||
obj->priv->click_policy = click_policy;
|
||||
|
||||
if (click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
{
|
||||
if (obj->priv->hand_cursor == NULL)
|
||||
{
|
||||
obj->priv->hand_cursor = gdk_cursor_new(GDK_HAND2);
|
||||
}
|
||||
}
|
||||
else if (click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE)
|
||||
{
|
||||
if (obj->priv->hover_path != NULL)
|
||||
{
|
||||
if (gtk_tree_model_get_iter (GTK_TREE_MODEL (obj->priv->model), &iter, obj->priv->hover_path))
|
||||
{
|
||||
gtk_tree_model_row_changed (GTK_TREE_MODEL (obj->priv->model), obj->priv->hover_path, &iter);
|
||||
}
|
||||
|
||||
gtk_tree_path_free (obj->priv->hover_path);
|
||||
obj->priv->hover_path = NULL;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (obj)))
|
||||
{
|
||||
win = gtk_widget_get_window (GTK_WIDGET (obj));
|
||||
gdk_window_set_cursor (win, NULL);
|
||||
|
||||
display = gtk_widget_get_display (GTK_WIDGET (obj));
|
||||
|
||||
if (display != NULL)
|
||||
{
|
||||
gdk_display_flush (display);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj->priv->hand_cursor)
|
||||
{
|
||||
g_object_unref (obj->priv->hand_cursor);
|
||||
obj->priv->hand_cursor = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
directory_activated (XedFileBrowserView *view,
|
||||
GtkTreeIter *iter)
|
||||
@@ -503,14 +367,7 @@ did_not_drag (XedFileBrowserView *view,
|
||||
|
||||
if (gtk_tree_view_get_path_at_pos (tree_view, event->x, event->y, &path, NULL, NULL, NULL))
|
||||
{
|
||||
if ((view->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
&& !button_event_modifies_selection(event)
|
||||
&& (event->button == 1 || event->button == 2))
|
||||
{
|
||||
/* Activate all selected items, and leave them selected */
|
||||
activate_selected_items (view);
|
||||
}
|
||||
else if ((event->button == 1 || event->button == 2)
|
||||
if ((event->button == 1 || event->button == 2)
|
||||
&& ((event->state & GDK_CONTROL_MASK) != 0 ||
|
||||
(event->state & GDK_SHIFT_MASK) == 0)
|
||||
&& view->priv->selected_on_button_down)
|
||||
@@ -589,12 +446,6 @@ button_press_event (GtkWidget *widget,
|
||||
|
||||
last_click_time = event->time;
|
||||
|
||||
/* Ignore double click if we are in single click mode */
|
||||
if (view->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE && click_count >= 2)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
view->priv->ignore_release = FALSE;
|
||||
call_parent = TRUE;
|
||||
|
||||
@@ -654,7 +505,7 @@ button_press_event (GtkWidget *widget,
|
||||
if (selected)
|
||||
{
|
||||
call_parent = on_expander || gtk_tree_selection_count_selected_rows (selection) == 1;
|
||||
view->priv->ignore_release = call_parent && view->priv->click_policy != XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE;
|
||||
view->priv->ignore_release = call_parent;
|
||||
}
|
||||
else if ((event->state & GDK_CONTROL_MASK) != 0)
|
||||
{
|
||||
@@ -881,9 +732,6 @@ get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_CLICK_POLICY:
|
||||
g_value_set_enum (value, obj->priv->click_policy);
|
||||
break;
|
||||
case PROP_RESTORE_EXPAND_STATE:
|
||||
g_value_set_boolean (value, obj->priv->restore_expand_state);
|
||||
break;
|
||||
@@ -903,9 +751,6 @@ set_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_CLICK_POLICY:
|
||||
set_click_policy_property (obj, g_value_get_enum (value));
|
||||
break;
|
||||
case PROP_RESTORE_EXPAND_STATE:
|
||||
set_restore_expand_state (obj, g_value_get_boolean (value));
|
||||
break;
|
||||
@@ -927,9 +772,6 @@ xed_file_browser_view_class_init (XedFileBrowserViewClass *klass)
|
||||
object_class->set_property = set_property;
|
||||
|
||||
/* Event handlers */
|
||||
widget_class->motion_notify_event = motion_notify_event;
|
||||
widget_class->enter_notify_event = enter_notify_event;
|
||||
widget_class->leave_notify_event = leave_notify_event;
|
||||
widget_class->button_press_event = button_press_event;
|
||||
widget_class->button_release_event = button_release_event;
|
||||
widget_class->drag_begin = drag_begin;
|
||||
@@ -943,14 +785,6 @@ xed_file_browser_view_class_init (XedFileBrowserViewClass *klass)
|
||||
/* Default handlers */
|
||||
klass->directory_activated = directory_activated;
|
||||
|
||||
g_object_class_install_property (object_class, PROP_CLICK_POLICY,
|
||||
g_param_spec_enum ("click-policy",
|
||||
"Click Policy",
|
||||
"The click policy",
|
||||
XED_FILE_BROWSER_TYPE_VIEW_CLICK_POLICY,
|
||||
XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
|
||||
|
||||
g_object_class_install_property (object_class, PROP_RESTORE_EXPAND_STATE,
|
||||
g_param_spec_boolean ("restore-expand-state",
|
||||
"Restore Expand State",
|
||||
@@ -1013,14 +847,6 @@ cell_data_cb (GtkTreeViewColumn *tree_column,
|
||||
|
||||
path = gtk_tree_model_get_path (tree_model, iter);
|
||||
|
||||
if (obj->priv->click_policy == XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
|
||||
{
|
||||
if (obj->priv->hover_path != NULL && gtk_tree_path_compare (path, obj->priv->hover_path) == 0)
|
||||
{
|
||||
underline = PANGO_UNDERLINE_SINGLE;
|
||||
}
|
||||
}
|
||||
|
||||
if (XED_IS_FILE_BROWSER_STORE (tree_model))
|
||||
{
|
||||
if (obj->priv->editable != NULL && gtk_tree_row_reference_valid (obj->priv->editable))
|
||||
@@ -1200,17 +1026,6 @@ xed_file_browser_view_start_rename (XedFileBrowserView *tree_view,
|
||||
FALSE, 0.0, 0.0);
|
||||
}
|
||||
|
||||
void
|
||||
xed_file_browser_view_set_click_policy (XedFileBrowserView *tree_view,
|
||||
XedFileBrowserViewClickPolicy policy)
|
||||
{
|
||||
g_return_if_fail (XED_IS_FILE_BROWSER_VIEW (tree_view));
|
||||
|
||||
set_click_policy_property (tree_view, policy);
|
||||
|
||||
g_object_notify (G_OBJECT (tree_view), "click-policy");
|
||||
}
|
||||
|
||||
void
|
||||
xed_file_browser_view_set_restore_expand_state (XedFileBrowserView *tree_view,
|
||||
gboolean restore_expand_state)
|
||||
|
@@ -37,12 +37,6 @@ typedef struct _XedFileBrowserView XedFileBrowserView;
|
||||
typedef struct _XedFileBrowserViewClass XedFileBrowserViewClass;
|
||||
typedef struct _XedFileBrowserViewPrivate XedFileBrowserViewPrivate;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
XED_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE,
|
||||
XED_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE
|
||||
} XedFileBrowserViewClickPolicy;
|
||||
|
||||
struct _XedFileBrowserView
|
||||
{
|
||||
GtkTreeView parent;
|
||||
@@ -74,8 +68,6 @@ void xed_file_browser_view_set_model (XedFileBrowserView *tree_view,
|
||||
GtkTreeModel *model);
|
||||
void xed_file_browser_view_start_rename (XedFileBrowserView *tree_view,
|
||||
GtkTreeIter *iter);
|
||||
void xed_file_browser_view_set_click_policy (XedFileBrowserView *tree_view,
|
||||
XedFileBrowserViewClickPolicy policy);
|
||||
void xed_file_browser_view_set_restore_expand_state (XedFileBrowserView *tree_view,
|
||||
gboolean restore_expand_state);
|
||||
|
||||
|
@@ -708,7 +708,7 @@ fill_combo_model (XedFileBrowserWidget *obj)
|
||||
GtkTreeIter iter;
|
||||
GdkPixbuf *icon;
|
||||
|
||||
icon = xed_file_browser_utils_pixbuf_from_theme (GTK_STOCK_HOME, GTK_ICON_SIZE_MENU);
|
||||
icon = xed_file_browser_utils_pixbuf_from_theme ("go-home", GTK_ICON_SIZE_MENU);
|
||||
|
||||
gtk_tree_store_append (store, &iter, NULL);
|
||||
gtk_tree_store_set (store, &iter,
|
||||
@@ -801,7 +801,7 @@ static const GtkActionEntry tree_actions_sensitive[] =
|
||||
|
||||
static const GtkToggleActionEntry tree_actions_toggle[] =
|
||||
{
|
||||
{"FilterHidden", GTK_STOCK_DIALOG_AUTHENTICATION, N_("Show _Hidden"), NULL,
|
||||
{"FilterHidden", NULL, N_("Show _Hidden"), NULL,
|
||||
N_("Show hidden files and folders"), G_CALLBACK (on_action_filter_hidden), FALSE},
|
||||
{"FilterBinary", NULL, N_("Show _Binary"), NULL,
|
||||
N_("Show binary files"), G_CALLBACK (on_action_filter_binary), FALSE}
|
||||
@@ -1183,7 +1183,7 @@ xed_file_browser_widget_init (XedFileBrowserWidget *obj)
|
||||
gtk_box_set_spacing (GTK_BOX (obj), 3);
|
||||
gtk_orientable_set_orientation (GTK_ORIENTABLE (obj), GTK_ORIENTATION_VERTICAL);
|
||||
|
||||
obj->priv->busy_cursor = gdk_cursor_new (GDK_WATCH);
|
||||
obj->priv->busy_cursor = gdk_cursor_new_for_display (gdk_display_get_default(), GDK_WATCH);
|
||||
}
|
||||
|
||||
/* Private */
|
||||
@@ -1247,6 +1247,7 @@ popup_menu (XedFileBrowserWidget *obj,
|
||||
GtkTreeModel *model)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkTreeView *tree;
|
||||
|
||||
if (XED_IS_FILE_BROWSER_STORE (model))
|
||||
{
|
||||
@@ -1263,16 +1264,18 @@ popup_menu (XedFileBrowserWidget *obj,
|
||||
|
||||
g_return_val_if_fail (menu != NULL, FALSE);
|
||||
|
||||
tree = GTK_TREE_VIEW (obj->priv->treeview);
|
||||
|
||||
if (event != NULL)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
|
||||
if (gtk_tree_selection_count_selected_rows (selection) <= 1)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
|
||||
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (obj->priv->treeview),
|
||||
if (gtk_tree_view_get_path_at_pos (tree,
|
||||
(gint)event->x, (gint)event->y,
|
||||
&path, NULL, NULL, NULL))
|
||||
{
|
||||
@@ -1282,14 +1285,38 @@ popup_menu (XedFileBrowserWidget *obj,
|
||||
}
|
||||
}
|
||||
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
xed_utils_menu_position_under_tree_view,
|
||||
obj->priv->treeview, 0,
|
||||
gtk_get_current_event_time ());
|
||||
GtkTreeModel *model;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
model = gtk_tree_view_get_model (tree);
|
||||
g_return_val_if_fail (model != NULL, FALSE);
|
||||
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
g_return_val_if_fail (selection != NULL, FALSE);
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GdkRectangle rect;
|
||||
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
gtk_tree_view_get_cell_area (tree, path, gtk_tree_view_get_column (tree, 0), &rect);
|
||||
gtk_menu_popup_at_rect (GTK_MENU (menu), gtk_widget_get_window (GTK_WIDGET (tree)),
|
||||
&rect, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup_at_widget (GTK_MENU (menu), GTK_WIDGET (obj->priv->treeview),
|
||||
GDK_GRAVITY_SOUTH, GDK_GRAVITY_NORTH, NULL);
|
||||
}
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
|
||||
}
|
||||
|
||||
@@ -1961,11 +1988,7 @@ set_busy (XedFileBrowserWidget *obj,
|
||||
|
||||
if (busy)
|
||||
{
|
||||
GdkCursor *cursor;
|
||||
|
||||
cursor = gdk_cursor_new (GDK_WATCH);
|
||||
gdk_window_set_cursor (window, cursor);
|
||||
g_object_unref (obj->priv->busy_cursor);
|
||||
gdk_window_set_cursor (window, obj->priv->busy_cursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2329,7 +2352,8 @@ directory_open (XedFileBrowserWidget *obj,
|
||||
|
||||
uri = g_file_get_uri (location);
|
||||
|
||||
if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (obj)), uri, GDK_CURRENT_TIME, &error))
|
||||
if (!gtk_show_uri_on_window (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (obj))),
|
||||
uri, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
g_signal_emit (obj, signals[ERROR], 0, XED_FILE_BROWSER_ERROR_OPEN_DIRECTORY, error->message);
|
||||
|
||||
|
@@ -712,7 +712,6 @@ xed_taglist_plugin_panel_init (XedTaglistPluginPanel *panel)
|
||||
panel->priv->tag_groups_combo,
|
||||
ATK_RELATION_CONTROLLED_BY);
|
||||
|
||||
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (panel->priv->tags_list), FALSE);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (panel->priv->tags_list), FALSE);
|
||||
|
||||
g_object_set (panel->priv->tags_list, "has-tooltip", TRUE, NULL);
|
||||
|
253
po/xed.pot
253
po/xed.pot
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2018-12-05 15:16+0000\n"
|
||||
"POT-Creation-Date: 2019-06-23 14:24+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -509,12 +509,12 @@ msgstr ""
|
||||
msgid "[FILE...] [+LINE]"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-app.c:616
|
||||
#: ../xed/xed-app.c:529
|
||||
#, c-format
|
||||
msgid "%s: invalid encoding."
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-app.c:1266
|
||||
#: ../xed/xed-app.c:1180
|
||||
msgid "There was an error displaying the help."
|
||||
msgstr ""
|
||||
|
||||
@@ -667,7 +667,7 @@ msgstr ""
|
||||
msgid "Do you want to try to replace it with the one you are saving?"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-commands-file.c:503 ../xed/xed-ui.h:118
|
||||
#: ../xed/xed-commands-file.c:503 ../xed/xed-ui.h:122
|
||||
msgid "_Replace"
|
||||
msgstr ""
|
||||
|
||||
@@ -764,12 +764,12 @@ msgid "Unsaved Document %d"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-documents-panel.c:93 ../xed/xed-documents-panel.c:104
|
||||
#: ../xed/xed-window.c:1731 ../xed/xed-window.c:1735
|
||||
#: ../xed/xed-window.c:1752 ../xed/xed-window.c:1756
|
||||
msgid "Read-Only"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-documents-panel.c:730 ../xed/resources/ui/xed-shortcuts.ui.h:1
|
||||
#: ../xed/xed-window.c:2956
|
||||
#: ../xed/xed-documents-panel.c:717 ../xed/resources/ui/xed-shortcuts.ui.h:1
|
||||
#: ../xed/xed-window.c:2982
|
||||
msgid "Documents"
|
||||
msgstr ""
|
||||
|
||||
@@ -835,7 +835,7 @@ msgstr ""
|
||||
msgid "Windows"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-highlight-mode-selector.c:269 ../xed/xed-window.c:1849
|
||||
#: ../xed/xed-highlight-mode-selector.c:291 ../xed/xed-window.c:1868
|
||||
msgid "Plain Text"
|
||||
msgstr ""
|
||||
|
||||
@@ -1214,71 +1214,71 @@ msgstr ""
|
||||
msgid "Preparing..."
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:567
|
||||
#: ../xed/xed-print-preview.c:571
|
||||
msgid "Show the previous page"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:573
|
||||
#: ../xed/xed-print-preview.c:577
|
||||
msgid "Show the next page"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:587
|
||||
#: ../xed/xed-print-preview.c:591
|
||||
msgid "Current page (Alt+P)"
|
||||
msgstr ""
|
||||
|
||||
#. gtk_label_set_mnemonic_widget ((GtkLabel *) l, mp->priv->page_entry);
|
||||
#. We are displaying 'XXX of XXX'.
|
||||
#. Translators: the "of" from "1 of 19" in print preview.
|
||||
#: ../xed/xed-print-preview.c:601
|
||||
#: ../xed/xed-print-preview.c:605
|
||||
msgid "of"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:606
|
||||
#: ../xed/xed-print-preview.c:610
|
||||
msgid "Page total"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:607
|
||||
#: ../xed/xed-print-preview.c:611
|
||||
msgid "The total number of pages in the document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:627
|
||||
#: ../xed/xed-print-preview.c:631
|
||||
msgid "Show multiple pages"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:645
|
||||
#: ../xed/xed-print-preview.c:649
|
||||
msgid "Zoom 1:1"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:651
|
||||
#: ../xed/xed-print-preview.c:655
|
||||
msgid "Zoom to fit the whole page"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:657
|
||||
#: ../xed/xed-print-preview.c:661
|
||||
msgid "Zoom the page in"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:663
|
||||
#: ../xed/xed-print-preview.c:667
|
||||
msgid "Zoom the page out"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:678
|
||||
#: ../xed/xed-print-preview.c:682
|
||||
msgid "_Close preview"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:680
|
||||
#: ../xed/xed-print-preview.c:684
|
||||
msgid "Close print preview"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:758
|
||||
#: ../xed/xed-print-preview.c:762
|
||||
#, c-format
|
||||
msgid "Page %d of %d"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:943
|
||||
#: ../xed/xed-print-preview.c:944
|
||||
msgid "Page Preview"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-print-preview.c:944
|
||||
#: ../xed/xed-print-preview.c:945
|
||||
msgid "The preview of a page in the document to be printed"
|
||||
msgstr ""
|
||||
|
||||
@@ -1700,6 +1700,14 @@ msgstr ""
|
||||
msgid "Decrement number at cursor"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/resources/ui/xed-shortcuts.ui.h:47
|
||||
msgid "Toggle comment block"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/resources/ui/xed-shortcuts.ui.h:48
|
||||
msgid "Toggle comment"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-searchbar.c:92
|
||||
#, c-format
|
||||
msgid "Found and replaced %d occurrence"
|
||||
@@ -1762,69 +1770,69 @@ msgstr ""
|
||||
|
||||
#. Translators: the first %s is a file name (e.g. test.txt) the second one
|
||||
#. is a directory (e.g. ssh://master.gnome.org/home/users/paolo)
|
||||
#: ../xed/xed-tab.c:715
|
||||
#: ../xed/xed-tab.c:716
|
||||
#, c-format
|
||||
msgid "Reverting %s from %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:720
|
||||
#: ../xed/xed-tab.c:721
|
||||
#, c-format
|
||||
msgid "Reverting %s"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: the first %s is a file name (e.g. test.txt) the second one
|
||||
#. is a directory (e.g. ssh://master.gnome.org/home/users/paolo)
|
||||
#: ../xed/xed-tab.c:733
|
||||
#: ../xed/xed-tab.c:734
|
||||
#, c-format
|
||||
msgid "Loading %s from %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:738
|
||||
#: ../xed/xed-tab.c:739
|
||||
#, c-format
|
||||
msgid "Loading %s"
|
||||
msgstr ""
|
||||
|
||||
#. Translators: the first %s is a file name (e.g. test.txt) the second one
|
||||
#. is a directory (e.g. ssh://master.gnome.org/home/users/paolo)
|
||||
#: ../xed/xed-tab.c:819
|
||||
#: ../xed/xed-tab.c:820
|
||||
#, c-format
|
||||
msgid "Saving %s to %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:824
|
||||
#: ../xed/xed-tab.c:825
|
||||
#, c-format
|
||||
msgid "Saving %s"
|
||||
msgstr ""
|
||||
|
||||
#. Read only
|
||||
#: ../xed/xed-tab.c:1304
|
||||
#: ../xed/xed-tab.c:1305
|
||||
msgid "RO"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1352
|
||||
#: ../xed/xed-tab.c:1353
|
||||
#, c-format
|
||||
msgid "Error opening file %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1356
|
||||
#: ../xed/xed-tab.c:1357
|
||||
#, c-format
|
||||
msgid "Error reverting file %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1360
|
||||
#: ../xed/xed-tab.c:1361
|
||||
#, c-format
|
||||
msgid "Error saving file %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1393
|
||||
#: ../xed/xed-tab.c:1394
|
||||
msgid "Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1394
|
||||
#: ../xed/xed-tab.c:1395
|
||||
msgid "MIME Type:"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-tab.c:1395
|
||||
#: ../xed/xed-tab.c:1396
|
||||
msgid "Encoding:"
|
||||
msgstr ""
|
||||
|
||||
@@ -1981,8 +1989,8 @@ msgstr ""
|
||||
msgid "Paste the clipboard"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:101 ../plugins/filebrowser/xed-file-browser-plugin.c:968
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:1003
|
||||
#: ../xed/xed-ui.h:101 ../plugins/filebrowser/xed-file-browser-plugin.c:966
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:1001
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:760
|
||||
msgid "_Delete"
|
||||
msgstr ""
|
||||
@@ -1999,177 +2007,197 @@ msgstr ""
|
||||
msgid "Select the entire document"
|
||||
msgstr ""
|
||||
|
||||
#. View menu
|
||||
#: ../xed/xed-ui.h:105
|
||||
msgid "_Toggle Comment"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:106 ../plugins/taglist/HTML.tags.xml.in.h:41
|
||||
msgid "Comment"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:107
|
||||
msgid "_Highlight Mode"
|
||||
msgid "Toggle Comment _Block"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:108
|
||||
msgid "Comment Block"
|
||||
msgstr ""
|
||||
|
||||
#. View menu
|
||||
#: ../xed/xed-ui.h:111
|
||||
msgid "_Highlight Mode"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:112
|
||||
msgid "Change syntax hightlight mode"
|
||||
msgstr ""
|
||||
|
||||
#. Search menu
|
||||
#: ../xed/xed-ui.h:112
|
||||
#: ../xed/xed-ui.h:116
|
||||
msgid "_Find"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:113
|
||||
#: ../xed/xed-ui.h:117
|
||||
msgid "Search for text"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:114
|
||||
#: ../xed/xed-ui.h:118
|
||||
msgid "Find Ne_xt"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:115
|
||||
#: ../xed/xed-ui.h:119
|
||||
msgid "Search forwards for the same text"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:116
|
||||
#: ../xed/xed-ui.h:120
|
||||
msgid "Find Pre_vious"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:117
|
||||
#: ../xed/xed-ui.h:121
|
||||
msgid "Search backwards for the same text"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:119
|
||||
#: ../xed/xed-ui.h:123
|
||||
msgid "Search for and replace text"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:120
|
||||
#: ../xed/xed-ui.h:124
|
||||
msgid "Go to _Line..."
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:121
|
||||
#: ../xed/xed-ui.h:125
|
||||
msgid "Go to a specific line"
|
||||
msgstr ""
|
||||
|
||||
#. Documents menu
|
||||
#: ../xed/xed-ui.h:124
|
||||
#: ../xed/xed-ui.h:128
|
||||
msgid "_Save All"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:125
|
||||
#: ../xed/xed-ui.h:129
|
||||
msgid "Save all open files"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:126
|
||||
#: ../xed/xed-ui.h:130
|
||||
msgid "_Close All"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:127
|
||||
#: ../xed/xed-ui.h:131
|
||||
msgid "Close all open files"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:128
|
||||
#: ../xed/xed-ui.h:132
|
||||
msgid "_Previous Document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:129
|
||||
#: ../xed/xed-ui.h:133
|
||||
msgid "Activate previous document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:130
|
||||
#: ../xed/xed-ui.h:134
|
||||
msgid "_Next Document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:131
|
||||
#: ../xed/xed-ui.h:135
|
||||
msgid "Activate next document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:132
|
||||
#: ../xed/xed-ui.h:136
|
||||
msgid "_Move to New Window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:133
|
||||
#: ../xed/xed-ui.h:137
|
||||
msgid "Move the current document to a new window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:139
|
||||
#: ../xed/xed-ui.h:143
|
||||
msgid "_Close"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:140
|
||||
#: ../xed/xed-ui.h:144
|
||||
msgid "Close the current file"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:146
|
||||
#: ../xed/xed-ui.h:150
|
||||
msgid "_Quit"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:147
|
||||
#: ../xed/xed-ui.h:151
|
||||
msgid "Quit the program"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:152
|
||||
#: ../xed/xed-ui.h:156
|
||||
msgid "_Toolbar"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:153
|
||||
#: ../xed/xed-ui.h:157
|
||||
msgid "Show or hide the toolbar in the current window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:155
|
||||
#: ../xed/xed-ui.h:159
|
||||
msgid "_Statusbar"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:156
|
||||
#: ../xed/xed-ui.h:160
|
||||
msgid "Show or hide the statusbar in the current window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:159
|
||||
#: ../xed/xed-ui.h:162
|
||||
msgid "Fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:163
|
||||
msgid "Edit text in fullscreen"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:161
|
||||
#: ../xed/xed-ui.h:165
|
||||
msgid "_Word wrap"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:162
|
||||
#: ../xed/xed-ui.h:166
|
||||
msgid "Set word wrap for the current document"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:164
|
||||
#: ../xed/xed-ui.h:168
|
||||
msgid "_Overview Map"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:165
|
||||
#: ../xed/xed-ui.h:169
|
||||
msgid "Show or hide the overview map for the current view"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:172
|
||||
#: ../xed/xed-ui.h:176
|
||||
msgid "Side _Pane"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:173
|
||||
#: ../xed/xed-ui.h:177
|
||||
msgid "Show or hide the side pane in the current window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:175
|
||||
#: ../xed/xed-ui.h:179
|
||||
msgid "_Bottom Pane"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-ui.h:176
|
||||
#: ../xed/xed-ui.h:180
|
||||
msgid "Show or hide the bottom pane in the current window"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-utils.c:922
|
||||
#: ../xed/xed-utils.c:642
|
||||
msgid "Please check your installation."
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-utils.c:990
|
||||
#: ../xed/xed-utils.c:710
|
||||
#, c-format
|
||||
msgid "Unable to open UI file %s. Error: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-utils.c:1010
|
||||
#: ../xed/xed-utils.c:730
|
||||
#, c-format
|
||||
msgid "Unable to find the object '%s' inside file %s."
|
||||
msgstr ""
|
||||
|
||||
#. Translators: '/ on <remote-share>'
|
||||
#: ../xed/xed-utils.c:1178
|
||||
#: ../xed/xed-utils.c:898
|
||||
#, c-format
|
||||
msgid "/ on %s"
|
||||
msgstr ""
|
||||
@@ -2190,28 +2218,25 @@ msgstr ""
|
||||
msgid "Activate '%s'"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:1324
|
||||
msgid "Spaces"
|
||||
#: ../xed/xed-window.c:1330
|
||||
#, c-format
|
||||
msgid "Spaces: %u"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:1328
|
||||
msgid "Tabs"
|
||||
#: ../xed/xed-window.c:1334
|
||||
#, c-format
|
||||
msgid "Tabs: %u"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:1389
|
||||
#: ../xed/xed-window.c:1411
|
||||
msgid "Use Spaces"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:1829
|
||||
#, c-format
|
||||
msgid "Tab Width: %u"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:2179
|
||||
#: ../xed/xed-window.c:2198
|
||||
msgid "There are unsaved documents"
|
||||
msgstr ""
|
||||
|
||||
#: ../xed/xed-window.c:3221
|
||||
#: ../xed/xed-window.c:3247
|
||||
msgid "Elevated Privileges"
|
||||
msgstr ""
|
||||
|
||||
@@ -2380,67 +2405,67 @@ msgstr ""
|
||||
msgid "Open a terminal at the currently opened directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:562
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:560
|
||||
msgid "File Browser"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:673
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:671
|
||||
msgid "An error occurred while creating a new directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:676
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:674
|
||||
msgid "An error occurred while creating a new file"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:679
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:677
|
||||
msgid "An error occurred while renaming a file or directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:682
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:680
|
||||
msgid "An error occurred while deleting a file or directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:685
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:683
|
||||
msgid "An error occurred while opening a directory in the file manager"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:688
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:686
|
||||
msgid "An error occurred while setting a root directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:691
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:689
|
||||
msgid "An error occurred while loading a directory"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:694
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:692
|
||||
msgid "An error occurred"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:951
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:949
|
||||
msgid ""
|
||||
"Cannot move file to trash, do you\n"
|
||||
"want to delete permanently?"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:956
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:954
|
||||
#, c-format
|
||||
msgid "The file \"%s\" cannot be moved to the trash."
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:961
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:959
|
||||
msgid "The selected files cannot be moved to the trash."
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:989
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:987
|
||||
#, c-format
|
||||
msgid "Are you sure you want to permanently delete \"%s\"?"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:994
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:992
|
||||
msgid "Are you sure you want to permanently delete the selected files?"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:997
|
||||
#: ../plugins/filebrowser/xed-file-browser-plugin.c:995
|
||||
msgid "If you delete an item, it is permanently lost."
|
||||
msgstr ""
|
||||
|
||||
@@ -2586,17 +2611,17 @@ msgstr ""
|
||||
msgid "_Match Filename"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:1991
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:2014
|
||||
#, c-format
|
||||
msgid "No mount object for mounted volume: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:2069
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:2092
|
||||
#, c-format
|
||||
msgid "Could not open media: %s"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:2118
|
||||
#: ../plugins/filebrowser/xed-file-browser-widget.c:2141
|
||||
#, c-format
|
||||
msgid "Could not mount volume: %s"
|
||||
msgstr ""
|
||||
@@ -2833,10 +2858,6 @@ msgstr ""
|
||||
msgid "Columns"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/taglist/HTML.tags.xml.in.h:41
|
||||
msgid "Comment"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/taglist/HTML.tags.xml.in.h:42
|
||||
msgid "Computer code fragment"
|
||||
msgstr ""
|
||||
@@ -4181,7 +4202,7 @@ msgid "Available Tag Lists"
|
||||
msgstr ""
|
||||
|
||||
#: ../plugins/taglist/xed-taglist-plugin-panel.c:706
|
||||
#: ../plugins/taglist/xed-taglist-plugin-panel.c:722
|
||||
#: ../plugins/taglist/xed-taglist-plugin-panel.c:721
|
||||
#: ../plugins/taglist/xed-taglist-plugin.c:113
|
||||
msgid "Tags"
|
||||
msgstr ""
|
||||
|
209
xed/Makefile.am
209
xed/Makefile.am
@@ -1,209 +0,0 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
bin_PROGRAMS = xed
|
||||
|
||||
pkglib_LTLIBRARIES = libxed.la
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_srcdir) \
|
||||
-I$(srcdir) \
|
||||
$(XED_CFLAGS) \
|
||||
$(WARN_CFLAGS) \
|
||||
$(INTROSPECTION_CFLAGS) \
|
||||
$(DISABLE_DEPRECATED_CFLAGS) \
|
||||
-DDATADIR=\""$(datadir)"\" \
|
||||
-DLIBDIR=\""$(libdir)"\"
|
||||
|
||||
xed_SOURCES = \
|
||||
xed.c
|
||||
|
||||
xed_LDADD = \
|
||||
libxed.la \
|
||||
$(XED_LIBS) \
|
||||
$(INTROSPECTION_LIBS)
|
||||
|
||||
xed_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
|
||||
|
||||
libxed_la_LDFLAGS = -avoid-version -export-dynamic -no-undefined -export-symbols-regex "^[^_].*"
|
||||
|
||||
# XED_LIBS must be the last to ensure correct order on some platforms
|
||||
libxed_la_LIBADD = $(XED_LIBS)
|
||||
|
||||
BUILT_SOURCES = \
|
||||
xed-enum-types.c \
|
||||
xed-enum-types.h \
|
||||
xed-marshal.c \
|
||||
xed-marshal.h
|
||||
|
||||
|
||||
NOINST_H_FILES = \
|
||||
xed-close-button.h \
|
||||
xed-close-confirmation-dialog.h \
|
||||
xed-dirs.h \
|
||||
xed-document-private.h \
|
||||
xed-documents-panel.h \
|
||||
xed-encodings-dialog.h \
|
||||
xed-highlight-mode-dialog.h \
|
||||
xed-highlight-mode-selector.h \
|
||||
xed-history-entry.h \
|
||||
xed-io-error-info-bar.h \
|
||||
xed-metadata-manager.h \
|
||||
xed-paned.h \
|
||||
xed-plugins-engine.h \
|
||||
xed-preferences-dialog.h \
|
||||
xed-print-job.h \
|
||||
xed-print-preview.h \
|
||||
xed-settings.h \
|
||||
xed-status-menu-button.h \
|
||||
xed-tab-label.h \
|
||||
xed-ui.h \
|
||||
xed-utils.h \
|
||||
xed-view-frame.h \
|
||||
xed-view-gutter-renderer.h \
|
||||
xed-window-private.h
|
||||
|
||||
INST_H_FILES = \
|
||||
xed-app.h \
|
||||
xed-app-activatable.h \
|
||||
xed-commands.h \
|
||||
xed-debug.h \
|
||||
xed-document.h \
|
||||
xed-encodings-combo-box.h \
|
||||
xed-file-chooser-dialog.h \
|
||||
xed-message-bus.h \
|
||||
xed-message-type.h \
|
||||
xed-message.h \
|
||||
xed-notebook.h \
|
||||
xed-panel.h \
|
||||
xed-progress-info-bar.h \
|
||||
xed-searchbar.h \
|
||||
xed-statusbar.h \
|
||||
xed-tab.h \
|
||||
xed-view.h \
|
||||
xed-view-activatable.h \
|
||||
xed-window.h \
|
||||
xed-window-activatable.h
|
||||
|
||||
headerdir = $(prefix)/include/xed
|
||||
|
||||
header_DATA = \
|
||||
$(INST_H_FILES)
|
||||
|
||||
BUILT_SOURCES_PRIVATE = \
|
||||
xed-resources.c
|
||||
|
||||
libxed_c_files = \
|
||||
xed-app.c \
|
||||
xed-app-activatable.c \
|
||||
xed-view-activatable.c \
|
||||
xed-window-activatable.c \
|
||||
xed-resources.c \
|
||||
xed-close-button.c \
|
||||
xed-close-confirmation-dialog.c \
|
||||
xed-commands-documents.c \
|
||||
xed-commands-edit.c \
|
||||
xed-commands-file.c \
|
||||
xed-commands-file-print.c \
|
||||
xed-commands-help.c \
|
||||
xed-commands-search.c \
|
||||
xed-commands-view.c \
|
||||
xed-debug.c \
|
||||
xed-dirs.c \
|
||||
xed-document.c \
|
||||
xed-documents-panel.c \
|
||||
xed-encodings-combo-box.c \
|
||||
xed-encodings-dialog.c \
|
||||
xed-file-chooser-dialog.c \
|
||||
xed-highlight-mode-dialog.c \
|
||||
xed-highlight-mode-selector.c \
|
||||
xed-history-entry.c \
|
||||
xed-io-error-info-bar.c \
|
||||
xed-message-bus.c \
|
||||
xed-message-type.c \
|
||||
xed-message.c \
|
||||
xed-metadata-manager.c \
|
||||
xed-notebook.c \
|
||||
xed-paned.c \
|
||||
xed-panel.c \
|
||||
xed-plugins-engine.c \
|
||||
xed-preferences-dialog.c \
|
||||
xed-print-job.c \
|
||||
xed-print-preview.c \
|
||||
xed-progress-info-bar.c \
|
||||
xed-settings.c \
|
||||
xed-searchbar.c \
|
||||
xed-statusbar.c \
|
||||
xed-status-menu-button.c \
|
||||
xed-tab.c \
|
||||
xed-tab-label.c \
|
||||
xed-utils.c \
|
||||
xed-view.c \
|
||||
xed-view-frame.c \
|
||||
xed-view-gutter-renderer.c \
|
||||
xed-window.c
|
||||
|
||||
libxed_la_SOURCES = \
|
||||
$(BUILT_SOURCES) \
|
||||
$(libxed_c_files) \
|
||||
$(POSIXIO_FILES) \
|
||||
$(NOINST_H_FILES) \
|
||||
$(INST_H_FILES)
|
||||
|
||||
xed-enum-types.h: xed-enum-types.h.template $(INST_H_FILES) $(GLIB_MKENUMS)
|
||||
$(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template xed-enum-types.h.template $(INST_H_FILES)) > $@
|
||||
|
||||
xed-enum-types.c: xed-enum-types.c.template $(INST_H_FILES) $(GLIB_MKENUMS)
|
||||
$(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template xed-enum-types.c.template $(INST_H_FILES)) > $@
|
||||
|
||||
xed-marshal.h: xed-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) $(GLIB_GENMARSHAL) $< --header --prefix=xed_marshal > $@
|
||||
|
||||
xed-marshal.c: xed-marshal.list $(GLIB_GENMARSHAL)
|
||||
$(AM_V_GEN) echo "#include \"xed-marshal.h\"" > $@ && \
|
||||
$(GLIB_GENMARSHAL) $< --body --prefix=xed_marshal >> $@
|
||||
|
||||
xed-resources.c: resources/xed.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(srcdir)/resources --generate-dependencies $(srcdir)/resources/xed.gresource.xml)
|
||||
$(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir)/resources --generate-source $(srcdir)/resources/xed.gresource.xml
|
||||
|
||||
EXTRA_DIST = \
|
||||
xed-enum-types.h.template \
|
||||
xed-enum-types.c.template \
|
||||
xed-marshal.list \
|
||||
xed.rc \
|
||||
resources/xed.gresource.xml \
|
||||
resources/ui/xed-ui.xml \
|
||||
resources/ui/xed-encodings-dialog.ui \
|
||||
resources/ui/xed-preferences-dialog.ui \
|
||||
resources/ui/xed-print-preferences.ui \
|
||||
resources/ui/xed-searchbar.ui \
|
||||
resources/ui/xed-view-frame.ui
|
||||
|
||||
CLEANFILES = $(BUILT_SOURCES) $(BUILT_SOURCES_PRIVATE)
|
||||
|
||||
if HAVE_INTROSPECTION
|
||||
-include $(INTROSPECTION_MAKEFILE)
|
||||
INTROSPECTION_GIRS = Xed-1.0.gir
|
||||
|
||||
Xed-1.0.gir: xed
|
||||
INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all
|
||||
Xed_1_0_gir_NAMESPACE = Xed
|
||||
Xed_1_0_gir_VERSION = 1.0
|
||||
Xed_1_0_gir_PROGRAM = $(builddir)/xed
|
||||
Xed_1_0_gir_FILES = $(INST_H_FILES) $(libxed_c_files) $(BUILT_SOURCES)
|
||||
Xed_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0
|
||||
|
||||
girdir = $(datadir)/xed/gir-1.0
|
||||
gir_DATA = $(INTROSPECTION_GIRS)
|
||||
|
||||
typelibdir = $(libdir)/xed/girepository-1.0
|
||||
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
|
||||
|
||||
CLEANFILES += \
|
||||
$(gir_DATA) \
|
||||
$(typelib_DATA)
|
||||
endif
|
||||
|
||||
dist-hook:
|
||||
cd $(distdir); rm -f $(BUILT_SOURCES) $(BUILT_SOURCES_PRIVATE)
|
||||
|
||||
-include $(top_srcdir)/git.mk
|
@@ -11,3 +11,14 @@
|
||||
min-height: 0;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
/*remove a keybinding so that we can use it for toggling comments*/
|
||||
@binding-set xed-view-bindings
|
||||
{
|
||||
unbind "<Control>slash";
|
||||
}
|
||||
|
||||
textview
|
||||
{
|
||||
-gtk-key-bindings: xed-view-bindings;
|
||||
}
|
||||
|
@@ -327,6 +327,20 @@
|
||||
<property name="title" translatable="yes">Decrement number at cursor</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl><shift>slash</property>
|
||||
<property name="title" translatable="yes">Toggle comment block</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="visible">1</property>
|
||||
<property name="accelerator"><ctrl>slash</property>
|
||||
<property name="title" translatable="yes">Toggle comment</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -38,6 +38,9 @@
|
||||
<menuitem name="EditSelectAllMenu" action="EditSelectAll"/>
|
||||
<placeholder name="EditOps_3" />
|
||||
<separator/>
|
||||
<menuitem name="EditToggleCommentMenu" action="EditToggleComment"/>
|
||||
<menuitem name="EditToggleCommentBlockMenu" action="EditToggleCommentBlock"/>
|
||||
<separator/>
|
||||
<placeholder name="EditOps_4" />
|
||||
<separator/>
|
||||
<placeholder name="EditOps_5" />
|
||||
|
@@ -356,93 +356,6 @@ xed_app_startup (GApplication *application)
|
||||
app);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_in_viewport (GtkWindow *window,
|
||||
GdkScreen *screen,
|
||||
gint workspace,
|
||||
gint viewport_x,
|
||||
gint viewport_y)
|
||||
{
|
||||
GdkScreen *s;
|
||||
GdkDisplay *display;
|
||||
GdkWindow *gdkwindow;
|
||||
const gchar *cur_name;
|
||||
const gchar *name;
|
||||
gint cur_n;
|
||||
gint n;
|
||||
gint ws;
|
||||
gint sc_width, sc_height;
|
||||
gint x, y, width, height;
|
||||
gint vp_x, vp_y;
|
||||
|
||||
/* Check for screen and display match */
|
||||
display = gdk_screen_get_display (screen);
|
||||
cur_name = gdk_display_get_name (display);
|
||||
cur_n = gdk_screen_get_number (screen);
|
||||
|
||||
s = gtk_window_get_screen (window);
|
||||
display = gdk_screen_get_display (s);
|
||||
name = gdk_display_get_name (display);
|
||||
n = gdk_screen_get_number (s);
|
||||
|
||||
if (strcmp (cur_name, name) != 0 || cur_n != n)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check for workspace match */
|
||||
ws = xed_utils_get_window_workspace (window);
|
||||
if (ws != workspace && ws != XED_ALL_WORKSPACES)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check for viewport match */
|
||||
gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
|
||||
gdk_window_get_position (gdkwindow, &x, &y);
|
||||
width = gdk_window_get_width (gdkwindow);
|
||||
height = gdk_window_get_height (gdkwindow);
|
||||
xed_utils_get_current_viewport (screen, &vp_x, &vp_y);
|
||||
x += vp_x;
|
||||
y += vp_y;
|
||||
|
||||
sc_width = gdk_screen_get_width (screen);
|
||||
sc_height = gdk_screen_get_height (screen);
|
||||
|
||||
return x + width * .25 >= viewport_x &&
|
||||
x + width * .75 <= viewport_x + sc_width &&
|
||||
y >= viewport_y &&
|
||||
y + height <= viewport_y + sc_height;
|
||||
}
|
||||
|
||||
static XedWindow *
|
||||
get_active_window (GtkApplication *app)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
guint workspace;
|
||||
gint viewport_x, viewport_y;
|
||||
GList *windows, *l;
|
||||
|
||||
screen = gdk_screen_get_default ();
|
||||
|
||||
workspace = xed_utils_get_current_workspace (screen);
|
||||
xed_utils_get_current_viewport (screen, &viewport_x, &viewport_y);
|
||||
|
||||
/* Gtk documentation says the window list is always in MRU order */
|
||||
windows = gtk_application_get_windows (app);
|
||||
for (l = windows; l != NULL; l = l->next)
|
||||
{
|
||||
GtkWindow *window = l->data;
|
||||
|
||||
if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y))
|
||||
{
|
||||
return XED_WINDOW (window);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
set_command_line_wait (XedApp *app,
|
||||
XedTab *tab)
|
||||
@@ -479,7 +392,7 @@ open_files (GApplication *application,
|
||||
|
||||
if (!new_window)
|
||||
{
|
||||
window = get_active_window (GTK_APPLICATION (application));
|
||||
window = XED_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (application)));
|
||||
}
|
||||
|
||||
if (window == NULL)
|
||||
@@ -1251,7 +1164,8 @@ xed_app_show_help (XedApp *app,
|
||||
link = g_strdup_printf ("help:%s", name);
|
||||
}
|
||||
|
||||
ret = gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (parent)), link, GDK_CURRENT_TIME, &error);
|
||||
ret = gtk_show_uri_on_window (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent))),
|
||||
link, GDK_CURRENT_TIME, &error);
|
||||
|
||||
g_free (link);
|
||||
|
||||
|
@@ -169,3 +169,156 @@ _xed_cmd_edit_preferences (GtkAction *action,
|
||||
|
||||
xed_show_preferences_dialog (window);
|
||||
}
|
||||
|
||||
void
|
||||
_xed_cmd_edit_toggle_comment (GtkAction *action,
|
||||
XedWindow *window)
|
||||
{
|
||||
XedView *active_view;
|
||||
GtkSourceBuffer *active_document;
|
||||
GtkSourceLanguage *language;
|
||||
const gchar *comment_text;
|
||||
gint start_line;
|
||||
gint end_line;
|
||||
gint i;
|
||||
gboolean is_comment = FALSE;
|
||||
GtkTextIter start_iter;
|
||||
GtkTextIter end_iter;
|
||||
|
||||
xed_debug (DEBUG_COMMANDS);
|
||||
|
||||
active_view = xed_window_get_active_view (window);
|
||||
|
||||
if (active_view == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));
|
||||
language = gtk_source_buffer_get_language (active_document);
|
||||
|
||||
if (language == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
comment_text = gtk_source_language_get_metadata (language, "line-comment-start");
|
||||
|
||||
if (comment_text == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (active_document), &start_iter, &end_iter);
|
||||
start_line = gtk_text_iter_get_line (&start_iter);
|
||||
end_line = gtk_text_iter_get_line (&end_iter);
|
||||
|
||||
gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (active_document)); // begin
|
||||
|
||||
// if some lines are already commented, consider the whole block commented and uncomment them
|
||||
for (i = start_line; i <= end_line; i++)
|
||||
{
|
||||
GtkTextIter start_line_iter;
|
||||
GtkTextIter end_line_iter;
|
||||
const gchar *line_text;
|
||||
|
||||
gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (active_document), &start_line_iter, i);
|
||||
end_line_iter = start_line_iter;
|
||||
gtk_text_iter_forward_to_line_end (&end_line_iter);
|
||||
|
||||
line_text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (active_document), &start_line_iter, &end_line_iter, TRUE);
|
||||
if (g_str_has_prefix (line_text, comment_text))
|
||||
{
|
||||
is_comment = TRUE;
|
||||
end_line_iter = start_line_iter;
|
||||
gtk_text_iter_forward_chars (&end_line_iter, strlen(comment_text));
|
||||
gtk_text_buffer_delete (GTK_TEXT_BUFFER (active_document), &start_line_iter, &end_line_iter);
|
||||
}
|
||||
}
|
||||
|
||||
// only comment if nothing was commented to begin with
|
||||
if (!is_comment)
|
||||
{
|
||||
for (i = start_line; i <= end_line; i++)
|
||||
{
|
||||
GtkTextIter insert_iter;
|
||||
|
||||
gtk_text_buffer_get_iter_at_line (GTK_TEXT_BUFFER (active_document), &insert_iter, i);
|
||||
gtk_text_buffer_insert (GTK_TEXT_BUFFER (active_document), &insert_iter, comment_text, -1);
|
||||
}
|
||||
}
|
||||
|
||||
gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (active_document)); // end
|
||||
}
|
||||
|
||||
void
|
||||
_xed_cmd_edit_toggle_comment_block (GtkAction *action,
|
||||
XedWindow *window)
|
||||
{
|
||||
XedView *active_view;
|
||||
GtkSourceBuffer *active_document;
|
||||
GtkSourceLanguage *language;
|
||||
const gchar *start_text;
|
||||
const gchar *end_text;
|
||||
GtkTextIter start_iter;
|
||||
GtkTextIter end_iter;
|
||||
gchar *selected_text;
|
||||
gchar *insert_text;
|
||||
|
||||
xed_debug (DEBUG_COMMANDS);
|
||||
|
||||
active_view = xed_window_get_active_view (window);
|
||||
|
||||
if (active_view == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
active_document = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (active_view)));
|
||||
language = gtk_source_buffer_get_language (active_document);
|
||||
|
||||
if (language == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
start_text = gtk_source_language_get_metadata (language, "block-comment-start");
|
||||
end_text = gtk_source_language_get_metadata (language, "block-comment-end");
|
||||
|
||||
if (start_text == NULL || end_text == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (active_document), &start_iter, &end_iter);
|
||||
|
||||
selected_text = gtk_text_buffer_get_slice (GTK_TEXT_BUFFER (active_document), &start_iter, &end_iter, TRUE);
|
||||
|
||||
if (g_str_has_prefix (selected_text, start_text) && g_str_has_suffix (selected_text, end_text))
|
||||
{
|
||||
gint start = strlen (start_text);
|
||||
gint end = strlen (end_text);
|
||||
const gchar *tmp = selected_text + start;
|
||||
insert_text = g_strndup (tmp , strlen(selected_text) - start - end);
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_text = g_strconcat (start_text, selected_text, end_text, NULL);
|
||||
}
|
||||
|
||||
gtk_text_buffer_begin_user_action (GTK_TEXT_BUFFER (active_document)); // begin
|
||||
|
||||
// replace the selected text with the commented/uncommented version
|
||||
gtk_text_buffer_delete (GTK_TEXT_BUFFER (active_document), &start_iter, &end_iter);
|
||||
gtk_text_buffer_insert (GTK_TEXT_BUFFER (active_document), &end_iter, insert_text, -1);
|
||||
|
||||
// move selection back where it was
|
||||
gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (active_document), &start_iter,
|
||||
gtk_text_iter_get_offset (&end_iter) - strlen (insert_text));
|
||||
gtk_text_buffer_select_range (GTK_TEXT_BUFFER (active_document), &start_iter, &end_iter);
|
||||
|
||||
gtk_text_buffer_end_user_action (GTK_TEXT_BUFFER (active_document)); // end
|
||||
|
||||
g_free (selected_text);
|
||||
g_free (insert_text);
|
||||
}
|
||||
|
@@ -42,6 +42,8 @@ void _xed_cmd_edit_paste (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_edit_delete (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_edit_select_all (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_edit_preferences (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_edit_toggle_comment (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_edit_toggle_comment_block (GtkAction *action, XedWindow *window);
|
||||
|
||||
void _xed_cmd_view_show_toolbar (GtkAction *action, XedWindow *window);
|
||||
void _xed_cmd_view_show_statusbar (GtkAction *action, XedWindow *window);
|
||||
|
@@ -525,20 +525,7 @@ show_popup_menu (XedDocumentsPanel *panel,
|
||||
menu = gtk_ui_manager_get_widget (xed_window_get_ui_manager (panel->priv->window), "/NotebookPopup");
|
||||
g_return_val_if_fail (menu != NULL, FALSE);
|
||||
|
||||
if (event != NULL)
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
NULL, NULL,
|
||||
event->button, event->time);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
(GtkMenuPositionFunc) menu_position, panel,
|
||||
0, gtk_get_current_event_time ());
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
|
||||
}
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -186,13 +186,17 @@ static XedNotebook *
|
||||
find_notebook_at_pointer (gint abs_x,
|
||||
gint abs_y)
|
||||
{
|
||||
GdkSeat *seat;
|
||||
GdkDevice *device;
|
||||
GdkWindow *win_at_pointer;
|
||||
GdkWindow *toplevel_win;
|
||||
gpointer toplevel = NULL;
|
||||
gint x, y;
|
||||
|
||||
/* FIXME multi-head */
|
||||
win_at_pointer = gdk_window_at_pointer (&x, &y);
|
||||
seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
device = gdk_seat_get_pointer (seat);
|
||||
win_at_pointer = gdk_device_get_window_at_position (device, &x, &y);
|
||||
|
||||
if (win_at_pointer == NULL)
|
||||
{
|
||||
/* We are outside all windows of the same application */
|
||||
@@ -702,18 +706,6 @@ xed_notebook_switch_page_cb (GtkNotebook *notebook,
|
||||
gtk_widget_grab_focus (GTK_WIDGET (view));
|
||||
}
|
||||
|
||||
/*
|
||||
* update_tabs_visibility: Hide tabs if there is only one tab
|
||||
*/
|
||||
static void
|
||||
update_tabs_visibility (XedNotebook *notebook)
|
||||
{
|
||||
gboolean show_tabs;
|
||||
|
||||
show_tabs = (gtk_notebook_get_n_pages (GTK_NOTEBOOK (notebook)) > 1);
|
||||
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), show_tabs);
|
||||
}
|
||||
|
||||
static void
|
||||
xed_notebook_init (XedNotebook *notebook)
|
||||
{
|
||||
@@ -726,7 +718,6 @@ xed_notebook_init (XedNotebook *notebook)
|
||||
|
||||
gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook), TRUE);
|
||||
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
|
||||
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (notebook), 0);
|
||||
|
||||
g_signal_connect (notebook, "button-press-event",
|
||||
@@ -867,7 +858,6 @@ xed_notebook_add_tab (XedNotebook *nb,
|
||||
|
||||
tab_label = create_tab_label (nb, tab);
|
||||
gtk_notebook_insert_page (GTK_NOTEBOOK (nb), GTK_WIDGET (tab), tab_label, position);
|
||||
update_tabs_visibility (nb);
|
||||
|
||||
g_signal_emit (G_OBJECT (nb), signals[TAB_ADDED], 0, tab);
|
||||
|
||||
@@ -927,7 +917,6 @@ remove_tab (XedTab *tab,
|
||||
|
||||
remove_tab_label (nb, tab);
|
||||
gtk_notebook_remove_page (GTK_NOTEBOOK (nb), position);
|
||||
update_tabs_visibility (nb);
|
||||
|
||||
g_signal_emit (G_OBJECT (nb), signals[TAB_REMOVED], 0, tab);
|
||||
|
||||
|
@@ -276,9 +276,9 @@ restore_button_clicked (GtkButton *button,
|
||||
header = g_settings_get_string (job->priv->print_settings, XED_SETTINGS_PRINT_FONT_HEADER_PANGO);
|
||||
numbers = g_settings_get_string (job->priv->print_settings, XED_SETTINGS_PRINT_FONT_NUMBERS_PANGO);
|
||||
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->body_fontbutton), body);
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->headers_fontbutton), header);
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->numbers_fontbutton), numbers);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->body_fontbutton), body);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->headers_fontbutton), header);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->numbers_fontbutton), numbers);
|
||||
|
||||
g_free (body);
|
||||
g_free (header);
|
||||
@@ -372,13 +372,13 @@ create_custom_widget_cb (GtkPrintOperation *operation,
|
||||
gtk_widget_set_sensitive (job->priv->do_not_split_checkbutton, wrap_mode != GTK_WRAP_NONE);
|
||||
|
||||
/* Set initial values */
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->body_fontbutton), font_body);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->body_fontbutton), font_body);
|
||||
g_free (font_body);
|
||||
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->headers_fontbutton), font_header);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->headers_fontbutton), font_header);
|
||||
g_free (font_header);
|
||||
|
||||
gtk_font_button_set_font_name (GTK_FONT_BUTTON (job->priv->numbers_fontbutton), font_numbers);
|
||||
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (job->priv->numbers_fontbutton), font_numbers);
|
||||
g_free (font_numbers);
|
||||
|
||||
g_signal_connect (job->priv->line_numbers_checkbutton, "toggled",
|
||||
@@ -404,9 +404,9 @@ custom_widget_apply_cb (GtkPrintOperation *operation,
|
||||
|
||||
syntax = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->syntax_checkbutton));
|
||||
page_header = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (job->priv->page_header_checkbutton));
|
||||
body = gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->body_fontbutton));
|
||||
header = gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->headers_fontbutton));
|
||||
numbers = gtk_font_button_get_font_name (GTK_FONT_BUTTON (job->priv->numbers_fontbutton));
|
||||
body = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (job->priv->body_fontbutton));
|
||||
header = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (job->priv->headers_fontbutton));
|
||||
numbers = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (job->priv->numbers_fontbutton));
|
||||
|
||||
g_settings_set_boolean (job->priv->print_settings, XED_SETTINGS_PRINT_SYNTAX_HIGHLIGHTING, syntax);
|
||||
g_settings_set_boolean (job->priv->print_settings, XED_SETTINGS_PRINT_HEADER, page_header);
|
||||
|
@@ -82,6 +82,9 @@ struct _XedPrintPreviewPrivate
|
||||
|
||||
G_DEFINE_TYPE (XedPrintPreview, xed_print_preview, GTK_TYPE_BOX)
|
||||
|
||||
static void goto_page (XedPrintPreview *preview,
|
||||
gint page);
|
||||
|
||||
static void
|
||||
xed_print_preview_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
@@ -173,6 +176,7 @@ set_rows_and_cols (XedPrintPreview *preview,
|
||||
preview->priv->rows = rows;
|
||||
preview->priv->cols = cols;
|
||||
update_layout_size (preview);
|
||||
goto_page (preview, preview->priv->cur_page - (preview->priv->cur_page % (preview->priv->rows * preview->priv->cols)));
|
||||
}
|
||||
|
||||
/* get the paper size in points: these must be used only
|
||||
@@ -312,7 +316,7 @@ goto_page (XedPrintPreview *preview,
|
||||
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (preview->priv->prev), (page > 0) && (preview->priv->n_pages > 1));
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (preview->priv->next),
|
||||
(page != (preview->priv->n_pages - 1)) &&
|
||||
(page < (preview->priv->n_pages - preview->priv->rows * preview->priv->cols)) &&
|
||||
(preview->priv->n_pages > 1));
|
||||
|
||||
if (page != preview->priv->cur_page)
|
||||
@@ -499,7 +503,7 @@ multi_button_clicked (GtkWidget *button,
|
||||
gtk_menu_attach (GTK_MENU (m), i, 1, 2, 1, 2);
|
||||
g_signal_connect (i, "activate", G_CALLBACK (on_2x2_clicked), preview);
|
||||
|
||||
gtk_menu_popup (GTK_MENU (m), NULL, NULL, NULL, preview, 0, GDK_CURRENT_TIME);
|
||||
gtk_menu_popup_at_widget (GTK_MENU (m), button, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -920,9 +924,6 @@ preview_layout_key_press (GtkWidget *widget,
|
||||
{
|
||||
gtk_adjustment_set_value (hadj, x);
|
||||
gtk_adjustment_set_value (vadj, y);
|
||||
|
||||
gtk_adjustment_value_changed (hadj);
|
||||
gtk_adjustment_value_changed (vadj);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -1124,7 +1125,7 @@ preview_draw (GtkWidget *widget,
|
||||
break;
|
||||
}
|
||||
|
||||
draw_page (cr, j * priv->tile_w, i * priv->tile_h, pg, preview);
|
||||
draw_page (cr, i * priv->tile_w, j * priv->tile_h, pg, preview);
|
||||
|
||||
++pg;
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ forward_search_finished (GtkSourceSearchContext *search_context,
|
||||
GtkTextIter match_start;
|
||||
GtkTextIter match_end;
|
||||
|
||||
found = gtk_source_search_context_forward_finish (search_context, result, &match_start, &match_end, NULL);
|
||||
found = gtk_source_search_context_forward_finish2 (search_context, result, &match_start, &match_end, NULL, NULL);
|
||||
buffer = gtk_source_search_context_get_buffer (search_context);
|
||||
|
||||
if (found)
|
||||
@@ -210,7 +210,7 @@ backward_search_finished (GtkSourceSearchContext *search_context,
|
||||
GtkTextIter match_end;
|
||||
GtkSourceBuffer *buffer;
|
||||
|
||||
found = gtk_source_search_context_backward_finish (search_context, result, &match_start, &match_end, NULL);
|
||||
found = gtk_source_search_context_backward_finish2 (search_context, result, &match_start, &match_end, NULL, NULL);
|
||||
buffer = gtk_source_search_context_get_buffer (search_context);
|
||||
|
||||
if (found)
|
||||
@@ -479,12 +479,12 @@ do_replace (XedSearchbar *searchbar)
|
||||
gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (doc), &start, &end);
|
||||
searchbar->priv->search_mode = XED_SEARCH_MODE_REPLACE;
|
||||
|
||||
gtk_source_search_context_replace (search_context,
|
||||
&start,
|
||||
&end,
|
||||
unescaped_replace_text,
|
||||
-1,
|
||||
NULL);
|
||||
gtk_source_search_context_replace2 (search_context,
|
||||
&start,
|
||||
&end,
|
||||
unescaped_replace_text,
|
||||
-1,
|
||||
NULL);
|
||||
|
||||
g_free (unescaped_replace_text);
|
||||
|
||||
|
@@ -87,8 +87,7 @@ xed_status_menu_button_class_init (XedStatusMenuButtonClass *klass)
|
||||
{
|
||||
static const gchar style[] =
|
||||
"* {\n"
|
||||
"padding: 1px 8px 2px 4px;\n"
|
||||
"border: 0;\n"
|
||||
"padding: 2px;\n"
|
||||
"outline-width: 0;\n"
|
||||
"}";
|
||||
|
||||
|
@@ -269,7 +269,6 @@ xed_tab_dispose (GObject *object)
|
||||
{
|
||||
XedTab *tab = XED_TAB (object);
|
||||
|
||||
g_clear_object (&tab->priv->editor);
|
||||
g_clear_object (&tab->priv->task_saver);
|
||||
|
||||
clear_loading (tab);
|
||||
@@ -282,6 +281,8 @@ xed_tab_finalize (GObject *object)
|
||||
{
|
||||
XedTab *tab = XED_TAB (object);
|
||||
|
||||
g_clear_object (&tab->priv->editor);
|
||||
|
||||
if (tab->priv->timer != NULL)
|
||||
{
|
||||
g_timer_destroy (tab->priv->timer);
|
||||
|
@@ -102,6 +102,10 @@ static const GtkActionEntry xed_menu_entries[] =
|
||||
N_("Delete the selected text"), G_CALLBACK (_xed_cmd_edit_delete) },
|
||||
{ "EditSelectAll", "edit-select-all-symbolic", N_("Select _All"), "<control>A",
|
||||
N_("Select the entire document"), G_CALLBACK (_xed_cmd_edit_select_all) },
|
||||
{ "EditToggleComment", NULL, N_("_Toggle Comment"), "<control>slash",
|
||||
N_("Comment"), G_CALLBACK (_xed_cmd_edit_toggle_comment) },
|
||||
{ "EditToggleCommentBlock", NULL, N_("Toggle Comment _Block"), "<shift><control>question",
|
||||
N_("Comment Block"), G_CALLBACK (_xed_cmd_edit_toggle_comment_block) },
|
||||
|
||||
/* View menu */
|
||||
{ "ViewHighlightMode", NULL, N_("_Highlight Mode"), "<shift><control>H",
|
||||
@@ -155,7 +159,7 @@ static const GtkToggleActionEntry xed_always_sensitive_toggle_menu_entries[] =
|
||||
{ "ViewStatusbar", NULL, N_("_Statusbar"), NULL,
|
||||
N_("Show or hide the statusbar in the current window"),
|
||||
G_CALLBACK (_xed_cmd_view_show_statusbar), TRUE },
|
||||
{ "ViewFullscreen", GTK_STOCK_FULLSCREEN, NULL, "F11",
|
||||
{ "ViewFullscreen", "view-fullscreen", N_("Fullscreen"), "F11",
|
||||
N_("Edit text in fullscreen"),
|
||||
G_CALLBACK (_xed_cmd_view_toggle_fullscreen_mode), FALSE },
|
||||
{ "ViewWordWrap", NULL, N_("_Word wrap"), NULL,
|
||||
|
280
xed/xed-utils.c
280
xed/xed-utils.c
@@ -54,99 +54,6 @@
|
||||
|
||||
#define STDIN_DELAY_MICROSECONDS 100000
|
||||
|
||||
static void
|
||||
widget_get_origin (GtkWidget *widget,
|
||||
gint *x,
|
||||
gint *y)
|
||||
|
||||
{
|
||||
GdkWindow *window;
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
gdk_window_get_origin (window, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
xed_utils_menu_position_under_widget (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkRequisition requisition;
|
||||
GtkAllocation allocation;
|
||||
|
||||
widget = GTK_WIDGET (user_data);
|
||||
widget_get_origin (widget, x, y);
|
||||
|
||||
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
*x += allocation.x + allocation.width - requisition.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x += allocation.x;
|
||||
}
|
||||
|
||||
*y += allocation.y + allocation.height;
|
||||
|
||||
*push_in = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xed_utils_menu_position_under_tree_view (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkTreeView *tree = GTK_TREE_VIEW (user_data);
|
||||
GtkTreeModel *model;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
model = gtk_tree_view_get_model (tree);
|
||||
g_return_if_fail (model != NULL);
|
||||
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
g_return_if_fail (selection != NULL);
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GdkRectangle rect;
|
||||
|
||||
widget_get_origin (GTK_WIDGET (tree), x, y);
|
||||
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
gtk_tree_view_get_cell_area (tree, path,
|
||||
gtk_tree_view_get_column (tree, 0), /* FIXME 0 for RTL ? */
|
||||
&rect);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
*x += rect.x;
|
||||
*y += rect.y + rect.height;
|
||||
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
|
||||
|
||||
*x += rect.width - requisition.width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no selection -> regular "under widget" positioning */
|
||||
xed_utils_menu_position_under_widget (menu, x, y, push_in, tree);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: remove this with gtk 2.12, it has gdk_color_to_string */
|
||||
gchar *
|
||||
xed_gdk_color_to_string (GdkColor color)
|
||||
@@ -630,193 +537,6 @@ xed_utils_replace_home_dir_with_tilde (const gchar *uri)
|
||||
return g_strdup (uri);
|
||||
}
|
||||
|
||||
/* the following two functions are courtesy of galeon */
|
||||
|
||||
/**
|
||||
* xed_utils_get_current_workspace:
|
||||
*
|
||||
* Get the current workspace
|
||||
*
|
||||
* Get the currently visible workspace for the #GdkScreen.
|
||||
*
|
||||
* If the X11 window property isn't found, 0 (the first workspace)
|
||||
* is returned.
|
||||
*/
|
||||
guint
|
||||
xed_utils_get_current_workspace (GdkScreen *screen)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *root_win;
|
||||
GdkDisplay *display;
|
||||
guint ret = 0;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
root_win = gdk_screen_get_root_window (screen);
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
guint *current_desktop;
|
||||
gint err, result;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_CURRENT_DESKTOP"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (gpointer) ¤t_desktop);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (type == XA_CARDINAL && format == 32 && nitems > 0)
|
||||
{
|
||||
ret = current_desktop[0];
|
||||
}
|
||||
|
||||
XFree (current_desktop);
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xed_utils_get_window_workspace:
|
||||
*
|
||||
* Get the workspace the window is on
|
||||
*
|
||||
* This function gets the workspace that the #GtkWindow is visible on,
|
||||
* it returns XED_ALL_WORKSPACES if the window is sticky, or if
|
||||
* the window manager doesn support this function
|
||||
*/
|
||||
guint
|
||||
xed_utils_get_window_workspace (GtkWindow *gtkwindow)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *window;
|
||||
GdkDisplay *display;
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
guint *workspace;
|
||||
gint err, result;
|
||||
guint ret = XED_ALL_WORKSPACES;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (gtkwindow), 0);
|
||||
g_return_val_if_fail (gtk_widget_get_realized (GTK_WIDGET (gtkwindow)), 0);
|
||||
|
||||
window = gtk_widget_get_window (GTK_WIDGET (gtkwindow));
|
||||
display = gdk_window_get_display (window);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (gpointer) &workspace);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (type == XA_CARDINAL && format == 32 && nitems > 0)
|
||||
{
|
||||
ret = workspace[0];
|
||||
}
|
||||
|
||||
XFree (workspace);
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xed_utils_get_current_viewport:
|
||||
*
|
||||
* Get the current viewport origin
|
||||
*
|
||||
* Get the currently visible viewport origin for the #GdkScreen.
|
||||
*
|
||||
* If the X11 window property isn't found, (0, 0) is returned.
|
||||
*/
|
||||
void
|
||||
xed_utils_get_current_viewport (GdkScreen *screen,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *root_win;
|
||||
GdkDisplay *display;
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
gulong *coordinates;
|
||||
gint err, result;
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
g_return_if_fail (x != NULL && y != NULL);
|
||||
|
||||
/* Default values for the viewport origin */
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
|
||||
root_win = gdk_screen_get_root_window (screen);
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_DESKTOP_VIEWPORT"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (void*) &coordinates);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type != XA_CARDINAL || format != 32 || nitems < 2)
|
||||
{
|
||||
XFree (coordinates);
|
||||
return;
|
||||
}
|
||||
|
||||
*x = coordinates[0];
|
||||
*y = coordinates[1];
|
||||
XFree (coordinates);
|
||||
}
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_valid_scheme_character (gchar c)
|
||||
{
|
||||
|
@@ -48,18 +48,6 @@ G_BEGIN_DECLS
|
||||
|
||||
enum { XED_ALL_WORKSPACES = 0xffffffff };
|
||||
|
||||
void xed_utils_menu_position_under_widget (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
|
||||
void xed_utils_menu_position_under_tree_view (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
|
||||
gchar *xed_gdk_color_to_string (GdkColor color);
|
||||
|
||||
gchar *xed_utils_escape_underscores (const gchar *text,
|
||||
@@ -97,14 +85,6 @@ gchar *xed_utils_location_get_dirname_for_display (GFile *location);
|
||||
|
||||
gchar *xed_utils_replace_home_dir_with_tilde (const gchar *uri);
|
||||
|
||||
guint xed_utils_get_current_workspace (GdkScreen *screen);
|
||||
|
||||
guint xed_utils_get_window_workspace (GtkWindow *gtkwindow);
|
||||
|
||||
void xed_utils_get_current_viewport (GdkScreen *screen,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
gboolean xed_utils_is_valid_location (GFile *location);
|
||||
|
||||
gboolean xed_utils_get_ui_objects (const gchar *filename,
|
||||
|
@@ -524,7 +524,6 @@ xed_view_frame_init (XedViewFrame *frame)
|
||||
{
|
||||
XedDocument *doc;
|
||||
GtkSourceFile *file;
|
||||
GdkRGBA transparent = {0, 0, 0, 0};
|
||||
PangoFontDescription *font_desc;
|
||||
|
||||
frame->priv = xed_view_frame_get_instance_private (frame);
|
||||
@@ -542,8 +541,6 @@ xed_view_frame_init (XedViewFrame *frame)
|
||||
g_object_set (frame->priv->map, "font-desc", font_desc, NULL);
|
||||
pango_font_description_free (font_desc);
|
||||
|
||||
gtk_widget_override_background_color (GTK_WIDGET (frame), 0, &transparent);
|
||||
|
||||
doc = xed_view_frame_get_document (frame);
|
||||
file = xed_document_get_file (doc);
|
||||
|
||||
|
@@ -401,7 +401,7 @@ show_line_numbers_menu (GtkWidget *view,
|
||||
GtkWidget *menu;
|
||||
|
||||
menu = create_line_numbers_menu (view);
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@@ -57,6 +57,7 @@ struct _XedWindowPrivate
|
||||
|
||||
GtkWidget *tab_width_button;
|
||||
GtkWidget *tab_width_menu;
|
||||
GtkWidget *tab_width_item;
|
||||
GtkWidget *language_button;
|
||||
GtkWidget *language_popover;
|
||||
GtkWidget *show_side_pane_button;
|
||||
|
104
xed/xed-window.c
104
xed/xed-window.c
@@ -1316,17 +1316,27 @@ tab_width_button_clicked (GtkMenuItem *item,
|
||||
}
|
||||
|
||||
static void
|
||||
set_tab_spaces_label (XedWindow *window,
|
||||
set_tab_spaces_label (XedView *view,
|
||||
XedWindow *window,
|
||||
gboolean use_spaces)
|
||||
{
|
||||
gchar *label;
|
||||
guint tab_width;
|
||||
|
||||
tab_width = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (view));
|
||||
|
||||
if (use_spaces)
|
||||
{
|
||||
xed_status_menu_button_set_label (XED_STATUS_MENU_BUTTON (window->priv->tab_width_button), _("Spaces"));
|
||||
label = g_strdup_printf (_("Spaces: %u"), tab_width);
|
||||
}
|
||||
else
|
||||
{
|
||||
xed_status_menu_button_set_label (XED_STATUS_MENU_BUTTON (window->priv->tab_width_button), _("Tabs"));
|
||||
label = g_strdup_printf (_("Tabs: %u"), tab_width);
|
||||
}
|
||||
|
||||
xed_status_menu_button_set_label (XED_STATUS_MENU_BUTTON (window->priv->tab_width_button), label);
|
||||
|
||||
g_free (label);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1339,7 +1349,7 @@ use_spaces_toggled (GtkCheckMenuItem *item,
|
||||
view = xed_window_get_active_view (window);
|
||||
use_spaces = gtk_check_menu_item_get_active (item);
|
||||
|
||||
set_tab_spaces_label (window, use_spaces);
|
||||
set_tab_spaces_label (view, window, use_spaces);
|
||||
|
||||
g_signal_handler_block (view, window->priv->spaces_instead_of_tabs_id);
|
||||
gtk_source_view_set_insert_spaces_instead_of_tabs (GTK_SOURCE_VIEW (view), use_spaces);
|
||||
@@ -1352,6 +1362,19 @@ typedef struct
|
||||
guint width;
|
||||
} TabWidthDefinition;
|
||||
|
||||
static void
|
||||
tab_width_menu_popped_up (GtkMenu *menu,
|
||||
gpointer flipped_rect,
|
||||
gpointer final_rect,
|
||||
gboolean flipped_x,
|
||||
gboolean flipped_y,
|
||||
gpointer user_data)
|
||||
{
|
||||
XedWindow *window = XED_WINDOW (user_data);
|
||||
|
||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (window->priv->tab_width_menu), GTK_WIDGET (window->priv->tab_width_item));
|
||||
}
|
||||
|
||||
static void
|
||||
setup_tab_width_menu (XedWindow *window)
|
||||
{
|
||||
@@ -1360,7 +1383,6 @@ setup_tab_width_menu (XedWindow *window)
|
||||
|
||||
guint i = 0;
|
||||
GtkWidget *item;
|
||||
gboolean use_spaces;
|
||||
|
||||
window->priv->tab_width_menu = gtk_menu_new ();
|
||||
|
||||
@@ -1390,10 +1412,9 @@ setup_tab_width_menu (XedWindow *window)
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (window->priv->tab_width_menu), item);
|
||||
gtk_widget_show (item);
|
||||
|
||||
g_signal_connect(item, "toggled", G_CALLBACK (use_spaces_toggled), window);
|
||||
g_signal_connect (item, "toggled", G_CALLBACK (use_spaces_toggled), window);
|
||||
|
||||
use_spaces = g_settings_get_boolean (window->priv->editor_settings, "insert-spaces");
|
||||
set_tab_spaces_label (window, use_spaces);
|
||||
g_signal_connect (window->priv->tab_width_menu, "popped-up", G_CALLBACK (tab_width_menu_popped_up), window);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1756,15 +1777,6 @@ set_title (XedWindow *window)
|
||||
|
||||
#undef MAX_TITLE_LENGTH
|
||||
|
||||
static void
|
||||
set_tab_width_item_blocked (XedWindow *window,
|
||||
GtkMenuItem *item)
|
||||
{
|
||||
g_signal_handlers_block_by_func(item, tab_width_button_clicked, window);
|
||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (window->priv->tab_width_menu), GTK_WIDGET (item));
|
||||
g_signal_handlers_unblock_by_func(item, tab_width_button_clicked, window);
|
||||
}
|
||||
|
||||
static void
|
||||
spaces_instead_of_tabs_changed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
@@ -1787,12 +1799,13 @@ tab_width_changed (GObject *object,
|
||||
GList *items;
|
||||
GList *item;
|
||||
guint new_tab_width;
|
||||
gchar *label;
|
||||
gboolean use_spaces;
|
||||
gboolean found = FALSE;
|
||||
|
||||
items = gtk_container_get_children (GTK_CONTAINER (window->priv->tab_width_menu));
|
||||
|
||||
new_tab_width = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW(object));
|
||||
new_tab_width = gtk_source_view_get_tab_width (GTK_SOURCE_VIEW (object));
|
||||
use_spaces = gtk_source_view_get_insert_spaces_instead_of_tabs (GTK_SOURCE_VIEW (object));
|
||||
|
||||
for (item = items; item; item = item->next)
|
||||
{
|
||||
@@ -1800,7 +1813,11 @@ tab_width_changed (GObject *object,
|
||||
|
||||
if (tab_width == new_tab_width)
|
||||
{
|
||||
set_tab_width_item_blocked (window, GTK_MENU_ITEM(item->data));
|
||||
window->priv->tab_width_item = item->data;
|
||||
if (gtk_widget_get_realized (window->priv->tab_width_menu))
|
||||
{
|
||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (window->priv->tab_width_menu), GTK_WIDGET (item->data));
|
||||
}
|
||||
found = TRUE;
|
||||
}
|
||||
|
||||
@@ -1814,7 +1831,11 @@ tab_width_changed (GObject *object,
|
||||
text = g_strdup_printf ("%u", new_tab_width);
|
||||
gtk_menu_item_set_label (GTK_MENU_ITEM(item->data), text);
|
||||
|
||||
set_tab_width_item_blocked (window, GTK_MENU_ITEM(item->data));
|
||||
window->priv->tab_width_item = item->data;
|
||||
if (gtk_widget_get_realized (window->priv->tab_width_menu))
|
||||
{
|
||||
gtk_menu_shell_select_item (GTK_MENU_SHELL (window->priv->tab_width_menu), GTK_WIDGET (item->data));
|
||||
}
|
||||
gtk_widget_show (GTK_WIDGET(item->data));
|
||||
}
|
||||
else
|
||||
@@ -1826,10 +1847,8 @@ tab_width_changed (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
label = g_strdup_printf (_("Tab Width: %u"), new_tab_width);
|
||||
xed_status_menu_button_set_label (XED_STATUS_MENU_BUTTON (window->priv->tab_width_button), label);
|
||||
set_tab_spaces_label (XED_VIEW (object), window, use_spaces);
|
||||
|
||||
g_free (label);
|
||||
g_list_free (items);
|
||||
}
|
||||
|
||||
@@ -2346,7 +2365,22 @@ on_fullscreen_controls_leave_notify_event (GtkWidget *widget,
|
||||
GdkEventCrossing *event,
|
||||
XedWindow *window)
|
||||
{
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER (window->priv->fullscreen_controls), FALSE);
|
||||
GdkWindow *gdk_window;
|
||||
GdkDevice *device;
|
||||
GdkSeat *seat;
|
||||
gint x, y;
|
||||
|
||||
seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
device = gdk_seat_get_pointer (seat);
|
||||
gdk_window = gtk_widget_get_parent_window (widget);
|
||||
|
||||
gdk_window_get_device_position (gdk_window, device, &x, &y, NULL);
|
||||
|
||||
// sometimes the leave event is erroneously triggered when y = 0
|
||||
if (y != 0)
|
||||
{
|
||||
gtk_revealer_set_reveal_child (GTK_REVEALER (window->priv->fullscreen_controls), FALSE);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2718,19 +2752,11 @@ notebook_tab_removed (XedNotebook *notebook,
|
||||
gtk_widget_hide (window->priv->language_button);
|
||||
}
|
||||
|
||||
if (!window->priv->removing_tabs)
|
||||
if (!window->priv->removing_tabs || window->priv->num_tabs == 0)
|
||||
{
|
||||
update_documents_list_menu (window);
|
||||
update_next_prev_doc_sensitivity_per_window (window);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (window->priv->num_tabs == 0)
|
||||
{
|
||||
update_documents_list_menu (window);
|
||||
update_next_prev_doc_sensitivity_per_window (window);
|
||||
}
|
||||
}
|
||||
|
||||
update_sensitivity_according_to_open_tabs (window);
|
||||
|
||||
@@ -2801,20 +2827,20 @@ show_notebook_popup_menu (GtkNotebook *notebook,
|
||||
#endif
|
||||
if (event != NULL)
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkWidget *tab;
|
||||
GtkWidget *tab_label;
|
||||
|
||||
tab = GTK_WIDGET(xed_window_get_active_tab (window));
|
||||
g_return_val_if_fail(tab != NULL, FALSE);
|
||||
tab = GTK_WIDGET (xed_window_get_active_tab (window));
|
||||
g_return_val_if_fail (tab != NULL, FALSE);
|
||||
|
||||
tab_label = gtk_notebook_get_tab_label (notebook, tab);
|
||||
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, xed_utils_menu_position_under_widget, tab_label, 0,
|
||||
gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_widget (GTK_MENU (menu), tab_label, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL(menu), FALSE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user