Periodic table (issue #25); Fix completion with title match; Only do conversion on units tool button submenu item activation if the whole expression is selected; Use current result, if expression has not changed, as prefilled value in insert function dialog; Mark data sets, functions, units, variables, and periodic table dialogs as regular windows; Fix set always on top; Use "descriptive name" instead of "title" in data set and property edit dialogs; Remove calendars and percentage tool buttons; Increase default height of main window; Do not add hidden objects to favourites
@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 12 12"
|
||||
width="12"
|
||||
height="12"
|
||||
version="1.1"
|
||||
id="svg1492"
|
||||
sodipodi:docname="edit-paste-12.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1494"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="true"
|
||||
inkscape:zoom="39.958333"
|
||||
inkscape:cx="12.362878"
|
||||
inkscape:cy="12"
|
||||
inkscape:current-layer="svg1492" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="color:#232629;fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 3,0 V 1.0000002 H 1 V 12 h 4 1 4 1 v -1 -3.9999998 -6 H 9 V 0 Z M 2,2.0000003 h 1 v 1 h 6 v -1 h 1 V 4.0000002 9.9999998 11 H 6 5 2 V 9.9999998 4.0000002 Z m 1,2.9999999 v 1 h 5 v -1 z m 0,3 v 1 h 3 v -1 z"
|
||||
class="ColorScheme-Text"
|
||||
id="path3527" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="svg1087"
|
||||
sodipodi:docname="edit-paste-16.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1089"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="59.9375"
|
||||
inkscape:cx="7.991658"
|
||||
inkscape:cy="8"
|
||||
inkscape:current-layer="svg1087" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="color:#232629;fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 4,0 V 2 H 2 1 V 16 H 2 15 V 15 2 H 14 12 V 0 Z M 2,3 H 3 V 5 H 13 V 3 h 1 V 15 H 2 Z m 2,3 v 1 h 8 V 6 Z M 4,8.9999995 V 9.9999994 H 9.9999997 V 8.9999995 Z M 4,12 v 1 h 3 v -1 z"
|
||||
class="ColorScheme-Text"
|
||||
id="path996" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"
|
||||
version="1.1"
|
||||
id="svg1492"
|
||||
sodipodi:docname="edit-paste-24.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1494"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="true"
|
||||
inkscape:zoom="39.958333"
|
||||
inkscape:cx="12.362878"
|
||||
inkscape:cy="12"
|
||||
inkscape:current-layer="svg1492" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g
|
||||
id="g1356"
|
||||
style="fill:#232629;fill-opacity:1;stroke:none">
|
||||
<path
|
||||
id="rect2447"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.69223;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="m 21,3.0000005 h 1 V 24 h -1 z" />
|
||||
<path
|
||||
id="rect2447-2"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.65144;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
transform="rotate(90)"
|
||||
d="m 3.0000005,-22 h 1 v 20 h -1 z" />
|
||||
<path
|
||||
id="rect2447-4"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.69223;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="M 2,3.0000005 H 3 V 24 H 2 Z" />
|
||||
<path
|
||||
id="rect2447-6"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.65144;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
transform="rotate(90)"
|
||||
d="m 23,-22 h 1 v 20 h -1 z" />
|
||||
<path
|
||||
id="rect2846"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:4.34741;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="M 6,0 H 18 V 7 H 6 Z" />
|
||||
<path
|
||||
id="rect2950"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:5.01996;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="m 5,3.0000005 h 14 v 4 H 5 Z" />
|
||||
<path
|
||||
id="rect2950-6"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:2.12132;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="m 7,10 h 10 v 1 H 7 Z" />
|
||||
<path
|
||||
id="rect2950-6-7"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.89737;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="m 7,14 h 8 v 1 H 7 Z" />
|
||||
<path
|
||||
id="rect2950-6-5"
|
||||
style="fill:#232629;fill-rule:evenodd;stroke-width:1.64317;stroke-miterlimit:2;fill-opacity:1;stroke:none"
|
||||
d="m 7,18 h 6 v 1 H 7 Z" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.8 KiB |
@ -1,42 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 12 12"
|
||||
version="1.1"
|
||||
id="svg1122"
|
||||
sodipodi:docname="edit-paste-dark-12.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
width="12"
|
||||
height="12"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1124"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="59.9375"
|
||||
inkscape:cx="0.68404588"
|
||||
inkscape:cy="8"
|
||||
inkscape:current-layer="svg1122" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#eff0f1;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="color:#eff0f1;fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 3,0 V 1 H 1 V 12 H 5 6 9.9999999 11 V 11 7 1 H 9 V 0 Z M 2,2 H 3 V 3 H 9 V 2 h 0.9999999 v 2 6 1 H 6 5 2 V 10 4 Z M 3,5 V 6 H 8 V 5 Z M 3,8 V 9 H 6 V 8 Z"
|
||||
class="ColorScheme-Text"
|
||||
id="path1090" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,40 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="svg1122"
|
||||
sodipodi:docname="edit-paste-dark-16.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1124"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="59.9375"
|
||||
inkscape:cx="0.68404588"
|
||||
inkscape:cy="8"
|
||||
inkscape:current-layer="svg1122" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#eff0f1;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path
|
||||
style="color:#eff0f1;fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 4,-5e-8 V 2 H 2 1 V 16 H 2 15 V 15 2 H 14 12 V -5e-8 Z M 2,3 H 3 V 5 H 13 V 3 h 1 V 15 H 2 Z m 2,3 v 1 h 8 V 6 Z m 0,2.9999997 v 1 h 6 v -1 z M 4,12 v 1 h 3 v -1 z"
|
||||
class="ColorScheme-Text"
|
||||
id="path1185" />
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB |
@ -1,79 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="24"
|
||||
height="24"
|
||||
version="1.1"
|
||||
id="svg1254"
|
||||
sodipodi:docname="edit-paste-dark-24.svg"
|
||||
inkscape:version="1.1 (c4e8f9ed74, 2021-05-24)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview1256"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
showgrid="false"
|
||||
inkscape:zoom="39.958333"
|
||||
inkscape:cx="11.987487"
|
||||
inkscape:cy="9.9979146"
|
||||
inkscape:current-layer="svg1254" />
|
||||
<defs
|
||||
id="defs3051">
|
||||
<style
|
||||
type="text/css"
|
||||
id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#eff0f1;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g
|
||||
id="g1356"
|
||||
style="fill:#eff0f1;fill-opacity:1;stroke:none">
|
||||
<path
|
||||
id="rect2447-62"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.69223;stroke-miterlimit:2"
|
||||
d="m 21,3.0000005 h 1 V 24 h -1 z" />
|
||||
<path
|
||||
id="rect2447-2-8"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.65144;stroke-miterlimit:2"
|
||||
transform="rotate(90)"
|
||||
d="m 3.0000005,-22 h 1 v 20 h -1 z" />
|
||||
<path
|
||||
id="rect2447-4-4"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.69223;stroke-miterlimit:2"
|
||||
d="M 2,3.0000005 H 3 V 24 H 2 Z" />
|
||||
<path
|
||||
id="rect2447-6-7"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.65144;stroke-miterlimit:2"
|
||||
transform="rotate(90)"
|
||||
d="m 23,-22 h 1 v 20 h -1 z" />
|
||||
<path
|
||||
id="rect2846-2"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4.34741;stroke-miterlimit:2"
|
||||
d="M 6,0 H 18 V 7 H 6 Z" />
|
||||
<path
|
||||
id="rect2950-4"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:5.01996;stroke-miterlimit:2"
|
||||
d="m 5,3.0000005 h 14 v 4 H 5 Z" />
|
||||
<path
|
||||
id="rect2950-6-0"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.12132;stroke-miterlimit:2"
|
||||
d="m 7,10 h 10 v 1 H 7 Z" />
|
||||
<path
|
||||
id="rect2950-6-7-6"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.89737;stroke-miterlimit:2"
|
||||
d="m 7,14 h 8 v 1 H 7 Z" />
|
||||
<path
|
||||
id="rect2950-6-5-2"
|
||||
style="fill:#eff0f1;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.64317;stroke-miterlimit:2"
|
||||
d="m 7,18 h 6 v 1 H 7 Z" />
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 2.8 KiB |
13
data/scalable/edit-paste-dark.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#eff0f1;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 5 2 L 5 3 L 3 3 L 3 14 L 7 14 L 8 14 L 12 14 L 13 14 L 13 13 L 13 9 L 13 3 L 11 3 L 11 2 L 5 2 z M 4 4 L 5 4 L 5 5 L 11 5 L 11 4 L 12 4 L 12 6 L 12 12 L 12 13 L 8 13 L 7 13 L 4 13 L 4 12 L 4 6 L 4 4 z M 5 7 L 5 8 L 10 8 L 10 7 L 5 7 z M 5 10 L 5 11 L 8 11 L 8 10 L 5 10 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
</svg>
|
After Width: | Height: | Size: 612 B |
13
data/scalable/edit-paste.svg
Normal file
@ -0,0 +1,13 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none"
|
||||
d="M 5 2 L 5 3 L 3 3 L 3 14 L 7 14 L 8 14 L 12 14 L 13 14 L 13 13 L 13 9 L 13 3 L 11 3 L 11 2 L 5 2 z M 4 4 L 5 4 L 5 5 L 11 5 L 11 4 L 12 4 L 12 6 L 12 12 L 12 13 L 8 13 L 7 13 L 4 13 L 4 12 L 4 6 L 4 4 z M 5 7 L 5 8 L 10 8 L 10 7 L 5 7 z M 5 10 L 5 11 L 8 11 L 8 10 L 5 10 z "
|
||||
class="ColorScheme-Text"
|
||||
/>
|
||||
</svg>
|
After Width: | Height: | Size: 612 B |
@ -10,7 +10,7 @@
|
||||
<file alias="actions/scalable/edit-copy.svg">data/scalable/edit-copy.svg</file>
|
||||
<file alias="actions/scalable/edit-delete.svg">data/scalable/edit-delete.svg</file>
|
||||
<file alias="actions/scalable/edit-find.svg">data/scalable/edit-find.svg</file>
|
||||
<file alias="actions/scalable/edit-paste.svg">data/scalable/edit-paste-24.svg</file>
|
||||
<file alias="actions/scalable/edit-paste.svg">data/scalable/edit-paste.svg</file>
|
||||
<file alias="actions/scalable/edit-undo.svg">data/scalable/edit-undo.svg</file>
|
||||
<file alias="actions/scalable/go-back.svg">data/scalable/go-back.svg</file>
|
||||
<file alias="actions/scalable/go-down.svg">data/scalable/go-down.svg</file>
|
||||
@ -34,7 +34,7 @@
|
||||
<file alias="dark/actions/scalable/edit-copy.svg">data/scalable/edit-copy-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/edit-delete.svg">data/scalable/edit-delete-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/edit-find.svg">data/scalable/edit-find-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/edit-paste.svg">data/scalable/edit-paste-dark-24.svg</file>
|
||||
<file alias="dark/actions/scalable/edit-paste.svg">data/scalable/edit-paste-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/edit-undo.svg">data/scalable/edit-undo-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/go-back.svg">data/scalable/go-back-dark.svg</file>
|
||||
<file alias="dark/actions/scalable/go-down.svg">data/scalable/go-down-dark.svg</file>
|
||||
|
@ -41,9 +41,9 @@ MOC_DIR = build
|
||||
OBJECTS_DIR = build
|
||||
DEFINES += VERSION=\\\"$$VERSION\\\"
|
||||
|
||||
HEADERS += src/calendarconversiondialog.h src/csvdialog.h src/dataseteditdialog.h src/datasetsdialog.h src/expressionedit.h src/fpconversiondialog.h src/functioneditdialog.h src/functionsdialog.h src/historyview.h src/itemproxymodel.h src/keypadwidget.h src/matrixwidget.h src/percentagecalculationdialog.h src/plotdialog.h src/preferencesdialog.h src/qalculateqtsettings.h src/qalculatewindow.h src/unitsdialog.h src/uniteditdialog.h src/unknowneditdialog.h src/variableeditdialog.h src/variablesdialog.h
|
||||
HEADERS += src/calendarconversiondialog.h src/csvdialog.h src/dataseteditdialog.h src/datasetsdialog.h src/expressionedit.h src/fpconversiondialog.h src/functioneditdialog.h src/functionsdialog.h src/historyview.h src/itemproxymodel.h src/keypadwidget.h src/matrixwidget.h src/percentagecalculationdialog.h src/periodictabledialog.h src/plotdialog.h src/preferencesdialog.h src/qalculateqtsettings.h src/qalculatewindow.h src/unitsdialog.h src/uniteditdialog.h src/unknowneditdialog.h src/variableeditdialog.h src/variablesdialog.h
|
||||
|
||||
SOURCES += src/calendarconversiondialog.cpp src/csvdialog.cpp src/dataseteditdialog.cpp src/datasetsdialog.cpp src/expressionedit.cpp src/fpconversiondialog.cpp src/functioneditdialog.cpp src/functionsdialog.cpp src/historyview.cpp src/itemproxymodel.cpp src/keypadwidget.cpp src/main.cpp src/matrixwidget.cpp src/percentagecalculationdialog.cpp src/plotdialog.cpp src/preferencesdialog.cpp src/qalculateqtsettings.cpp src/qalculatewindow.cpp src/unitsdialog.cpp src/uniteditdialog.cpp src/unknowneditdialog.cpp src/variableeditdialog.cpp src/variablesdialog.cpp
|
||||
SOURCES += src/calendarconversiondialog.cpp src/csvdialog.cpp src/dataseteditdialog.cpp src/datasetsdialog.cpp src/expressionedit.cpp src/fpconversiondialog.cpp src/functioneditdialog.cpp src/functionsdialog.cpp src/historyview.cpp src/itemproxymodel.cpp src/keypadwidget.cpp src/main.cpp src/matrixwidget.cpp src/percentagecalculationdialog.cpp src/periodictabledialog.cpp src/plotdialog.cpp src/preferencesdialog.cpp src/qalculateqtsettings.cpp src/qalculatewindow.cpp src/unitsdialog.cpp src/uniteditdialog.cpp src/unknowneditdialog.cpp src/variableeditdialog.cpp src/variablesdialog.cpp
|
||||
|
||||
LANGUAGES = ca de es fr nl pt_BR ru sl sv zh_CN
|
||||
|
||||
|
@ -45,7 +45,7 @@ DataPropertyEditDialog::DataPropertyEditDialog(QWidget *parent) : QDialog(parent
|
||||
# endif
|
||||
#endif
|
||||
grid->addWidget(nameEdit, 0, 1);
|
||||
grid->addWidget(new QLabel(tr("Title:"), this), 1, 0);
|
||||
grid->addWidget(new QLabel(tr("Descriptive name:"), this), 1, 0);
|
||||
titleEdit = new QLineEdit(this);
|
||||
grid->addWidget(titleEdit, 1, 1);
|
||||
grid->addWidget(new QLabel(tr("Description:"), this), 2, 0, 1, 2);
|
||||
@ -205,7 +205,7 @@ DataSetEditDialog::DataSetEditDialog(QWidget *parent) : QDialog(parent) {
|
||||
tabs->addTab(w2, tr("Properties"));
|
||||
tabs->addTab(w3, tr("Function"));
|
||||
QGridLayout *grid = new QGridLayout(w1);
|
||||
grid->addWidget(new QLabel(tr("Title:"), this), 0, 0);
|
||||
grid->addWidget(new QLabel(tr("Descriptive name:"), this), 0, 0);
|
||||
titleEdit = new QLineEdit(this);
|
||||
grid->addWidget(titleEdit, 0, 1);
|
||||
grid->addWidget(new QLabel(tr("Data file:"), this), 1, 0);
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "datasetsdialog.h"
|
||||
#include "dataseteditdialog.h"
|
||||
|
||||
DataSetsDialog::DataSetsDialog(QWidget *parent) : QDialog(parent) {
|
||||
DataSetsDialog::DataSetsDialog(QWidget *parent) : QDialog(parent, Qt::Window) {
|
||||
selected_dataset = NULL;
|
||||
selected_object = NULL;
|
||||
QVBoxLayout *topbox = new QVBoxLayout(this);
|
||||
@ -148,7 +148,7 @@ void DataSetsDialog::addDataset() {
|
||||
if(ds) {
|
||||
selected_dataset = ds;
|
||||
updateDatasets();
|
||||
if(ds != replaced_item) settings->favourite_functions.push_back(ds);
|
||||
if(ds != replaced_item && !ds->isHidden()) settings->favourite_functions.push_back(ds);
|
||||
emit itemsChanged();
|
||||
}
|
||||
}
|
||||
|
@ -881,7 +881,11 @@ bool ExpressionEdit::eventFilter(QObject *o, QEvent *e) {
|
||||
if(toolTipTimer) toolTipTimer->stop();
|
||||
if(tipLabel) tipLabel->hideTip();
|
||||
}
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
if(tipLabel && tipLabel->isVisible() && QRect(tb->parentWidget()->mapToGlobal(tb->pos()), tb->size()).contains(((QMouseEvent*) e)->globalPosition().toPoint()) && tipLabel->pos().x() + tipLabel->width() > mapToGlobal(QPoint(width(), 0)).x()) tipLabel->hideTipImmediately();
|
||||
#else
|
||||
if(tipLabel && tipLabel->isVisible() && QRect(tb->parentWidget()->mapToGlobal(tb->pos()), tb->size()).contains(((QMouseEvent*) e)->globalPos()) && tipLabel->pos().x() + tipLabel->width() > mapToGlobal(QPoint(width(), 0)).x()) tipLabel->hideTipImmediately();
|
||||
#endif
|
||||
break;
|
||||
case QEvent::MouseButtonPress:
|
||||
case QEvent::MouseButtonRelease:
|
||||
@ -3005,7 +3009,7 @@ void ExpressionEdit::onCompletionActivated(const QModelIndex &index_pre) {
|
||||
p_type = index.data(TYPE_ROLE).toInt();
|
||||
p = index.data(ITEM_ROLE).value<void*>();
|
||||
i_match = index.data(IMATCH_ROLE).toInt();
|
||||
i_type = index.data(TYPE_ROLE).toULongLong();
|
||||
i_type = index.data(MATCH_ROLE).toULongLong();
|
||||
if(i_type == 3 && p) return;
|
||||
if(p_type == 1) item = (ExpressionItem*) p;
|
||||
else if(p_type == 2) prefix = (Prefix*) p;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "functioneditdialog.h"
|
||||
#include "dataseteditdialog.h"
|
||||
|
||||
FunctionsDialog::FunctionsDialog(QWidget *parent) : QDialog(parent) {
|
||||
FunctionsDialog::FunctionsDialog(QWidget *parent) : QDialog(parent, Qt::Window) {
|
||||
QVBoxLayout *topbox = new QVBoxLayout(this);
|
||||
setWindowTitle(tr("Functions"));
|
||||
QHBoxLayout *hbox = new QHBoxLayout();
|
||||
@ -200,7 +200,7 @@ void FunctionsDialog::newClicked() {
|
||||
functionsView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Clear);
|
||||
functionsView->scrollTo(index);
|
||||
}
|
||||
if(f != replaced_item) settings->favourite_functions.push_back(f);
|
||||
if(f != replaced_item && !f->isHidden()) settings->favourite_functions.push_back(f);
|
||||
emit itemsChanged();
|
||||
}
|
||||
}
|
||||
|
223
src/periodictabledialog.cpp
Normal file
@ -0,0 +1,223 @@
|
||||
/*
|
||||
Qalculate (QT UI)
|
||||
|
||||
Copyright (C) 2021 Hanna Knutsson (hanna.knutsson@protonmail.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QGridLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
|
||||
#include "qalculateqtsettings.h"
|
||||
#include "periodictabledialog.h"
|
||||
|
||||
PeriodicTableDialog::PeriodicTableDialog(QWidget *parent) : QDialog(parent, Qt::Window | Qt::MSWindowsFixedSizeDialogHint) {
|
||||
setWindowTitle(tr("Periodic Table"));
|
||||
QVBoxLayout *topbox = new QVBoxLayout(this);
|
||||
QGridLayout *grid = new QGridLayout();
|
||||
topbox->addLayout(grid);
|
||||
grid->setSpacing(3);
|
||||
QFontMetrics fm(font());
|
||||
QSize size = fm.boundingRect("AB").size();
|
||||
size.setWidth(size.width() + 12); size.setHeight(size.height() + 12);
|
||||
for(int i = 1; i <= 18; i++) {
|
||||
QLabel *label = new QLabel(QString::number(i), this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, 0, i > 2 ? i + 1 : i, Qt::AlignCenter);
|
||||
}
|
||||
for(int i = 1; i <= 7; i++) {
|
||||
QLabel *label = new QLabel(QString::number(i), this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, i, 0, Qt::AlignCenter);
|
||||
}
|
||||
QLabel *label = new QLabel("*", this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, 6, 3, Qt::AlignCenter);
|
||||
label = new QLabel("**", this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, 7, 3, Qt::AlignCenter);
|
||||
label = new QLabel("*", this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, 9, 3, Qt::AlignCenter);
|
||||
label = new QLabel("**", this);
|
||||
label->setMinimumSize(size);
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
grid->addWidget(label, 10, 3, Qt::AlignCenter);
|
||||
DataSet *dc = CALCULATOR->getDataSet("atom");
|
||||
if(dc) {
|
||||
DataProperty *p_xpos = dc->getProperty("x_pos");
|
||||
DataProperty *p_ypos = dc->getProperty("y_pos");
|
||||
DataProperty *p_weight = dc->getProperty("weight");
|
||||
DataProperty *p_number = dc->getProperty("number");
|
||||
DataProperty *p_symbol = dc->getProperty("symbol");
|
||||
DataProperty *p_class = dc->getProperty("class");
|
||||
DataProperty *p_name = dc->getProperty("name");
|
||||
if(p_xpos && p_ypos && p_weight && p_number && p_symbol && p_class && p_name) {
|
||||
int x_pos = 0, y_pos = 0;
|
||||
for(int i = 1; i < 120; i++) {
|
||||
DataObject *e = dc->getObject(i2s(i));
|
||||
if(e) {
|
||||
x_pos = s2i(e->getProperty(p_xpos));
|
||||
y_pos = s2i(e->getProperty(p_ypos));
|
||||
}
|
||||
if(e && x_pos > 0 && x_pos <= 18 && y_pos > 0 && y_pos <= 10) {
|
||||
QPushButton *e_button = new QPushButton(QString::fromStdString(e->getProperty(p_symbol)), this);
|
||||
e_button->setFlat(true);
|
||||
int group = s2i(e->getProperty(p_class));
|
||||
if(group > 0 && group <= 11) {
|
||||
QPalette pal = e_button->palette();
|
||||
switch(group) {
|
||||
case 1: {pal.setColor(QPalette::Button, QColor("#eeccee")); break;}
|
||||
case 2: {pal.setColor(QPalette::Button, QColor("#ddccee")); break;}
|
||||
case 3: {pal.setColor(QPalette::Button, QColor("#ccddff")); break;}
|
||||
case 4: {pal.setColor(QPalette::Button, QColor("#ddeeff")); break;}
|
||||
case 5: {pal.setColor(QPalette::Button, QColor("#cceeee")); break;}
|
||||
case 6: {pal.setColor(QPalette::Button, QColor("#bbffbb")); break;}
|
||||
case 7: {pal.setColor(QPalette::Button, QColor("#eeffdd")); break;}
|
||||
case 8: {pal.setColor(QPalette::Button, QColor("#ffffaa")); break;}
|
||||
case 9: {pal.setColor(QPalette::Button, QColor("#ffddaa")); break;}
|
||||
case 10: {pal.setColor(QPalette::Button, QColor("#ffccdd")); break;}
|
||||
case 11: {pal.setColor(QPalette::Button, QColor("#aaeedd")); break;}
|
||||
default: {}
|
||||
}
|
||||
pal.setColor(QPalette::ButtonText, QColor("#000000"));
|
||||
e_button->setAutoFillBackground(true);
|
||||
e_button->setPalette(pal);
|
||||
e_button->update();
|
||||
}
|
||||
if(x_pos > 2) {
|
||||
grid->addWidget(e_button, y_pos, x_pos + 1);
|
||||
} else {
|
||||
grid->addWidget(e_button, y_pos, x_pos);
|
||||
}
|
||||
std::string tip = e->getProperty(p_number);
|
||||
tip += " ";
|
||||
tip += e->getProperty(p_name);
|
||||
std::string weight = e->getPropertyDisplayString(p_weight);
|
||||
if(!weight.empty() && weight != "-") {
|
||||
tip += "\n";
|
||||
tip += weight;
|
||||
}
|
||||
e_button->setToolTip(QString::fromStdString(tip));
|
||||
e_button->setProperty("ELEMENT OBJECT", QVariant::fromValue((void*) e));
|
||||
e_button->setMinimumSize(size);
|
||||
e_button->setMaximumSize(size);
|
||||
connect(e_button, SIGNAL(clicked()), this, SLOT(elementClicked()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < 20; i++) {
|
||||
grid->setColumnStretch(i, 1);
|
||||
}
|
||||
for(int i = 0; i < 10; i++) {
|
||||
grid->setRowStretch(i, 1);
|
||||
}
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
|
||||
topbox->addWidget(buttonBox);
|
||||
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()), this, SLOT(reject()));
|
||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
if(settings->always_on_top) setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
PeriodicTableDialog::~PeriodicTableDialog() {}
|
||||
|
||||
void PeriodicTableDialog::reject() {
|
||||
for(QMap<DataObject*, QDialog*>::const_iterator it = elementDialogs.constBegin(); it != elementDialogs.constEnd(); ++it) {
|
||||
(*it)->reject();
|
||||
}
|
||||
QDialog::reject();
|
||||
}
|
||||
void PeriodicTableDialog::onAlwaysOnTopChanged() {
|
||||
if(settings->always_on_top) setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
else setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
for(QMap<DataObject*, QDialog*>::const_iterator it = elementDialogs.constBegin(); it != elementDialogs.constEnd(); ++it) {
|
||||
if(settings->always_on_top) (*it)->setWindowFlags((*it)->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
else (*it)->setWindowFlags((*it)->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
}
|
||||
void PeriodicTableDialog::elementClicked() {
|
||||
DataObject *e = (DataObject*) sender()->property("ELEMENT OBJECT").value<void*>();
|
||||
QMap<DataObject*, QDialog*>::const_iterator qit = elementDialogs.find(e);
|
||||
if(qit != elementDialogs.constEnd()) {
|
||||
(*qit)->show();
|
||||
qApp->processEvents();
|
||||
(*qit)->raise();
|
||||
(*qit)->activateWindow();
|
||||
return;
|
||||
}
|
||||
QDialog *dialog = new QDialog(this, Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
dialog->setWindowTitle(tr("Element Data"));
|
||||
QVBoxLayout *topbox = new QVBoxLayout(dialog);
|
||||
QGridLayout *grid = new QGridLayout();
|
||||
topbox->addLayout(grid);
|
||||
DataSet *ds = e->parentSet();
|
||||
DataProperty *p_number = ds->getProperty("number");
|
||||
DataProperty *p_symbol = ds->getProperty("symbol");
|
||||
DataProperty *p_class = ds->getProperty("class");
|
||||
DataProperty *p_name = ds->getProperty("name");
|
||||
int group = s2i(e->getProperty(p_class));
|
||||
QString group_name;
|
||||
switch(group) {
|
||||
case ALKALI_METALS: {group_name = tr("Alkali Metal"); break;}
|
||||
case ALKALI_EARTH_METALS: {group_name = tr("Alkaline-Earth Metal"); break;}
|
||||
case LANTHANIDES: {group_name = tr("Lanthanide"); break;}
|
||||
case ACTINIDES: {group_name = tr("Actinide"); break;}
|
||||
case TRANSITION_METALS: {group_name = tr("Transition Metal"); break;}
|
||||
case METALS: {group_name = tr("Metal"); break;}
|
||||
case METALLOIDS: {group_name = tr("Metalloid"); break;}
|
||||
case NONMETALS: {group_name = tr("Polyatomic Non-Metal"); break;}
|
||||
case HALOGENS: {group_name = tr("Diatomic Non-Metal"); break;}
|
||||
case NOBLE_GASES: {group_name = tr("Noble Gas"); break;}
|
||||
case TRANSACTINIDES: {group_name = tr("Unknown chemical properties"); break;}
|
||||
default: {group_name = tr("Unknown"); break;}
|
||||
}
|
||||
grid->addWidget(new QLabel(QString("<div style=\"font-size: large\">%1</div>").arg(QString::fromStdString(e->getProperty(p_number))), dialog), 0, 0, 1, 3, Qt::AlignRight);
|
||||
grid->addWidget(new QLabel(QString("<div style=\"font-size: xx-large\">%1</div>").arg(QString::fromStdString(e->getProperty(p_symbol))), dialog), 1, 0, 1, 3);
|
||||
grid->addWidget(new QLabel(QString("<div style=\"font-size: x-large\">%1</div>").arg(QString::fromStdString(e->getProperty(p_name))), dialog), 2, 0, 1, 3);
|
||||
grid->addWidget(new QLabel(QString("<div style=\"font-weight: bold\">%1</div>").arg(tr("%1:").arg(QString::fromStdString(p_class->title()))), dialog), 3, 0);
|
||||
grid->addWidget(new QLabel(group_name, dialog), 3, 1);
|
||||
DataPropertyIter it;
|
||||
DataProperty *dp = ds->getFirstProperty(&it);
|
||||
int row = 4;
|
||||
while(dp) {
|
||||
if(!dp->isHidden() && dp != p_number && dp != p_class && dp != p_symbol && dp != p_name) {
|
||||
std::string sval = e->getPropertyDisplayString(dp);
|
||||
if(!sval.empty()) {
|
||||
grid->addWidget(new QLabel(QString("<div style=\"font-weight: bold\">%1</div>").arg(tr("%1:").arg(QString::fromStdString(dp->title()))), dialog), row, 0);
|
||||
grid->addWidget(new QLabel(QString::fromStdString(sval), dialog), row, 1);
|
||||
QPushButton *button = new QPushButton(LOAD_ICON("edit-paste"), QString(), dialog);
|
||||
grid->addWidget(button, row, 2);
|
||||
button->setProperty("ELEMENT OBJECT", QVariant::fromValue((void*) e));
|
||||
button->setProperty("ELEMENT PROPERTY", QVariant::fromValue((void*) dp));
|
||||
connect(button, SIGNAL(clicked()), this, SLOT(propertyClicked()));
|
||||
row++;
|
||||
}
|
||||
}
|
||||
dp = ds->getNextProperty(&it);
|
||||
}
|
||||
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, dialog);
|
||||
topbox->addWidget(buttonBox);
|
||||
connect(buttonBox->button(QDialogButtonBox::Close), SIGNAL(clicked()), dialog, SLOT(reject()));
|
||||
dialog->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
elementDialogs[e] = dialog;
|
||||
dialog->show();
|
||||
}
|
||||
void PeriodicTableDialog::propertyClicked() {
|
||||
emit insertPropertyRequest((DataObject*) sender()->property("ELEMENT OBJECT").value<void*>(), (DataProperty*) sender()->property("ELEMENT PROPERTY").value<void*>());
|
||||
}
|
||||
|
50
src/periodictabledialog.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
Qalculate (QT UI)
|
||||
|
||||
Copyright (C) 2021 Hanna Knutsson (hanna.knutsson@protonmail.com)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
*/
|
||||
|
||||
#ifndef PERIODIC_TABLE_DIALOG_H
|
||||
#define PERIODIC_TABLE_DIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
|
||||
#include <libqalculate/qalculate.h>
|
||||
|
||||
class PeriodicTableDialog : public QDialog {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
protected:
|
||||
|
||||
QMap<DataObject*, QDialog*> elementDialogs;
|
||||
|
||||
protected slots:
|
||||
|
||||
void elementClicked();
|
||||
void propertyClicked();
|
||||
|
||||
public slots:
|
||||
|
||||
void reject() override;
|
||||
void onAlwaysOnTopChanged();
|
||||
|
||||
public:
|
||||
|
||||
PeriodicTableDialog(QWidget *parent = NULL);
|
||||
virtual ~PeriodicTableDialog();
|
||||
|
||||
signals:
|
||||
|
||||
void insertPropertyRequest(DataObject*, DataProperty*);
|
||||
|
||||
};
|
||||
|
||||
#endif //PERIODIC_TABLE_DIALOG_H
|
||||
|
@ -281,7 +281,9 @@ void QalculateQtSettings::loadPreferences() {
|
||||
default_plot_use_sampling_rate = true;
|
||||
max_plot_time = 5;
|
||||
|
||||
int version_numbers[] = {3, 21, 0};
|
||||
preferences_version[0] = 3;
|
||||
preferences_version[1] = 21;
|
||||
preferences_version[2] = 0;
|
||||
|
||||
if(file) {
|
||||
char line[1000000L];
|
||||
@ -327,7 +329,7 @@ void QalculateQtSettings::loadPreferences() {
|
||||
favourite_variables_pre.push_back(svalue);
|
||||
favourite_variables_changed = true;
|
||||
} else if(svar == "version") {
|
||||
parse_qalculate_version(svalue, version_numbers);
|
||||
parse_qalculate_version(svalue, preferences_version);
|
||||
} else if(svar == "always_on_top") {
|
||||
always_on_top = v;
|
||||
} else if(svar == "keep_function_dialog_open") {
|
||||
@ -864,8 +866,8 @@ void QalculateQtSettings::savePreferences(bool) {
|
||||
fprintf(file, "last_version_check=%s\n", last_version_check_date.toISOString().c_str());
|
||||
if(!last_found_version.empty()) fprintf(file, "last_found_version=%s\n", last_found_version.c_str());
|
||||
}
|
||||
fprintf(file, "window_state=%s\n", window_state.toBase64().data());
|
||||
fprintf(file, "window_geometry=%s\n", window_geometry.toBase64().data());
|
||||
if(!window_state.isEmpty()) fprintf(file, "window_state=%s\n", window_state.toBase64().data());
|
||||
if(!window_geometry.isEmpty()) fprintf(file, "window_geometry=%s\n", window_geometry.toBase64().data());
|
||||
if(rpn_shown) fprintf(file, "rpn_shown=%i\n", rpn_shown);
|
||||
fprintf(file, "splitter_state=%s\n", splitter_state.toBase64().data());
|
||||
if(!functions_geometry.isEmpty()) fprintf(file, "functions_geometry=%s\n", functions_geometry.toBase64().data());
|
||||
|
@ -122,6 +122,7 @@ class QalculateQtSettings : QObject {
|
||||
QalculateDateTime last_version_check_date;
|
||||
bool check_version;
|
||||
std::string last_found_version;
|
||||
int preferences_version[3];
|
||||
|
||||
std::vector<std::string> v_expression;
|
||||
std::vector<bool> v_protected;
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include "fpconversiondialog.h"
|
||||
#include "percentagecalculationdialog.h"
|
||||
#include "plotdialog.h"
|
||||
#include "periodictabledialog.h"
|
||||
#include "calendarconversiondialog.h"
|
||||
#include "matrixwidget.h"
|
||||
#include "csvdialog.h"
|
||||
@ -271,6 +272,7 @@ QalculateWindow::QalculateWindow() : QMainWindow() {
|
||||
fpConversionDialog = NULL;
|
||||
percentageDialog = NULL;
|
||||
plotDialog = NULL;
|
||||
periodicTableDialog = NULL;
|
||||
calendarConversionDialog = NULL;
|
||||
|
||||
QVBoxLayout *topLayout = new QVBoxLayout(w_top);
|
||||
@ -328,6 +330,7 @@ QalculateWindow::QalculateWindow() : QMainWindow() {
|
||||
menu->addAction(tr("Floating Point Conversion (IEEE 754)"), this, SLOT(openFPConversion()));
|
||||
menu->addAction(tr("Calendar Conversion"), this, SLOT(openCalendarConversion()));
|
||||
menu->addAction(tr("Percentage Calculation Tool"), this, SLOT(openPercentageCalculation()));
|
||||
menu->addAction(tr("Periodic Table"), this, SLOT(openPeriodicTable()));
|
||||
menu->addSeparator();
|
||||
menu->addAction(tr("Update Exchange Rates"), this, SLOT(fetchExchangeRates()));
|
||||
menu->addSeparator();
|
||||
@ -587,12 +590,14 @@ QalculateWindow::QalculateWindow() : QMainWindow() {
|
||||
plotAction = NULL;
|
||||
}
|
||||
fpAction = NULL;
|
||||
calendarsAction = new QAction(LOAD_ICON("calendars"), tr("Calendar Conversion"), this);
|
||||
calendarsAction = NULL;
|
||||
percentageAction = NULL;
|
||||
/*calendarsAction = new QAction(LOAD_ICON("calendars"), tr("Calendar Conversion"), this);
|
||||
connect(calendarsAction, SIGNAL(triggered(bool)), this, SLOT(openCalendarConversion()));
|
||||
tb->addAction(calendarsAction);
|
||||
percentageAction = new QAction(LOAD_ICON("percentage"), tr("Percentage Calculation Tool"), this);
|
||||
connect(percentageAction, SIGNAL(triggered(bool)), this, SLOT(openPercentageCalculation()));
|
||||
tb->addAction(percentageAction);
|
||||
tb->addAction(percentageAction);*/
|
||||
basesAction = new QAction(LOAD_ICON("number-bases"), tr("Number bases"), this);
|
||||
basesAction->setShortcut(Qt::CTRL | Qt::Key_B); basesAction->setShortcutContext(Qt::ApplicationShortcut); basesAction->setToolTip(tr("Number Bases (%1)").arg(basesAction->shortcut().toString(QKeySequence::NativeText)));
|
||||
connect(basesAction, SIGNAL(triggered(bool)), this, SLOT(onBasesActivated(bool)));
|
||||
@ -790,7 +795,7 @@ QalculateWindow::QalculateWindow() : QMainWindow() {
|
||||
connect(keypad, SIGNAL(answerClicked()), this, SLOT(onAnswerClicked()));
|
||||
|
||||
if(!settings->window_geometry.isEmpty()) restoreGeometry(settings->window_geometry);
|
||||
else resize(600, 650);
|
||||
if(settings->window_geometry.isEmpty() || (settings->preferences_version[0] == 3 && settings->preferences_version[1] < 22 && height() == 650 && width() == 600)) resize(600, 700);
|
||||
if(!settings->window_state.isEmpty()) restoreState(settings->window_state);
|
||||
if(!settings->splitter_state.isEmpty()) ehSplitter->restoreState(settings->splitter_state);
|
||||
|
||||
@ -874,7 +879,7 @@ void QalculateWindow::variableActivated() {
|
||||
onVariableClicked((Variable*) ((QAction*) sender())->data().value<void*>());
|
||||
}
|
||||
void QalculateWindow::unitActivated() {
|
||||
if(!expressionEdit->expressionHasChanged() && settings->current_result) {
|
||||
if(!expressionEdit->expressionHasChanged() && ((settings->replace_expression == CLEAR_EXPRESSION && expressionEdit->document()->isEmpty()) || (!expressionEdit->document()->isEmpty() && expressionEdit->selectedText() == expressionEdit->toPlainText())) && settings->current_result) {
|
||||
convertToUnit((Unit*) ((QAction*) sender())->data().value<void*>());
|
||||
} else {
|
||||
onUnitClicked((Unit*) ((QAction*) sender())->data().value<void*>());
|
||||
@ -4290,7 +4295,7 @@ void QalculateWindow::setResult(Prefix *prefix, bool update_history, bool update
|
||||
|
||||
if(!supress_dialog && !register_moved && !do_stack && mstruct->isMatrix() && matrix_mstruct.isMatrix()) {
|
||||
QDialog *dialog = new QDialog(this);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
dialog->setWindowTitle(tr("Matrix"));
|
||||
QVBoxLayout *box = new QVBoxLayout(dialog);
|
||||
MatrixWidget *w = new MatrixWidget(dialog);
|
||||
@ -4396,7 +4401,7 @@ bool QalculateWindow::askTC(MathStructure &m) {
|
||||
}
|
||||
QDialog *dialog = new QDialog(this);
|
||||
QVBoxLayout *box = new QVBoxLayout(dialog);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
dialog->setWindowTitle(tr("Temperature Calculation Mode"));
|
||||
QGridLayout *grid = new QGridLayout();
|
||||
box->addLayout(grid);
|
||||
@ -4454,7 +4459,7 @@ bool QalculateWindow::askDot(const std::string &str) {
|
||||
if(!b) return false;
|
||||
QDialog *dialog = new QDialog(this);
|
||||
QVBoxLayout *box = new QVBoxLayout(dialog);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
dialog->setWindowTitle(tr("Interpretation of dots"));
|
||||
QGridLayout *grid = new QGridLayout();
|
||||
box->addLayout(grid);
|
||||
@ -4499,7 +4504,7 @@ bool QalculateWindow::askDot(const std::string &str) {
|
||||
bool QalculateWindow::askImplicit() {
|
||||
QDialog *dialog = new QDialog(this);
|
||||
QVBoxLayout *box = new QVBoxLayout(dialog);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
dialog->setWindowTitle(tr("Parsing Mode"));
|
||||
QGridLayout *grid = new QGridLayout();
|
||||
box->addLayout(grid);
|
||||
@ -4552,7 +4557,8 @@ void QalculateWindow::keyPressEvent(QKeyEvent *e) {
|
||||
}
|
||||
void QalculateWindow::closeEvent(QCloseEvent *e) {
|
||||
settings->window_state = saveState();
|
||||
settings->window_geometry = saveGeometry();
|
||||
if(height() != 700 || width() != 600) settings->window_geometry = saveGeometry();
|
||||
else settings->window_geometry = QByteArray();
|
||||
settings->splitter_state = ehSplitter->saveState();
|
||||
if(settings->save_defs_on_exit) CALCULATOR->saveDefinitions();
|
||||
CALCULATOR->abort();
|
||||
@ -4598,7 +4604,7 @@ void QalculateWindow::onStoreActivated() {
|
||||
expressionEdit->updateCompletion();
|
||||
if(variablesDialog) variablesDialog->updateVariables();
|
||||
if(unitsDialog) unitsDialog->updateUnits();
|
||||
if(v != replaced_item) settings->favourite_variables.push_back(v);
|
||||
if(v != replaced_item && !v->isHidden()) settings->favourite_variables.push_back(v);
|
||||
updateVariablesMenu();
|
||||
}
|
||||
}
|
||||
@ -4609,7 +4615,7 @@ void QalculateWindow::newVariable() {
|
||||
expressionEdit->updateCompletion();
|
||||
if(variablesDialog) variablesDialog->updateVariables();
|
||||
if(unitsDialog) unitsDialog->updateUnits();
|
||||
if(v != replaced_item) settings->favourite_variables.push_back(v);
|
||||
if(v != replaced_item && !v->isHidden()) settings->favourite_variables.push_back(v);
|
||||
updateVariablesMenu();
|
||||
}
|
||||
}
|
||||
@ -4620,7 +4626,7 @@ void QalculateWindow::newMatrix() {
|
||||
expressionEdit->updateCompletion();
|
||||
if(variablesDialog) variablesDialog->updateVariables();
|
||||
if(unitsDialog) unitsDialog->updateUnits();
|
||||
if(v != replaced_item) settings->favourite_variables.push_back(v);
|
||||
if(v != replaced_item && !v->isHidden()) settings->favourite_variables.push_back(v);
|
||||
updateVariablesMenu();
|
||||
}
|
||||
}
|
||||
@ -4631,7 +4637,7 @@ void QalculateWindow::newUnknown() {
|
||||
expressionEdit->updateCompletion();
|
||||
if(variablesDialog) variablesDialog->updateVariables();
|
||||
if(unitsDialog) unitsDialog->updateUnits();
|
||||
if(v != replaced_item) settings->favourite_variables.push_back(v);
|
||||
if(v != replaced_item && !v->isHidden()) settings->favourite_variables.push_back(v);
|
||||
updateVariablesMenu();
|
||||
}
|
||||
}
|
||||
@ -4642,7 +4648,7 @@ void QalculateWindow::newUnit() {
|
||||
expressionEdit->updateCompletion();
|
||||
if(variablesDialog) variablesDialog->updateVariables();
|
||||
if(unitsDialog) unitsDialog->updateUnits();
|
||||
if(u != replaced_item) settings->favourite_units.push_back(u);
|
||||
if(u != replaced_item && !u->isHidden()) settings->favourite_units.push_back(u);
|
||||
updateUnitsMenu();
|
||||
}
|
||||
}
|
||||
@ -4653,7 +4659,7 @@ void QalculateWindow::newFunction() {
|
||||
if(f) {
|
||||
expressionEdit->updateCompletion();
|
||||
if(functionsDialog) functionsDialog->updateFunctions();
|
||||
if(f != replaced_item) settings->favourite_functions.push_back(f);
|
||||
if(f != replaced_item && !f->isHidden()) settings->favourite_functions.push_back(f);
|
||||
updateFunctionsMenu();
|
||||
}
|
||||
}
|
||||
@ -4841,27 +4847,28 @@ void QalculateWindow::assumptionsSignActivated() {
|
||||
void QalculateWindow::onAlwaysOnTopChanged() {
|
||||
if(settings->always_on_top) {
|
||||
setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(datasetsDialog) datasetsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(functionsDialog) functionsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(variablesDialog) variablesDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(unitsDialog) unitsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(fpConversionDialog) fpConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(percentageDialog) percentageDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(plotDialog) plotDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(calendarConversionDialog) calendarConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(preferencesDialog) preferencesDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(datasetsDialog) datasetsDialog->setWindowFlags(datasetsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(functionsDialog) functionsDialog->setWindowFlags(functionsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(variablesDialog) variablesDialog->setWindowFlags(variablesDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(unitsDialog) unitsDialog->setWindowFlags(unitsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(fpConversionDialog) fpConversionDialog->setWindowFlags(fpConversionDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(percentageDialog) percentageDialog->setWindowFlags(percentageDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(plotDialog) plotDialog->setWindowFlags(plotDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(calendarConversionDialog) calendarConversionDialog->setWindowFlags(calendarConversionDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(preferencesDialog) preferencesDialog->setWindowFlags(preferencesDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
} else {
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(datasetsDialog) datasetsDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(functionsDialog) functionsDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(variablesDialog) variablesDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(unitsDialog) unitsDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(fpConversionDialog) fpConversionDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(percentageDialog) percentageDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(plotDialog) plotDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(calendarConversionDialog) calendarConversionDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(preferencesDialog) preferencesDialog->setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(datasetsDialog) datasetsDialog->setWindowFlags(datasetsDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(functionsDialog) functionsDialog->setWindowFlags(functionsDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(variablesDialog) variablesDialog->setWindowFlags(variablesDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(unitsDialog) unitsDialog->setWindowFlags(unitsDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(fpConversionDialog) fpConversionDialog->setWindowFlags(fpConversionDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(percentageDialog) percentageDialog->setWindowFlags(percentageDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(plotDialog) plotDialog->setWindowFlags(plotDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(calendarConversionDialog) calendarConversionDialog->setWindowFlags(calendarConversionDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
if(preferencesDialog) preferencesDialog->setWindowFlags(preferencesDialog->windowFlags() & ~Qt::WindowStaysOnTopHint);
|
||||
}
|
||||
if(periodicTableDialog) periodicTableDialog->onAlwaysOnTopChanged();
|
||||
show();
|
||||
}
|
||||
void QalculateWindow::onTitleTypeChanged() {
|
||||
@ -4908,7 +4915,7 @@ void QalculateWindow::onExpressionStatusModeChanged() {
|
||||
}
|
||||
void QalculateWindow::editPreferences() {
|
||||
if(preferencesDialog) {
|
||||
preferencesDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
preferencesDialog->setWindowState((preferencesDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
preferencesDialog->show();
|
||||
qApp->processEvents();
|
||||
preferencesDialog->raise();
|
||||
@ -4928,6 +4935,7 @@ void QalculateWindow::editPreferences() {
|
||||
connect(preferencesDialog, SIGNAL(appFontChanged()), this, SLOT(onAppFontChanged()));
|
||||
connect(preferencesDialog, SIGNAL(symbolsUpdated()), keypad, SLOT(updateSymbols()));
|
||||
connect(preferencesDialog, SIGNAL(dialogClosed()), this, SLOT(onPreferencesClosed()));
|
||||
if(settings->always_on_top) preferencesDialog->setWindowFlags(preferencesDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
preferencesDialog->show();
|
||||
}
|
||||
void QalculateWindow::onDatasetsChanged() {
|
||||
@ -4956,7 +4964,7 @@ void QalculateWindow::insertProperty(DataObject *o, DataProperty *dp) {
|
||||
}
|
||||
void QalculateWindow::openDatasets() {
|
||||
if(datasetsDialog) {
|
||||
datasetsDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
datasetsDialog->setWindowState((datasetsDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
datasetsDialog->show();
|
||||
qApp->processEvents();
|
||||
datasetsDialog->raise();
|
||||
@ -4966,7 +4974,7 @@ void QalculateWindow::openDatasets() {
|
||||
datasetsDialog = new DataSetsDialog();
|
||||
connect(datasetsDialog, SIGNAL(itemsChanged()), this, SLOT(onDatasetsChanged()));
|
||||
connect(datasetsDialog, SIGNAL(insertPropertyRequest(DataObject*, DataProperty*)), this, SLOT(insertProperty(DataObject*, DataProperty*)));
|
||||
if(settings->always_on_top) datasetsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) datasetsDialog->setWindowFlags(datasetsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
datasetsDialog->show();
|
||||
}
|
||||
void QalculateWindow::applyFunction(MathFunction *f) {
|
||||
@ -4990,7 +4998,7 @@ void QalculateWindow::applyFunction(MathFunction *f) {
|
||||
}
|
||||
void QalculateWindow::openFunctions() {
|
||||
if(functionsDialog) {
|
||||
functionsDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
functionsDialog->setWindowState((functionsDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
functionsDialog->show();
|
||||
qApp->processEvents();
|
||||
functionsDialog->raise();
|
||||
@ -5002,7 +5010,7 @@ void QalculateWindow::openFunctions() {
|
||||
connect(functionsDialog, SIGNAL(applyFunctionRequest(MathFunction*)), this, SLOT(applyFunction(MathFunction*)));
|
||||
connect(functionsDialog, SIGNAL(insertFunctionRequest(MathFunction*)), this, SLOT(onInsertFunctionRequested(MathFunction*)));
|
||||
connect(functionsDialog, SIGNAL(calculateFunctionRequest(MathFunction*)), this, SLOT(onCalculateFunctionRequested(MathFunction*)));
|
||||
if(settings->always_on_top) functionsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) functionsDialog->setWindowFlags(functionsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
functionsDialog->show();
|
||||
}
|
||||
void QalculateWindow::onUnitRemoved(Unit *u) {
|
||||
@ -5013,7 +5021,7 @@ void QalculateWindow::onUnitDeactivated(Unit *u) {
|
||||
}
|
||||
void QalculateWindow::openVariables() {
|
||||
if(variablesDialog) {
|
||||
variablesDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
variablesDialog->setWindowState((variablesDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
variablesDialog->show();
|
||||
qApp->processEvents();
|
||||
variablesDialog->raise();
|
||||
@ -5027,7 +5035,7 @@ void QalculateWindow::openVariables() {
|
||||
connect(variablesDialog, SIGNAL(unitRemoved(Unit*)), this, SLOT(onUnitRemoved(Unit*)));
|
||||
connect(variablesDialog, SIGNAL(unitDeactivated(Unit*)), this, SLOT(onUnitDeactivated(Unit*)));
|
||||
connect(variablesDialog, SIGNAL(insertVariableRequest(Variable*)), this, SLOT(onVariableClicked(Variable*)));
|
||||
if(settings->always_on_top) variablesDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) variablesDialog->setWindowFlags(variablesDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
variablesDialog->show();
|
||||
}
|
||||
void QalculateWindow::onVariableRemoved(Variable *v) {
|
||||
@ -5044,7 +5052,7 @@ void QalculateWindow::openUnits() {
|
||||
if(unitsDialog) {
|
||||
if(u && !u->category().empty()) unitsDialog->selectCategory(u->category());
|
||||
else unitsDialog->selectCategory("All");
|
||||
unitsDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
unitsDialog->setWindowState((unitsDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
unitsDialog->show();
|
||||
qApp->processEvents();
|
||||
unitsDialog->raise();
|
||||
@ -5061,7 +5069,7 @@ void QalculateWindow::openUnits() {
|
||||
connect(unitsDialog, SIGNAL(insertUnitRequest(Unit*)), this, SLOT(onUnitClicked(Unit*)));
|
||||
connect(unitsDialog, SIGNAL(convertToUnitRequest(Unit*)), this, SLOT(convertToUnit(Unit*)));
|
||||
connect(unitsDialog, SIGNAL(unitActivated(Unit*)), this, SLOT(onUnitActivated(Unit*)));
|
||||
if(settings->always_on_top) unitsDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) unitsDialog->setWindowFlags(unitsDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
unitsDialog->show();
|
||||
}
|
||||
void QalculateWindow::onUnitActivated(Unit *u) {
|
||||
@ -5070,15 +5078,14 @@ void QalculateWindow::onUnitActivated(Unit *u) {
|
||||
}
|
||||
void QalculateWindow::openFPConversion() {
|
||||
if(fpConversionDialog) {
|
||||
if(settings->always_on_top) fpConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
fpConversionDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
fpConversionDialog->setWindowState((fpConversionDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
fpConversionDialog->show();
|
||||
qApp->processEvents();
|
||||
fpConversionDialog->raise();
|
||||
fpConversionDialog->activateWindow();
|
||||
} else {
|
||||
fpConversionDialog = new FPConversionDialog(this);
|
||||
if(settings->always_on_top) fpConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) fpConversionDialog->setWindowFlags(fpConversionDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
fpConversionDialog->show();
|
||||
}
|
||||
QString str;
|
||||
@ -5111,15 +5118,14 @@ void QalculateWindow::openFPConversion() {
|
||||
}
|
||||
void QalculateWindow::openPercentageCalculation() {
|
||||
if(percentageDialog) {
|
||||
if(settings->always_on_top) percentageDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
percentageDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
percentageDialog->setWindowState((percentageDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
percentageDialog->show();
|
||||
qApp->processEvents();
|
||||
percentageDialog->raise();
|
||||
percentageDialog->activateWindow();
|
||||
} else {
|
||||
percentageDialog = new PercentageCalculationDialog(this);
|
||||
if(settings->always_on_top) percentageDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) percentageDialog->setWindowFlags(percentageDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
percentageDialog->show();
|
||||
}
|
||||
QString str;
|
||||
@ -5138,15 +5144,14 @@ void QalculateWindow::openPlot() {
|
||||
return;
|
||||
}
|
||||
if(plotDialog) {
|
||||
if(settings->always_on_top) plotDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
plotDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
plotDialog->setWindowState((plotDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
plotDialog->show();
|
||||
qApp->processEvents();
|
||||
plotDialog->raise();
|
||||
plotDialog->activateWindow();
|
||||
} else {
|
||||
plotDialog = new PlotDialog(this);
|
||||
if(settings->always_on_top) plotDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) plotDialog->setWindowFlags(plotDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
plotDialog->show();
|
||||
}
|
||||
if(settings->evalops.parse_options.base == 10) {
|
||||
@ -5158,11 +5163,24 @@ void QalculateWindow::openPlot() {
|
||||
plotDialog->setExpression(QString());
|
||||
}
|
||||
}
|
||||
void QalculateWindow::openPeriodicTable() {
|
||||
if(periodicTableDialog) {
|
||||
periodicTableDialog->setWindowState((periodicTableDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
periodicTableDialog->show();
|
||||
qApp->processEvents();
|
||||
periodicTableDialog->raise();
|
||||
periodicTableDialog->activateWindow();
|
||||
} else {
|
||||
periodicTableDialog = new PeriodicTableDialog(this);
|
||||
connect(periodicTableDialog, SIGNAL(insertPropertyRequest(DataObject*, DataProperty*)), this, SLOT(insertProperty(DataObject*, DataProperty*)));
|
||||
if(settings->always_on_top) periodicTableDialog->setWindowFlags(periodicTableDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
periodicTableDialog->show();
|
||||
}
|
||||
}
|
||||
void QalculateWindow::openCalendarConversion() {
|
||||
if(calendarConversionDialog) {
|
||||
if(settings->always_on_top) calendarConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(mstruct && mstruct->isDateTime()) calendarConversionDialog->setDate(*mstruct->datetime());
|
||||
calendarConversionDialog->setWindowState((windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
calendarConversionDialog->setWindowState((calendarConversionDialog->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
|
||||
calendarConversionDialog->show();
|
||||
qApp->processEvents();
|
||||
calendarConversionDialog->raise();
|
||||
@ -5170,7 +5188,7 @@ void QalculateWindow::openCalendarConversion() {
|
||||
return;
|
||||
}
|
||||
calendarConversionDialog = new CalendarConversionDialog(this);
|
||||
if(settings->always_on_top) calendarConversionDialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) calendarConversionDialog->setWindowFlags(calendarConversionDialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
QalculateDateTime dt;
|
||||
if(mstruct && mstruct->isDateTime()) dt.set(*mstruct->datetime());
|
||||
else dt.setToCurrentDate();
|
||||
@ -5293,7 +5311,7 @@ void QalculateWindow::insertFunction(MathFunction *f, QWidget *parent) {
|
||||
|
||||
std::string f_title = f->title(true, settings->printops.use_unicode_signs, &can_display_unicode_string_function, (void*) this);
|
||||
fd->dialog = new QDialog(parent ? parent : this);
|
||||
if(settings->always_on_top) fd->dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) fd->dialog->setWindowFlags(fd->dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
fd->dialog->setWindowTitle(QString::fromStdString(f_title));
|
||||
|
||||
QVBoxLayout *box = new QVBoxLayout(fd->dialog);
|
||||
@ -5597,14 +5615,19 @@ void QalculateWindow::insertFunction(MathFunction *f, QWidget *parent) {
|
||||
std::string seltext, str2;
|
||||
if(expressionEdit->textCursor().hasSelection()) seltext = expressionEdit->textCursor().selectedText().toStdString();
|
||||
else seltext = expressionEdit->toPlainText().toStdString();
|
||||
bool use_current_result = !expressionEdit->expressionHasChanged() && !settings->history_answer.empty() && settings->current_result && (!expressionEdit->textCursor().hasSelection() || seltext == expressionEdit->toPlainText().toStdString());
|
||||
CALCULATOR->separateToExpression(seltext, str2, settings->evalops, true);
|
||||
remove_blank_ends(seltext);
|
||||
if(!seltext.empty()) {
|
||||
if(arg && arg->type() == ARGUMENT_TYPE_INTEGER) {
|
||||
MathStructure m;
|
||||
CALCULATOR->beginTemporaryStopMessages();
|
||||
CALCULATOR->calculate(&m, CALCULATOR->unlocalizeExpression(seltext, settings->evalops.parse_options), 200, settings->evalops);
|
||||
if(CALCULATOR->endTemporaryStopMessages() && m.isInteger()) {
|
||||
if(use_current_result) {
|
||||
m = *settings->current_result;
|
||||
} else {
|
||||
CALCULATOR->calculate(&m, CALCULATOR->unlocalizeExpression(seltext, settings->evalops.parse_options), 200, settings->evalops);
|
||||
}
|
||||
if(!CALCULATOR->endTemporaryStopMessages() && m.isInteger()) {
|
||||
bool overflow = false;
|
||||
int v = m.number().intValue(&overflow);
|
||||
QSpinBox *spin = (QSpinBox*) entry;
|
||||
@ -5613,8 +5636,12 @@ void QalculateWindow::insertFunction(MathFunction *f, QWidget *parent) {
|
||||
} else if(arg && arg->type() == ARGUMENT_TYPE_DATE) {
|
||||
MathStructure m;
|
||||
CALCULATOR->beginTemporaryStopMessages();
|
||||
CALCULATOR->calculate(&m, CALCULATOR->unlocalizeExpression(seltext, settings->evalops.parse_options), 200, settings->evalops);
|
||||
if(CALCULATOR->endTemporaryStopMessages() && m.isDateTime()) {
|
||||
if(use_current_result) {
|
||||
m = *settings->current_result;
|
||||
} else {
|
||||
CALCULATOR->calculate(&m, CALCULATOR->unlocalizeExpression(seltext, settings->evalops.parse_options), 200, settings->evalops);
|
||||
}
|
||||
if(!CALCULATOR->endTemporaryStopMessages() && m.isDateTime()) {
|
||||
QDateTime d;
|
||||
d.setDate(QDate(m.datetime()->year(), m.datetime()->month(), m.datetime()->day()));
|
||||
Number nr_sec = m.datetime()->second();
|
||||
@ -5624,7 +5651,16 @@ void QalculateWindow::insertFunction(MathFunction *f, QWidget *parent) {
|
||||
((QDateTimeEdit*) entry)->setDateTime(d);
|
||||
}
|
||||
} else {
|
||||
((QLineEdit*) fd->entry[i])->setText(QString::fromStdString(seltext));
|
||||
if(use_current_result) {
|
||||
if(exact_text.empty()) {
|
||||
Number nr(settings->history_answer.size(), 1, 0);
|
||||
((QLineEdit*) fd->entry[i])->setText(QString("%1(%2)").arg(QString::fromStdString(settings->f_answer->preferredInputName(settings->printops.abbreviate_names, settings->printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) fd->entry[i]).name)).arg(QString::fromStdString(print_with_evalops(nr))));
|
||||
} else {
|
||||
((QLineEdit*) fd->entry[i])->setText(QString::fromStdString(exact_text));
|
||||
}
|
||||
} else {
|
||||
((QLineEdit*) fd->entry[i])->setText(QString::fromStdString(seltext));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5679,7 +5715,7 @@ void QalculateWindow::onEntryEditMatrix() {
|
||||
QLineEdit *entry = (QLineEdit*) sender()->property("QALCULATE ENTRY").value<void*>();
|
||||
FunctionDialog *fd = (FunctionDialog*) entry->property("QALCULATE FD").value<void*>();
|
||||
QDialog *dialog = new QDialog(fd->dialog);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
if(settings->always_on_top) dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
|
||||
dialog->setWindowTitle(tr("Matrix"));
|
||||
QVBoxLayout *box = new QVBoxLayout(dialog);
|
||||
MatrixWidget *w = new MatrixWidget(dialog);
|
||||
|
@ -40,6 +40,7 @@ class UnitsDialog;
|
||||
class FPConversionDialog;
|
||||
class PercentageCalculationDialog;
|
||||
class PlotDialog;
|
||||
class PeriodicTableDialog;
|
||||
class CalendarConversionDialog;
|
||||
class QTableWidget;
|
||||
class QMenu;
|
||||
@ -80,6 +81,7 @@ class QalculateWindow : public QMainWindow {
|
||||
FPConversionDialog *fpConversionDialog;
|
||||
PercentageCalculationDialog *percentageDialog;
|
||||
PlotDialog *plotDialog;
|
||||
PeriodicTableDialog *periodicTableDialog;
|
||||
CalendarConversionDialog *calendarConversionDialog;
|
||||
|
||||
KeypadWidget *keypad;
|
||||
@ -250,6 +252,7 @@ class QalculateWindow : public QMainWindow {
|
||||
void openFPConversion();
|
||||
void openPercentageCalculation();
|
||||
void openPlot();
|
||||
void openPeriodicTable();
|
||||
void negate();
|
||||
void checkVersion();
|
||||
void reportBug();
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include "itemproxymodel.h"
|
||||
#include "uniteditdialog.h"
|
||||
|
||||
UnitsDialog::UnitsDialog(QWidget *parent) : QDialog(parent) {
|
||||
UnitsDialog::UnitsDialog(QWidget *parent) : QDialog(parent, Qt::Window) {
|
||||
last_from = true;
|
||||
QVBoxLayout *topbox = new QVBoxLayout(this);
|
||||
setWindowTitle(tr("Units"));
|
||||
@ -341,7 +341,7 @@ void UnitsDialog::newClicked() {
|
||||
unitsView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Clear);
|
||||
unitsView->scrollTo(index);
|
||||
}
|
||||
if(u != replaced_item) settings->favourite_units.push_back(u);
|
||||
if(u != replaced_item && !u->isHidden()) settings->favourite_units.push_back(u);
|
||||
emit itemsChanged();
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include "variableeditdialog.h"
|
||||
#include "csvdialog.h"
|
||||
|
||||
VariablesDialog::VariablesDialog(QWidget *parent) : QDialog(parent) {
|
||||
VariablesDialog::VariablesDialog(QWidget *parent) : QDialog(parent, Qt::Window) {
|
||||
QVBoxLayout *topbox = new QVBoxLayout(this);
|
||||
setWindowTitle(tr("Variables"));
|
||||
QHBoxLayout *hbox = new QHBoxLayout();
|
||||
@ -218,7 +218,7 @@ void VariablesDialog::newVariable(int type) {
|
||||
variablesView->selectionModel()->setCurrentIndex(index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Clear);
|
||||
variablesView->scrollTo(index);
|
||||
}
|
||||
if(v != replaced_item) settings->favourite_variables.push_back(v);
|
||||
if(v != replaced_item && !v->isHidden()) settings->favourite_variables.push_back(v);
|
||||
emit itemsChanged();
|
||||
}
|
||||
}
|
||||
|