cinnamon-desktop
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Licensed under the GNU General Public License, version 3.
|
||||
# See the file http://www.gnu.org/copyleft/gpl.txt
|
||||
|
||||
from pisi.actionsapi import shelltools
|
||||
from pisi.actionsapi import pisitools
|
||||
|
||||
def install():
|
||||
shelltools.system("./makepot")
|
||||
pisitools.insinto("/usr/", "usr/*")
|
||||
#pisitools.insinto("/usr/bin/", "usr/bin/*")
|
||||
#pisitools.insinto("/usr/lib/linuxmint/mintlocale/", "usr/lib/linuxmint/mintlocale/*.py")
|
||||
#pisitools.insinto("/usr/lib/linuxmint/mintlocale/ImConfig/", "usr/lib/linuxmint/mintlocale/ImConfig/*.py")
|
||||
#pisitools.insinto("/usr/share/applications/", "usr/share/applications/*")
|
||||
#pisitools.insinto("/usr/share/icons/hicolor", "usr/share/icons/hicolor/*")
|
||||
#pisitools.insinto("/usr/share/linuxmint/adjustments/", "usr/share/linuxmint/adjustments/*")
|
||||
#pisitools.insinto("/usr/share/linuxmint/mintlocale/", "usr/share/linuxmint/mintlocale/*")
|
||||
#pisitools.insinto("/usr/share/polkit-1/actions/", "usr/share/polkit-1/actions/*")
|
||||
@@ -0,0 +1,159 @@
|
||||
From 451de58797ef3e270314d07da7170065d787e3e1 Mon Sep 17 00:00:00 2001
|
||||
From: Sam Burgos <sam.burgos1089@gmail.com>
|
||||
Date: Tue, 15 May 2018 16:04:11 -0600
|
||||
Subject: [PATCH] added checking of APT so application can show proper
|
||||
configuration
|
||||
|
||||
---
|
||||
usr/lib/linuxmint/mintlocale/install_remove.py | 53 ++++++++++++++++----------
|
||||
usr/lib/linuxmint/mintlocale/mintlocale.py | 20 +++++-----
|
||||
2 files changed, 43 insertions(+), 30 deletions(-)
|
||||
|
||||
diff --git a/usr/lib/linuxmint/mintlocale/install_remove.py b/usr/lib/linuxmint/mintlocale/install_remove.py
|
||||
index 205bd5b..00e2e2d 100755
|
||||
--- a/usr/lib/linuxmint/mintlocale/install_remove.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/install_remove.py
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
import os
|
||||
import gettext
|
||||
-import apt_pkg
|
||||
import subprocess
|
||||
import tempfile
|
||||
import locale
|
||||
import codecs
|
||||
-import mintcommon
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
@@ -15,6 +13,13 @@
|
||||
from gi.repository import GdkX11
|
||||
from gi.repository import Gtk, GdkPixbuf, XApp
|
||||
|
||||
+# Used to detect Debian derivatives (we don't want to show APT features in other distros)
|
||||
+IS_DEBIAN = os.path.exists("/etc/debian_version")
|
||||
+
|
||||
+if IS_DEBIAN:
|
||||
+ import apt_pkg
|
||||
+ import mintcommon
|
||||
+
|
||||
# i18n
|
||||
APP = 'mintlocale'
|
||||
LOCALE_DIR = "/usr/share/linuxmint/locale"
|
||||
@@ -98,7 +103,9 @@ def __init__(self):
|
||||
|
||||
self.build_lang_list()
|
||||
|
||||
- self.apt = mintcommon.APT(self.window)
|
||||
+
|
||||
+ if IS_DEBIAN:
|
||||
+ self.apt = mintcommon.APT(self.window)
|
||||
|
||||
def split_locale(self, locale_code):
|
||||
if "_" in locale_code:
|
||||
@@ -244,22 +251,25 @@ def select_language(self, treeview, data=None):
|
||||
|
||||
def button_install_clicked(self, button):
|
||||
if self.selected_language_packs is not None:
|
||||
- if self.cache_updated:
|
||||
- self.apt.set_finished_callback(self.on_install_finished)
|
||||
- self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
- self.apt.install_packages(self.selected_language_packs)
|
||||
- else:
|
||||
- self.apt.set_finished_callback(self.on_update_finished)
|
||||
- self.apt.update_cache()
|
||||
-
|
||||
- def on_update_finished(self, transaction=None, exit_state=None):
|
||||
- self.cache_updated = True
|
||||
- self.apt.set_finished_callback(self.on_install_finished)
|
||||
- self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
- self.apt.install_packages(self.selected_language_packs)
|
||||
-
|
||||
- def on_install_finished(self, transaction=None, exit_state=None):
|
||||
- self.build_lang_list()
|
||||
+ if IS_DEBIAN:
|
||||
+ if self.cache_updated:
|
||||
+ self.apt.set_finished_callback(self.on_install_finished)
|
||||
+ self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
+ self.apt.install_packages(self.selected_language_packs)
|
||||
+ else:
|
||||
+ self.apt.set_finished_callback(self.on_update_finished)
|
||||
+ self.apt.update_cache()
|
||||
+
|
||||
+ if IS_DEBIAN:
|
||||
+ def on_update_finished(self, transaction=None, exit_state=None):
|
||||
+ self.cache_updated = True
|
||||
+ self.apt.set_finished_callback(self.on_install_finished)
|
||||
+ self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
+ self.apt.install_packages(self.selected_language_packs)
|
||||
+
|
||||
+ if IS_DEBIAN:
|
||||
+ def on_install_finished(self, transaction=None, exit_state=None):
|
||||
+ self.build_lang_list()
|
||||
|
||||
def button_add_clicked(self, button):
|
||||
os.system("/usr/lib/linuxmint/mintlocale/add.py")
|
||||
@@ -284,8 +294,9 @@ def button_remove_clicked(self, button):
|
||||
print(pkgname)
|
||||
|
||||
if len(installed_packs) > 0:
|
||||
- self.apt.set_finished_callback(self.on_install_finished)
|
||||
- self.apt.remove_packages(installed_packs)
|
||||
+ if IS_DEBIAN:
|
||||
+ self.apt.set_finished_callback(self.on_install_finished)
|
||||
+ self.apt.remove_packages(installed_packs)
|
||||
|
||||
self.build_lang_list()
|
||||
|
||||
diff --git a/usr/lib/linuxmint/mintlocale/mintlocale.py b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
index cd75f75..87e0c47 100755
|
||||
--- a/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
@@ -8,7 +8,6 @@
|
||||
import tempfile
|
||||
import subprocess
|
||||
import codecs
|
||||
-import mintcommon
|
||||
|
||||
try:
|
||||
import _thread as thread
|
||||
@@ -33,6 +32,7 @@
|
||||
|
||||
if IS_DEBIAN:
|
||||
import apt
|
||||
+ import mintcommon
|
||||
|
||||
# i18n
|
||||
APP = 'mintlocale'
|
||||
@@ -64,7 +64,8 @@ def __init__(self, codename, name, methods, app):
|
||||
self.app = app
|
||||
self.packages = []
|
||||
self.missing_packages = []
|
||||
- self.apt = mintcommon.APT(self.app.window)
|
||||
+ if IS_DEBIAN:
|
||||
+ self.apt = mintcommon.APT(self.app.window)
|
||||
|
||||
self.label = Gtk.Label()
|
||||
self.label.set_markup(name)
|
||||
@@ -107,13 +108,14 @@ def __init__(self, codename, name, methods, app):
|
||||
def install(self, widget):
|
||||
if len(self.missing_packages) > 0:
|
||||
self.app.lock_input_methods()
|
||||
- if self.app.cache_updated:
|
||||
- self.apt.set_finished_callback(self.on_install_finished)
|
||||
- self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
- self.apt.install_packages(self.missing_packages)
|
||||
- else:
|
||||
- self.apt.set_finished_callback(self.on_update_finished)
|
||||
- self.apt.update_cache()
|
||||
+ if IS_DEBIAN:
|
||||
+ if self.app.cache_updated:
|
||||
+ self.apt.set_finished_callback(self.on_install_finished)
|
||||
+ self.apt.set_cancelled_callback(self.on_install_finished)
|
||||
+ self.apt.install_packages(self.missing_packages)
|
||||
+ else:
|
||||
+ self.apt.set_finished_callback(self.on_update_finished)
|
||||
+ self.apt.update_cache()
|
||||
|
||||
def on_update_finished(self, transaction=None, exit_state=None):
|
||||
self.app.cache_updated = True
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
@@ -21,6 +21,7 @@ except ImportError as err:
|
||||
import ConfigParser as configparser
|
||||
|
||||
import gi
|
||||
+gi.require_version('GdkX11', '3.0')
|
||||
gi.require_version('Gtk', '3.0')
|
||||
gi.require_version('AccountsService', '1.0')
|
||||
from gi.repository import GdkX11
|
||||
@@ -0,0 +1,22 @@
|
||||
From 7041982b69fa9fea065098e7b33f306df1dcac91 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Webster <miketwebster@gmail.com>
|
||||
Date: Tue, 14 Jan 2020 16:51:20 -0500
|
||||
Subject: [PATCH] mintlocale.py: Fix signal name typo.
|
||||
|
||||
---
|
||||
usr/lib/linuxmint/mintlocale/mintlocale.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usr/lib/linuxmint/mintlocale/mintlocale.py b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
index e7db8e4..d145073 100755
|
||||
--- a/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
@@ -430,7 +430,7 @@ def __init__(self):
|
||||
|
||||
self.accountService = AccountsService.UserManager.get_default().get_user(current_user)
|
||||
self.accountService.connect('notify::is-loaded', self.accountservice_ready)
|
||||
- self.accountService.connect('changed::', self.accountservice_changed)
|
||||
+ self.accountService.connect('changed', self.accountservice_changed)
|
||||
|
||||
groups = grp.getgrall()
|
||||
for group in groups:
|
||||
@@ -0,0 +1,37 @@
|
||||
--- a/usr/lib/linuxmint/mintlocale/im.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/im.py
|
||||
@@ -1,10 +1,8 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
-import apt
|
||||
import codecs
|
||||
import gettext
|
||||
import locale
|
||||
-import mintcommon.aptdaemon
|
||||
import os
|
||||
|
||||
try:
|
||||
@@ -19,6 +17,13 @@
|
||||
from gi.repository import Gtk, GObject, Gdk, XApp
|
||||
|
||||
from ImConfig.ImConfig import ImConfig
|
||||
+
|
||||
+# Used to detect Debian derivatives (we don't want to show APT features in other distros)
|
||||
+IS_DEBIAN = os.path.exists("/etc/debian_version")
|
||||
+
|
||||
+if IS_DEBIAN:
|
||||
+ import apt
|
||||
+ import mintcommon.aptdaemon
|
||||
|
||||
# i18n
|
||||
APP = 'mintlocale'
|
||||
@@ -38,7 +43,8 @@
|
||||
self.app = app
|
||||
self.packages = []
|
||||
self.missing_packages = []
|
||||
- self.apt = mintcommon.aptdaemon.APT(self.app.window)
|
||||
+ if IS_DEBIAN:
|
||||
+ self.apt = mintcommon.aptdaemon.APT(self.app.window)
|
||||
self.button = button
|
||||
self.button.connect('clicked', self.install)
|
||||
self.button.set_sensitive(False)
|
||||
@@ -0,0 +1,48 @@
|
||||
--- a/usr/lib/linuxmint/mintlocale/install_remove.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/install_remove.py
|
||||
@@ -2,15 +2,21 @@
|
||||
|
||||
import os
|
||||
import gettext
|
||||
-import apt_pkg
|
||||
import subprocess
|
||||
import locale
|
||||
import codecs
|
||||
-import mintcommon.aptdaemon
|
||||
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk, Gdk, GdkPixbuf
|
||||
+
|
||||
++
|
||||
++# Used to detect Debian derivatives (we don't want to show APT features in other distros)
|
||||
++IS_DEBIAN = os.path.exists("/etc/debian_version")
|
||||
++
|
||||
++if IS_DEBIAN:
|
||||
++ import apt_pkg
|
||||
++ import mintcommon.aptdaemon
|
||||
|
||||
# i18n
|
||||
APP = 'mintlocale'
|
||||
@@ -53,8 +59,9 @@
|
||||
else:
|
||||
self.language_packs.append(LanguagePack(category, language, dependency, package))
|
||||
|
||||
- apt_pkg.init()
|
||||
- self.cache = apt_pkg.Cache(None)
|
||||
+ if IS_DEBIAN:
|
||||
+ apt_pkg.init()
|
||||
+ self.cache = apt_pkg.Cache(None)
|
||||
self.cache_updated = False
|
||||
|
||||
|
||||
@@ -134,7 +141,8 @@
|
||||
return (language_code, country_code, language_label)
|
||||
|
||||
def build_lang_list(self):
|
||||
- self.cache = apt_pkg.Cache(None)
|
||||
+ if IS_DEBIAN:
|
||||
+ self.cache = apt_pkg.Cache(None)
|
||||
|
||||
self.builder.get_object('button_install').set_sensitive(False)
|
||||
self.builder.get_object('button_remove').set_sensitive(False)
|
||||
@@ -0,0 +1,110 @@
|
||||
--- a/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
+++ b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
||||
@@ -279,7 +279,7 @@
|
||||
vbox = Gtk.VBox()
|
||||
vbox.pack_start(image, False, False, 2)
|
||||
label = Gtk.Label()
|
||||
- label.set_markup(title)
|
||||
+ label.set_text(title)
|
||||
vbox.pack_start(label, False, False, 2)
|
||||
menuitem.add(vbox)
|
||||
else:
|
||||
@@ -720,7 +720,10 @@
|
||||
vars[var_name] = value
|
||||
if "LANG" in vars:
|
||||
locale = vars['LANG'].replace('"', '').replace("'", "")
|
||||
- locale = locale.split(".")[0].strip()
|
||||
+ locale = locale.replace("utf8", "UTF-8")
|
||||
+ locale = locale.replace("UTF-8", "")
|
||||
+ locale = locale.replace(".", "")
|
||||
+ locale = locale.strip()
|
||||
if "_" in locale:
|
||||
split = locale.split("_")
|
||||
if len(split) == 2:
|
||||
@@ -745,7 +748,10 @@
|
||||
|
||||
if "LC_NUMERIC" in vars:
|
||||
locale = vars['LC_NUMERIC'].replace('"', '').replace("'", "")
|
||||
- locale = locale.split(".")[0].strip()
|
||||
+ locale = locale.replace("utf8", "UTF-8")
|
||||
+ locale = locale.replace("UTF-8", "")
|
||||
+ locale = locale.replace(".", "")
|
||||
+ locale = locale.strip()
|
||||
if "_" in locale:
|
||||
split = locale.split("_")
|
||||
if len(split) == 2:
|
||||
@@ -773,7 +779,7 @@
|
||||
self.system_label.set_markup("<b>%s</b>\n<small>%s <i>%s</i>\n%s <i>%s</i></small>" % (_("System locale"), language_prefix, language_str, region_prefix, region_str))
|
||||
|
||||
def set_num_installed(self):
|
||||
- num_installed = int(subprocess.check_output("localedef --list-archive | wc -l", shell=True))
|
||||
+ num_installed = int(subprocess.check_output("localedef --list-archive | grep utf8 | wc -l", shell=True))
|
||||
self.install_label.set_markup("<b>%s</b>\n<small>%s</small>" % (_("Language support"), gettext.ngettext("%d language installed", "%d languages installed", num_installed) % num_installed))
|
||||
|
||||
def accountservice_ready(self, user, param):
|
||||
@@ -827,11 +833,12 @@
|
||||
built_locales = {}
|
||||
for line in locales.rstrip().split("\n"):
|
||||
line = line.replace("utf8", "UTF-8")
|
||||
- cur_index += 1
|
||||
- locale_code = line.split(".")[0].strip()
|
||||
- charmap = None
|
||||
- if len(line.split(".")) > 1:
|
||||
- charmap = line.split(".")[1].strip()
|
||||
+ if "UTF-8" not in line:
|
||||
+ continue
|
||||
+ cur_index += 1
|
||||
+ locale_code = line.replace("UTF-8", "")
|
||||
+ locale_code = locale_code.replace(".", "")
|
||||
+ locale_code = locale_code.strip()
|
||||
|
||||
if "_" in locale_code:
|
||||
split = locale_code.split("_")
|
||||
@@ -843,16 +850,13 @@
|
||||
else:
|
||||
language = language_code
|
||||
|
||||
- country_code = split[1].lower().split('@')[0].strip()
|
||||
+ country_code = split[1].lower()
|
||||
if country_code in self.countries:
|
||||
country = self.countries[country_code]
|
||||
else:
|
||||
country = country_code
|
||||
|
||||
- if '@' in split[1]:
|
||||
- language_label = u"%s (@%s), %s" % (language, split[1].split('@')[1].strip(), country)
|
||||
- else:
|
||||
- language_label = u"%s, %s" % (language, country)
|
||||
+ language_label = u"%s, %s" % (language, country)
|
||||
|
||||
flag_path = FLAG_PATH % country_code
|
||||
else:
|
||||
@@ -864,9 +868,6 @@
|
||||
|
||||
flag_path = self.set_minority_language_flag_path(locale_code, flag_path)
|
||||
|
||||
- if charmap is not None and not all_locales_are_utf8:
|
||||
- language_label = u"%s <small><span foreground='#3c3c3c'>%s</span></small>" % (language_label, charmap)
|
||||
-
|
||||
if os.path.exists(flag_path):
|
||||
flag = flag_path
|
||||
else:
|
||||
@@ -892,7 +893,7 @@
|
||||
|
||||
def set_user_locale(self, path, locale):
|
||||
self.locale_button.set_button_label(locale.name)
|
||||
- print(u"Setting language to %s" % locale.id)
|
||||
+ print(u"Setting language to '%s' '%s'" % (locale.name, locale.id))
|
||||
# Set it in Accounts Service
|
||||
try:
|
||||
self.accountService.set_language(locale.id)
|
||||
@@ -916,7 +917,7 @@
|
||||
|
||||
def set_user_region(self, path, locale):
|
||||
self.region_button.set_button_label(locale.name)
|
||||
- print("Setting region to %s" % locale.id)
|
||||
+ print("Setting region to '%s' '%s'" % (locale.name, locale.id))
|
||||
|
||||
# We don't call self.accountService.set_formats_locale(locale.id) here...
|
||||
# First, we don't really use AccountsService, we're only doing this to be nice to LightDM and all..
|
||||
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>mintlocale</Name>
|
||||
<Homepage>http://cinnamon.linuxmint.com</Homepage>
|
||||
<Packager>
|
||||
<Name>Alihan Öztürk</Name>
|
||||
<Email>alihan@pisilinux.org</Email>
|
||||
</Packager>
|
||||
<License>GPLv2+</License>
|
||||
<PartOf>desktop</PartOf>
|
||||
<IsA>app:gui</IsA>
|
||||
<Summary>Language selection tool.</Summary>
|
||||
<Description>Language selection tool.</Description>
|
||||
<BuildDependencies>
|
||||
<Dependency>desktop-file-utils</Dependency>
|
||||
<Dependency>accountsservice-devel</Dependency>
|
||||
<Dependency>gtk3-devel</Dependency>
|
||||
<Dependency>gettext-devel</Dependency>
|
||||
<Dependency>gobject-introspection-devel</Dependency>
|
||||
<Dependency>gdk-pixbuf-devel</Dependency>
|
||||
<Dependency>intltool</Dependency>
|
||||
<Dependency>xapp-devel</Dependency>
|
||||
</BuildDependencies>
|
||||
<Archive sha1sum="5a868a7ed4bd0def3ae3d1593740bbf44e172cfb" type="targz">https://github.com/linuxmint/mintlocale/archive/refs/tags/1.4.7.tar.gz</Archive>
|
||||
<Patches>
|
||||
<Patch>add_apt_checking.patch</Patch>
|
||||
<Patch>fix_gdk_import.patch</Patch>
|
||||
<Patch>fix_signal_name.patch</Patch>
|
||||
<Patch>show_utf8_only.patch</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>mintlocale</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency>desktop-file-utils</Dependency>
|
||||
<Dependency>accountsservice</Dependency>
|
||||
<Dependency>gtk3</Dependency>
|
||||
<Dependency>iso-flag-png</Dependency>
|
||||
<Dependency>gettext</Dependency>
|
||||
<Dependency>gobject-introspection</Dependency>
|
||||
<Dependency>intltool</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="executable">/usr/bin</Path>
|
||||
<Path fileType="data">/usr/share</Path>
|
||||
<Path fileType="library">/usr/lib</Path>
|
||||
</Files>
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="1">
|
||||
<Date>2022-06-30</Date>
|
||||
<Version>1.4.7</Version>
|
||||
<Comment>First release</Comment>
|
||||
<Name>Alihan Öztürk</Name>
|
||||
<Email>alihan@pisilinux.org</Email>
|
||||
</Update>
|
||||
</History>
|
||||
</PISI>
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
<PISI>
|
||||
<Source>
|
||||
<Name>mintlocale</Name>
|
||||
<Summary xml:lang="tr">Cinnamon dil aracı.</Summary>
|
||||
<Description xml:lang="tr">Cinnamon masaüstü için dil aracı.</Description>
|
||||
</Source>
|
||||
</PISI>
|
||||
Reference in New Issue
Block a user