X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-navigation-action.c;h=b34c37892b781ff12573546366c854665cd28af7;hb=223cc03e0275c77c4482ed0495b3bd15993a3ab8;hp=9da89f993c10149f9248799ecdecc8cbb51ef35a;hpb=33bf66b8f4e2d719c847af1c177c71b5173b49aa;p=evince.git diff --git a/shell/ev-navigation-action.c b/shell/ev-navigation-action.c index 9da89f99..b34c3789 100644 --- a/shell/ev-navigation-action.c +++ b/shell/ev-navigation-action.c @@ -14,23 +14,18 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ #include "config.h" +#include +#include + #include "ev-navigation-action.h" #include "ev-navigation-action-widget.h" -#include -#include -#include -#include -#include -#include -#include -#include enum { @@ -60,9 +55,8 @@ ev_navigation_action_history_changed (EvHistory *history, { EvNavigationAction *action = EV_NAVIGATION_ACTION (data); - gtk_action_set_sensitive (action, ev_history_get_n_links (history) > 0); - - return; + gtk_action_set_sensitive (GTK_ACTION (action), + ev_history_get_n_links (history) > 0); } void @@ -75,7 +69,7 @@ ev_navigation_action_set_history (EvNavigationAction *action, (gpointer) &action->priv->history); g_signal_connect_object (history, "changed", - ev_navigation_action_history_changed, + G_CALLBACK (ev_navigation_action_history_changed), action, 0); } @@ -108,11 +102,11 @@ new_history_menu_item (EvNavigationAction *action, title = ev_link_get_title (link); item = gtk_image_menu_item_new_with_label (title); - gtk_label_set_use_markup (GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))), TRUE); + label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item))); + gtk_label_set_use_markup (label, TRUE); g_object_set_data (G_OBJECT (item), "index", GINT_TO_POINTER (index)); - label = GTK_LABEL (GTK_BIN (item)->child); gtk_label_set_ellipsize (label, PANGO_ELLIPSIZE_END); gtk_label_set_max_width_chars (label, MAX_LABEL_LENGTH); @@ -134,12 +128,12 @@ build_menu (EvNavigationAction *action) EvHistory *history = action->priv->history; int start, end, i; - menu = GTK_MENU_SHELL (gtk_menu_new ()); - - if (history == NULL) { - return GTK_WIDGET (menu); + if (history == NULL || ev_history_get_n_links (history) <= 0) { + return NULL; } + menu = GTK_MENU_SHELL (gtk_menu_new ()); + start = 0; end = ev_history_get_n_links (history);