Example #1
0
	def mms_menu_button_clicked(self, button, fname):
		""" actions for mms menu """
		buttontext = button.get_label()
		if buttontext == self.headerstxt:
			ret = self.create_headers_dialog(fname)
		elif buttontext == self.replytxt:
			number = self.cont.get_replyuri_from_transid(fname)
			fMMSSenderUI.fMMS_SenderUI(spawner=self.window, tonumber=number).run()
		elif buttontext == self.replysmstxt:
			number = self.cont.get_replyuri_from_transid(fname)
			if "@" in number:
				note = osso.SystemNote(self.osso_c)
				note.system_note_dialog(gettext.ldgettext('rtcom-messaging-ui', "messaging_fi_smsc_invalid_chars") , 'notice')
			else:
				rpc = osso.Rpc(self.osso_c)
				nr = "sms:%s" % str(number)
				args = (nr, "")
				rpc.rpc_run('com.nokia.MessagingUI', '/com/nokia/MessagingUI', 'com.nokia.MessagingUI', 'messaging_ui_interface_start_sms', args, True, True)
		elif buttontext == self.forwardtxt:
			tbuffer = self.textview.get_buffer()
			msg = tbuffer.get_text(tbuffer.get_start_iter(), tbuffer.get_end_iter())
			fn = self.attachment
			fMMSSenderUI.fMMS_SenderUI(spawner=self.window, withfile=fn, message=msg, forward=True)
		elif buttontext == self.deletetxt:
			self.delete_dialog(fname)
		elif buttontext == self.copytxt:
			clip = gtk.Clipboard(display=gtk.gdk.display_get_default(), selection="CLIPBOARD")
			tbuffer = self.textview.get_buffer()
			msg = tbuffer.get_text(tbuffer.get_start_iter(), tbuffer.get_end_iter())
			clip.set_text(msg, -1)
		elif buttontext == self.saveattachments:
			self.save_attachments(fname)
 def test_system_note_infoprint(self):
     # Delay for some time before calling rpc_run_with_defaults().
     # Otherwise, this error might occur:
     # Message did not receive a reply (timeout by message bus)
     import time
     time.sleep(0.5)
     note = osso.SystemNote(self.ctx)
     note.system_note_infoprint("test text")
Example #3
0
def main():
    
    osso_c = osso.Context("osso_test_note", "0.0.1", False)

    note = osso.SystemNote(osso_c)

    result = note.system_note_infoprint("System Note test application")

    print result
    loop = gobject.MainLoop()

    loop.run()
Example #4
0
 def create_reset_dialog(self, parent=None):
     dialog = gtk.Dialog()
     dialog.set_transient_for(parent)
     dialog.set_title(_('Reset settings'))
     dialog.add_button(gtk.STOCK_YES, 1)
     dialog.add_button(gtk.STOCK_NO, 0)
     label = gtk.Label(_('Are you sure you want to reset all settings?'))
     dialog.vbox.add(label)
     dialog.show_all()
     ret = dialog.run()
     if ret == 1:
         import osso
         self.osso_c = osso.Context("fMMS", "1.0", False)
         note = osso.SystemNote(self.osso_c)
         note.system_note_dialog(
             _('Application will close after settings are removed'),
             'notice')
         self.reset_all_settings()
         import sys
         sys.exit(0)
     dialog.destroy()
Example #5
0
 def show_system_note(self, msg):
     note = osso.SystemNote(self.osso_c)
     note.system_note_dialog(msg, 'notice')
 def test_system_note_dialog(self):
     note = osso.SystemNote(self.ctx)
     note.system_note_dialog("test message", "warning")
 def test_constructor_system_notification(self):
     systemnote = osso.SystemNote(self.ctx)
     self.assertTrue(isinstance(systemnote, osso.SystemNote))
     self.assertRaises(TypeError, osso.SystemNote, None)
Example #8
0
      except IOError:
          try:
            save_page=open('%s___' % filename[0:-1],'w')
          except IOError:
            error_msg="Error saving "+title+" from "+url+" to "+filename
            print error_msg
            print url 
            sys.exit()
      article_html=page.read().replace('<head>','<head><link rel="stylesheet" type="text/css" href="../slashdot.css" />')  
      save_page.writelines(article_html)
      save_page.close()
      print 'Saved'
      for j in [3,2,1]:
        print j
        time.sleep(1)

    print '%s saves' %i

    try:
        import osso
        osso_c = osso.Context("osso_test_note", "0.0.1", False)
        note = osso.SystemNote(osso_c)
        note.system_note_dialog('Downloaded', type='notice')
    except ImportError:
        pass

for day in xrange(start_day,end_day):
    # get page of each date
    date=datetime.datetime(final_year,final_month,day)
    fetch_headlines(date)
#!/usr/bin/python2.5 -u
import osso

c = osso.Context("test_system_note", "0.0.0", True)

#print "c.get_name() ->", c.get_name()
#print "c.get_version() ->", c.get_version()
#print "c.get_rpc_timeout() ->", c.get_rpc_timeout()
#print "c.set_rpc_timeout(15) ->", c.set_rpc_timeout(15)
#print "c.get_rpc_timeout() ->", c.get_rpc_timeout()

osso_sysnote = osso.SystemNote(c)

print "DIALOG:", osso_sysnote.system_note_dialog("Test Notice Dialog!")
#a = raw_input()
print "DIALOG:", osso_sysnote.system_note_dialog("Test Notice Dialog Again!",
                                                 "notice")
#a = raw_input()
print "DIALOG:", osso_sysnote.system_note_dialog("Test Wait Dialog!", "wait")
#a = raw_input()
print "DIALOG:", osso_sysnote.system_note_dialog("Test Error Dialog!", "error")
#a = raw_input()
print "DIALOG:", osso_sysnote.system_note_dialog("Test Warning Dialog!",
                                                 "warning")
#a = raw_input()
print "INFOPRINT:", osso_sysnote.system_note_infoprint("Test Infoprint!")
#a = raw_input()

c.close()
Example #10
0
def banner_notification(message):
    osso_c = osso.Context("heysms_notif", "0.0.1", False)
    note = osso.SystemNote(osso_c)
    note.system_note_infoprint(message)
Example #11
0
def callback_func(interface, method, arguments, user_data):
    print "RPC received"
    osso_c = user_data
    osso_sysnote = osso.SystemNote(osso_c)
    osso_sysnote.system_note_infoprint(
        "osso_test_receiver: Received an RPC to %s." % method)