| Commit message (Collapse) | Author | Age | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
meson's tooling for gettext introduces a couple of issues. Firstly, it
is currently not possible [1] to specify per-language keywords. We need
this in order to ignore the 'Name' record in the desktop file.
Secondly, every invocation of 'update-po' also updates the pot file [2],
inadvertently recording the updated creation date in all translations.
Since we recommended the use of 'update-po' to translators in TRANSLATE,
this will lead to lots of unrelated changes every time a new translation
is added, even if no msgids change.
Thirdly, people who do not have meson installed are currently not able
to use the tooling it provides.
To fix these issues, this commit adds custom tooling around gettext: The
'update-pot.sh' script updates the pot and po files using xgettext(1)
and msgmerge(1), and 'init-po.sh' makes the necessary changes to LINGUAS
whilst also creating the relevant po file(s) with msginit(1).
We no longer need to refer to meson at all in TRANSLATE. Make sure to
mention the new scripts as well.
[1] https://github.com/mesonbuild/meson/issues/1739
[2] https://github.com/mesonbuild/meson/blob/a9e9b7c7501a3c8a5984a93879d1f309bf8c72aa/mesonbuild/scripts/gettext.py#L112
|
| |
|
|
|
|
|
| |
Translators may not be familiar with the code base or translation
process. This commit adds a small guide detailing common steps.
|
|
|
|
|
|
|
|
|
| |
Currently weltschmerz's make-based build system relies on GNU make
extensions. Change it to only use POSIX and other nearly universally
implemented features.
A small downside to this patch is that .po files must be listed in the
Makefile manually.
|
|
|
|
|
|
|
|
|
| |
Currently these localization files are only built when the user executes
`make install`. Since `make install` is often run as root, this leaves
files with root as their owner in the source directory. There are also
security implications to running compilers as root. This patch adds a
target `all` to the Makefile which depends on the localization files, so
that they are built as the user.
|
| |
|
|
|
|
|
| |
Since the default setting of ASCII-only could potentially bite us in the
long run, make sure to have xgettext interpret files as UTF-8.
|
|
|
|
|
|
|
| |
This is the mail .pot file that all future translations will use as a
base. Since the header is supposed to be filled out by translators in
the .po file, we can leave it as-is. This also makes subsequent updates
to this file easier, since it is generated by a tool.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the translation infrastructure now in place, make sure to mark
every user-bound message for translation. All but one of the strings in
terminal.ui are already marked. This commit marks all remaining messages
in the Vala code as well as the missing one from terminal.ui.
One of the messages in terminal.ui is a sample error message for the
infobar label. Since this message will never be visible to the user (the
code overrides the label's contents with any relevant warning messages),
we do not need to keep it marked.
Finally, give translators ample context for what they will have to
translate and fix a small inconsistency with the capitalization of
warning messages in configreader.vala.
|
|
|
|
|
|
|
|
|
| |
For some translatable strings we need to provide more context to the
translators. Conveniently, xgettext [1] provides the '-c[tag]' flag for
this. Make sure to pass along any comment containing "TRANSLATORS"
preceding a gettext call to the .pot file.
[1] https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
weltschmerz currently does not allow for translation and exists in
English only. This is a serious defect for people who do not speak that
language. The following series of commits aims to remedy this by adding
the necessary infrastructure and build steps to enable easy translation.
To do this we use GNU gettext[1]; its tooling is widely supported and a
de-facto standard. Since we need to tell gettext where to find the
compiled .mo translation files, have both the Makefile and meson pass
the locale directory to weltschmerz in form of a LOCALEDIR macro. The
translation domain will be "weltschmerz".
Not only will any strings in the Vala code have to be translated, we
need to make sure to translate terminal.ui and weltschmerz.desktop as
well. The former will be taken care of through POTFILES only, but for
the latter we have to define an intermediary build step. To ensure
compatibility with the Makefile, we suffix the desktop file with '.in'.
For now, LINGUAS and POTFILES remain empty. A future commit will
document all files needing translation. LINGUAS will be updated as
translations are completed.
[1] https://www.gnu.org/software/gettext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add ability to open a new weltschmerz terminal, either from context menu or
with a key combination. The new terminal is opened in the directory
indicated with OSC 7, allowing quickly opening additional terminals while
working.
Preferably this would launch the user's preferred terminal, as defined
in per-user settings, but this is not possible with glib[1]. For this
reason the option always launches another weltschmerz.
weltschmerz is launched using bare Process.spawn_async() on the name of the
program as defined in weltschmerz.vala. We considered using the AppInfo
database to retrieve the name of executable instead, but as there is no way
to query the database for terminal emulators we would have to go through
every single program installed on the computer and try to find one called
weltschmerz. As the change would merely replace the requirement of having
weltschmerz in PATH with the requirement of having a .desktop file with the
name in one of the standardized locations, this would not be worth it.
[1] https://gitlab.gnome.org/GNOME/glib/-/issues/338
|
|
|
|
|
|
|
|
|
| |
Currently, weltschmerz only copies URLs to GTK's default clipboard. This
is defined to be CLIPBOARD, leaving the PRIMARY selection unchanged.
Since all other normal copy/paste operations start with making a
selection and therefore set PRIMARY, make sure to also set the PRIMARY
selection when copying a URL. This brings weltschmerz in line with how
other GTK apps behave.
|
|
|
|
|
|
| |
No functional change, since vte_copy() defaults to false here. This
seems to be a remnant of when vte_copy() required specifying the 'html'
argument.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, in commit c49fbfb (Set minimum width and height in window
geometry, 2021-06-17), we set the minimum size of the window to one
cell. We do not yet include our fixes from 89f8571 (Calculate base_width
dynamically, 2021-06-18) and so do not account for the scrollbar when
setting the minimum size hints.
A minimum size of one cell can lead to issues like [1] when resizing
aggressively. A fix for this has been committed in [2], but not yet
merged to any release branch. Setting the minimum size to larger values
seems to work around this problem.
Therefore, define a minimum window size of 28 x 3 cells - just big
enough to still fit the search overlay. Make sure to include base_height
and base_width so that the right size will be reported to the window
manager.
[1] https://gitlab.gnome.org/GNOME/vte/-/issues/340
[2] https://gitlab.gnome.org/GNOME/vte/-/commit/b333d66879963637099dc0bc5a702f50f34da67e
|
| |
|
| |
|
|
|
|
|
|
| |
The Environment.get_variable() method returns an unowned value. Make
sure to mark it as such in our code. Whilst we're here, add a missing
space to the subsequent if branch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
weltschmerz sets window geometry hints to indicate how the terminal
window is to be sized and resized. New sizes are always kept at a
multiple of the character width and height. Effectively, this ensures
that terminal windows never have "negative space" that is not used for
any terminal output.
In order to account for padding and non-terminal widgets, one may
specify base_height and base_width. These values indicate how much space
to add in a final step, after the character width and heights have been
multiplied with the amount of columns and rows respectively. For
example, allowed window widths are always:
(char_width * N) + base_width
Currently, we always use a base_width of 2 * 2. This is to account for
the padding of 2 pixels as specified in terminal.css.
weltschmerz uses GtkScrolledWindow and overlay scrolling by default.
With overlay_scrolling enabled, the scrollbar does not take up any extra
space. The previous commit works around a problem with GtkScrolledWindow
and sets PolicyType.ALWAYS when overlay scrolling is turned off. This
means that we now also have to account for the size of that scrollbar.
Since we cannot simply query the size of the scrollbar, we have to be a
bit more creative. Use the full window width and subtract the width of
the terminal at startup (we know it is always 80 columns) to get the
amount of space taken up by "anything else". This includes VTE padding
and the scrollbar size.
Importantly, this needs only be done once and is completely agnostic to
any further changes to the terminal or font size (which affects the cell
width and height). We only assume that both the size of the scrollbar
and the amount of padding is constant, which we feel to be a reasonable
trade-off.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
weltschmerz uses GtkScrolledWindow to provide a vertical scrollbar to
the user. By default, this widget enables overlay scrolling. This means
that the scrollbar is painted "inside" the terminal, as if overlaid.
There's no configuration switch to turn this behaviour off, since we are
convinced that overlay scrolling is the right thing to do for terminals.
However, GTK allows users to turn off overlay scrolling in a global
setting [1] or by using the 'GTK_OVERLAY_SCROLLING' environment
variable. Some distributions turn overlay scrolling off by default.
When overlay scrolling is disabled, GtkScrolledWindow falls back to
rendering the scrollbar normally. Since our scrollbar policy is set to
AUTOMATIC, it is only drawn on demand. This means that it is initially
not be visible but can suddenly take up effective window space once it
appears.
When this happens, depending on what is going on in the terminal, one
can be left with a terminal that is scrolling down infinitely as the
reported column width flaps between two values: one accounting for the
size of the scrollbar and the other one ignoring it. Each time the
column width flaps, VTE sends SIGWINCH, possibly getting caught in an
infinite loop of internal resizes.
Since upstream declares GtkScrolledWindow incompatible with VTE [2] [3],
we have not attempted further investigation on this issue, but may
report an issue in the future.
We definitely want to keep using GtkScrolledWindow even with this
incompatibility - it is the most elegant and visually pleasing solution.
The alternative would be to use a GtkBox and supply our own scrollbar.
This scrollbar would either always be visible (even if there is nothing
to scroll) or entirely hidden. An implementation of this may be found in
the box-scroll branch. Note, however, that we do not guarantee that
branch to be up to date with the latest developments.
To work around this problem, detect when overlay scrolling is turned off
and fall back to PolicyType.ALWAYS. This ensures that the scrollbar is
always visible, mitigating the infinite resize loop. Crucially, compared
to the alternative solution, this will still enable users to enjoy
overlay scrolling if they (or their distribution) do not turn it off.
[1] https://developer.gnome.org/gtk3/stable/GtkSettings.html#GtkSettings--gtk-overlay-scrolling
[2] https://gitlab.gnome.org/GNOME/vte/-/issues/11#note_264921
[3] https://bugzilla.gnome.org/show_bug.cgi?id=733210#c2
|
|
|
|
|
| |
Even though PolicyType.AUTOMATIC should always keep it hidden, be
explicit about our wish to show it under no circumstances.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit c49fbfb (Set minimum width and height in window geometry,
2021-06-17) introduced a trailing comma to make subsequent changes to
the initializer less of a hassle.
However, Vala only accepts trailing commas starting with 0.52.3 [1]. It
would be petty to require this version, especially since older versions
of Vala can still compile weltschmerz without problems.
[1] https://gitlab.gnome.org/GNOME/vala/-/commit/20fcf9ce42dca52c707b96ddf7457931d6ee96f5
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
GTK 3.24 is the last release for the GTK 3 series [1]. New development
now only happens on GTK 4 and above. Therefore it is reasonable to
require this long-term stable version of GTK 3 instead of an older
candidate.
Since 3.24 deprecates the 'window-placement-set' property, remove it
fully as well.
[1] https://blog.gtk.org/2018/06/23/a-gtk-3-update
|
|
|
|
|
|
|
| |
These were deprecated in GTK 3.12 [1]. Instead use 'margin-start' and
'margin-end' for the same effect.
[1] https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget--margin-left
|
|
|
|
|
|
| |
This property was deprecated in GTK 3.20 [1]. Remove it.
[1] https://developer.gnome.org/gtk3/stable/GtkEntry.html#GtkEntry--shadow-type
|
|
|
|
|
|
|
| |
GTK-STOCK-OPEN was deprecated in GTK 3.10 [1]. Use the recommended named
icon 'document-open' icon instead.
[1] https://developer.gnome.org/gtk3/stable/gtk3-Stock-Items.html#GTK-STOCK-OPEN:CAPS
|
|
|
|
|
| |
This was done automatically by glade 3.38.2. There are no functional
changes.
|
|
|
|
|
|
|
|
|
| |
weltschmerz currently does not indicate any minimum size for its window
geometry. If the minimum size is not set, GtkWindow uses its requisition
as the minimum size [1]. Make sure, instead, that we control this value
and set it to one cell.
[1] https://valadoc.org/gdk-3.0/Gdk.Geometry.html
|
|
|
|
|
|
|
|
|
|
| |
Currently weltschmerz always uses the global GTK setting for cursor
blink, which means that the cursor blink setting is stored separately
from the rest of the configuration. Add a setting for overriding it in
the config file, so that all the relevant settings can be adjusted in
one standardized place.
Reviewed-by: Wolfgang Müller <wolf@oriole.systems>
|
|
|
|
|
|
| |
See [1] for background. This was motivated by a warning from valac-0.50.
[1] https://gitlab.gnome.org/GNOME/vala/-/issues/1121
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Two (relatively) new source files, namely configreader.vala and
utils.vala, were missing as prerequisites from the weltschmerz rule,
leading to the binary not being rebuilt if either file is changed.
|
| |
|
|
|
|
|
| |
There was no VTE-related functionality in this method, so we can find a
better place for it now that a dedicated utility class exists.
|
| |
|
|
|
|
|
|
|
| |
VTE can leverage the child program's support of OSC 7 to keep track of
the current directory. This commit adds support for opening said
directory in the default file manager, either by using a shortcut or by
activating a new entry in the context menu.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a "Copy to HTML" entry to the context menu. It is
active when VTE registers an active selection. Lines copied like this
will be put into the clipboard as formatted HTML, retaining nearly all
styling information.
For this, vte_copy now takes a boolean argument - whether or not to
format the lines copied as HTML. As two menu items now access vte_copy
directly, and there is no clean way of passing arguments to signal
handlers through terminal.ui, signals for both menu items are now
connected in the Vala code instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for the OSC 8 hyperlink escape sequence [1]. As
this is not a mature feature and there seem to be outstanding security
concerns [2], the setting that controls whether or not OSC 8 is
interpreted is disabled by default.
Just like gnome-terminal, weltschmerz will display a tooltip with the
canonicalized URI when hovering over a hyperlink.
[1] https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
[2] https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#security
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit improves and simplifies weltschmerz's configuration
handling. Obtaining and parsing the KeyFile is split out into
ConfigReader, which is fully agnostic of the specific configuration
values.
Config now contains all configuration values in the form of primitive
types or class instances, and no longer delegates access to the KeyFile
structure directly. This means that the configuration file is read once,
and then kept in the Config instance.
Indirectly this commit also fixes a bug where weltschmerz would segfault
if one of the palette entries contained an invalid value.
|
| |
|
| |
|
| |
|
| |
|