From 2d2e3cf53192918299d24f2ceb5e864e04ebc520 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 26 Oct 2018 11:53:45 +0300 Subject: Take path to document to edit on the command line Sure, could add more and more options to specify what LibreOffice installation to run against, etc, like gtktiledviewer. That is not a priority though, this is just a very basic testbed for now. --- gtk/mobile.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/mobile.cpp b/gtk/mobile.cpp index 61d5d6c91f..a819972cbf 100644 --- a/gtk/mobile.cpp +++ b/gtk/mobile.cpp @@ -270,6 +270,12 @@ static void handle_error_message(WebKitUserContentManager *manager, int main(int argc, char* argv[]) { + if (argc != 2) + { + fprintf(stderr, "Usage: %s document\n", argv[0]); + exit(1); + } + Log::initialize("Mobile", "trace", false, false, {}); Util::setThreadName("main"); fakeSocketSetLoggingCallback([](const std::string& line) @@ -324,9 +330,7 @@ int main(int argc, char* argv[]) g_signal_connect(main_window, "destroy", G_CALLBACK(destroyWindowCb), NULL); g_signal_connect(webView, "close", G_CALLBACK(closeWebViewCb), main_window); - system("cp " TOPSRCDIR "/test/data/hello.odt" " " TOPSRCDIR "/test/data/hello-world.odt"); - - fileURL = "file://" TOPSRCDIR "/test/data/hello-world.odt"; + fileURL = "file://" + std::string(realpath(argv[1], NULL)); std::string urlAndQuery = "file://" TOPSRCDIR "/loleaflet/dist/loleaflet.html" -- cgit