[dasher: 49/61] Dasher should support a --version option #41 (#108)



commit 8b5598f6edfde75395f445c32041ea13b6546bb2
Author: mbgazi <kimmiskim hotmail com>
Date:   Mon Mar 27 11:50:32 2017 +0300

    Dasher should support a --version option #41 (#108)
    
    * Completed the issue: Dasher should support a --version option #41
    
    * Updated tr.po file with version and license translation for issu #41
    
    * Completed requested minor changes
    
    * Edited po/tr.po via gtranslator
    
    * Add tr translation for "License"

 Src/Gtk2/DasherAppSettings.cpp |    9 +++++++++
 Src/Gtk2/DasherAppSettings.h   |    2 +-
 Src/main.cc                    |   11 ++++++++++-
 po/tr.po                       |   15 ++++++++++++---
 4 files changed, 32 insertions(+), 5 deletions(-)
---
diff --git a/Src/Gtk2/DasherAppSettings.cpp b/Src/Gtk2/DasherAppSettings.cpp
index e5ad0fb..36ec440 100644
--- a/Src/Gtk2/DasherAppSettings.cpp
+++ b/Src/Gtk2/DasherAppSettings.cpp
@@ -153,3 +153,12 @@ void option_help()
     g_print("%-30s %-12s  %s\n", stringparamtable[i].regName, stringparamtable[i].defaultValue, 
stringparamtable[i].humanReadable);
   }
 }
+
+void option_version()
+{
+  g_print("\n");
+  // Note to translators: This is the version keyword showing for the command line option "--version"
+  g_print("%-30s %-30s \n", _("Version"), PACKAGE_VERSION);
+  // Note to translators: This is the license keyword showing for the command line option "--version"
+  g_print("%-30s %-30s\n", _("License"), "GPL 2+");
+}
diff --git a/Src/Gtk2/DasherAppSettings.h b/Src/Gtk2/DasherAppSettings.h
index ff78c8f..91acf84 100644
--- a/Src/Gtk2/DasherAppSettings.h
+++ b/Src/Gtk2/DasherAppSettings.h
@@ -81,5 +81,5 @@ private:
 };
 
 void option_help();
-
+void option_version();
 #endif
diff --git a/Src/main.cc b/Src/main.cc
index 085a9d9..3ca9c3f 100644
--- a/Src/main.cc
+++ b/Src/main.cc
@@ -152,6 +152,7 @@ int main(int argc, char *argv[]) {
   SCommandLine sCommandLine;
 
   gboolean do_option_help = false;
+  gboolean do_show_version = false;
   static const GOptionEntry options[] = {
     //   {"timedata", 'w', 0, G_OPTION_ARG_NONE, &timedata, "Write basic timing information to stdout", 
NULL},
     //   {"preferences", 'p', 0, G_OPTION_ARG_NONE, &preferences, "Show preferences window only", NULL},
@@ -162,8 +163,10 @@ int main(int argc, char *argv[]) {
     // Note to translators: This is the help string for "--options"
     {"options", 'o', 0, G_OPTION_ARG_STRING, &(sCommandLine.szOptions), N_("Override stored options"), NULL},
     {"config", 'c', 0, G_OPTION_ARG_STRING, &(sCommandLine.szConfigFile), N_("XML configuration file name"), 
NULL},
-        // Note to translators: This is the help string for "--help-options"
+    // Note to translators: This is the help string for "--help-options"
     {"help-options", 0, 0, G_OPTION_ARG_NONE, &do_option_help, N_("Describe \"--options\"."), NULL},
+    // Note to translators: This is the help string for "--version"
+    {"version", 'v', 0, G_OPTION_ARG_NONE, &do_show_version, N_("Show the version details."), NULL},
     {NULL}
   };
 
@@ -189,6 +192,12 @@ int main(int argc, char *argv[]) {
     return 0;
   }
 
+  if (do_show_version)
+  {
+    option_version();
+    return 0;
+  }
+
 #ifdef WITH_GPE
   gpe_application_init(&argc, &argv);
   init_xsettings();
diff --git a/po/tr.po b/po/tr.po
index 85dfc58..e619407 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -9,6 +9,7 @@
 # Baris Cicek <baris teamforce name tr>, 2008, 2009.
 # Kaan Özdinçer <kaanozdincer gmail com>, 2015.
 # Muhammet Kara <muhammetk gmail com>, 2011, 2014, 2016.
+# Melike Burakgazi Bilgen <kimmiskim hotmail com>, 2017.
 #
 msgid ""
 msgstr ""
@@ -16,9 +17,9 @@ msgstr ""
 "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?";
 "product=dasher&keywords=I18N+L10N&component=general\n"
 "POT-Creation-Date: 2016-09-01 16:47+0000\n"
-"PO-Revision-Date: 2016-11-30 23:50+0300\n"
-"Last-Translator: Muhammet Kara <muhammetk gmail com>\n"
-"Language-Team: Türkçe <gnome-turk gnome org>\n"
+"PO-Revision-Date: 2017-03-20 23:22+0300\n"
+"Last-Translator: Melike Burakgazi Bilgen <kimmiskim hotmail com>\n"
+"Language-Team: Türkçe <kimmiskim hotmail com>\n"
 "Language: tr\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
@@ -1101,6 +1102,14 @@ msgstr "Tamsayı parametreleri"
 msgid "String parameters"
 msgstr "Dizgi parametreleri"
 
+#: Src/Gtk2/DasherAppSettings.cpp:161
+msgid "Version"
+msgstr "Versiyon"
+
+#: Src/Gtk2/DasherAppSettings.cpp:161
+msgid "License"
+msgstr "Lisans"
+
 #: Src/Gtk2/dasher_editor.cpp:812 Src/Gtk2/dasher_main.cpp:550
 #: Src/Gtk2/dasher_main.cpp:885
 msgid "_Open"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]