~davidc3/onehundredscopes/unity-lens-answers

« back to all changes in this revision

Viewing changes to src/unity-lens-answers

  • Committer: David Callé
  • Date: 2012-11-29 21:18:19 UTC
  • Revision ID: davidc@framli.eu-20121129211819-b3czz447j9tan37d
No answers -> Ask Google

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
                icon = self.icon_picker(search)
84
84
                model.append(source,"/usr/share/unity/lenses/answers/answer"+icon+".svg",0, "text/html", text, "", search)
85
85
                break
 
86
        else:
 
87
            text = "I'm not sure... What about asking Google?"
 
88
            model.append("http://google.com?q="+search,"/usr/share/unity/lenses/answers/answer1.svg",0, "text/html", text, "", "")
86
89
        si.finished ()
87
90
 
88
91
 
108
111
                text = model.get_value(iter, 4)
109
112
                text = text.replace("&", "and")
110
113
                question = model.get_value(iter, 6)
111
 
                
 
114
                image = self._getGoogleImage (question)
 
115
                if question == "":
 
116
                    question = "I'm not sure..."
 
117
                    text = "What about asking Google?"
 
118
                    image = self._getGoogleImage ("What's the Google logo")
112
119
                preview = Unity.GenericPreview.new("", text, None)
113
120
                preview.props.subtitle = question.capitalize()
114
 
                image = self._getGoogleImage (question)
115
121
                if image:
116
122
                    preview.props.image_source_uri = image
117
123
                if uri.startswith("http"):