Skip to content

Commit 5d566ee

Browse files
author
smpl-os
committed
v1.4.6: Add Show Places (Alt+Shift+P) and Show Treeview (Alt+Shift+T) keybindings
- Add NEMO_ACTION_SHOW_PLACES / NEMO_ACTION_SHOW_TREEVIEW to nemo-actions.h - Add action_show_places_callback / action_show_treeview_callback in nemo-window-menus.c (switches sidebar type AND ensures sidebar is visible) - Register both as GtkActionEntry in main_entries[] - Add show-places / show-treeview keys to nemo-keybindings.c with Alt+Shift+P / Alt+Shift+T defaults - Add corresponding schema keys to org.nemo.gschema.xml - Upgrade statusbar places/tree button tooltips to use make_tooltip_with_accel so they show the live keybinding like the other buttons
1 parent 69161ac commit 5d566ee

6 files changed

Lines changed: 45 additions & 3 deletions

File tree

libnemo-private/org.nemo.gschema.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,14 @@
998998
<default>'&lt;Control&gt;F3'</default>
999999
<summary>Toggle split view</summary>
10001000
</key>
1001+
<key name="show-places" type="s">
1002+
<default>'&lt;Alt&gt;&lt;Shift&gt;p'</default>
1003+
<summary>Show Places sidebar</summary>
1004+
</key>
1005+
<key name="show-treeview" type="s">
1006+
<default>'&lt;Alt&gt;&lt;Shift&gt;t'</default>
1007+
<summary>Show Treeview sidebar</summary>
1008+
</key>
10011009
<key name="quick-preview" type="s">
10021010
<default>'F3'</default>
10031011
<summary>Quick file preview</summary>

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Meson build file
22

33
# https://github.com/linuxmint/nemo
4-
project('nemo', 'c', version : '1.4.5', meson_version : '>=0.56.0')
4+
project('nemo', 'c', version : '1.4.6', meson_version : '>=0.56.0')
55

66
# 1. If the library code has changed at all since last release, then increment revision.
77
# 2. If any interfaces have been added, then increment current and set revision to 0.

src/nemo-actions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#define NEMO_ACTION_UP_ACCEL "UpAccel"
3838
#define NEMO_ACTION_FORWARD "Forward"
3939
#define NEMO_ACTION_SHOW_HIDE_SIDEBAR "Show Hide Sidebar"
40+
#define NEMO_ACTION_SHOW_PLACES "Show Places"
41+
#define NEMO_ACTION_SHOW_TREEVIEW "Show Treeview"
4042

4143
#define NEMO_ACTION_SHOW_HIDE_TOOLBAR "Show Hide Toolbar"
4244
#define NEMO_ACTION_TOOLBAR_ALWAYS_SHOW_PATHBAR "Toolbar Always Show Pathbar"

src/nemo-keybindings.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ const NemoKeybindingEntry nemo_keybinding_entries[] = {
5858
{ "show-hidden-files", "<Actions>/ShellActions/Show Hidden Files", N_("Show Hidden Files"), N_("Window"), "<Control>h", NULL, NULL },
5959
{ "show-sidebar", "<Actions>/ShellActions/Show Hide Sidebar", N_("Toggle Sidebar"), N_("Window"), "F9", NULL, NULL },
6060
{ "split-view", "<Actions>/ShellActions/Show Hide Extra Pane", N_("Toggle Split View"), N_("Window"), "<Control>F3", NULL, NULL },
61+
{ "show-places", "<Actions>/ShellActions/Show Places", N_("Show Places Sidebar"), N_("Window"), "<Alt><Shift>p", NULL, NULL },
62+
{ "show-treeview", "<Actions>/ShellActions/Show Treeview", N_("Show Treeview Sidebar"), N_("Window"), "<Alt><Shift>t", NULL, NULL },
6163
{ "quick-preview", "<Actions>/ShellActions/Quick Preview", N_("Quick File Preview"), N_("Window"), "F3", NULL, NULL },
6264
{ "toggle-mute", NULL, N_("Mute/Unmute Preview Audio"), N_("Window"), "<Control>m", NULL, NULL },
6365
{ "toggle-play", NULL, N_("Play/Pause Preview Audio"), N_("Window"), "<Control>space", NULL, NULL },

src/nemo-statusbar.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ nemo_status_bar_constructed (GObject *object)
235235
button = gtk_toggle_button_new ();
236236
icon = gtk_image_new_from_icon_name ("nemo-sidebar-places-symbolic", size);
237237
gtk_button_set_image (GTK_BUTTON (button), icon);
238-
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Show Places"));
238+
{
239+
gchar *tip = make_tooltip_with_accel (bar, _("Show Places"), NEMO_ACTION_SHOW_PLACES);
240+
gtk_widget_set_tooltip_text (GTK_WIDGET (button), tip);
241+
g_free (tip);
242+
}
239243
bar->places_button = button;
240244
gtk_box_pack_start (GTK_BOX (bar), button, FALSE, FALSE, 2);
241245
g_signal_connect (GTK_BUTTON (button), "clicked",
@@ -244,7 +248,11 @@ nemo_status_bar_constructed (GObject *object)
244248
button = gtk_toggle_button_new ();
245249
icon = gtk_image_new_from_icon_name ("nemo-sidebar-tree-symbolic", size);
246250
gtk_button_set_image (GTK_BUTTON (button), icon);
247-
gtk_widget_set_tooltip_text (GTK_WIDGET (button), _("Show Treeview"));
251+
{
252+
gchar *tip = make_tooltip_with_accel (bar, _("Show Treeview"), NEMO_ACTION_SHOW_TREEVIEW);
253+
gtk_widget_set_tooltip_text (GTK_WIDGET (button), tip);
254+
g_free (tip);
255+
}
248256
bar->tree_button = button;
249257
gtk_box_pack_start (GTK_BOX (bar), button, FALSE, FALSE, 2);
250258
g_signal_connect (GTK_BUTTON (button), "clicked",

src/nemo-window-menus.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,24 @@ action_split_view_same_location_callback (GtkAction *action,
599599
}
600600
}
601601

602+
static void
603+
action_show_places_callback (GtkAction *action,
604+
gpointer user_data)
605+
{
606+
NemoWindow *window = NEMO_WINDOW (user_data);
607+
nemo_window_set_sidebar_id (window, NEMO_WINDOW_SIDEBAR_PLACES);
608+
nemo_window_set_show_sidebar (window, TRUE);
609+
}
610+
611+
static void
612+
action_show_treeview_callback (GtkAction *action,
613+
gpointer user_data)
614+
{
615+
NemoWindow *window = NEMO_WINDOW (user_data);
616+
nemo_window_set_sidebar_id (window, NEMO_WINDOW_SIDEBAR_TREE);
617+
nemo_window_set_show_sidebar (window, TRUE);
618+
}
619+
602620
static void
603621
action_show_hide_sidebar_callback (GtkAction *action,
604622
gpointer user_data)
@@ -2256,6 +2274,10 @@ static const GtkActionEntry main_entries[] = {
22562274
G_CALLBACK (action_tabs_move_right_callback) },
22572275
{ "Sidebar List", NULL, N_("Sidebar") },
22582276
{ "Toolbar List", NULL, N_("Toolbar") },
2277+
{ NEMO_ACTION_SHOW_PLACES, NULL, N_("Show _Places Sidebar"), NULL, N_("Switch to Places sidebar panel"),
2278+
G_CALLBACK (action_show_places_callback) },
2279+
{ NEMO_ACTION_SHOW_TREEVIEW, NULL, N_("Show _Tree Sidebar"), NULL, N_("Switch to Tree sidebar panel"),
2280+
G_CALLBACK (action_show_treeview_callback) },
22592281
};
22602282

22612283
static const GtkToggleActionEntry main_toggle_entries[] = {

0 commit comments

Comments
 (0)