| | 1714 | } |
| | 1715 | |
| | 1716 | /** |
| | 1717 | @brief clear the current forward-back history content |
| | 1718 | @param from the button, menu item etc which was activated |
| | 1719 | @param art action runtime data |
| | 1720 | |
| | 1721 | @return TRUE |
| | 1722 | */ |
| | 1723 | static gboolean _e2_pane_clear_goto_history (gpointer from, E2_ActionRuntime *art) |
| | 1724 | { |
| | 1725 | gboolean retval = FALSE; |
| | 1726 | const gchar *arg = NULL; |
| | 1727 | E2_PaneRuntime *rt = e2_pane_get_runtime (from, art->data, &arg); |
| | 1728 | if (rt != NULL) |
| | 1729 | { |
| | 1730 | rt->opendir_cur = 0; |
| | 1731 | //do not clear the data, it's shared with app.dir_history |
| | 1732 | g_list_free (rt->opendirs); |
| | 1733 | rt->opendirs = NULL; |
| | 1734 | retval = TRUE; |
| | 1735 | } |
| | 1736 | if (arg != NULL) |
| | 1737 | { |
| | 1738 | if (g_str_has_prefix (arg, "1")) |
| | 1739 | rt = &app.pane1; |
| | 1740 | else if (g_str_has_prefix (arg, "2")) |
| | 1741 | rt = &app.pane2; |
| | 1742 | else if ((strchr (arg, '1') != NULL && strchr (arg, '2') != NULL) |
| | 1743 | || g_str_has_prefix (arg, _("both"))) |
| | 1744 | { |
| | 1745 | rt = &app.pane1; |
| | 1746 | rt->opendir_cur = 0; |
| | 1747 | g_list_free (rt->opendirs); |
| | 1748 | rt->opendirs = NULL; |
| | 1749 | rt = &app.pane2; |
| | 1750 | } |
| | 1751 | rt->opendir_cur = 0; |
| | 1752 | g_list_free (rt->opendirs); |
| | 1753 | rt->opendirs = NULL; |
| | 1754 | retval = TRUE; |
| | 1755 | } |
| | 1756 | return retval; |
| 1795 | | /* no need to "go back" to places visited in a prior session |
| 1796 | | //CHECKME do this again after post-config window recreation ? |
| 1797 | | gchar *history_name = g_strconcat (rt->name, "-history", NULL); |
| 1798 | | e2_cache_list_register (history_name, &rt->history); |
| 1799 | | if (rt->history != NULL) //if history list found in cache |
| 1800 | | rt->opendir_cur = 0; //g_list_length (rt->history); |
| 1801 | | g_free (history_name); |
| 1802 | | */ |
| 1803 | | gchar *history_name = g_strconcat (rt->name, "-history", NULL); |
| 1804 | | e2_cache_list_register (history_name, &rt->opendirs); |
| 1805 | | g_free (history_name); |
| 1806 | | if (rt->opendirs != NULL) |
| 1807 | | { |
| 1808 | | GList *node; |
| 1809 | | for (node = rt->opendirs; node != NULL; node = node->next) |
| 1810 | | { |
| 1811 | | gchar *dirpath = (gchar *)node->data; |
| 1812 | | E2_DirHistoryEntry *hist_entry = g_hash_table_lookup (app.dir_history, dirpath); |
| 1813 | | if (hist_entry == NULL) |
| 1814 | | {//need a new entry for the history cache |
| 1815 | | hist_entry = ALLOCATE0 (E2_DirHistoryEntry); |
| 1816 | | CHECKALLOCATEDWARNT (hist_entry, ); |
| 1817 | | if (hist_entry != NULL) |
| | 1838 | if (e2_option_bool_get ("cache-history")) |
| | 1839 | { |
| | 1840 | gchar *history_name = g_strconcat (rt->name, "-history", NULL); |
| | 1841 | e2_cache_list_register (history_name, &rt->opendirs); |
| | 1842 | g_free (history_name); |
| | 1843 | if (rt->opendirs != NULL) |
| | 1844 | { |
| | 1845 | GList *node; |
| | 1846 | for (node = rt->opendirs; node != NULL; node = node->next) |
| | 1847 | { |
| | 1848 | gchar *dirpath = (gchar *)node->data; |
| | 1849 | E2_DirHistoryEntry *hist_entry = g_hash_table_lookup (app.dir_history, dirpath); |
| | 1850 | if (hist_entry == NULL) |
| | 1851 | {//need a new entry for the history cache |
| | 1852 | hist_entry = ALLOCATE0 (E2_DirHistoryEntry); |
| | 1853 | CHECKALLOCATEDWARNT (hist_entry, ); |
| | 1854 | if (hist_entry != NULL) |
| | 1855 | { |
| | 1856 | g_strlcpy (hist_entry->path, dirpath, sizeof(hist_entry->path)); |
| | 1857 | hist_entry->selrow = -1; |
| | 1858 | #ifdef E2_VFSTMP |
| | 1859 | hist_entry->spacedata = view->spacedata; |
| | 1860 | #endif |
| | 1861 | g_hash_table_insert (app.dir_history, dirpath, hist_entry); |
| | 1862 | } |
| | 1863 | } |
| | 1864 | else |
| 1827 | | else |
| 1828 | | { |
| 1829 | | g_free (dirpath); |
| 1830 | | node->data = hist_entry; |
| 1831 | | } |
| 1832 | | } |
| 1833 | | } |
| 1834 | | history_name = g_strconcat (rt->name, "-current", NULL); |
| 1835 | | e2_cache_int_register (history_name, (gint*)&rt->opendir_cur, 0); |
| 1836 | | g_free (history_name); |
| 1837 | | if (rt->opendirs == NULL) |
| 1838 | | rt->opendir_cur = 0; |
| 1839 | | else if (startdir == NULL) |
| 1840 | | { |
| 1841 | | g_free (rt->path); |
| 1842 | | rt->path = g_strdup (g_list_nth_data (rt->opendirs, rt->opendir_cur)); |
| | 1870 | } |
| | 1871 | history_name = g_strconcat (rt->name, "-current", NULL); |
| | 1872 | e2_cache_int_register (history_name, (gint*)&rt->opendir_cur, 0); |
| | 1873 | g_free (history_name); |
| | 1874 | if (rt->opendirs == NULL) |
| | 1875 | rt->opendir_cur = 0; |
| | 1876 | else if (startdir == NULL) |
| | 1877 | { |
| | 1878 | g_free (rt->path); |
| | 1879 | rt->path = g_strdup (g_list_nth_data (rt->opendirs, rt->opendir_cur)); |
| | 1880 | } |
| 1994 | 2033 | {g_strconcat(_A(13),".",_A(49),NULL),_e2_pane_go_back, TRUE, E2_ACTION_TYPE_HOVER, 0, hdata1, NULL}, |
| 1995 | 2034 | {g_strconcat(_A(13),".",_A(50),NULL),_e2_pane_go_forward, TRUE, E2_ACTION_TYPE_HOVER, 0, hdata2, NULL}, |
| 2011 | | {g_strconcat(_A(5),".",_A(34),NULL),_e2_pane_clear_history, TRUE, E2_ACTION_TYPE_ITEM, 0, NULL, NULL}, |
| | 2050 | {g_strconcat(_A(5),".",_A(34),NULL),_e2_pane_clear_dirline_history, TRUE, E2_ACTION_TYPE_ITEM, 0, NULL, NULL}, |
| 2012 | 2051 | {g_strconcat(_A(7),".",_A(52),NULL),_e2_pane_focus_bottom, TRUE, E2_ACTION_TYPE_ITEM, 0, NULL, NULL}, |
| 2013 | 2052 | {g_strconcat(_A(7),".",_A(53),NULL),_e2_pane_focus_top, TRUE, E2_ACTION_TYPE_ITEM, 0, NULL, NULL}, |