示例#1
0
  def on_click_me_clicked(self, button):
    """
    Method to handle click event on Send SMS button.
 
    Args:
      button - the button 
    """
    u = self.numentry.get_text()
    p = self.msgentry.get_text()
    s = zw_lib.authenticate(u,p)
    self.destroy()
    Gtk.main_quit()
示例#2
0
def readmsgs(buf, num=190):
  """
  View recent messages in a list window.

  Args:
    buf - buffer passed from the menu object
    num - number of messages to get
  """
  s = zw_lib.authenticate()
  recent = zw_lib.get_recent(s, num)
  win = CellRendererTextWindow(recent)
  win.connect("delete-event", Gtk.main_quit)
  win.show_all()
  Gtk.main()
示例#3
0
def markread(buf, num=90):
  """
  Mark recent messages read.

  Args:
    buf - buffer passed from the menu object
    num - number of messages to get
  """
  s = zw_lib.authenticate()
  zw_lib.show_recent(s, num, False, True, False)
  n = notify2.Notification("Zipwhip", 
        "All messages marked read", 
        "phone")
  n.show()
示例#4
0
  Main loop for background threads.
  """
  background_thread = threading.Thread(target=background_run)
  background_thread.daemon = True
  background_thread.start()


if __name__ == "__main__":
  notify2.init("Zipwhip", "glib")
  if not os.path.isfile(SETTINGS_FILE):
    s = PasswordWindow()
    s.connect("delete-event", Gtk.main_quit)
    s.show_all()
    Gtk.main()
  try:
    s = zw_lib.authenticate()
  except:
    n = notify2.Notification("Zipwhip", 
      "Error: Can't connect to Zipwhip.  Exiting.", "phone")
    n.show()
    sys.exit(0)
  ind = appindicator.Indicator.new(
                        "Zipwhip",
                        "phone",
                        appindicator.IndicatorCategory.APPLICATION_STATUS,
                       )
  ind.set_status (appindicator.IndicatorStatus.ACTIVE)
  ind.set_attention_icon ("phone")
  menu = Gtk.Menu()

  # create some