~mhr3/libunity/fix-1062331

« back to all changes in this revision

Viewing changes to src/unity-scope-private.vala

  • Committer: Tarmac
  • Author(s): Michal Hruby
  • Date: 2012-09-05 10:21:10 UTC
  • mfrom: (171.1.4 libunity)
  • Revision ID: tarmac-20120905102110-4myo5pskc1jyq44r
Add hints parameter to dbus Activate() method. Fixes: . Approved by Pawel Stolowski.

Show diffs side-by-side

added added

removed removed

Lines of Context:
283
283
  }
284
284
 
285
285
  public async ActivationReplyRaw activate (string uri,
286
 
                                            uint action_type) throws IOError
 
286
                                            uint action_type,
 
287
                                            HashTable<string, Variant> hints) throws IOError
287
288
  {
288
289
    var reply = ActivationReplyRaw ();
289
290
    ActivationResponse? response = null;
302
303
      case ActionType.PREVIEW_ACTION:
303
304
        string[] tokens = uri.split (":", 2);
304
305
        stripped_uri = tokens[1];
305
 
        response = activate_action (tokens[0], stripped_uri);
 
306
        response = activate_action (tokens[0], stripped_uri, hints);
306
307
        break;
307
308
      case ActionType.PREVIEW_BUILTIN_ACTION:
308
309
        // TODO: implement
321
322
        var new_uri = response.goto_uri;
322
323
        if (new_uri == null || new_uri[0] == '\0')
323
324
          new_uri = stripped_uri ?? uri;
324
 
        reply = yield activate (new_uri, ActionType.PREVIEW_RESULT);
 
325
        reply = yield activate (new_uri, ActionType.PREVIEW_RESULT, hints);
325
326
        return reply;
326
327
      }
327
328
    }
584
585
    return response;
585
586
  }
586
587
 
587
 
  public ActivationResponse? activate_action (string action_id, string uri)
 
588
  public ActivationResponse? activate_action (string action_id, string uri,
 
589
                                              HashTable<string, Variant> hints)
588
590
  {
589
591
    ActivationResponse? response = null;
590
592
    var action = _action_map[action_id];
591
593
    if (action != null)
 
594
    {
 
595
      var action_hints = action.hints;
 
596
      action_hints.remove_all ();
 
597
      if (hints.size () > 0)
 
598
      {
 
599
        HashTableIter<string, Variant> iter = HashTableIter<string, Variant> (hints);
 
600
        unowned string key;
 
601
        unowned Variant value;
 
602
        while (iter.next (out key, out value))
 
603
        {
 
604
          action_hints[key] = value;
 
605
        }
 
606
      }
592
607
      response = action.activated (uri);
 
608
    }
593
609
    else
594
610
      warning ("Cannot find PreviewAction with id: %s", action_id);
595
611