After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 665300 - Allow to open previews from the command line
Allow to open previews from the command line
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-12-01 16:15 UTC by Florian Müllner
Modified: 2011-12-01 19:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
embed: Allow switching directly between previews (3.63 KB, patch)
2011-12-01 16:15 UTC, Florian Müllner
none Details | Review
application: Allow to open previews from the command line (3.29 KB, patch)
2011-12-01 16:15 UTC, Florian Müllner
none Details | Review
embed: Allow switching directly between previews (3.53 KB, patch)
2011-12-01 17:45 UTC, Florian Müllner
committed Details | Review
application: Allow to open previews from the command line (3.29 KB, patch)
2011-12-01 17:45 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2011-12-01 16:15:40 UTC
See patches.
Comment 1 Florian Müllner 2011-12-01 16:15:42 UTC
Created attachment 202531 [details] [review]
embed: Allow switching directly between previews

Currently it is only possible to open a preview from the overview.
However, when we allow to open a preview from the command line, we
should switch to the new preview even if we are already in preview
mode.
Comment 2 Florian Müllner 2011-12-01 16:15:45 UTC
Created attachment 202532 [details] [review]
application: Allow to open previews from the command line

Allow to pass in a URN on the command line and handle it in the
primary instance. This will be used by the gnome-shell search
provider to open search results.
Comment 3 Florian Müllner 2011-12-01 17:45:22 UTC
Created attachment 202535 [details] [review]
embed: Allow switching directly between previews

Fix for collections.
Comment 4 Florian Müllner 2011-12-01 17:45:35 UTC
Created attachment 202536 [details] [review]
application: Allow to open previews from the command line

Reattaching to maintain patch order
Comment 5 Cosimo Cecchi 2011-12-01 19:12:05 UTC
Review of attachment 202535 [details] [review]:

Looks good.

::: src/embed.js
@@ +234,3 @@
+
+        if (doc == null)
+            return;

I prefer the if (!foo) style in JS, since it's also safe vs. undefined values.
Comment 6 Cosimo Cecchi 2011-12-01 19:41:44 UTC
Review of attachment 202536 [details] [review]:

Looks good, thanks!

::: src/main.js
@@ +24,3 @@
 function start() {
     let application = new Application.Application();
+    return application.application.run(ARGV);

Why do you return here?
Comment 7 Florian Müllner 2011-12-01 19:49:20 UTC
Attachment 202535 [details] pushed as 95b8ed5 - embed: Allow switching directly between previews
Attachment 202536 [details] pushed as e5f507d - application: Allow to open previews from the command line

(In reply to comment #6)
> @@ +24,3 @@
>  function start() {
>      let application = new Application.Application();
> +    return application.application.run(ARGV);
> 
> Why do you return here?

From g_application_run() docs:
This function is intended to be run from main() and its return value is intended to be returned by main().

(and yes, it actually works, though there's a bug currently which prevents non-primary instances from returning immediately)