Now able to create symbolic links
This commit is contained in:
parent
a1af8a062b
commit
e57392493e
|
@ -35,6 +35,9 @@
|
|||
#include "desktop.h"
|
||||
#include "../config.h"
|
||||
|
||||
#define COMMON_SYMLINK
|
||||
#include "common.c"
|
||||
|
||||
#ifdef PACKAGE
|
||||
# undef PACKAGE
|
||||
#endif
|
||||
|
@ -292,6 +295,7 @@ static void _on_popup_new_folder(gpointer data);
|
|||
static void _on_popup_new_text_file(gpointer data);
|
||||
static void _on_popup_paste(gpointer data);
|
||||
static void _on_popup_preferences(gpointer data);
|
||||
static void _on_popup_symlink(gpointer data);
|
||||
|
||||
static GdkFilterReturn _new_on_root_event(GdkXEvent * xevent, GdkEvent * event,
|
||||
gpointer data)
|
||||
|
@ -341,6 +345,10 @@ static GdkFilterReturn _event_button_press(XButtonEvent * xbev,
|
|||
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
|
||||
menuitem = gtk_separator_menu_item_new();
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
|
||||
menuitem = gtk_image_menu_item_new_with_label("Symbolic link...");
|
||||
g_signal_connect_swapped(G_OBJECT(menuitem), "activate", G_CALLBACK(
|
||||
_on_popup_symlink), desktop);
|
||||
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
|
||||
menuitem = gtk_image_menu_item_new_with_label("Text file");
|
||||
image = gtk_image_new_from_icon_name("stock_new-text",
|
||||
GTK_ICON_SIZE_MENU);
|
||||
|
@ -587,6 +595,14 @@ static void _preferences_set(Desktop * desktop)
|
|||
config_delete(config);
|
||||
}
|
||||
|
||||
static void _on_popup_symlink(gpointer data)
|
||||
{
|
||||
Desktop * desktop = data;
|
||||
|
||||
if(_common_symlink(NULL, desktop->path) != 0)
|
||||
desktop_error(desktop, "symlink", 0);
|
||||
}
|
||||
|
||||
|
||||
/* desktop_delete */
|
||||
void desktop_delete(Desktop * desktop)
|
||||
|
|
Loading…
Reference in New Issue
Block a user