diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2011-06-10 14:51:42 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2011-06-10 14:51:42 +0200 |
commit | 5d1c8bbf75a275ddbc1f01b43165ce9411986b6e (patch) | |
tree | f14b11e622cff10d1716bfd299743e0d621aa5ff | |
parent | a2b898b610c7150a8e1c904afbe0f936b7069e4f (diff) | |
download | logdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.tar.gz logdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.tar.xz logdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.zip |
Change the way command line arguments are parsed.
-rw-r--r-- | po/cs.po | 14 | ||||
-rw-r--r-- | po/de.po | 16 | ||||
-rw-r--r-- | po/logdiag.pot | 10 | ||||
-rw-r--r-- | po/pl.po | 16 | ||||
-rw-r--r-- | po/sk.po | 14 | ||||
-rw-r--r-- | src/logdiag.c | 41 |
6 files changed, 61 insertions, 50 deletions
@@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: logdiag\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-06 16:14+0100\n" -"PO-Revision-Date: 2011-03-06 16:24+0100\n" +"POT-Creation-Date: 2011-06-10 14:24+0200\n" +"PO-Revision-Date: 2011-06-10 14:25+0100\n" "Last-Translator: Přemysl Janouch <p.janouch@gmail.com>\n" "Language-Team: Czech <cs@li.org>\n" "Language: \n" @@ -16,6 +16,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ../src/logdiag.c:117 +msgid "- Schematic editor" +msgstr "- Editor schémat" + #: ../src/ld-window-main.c:769 msgid "Close _without Saving" msgstr "Zavřít _bez uložení" @@ -153,9 +157,9 @@ msgstr "Přiblíží diagram" msgid "Zoom out of the diagram" msgstr "Oddálí diagram" -#: ../src/logdiag.c:42 -msgid "[FILE] - Schematic editor" -msgstr "[SOUBOR] - Editor schémat" +#: ../src/logdiag.c:86 +msgid "[FILE]" +msgstr "[SOUBOR]" #: ../src/ld-window-main.c:173 msgid "_About" @@ -7,15 +7,19 @@ msgid "" msgstr "" "Project-Id-Version: logdiag\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-06 16:14+0100\n" -"PO-Revision-Date: 2011-03-07 05:55+0100\n" -"Last-Translator: Andy J.\n" +"POT-Creation-Date: 2011-06-10 14:24+0200\n" +"PO-Revision-Date: 2011-06-10 14:38+0100\n" +"Last-Translator: Přemysl Janouch <p.janouch@gmail.com>\n" "Language-Team: German <de@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ../src/logdiag.c:117 +msgid "- Schematic editor" +msgstr "- Schema Editor" + #: ../src/ld-window-main.c:769 msgid "Close _without Saving" msgstr "Schließen _ohne Speichern" @@ -155,9 +159,9 @@ msgstr "In das Diagramm zoomen" msgid "Zoom out of the diagram" msgstr "Aus dem Diagramm zoomen" -#: ../src/logdiag.c:42 -msgid "[FILE] - Schematic editor" -msgstr "[DATEI] - Schema Editor" +#: ../src/logdiag.c:86 +msgid "[FILE]" +msgstr "[DATEI]" #: ../src/ld-window-main.c:173 msgid "_About" diff --git a/po/logdiag.pot b/po/logdiag.pot index cc8a857..f577ae0 100644 --- a/po/logdiag.pot +++ b/po/logdiag.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: logdiag \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-06 16:14+0100\n" +"POT-Creation-Date: 2011-06-10 14:24+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -222,6 +222,10 @@ msgstr "" msgid "translator-credits" msgstr "" -#: ../src/logdiag.c:42 -msgid "[FILE] - Schematic editor" +#: ../src/logdiag.c:86 +msgid "[FILE]" +msgstr "" + +#: ../src/logdiag.c:117 +msgid "- Schematic editor" msgstr "" @@ -7,15 +7,19 @@ msgid "" msgstr "" "Project-Id-Version: logdiag\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-06 16:14+0100\n" -"PO-Revision-Date: 2011-02-13 20:36+0100\n" -"Last-Translator: Robert Svoboda <ravath@gmail.com>\n" +"POT-Creation-Date: 2011-06-10 14:24+0200\n" +"PO-Revision-Date: 2011-06-10 14:40+0100\n" +"Last-Translator: Přemysl Janouch <p.janouch@gmail.com>\n" "Language-Team: Polish <pl@li.org>\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ../src/logdiag.c:117 +msgid "- Schematic editor" +msgstr "- Edytor schematów" + #: ../src/ld-window-main.c:769 msgid "Close _without Saving" msgstr "Zamknąć _bez zapisu" @@ -155,9 +159,9 @@ msgstr "Przybliżyć widok" msgid "Zoom out of the diagram" msgstr "Oddalić widok" -#: ../src/logdiag.c:42 -msgid "[FILE] - Schematic editor" -msgstr "[SOUBOR] - Edytor schematów" +#: ../src/logdiag.c:86 +msgid "[FILE]" +msgstr "[PLIK]" #: ../src/ld-window-main.c:173 msgid "_About" @@ -7,8 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: logdiag\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-03-06 16:14+0100\n" -"PO-Revision-Date: 2011-03-06 16:26+0100\n" +"POT-Creation-Date: 2011-06-10 14:24+0200\n" +"PO-Revision-Date: 2011-06-10 14:40+0100\n" "Last-Translator: Přemysl Janouch <p.janouch@gmail.com>\n" "Language-Team: Slovak <sk@li.org>\n" "Language: \n" @@ -16,6 +16,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +#: ../src/logdiag.c:117 +msgid "- Schematic editor" +msgstr "- Editor schém" + #: ../src/ld-window-main.c:769 msgid "Close _without Saving" msgstr "Zatvoriť _bez uloženia" @@ -154,9 +158,9 @@ msgstr "Priblíži diagram" msgid "Zoom out of the diagram" msgstr "Oddiali diagram" -#: ../src/logdiag.c:42 -msgid "[FILE] - Schematic editor" -msgstr "[SÚBOR] - Editor schém" +#: ../src/logdiag.c:86 +msgid "[FILE]" +msgstr "[SÚBOR]" #: ../src/ld-window-main.c:173 msgid "_About" diff --git a/src/logdiag.c b/src/logdiag.c index c9c6af2..90548d3 100644 --- a/src/logdiag.c +++ b/src/logdiag.c @@ -19,6 +19,14 @@ int main (int argc, char *argv[]) { + gchar **files = NULL; + GOptionEntry option_entries[] = + { + {G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &files, + NULL, N_("[FILE]")}, + {NULL} + }; + GError *error; #ifdef _WIN32 gchar *install_dir; @@ -38,8 +46,8 @@ main (int argc, char *argv[]) textdomain (GETTEXT_DOMAIN); error = NULL; - gtk_init_with_args (&argc, &argv, - N_("[FILE] - Schematic editor"), NULL, GETTEXT_DOMAIN, &error); + gtk_init_with_args (&argc, &argv, N_("- Schematic editor"), + option_entries, GETTEXT_DOMAIN, &error); if (error) { g_warning ("%s", error->message); @@ -49,31 +57,14 @@ main (int argc, char *argv[]) gtk_window_set_default_icon_name (PROJECT_NAME); - /* TODO: Accept multiple files. */ - if (argc < 2) - ld_window_main_new (NULL); - else + /* TODO: Be able to open multiple files. */ + if (files) { - gchar *arg_utf8, *arg_filename; - - arg_utf8 = g_locale_to_utf8 (argv[1], -1, NULL, NULL, &error); - if (error) - { - g_warning ("%s", error->message); - g_error_free (error); - return 1; - } - arg_filename = g_filename_from_utf8 (arg_utf8, -1, NULL, NULL, &error); - if (error) - { - g_warning ("%s", error->message); - g_error_free (error); - return 1; - } - ld_window_main_new (arg_filename); - g_free (arg_filename); - g_free (arg_utf8); + ld_window_main_new (files[0]); + g_strfreev (files); } + else + ld_window_main_new (NULL); gtk_main (); return 0; |