class_docstr: View / controller for the preferences that get displayed in the main window
  
      
class_docstr_tok: ["View","\/","controller","for","the","preferences","that","get","displayed","in","the","main","window"]
code: def update_progress(self, message, elapsed_time, remaining_time=None):
      #
      # Disable everything if in a modal state. The progress bar
      # seems to eat memory in huge chunks if allowed to draw its
      # oh so shiny self while modal in the ultra awesome Mac
      # interface. But you have to admit, the design is disgustingly
      # elegant even if it does cause my ugly application to
      # crash horribly.
      #
      # Taken from Cody Precord's post
      # https://groups.google.com/forum/#!topic/wxpython-users/s8AQ64ptyCg
      #
      for win in wx.GetTopLevelWindows():
          if isinstance(win, wx.Dialog):
              if win.IsModal():
                  self.__progress_bar.Show(False)
                  return
      self.__progress_bar.Show(True)
      self.__progress_msg_ctrl.SetLabel(message)
      if remaining_time is not None:
          self.__progress_bar.SetValue(
              (100 * elapsed_time)
              / (elapsed_time + remaining_time + 0.00001)
          )
          timestr = "Time %s/%s" % (
              secs_to_timestr(elapsed_time),
              secs_to_timestr(elapsed_time + remaining_time),
          )
      else:
          self.__progress_bar.Pulse()
          timestr = "Elapsed time: %s" % secs_to_timestr(elapsed_time)
      self.__timer.SetLabel(timestr)
      self.__progress_panel.Layout()
  
imports: import os
  import wx
  from cellprofiler_core.analysis import use_analysis
  from cellprofiler_core.preferences import DEFAULT_IMAGE_DIRECTORY
  from cellprofiler_core.preferences import DEFAULT_IMAGE_FOLDER_HELP
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_DIRECTORY
  from cellprofiler_core.preferences import DEFAULT_OUTPUT_FOLDER_HELP
  from cellprofiler_core.preferences import add_image_directory_listener
  from cellprofiler_core.preferences import add_output_directory_listener
  from cellprofiler_core.preferences import add_progress_callback
  from cellprofiler_core.preferences import fire_image_directory_changed_event
  from cellprofiler_core.preferences import get_default_image_directory
  from cellprofiler_core.preferences import get_default_output_directory
  from cellprofiler_core.preferences import get_recent_files
  from cellprofiler_core.preferences import remove_image_directory_listener
  from cellprofiler_core.preferences import remove_output_directory_listener
  from cellprofiler_core.preferences import set_default_image_directory
  from cellprofiler_core.preferences import set_default_output_directory
  from cellprofiler_core.preferences import set_pixel_size
  from ._progress_watcher import ProgressWatcher
  from ..constants.preferences_view import WELCOME_MESSAGE
  from ..html.utils import rst_to_html_fragment
  from ..htmldialog import HTMLDialog
  from ..utilities.preferences_view import secs_to_timestr
label_desc: Use image node_id 17 for calling the PreferencesView obj's underlying member method code with example usage: obj.update_progress(message, elapsed_time, remaining_time) without return types