Reorganize project files

Rename cambalache to cambalacheui and install it as a python module
Install merengue and cambalache module in pkgdatadir
Add localization support with spanish translation
Add desktop file and appstream file
This commit is contained in:
Juan Pablo Ugarte 2021-05-19 21:27:05 -03:00
parent bd28816875
commit fe01ea88ae
53 changed files with 846 additions and 76 deletions

16
.gitignore vendored
View File

@ -1,12 +1,14 @@
*.pyc
cambalache/cambalache.gresource
cambalache/config.py
cambalacheui/cambalacheui.gresource
cambalacheui/config.py
merengue/merengue.gresource
merengue/config.py
merengue/merengue
src/cambalache_app.gresource
src/cambalache.gresource
src/config.py
tools/CmbUtils-0.1.gir
tools/CmbUtils-0.1.typelib
tools/libcmbutils.so
tools/CmbUtils-3.0.gir
tools/CmbUtils-3.0.typelib
tools/CmbUtils-4.0.gir
tools/CmbUtils-4.0.typelib
tools/libcmbutils3.so
tools/libcmbutils4.so

View File

@ -14,6 +14,6 @@ Tool to generate GObject classes from DB tables
```
flatpak-builder --force-clean --repo=repo build ar.xjuan.Cambalache.json
flatpak build-bundle repo cambalache.flatpak ar.xjuan.Cambalache
flatpak install cambalache.flatpak
flatpak install --user cambalache.flatpak
```

View File

@ -3,13 +3,15 @@
"runtime" : "org.gnome.Platform",
"runtime-version" : "40",
"sdk" : "org.gnome.Sdk",
"command" : "ar.xjuan.Cambalache",
"separate-locales": false,
"command" : "cambalache",
"finish-args" : [
"--share=ipc",
"--share=network",
"--socket=fallback-x11",
"--socket=wayland",
"--filesystem=home"
"--filesystem=home",
"--device=dri"
],
"cleanup" : [
"/include",

View File

@ -8,7 +8,7 @@
import os
from .config import *
from gi.repository import Gio
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'cambalache.gresource'))
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'cambalacheui.gresource'))
resource._register()
from .cmb_ui import CmbUI

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/ar/xjuan/Cambalache">
<gresource prefix="/ar/xjuan/Cambalacheui">
<file>cmb_base.sql</file>
<file>cmb_project.sql</file>
<file>cmb_history.sql</file>

View File

@ -27,7 +27,7 @@ from .cmb_list_store import CmbListStore
from .config import *
def _get_text_resource(name):
gbytes = Gio.resources_lookup_data(f'/ar/xjuan/Cambalache/{name}',
gbytes = Gio.resources_lookup_data(f'/ar/xjuan/Cambalacheui/{name}',
Gio.ResourceLookupFlags.NONE)
return gbytes.get_data().decode('UTF-8')

View File

@ -28,7 +28,7 @@ class Col(Enum):
INFO = 8
@Gtk.Template(resource_path='/ar/xjuan/Cambalache/cmb_signal_editor.ui')
@Gtk.Template(resource_path='/ar/xjuan/Cambalacheui/cmb_signal_editor.ui')
class CmbSignalEditor(Gtk.Box):
__gtype_name__ = 'CmbSignalEditor'

View File

@ -94,7 +94,7 @@ class CmbProcess(GObject.Object):
return self.emit('stdout', condition)
@Gtk.Template(resource_path='/ar/xjuan/Cambalache/cmb_view.ui')
@Gtk.Template(resource_path='/ar/xjuan/Cambalacheui/cmb_view.ui')
class CmbView(Gtk.Stack):
__gtype_name__ = 'CmbView'

View File

@ -1,5 +1,8 @@
gnome.compile_resources('cambalache',
'cambalache.gresource.xml',
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'cambalacheui')
moduledir = join_paths(get_option('prefix'), python_bin.get_install_dir(), 'cambalacheui')
gnome.compile_resources('cambalacheui',
'cambalacheui.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,

View File

@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="80"
height="80"
viewBox="0 0 21.166665 21.166666"
version="1.1"
id="svg8"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
sodipodi:docname="ar.xjuan.Cambalache-symbolic.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="7.9195959"
inkscape:cx="26.938477"
inkscape:cy="22.800044"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1136"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
units="px" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-19.430474,-64.33073)">
<path
d="m 34.379178,79.912465 c -0.599414,0.401656 -1.159736,0.74434 -1.691553,1.032433 -0.531816,0.288091 -1.035129,0.521594 -1.520524,0.704889 -0.485396,0.183299 -0.952872,0.316386 -1.413021,0.403649 -0.460149,0.08727 -0.912965,0.128695 -1.369042,0.128695 -0.514714,0 -0.982193,-0.09563 -1.393882,-0.276935 -0.411691,-0.18131 -0.767593,-0.448278 -1.059155,-0.790962 -0.291563,-0.342682 -0.538508,-0.71587 0.01755,-1.470699 -0.753644,-0.388763 -0.947042,-0.814135 -0.926512,-1.414216 0.04533,-1.325361 0.23944,-2.650614 0.658868,-3.891446 0.419425,-1.240833 1.018839,-2.397986 1.738788,-3.389377 0.719948,-0.99139 1.560431,-1.817017 2.461997,-2.394796 0.901563,-0.577779 1.86421,-0.907712 2.828483,-0.907712 0.390923,0 0.732978,0.05899 1.028615,0.178915 0.295634,0.119929 0.544846,0.300844 0.750079,0.544707 0.205235,0.243862 0.36649,0.550683 0.486211,0.922455 0.119718,0.371771 0.197916,0.808492 0.236996,1.312157 l 0.482138,-0.401657 0.482136,-0.401658 0.482138,-0.401655 0.482138,-0.401657 c -0.02606,-0.204013 -0.05538,-0.382529 -0.08957,-0.541517 -0.03421,-0.158991 -0.0733,-0.298454 -0.118921,-0.42437 -0.04562,-0.125913 -0.09772,-0.238283 -0.158,-0.343082 -0.06028,-0.104802 -0.128679,-0.202026 -0.206873,-0.297655 -0.123793,-0.146632 -0.275275,-0.27893 -0.449153,-0.394884 -0.173883,-0.115959 -0.370155,-0.21558 -0.583532,-0.296859 -0.213382,-0.08129 -0.443858,-0.144242 -0.68615,-0.186891 -0.24229,-0.04263 -0.496389,-0.06494 -0.757005,-0.06494 -0.566838,0 -1.156477,0.08129 -1.757928,0.238286 -0.601451,0.157003 -1.214711,0.389701 -1.828785,0.692537 -1.685618,1.052713 -2.199963,0.790171 -2.199963,0.790171 0,0 0.02123,0.62542 -1.406291,1.823786 -0.678377,0.569431 -1.198828,1.294228 -1.693589,2.011869 -0.873841,1.517457 -1.813121,1.838988 -1.813121,1.838988 0,0 0.275255,0.885853 -0.235147,2.844615 -0.178777,0.822839 -0.27161,1.656436 -0.27161,2.485251 0,0.656676 0.09285,1.248003 0.270795,1.765614 0.177948,0.517612 0.44101,0.961505 0.781436,1.323314 0.340428,0.361811 0.758226,0.641535 1.245657,0.830809 0.487432,0.189284 1.044495,0.288093 1.663454,0.288093 0.566839,0 1.167881,-0.06375 1.786027,-0.185694 0.618144,-0.121913 1.501768,-0.34105 2.23331,-0.118966 0.07646,-0.45476 0.925829,-0.933785 1.543976,-1.266109 0.618145,-0.332322 1.219188,-0.711663 1.786025,-1.132447 l 0.04562,-0.191273 0.04559,-0.191272 0.04562,-0.191272 z"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.2889px;line-height:125%;font-family:Z003;-inkscape-font-specification:'Z003, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-east-asian:normal;text-align:end;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.264584px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
id="path851"
sodipodi:nodetypes="csssssscsscssssscccccssscsssssccscccsssssscsccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>ar.xjuan.Cambalache.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>LicenseRef-proprietary</project_license>
<name>Cambalache</name>
<summary>Create and edit UI files for Gtk 4 and Gtk 3 applications</summary>
<description>
<!-- To translators: AppData description first paragraph -->
<p>
Cambalache is a new RAD tool that enables the creation of user interfaces
for Gtk and the GNOME desktop environment.
</p>
<!-- To translators: AppData description second paragraph -->
<p>
Cambalache's main target is Gtk version 4 but it has been designed from
the ground up to support other versions.
</p>
</description>
<translation type="gettext">cambalache</translation>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="violence-desecration">none</content_attribute>
<content_attribute id="violence-slavery">none</content_attribute>
<content_attribute id="violence-worship">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="sex-homosexuality">none</content_attribute>
<content_attribute id="sex-prostitution">none</content_attribute>
<content_attribute id="sex-adultery">none</content_attribute>
<content_attribute id="sex-appearance">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">none</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">none</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">none</content_attribute>
<content_attribute id="money-purchasing">none</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
</content_rating>
<developer_name>Juan Pablo Ugarte</developer_name>
<update_contact>juanpablougarte@gmail.com</update_contact>
</component>

View File

@ -0,0 +1,13 @@
[Desktop Entry]
Name=Cambalache
GenericName=UI Maker
Exec=cambalache %f
Terminal=false
Type=Application
Categories=GNOME;GTK;Development;GUIDesigner;
MimeType=application/x-gtk-builder;application/x-glade;
StartupNotify=true
# TRANSLATORS: Don't translate this, its an icon name
Icon=ar.xjuan.Cambalache
# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
Keywords=UI Maker;GUI designer;user interface;ui builder;

View File

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

39
data/meson.build Normal file
View File

@ -0,0 +1,39 @@
datadir = get_option('datadir')
install_data('ar.xjuan.Cambalache.svg',
install_dir: join_paths(datadir, 'icons/hicolor/scalable/apps')
)
install_data('ar.xjuan.Cambalache-symbolic.svg',
install_dir: join_paths(datadir, 'icons/hicolor/symbolic/apps')
)
desktop_file = i18n.merge_file(
input: 'ar.xjuan.Cambalache.desktop.in',
output: 'ar.xjuan.Cambalache.desktop',
type: 'desktop',
po_dir: '../po',
install: true,
install_dir: join_paths(datadir, 'applications')
)
appstream_file = i18n.merge_file(
input: 'ar.xjuan.Cambalache.appdata.xml.in',
output: 'ar.xjuan.Cambalache.appdata.xml',
po_dir: '../po',
install: true,
install_dir: join_paths(datadir, 'appdata')
)
desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
test('Validating desktop file', desktop_file_validate, args: [desktop_file])
endif
appstream_util = find_program('appstream-util', required: false)
if appstream_util.found()
test('Validating appstream file',
appstream_util,
args: ['validate', appstream_file])
endif

View File

@ -12,9 +12,9 @@ import gi
import sys
import signal
pythondir = '@pythondir@'
pkgdatadir = '@pkgdatadir@'
sys.path.insert(1, pythondir)
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
from gi.repository import GLib

View File

@ -1,4 +1,5 @@
moduledir = join_paths(python_dir, 'merengue')
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'merengue')
moduledir = join_paths(pkgdatadir, 'merengue')
gnome.compile_resources('merengue',
'merengue.gresource.xml',
@ -9,8 +10,7 @@ gnome.compile_resources('merengue',
conf = configuration_data()
conf.set('VERSION', meson.project_version())
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('pythondir', python_dir)
conf.set('PYTHON', python_bin.path())
conf.set('pkgdatadir', pkgdatadir)
configure_file(
@ -43,7 +43,7 @@ install_data([
'controller/mrg_controller.pyc',
'controller/mrg_controller_registry.pyc',
],
install_dir: join_paths(python_dir, 'controller')
install_dir: join_paths(moduledir, 'controller')
)
install_data([
@ -51,13 +51,13 @@ install_data([
'mrg_gtk/mrg_gtk_widget.pyc',
'mrg_gtk/mrg_gtk_window.pyc',
],
install_dir: join_paths(python_dir, 'mrg_gtk')
install_dir: join_paths(moduledir, 'mrg_gtk')
)
install_data([
'utils/__init__.pyc',
'utils/utils.pyc',
],
install_dir: join_paths(python_dir, 'utils')
install_dir: join_paths(moduledir, 'utils')
)

View File

@ -12,9 +12,9 @@ import sys
import json
from gi.repository import GLib, Gio, Gdk, Gtk
import utils
from controller import MrgControllerRegistry
from merengue.controller import MrgControllerRegistry
from merengue import utils
class MrgApplication(Gtk.Application):
@ -186,7 +186,7 @@ class MrgApplication(Gtk.Application):
Gtk.Application.do_startup(self)
# TODO: support multiples plugins
import mrg_gtk
from merengue import mrg_gtk
self.registry.load_module(mrg_gtk)
stdin_channel = GLib.IOChannel.unix_new(sys.stdin.fileno())

View File

@ -8,7 +8,7 @@
import gi
from gi.repository import GObject, Gdk, Gtk
from controller import MrgController
from merengue.controller import MrgController
class MrgGtkWidgetController(MrgController):

View File

@ -10,7 +10,7 @@ from gi.repository import GObject, Gdk, Gtk
from .mrg_gtk_widget import MrgGtkWidgetController
import utils
from merengue import utils
preselected_widget = None

View File

@ -6,13 +6,15 @@ project(
python = import('python')
python_bin = python.find_installation('python3')
python_dir = join_paths(get_option('prefix'), python_bin.get_install_dir())
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name())
moduledir = join_paths(python_dir, meson.project_name())
localedir = join_paths(get_option('prefix'), get_option('localedir'))
gnome = import('gnome')
subdir('cambalache')
i18n = import('i18n')
subdir('data')
subdir('cambalacheui')
subdir('merengue')
subdir('src')
subdir('po')
meson.add_install_script('postinstall.py')

1
po/LINGUAS Normal file
View File

@ -0,0 +1 @@
es

19
po/POTFILES Normal file
View File

@ -0,0 +1,19 @@
data/ar.xjuan.Cambalache.desktop.in
data/ar.xjuan.Cambalache.appdata.xml.in
cambalacheui/cmb_base.py
cambalacheui/cmb_object.py
cambalacheui/cmb_signal_editor.py
cambalacheui/cmb_signal_editor.ui
cambalacheui/cmb_view.py
cambalacheui/cmb_view.ui
cambalacheui/cmb_layout_property.py
cambalacheui/cmb_tree_view.py
cambalacheui/cmb_list_store.py
cambalacheui/cmb_project.py
cambalacheui/cmb_type_info.py
cambalacheui/cmb_object_editor.py
cambalacheui/cmb_property.py
cambalacheui/cmb_ui.py
src/cmb_application.py
src/cmb_window.py
src/cmb_window.ui

263
po/cambalache.pot Normal file
View File

@ -0,0 +1,263 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the cambalache package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: cambalache\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-20 17:11-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: data/ar.xjuan.Cambalache.desktop.in:3
#: data/ar.xjuan.Cambalache.appdata.xml.in:6 src/cmb_window.ui:731
msgid "Cambalache"
msgstr ""
#: data/ar.xjuan.Cambalache.desktop.in:4 src/cmb_window.ui:958
msgid "UI Maker"
msgstr ""
#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
#: data/ar.xjuan.Cambalache.desktop.in:14
msgid "UI Maker;GUI designer;user interface;ui builder;"
msgstr ""
#: data/ar.xjuan.Cambalache.appdata.xml.in:7
msgid "Create and edit UI files for Gtk 4 and Gtk 3 applications"
msgstr ""
#. To translators: AppData description first paragraph
#: data/ar.xjuan.Cambalache.appdata.xml.in:11
msgid ""
"Cambalache is a new RAD tool that enables the creation of user interfaces "
"for Gtk and the GNOME desktop environment."
msgstr ""
#. To translators: AppData description second paragraph
#: data/ar.xjuan.Cambalache.appdata.xml.in:17
msgid ""
"Cambalache's main target is Gtk version 4 but it has been designed from the "
"ground up to support other versions."
msgstr ""
#: data/ar.xjuan.Cambalache.appdata.xml.in:52
msgid "Juan Pablo Ugarte"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:57
msgid "Signal"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:72
msgid "Handler"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:88
msgid "Data"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:103
msgid "Swap"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:116
msgid "After"
msgstr ""
#: cambalacheui/cmb_view.ui:36
msgid "Project View"
msgstr ""
#: cambalacheui/cmb_view.ui:81
msgid "UI Definition"
msgstr ""
#: cambalacheui/cmb_view.ui:102
msgid "Cut"
msgstr ""
#: cambalacheui/cmb_view.ui:116
msgid "Copy"
msgstr ""
#: cambalacheui/cmb_view.ui:130
msgid "Paste"
msgstr ""
#: cambalacheui/cmb_view.ui:144
msgid "Delete"
msgstr ""
#: cambalacheui/cmb_view.ui:169
msgid "Clear Properties"
msgstr ""
#: cambalacheui/cmb_view.ui:183
msgid "Read Documentation"
msgstr ""
#: cambalacheui/cmb_view.ui:207
msgid "Restart workspace"
msgstr ""
#: cambalacheui/cmb_view.ui:221
msgid "Inspect UI definition"
msgstr ""
#: src/cmb_window.py:156
msgid "<Choose a UI filename to create>"
msgstr ""
#: src/cmb_window.py:250
msgid "Choose file to open"
msgstr ""
#: src/cmb_window.py:293
msgid "File name already exists, choose a different name."
msgstr ""
#: src/cmb_window.py:325
msgid "Choose a new file to save the project"
msgstr ""
#: src/cmb_window.py:337
msgid "Choose a file name for the new UI"
msgstr ""
#: src/cmb_window.py:371
msgid "Choose file to import"
msgstr ""
#: src/cmb_window.ui:31
msgid "Import"
msgstr ""
#: src/cmb_window.ui:45
msgid "Export all"
msgstr ""
#: src/cmb_window.ui:59
msgid "Close Project"
msgstr ""
#: src/cmb_window.ui:73
msgid "Debug Project Data"
msgstr ""
#: src/cmb_window.ui:98
msgid "About Cambalache"
msgstr ""
#: src/cmb_window.ui:112
msgid "Quit"
msgstr ""
#: src/cmb_window.ui:193
msgid ""
"<b><span size=\"40000\">Cambalache</span>\n"
"<span size=\"20000\">UI Maker</span></b>"
msgstr ""
#: src/cmb_window.ui:234
msgid ""
"<b>\n"
"\n"
"<span size=\"18000\">New project</span>\n"
"</b>"
msgstr ""
#: src/cmb_window.ui:262
msgid "Name"
msgstr ""
#: src/cmb_window.ui:274
msgid "Toolkit target"
msgstr ""
#: src/cmb_window.ui:286
msgid "Location"
msgstr ""
#: src/cmb_window.ui:298
msgid "<project basename>"
msgstr ""
#: src/cmb_window.ui:310
msgid "Create"
msgstr ""
#: src/cmb_window.ui:440
msgid "Choose a location to save the project"
msgstr ""
#: src/cmb_window.ui:450
msgid "Cancel"
msgstr ""
#: src/cmb_window.ui:467
msgid "UI Filename"
msgstr ""
#: src/cmb_window.ui:504
msgid "New Project"
msgstr ""
#: src/cmb_window.ui:657
msgid "Properties"
msgstr ""
#: src/cmb_window.ui:685
msgid "Layout"
msgstr ""
#: src/cmb_window.ui:701
msgid "Signals"
msgstr ""
#: src/cmb_window.ui:759
msgid "_Open"
msgstr ""
#: src/cmb_window.ui:763
msgid "Open a project"
msgstr ""
#: src/cmb_window.ui:804
msgid "Create a new project"
msgstr ""
#: src/cmb_window.ui:825
msgid "Save"
msgstr ""
#: src/cmb_window.ui:829
msgid "Save project"
msgstr ""
#: src/cmb_window.ui:844
msgid "Save project with a different file name"
msgstr ""
#: src/cmb_window.ui:881
msgid "Add new UI to project"
msgstr ""
#: src/cmb_window.ui:957
msgid "© 2020-2021 Juan Pablo Ugarte - All Rights Reserved"
msgstr ""
#: src/cmb_window.ui:959
msgid ""
"This application is distributed on an \"AS IS\" BASIS, WITHOUT\n"
"WARRANTIES OR CONDITIONS OF ANY KIND,\n"
"either express or implied."
msgstr ""

278
po/es.po Normal file
View File

@ -0,0 +1,278 @@
# Spanish translations for cambalache package.
# Copyright (C) 2021 THE cambalache'S COPYRIGHT HOLDER
# This file is distributed under the same license as the cambalache package.
# Automatically generated, 2021.
# Juan Pablo Ugarte <juanpablougarte@gmail.com>, 2021.
#
msgid ""
msgstr ""
"Project-Id-Version: cambalache\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-05-20 17:11-0300\n"
"PO-Revision-Date: 2021-05-20 17:14-0300\n"
"Last-Translator: Juan Pablo Ugarte <juanpablougarte@gmail.com>\n"
"Language-Team: Spanish; Castilian <>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 3.38.0\n"
#: data/ar.xjuan.Cambalache.desktop.in:3
#: data/ar.xjuan.Cambalache.appdata.xml.in:6 src/cmb_window.ui:731
msgid "Cambalache"
msgstr ""
#: data/ar.xjuan.Cambalache.desktop.in:4 src/cmb_window.ui:958
msgid "UI Maker"
msgstr "Constructor de UI"
#. Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
#: data/ar.xjuan.Cambalache.desktop.in:14
msgid "UI Maker;GUI designer;user interface;ui builder;"
msgstr ""
"Constructor de UI;Diseñador de interfaces graficas;interfaces de usuario;"
#: data/ar.xjuan.Cambalache.appdata.xml.in:7
msgid "Create and edit UI files for Gtk 4 and Gtk 3 applications"
msgstr ""
"Crea y edita archivos de interfaces graficas para aplicaciones Gtk 4 y Gtk3"
#. To translators: AppData description first paragraph
#: data/ar.xjuan.Cambalache.appdata.xml.in:11
msgid ""
"Cambalache is a new RAD tool that enables the creation of user interfaces "
"for Gtk and the GNOME desktop environment."
msgstr ""
"Cambalache es una nueva utilidad para desarrollo rápido de aplicaciones que "
"permite crear interfaces de usuario para Gtk y el entorno de escritorio "
"GNOME."
#. To translators: AppData description second paragraph
#: data/ar.xjuan.Cambalache.appdata.xml.in:17
msgid ""
"Cambalache's main target is Gtk version 4 but it has been designed from the "
"ground up to support other versions."
msgstr ""
"El objetivo principal de Cambalache es Gtk 4 pero fue diseñado desde un "
"principio para soportar otras versiones."
#: data/ar.xjuan.Cambalache.appdata.xml.in:52
msgid "Juan Pablo Ugarte"
msgstr ""
#: cambalacheui/cmb_signal_editor.ui:57
msgid "Signal"
msgstr "Señal"
#: cambalacheui/cmb_signal_editor.ui:72
msgid "Handler"
msgstr "Manipulador"
#: cambalacheui/cmb_signal_editor.ui:88
msgid "Data"
msgstr "Datos"
#: cambalacheui/cmb_signal_editor.ui:103
msgid "Swap"
msgstr "Intercambiar"
#: cambalacheui/cmb_signal_editor.ui:116
msgid "After"
msgstr "Después"
#: cambalacheui/cmb_view.ui:36
msgid "Project View"
msgstr "Vista del Proyecto"
#: cambalacheui/cmb_view.ui:81
msgid "UI Definition"
msgstr "Definición del UI"
#: cambalacheui/cmb_view.ui:102
msgid "Cut"
msgstr "Cortar"
#: cambalacheui/cmb_view.ui:116
msgid "Copy"
msgstr "Copiar"
#: cambalacheui/cmb_view.ui:130
msgid "Paste"
msgstr "Pegar"
#: cambalacheui/cmb_view.ui:144
msgid "Delete"
msgstr "Borrar"
#: cambalacheui/cmb_view.ui:169
msgid "Clear Properties"
msgstr "Limpiar Propiedades"
#: cambalacheui/cmb_view.ui:183
msgid "Read Documentation"
msgstr "Leer Documentación"
#: cambalacheui/cmb_view.ui:207
msgid "Restart workspace"
msgstr "Reiniciar área de trabajo"
#: cambalacheui/cmb_view.ui:221
msgid "Inspect UI definition"
msgstr "Inspeccionar UI"
#: src/cmb_window.py:156
msgid "<Choose a UI filename to create>"
msgstr "<Elija un nombre de archivo para crear un UI>"
#: src/cmb_window.py:250
msgid "Choose file to open"
msgstr "Elija un archivo para abrir"
#: src/cmb_window.py:293
msgid "File name already exists, choose a different name."
msgstr "El archivo ya existe, elija un nombre diferente."
#: src/cmb_window.py:325
msgid "Choose a new file to save the project"
msgstr "Elija un nuevo archivo para guardar el proyecto"
#: src/cmb_window.py:337
msgid "Choose a file name for the new UI"
msgstr "Elija un nombre de archivo para la UI nueva"
#: src/cmb_window.py:371
msgid "Choose file to import"
msgstr "Elija un archivo para importar"
#: src/cmb_window.ui:31
msgid "Import"
msgstr "Importar"
#: src/cmb_window.ui:45
msgid "Export all"
msgstr "Exportar todo"
#: src/cmb_window.ui:59
msgid "Close Project"
msgstr "Cerrar Proyecto"
#: src/cmb_window.ui:73
msgid "Debug Project Data"
msgstr "Depurar datos"
#: src/cmb_window.ui:98
msgid "About Cambalache"
msgstr "Acerca de Cambalache"
#: src/cmb_window.ui:112
msgid "Quit"
msgstr "Salir"
#: src/cmb_window.ui:193
msgid ""
"<b><span size=\"40000\">Cambalache</span>\n"
"<span size=\"20000\">UI Maker</span></b>"
msgstr ""
"<b><span size=\"40000\">Cambalache</span>\n"
"<span size=\"20000\">Constructor de UI</span></b>"
#: src/cmb_window.ui:234
msgid ""
"<b>\n"
"\n"
"<span size=\"18000\">New project</span>\n"
"</b>"
msgstr ""
"<b>\n"
"\n"
"<span size=\"18000\">Proyecto Nuevo</span>\n"
"</b>"
#: src/cmb_window.ui:262
msgid "Name"
msgstr "Nombre"
#: src/cmb_window.ui:274
msgid "Toolkit target"
msgstr "Biblioteca"
#: src/cmb_window.ui:286
msgid "Location"
msgstr "Directorio"
#: src/cmb_window.ui:298
msgid "<project basename>"
msgstr "<nombre base del proyecto>"
#: src/cmb_window.ui:310
msgid "Create"
msgstr "Crear"
#: src/cmb_window.ui:440
msgid "Choose a location to save the project"
msgstr "Elija un lugar donde guardar el proyecto"
#: src/cmb_window.ui:450
msgid "Cancel"
msgstr "Cancelar"
#: src/cmb_window.ui:467
msgid "UI Filename"
msgstr "Archivo de UI"
#: src/cmb_window.ui:504
msgid "New Project"
msgstr "Proyecto Nuevo"
#: src/cmb_window.ui:657
msgid "Properties"
msgstr "Propiedades"
#: src/cmb_window.ui:685
msgid "Layout"
msgstr "Diseño"
#: src/cmb_window.ui:701
msgid "Signals"
msgstr "Señales"
#: src/cmb_window.ui:759
msgid "_Open"
msgstr "_Abrir"
#: src/cmb_window.ui:763
msgid "Open a project"
msgstr "Abrir proyecto"
#: src/cmb_window.ui:804
msgid "Create a new project"
msgstr "Crear proyecto nuevo"
#: src/cmb_window.ui:825
msgid "Save"
msgstr "Guardar"
#: src/cmb_window.ui:829
msgid "Save project"
msgstr "Guardar proyecto"
#: src/cmb_window.ui:844
msgid "Save project with a different file name"
msgstr "Guardar proyecto con un nombre diferente"
#: src/cmb_window.ui:881
msgid "Add new UI to project"
msgstr "Agregar nueva UI al proyecto"
#: src/cmb_window.ui:957
msgid "© 2020-2021 Juan Pablo Ugarte - All Rights Reserved"
msgstr "© 2020-2021 Juan Pablo Ugarte - Todos los derechos reservados"
#: src/cmb_window.ui:959
msgid ""
"This application is distributed on an \"AS IS\" BASIS, WITHOUT\n"
"WARRANTIES OR CONDITIONS OF ANY KIND,\n"
"either express or implied."
msgstr ""

1
po/meson.build Normal file
View File

@ -0,0 +1 @@
i18n.gettext(meson.project_name(), preset: 'glib')

17
postinstall.py Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env python3
from os import environ, path
from subprocess import call
prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
datadir = path.join(prefix, 'share')
destdir = environ.get('DESTDIR', '')
# Package managers set this so we don't need to run
if not destdir:
print('Updating icon cache...')
call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
print('Updating desktop database...')
call(['update-desktop-database', '-q', path.join(datadir, 'applications')])

View File

@ -11,11 +11,12 @@ import os
import sys
import stat
import signal
import xml.etree.ElementTree as ET
from gi.repository import GLib
basedir = os.path.dirname(__file__)
sys.path.insert(0, basedir)
sys.path.insert(1, basedir)
os.environ['PATH'] = os.path.join(basedir, 'merengue') + ':' + os.environ.get('PATH')
@ -70,8 +71,8 @@ def configure_file(input_file, output_file, config):
# Create config files pointing to source directories
dev_config('cambalache/config.py',
f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('cambalache')}'")
dev_config('cambalacheui/config.py',
f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('cambalacheui')}'")
dev_config('merengue/config.py',
f"VERSION = 'git'\npkgdatadir = '{os.path.abspath('merengue')}'")
dev_config('src/config.py',
@ -79,14 +80,14 @@ dev_config('src/config.py',
configure_file('merengue/merengue.in', 'merengue/merengue', {
'PYTHON': GLib.find_program_in_path('python3'),
'pythondir': os.path.abspath('.')
'pkgdatadir': os.path.abspath('.')
})
os.chmod('merengue/merengue', stat.S_IREAD | stat.S_IWRITE | stat.S_IEXEC)
# Ensure gresources are up to date
compile_resource('cambalache', 'cambalache.gresource')
compile_resource('cambalacheui', 'cambalacheui.gresource')
compile_resource('merengue', 'merengue.gresource')
compile_resource('src', 'cambalache_app.gresource')
compile_resource('src', 'cambalache.gresource')
from src import CmbApplication

View File

@ -9,7 +9,7 @@ import os
from .config import *
from gi.repository import Gio
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'cambalache_app.gresource'))
resource = Gio.Resource.load(os.path.join(pkgdatadir, 'cambalache.gresource'))
resource._register()
from .cmb_application import CmbApplication

View File

@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/ar/xjuan/Cambalache/App">
<gresource prefix="/ar/xjuan/Cambalache">
<file>cmb_window.ui</file>
<file>cambalache.css</file>
<file>images/cmb.svg</file>
<file>images/gtk3.svg</file>
<file>images/gtk4.svg</file>
</gresource>

View File

@ -11,12 +11,19 @@ import os
import sys
import signal
pythondir = '@pythondir@'
pkgdatadir = '@pkgdatadir@'
localedir = '@localedir@'
sys.path.insert(1, pythondir)
sys.path.insert(1, pkgdatadir)
signal.signal(signal.SIGINT, signal.SIG_DFL)
print(pkgdatadir, localedir)
from cambalache.app import CmbApplication
import locale
locale.bindtextdomain("cambalache", localedir)
locale.textdomain("cambalache")
from cambalache import CmbApplication
if __name__ == '__main__':
app = CmbApplication()

View File

@ -14,7 +14,7 @@ gi.require_version('Gdk', '3.0')
gi.require_version('Gtk', '3.0')
from gi.repository import Gdk, Gtk, Gio
from cambalache import *
from cambalacheui import *
from .cmb_window import CmbWindow
@ -56,7 +56,7 @@ class CmbApplication(Gtk.Application):
self.add_action(gaction)
provider = Gtk.CssProvider()
provider.load_from_resource('/ar/xjuan/Cambalache/App/cambalache.css')
provider.load_from_resource('/ar/xjuan/Cambalache/cambalache.css')
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
provider,

View File

@ -14,10 +14,11 @@ import traceback
gi.require_version('Gtk', '3.0')
from gi.repository import GLib, GObject, Gio, Gtk
from cambalache import *
from locale import gettext as _
from cambalacheui import *
@Gtk.Template(resource_path='/ar/xjuan/Cambalache/App/cmb_window.ui')
@Gtk.Template(resource_path='/ar/xjuan/Cambalache/cmb_window.ui')
class CmbWindow(Gtk.ApplicationWindow):
__gtype_name__ = 'CmbWindow'
@ -152,7 +153,7 @@ class CmbWindow(Gtk.ApplicationWindow):
if len(value):
return value.lower().rsplit('.', 1)[0] + '.ui'
else:
return '<Choose a UI filename to create>'
return _('<Choose a UI filename to create>')
def _is_project_visible(self):
page = self.stack.get_visible_child_name()
@ -238,7 +239,7 @@ class CmbWindow(Gtk.ApplicationWindow):
flags=0,
message_type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.OK,
text=f'Error loading {filename}'
text=f_('Error loading {filename}')
)
print(traceback.format_exc())
@ -246,7 +247,7 @@ class CmbWindow(Gtk.ApplicationWindow):
dialog.destroy()
def _on_open_activate(self, action, data):
dialog = self._file_open_dialog_new("Choose file to open",
dialog = self._file_open_dialog_new(_("Choose file to open"),
filter_obj=self.open_filter)
if dialog.run() == Gtk.ResponseType.OK:
self.emit('open-project', dialog.get_filename(), None)
@ -289,7 +290,7 @@ class CmbWindow(Gtk.ApplicationWindow):
flags=0,
message_type=Gtk.MessageType.INFO,
buttons=Gtk.ButtonsType.OK,
text="File name already exists, choose a different name.",
text=_("File name already exists, choose a different name."),
)
dialog.run()
@ -321,7 +322,7 @@ class CmbWindow(Gtk.ApplicationWindow):
if self.project is None:
return
dialog = self._file_open_dialog_new("Choose a new file to save the project",
dialog = self._file_open_dialog_new(_("Choose a new file to save the project"),
Gtk.FileChooserAction.SAVE)
if dialog.run() == Gtk.ResponseType.OK:
self.project.filename = dialog.get_filename()
@ -333,7 +334,7 @@ class CmbWindow(Gtk.ApplicationWindow):
if self.project is None:
return
dialog = self._file_open_dialog_new("Choose a file name for the new UI",
dialog = self._file_open_dialog_new(_("Choose a file name for the new UI"),
Gtk.FileChooserAction.SAVE)
if dialog.run() == Gtk.ResponseType.OK:
ui = self.project.add_ui(dialog.get_filename())
@ -353,7 +354,7 @@ class CmbWindow(Gtk.ApplicationWindow):
flags=0,
message_type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.YES_NO,
text=f"Do you want to delete selected UI?",
text=f_("Do you want to delete selected UI?"),
)
if dialog.run() == Gtk.ResponseType.YES:
@ -367,7 +368,7 @@ class CmbWindow(Gtk.ApplicationWindow):
if self.project is None:
return
dialog = self._file_open_dialog_new("Choose file to import",
dialog = self._file_open_dialog_new(_("Choose file to import"),
filter_obj=self.import_filter)
if dialog.run() == Gtk.ResponseType.OK:
self.project.import_file(dialog.get_filename())

View File

@ -345,7 +345,7 @@
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="resource">/ar/xjuan/Cambalache/App/images/gtk3.svg</property>
<property name="resource">/ar/xjuan/Cambalache/images/gtk3.svg</property>
</object>
<packing>
<property name="expand">False</property>
@ -357,7 +357,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Gtk 3&lt;/b&gt;</property>
<property name="label">&lt;b&gt;Gtk 3&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="justify">center</property>
</object>
@ -394,7 +394,7 @@
<object class="GtkImage">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="resource">/ar/xjuan/Cambalache/App/images/gtk4.svg</property>
<property name="resource">/ar/xjuan/Cambalache/images/gtk4.svg</property>
</object>
<packing>
<property name="expand">False</property>
@ -406,7 +406,7 @@
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">&lt;b&gt;Gtk 4&lt;/b&gt;</property>
<property name="label">&lt;b&gt;Gtk 4&lt;/b&gt;</property>
<property name="use-markup">True</property>
<property name="justify">center</property>
</object>
@ -956,10 +956,11 @@
<property name="program-name">Cambalache</property>
<property name="copyright" translatable="yes">© 2020-2021 Juan Pablo Ugarte - All Rights Reserved</property>
<property name="comments" translatable="yes">UI Maker</property>
<property name="license" translatable="yes">This application is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.</property>
<property name="license" translatable="yes">This application is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied.</property>
<property name="authors">Juan Pablo Ugarte</property>
<property name="logo">resource:///ar/xjuan/Cambalache/App/images/cmb.svg</property>
<property name="logo-icon-name">ar.xjuan.Cambalache</property>
<property name="license-type">custom</property>
<signal name="delete-event" handler="on_about_dialog_delete_event" swapped="no"/>
<child internal-child="vbox">

View File

@ -1,21 +1,22 @@
gnome.compile_resources('cambalache_app',
'cambalache_app.gresource.xml',
pkgdatadir = join_paths(get_option('prefix'), get_option('datadir'), 'cambalache')
moduledir = join_paths(pkgdatadir, 'cambalache')
gnome.compile_resources('cambalache',
'cambalache.gresource.xml',
gresource_bundle: true,
install: true,
install_dir: pkgdatadir,
)
appdir = join_paths(python_dir, meson.project_name(), 'app')
conf = configuration_data()
conf.set('VERSION', meson.project_version())
conf.set('PYTHON', python.find_installation('python3').path())
conf.set('pythondir', python_dir)
conf.set('PYTHON', python_bin.path())
conf.set('localedir', localedir)
conf.set('pkgdatadir', pkgdatadir)
configure_file(
input: 'ar.xjuan.Cambalache.in',
output: 'ar.xjuan.Cambalache',
input: 'cambalache.in',
output: 'cambalache',
configuration: conf,
install: true,
install_dir: get_option('bindir')
@ -26,7 +27,7 @@ configure_file(
output: 'config.py',
configuration: conf,
install: true,
install_dir: appdir
install_dir: moduledir
)
run_command('python3', '-m', 'compileall', '-b', '.')
@ -36,6 +37,6 @@ install_data([
'cmb_application.pyc',
'cmb_window.pyc'
],
install_dir: appdir)
install_dir: moduledir)