~ps-jenkins/unity-lens-applications/latestsnapshot-6.10.0daily13.04.23ubuntu.unity.experimental.certified-0ubuntu1

« back to all changes in this revision

Viewing changes to src/daemon.vala

  • Committer: Michal Hruby
  • Date: 2013-03-07 18:21:59 UTC
  • Revision ID: michal.mhr@gmail.com-20130307182159-is0lhk6yr0oa1a5q
Fix sources filter

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
      scope.search_hint = _("Search Applications");
171
171
      scope.search_in_global = true;
172
172
      // scope.sources_display_name = _("Sources");
173
 
      populate_categories ();
174
 
      populate_filters();
175
 
      //scope.icon = @"$(Config.PREFIX)/share/unity/themes/applications.png";
176
 
 
177
173
      // TRANSLATORS: Please make sure this string is short enough to fit
178
174
      // into the filter button
179
175
      local_apps_option = scope.sources.add_option ("local", _("Local Apps"));
184
180
        usc_apps_option = scope.sources.add_option ("usc", _("Software Center"));
185
181
      }
186
182
 
 
183
      populate_categories ();
 
184
      populate_filters();
 
185
      //scope.icon = @"$(Config.PREFIX)/share/unity/themes/applications.png";
 
186
 
187
187
      scope.generate_search_key.connect ((lens_search) =>
188
188
      {
189
189
        return lens_search.search_string.strip ();
244
244
      ratings_db_initialized = true;
245
245
    }
246
246
 
247
 
    private async void dispatch_search (DeprecatedScopeSearch lens_search,
 
247
    private async void dispatch_search (DeprecatedScopeSearch search,
248
248
                                        SearchType search_type,
249
249
                                        GLib.Cancellable cancellable)
250
250
    {
258
258
      }
259
259
 
260
260
      if (search_type == SearchType.DEFAULT)
261
 
        yield update_scope_search (lens_search, cancellable);
 
261
        yield update_scope_search (search, cancellable);
262
262
      else
263
 
        yield update_global_search (lens_search, cancellable);
 
263
        yield update_global_search (search, cancellable);
 
264
 
 
265
      search.finished ();
264
266
    }
265
267
 
266
268
    private void populate_categories ()
603
605
        search.set_reply_hint ("no-results-hint",
604
606
          _("Sorry, there are no applications that match your search."));
605
607
      }
606
 
 
607
 
      search.finished ();
608
608
    }
609
609
 
610
610
    private async void update_global_search (DeprecatedScopeSearch search,
639
639
      timer.stop ();
640
640
      debug ("Global search listed %i Installed apps in %fms for query: %s",
641
641
             appresults.num_hits, timer.elapsed ()*1000, search_string);
642
 
 
643
 
      /* Allow new searches once we enter an idle again.
644
 
       * We don't do it directly from here as that could mean we start
645
 
       * changing the model even before we had flushed out current changes
646
 
       */
647
 
      search.finished ();
648
642
    }
649
643
 
650
644
    private async void update_global_without_search (DeprecatedScopeSearch search,
690
684
                   search.search_string, e.message);
691
685
        }
692
686
      }
693
 
 
694
 
      search.finished ();
695
687
    }
696
688
 
697
689
    public Icon find_pkg_icon (string? desktop_file, string icon_name)