summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-06-10 14:51:42 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2011-06-10 14:51:42 +0200
commit5d1c8bbf75a275ddbc1f01b43165ce9411986b6e (patch)
treef14b11e622cff10d1716bfd299743e0d621aa5ff
parenta2b898b610c7150a8e1c904afbe0f936b7069e4f (diff)
downloadlogdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.tar.gz
logdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.tar.xz
logdiag-5d1c8bbf75a275ddbc1f01b43165ce9411986b6e.zip
Change the way command line arguments are parsed.
-rw-r--r--po/cs.po14
-rw-r--r--po/de.po16
-rw-r--r--po/logdiag.pot10
-rw-r--r--po/pl.po16
-rw-r--r--po/sk.po14
-rw-r--r--src/logdiag.c41
6 files changed, 61 insertions, 50 deletions
diff --git a/po/cs.po b/po/cs.po
index 97ad9c3..e6dcfc2 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -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"
diff --git a/po/de.po b/po/de.po
index 6fc350b..a3dfa73 100644
--- a/po/de.po
+++ b/po/de.po
@@ -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 ""
diff --git a/po/pl.po b/po/pl.po
index 85f01d5..fe5b0db 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -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"
diff --git a/po/sk.po b/po/sk.po
index f21d3a0..0546de9 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -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;