~facundo/encuentro/trunk

« back to all changes in this revision

Viewing changes to encuentro/ui/central_panel.py

  • Committer: Facundo Batista
  • Date: 2013-04-02 21:23:58 UTC
  • mto: (151.2.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 154.
  • Revision ID: facundo@taniquetil.com.ar-20130402212358-h1hlb5f65oftqyvb
Have a throbber (or spinner).

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    QHBoxLayout,
28
28
    QLabel,
29
29
    QMenu,
 
30
    QMovie,
30
31
    QPixmap,
31
32
    QPushButton,
32
33
    QTextEdit,
39
40
from encuentro import data, image
40
41
from encuentro.data import Status
41
42
from encuentro.ui import remembering
 
43
from encuentro.ui.throbber import Throbber
42
44
 
43
45
logger = logging.getLogger("encuentro.centralpanel")
44
46
 
286
288
        self.current_episode = None
287
289
        layout = QVBoxLayout(self)
288
290
 
289
 
        # FIXME: add a spinner, here
 
291
        # a throbber, that we don't initially show
 
292
        self.throbber = Throbber()
 
293
        layout.addWidget(self.throbber)
 
294
        self.throbber.hide()
290
295
 
291
296
        # the image and its getter
292
297
        self.image_episode = QLabel()
316
321
        self.image_episode.setPixmap(pixmap)
317
322
        self.image_episode.show()
318
323
 
319
 
        # hide the spinner
320
 
        # FIXME: hide the spinner
321
 
#        self.image_spinner.stop()
322
 
#        self.image_spinner.hide()
 
324
        # hide the throbber
 
325
        self.throbber.hide()
323
326
 
324
327
    def update(self, episode):
325
328
        """Update all the episode info."""
328
331
        # image
329
332
        if episode.image_url is not None:
330
333
            # this must be before the get_image call, as it may call
331
 
            # immediately to image_episode_loaded, showing the image and
332
 
            # hiding the spinner
333
 
            # FIXME: we need to put a spinner here until we get the image
 
334
            # immediately to image_episode_loaded (showing the image and
 
335
            # hiding the throber)
334
336
            self.image_episode.hide()
335
 
#            self.image_spinner.show()
336
 
#            self.image_spinner.start()
 
337
            self.throbber.show()
337
338
            # now do call the get_image
338
339
            self.get_image(episode.episode_id,
339
340
                           episode.image_url.encode('utf-8'))