...
 
Commits (24)
......@@ -34,11 +34,9 @@ build:ubuntu:
build:snap:
stage: build
image: snapcore/snapcraft
image: ubuntudesktop/gnome-3-28-1804
before_script:
- apt-get update
- apt-get install -q -y --no-install-recommends software-properties-common
- add-apt-repository -yu ppa:ubuntu-desktop/gnome-3-26
script: snapcraft
allow_failure: true
artifacts:
......
Overview of changes in gnome-calculator 3.32.2
* Snap build updates (Ken VanDine)
* Updated Chinese translation (Dingzhong Chen)
* Fixed numbers with octal prefix #110, #114 (Robert Roth)
Overview of changes in gnome-calculator 3.32.1
* Snap build update (Ken VanDine)
* Updated Basque translation (Asier Sarasua Garmendia)
* Updated French translation (Charles Monzat)
* Updated Croatian translation (Goran Vidović)
* Updated Danish translation (Ask Hjorth Larsen)
* Fixed CFA conversion rate #102 (Robert Roth)
* Removed copy icon from search provider result #103 (Robert Roth)
* Do not assume octal base for binary numbers #101 (Robert Roth)
* Use currency name instead of display name for conversion #106 (Robert Roth)
* Updated application icon in help (Andre Klapper)
* Fixed search provider results broken #104 (Pascal Nowack)
* Ignore keypresses while calculating result #47 (Robert Roth)
* Only allow entering one decimal point #5 (Robert Roth)
* Use meson build compatible with older meson (Robert Roth)
* Show thousands separator in unit converter #102 (Robert Roth)
Overview of changes in gnome-calculator 3.32.0
* Updated Esperanto translation (Kristjan Esperanto)
* Updated Korean translation (Changwoo Ryu)
......
......@@ -65,6 +65,38 @@
<translation type="gettext">gnome-calculator</translation>
<content_rating type="oars-1.1" />
<releases>
<release version="3.32.2" date="2019-06-26">
<description>
<p>Overview of changes in gnome-calculator 3.32.2</p>
<ul>
<li>Snap build updates (Ken VanDine)</li>
<li>Updated Chinese translation (Dingzhong Chen)</li>
<li>Fixed numbers with octal prefix #110, #114 (Robert Roth)</li>
</ul>
</description>
</release>
<release version="3.32.1" date="2019-04-08">
<description>
<p>Overview of changes in gnome-calculator 3.32.1</p>
<ul>
<li>Snap build update (Ken VanDine)</li>
<li>Updated Basque translation (Asier Sarasua Garmendia)</li>
<li>Updated French translation (Charles Monzat)</li>
<li>Updated Croatian translation (Goran Vidović)</li>
<li>Updated Danish translation (Ask Hjorth Larsen)</li>
<li>Fixed CFA conversion rate #102 (Robert Roth)</li>
<li>Removed copy icon from search provider result #103 (Robert Roth)</li>
<li>Do not assume octal base for binary numbers #101 (Robert Roth)</li>
<li>Use currency name instead of display name for conversion #106 (Robert Roth)</li>
<li>Updated application icon in help (Andre Klapper)</li>
<li>Fixed search provider results broken #104 (Pascal Nowack)</li>
<li>Ignore keypresses while calculating result #47 (Robert Roth)</li>
<li>Only allow entering one decimal point #5 (Robert Roth)</li>
<li>Use meson build compatible with older meson (Robert Roth)</li>
<li>Show thousands separator in unit converter #102 (Robert Roth)</li>
</ul>
</description>
</release>
<release version="3.32.0" date="2019-03-11">
<description>
<p>Overview of changes in gnome-calculator 3.32.0</p>
......
help/C/figures/logo32.png

1.33 KB | W: | H:

help/C/figures/logo32.png

624 Bytes | W: | H:

help/C/figures/logo32.png
help/C/figures/logo32.png
help/C/figures/logo32.png
help/C/figures/logo32.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -338,7 +338,7 @@ public class CurrencyManager : Object
/* Set some fixed rates */
set_ecb_fixed_rate ("EEK", "0.06391", eur_rate);
set_ecb_fixed_rate ("CFA", "0.152449", eur_rate);
set_ecb_fixed_rate ("CFA", "0.00152449", eur_rate);
Xml.Parser.init ();
var filename = get_ecb_rate_filepath ();
......
......@@ -135,6 +135,8 @@ public class MathEquation : Gtk.SourceBuffer
private bool in_reformat;
private bool in_delete;
private uint in_progress_timeout;
private uint looking_for_answer_timeout;
private bool _in_solve;
public bool in_solve
......@@ -794,8 +796,8 @@ public class MathEquation : Gtk.SourceBuffer
var text = serializer.to_string (x);
if (representation_base != 0)
serializer.set_representation_base (serializer.get_base ());
this.history_signal (get_current_state ().expression, x, serializer.get_base(), representation_base); /*emits signal to enter a new entry into history-view */
serializer.set_representation_base (number_base);
this.history_signal (get_current_state ().expression, x, number_base, representation_base); /*emits signal to enter a new entry into history-view */
set_text (text, -1);
state.ans = x;
......@@ -891,7 +893,34 @@ public class MathEquation : Gtk.SourceBuffer
public void insert_numeric_point ()
{
insert (serializer.get_radix ().to_string ());
Gtk.TextIter iter_prev;
get_iter_at_mark (out iter_prev, get_insert ());
/** go back to the first digit of the currently entered number **/
while (iter_prev.backward_char () && (iter_prev.get_char () == serializer.get_thousands_separator ()
|| iter_prev.get_char ().isdigit ()
|| iter_prev.get_char () == serializer.get_radix ()))
; // do nothing
if (!iter_prev.is_start ())
iter_prev.forward_char ();
var current_number = "";
/** find the currently entered number, ignoring thousand separators and including decimal point **/
while (iter_prev.get_char () == serializer.get_thousands_separator ()
|| iter_prev.get_char ().isdigit ()
|| iter_prev.get_char () == serializer.get_radix ()) {
if (iter_prev.get_char ().isdigit ()) {
current_number += iter_prev.get_char ().to_string ();
}
if (iter_prev.get_char () == serializer.get_radix ()) {
current_number += ".";
}
iter_prev.forward_char ();
}
/** if the current number doesn't contain decimal point yet, add one */
if (!current_number.contains ("."))
insert (serializer.get_radix ().to_string ());
}
public void insert_number (Number x)
......@@ -922,7 +951,7 @@ public class MathEquation : Gtk.SourceBuffer
private Number? parse (string text, out uint representation_base, out ErrorCode error_code = null, out string? error_token = null, out uint? error_start = null, out uint error_end = null)
{
var equation = new MEquation (this, text);
equation.base = serializer.get_base ();
equation.base = number_base;
equation.wordlen = word_size;
equation.angle_units = angle_units;
......@@ -1077,8 +1106,8 @@ public class MathEquation : Gtk.SourceBuffer
new Thread<void*> ("", solve_real);
Timeout.add (50, look_for_answer);
Timeout.add (100, show_in_progress);
looking_for_answer_timeout = Timeout.add (50, look_for_answer);
in_progress_timeout = Timeout.add (100, show_in_progress);
}
/* Fix the offsets to consider thousand separators inserted by the gui. */
......@@ -1181,6 +1210,8 @@ public class MathEquation : Gtk.SourceBuffer
{
var x = number;
var factors = x.factorize ();
var result = new SolveData ();
queue.push (result);
var text = "";
var i = 0;
......@@ -1192,9 +1223,7 @@ public class MathEquation : Gtk.SourceBuffer
i++;
}
var result = new SolveData ();
result.text_result = text;
queue.push (result);
return null;
}
......@@ -1217,8 +1246,8 @@ public class MathEquation : Gtk.SourceBuffer
new Thread<void*> ("", factorize_real);
Timeout.add (50, look_for_answer);
Timeout.add (100, show_in_progress);
looking_for_answer_timeout = Timeout.add (50, look_for_answer);
in_progress_timeout = Timeout.add (100, show_in_progress);
}
public void delete_next ()
......@@ -1255,6 +1284,12 @@ public class MathEquation : Gtk.SourceBuffer
number_mode = NumberMode.NORMAL;
set_text ("", -1);
clear_ans (false);
if (in_solve) {
_in_solve = false;
queue.try_pop ();
Source.remove (looking_for_answer_timeout);
Source.remove (in_progress_timeout);
}
}
public void shift (int count)
......
......@@ -21,7 +21,6 @@
*
* FOR A GENERAL DESCRIPTION OF THE PHILOSOPHY AND DESIGN OF MP,
* SEE - R. P. BRENT, A FORTRAN MULTIPLE-PRECISION ARITHMETIC
* PACKAGE, ACM TRANS. MATH. SOFTWARE 4 (MARCH 1978), 57-70.
* SOME ADDITIONAL DETAILS ARE GIVEN IN THE SAME ISSUE, 71-81.
* FOR DETAILS OF THE IMPLEMENTATION, CALLING SEQUENCES ETC. SEE
* THE MP USERS GUIDE.
......@@ -1124,18 +1123,6 @@ private static int parse_literal_prefix (string str, ref int prefix_len)
if (new_base != 0)
prefix_len = 2;
if (prefix.isdigit ())
{
unichar c;
bool all_digits = true;
for (int i = 2; str.get_next_char (ref i, out c) && all_digits;)
all_digits = c.isdigit ();
if (all_digits)
new_base = 8;
}
return new_base;
}
......
......@@ -347,6 +347,7 @@ public class Unit : Object
{
serializer = new Serializer (DisplayFormat.AUTOMATIC, 10, 2);
serializer.set_leading_digits (6);
serializer.set_show_thousands_separators (true);
_name = name;
_display_name = display_name;
......
project('gnome-calculator', ['c', 'vala'],
version: '3.32.0',
version: '3.32.2',
meson_version: '>= 0.42',
license: 'GPLv3+',
)
......
......@@ -25,9 +25,9 @@
msgid ""
msgstr ""
"Project-Id-Version: gcalctool\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-calculator/"
"issues\n"
"POT-Creation-Date: 2019-02-06 18:32+0000\n"
"Report-Msgid-Bugs-To: "
"https://gitlab.gnome.org/GNOME/gnome-calculator/issues\n"
"POT-Creation-Date: 2019-03-25 13:25+0000\n"
"PO-Revision-Date: 2019-02-13 11:33+0100\n"
"Last-Translator: Alan Mortensen <alanmortensen.am@gmail.com>\n"
"Language-Team: Danish <dansk@dansk-gruppen.dk>\n"
......@@ -78,8 +78,8 @@ msgid ""
"depreciation, and many others."
msgstr ""
"Finanstilstanden understøtter adskillige udregninger inklusive periodisk "
"renterate, nuværende og fremtidig værdi, dobbelt faldende- og ret linje-"
"afskrivning og mange andre."
"renterate, nuværende og fremtidig værdi, dobbelt faldende- og ret "
"linje-afskrivning og mange andre."
#: data/org.gnome.Calculator.appdata.xml.in:27
msgid ""
......@@ -88,8 +88,8 @@ msgid ""
"character to character code conversion, and more."
msgstr ""
"Programmeringstilstand understøtter konvertering mellem almindelige grundtal "
"(binær, oktal, decimal og heksadecimal), boolesk algebra, etter- og toer-"
"kompliment, tegn til tegnkode-konvertering med mere."
"(binær, oktal, decimal og heksadecimal), boolesk algebra, etter- og "
"toer-kompliment, tegn til tegnkode-konvertering med mere."
#: data/org.gnome.Calculator.appdata.xml.in:36
msgid "GNOME Calculator in Basic Mode"
......@@ -121,14 +121,8 @@ msgstr "Lommeregner"
#: data/org.gnome.Calculator.desktop.in:6
msgid "calculation;arithmetic;scientific;financial;"
msgstr ""
"udregning;aritmetik;videnskabelig;finansiel;finans;regning;lommeregner;"
"matematik;"
#. Translators: Do NOT translate or transliterate this text (this is an icon file name)!
#: data/org.gnome.Calculator.desktop.in:9
#| msgid "gnome-calculator"
msgid "org.gnome.Calculator"
msgstr "org.gnome.Calculator"
""
"udregning;aritmetik;videnskabelig;finansiel;finans;regning;lommeregner;matematik;"
#: data/org.gnome.calculator.gschema.xml:25
msgid "Accuracy value"
......@@ -2667,8 +2661,9 @@ msgstr ""
"Ask Hjorth Larsen\n"
"Alan Mortensen\n"
"\n"
"Dansk-gruppen <dansk@dansk-gruppen.dk>\n"
"Mere info: http://www.dansk-gruppen.dk"
"Dansk-gruppen\n"
"Websted http://dansk-gruppen.dk\n"
"E-mail <dansk@dansk-gruppen.dk>"
#: src/gnome-calculator.vala:334 src/math-window.ui:71
msgid "About Calculator"
......@@ -2983,6 +2978,9 @@ msgstr "Menu"
msgid "_Quit"
msgstr "_Afslut"
#~ msgid "org.gnome.Calculator"
#~ msgstr "org.gnome.Calculator"
#~ msgid " in "
#~ msgstr " i "
......@@ -3020,7 +3018,7 @@ msgstr "_Afslut"
#~ msgid "degR,˚R,˚Ra"
#~ msgstr "gradR,˚R,˚Ra"
# right og left shift er bitvise operatorer, der forskyder N bit til højre eller venstre. Places og bit er derfor det samme i denne sammenhæng
#~ # right og left shift er bitvise operatorer, der forskyder N bit til højre eller venstre. Places og bit er derfor det samme i denne sammenhæng
#~ msgid "_%d place"
#~ msgid_plural "_%d places"
#~ msgstr[0] "_%d bit"
......@@ -3140,8 +3138,7 @@ msgstr "_Afslut"
#~ "GNU General Public License for more details.\n"
#~ "\n"
#~ "You should have received a copy of the GNU General Public License\n"
#~ "along with Gcalctool; if not, write to the Free Software Foundation, "
#~ "Inc.,\n"
#~ "along with Gcalctool; if not, write to the Free Software Foundation, Inc.,\n"
#~ "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA"
#~ msgstr ""
#~ "Gcalctool er fri software. Du kan redistribuere og/eller modificere det\n"
......@@ -3149,11 +3146,10 @@ msgstr "_Afslut"
#~ "er udgivet af Free Software Foundation. Enten version 2 af licensen\n"
#~ "eller (efter eget valg) enhver senere version.\n"
#~ "\n"
#~ "Gcalctool distribueres i håb om at det vil vise sig nyttigt, men UDEN "
#~ "NOGEN \n"
#~ "Gcalctool distribueres i håb om at det vil vise sig nyttigt, men UDEN NOGEN "
#~ "\n"
#~ "FORM FOR GARANTI, uden selv de underforståede garantier omkring \n"
#~ "SALGBARHED eller EGNETHED TIL ET BESTEMT FORMÅL. Yderligere detaljer "
#~ "kan \n"
#~ "SALGBARHED eller EGNETHED TIL ET BESTEMT FORMÅL. Yderligere detaljer kan \n"
#~ "læses i GNU General Public License.\n"
#~ "\n"
#~ "Du skulle have modtaget en kopi af GNU General Public License sammen med\n"
......@@ -3245,12 +3241,12 @@ msgstr "_Afslut"
#~ "The initial calculator mode. Valid values are \"BASIC\", \"FINANCIAL\", "
#~ "\"LOGICAL\", \"SCIENTIFIC\" and \"PROGRAMMING\""
#~ msgstr ""
#~ "Lommeregnerens begyndelsestilstand. Gyldige værdier er “BASIC”, "
#~ "“FINANCIAL”, “LOGICAL”, “SCIENTIFIC” og “PROGRAMMING”"
#~ "Lommeregnerens begyndelsestilstand. Gyldige værdier er “BASIC”, “FINANCIAL”, "
#~ "“LOGICAL”, “SCIENTIFIC” og “PROGRAMMING”"
#~ msgid ""
#~ "The initial trigonometric type. Valid values are \"DEG\" (degrees), \"GRAD"
#~ "\" (gradians) and \"RAD\" (radians)."
#~ "The initial trigonometric type. Valid values are \"DEG\" (degrees), \"GRAD\" "
#~ "(gradians) and \"RAD\" (radians)."
#~ msgstr ""
#~ "Den trigonometriske type ved start. Gyldige værdier er “DEG” (degrees), "
#~ "“GRAD” (gradians) og “RAD” (radians)."
......@@ -3261,8 +3257,7 @@ msgstr "_Afslut"
#~ msgid "The initial y-coordinate for the window"
#~ msgstr "Vinduets start-y-koordinat"
#~ msgid ""
#~ "The number of pixels to place the window from the left of the screen."
#~ msgid "The number of pixels to place the window from the left of the screen."
#~ msgstr ""
#~ "Pixelpositionen, hvor vinduet placeres, målt fra venstre side af skærmen."
......@@ -3273,14 +3268,13 @@ msgstr "_Afslut"
#~ msgstr "Trigonometrisk type"
#~ msgid ""
#~ "Converts between different currencies. Enter the amount and the currency "
#~ "you want to convert from on the upper row, and the currency you want to "
#~ "convert to on the lower row, and the amount will be displayed on the "
#~ "lower row."
#~ "Converts between different currencies. Enter the amount and the currency you "
#~ "want to convert from on the upper row, and the currency you want to convert "
#~ "to on the lower row, and the amount will be displayed on the lower row."
#~ msgstr ""
#~ "Omregner mellem forskellige valutaer. Indtast beløbet samt den valuta, du "
#~ "vil konvertere fra i øvre række, og valuaten du vil konvertere til i "
#~ "nedre række. Dermed vil det omregnede beløb blive vist i nedre række."
#~ "vil konvertere fra i øvre række, og valuaten du vil konvertere til i nedre "
#~ "række. Dermed vil det omregnede beløb blive vist i nedre række."
#~ msgid "Currency Conversion"
#~ msgstr "Valutaomregning"
......@@ -3411,8 +3405,8 @@ msgstr "_Afslut"
#~ msgstr "Du har ingen opdaterede valutakurser. Vil du hente nogle nu?"
#~ msgid ""
#~ "Currency rates could not be downloaded. You may receive inaccurate "
#~ "results, or you may not receive any results at all."
#~ "Currency rates could not be downloaded. You may receive inaccurate results, "
#~ "or you may not receive any results at all."
#~ msgstr ""
#~ "Kunne ikke hente nogen valutakurser. Du vil måske få upræcise resultater, "
#~ "eller ingen resultater overhovedet."
......@@ -4271,8 +4265,7 @@ msgstr "_Afslut"
#~ msgid ""
#~ "You should have received a copy of the GNU General Public License\n"
#~ "along with Gcalctool; if not, write to the Free Software Foundation, "
#~ "Inc.,\n"
#~ "along with Gcalctool; if not, write to the Free Software Foundation, Inc.,\n"
#~ "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA\n"
#~ msgstr ""
#~ "Du skulle have modtaget en kopi af GNU General Public License\n"
......@@ -4283,11 +4276,11 @@ msgstr "_Afslut"
#~ msgstr "Tilstandsændring rydder beregningen"
#~ msgid ""
#~ "When you change modes, the current calculation will be cleared, and the "
#~ "base will be reset to decimal."
#~ "When you change modes, the current calculation will be cleared, and the base "
#~ "will be reset to decimal."
#~ msgstr ""
#~ "Når du ændrer tilstand, vil den nuværende beregning blive slettet og "
#~ "basen sat til decimal."
#~ "Når du ændrer tilstand, vil den nuværende beregning blive slettet og basen "
#~ "sat til decimal."
#~ msgid "_Do not warn me again"
#~ msgstr "_Advar mig ikke igen"
......@@ -4328,7 +4321,7 @@ msgstr "_Afslut"
#~ msgid "Constants"
#~ msgstr "Konstanter"
# Gad vide hvad E er. Eulers tal hedder jo e.
#~ # Gad vide hvad E er. Eulers tal hedder jo e.
#~ msgid "E to the x"
#~ msgstr "E opløftet til x"
......@@ -4607,3 +4600,4 @@ msgstr "_Afslut"
#~ msgid "/sep1"
#~ msgstr "/sep1"
This diff is collapsed.
......@@ -15,22 +15,23 @@
# Laurent Coudeur <laurentc@iol.ie>, 2009, 2010.
# Julien Hardelin <jhardlin@orange.fr>, 2015.
# Guillaume Bernard <contact.guib@laposte.net>, 2017
# Charles Monzat <charles.monzat@free.fr>, 2019.
#
msgid ""
msgstr ""
"Project-Id-Version: gnome-calculator master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gnome-calculator/"
"issues\n"
"POT-Creation-Date: 2019-02-06 18:32+0000\n"
"PO-Revision-Date: 2019-02-20 21:37+0100\n"
"Last-Translator: Guillaume Bernard <associations@guillaume-bernard.fr>\n"
"POT-Creation-Date: 2019-03-11 20:10+0000\n"
"PO-Revision-Date: 2019-03-25 11:32+0100\n"
"Last-Translator: Charles Monzat <charles.monzat@free.fr>\n"
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
"Language: fr\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: Poedit 2.2.1\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
"X-Generator: Gtranslator 3.32.0\n"
#: data/org.gnome.Calculator.appdata.xml.in:7
msgid "GNOME Calculator"
......@@ -2771,22 +2772,22 @@ msgstr "_Taille du mot :"
#. Word size combo: 8 bits
#: src/math-preferences.vala:175
msgid "8 bits"
msgstr "8 bits"
msgstr "8 bits"
#. Word size combo: 16 bits
#: src/math-preferences.vala:177
msgid "16 bits"
msgstr "16 bits"
msgstr "16 bits"
#. Word size combo: 32 bits
#: src/math-preferences.vala:179
msgid "32 bits"
msgstr "32 bits"
msgstr "32 bits"
#. Word size combo: 64 bits
#: src/math-preferences.vala:181
msgid "64 bits"
msgstr "64 bits"
msgstr "64 bits"
#. Preferences dialog: Label for exchange rate refresh interval combo box
#: src/math-preferences.vala:187
......@@ -2831,7 +2832,7 @@ msgstr "Afficher l’aide"
#: src/math-shortcuts.ui:41
msgctxt "shortcut window"
msgid "Clear history"
msgstr "Purger l'historique"
msgstr "Purger lhistorique"
#: src/math-shortcuts.ui:48
msgctxt "shortcut window"
......
This diff is collapsed.
This diff is collapsed.
......@@ -46,10 +46,13 @@ install_data('org.gnome.Calculator-search-provider.ini',
# The DBUS service file
dbusconf = configuration_data()
dbusconf.set('libexecdir', libexec_dir)
configure_file(
configuration_file = configure_file(
input: 'org.gnome.Calculator.SearchProvider.service.in',
output: 'org.gnome.Calculator.SearchProvider.service',
configuration: dbusconf,
install: true,
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
)
install_data(configuration_file,
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
)
\ No newline at end of file
......@@ -108,7 +108,7 @@ public class SearchProvider : Object
try
{
var subprocess = yield solve_subprocess (normalized_equation);
var subprocess = yield solve_subprocess (equation);
yield subprocess.communicate_utf8_async (null, cancellable, out result, null);
subprocess.wait_check (cancellable);
}
......@@ -187,7 +187,6 @@ public class SearchProvider : Object
metadata[copy_index] = new HashTable<string, Variant> (str_hash, str_equal);
metadata[copy_index].insert ("id", COPY_TO_CLIPBOARD_ID);
metadata[copy_index].insert ("name", _("Copy"));
metadata[copy_index].insert ("icon", "edit-copy");
metadata[copy_index].insert ("description", _("Copy result to clipboard"));
}
......
......@@ -70,8 +70,7 @@ parts:
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- build-essential
- libgtk-3-dev
- gcc
override-build: |
snapcraftctl build
mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform
......@@ -79,9 +78,8 @@ parts:
after: [desktop-gnome-platform]
source: https://gitlab.gnome.org/GNOME/gtksourceview.git
source-type: git
# source-tag: 4.0.3
plugin: autotools
configflags: [--prefix=/usr]
plugin: meson
meson-parameters: [--prefix=/usr, -Dc_args="-Wno-error=undef"]
organize:
snap/gtksourceview/current/usr: usr
build-packages:
......@@ -89,6 +87,7 @@ parts:
- gettext
- gobject-introspection
- gtk-doc-tools
- libfribidi-dev
- libgirepository1.0-dev
- libglib2.0-dev
- libgtk-3-dev
......@@ -101,14 +100,16 @@ parts:
after: [gtksourceview]
source: .
plugin: meson
meson-parameters: [--prefix=/snap/gnome-calculator/current/usr]
meson-parameters: [--prefix=/snap/gnome-calculator/current/usr, -Dvala_args="--vapidir=$SNAPCRAFT_STAGE/usr/share/vala/vapi"]
organize:
snap/gnome-calculator/current/usr: usr
# overriding vapidir in build-environment doesn't seem to work
override-build: |
sed -i.bak -e "s|vapi_dir]|vapi_dir, '--vapidir=$SNAPCRAFT_STAGE/usr/share/vala/vapi']|g" meson.build
sed -i.bak -e "s|config',|config', '--vapidir=$SNAPCRAFT_STAGE/usr/share/vala/vapi',|g" src/meson.build
sed -i.bak -e 's|Icon=org.gnome.Calculator$|Icon=${SNAP}/meta/gui/org.gnome.Calculator.svg|g' data/org.gnome.Calculator.desktop.in
sed -i.bak -e 's|media: gnome_calculator_help_media|media: gnome_calculator_help_media, symlink_media: false|g' help/meson.build
snapcraftctl build
mkdir -p $SNAPCRAFT_PART_INSTALL/meta/gui/
cp ../src/data/icons/hicolor/scalable/apps/org.gnome.Calculator.svg $SNAPCRAFT_PART_INSTALL/meta/gui/
build-packages:
- desktop-file-utils
- gettext
......@@ -116,14 +117,20 @@ parts:
- appstream-util
- gnome-pkg-tools
- intltool
- libgee-0.8-dev
- libglib2.0-dev
- libgtk-3-dev
- libxml2-dev
- libsoup2.4-dev
- libmpc-dev
- libmpfr-dev
- libvala-0.40-dev
- valac
- yelp-tools
stage-packages:
- libfribidi0
prime:
- "-usr/lib/gnome-calculator/libcalculator.a"
- "-usr/share/appdata"
- "-usr/share/vala"
- "-usr/lib/*/pkgconfig"
......@@ -244,7 +244,7 @@ public class MathConverter : Gtk.Grid
var z = convert_equation (x, out from_unit, out to_unit);
if (z != null && from_unit != null && to_unit != null)
{
equation.set ("%s %s %s %s".printf(equation.serializer.to_string (x), from_unit.display_name, _("in"), to_unit.display_name));
equation.set ("%s %s %s %s".printf(equation.serializer.to_string (x), from_unit.name, _("in"), to_unit.name));
equation.solve ();
}
}
......
......@@ -148,6 +148,20 @@ public class MathDisplay : Gtk.Viewport
private bool key_press_cb (Gdk.EventKey event)
{
/* Clear on escape */
var state = event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK);
if ((event.keyval == Gdk.Key.Escape && state == 0) ||
(event.keyval == Gdk.Key.Delete && state == Gdk.ModifierType.SHIFT_MASK))
{
equation.clear ();
status_changed_cb ();
return true;
}
/* Ignore keypresses while calculating */
if (equation.in_solve)
return true;
/* Treat keypad keys as numbers even when numlock is off */
uint new_keyval = 0;
switch (event.keyval)
......@@ -194,7 +208,6 @@ public class MathDisplay : Gtk.Viewport
return key_press_event (new_event);
}
var state = event.state & (Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK);
var c = Gdk.keyval_to_unicode (event.keyval);
/* Solve on enter */
......@@ -206,17 +219,10 @@ public class MathDisplay : Gtk.Viewport
return true;
}
/* Clear on escape */
if ((event.keyval == Gdk.Key.Escape && state == 0) ||
(event.keyval == Gdk.Key.Delete && state == Gdk.ModifierType.SHIFT_MASK))
{
equation.clear ();
return true;
}
/* Numeric keypad will insert '.' or ',' depending on layout */
if ((event.keyval == Gdk.Key.KP_Decimal) ||
(event.keyval == Gdk.Key.KP_Separator) ||
(event.keyval == Gdk.Key.period) ||
(event.keyval == Gdk.Key.decimalpoint) ||
(event.keyval == Gdk.Key.comma))
{
......
......@@ -234,8 +234,8 @@ private void test_equations ()
test ("0b5", "", ErrorCode.MP); test ("0B5", "", ErrorCode.MP); test ("0o5", "5", 0); test ("0O5", "5", 0); test ("005", "5", 0); test ("5", "5", 0); test ("0x5", "5", 0); test ("0X5", "5", 0);
test ("0b6", "", ErrorCode.MP); test ("0B6", "", ErrorCode.MP); test ("0o6", "6", 0); test ("0O6", "6", 0); test ("006", "6", 0); test ("6", "6", 0); test ("0x6", "6", 0); test ("0X6", "6", 0);
test ("0b7", "", ErrorCode.MP); test ("0B7", "", ErrorCode.MP); test ("0o7", "7", 0); test ("0O7", "7", 0); test ("007", "7", 0); test ("7", "7", 0); test ("0x7", "7", 0); test ("0X7", "7", 0);
test ("0b8", "", ErrorCode.MP); test ("0B8", "", ErrorCode.MP); test ("0o8", "", ErrorCode.UNKNOWN_VARIABLE); test ("0O8", "", ErrorCode.UNKNOWN_VARIABLE); test ("008", "", ErrorCode.INVALID); test ("8", "8", 0); test ("0x8", "8", 0); test ("0X8", "8", 0);
test ("0b9", "", ErrorCode.MP); test ("0B9", "", ErrorCode.MP); test ("0o9", "", ErrorCode.UNKNOWN_VARIABLE); test ("0O9", "", ErrorCode.UNKNOWN_VARIABLE); test ("009", "", ErrorCode.INVALID); test ("9", "9", 0); test ("0x9", "9", 0); test ("0X9", "9", 0);
test ("0b8", "", ErrorCode.MP); test ("0B8", "", ErrorCode.MP); test ("0o8", "", ErrorCode.UNKNOWN_VARIABLE); test ("0O8", "", ErrorCode.UNKNOWN_VARIABLE); test ("8", "8", 0); test ("0x8", "8", 0); test ("0X8", "8", 0);
test ("0b9", "", ErrorCode.MP); test ("0B9", "", ErrorCode.MP); test ("0o9", "", ErrorCode.UNKNOWN_VARIABLE); test ("0O9", "", ErrorCode.UNKNOWN_VARIABLE); test ("9", "9", 0); test ("0x9", "9", 0); test ("0X9", "9", 0);
// // /* Note : "B", "b", "C", "c", "F", "f" are units, and hence have different error code. */
test ("0bA", "", ErrorCode.UNKNOWN_VARIABLE); test ("0BA", "", ErrorCode.UNKNOWN_VARIABLE); test ("0oA", "", ErrorCode.UNKNOWN_VARIABLE); test ("0OA", "", ErrorCode.UNKNOWN_VARIABLE); test ("00A", "", ErrorCode.UNKNOWN_VARIABLE); test ("A", "", ErrorCode.UNKNOWN_VARIABLE); test ("0xA", "10", 0); test ("0XA", "10", 0);
test ("0bB", "", ErrorCode.UNKNOWN_VARIABLE); test ("0BB", "", ErrorCode.UNKNOWN_VARIABLE); test ("0oB", "", ErrorCode.UNKNOWN_VARIABLE); test ("0OB", "", ErrorCode.UNKNOWN_VARIABLE); test ("00B", "", ErrorCode.INVALID); test ("B", "", ErrorCode.INVALID); test ("0xB", "11", 0); test ("0XB", "11", 0);
......@@ -700,7 +700,6 @@ private void test_base_conversion ()
test ("x in dec", "2", 0);
test ("x in hex", "2₁₆", 0);
test ("012 in dec", "10", 0);
test ("0b1010 in dec", "10", 0);
test ("0B1010 in dec", "10", 0);
test ("0o012 in dec", "10", 0);
......
......@@ -134,7 +134,6 @@ private void test_base_conversion (Serializer s)
test_number (s, "0b1010", 10, 10, "10");
test_number (s, "0B1010", 10, 10, "10");
test_number (s, "012", 10, 10, "10");
test_number (s, "0o012", 10, 10, "10");
test_number (s, "0O012", 10, 10, "10");
test_number (s, "0xA", 10, 10, "10");
......@@ -142,7 +141,6 @@ private void test_base_conversion (Serializer s)
test_number (s, "0b10103", 10, 10, null);
test_number (s, "0B10103", 10, 10, null);
test_number (s, "0128", 10, 10, null);
test_number (s, "0o0128", 10, 10, null);
test_number (s, "0O0128", 10, 10, null);
test_number (s, "0xAH", 10, 10, null);
......