source:
pkg/viola/main/nautilus/trunk/debian/patches/10_location_titlebar.patch
@
3516
| Revision 3516, 7.2 KB checked in by alanbach-guest, 5 years ago (diff) |
|---|
-
libnautilus-private/apps_nautilus_preferences.schemas.in
Debian #413018 GNOME #142087 Option to show the full location in the title bar
old new 720 720 </locale> 721 721 </schema> 722 722 723 <schema> 724 <key>/schemas/apps/nautilus/preferences/location_in_title_bar</key> 725 <applyto>/apps/nautilus/preferences/location_in_title_bar</applyto> 726 <owner>nautilus</owner> 727 <type>bool</type> 728 <default>false</default> 729 <locale name="C"> 730 <short>Show current location in title bar</short> 731 <long> 732 If set to true, windows will have the full location displayed 733 in their title bar. Otherwise it will only show the folder name. 734 </long> 735 </locale> 736 </schema> 737 723 738 <schema> 724 739 <key>/schemas/apps/nautilus/preferences/start_with_sidebar</key> 725 740 <applyto>/apps/nautilus/preferences/start_with_sidebar</applyto> -
libnautilus-private/nautilus-global-preferences.c
old new 378 378 PREFERENCE_BOOLEAN, 379 379 GINT_TO_POINTER (TRUE) 380 380 }, 381 { NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR, 382 PREFERENCE_BOOLEAN, 383 GINT_TO_POINTER (TRUE) 384 }, 381 385 { NAUTILUS_PREFERENCES_START_WITH_SIDEBAR, 382 386 PREFERENCE_BOOLEAN, 383 387 GINT_TO_POINTER (TRUE) -
libnautilus-private/nautilus-global-preferences.h
old new 84 84 #define NAUTILUS_PREFERENCES_START_WITH_LOCATION_BAR "preferences/start_with_location_bar" 85 85 #define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY "preferences/always_use_location_entry" 86 86 #define NAUTILUS_PREFERENCES_START_WITH_STATUS_BAR "preferences/start_with_status_bar" 87 #define NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR "preferences/location_in_title_bar" 87 88 #define NAUTILUS_PREFERENCES_START_WITH_SIDEBAR "preferences/start_with_sidebar" 88 89 #define NAUTILUS_PREFERENCES_START_WITH_TOOLBAR "preferences/start_with_toolbar" 89 90 #define NAUTILUS_PREFERENCES_SIDE_PANE_VIEW "preferences/side_pane_view" -
src/nautilus-navigation-window.c
old new 914 914 static gboolean 915 915 real_set_title (NautilusWindow *window, const char *title) 916 916 { 917 char *full_title;918 char *window_title;919 917 gboolean changed; 920 918 921 919 changed = EEL_CALL_PARENT_WITH_RETURN_VALUE 922 920 (NAUTILUS_WINDOW_CLASS, set_title, (window, title)); 923 921 924 922 if (changed) { 925 full_title = g_strdup_printf (_("%s - File Browser"), title); 923 char *full_title; 924 char *window_title; 925 char *location_titlebar; 926 927 location_titlebar = nautilus_window_set_location_in_titlebar (window, title); 928 929 full_title = g_strdup_printf (_("%s - File Browser"), location_titlebar); 926 930 927 931 window_title = eel_str_middle_truncate (full_title, MAX_TITLE_LENGTH); 928 932 gtk_window_set_title (GTK_WINDOW (window), window_title); 929 933 g_free (window_title); 930 934 g_free (full_title); 935 g_free (location_titlebar); 931 936 } 932 937 933 938 return changed; -
src/nautilus-spatial-window.c
old new 430 430 gtk_window_set_title (GTK_WINDOW (window), _("Nautilus")); 431 431 } else if (changed) { 432 432 char *window_title; 433 char *location_titlebar; 433 434 434 window_title = eel_str_middle_truncate (title, MAX_TITLE_LENGTH); 435 location_titlebar = nautilus_window_set_location_in_titlebar (window, title); 436 437 window_title = eel_str_middle_truncate (location_titlebar, MAX_TITLE_LENGTH); 435 438 gtk_window_set_title (GTK_WINDOW (window), window_title); 436 439 g_free (window_title); 440 g_free (location_titlebar); 437 441 } 438 442 439 443 return changed; -
nautilus-2.22.0/src/nautilus-window.c
old new 1709 1709 { 1710 1710 return (nautilus_window_get_window_type (window) != NAUTILUS_WINDOW_DESKTOP); 1711 1711 } 1712 1713 char * 1714 nautilus_window_set_location_in_titlebar (NautilusWindow *window, const char *title) 1715 { 1716 char *location_title; 1717 GFile *uri = NULL; 1718 char *location = NULL; 1719 const char *path; 1720 const char *scheme = NULL; 1721 const char *display_location; 1722 const char *tmp_location; 1723 const char *location_prefix; 1724 int tmp_location_len; 1725 int tilde = 0; 1726 1727 location_title = g_strdup (title); 1728 1729 if (eel_preferences_get_boolean (NAUTILUS_PREFERENCES_LOCATION_IN_TITLE_BAR) != TRUE 1730 || (uri = nautilus_window_get_location (window)) == NULL 1731 || (location = g_file_get_parse_name (uri)) == NULL 1732 || location[0] == 0 1733 || location[1] == 0) 1734 goto done; 1735 1736 if ((tmp_location = g_get_home_dir()) == NULL) { 1737 display_location = location; 1738 goto construct_title; 1739 } 1740 1741 if (strcmp (location, tmp_location) == 0) { 1742 tilde = 1; 1743 display_location = ""; 1744 goto construct_title; 1745 } 1746 1747 tmp_location_len = strlen (tmp_location); 1748 if (eel_str_has_prefix (location, tmp_location) == FALSE 1749 || location[tmp_location_len] != G_DIR_SEPARATOR) { 1750 display_location = location; 1751 goto construct_title; 1752 } 1753 1754 tilde = 1; 1755 display_location = location + tmp_location_len; 1756 1757 construct_title: 1758 1759 g_free (location_title); 1760 1761 if(scheme != NULL) 1762 location_prefix = scheme; 1763 else if(tilde == 1) 1764 location_prefix = "~"; 1765 else 1766 location_prefix = ""; 1767 1768 location_title = g_strdup_printf ("%s (%s%s%s)", title, location_prefix, scheme != NULL ? " - " : "", display_location); 1769 1770 done: 1771 if (uri != NULL) 1772 g_object_unref (uri); 1773 1774 if (location != NULL) 1775 g_free (location); 1776 1777 return (location_title); 1778 } 1779 -
nautilus-2.22.0/src/nautilus-window.h
old new 152 152 void nautilus_window_add_extra_location_widget (NautilusWindow *window, 153 153 GtkWidget *widget); 154 154 gboolean nautilus_window_has_menubar_and_statusbar (NautilusWindow *window); 155 char * nautilus_window_set_location_in_titlebar (NautilusWindow *window, 156 const char *title); 155 157 156 158 #endif
Note: See TracBrowser
for help on using the repository browser.


