# HG changeset patch # User Aleksej Bobylev # Date 1477962940 -7200 # Node ID 41fccfd3180c83707fdcb016a310d263d813633c # Parent f0167c6f681ac1339a97383b2f3734cd59db418b epdfview: don't use custom icons diff -r f0167c6f681a -r 41fccfd3180c epdfview-cups/receipt --- a/epdfview-cups/receipt Tue Nov 01 02:58:15 2016 +0200 +++ b/epdfview-cups/receipt Tue Nov 01 03:15:40 2016 +0200 @@ -28,24 +28,19 @@ -e 's/location->values\[0\].string.text/ippGetString(location, 0, NULL)/' \ -e 's/.*IPP_TAG_KEYWORD.*/ ipp_t *request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);\n&/' \ src/PrintPter.cxx + patch -p1 -i $stuff/no-stock-icons.patch ./configure \ --with-cups \ $CONFIGURE_ARGS && make && make install + cp -f $stuff/*.desktop $install/usr/share/applications } # Rules to gen a SliTaz package suitable for Tazpkg. genpkg_rules() { - mkdir -p $fs/usr/share/pixmaps - cp -a $install/usr/bin $fs/usr - cp -a $install/usr/share/epdfview $fs/usr/share - cd $fs/usr/share/pixmaps - ln -sf /usr/share/epdfview/pixmaps/icon_epdfview-32.png epdfview.png + cook_copy_files epdfview *.desktop *.xml + mkdir -p $fs/usr/share/icons/hicolor/48x48/apps + cp $install/usr/share/epdfview/pixmaps/icon_epdfview-48.png \ + $fs/usr/share/icons/hicolor/48x48/apps/epdfview.png } - -# Pre install commands for Tazpkg. -pre_install() -{ - [ -x "$1/usr/bin/epdfview" ] && yes y | tazpkg remove epdfview -} diff -r f0167c6f681a -r 41fccfd3180c epdfview-cups/stuff/no-stock-icons.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epdfview-cups/stuff/no-stock-icons.patch Tue Nov 01 03:15:40 2016 +0200 @@ -0,0 +1,192 @@ +--- a/src/gtk/FindView.cxx ++++ b/srv/gtk/FindView.cxx +@@ -50,7 +50,7 @@ + gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ); + + // The "Close" button. +- m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); ++ m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close")); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1); + + // The text to find entry. +@@ -65,13 +65,13 @@ + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1); + + // The "Find Next" button. +- m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT); ++ m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next")); + gtk_tool_item_set_is_important (m_FindNext, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1); + + // The "Find Previous" button. + m_FindPrevious = +- gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS); ++ gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous")); + gtk_tool_item_set_is_important (m_FindPrevious, TRUE); + gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1); + +--- a/src/gtk/MainView.cxx ++++ b/src/gtk/MainView.cxx +@@ -92,80 +92,80 @@ + { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL }, + { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL }, + +- { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "O", ++ { "OpenFile", "document-open", N_("_Open"), "O", + N_("Open a PDF document"), + G_CALLBACK (main_window_open_file_cb) }, + +- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", ++ { "ReloadFile", "view-refresh", N_("_Reload"), "R", + N_("Reload the current document"), + G_CALLBACK (main_window_reload_cb) }, + +- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", ++ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", + N_("Save a copy of the current document"), + G_CALLBACK (main_window_save_file_cb) }, + + #if defined (HAVE_CUPS) +- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", ++ { "Print", "document-print", N_("_Print..."), "P", + N_("Print the current document"), + G_CALLBACK (main_window_print_cb) }, + #endif // HAVE_CUPS + +- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", ++ { "Quit", "window-close", N_("_Close"), "W", + N_("Close this window"), + G_CALLBACK (main_window_quit_cb) }, + +- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", ++ { "Find", "edit-find", N_("_Find"), "F", + N_("Find a word in the document"), + G_CALLBACK (main_window_find_cb) }, + +- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, ++ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, + N_("Change the application's preferences"), + G_CALLBACK (main_window_preferences_cb) }, + +- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", ++ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", + N_("Enlarge the document"), + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", ++ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", + N_("Shrink the document"), + G_CALLBACK (main_window_zoom_out_cb) }, + +- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", ++ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", + N_("Rotate the document 90 degrees clockwise"), + G_CALLBACK (main_window_rotate_right_cb) }, + +- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", ++ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", + N_("Rotate the document 90 degrees counter-clockwise"), + G_CALLBACK (main_window_rotate_left_cb) }, + +- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", ++ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", + N_("Go to the first page"), + G_CALLBACK (main_window_go_to_first_page_cb) }, + +- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", ++ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", + N_("Go to the next page"), + G_CALLBACK (main_window_go_to_next_page_cb) }, + +- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", ++ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", + N_("Go to the previous page"), + G_CALLBACK (main_window_go_to_previous_page_cb) }, + +- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", ++ { "GoToLastPage", "go-last", N_("_Last Page"), "End", + N_("Go to the last page"), + G_CALLBACK (main_window_go_to_last_page_cb) }, + +- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, ++ { "About", "help-about", N_("_About"), NULL, + N_("Display application's credits"), + G_CALLBACK (main_window_about_box_cb) }, + + // Accelerator keys. +- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, ++ { "Slash", "edit-find", NULL, "slash", NULL, + G_CALLBACK (main_window_find_cb) }, + +- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, ++ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", ++ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", + NULL, + G_CALLBACK (main_window_zoom_out_cb) } + }; +@@ -188,21 +188,21 @@ + N_("Show or hide the document's outline"), + G_CALLBACK (main_window_show_index_cb), FALSE }, + +- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, ++ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, + N_("Make the current document fill the window"), + G_CALLBACK (main_window_zoom_fit_cb), FALSE }, + +- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, ++ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, + N_("Make the current document fill the window width"), + G_CALLBACK (main_window_zoom_width_cb), FALSE }, + }; + + static GtkRadioActionEntry g_PageScrollEntries[] = + { +- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, ++ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, + N_("Mouse scroll page"), (int)PagePterModeScroll }, + +- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, ++ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, + N_(" Mouse select text"), (int)PagePterModeSelectText }, + }; + +@@ -1031,35 +1031,7 @@ + void + MainView::setMainWindowIcon () + { +- const gchar *iconFiles[] = +- { +- "icon_epdfview-48.png", +- "icon_epdfview-32.png", +- "icon_epdfview-24.png", +- }; +- +- GList *iconList = NULL; +- int iconFilesNum = G_N_ELEMENTS (iconFiles); +- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) +- { +- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", +- iconFiles[iconIndex], NULL); +- GError *error = NULL; +- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); +- if ( NULL != iconPixbuf ) +- { +- iconList = g_list_prepend (iconList, iconPixbuf); +- } +- else +- { +- g_warning ("Error loading icon: %s\n", error->message); +- g_error_free (error); +- } +- g_free (filename); +- } +- gtk_window_set_default_icon_list (iconList); +- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); +- g_list_free (iconList); ++ gtk_window_set_default_icon_name ("epdfview"); + } + + /// diff -r f0167c6f681a -r 41fccfd3180c epdfview/receipt --- a/epdfview/receipt Tue Nov 01 02:58:15 2016 +0200 +++ b/epdfview/receipt Tue Nov 01 03:15:40 2016 +0200 @@ -23,18 +23,19 @@ src/epdfview.h find . -name '*.[ch]*' | xargs sed -i 's|O", ++ { "OpenFile", "document-open", N_("_Open"), "O", + N_("Open a PDF document"), + G_CALLBACK (main_window_open_file_cb) }, + +- { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "R", ++ { "ReloadFile", "view-refresh", N_("_Reload"), "R", + N_("Reload the current document"), + G_CALLBACK (main_window_reload_cb) }, + +- { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "S", ++ { "SaveFile", "document-save", N_("_Save a Copy..."), "S", + N_("Save a copy of the current document"), + G_CALLBACK (main_window_save_file_cb) }, + + #if defined (HAVE_CUPS) +- { "Print", GTK_STOCK_PRINT, N_("_Print..."), "P", ++ { "Print", "document-print", N_("_Print..."), "P", + N_("Print the current document"), + G_CALLBACK (main_window_print_cb) }, + #endif // HAVE_CUPS + +- { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "W", ++ { "Quit", "window-close", N_("_Close"), "W", + N_("Close this window"), + G_CALLBACK (main_window_quit_cb) }, + +- { "Find", GTK_STOCK_FIND, N_("_Find"), "F", ++ { "Find", "edit-find", N_("_Find"), "F", + N_("Find a word in the document"), + G_CALLBACK (main_window_find_cb) }, + +- { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL, ++ { "Preferences", "preferences-system", N_("_Preferences..."), NULL, + N_("Change the application's preferences"), + G_CALLBACK (main_window_preferences_cb) }, + +- { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "plus", ++ { "ZoomIn", "zoom-in", N_("Zoom _In"), "plus", + N_("Enlarge the document"), + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "minus", ++ { "ZoomOut", "zoom-out", N_("Zoom _Out"), "minus", + N_("Shrink the document"), + G_CALLBACK (main_window_zoom_out_cb) }, + +- { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "bracketright", ++ { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "bracketright", + N_("Rotate the document 90 degrees clockwise"), + G_CALLBACK (main_window_rotate_right_cb) }, + +- { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "bracketleft", ++ { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "bracketleft", + N_("Rotate the document 90 degrees counter-clockwise"), + G_CALLBACK (main_window_rotate_left_cb) }, + +- { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "Home", ++ { "GoToFirstPage", "go-first", N_("_First Page"), "Home", + N_("Go to the first page"), + G_CALLBACK (main_window_go_to_first_page_cb) }, + +- { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down", ++ { "GoToNextPage", "go-next", N_("_Next Page"), "Page_Down", + N_("Go to the next page"), + G_CALLBACK (main_window_go_to_next_page_cb) }, + +- { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up", ++ { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "Page_Up", + N_("Go to the previous page"), + G_CALLBACK (main_window_go_to_previous_page_cb) }, + +- { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "End", ++ { "GoToLastPage", "go-last", N_("_Last Page"), "End", + N_("Go to the last page"), + G_CALLBACK (main_window_go_to_last_page_cb) }, + +- { "About", GTK_STOCK_ABOUT, N_("_About"), NULL, ++ { "About", "help-about", N_("_About"), NULL, + N_("Display application's credits"), + G_CALLBACK (main_window_about_box_cb) }, + + // Accelerator keys. +- { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL, ++ { "Slash", "edit-find", NULL, "slash", NULL, + G_CALLBACK (main_window_find_cb) }, + +- { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "KP_Add", NULL, ++ { "KPAdd", "zoom-in", NULL, "KP_Add", NULL, + G_CALLBACK (main_window_zoom_in_cb) }, + +- { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "KP_Subtract", ++ { "KPSubtract", "zoom-out", NULL, "KP_Subtract", + NULL, + G_CALLBACK (main_window_zoom_out_cb) } + }; +@@ -188,21 +188,21 @@ + N_("Show or hide the document's outline"), + G_CALLBACK (main_window_show_index_cb), FALSE }, + +- { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, ++ { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL, + N_("Make the current document fill the window"), + G_CALLBACK (main_window_zoom_fit_cb), FALSE }, + +- { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, ++ { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL, + N_("Make the current document fill the window width"), + G_CALLBACK (main_window_zoom_width_cb), FALSE }, + }; + + static GtkRadioActionEntry g_PageScrollEntries[] = + { +- { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, ++ { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL, + N_("Mouse scroll page"), (int)PagePterModeScroll }, + +- { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, ++ { "PageModeText", "edit-select-all", N_("Select Text"), NULL, + N_(" Mouse select text"), (int)PagePterModeSelectText }, + }; + +@@ -1031,35 +1031,7 @@ + void + MainView::setMainWindowIcon () + { +- const gchar *iconFiles[] = +- { +- "icon_epdfview-48.png", +- "icon_epdfview-32.png", +- "icon_epdfview-24.png", +- }; +- +- GList *iconList = NULL; +- int iconFilesNum = G_N_ELEMENTS (iconFiles); +- for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ ) +- { +- gchar *filename = g_strconcat (DATADIR, "/pixmaps/", +- iconFiles[iconIndex], NULL); +- GError *error = NULL; +- GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error); +- if ( NULL != iconPixbuf ) +- { +- iconList = g_list_prepend (iconList, iconPixbuf); +- } +- else +- { +- g_warning ("Error loading icon: %s\n", error->message); +- g_error_free (error); +- } +- g_free (filename); +- } +- gtk_window_set_default_icon_list (iconList); +- g_list_foreach (iconList, (GFunc)g_object_unref, NULL); +- g_list_free (iconList); ++ gtk_window_set_default_icon_name ("epdfview"); + } + + ///