Updated to 28.0.1

This commit is contained in:
Алзим 2018-08-31 15:04:35 +03:00
parent 5f01e77b26
commit 53ba98fc23
5 changed files with 10 additions and 5041 deletions

View file

@ -1,4 +1,3 @@
sources:
UXP-PM28.0.0_Release.tar.gz: 6f7ea85c8a193d7523806d99c2d6f6b18147e7a4
UXP-PM28.0.1_Release.tar.gz: 21667f2d2eff1cea95e085fc2aac90548da4bb81
firefox-dictionary-61.0.2.tar.bz2: 25929c585dc8568a32d5be49aacc672f0ed2202f
icons.tar.bz2: 625177825178215f8bb80f097fc3595daabece24

View file

@ -1,142 +0,0 @@
diff -urN mozilla-release.orig/browser/components/shell/nsKDEShellService.cpp mozilla-release/browser/components/shell/nsKDEShellService.cpp
--- mozilla-release.orig/browser/components/shell/nsKDEShellService.cpp 2014-08-04 17:37:32.064081427 +0400
+++ mozilla-release/browser/components/shell/nsKDEShellService.cpp 2014-08-04 17:42:22.108041230 +0400
@@ -17,6 +17,21 @@
#include "nsIMutableArray.h"
#include "nsISupportsPrimitives.h"
#include "nsArrayUtils.h"
+#include "nsIImageLoadingContent.h"
+#include "imgIRequest.h"
+#include "nsIStringBundle.h"
+#include "nsIDOMHTMLImageElement.h"
+#include "prenv.h"
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gtk/gtk.h>
+#include <gdk/gdk.h>
+#if defined(MOZ_WIDGET_GTK)
+#include "nsIImageToPixbuf.h"
+#endif
+#include <limits.h>
+#include <stdlib.h>
using namespace mozilla;
@@ -28,6 +43,29 @@
return NS_OK;
}
+static nsresult
+WriteImage(const nsCString& aPath, imgIContainer* aImage)
+{
+#if !defined(MOZ_WIDGET_GTK)
+ return NS_ERROR_NOT_AVAILABLE;
+#else
+ nsCOMPtr<nsIImageToPixbuf> imgToPixbuf =
+ do_GetService("@mozilla.org/widget/image-to-gdk-pixbuf;1");
+ if (!imgToPixbuf)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ GdkPixbuf* pixbuf = imgToPixbuf->ConvertImageToPixbuf(aImage);
+ if (!pixbuf)
+ return NS_ERROR_NOT_AVAILABLE;
+
+ gboolean res = gdk_pixbuf_save(pixbuf, aPath.get(), "png", nullptr, nullptr);
+
+ g_object_unref(pixbuf);
+ return res ? NS_OK : NS_ERROR_FAILURE;
+#endif
+}
+
+
NS_IMPL_ISUPPORTS(nsKDEShellService, nsIShellService)
NS_IMETHODIMP
@@ -123,19 +161,83 @@
nsKDEShellService::SetDesktopBackground(nsIDOMElement* aElement,
PRInt32 aPosition)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ nsresult rv;
+ nsCOMPtr<nsIImageLoadingContent> imageContent = do_QueryInterface(aElement, &rv);
+ if (!imageContent) return rv;
+
+ // get the image container
+ nsCOMPtr<imgIRequest> request;
+ rv = imageContent->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
+ getter_AddRefs(request));
+ if (!request) return rv;
+ nsCOMPtr<imgIContainer> container;
+ rv = request->GetImage(getter_AddRefs(container));
+ if (!container) return rv;
+
+ // Set desktop wallpaper filling style
+ nsAutoCString options;
+ if (aPosition == BACKGROUND_TILE)
+ options.Assign("TiledResize");
+ else if (aPosition == BACKGROUND_STRETCH)
+ options.Assign("ScaledResize");
+ else if (aPosition == BACKGROUND_FILL)
+ options.Assign("ScaledAndCroppedResize");
+ else if (aPosition == BACKGROUND_FIT)
+ options.Assign("MaxpectResize");
+ else
+ options.Assign("CenteredResize");
+
+ // Write the background file to the home directory.
+ nsAutoCString filePath(PR_GetEnv("HOME"));
+
+ // get the product brand name from localized strings
+ nsString brandName;
+ nsCID bundleCID = NS_STRINGBUNDLESERVICE_CID;
+ nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(bundleCID));
+ if (bundleService) {
+ nsCOMPtr<nsIStringBundle> brandBundle;
+ rv = bundleService->CreateBundle(BRAND_PROPERTIES,
+ getter_AddRefs(brandBundle));
+ if (NS_SUCCEEDED(rv) && brandBundle) {
+ rv = brandBundle->GetStringFromName(NS_LITERAL_STRING("brandShortName").get(),
+ getter_Copies(brandName));
+ NS_ENSURE_SUCCESS(rv, rv);
+ }
+ }
+
+ // build the file name
+ filePath.Append('/');
+ filePath.Append(NS_ConvertUTF16toUTF8(brandName));
+ filePath.Append("_wallpaper.png");
+
+ // write the image to a file in the home dir
+ rv = WriteImage(filePath, container);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ nsCOMPtr<nsIMutableArray> command = do_CreateInstance( NS_ARRAY_CONTRACTID );
+ nsCOMPtr<nsISupportsCString> cmdstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr<nsISupportsCString> imgstr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ nsCOMPtr<nsISupportsCString> modestr = do_CreateInstance( NS_SUPPORTS_CSTRING_CONTRACTID );
+ cmdstr->SetData( NS_LITERAL_CSTRING( "SETWALLPAPER" ));
+ command->AppendElement( cmdstr, false );
+ imgstr->SetData( filePath );
+ command->AppendElement( imgstr, false );
+ modestr->SetData( options );
+ command->AppendElement( modestr, false );
+ return nsKDEUtils::command( command ) ? rv : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ aColor = 0;
+ return NS_OK;
}
NS_IMETHODIMP
nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
{
- return NS_ERROR_NOT_IMPLEMENTED;
+ return NS_OK;
}
NS_IMETHODIMP

View file

@ -17,21 +17,20 @@
Summary: Web browser based on Goanna engine
Name: newmoon
Version: 28.0.0
Release: 2
Version: 28.0.1
Release: 1
License: MPLv2.0
Group: Networking/WWW
Url: http://www.palemoon.org
Source0: https://github.com/MoonchildProductions/UXP/archive/%{oname}%{version}_Release.tar.gz?/UXP-%{oname}%{version}_Release.tar.gz
Source2: icons.tar.bz2
Source1: xulstore.json
Source1: newmoon.rpmlintrc
Source2: xulstore.json
Source4: %{name}.desktop
Source5: firefox-searchengines-yandex.xml
Source6: firefox-searchengines-google.xml
Source9: kde.js
# https://www.mozilla.org/en-US/firefox/all/
Source10: firefox-dictionary-61.0.2.tar.bz2
Source100: newmoon.rpmlintrc
Patch6: palemoon-27.4.0-enable-addons.patch
Patch7: palemoon-27.4.0-user-agent-overrides.patch
@ -110,8 +109,7 @@ themes to make the browser truly your own.
%{_bindir}/%{name}
%{_iconsdir}/hicolor/*/apps/*.png
%{_datadir}/applications/*.desktop
%{_datadir}/dict/mozilla/browser/branding/unofficial/*
%{_libdir}/%{name}-%{version}*
%{mozillalibdir}*
%dir %{_libdir}/mozilla
%dir %{_libdir}/mozilla/extensions
%dir %{_libdir}/mozilla/extensions/%{newmoon_appid}
@ -134,7 +132,6 @@ Files and macros mainly for building New Moon extensions.
%prep
%setup -qn UXP-%{oname}%{version}_Release
tar xf %{SOURCE2}
%patch6 -p1 -b .addons
%patch7 -p1 -b .ua
@ -226,7 +223,7 @@ install -m 644 %{SOURCE4} %{buildroot}%{_datadir}/applications/%{name}.desktop
# (tpg) icons
for i in 16 22 24 32 48 128; do
# (cg) Not all icon sizes are installed with make install, so just redo it here.
convert browser/branding/unofficial/mozicon128.png -scale ${i}x${i} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default${i}.png
convert %{_builddir}/obj/dist/palemoon/browser/icons/mozicon128.png -scale ${i}x${i} %{buildroot}%{mozillalibdir}/browser/chrome/icons/default/default${i}.png
mkdir -p %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps
ln -sf %{mozillalibdir}/browser/chrome/icons/default/default$i.png %{buildroot}%{_iconsdir}/hicolor/"$i"x"$i"/apps/%{name}.png ;
done
@ -261,7 +258,7 @@ pref("network.manage-offline-status", true);
pref("startup.homepage_welcome_url", "file:///usr/share/branding-configs/fresh/first_startup.html");
EOF
install -m644 %{SOURCE1} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/xulstore.json
install -m644 %{SOURCE2} %{buildroot}%{mozillalibdir}/browser/defaults/preferences/xulstore.json
# display icon for New Moon button
#mkdir -p %{buildroot}%{mozillalibdir}/browser/defaults/preferences/chrome
@ -277,9 +274,8 @@ rm -fr %{buildroot}%{mozillalibdir}/dictionaries
ln -s %{_datadir}/dict/mozilla/ %{buildroot}%{mozillalibdir}/dictionaries
%else
rm -fr %{buildroot}%{mozillalibdir}/dictionaries
mkdir -p %{buildroot}%{_datadir}/dict/mozilla
tar xjf %{SOURCE10} -C %{buildroot}%{_datadir}/dict/mozilla/
ln -s %{_datadir}/dict/mozilla/ %{buildroot}%{mozillalibdir}/dictionaries
mkdir -p %{buildroot}%{mozillalibdir}/dictionaries
tar xjf %{SOURCE10} -C %{buildroot}%{mozillalibdir}/dictionaries
%endif
# (lm) touch and %%ghost bookmarks.html to a proper uninstall

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff