]> git.zerfleddert.de Git - ms2-fixes/commitdiff
add version name to about dialog
authorMichael Gernoth <michael@gernoth.net>
Mon, 29 Oct 2012 12:39:10 +0000 (13:39 +0100)
committerMichael Gernoth <michael@gernoth.net>
Mon, 29 Oct 2012 12:39:10 +0000 (13:39 +0100)
MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java

index 5c042060383dfc19c907f39be25c35c4b5688f0a..9b41abe158529cb5c4a3f37d6acf1555cdf378e2 100644 (file)
@@ -360,8 +360,16 @@ public class MS2Debounce extends Activity
                                dlg = shellexec.create();
                                break;
                        case 42:
                                dlg = shellexec.create();
                                break;
                        case 42:
+                               String version;
+                               
+                               try {
+                                       version = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
+                               } catch (Exception e) {
+                                       version = "?";
+                               }
+
                                AlertDialog.Builder about = new AlertDialog.Builder(this);
                                AlertDialog.Builder about = new AlertDialog.Builder(this);
-                               about.setMessage("Milestone 2 Debounce\n\n(C) 2011 Michael Gernoth <michael@gernoth.net>\n\nThis 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 version 2 of the License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA")
+                               about.setMessage("Milestone 2 Debounce " + version + "\n\n(C) 2011 Michael Gernoth <michael@gernoth.net>\n\nThis 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 version 2 of the License.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA")
                                        .setCancelable(true)
                                        .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                                                public void onClick(DialogInterface dialog, int id) {
                                        .setCancelable(true)
                                        .setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                                                public void onClick(DialogInterface dialog, int id) {
Impressum, Datenschutz