Skip to content

Commit

Permalink
Update calendar and floating point conversion dialogs after expressio…
Browse files Browse the repository at this point in the history
…n calculation; Reset special duodecimal symbols property after use of "doz"/"dozenal" conversion, and do not change the property for "duo"/"duodecimal" conversion; Fix metainfo file; Fix for Swedish translation
  • Loading branch information
hanna-kn committed Oct 6, 2024
1 parent b635c22 commit c98fb5b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion data/io.github.Qalculate.qalculate-qt.metainfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
<li>Update parsed expression and calculate-as-you-type result if variable, function, or unit in expression has changed</li>
<li>Improve support for small displays with low resolution/high scaling</li>
<li>Update chain mode to match behaviour in Gtk UI</li>
<li>Update calendar and floating point conversion dialogs after expression calculation</li>
<li>Portuguese (pt_PT) translation</li>
<li>Fixes for overwrite input mode
<li>Fixes for overwrite input mode</li>
<li>Fix unresponsive expression field in some cases after smart parentheses has been applied</li>
<li>Fix completion with both custom app font and custom expression font set</li>
<li>Fix input of max value for number argument</li>
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ parts:

qalculate-qt:
source: https://github.com/Qalculate/qalculate-qt/releases/download/v5.3.0/qalculate-qt-5.3.0.tar.gz
source-checksum: sha512/f60df88fcb58ca1366c98a491458ae6a808c11f32aa588678b1938c2f98750c22fa23cb14b447831fb70dec66f27136c5346b0f42bebd7fef4534262bade0b9d
source-checksum: sha512/841461dca4fa97d9dc3cff57de050b5c0d1dabe06c151149484a85b66540b038f6d3270ca96a34a65fbd9e71da26ce1068f2df76adc365e74a0e4d2220ccc909
plugin: qmake
build-snaps:
- kde-frameworks-5-core18-sdk
Expand Down
20 changes: 14 additions & 6 deletions src/qalculatewindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1419,6 +1419,7 @@ void QalculateWindow::triggerShortcut(int type, const std::string &value) {
Number save_nbase = CALCULATOR->customOutputBase();
to_base = 0;
to_bits = 0;
to_duo_syms = false;
Number nbase;
base_from_string(value, settings->printops.base, nbase);
CALCULATOR->setCustomOutputBase(nbase);
Expand Down Expand Up @@ -1456,6 +1457,7 @@ void QalculateWindow::triggerShortcut(int type, const std::string &value) {
base_from_string(value, settings->printops.base, nbase, false);
to_base = 0;
to_bits = 0;
to_duo_syms = false;
QAction *action = find_child_data(this, "group_outbase", settings->printops.base);
if(!action) action = customOutputBaseAction;
if(action) action->setChecked(true);
Expand Down Expand Up @@ -3274,6 +3276,7 @@ void QalculateWindow::onBaseClicked(int v, bool b, bool b_update) {
settings->printops.base = v;
to_base = 0;
to_bits = 0;
to_duo_syms = false;
QAction *action = find_child_data(this, "group_outbase", v);
if(action) action->setChecked(true);
if(b_update) resultFormatUpdated();
Expand Down Expand Up @@ -3630,6 +3633,7 @@ void QalculateWindow::setOption(std::string str) {
settings->printops.base = v;
to_base = 0;
to_bits = 0;
to_duo_syms = false;
QAction *action = find_child_data(this, "group_outbase", v);
if(!action) action = find_child_data(this, "group_outbase", BASE_CUSTOM);
if(action) {
Expand Down Expand Up @@ -4435,7 +4439,7 @@ void QalculateWindow::calculateExpression(bool force, bool do_mathoperation, Mat
if(!do_stack) stack_index = 0;

if(execute_str.empty()) {
to_fraction = 0; to_fixed_fraction = 0; to_prefix = 0; to_base = 0; to_bits = 0; to_nbase.clear(); to_caf = -1;
to_fraction = 0; to_fixed_fraction = 0; to_prefix = 0; to_base = 0; to_duo_syms = false; to_bits = 0; to_nbase.clear(); to_caf = -1;
}
bool current_expr = false;
if(str.empty() && !do_mathoperation) {
Expand Down Expand Up @@ -5853,6 +5857,8 @@ void QalculateWindow::calculateExpression(bool force, bool do_mathoperation, Mat
QApplication::clipboard()->setMimeData(qm);
}
}
if(!do_calendars && calendarConversionDialog && mstruct->isDateTime() && calendarConversionDialog->isVisible()) calendarConversionDialog->setDate(*mstruct->datetime());
if(fpConversionDialog && mstruct->isNumber() && mstruct->number().isReal() && fpConversionDialog->isVisible()) fpConversionDialog->setValue(*mstruct);
}

if(CALCULATOR->checkSaveFunctionCalled()) {
Expand Down Expand Up @@ -6318,7 +6324,7 @@ void QalculateWindow::autoCalculateTimeout() {
CALCULATOR->beginTemporaryStopMessages();

bool do_factors = false, do_pfe = false, do_expand = false, do_bases = false, do_calendars = false;
to_fraction = 0; to_fixed_fraction = 0; to_prefix = 0; to_base = 0; to_bits = 0; to_nbase.clear(); to_caf = -1;
to_fraction = 0; to_fixed_fraction = 0; to_prefix = 0; to_base = 0; to_duo_syms = false; to_bits = 0; to_nbase.clear(); to_caf = -1;
std::string to_str, str_conv;
CALCULATOR->parseComments(str, settings->evalops.parse_options);
if(str.empty()) {
Expand Down Expand Up @@ -6689,10 +6695,10 @@ void QalculateWindow::autoCalculateTimeout() {
bool do_to = false;

if(to_base != 0 || to_fraction > 0 || to_fixed_fraction >= 2 || to_prefix != 0 || (to_caf >= 0 && to_caf != settings->complex_angle_form)) {
if(to_base != 0 && (to_base != settings->printops.base || to_bits != settings->printops.binary_bits || (to_base == BASE_CUSTOM && to_nbase != CALCULATOR->customOutputBase()) || (to_base == BASE_DUODECIMAL && to_duo_syms != settings->printops.duodecimal_symbols))) {
if(to_base != 0 && (to_base != settings->printops.base || to_bits != settings->printops.binary_bits || (to_base == BASE_CUSTOM && to_nbase != CALCULATOR->customOutputBase()) || (to_base == BASE_DUODECIMAL && to_duo_syms && !settings->printops.duodecimal_symbols))) {
settings->printops.base = to_base;
settings->printops.binary_bits = to_bits;
settings->printops.duodecimal_symbols = to_duo_syms;
if(to_duo_syms) settings->printops.duodecimal_symbols = true;
if(to_base == BASE_CUSTOM) {
custom_base_set = true;
save_nbase = CALCULATOR->customOutputBase();
Expand Down Expand Up @@ -7141,10 +7147,10 @@ void QalculateWindow::setResult(Prefix *prefix, bool update_history, bool update

if(!do_stack) {
if(to_base != 0 || to_fraction > 0 || to_fixed_fraction >= 2 || to_prefix != 0 || (to_caf >= 0 && to_caf != settings->complex_angle_form)) {
if(to_base != 0 && (to_base != settings->printops.base || to_bits != settings->printops.binary_bits || (to_base == BASE_CUSTOM && to_nbase != CALCULATOR->customOutputBase()) || (to_base == BASE_DUODECIMAL && to_duo_syms != settings->printops.duodecimal_symbols))) {
if(to_base != 0 && (to_base != settings->printops.base || to_bits != settings->printops.binary_bits || (to_base == BASE_CUSTOM && to_nbase != CALCULATOR->customOutputBase()) || (to_base == BASE_DUODECIMAL && to_duo_syms && !settings->printops.duodecimal_symbols))) {
settings->printops.base = to_base;
settings->printops.binary_bits = to_bits;
settings->printops.duodecimal_symbols = to_duo_syms;
if(to_duo_syms) settings->printops.duodecimal_symbols = true;
if(to_base == BASE_CUSTOM) {
custom_base_set = true;
save_nbase = CALCULATOR->customOutputBase();
Expand Down Expand Up @@ -8225,6 +8231,7 @@ void QalculateWindow::outputBaseActivated() {
int v = qobject_cast<QAction*>(sender())->data().toInt();
to_base = 0;
to_bits = 0;
to_duo_syms = false;
if(v == BASE_CUSTOM) {
v = customOutputBaseEdit->value();
if(v > 2 && v <= 36) {
Expand All @@ -8243,6 +8250,7 @@ void QalculateWindow::onCustomOutputBaseChanged(int v) {
customOutputBaseAction->setChecked(true);
to_base = 0;
to_bits = 0;
to_duo_syms = false;
if(v > 2 && v <= 36) {
settings->printops.base = v;
} else {
Expand Down
2 changes: 1 addition & 1 deletion translations/qalculate-qt_sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6237,7 +6237,7 @@ Enkel</translation>
<message>
<location filename="../src/csvdialog.cpp" line="84"/>
<source>Includes headings</source>
<translation>Inkludera kolumnnamn</translation>
<translation>Inkluderar kolumnnamn</translation>
</message>
<message>
<location filename="../src/csvdialog.cpp" line="87"/>
Expand Down

0 comments on commit c98fb5b

Please sign in to comment.