Add command line argument to allow start in portable mode

master
addi 2016-10-17 10:00:18 +02:00
parent d3832929c7
commit 7887fdd0ed
5 changed files with 233 additions and 146 deletions

View File

@ -736,7 +736,7 @@
<location filename="../mainwindow.ui" line="1266"/>
<location filename="../mainwindow.ui" line="1277"/>
<location filename="../mainwindow.ui" line="1288"/>
<location filename="../mainwindow.cpp" line="958"/>
<location filename="../mainwindow.cpp" line="996"/>
<source>select color</source>
<translation>Farbe auswählen</translation>
</message>
@ -892,7 +892,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2397"/>
<location filename="../mainwindow.cpp" line="939"/>
<location filename="../mainwindow.cpp" line="977"/>
<source>About MinetestMapper</source>
<translation>Über MinetestMapper</translation>
</message>
@ -941,7 +941,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2537"/>
<location filename="../mainwindow.cpp" line="971"/>
<location filename="../mainwindow.cpp" line="1009"/>
<source>New Profile</source>
<translation>Neues Profil</translation>
</message>
@ -951,7 +951,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2545"/>
<location filename="../mainwindow.cpp" line="401"/>
<location filename="../mainwindow.cpp" line="434"/>
<source>Expert Mode</source>
<translation>Expertenmodus</translation>
</message>
@ -966,211 +966,233 @@
<translation>Im Expertenmodus werden die Parameter angezeigt, die du verändern kannst.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="157"/>
<location filename="../mainwindow.cpp" line="190"/>
<source>Current Language changed to %1</source>
<translation>Sprache wurde auf %1 geändert</translation>
</message>
<message>
<location filename="../mainwindow.ui" line="2496"/>
<location filename="../mainwindow.cpp" line="925"/>
<location filename="../mainwindow.cpp" line="963"/>
<source>About MinetestMapper GUI</source>
<translation>Über MinetestMapperGUI</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="207"/>
<location filename="../mainwindow.cpp" line="216"/>
<location filename="../mainwindow.cpp" line="240"/>
<location filename="../mainwindow.cpp" line="249"/>
<source>Minetestmapper not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="226"/>
<location filename="../mainwindow.cpp" line="259"/>
<source>Minetestmapper not executable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="241"/>
<location filename="../mainwindow.cpp" line="274"/>
<source>no input world selected</source>
<translation>Keine Minetestwelt ausgewählt</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="242"/>
<location filename="../mainwindow.cpp" line="275"/>
<source>ERROR: No MinetestWorld selected&lt;br&gt;&lt;br&gt;please select a world</source>
<translation>FEHLER: Keine Minetestwelt ausgewählt&lt;br&gt;&lt;br&gt;Bitte wähle eine Welt aus</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="248"/>
<location filename="../mainwindow.cpp" line="281"/>
<source>no output image selected</source>
<translation>Kein Ausgabebild ausgewählt</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="249"/>
<location filename="../mainwindow.cpp" line="282"/>
<source>ERROR: No output image selected&lt;br&gt;&lt;br&gt;please select a output image</source>
<translation>FEHLER: Kein Ausgabebild Ausgewählt. &lt;br&gt;&lt;br&gt;Bitte ein Bild Auswählen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="254"/>
<location filename="../mainwindow.cpp" line="287"/>
<source>the Image File does already exist</source>
<translation>Das Bild existiert bereits</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="255"/>
<location filename="../mainwindow.cpp" line="288"/>
<source>The File &lt;i&gt;%1&lt;/i&gt; does already exist. &lt;br&gt;&lt;br&gt;Do you want to overwrite?</source>
<translation>Die Datei &lt;i&gt;%1&lt;/i&gt; existiert bereits. &lt;br&gt;&lt;br&gt;Soll die Datei Überschrieben werden?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="263"/>
<location filename="../mainwindow.cpp" line="296"/>
<source>the directory does not exist</source>
<translation>Der Ordner existiert nicht</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="264"/>
<location filename="../mainwindow.cpp" line="297"/>
<source>The directory &lt;i&gt;%1&lt;/i&gt; does not exist. &lt;br&gt;&lt;br&gt;Should it be created?</source>
<translation>Der Ordner &lt;i&gt;%1&lt;/i&gt; existiert nicht. &lt;br&gt;&lt;br&gt;Möchten sie den Ordner erstellen?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="402"/>
<location filename="../mainwindow.cpp" line="435"/>
<source>MinetestMapper will be executed using this arguments.
The arguments can be removed, modified, or new arguments can be added.</source>
<translation>MinetestMapper wird mit den folgenden Parametern ausgeführt.
Die einzelnen Parameter können entfernt, verändert, oder neue hinzugefügt werden.</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="500"/>
<location filename="../mainwindow.cpp" line="533"/>
<source>Finisched :)</source>
<translation>Fertig :-)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="508"/>
<location filename="../mainwindow.cpp" line="541"/>
<source>minetestmapper terminated</source>
<translation>minetestmapper abgebrochen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="511"/>
<location filename="../mainwindow.cpp" line="528"/>
<location filename="../mainwindow.cpp" line="544"/>
<location filename="../mainwindow.cpp" line="561"/>
<source>Minetest Mapper failed</source>
<translation>Minetestmapper hat ein Fehler festgestellt</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="512"/>
<location filename="../mainwindow.cpp" line="545"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;minetestmapper failed&lt;/h2&gt;Exit code: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Status of MinetestMapper: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Please fix the error and try again </source>
<translation>&lt;h1&gt;Fehler&lt;/h1&gt; &lt;h2&gt;kartenerstellung fehlgeschlagen&lt;/h2&gt;Exit code: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Ausgabe des Minetstmapper: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Bitte den Fehler beheben und erneut versuchen </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="529"/>
<location filename="../mainwindow.cpp" line="562"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;minetestmapper failed&lt;/h2&gt;Error code: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Error Message: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;</source>
<translation>&lt;h1&gt;FEHLER&lt;/h1&gt; &lt;h2&gt;minetestmapper ist abgestürzt&lt;/h2&gt;Fehlercode: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Fehlernachricht: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="568"/>
<location filename="../mainwindow.cpp" line="601"/>
<source>Migrating settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="569"/>
<location filename="../mainwindow.cpp" line="602"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Migrating settings: both old and new settings found&lt;/h2&gt;old settings directory: &lt;i&gt;%1&lt;/i&gt;&lt;br&gt;new settings directory: &lt;i&gt;%2&lt;/i&gt;&lt;br&gt;&lt;h2&gt;Migrate old settings anyway ?&lt;/h2&gt;This overwrites the new settings, and some or all new profiles&lt;br&gt;&lt;br&gt;Delete the old settings files (&lt;i&gt;%1/Minetestmapper*&lt;/i&gt;) to avoid this message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="583"/>
<location filename="../mainwindow.cpp" line="603"/>
<location filename="../mainwindow.cpp" line="612"/>
<location filename="../mainwindow.cpp" line="616"/>
<location filename="../mainwindow.cpp" line="636"/>
<location filename="../mainwindow.cpp" line="645"/>
<source>Failed to migrate settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="584"/>
<location filename="../mainwindow.cpp" line="617"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to create new settings directory &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="604"/>
<location filename="../mainwindow.cpp" line="637"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to remove existing file &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="613"/>
<location filename="../mainwindow.cpp" line="646"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to move file &lt;i&gt;%1&lt;/i&gt; to &lt;i&gt;%2&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="622"/>
<location filename="../mainwindow.cpp" line="655"/>
<source>Failed to remove old settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="623"/>
<location filename="../mainwindow.cpp" line="656"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Failed to remove old settings&lt;/h2&gt;Reason: failed to remove file &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="633"/>
<location filename="../mainwindow.cpp" line="666"/>
<source>Failed to remove old settings directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="634"/>
<location filename="../mainwindow.cpp" line="667"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Failed to remove old settings directory&lt;/h2&gt;Reason: failed to remove directory &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="883"/>
<location filename="../mainwindow.cpp" line="722"/>
<source>Can not save settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="723"/>
<source>Minetest Mapper GUI could not save the settings to %1.
Please make shure Minetest Mapper Gui can access to the file/directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="750"/>
<source>Can not save profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="751"/>
<source>Minetest Mapper GUI could not save the current Profile &apos;%1&apos; to %2.
Please make shure Minetest Mapper Gui can access to the file/directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="921"/>
<source>Open Minetest World</source>
<translation>Minetest Welt-Ordner öffnen</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="893"/>
<location filename="../mainwindow.cpp" line="931"/>
<source>Save generated map to...</source>
<translation>Karte speichern nach...</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="893"/>
<location filename="../mainwindow.cpp" line="931"/>
<source>png image (*.png)</source>
<translation>png Grafik (*.png)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="900"/>
<location filename="../mainwindow.cpp" line="938"/>
<source>Open HeightmapNodes File</source>
<translation>Öffne HeightmapNodes Datei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="902"/>
<location filename="../mainwindow.cpp" line="910"/>
<location filename="../mainwindow.cpp" line="918"/>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="948"/>
<location filename="../mainwindow.cpp" line="956"/>
<source>TXT File (*.txt)</source>
<translation>TXT Datei (*.txt)</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="908"/>
<location filename="../mainwindow.cpp" line="946"/>
<source>Open HeightmapColors File</source>
<translation>Öffne Höhenkarte Farbdefinitionsdatei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="916"/>
<location filename="../mainwindow.cpp" line="954"/>
<source>Open colors.txt File</source>
<translation>Öffne colors.txt Datei</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="926"/>
<location filename="../mainwindow.cpp" line="964"/>
<source>&lt;h1&gt;About MinetestMapperGUI&lt;/h1&gt;The &lt;b&gt;MinetestMapper Gui&lt;/b&gt; is written by addi.&lt;br /&gt;It is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;Creative Commons Attribution 3.0 Unported License&lt;/a&gt;.&lt;br&gt;The current version is %1. &lt;br&gt;The sourcecode is aviable on &lt;a href=&apos;https://bitbucket.org/adrido/minetestmappergui/&apos;&gt;Bitbucket&lt;/a&gt;.&lt;br&gt;You may also want to read the &lt;a href=&apos;https://forum.minetest.net/viewtopic.php?f=14&amp;t=12139&apos;&gt;Minetest forum thread&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;b&gt;Thanks to:&lt;/b&gt;&lt;br&gt;McKrustenkaese for his great icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1031"/>
<location filename="../mainwindow.cpp" line="1069"/>
<source>map center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1036"/>
<location filename="../mainwindow.cpp" line="1074"/>
<source>map origin (top left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="978"/>
<source>&lt;h1&gt;About MinetestMapper&lt;/h1&gt;The &lt;b&gt;MinetestMapper&lt;/b&gt; is written by:&lt;br&gt;Miroslav Bendík &lt;miroslav.bendik@gmail.com&gt;&lt;br&gt;ShadowNinja &lt;shadowninja@minetest.net&gt;&lt;br&gt;sfan5 &lt;sfan5@live.de&gt;&lt;br&gt;Rogier &lt;rogier777@gmail.com&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;License:&lt;/u&gt;LGPLv2.1+ and BSD 2-clause.&lt;br&gt;&lt;u&gt;Source Code:&lt;/u&gt; &lt;a href=&apos;https://github.com/Rogier-5/minetest-mapper-cpp&apos;&gt;Github&lt;/a&gt;&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="208"/>
<location filename="../mainwindow.cpp" line="241"/>
<source>ERROR: No minetestmapper executable could not be found.
Please configure one. (Edit-&gt;Preferences)
@ -1181,7 +1203,7 @@ Bitte Konfigurieren Sie eine. (Bearbeiten-&gt;Einstellungen)
Möchten Sie die Einstellungen jetzt öffnen?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="217"/>
<location filename="../mainwindow.cpp" line="250"/>
<source>ERROR: Configured minetestmapper executable (%1) could not be found
Please configure one. (Edit-&gt;Preferences)
@ -1192,7 +1214,7 @@ Bitte erneut Konfigurieren. (Bearbeiten-&gt;Einstellungen)
Möchten Sie die Einstellungen jetzt öffnen?</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="227"/>
<location filename="../mainwindow.cpp" line="260"/>
<source>ERROR: The configured minetestmapper (%1) is not executable.
Please configure a valid minetestmapper executable. (Edit-&gt;Preferences)
@ -1203,12 +1225,12 @@ Bitte erneut eine gültige minetestmapper Anwendung auswählen. (Bearbeiten-&gt;
Möchten Sie die Einstellungen jetzt öffnen? </translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="952"/>
<location filename="../mainwindow.cpp" line="990"/>
<source>preview: %1</source>
<translation>Vorschau: %1</translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="972"/>
<location filename="../mainwindow.cpp" line="1010"/>
<source>Name of the new Profile:</source>
<translation>Name des Neuen Profils:</translation>
</message>

View File

@ -432,7 +432,7 @@
<location filename="../mainwindow.ui" line="1266"/>
<location filename="../mainwindow.ui" line="1277"/>
<location filename="../mainwindow.ui" line="1288"/>
<location filename="../mainwindow.cpp" line="958"/>
<location filename="../mainwindow.cpp" line="996"/>
<source>select color</source>
<translation type="unfinished"></translation>
</message>
@ -851,7 +851,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2397"/>
<location filename="../mainwindow.cpp" line="939"/>
<location filename="../mainwindow.cpp" line="977"/>
<source>About MinetestMapper</source>
<translation type="unfinished"></translation>
</message>
@ -897,7 +897,7 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2496"/>
<location filename="../mainwindow.cpp" line="925"/>
<location filename="../mainwindow.cpp" line="963"/>
<source>About MinetestMapper GUI</source>
<translation type="unfinished"></translation>
</message>
@ -921,13 +921,13 @@
</message>
<message>
<location filename="../mainwindow.ui" line="2537"/>
<location filename="../mainwindow.cpp" line="971"/>
<location filename="../mainwindow.cpp" line="1009"/>
<source>New Profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.ui" line="2545"/>
<location filename="../mainwindow.cpp" line="401"/>
<location filename="../mainwindow.cpp" line="434"/>
<source>Expert Mode</source>
<translation type="unfinished"></translation>
</message>
@ -942,204 +942,226 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="157"/>
<location filename="../mainwindow.cpp" line="190"/>
<source>Current Language changed to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="207"/>
<location filename="../mainwindow.cpp" line="216"/>
<location filename="../mainwindow.cpp" line="240"/>
<location filename="../mainwindow.cpp" line="249"/>
<source>Minetestmapper not found</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="226"/>
<location filename="../mainwindow.cpp" line="259"/>
<source>Minetestmapper not executable</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="241"/>
<location filename="../mainwindow.cpp" line="274"/>
<source>no input world selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="242"/>
<location filename="../mainwindow.cpp" line="275"/>
<source>ERROR: No MinetestWorld selected&lt;br&gt;&lt;br&gt;please select a world</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="248"/>
<location filename="../mainwindow.cpp" line="281"/>
<source>no output image selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="249"/>
<location filename="../mainwindow.cpp" line="282"/>
<source>ERROR: No output image selected&lt;br&gt;&lt;br&gt;please select a output image</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="254"/>
<location filename="../mainwindow.cpp" line="287"/>
<source>the Image File does already exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="255"/>
<location filename="../mainwindow.cpp" line="288"/>
<source>The File &lt;i&gt;%1&lt;/i&gt; does already exist. &lt;br&gt;&lt;br&gt;Do you want to overwrite?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="263"/>
<location filename="../mainwindow.cpp" line="296"/>
<source>the directory does not exist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="264"/>
<location filename="../mainwindow.cpp" line="297"/>
<source>The directory &lt;i&gt;%1&lt;/i&gt; does not exist. &lt;br&gt;&lt;br&gt;Should it be created?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="402"/>
<location filename="../mainwindow.cpp" line="435"/>
<source>MinetestMapper will be executed using this arguments.
The arguments can be removed, modified, or new arguments can be added.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="500"/>
<location filename="../mainwindow.cpp" line="533"/>
<source>Finisched :)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="508"/>
<location filename="../mainwindow.cpp" line="541"/>
<source>minetestmapper terminated</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="511"/>
<location filename="../mainwindow.cpp" line="528"/>
<location filename="../mainwindow.cpp" line="544"/>
<location filename="../mainwindow.cpp" line="561"/>
<source>Minetest Mapper failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="512"/>
<location filename="../mainwindow.cpp" line="545"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;minetestmapper failed&lt;/h2&gt;Exit code: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Status of MinetestMapper: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Please fix the error and try again </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="529"/>
<location filename="../mainwindow.cpp" line="562"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;minetestmapper failed&lt;/h2&gt;Error code: &lt;i&gt;%1&lt;/i&gt; &lt;br&gt;Error Message: &lt;pre&gt;%2&lt;/pre&gt;&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="568"/>
<location filename="../mainwindow.cpp" line="601"/>
<source>Migrating settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="569"/>
<location filename="../mainwindow.cpp" line="602"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Migrating settings: both old and new settings found&lt;/h2&gt;old settings directory: &lt;i&gt;%1&lt;/i&gt;&lt;br&gt;new settings directory: &lt;i&gt;%2&lt;/i&gt;&lt;br&gt;&lt;h2&gt;Migrate old settings anyway ?&lt;/h2&gt;This overwrites the new settings, and some or all new profiles&lt;br&gt;&lt;br&gt;Delete the old settings files (&lt;i&gt;%1/Minetestmapper*&lt;/i&gt;) to avoid this message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="583"/>
<location filename="../mainwindow.cpp" line="603"/>
<location filename="../mainwindow.cpp" line="612"/>
<location filename="../mainwindow.cpp" line="616"/>
<location filename="../mainwindow.cpp" line="636"/>
<location filename="../mainwindow.cpp" line="645"/>
<source>Failed to migrate settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="584"/>
<location filename="../mainwindow.cpp" line="617"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to create new settings directory &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="604"/>
<location filename="../mainwindow.cpp" line="637"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to remove existing file &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="613"/>
<location filename="../mainwindow.cpp" line="646"/>
<source>&lt;h1&gt;ERROR&lt;/h1&gt; &lt;h2&gt;Failed to migrate settings&lt;/h2&gt;Reason: failed to move file &lt;i&gt;%1&lt;/i&gt; to &lt;i&gt;%2&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="622"/>
<location filename="../mainwindow.cpp" line="655"/>
<source>Failed to remove old settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="623"/>
<location filename="../mainwindow.cpp" line="656"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Failed to remove old settings&lt;/h2&gt;Reason: failed to remove file &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="633"/>
<location filename="../mainwindow.cpp" line="666"/>
<source>Failed to remove old settings directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="634"/>
<location filename="../mainwindow.cpp" line="667"/>
<source>&lt;h1&gt;WARNING&lt;/h1&gt; &lt;h2&gt;Failed to remove old settings directory&lt;/h2&gt;Reason: failed to remove directory &lt;i&gt;%1&lt;/i&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="883"/>
<location filename="../mainwindow.cpp" line="722"/>
<source>Can not save settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="723"/>
<source>Minetest Mapper GUI could not save the settings to %1.
Please make shure Minetest Mapper Gui can access to the file/directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="750"/>
<source>Can not save profile</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="751"/>
<source>Minetest Mapper GUI could not save the current Profile &apos;%1&apos; to %2.
Please make shure Minetest Mapper Gui can access to the file/directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="921"/>
<source>Open Minetest World</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="893"/>
<location filename="../mainwindow.cpp" line="931"/>
<source>Save generated map to...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="893"/>
<location filename="../mainwindow.cpp" line="931"/>
<source>png image (*.png)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="900"/>
<location filename="../mainwindow.cpp" line="938"/>
<source>Open HeightmapNodes File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="902"/>
<location filename="../mainwindow.cpp" line="910"/>
<location filename="../mainwindow.cpp" line="918"/>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="948"/>
<location filename="../mainwindow.cpp" line="956"/>
<source>TXT File (*.txt)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="908"/>
<location filename="../mainwindow.cpp" line="946"/>
<source>Open HeightmapColors File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="916"/>
<location filename="../mainwindow.cpp" line="954"/>
<source>Open colors.txt File</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="926"/>
<location filename="../mainwindow.cpp" line="964"/>
<source>&lt;h1&gt;About MinetestMapperGUI&lt;/h1&gt;The &lt;b&gt;MinetestMapper Gui&lt;/b&gt; is written by addi.&lt;br /&gt;It is licensed under a &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;&gt;Creative Commons Attribution 3.0 Unported License&lt;/a&gt;.&lt;br&gt;The current version is %1. &lt;br&gt;The sourcecode is aviable on &lt;a href=&apos;https://bitbucket.org/adrido/minetestmappergui/&apos;&gt;Bitbucket&lt;/a&gt;.&lt;br&gt;You may also want to read the &lt;a href=&apos;https://forum.minetest.net/viewtopic.php?f=14&amp;t=12139&apos;&gt;Minetest forum thread&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;b&gt;Thanks to:&lt;/b&gt;&lt;br&gt;McKrustenkaese for his great icon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1031"/>
<location filename="../mainwindow.cpp" line="1069"/>
<source>map center</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="1036"/>
<location filename="../mainwindow.cpp" line="1074"/>
<source>map origin (top left)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="940"/>
<location filename="../mainwindow.cpp" line="978"/>
<source>&lt;h1&gt;About MinetestMapper&lt;/h1&gt;The &lt;b&gt;MinetestMapper&lt;/b&gt; is written by:&lt;br&gt;Miroslav Bendík &lt;miroslav.bendik@gmail.com&gt;&lt;br&gt;ShadowNinja &lt;shadowninja@minetest.net&gt;&lt;br&gt;sfan5 &lt;sfan5@live.de&gt;&lt;br&gt;Rogier &lt;rogier777@gmail.com&gt;&lt;br&gt;&lt;br&gt;&lt;u&gt;License:&lt;/u&gt;LGPLv2.1+ and BSD 2-clause.&lt;br&gt;&lt;u&gt;Source Code:&lt;/u&gt; &lt;a href=&apos;https://github.com/Rogier-5/minetest-mapper-cpp&apos;&gt;Github&lt;/a&gt;&lt;br&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="208"/>
<location filename="../mainwindow.cpp" line="241"/>
<source>ERROR: No minetestmapper executable could not be found.
Please configure one. (Edit-&gt;Preferences)
@ -1147,7 +1169,7 @@ Do you want to open Preferences now?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="217"/>
<location filename="../mainwindow.cpp" line="250"/>
<source>ERROR: Configured minetestmapper executable (%1) could not be found
Please configure one. (Edit-&gt;Preferences)
@ -1155,7 +1177,7 @@ Do you want to open Preferences now?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="227"/>
<location filename="../mainwindow.cpp" line="260"/>
<source>ERROR: The configured minetestmapper (%1) is not executable.
Please configure a valid minetestmapper executable. (Edit-&gt;Preferences)
@ -1163,12 +1185,12 @@ Do you want to open Preferences now?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="952"/>
<location filename="../mainwindow.cpp" line="990"/>
<source>preview: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../mainwindow.cpp" line="972"/>
<location filename="../mainwindow.cpp" line="1010"/>
<source>Name of the new Profile:</source>
<translation type="unfinished"></translation>
</message>

View File

@ -1,12 +1,16 @@
#include "mainwindow.h"
#include <QCoreApplication>
#include <QApplication>
#include <QDebug>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
//set organization to MinetestMapperGui which is read by settings
QCoreApplication::setOrganizationName("MinetestMapperGui");
QCoreApplication::setApplicationName("MinetestMapperGui");
a.setApplicationName("MinetestMapperGui");
a.setApplicationDisplayName("Minetest Mapper GUI");
a.setApplicationVersion(GIT_VERSION);
a.setOrganizationName("MinetestMapperGui");
MainWindow w;
w.show();

View File

@ -45,6 +45,36 @@ MainWindow::MainWindow(QWidget *parent) :
exit(EXIT_FAILURE);
#endif
QCommandLineParser parser;
parser.setApplicationDescription("This program provides a graphical user interface for minetestmapper. \n"
"If you are looking for the command line interface of minetesmapper please execute minetestmapper directly.");
parser.addHelpOption();
parser.addVersionOption();
QCommandLineOption startPortableOption(QStringList() << "p" << "portable",
"Starts in portable mode which reads and writes settings and profiles relative to current directory");
parser.addOption(startPortableOption);
parser.process(qApp->arguments());
portable = parser.isSet(startPortableOption);
if(portable){
//Attention: This paths could be non writable locations!
pathAppData = qApp->applicationDirPath(); //use the Applications directory
pathProfiles = pathAppData + "/profiles/";
//manipulate settingsfile on portable mode
settings = new QSettings(pathAppData+"/MinetestMapperGui.ini",QSettings::IniFormat);
}
else{
QSettings dummySettings(QSettings::IniFormat, QSettings::UserScope,qApp->organizationName(),"dummy");
pathAppData = QFileInfo(dummySettings.fileName()).path();
pathProfiles = pathAppData + "/profiles/";
dummySettings.deleteLater();
//non portable use OS defaults
settings = new QSettings();
}
ui->setupUi(this);
finishUiInitialisation();
readSettings();
@ -645,12 +675,8 @@ void MainWindow::createProfilesMenu(){
connect(profileGroup, SIGNAL (triggered(QAction *)), this, SLOT (slotProfileChanged(QAction *)));
//Qt 5.4 or less
QSettings dummySettings(QSettings::IniFormat, QSettings::UserScope,QCoreApplication::organizationName(),"/profiles/default");
QDir dir = QFileInfo(dummySettings.fileName()).absoluteDir();
QDir dir(pathProfiles);
qDebug()<<pathProfiles;
QStringList fileNames = dir.entryList(QStringList("*.ini"));
qDebug()<<"found the Profiles"<< fileNames<< "in"<<dir.absolutePath();
@ -689,30 +715,40 @@ void MainWindow::slotProfileChanged(QAction* action)
void MainWindow::writeSettings()
{
settings.beginGroup("MainWindow");
if(portable && !settings->isWritable()){
QMessageBox::warning(this, tr("Can not save settings"),
tr("Minetest Mapper GUI could not save the settings to %1.\n"
"Please make shure Minetest Mapper Gui can access to the file/directory").arg(settings->fileName()));
}
settings->beginGroup("MainWindow");
if(isMaximized()){
settings.setValue("maximized", true);
settings->setValue("maximized", true);
}
else{
settings.setValue("maximized", false);
settings.setValue("size", size());
settings.setValue("pos", pos());
settings->setValue("maximized", false);
settings->setValue("size", size());
settings->setValue("pos", pos());
}
settings.setValue("help", ui->actionHelp->isChecked());
settings.setValue("profile", currentProfile);
settings.setValue("expertMode",ui->actionExpert_Mode->isChecked());
settings.setValue("openMap",ui->actionOpen_map_after_creation->isChecked());
settings.endGroup();
settings->setValue("help", ui->actionHelp->isChecked());
settings->setValue("profile", currentProfile);
settings->setValue("expertMode",ui->actionExpert_Mode->isChecked());
settings->setValue("openMap",ui->actionOpen_map_after_creation->isChecked());
settings->endGroup();
}
void MainWindow::writeProfile(QString strProfile)
{
//QSettings::setDefaultFormat(QSettings::IniFormat);
//QSettings profile;
//looks odd, but it constructs the correct settingsfile
QSettings profile(QSettings::IniFormat, QSettings::UserScope,QCoreApplication::organizationName(),"/profiles/"+strProfile);
qDebug()<<"Write profile"<< strProfile<<"to:"<<profile.fileName();
QSettings profile(QString("%1/%2.ini").arg(pathProfiles).arg(strProfile), QSettings::IniFormat);
if(portable && !profile.isWritable()){
QMessageBox::warning(this, tr("Can not save profile"),
tr("Minetest Mapper GUI could not save the current Profile '%1' to %2.\n"
"Please make shure Minetest Mapper Gui can access to the file/directory").arg(strProfile).arg(profile.fileName()));
}
qDebug()<<"Write profile" << strProfile << "to" << profile.fileName();
profile.beginGroup("Mapper");
//'currentSettings'
@ -775,34 +811,33 @@ void MainWindow::writeProfile(QString strProfile)
void MainWindow::readSettings()
{
qDebug()<<"Read settings from"<<settings.fileName();
qDebug()<<"Read settings from"<<settings->fileName();
settings.beginGroup("MainWindow");
if (settings.value("maximized",false).toBool()) {
settings->beginGroup("MainWindow");
if (settings->value("maximized",false).toBool()) {
setWindowState(Qt::WindowMaximized);
}
else {
resize(settings.value("size", QSize(400, 400)).toSize());
move(settings.value("pos", QPoint(200, 200)).toPoint());
resize(settings->value("size", QSize(400, 400)).toSize());
move(settings->value("pos", QPoint(200, 200)).toPoint());
}
if(settings.value("help",false).toBool()==false){
if(settings->value("help",false).toBool()==false){
ui->dockHelp->close();
}
currentProfile = settings.value("profile","default").toString();
ui->actionExpert_Mode->setChecked(settings.value("expertMode",false).toBool());
ui->actionOpen_map_after_creation->setChecked(settings.value("openMap",true).toBool());
settings.endGroup();
currentProfile = settings->value("profile","default").toString();
ui->actionExpert_Mode->setChecked(settings->value("expertMode",false).toBool());
ui->actionOpen_map_after_creation->setChecked(settings->value("openMap",true).toBool());
settings->endGroup();
}
void MainWindow::readProfile(QString strProfile)
{
QSettings profile(QSettings::IniFormat,
QSettings::UserScope,
QCoreApplication::organizationName(),
"/profiles/"+strProfile);
qDebug()<< "Reading profile"<< profile.fileName();
QSettings profile(QString("%1/%2.ini").arg(pathProfiles).arg(strProfile),QSettings::IniFormat);
qDebug()<< "Reading profile" << strProfile << "from" << profile.fileName();
profile.beginGroup("Mapper");
//'currentSettings'

View File

@ -102,6 +102,7 @@ private slots:
void on_actionPreferences_triggered();
private:
bool portable;
Ui::MainWindow *ui;
QProgressBar *progressBar;
QProcess *myProcess;
@ -126,7 +127,10 @@ private:
QString m_currLang; // contains the currently loaded language
QString m_langPath; // Path of language files. This is always fixed to /languages.
QString currentProfile; //contains the name of current loaded profile
QSettings settings;
QString pathAppData; // Path where the settings should be stored.
QString pathProfiles; // path where the profiles should be stored.
//QSettings profile;
QSettings *settings;
};
#endif // MAINWINDOW_H