Here is another patch, that fixes the inability to specify command line
options:
Index: src/Xournalpp.cpp
===================================================================
--- src/Xournalpp.cpp (revision 21)
+++ src/Xournalpp.cpp (working copy)
@@ -87,12 +87,17 @@
}
static bool optNoWarnSVN = false;
-static const gchar * optFilename;
-static GOptionEntry options[] = { { "no-warn-svn", 'w', 0, G_OPTION_ARG_NONE,
&optNoWarnSVN,
- "Do not warn this is a development release", NULL }, {
G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME,
- &optFilename, NULL, "<input>" }, { NULL } };
+static gchar ** optFilename;
+static GOptionEntry options[] = {
+ { "no-warn-svn", 'w', 0, G_OPTION_ARG_NONE, &optNoWarnSVN, "Do
not warn this is a development release", NULL },
+ { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &optFilename,
"<input>" , NULL},
+ { NULL }
+
+
+};
+
int main(int argc, char *argv[]) {
installCrashHandlers();
@@ -148,7 +153,18 @@
bool opened = false;
if (optFilename) {
- GFile * file = g_file_new_for_commandline_arg(optFilename);
+
+ if (g_strv_length (optFilename) != 1) {
+ GtkWidget * dialog =
gtk_message_dialog_new((GtkWindow*) *win, GTK_DIALOG_DESTROY_WITH_PARENT,
+
GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, _("Sorry, Xournal can only open one file
from the command line.\n"
+
"Others are ignored."));
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy(dialog);
+
+ }
+
+
+ GFile * file = g_file_new_for_commandline_arg(optFilename[0]);
char * uri = g_file_get_uri(file);
String sUri = uri;
g_free(uri);
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Xournal-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xournal-devel