change callback, widget and variable names for subscription request window in glade and in the code
This commit is contained in:
		
							parent
							
								
									b97b090054
								
							
						
					
					
						commit
						e05fde85a2
					
				
					 2 changed files with 18 additions and 77 deletions
				
			
		| 
						 | 
					@ -416,32 +416,31 @@ class confirm_Window:
 | 
				
			||||||
		xml.get_widget('label_confirm').set_text(label)
 | 
							xml.get_widget('label_confirm').set_text(label)
 | 
				
			||||||
		self.win = xml.get_widget('Confirm')
 | 
							self.win = xml.get_widget('Confirm')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class authorize_Window:
 | 
					class subscription_request_Window:
 | 
				
			||||||
	"""Class for authorization window :
 | 
						"""Class for authorization window :
 | 
				
			||||||
	window that appears when a user wants to add us to his/her roster"""
 | 
						window that appears when a user wants to add us to his/her roster"""
 | 
				
			||||||
	def on_close(self, widget):
 | 
						def on_close_button_clicked(self, widget):
 | 
				
			||||||
		"""When Close button is clicked"""
 | 
							"""When Close button is clicked"""
 | 
				
			||||||
		widget.get_toplevel().destroy()
 | 
							widget.get_toplevel().destroy()
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
	def auth(self, widget):
 | 
						def on_authorize_button_clicked(self, widget):
 | 
				
			||||||
		"""Accept the request"""
 | 
							"""Accept the request"""
 | 
				
			||||||
		self.plugin.send('AUTH', self.account, self.jid)
 | 
							self.plugin.send('AUTH', self.account, self.jid)
 | 
				
			||||||
		widget.get_toplevel().destroy()
 | 
							widget.get_toplevel().destroy()
 | 
				
			||||||
		if not self.plugin.roster.contacts[self.account].has_key(self.jid):
 | 
							if not self.plugin.roster.contacts[self.account].has_key(self.jid):
 | 
				
			||||||
			addContact_Window(self.plugin, self.account, self.jid)
 | 
								addContact_Window(self.plugin, self.account, self.jid)
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	def deny(self, widget):
 | 
						def on_deny_button_clicked(self, widget):
 | 
				
			||||||
		"""refuse the request"""
 | 
							"""refuse the request"""
 | 
				
			||||||
		self.plugin.send('DENY', self.account, self.jid)
 | 
							self.plugin.send('DENY', self.account, self.jid)
 | 
				
			||||||
		widget.get_toplevel().destroy()
 | 
							widget.get_toplevel().destroy()
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	def __init__(self, plugin, jid, txt, account):
 | 
						def __init__(self, plugin, jid, text, account):
 | 
				
			||||||
		xml = gtk.glade.XML(GTKGUI_GLADE, 'Sub_req', APP)
 | 
							xml = gtk.glade.XML(GTKGUI_GLADE, 'subscription_request_window', APP)
 | 
				
			||||||
		self.plugin = plugin
 | 
							self.plugin = plugin
 | 
				
			||||||
		self.jid = jid
 | 
							self.jid = jid
 | 
				
			||||||
		self.account = account
 | 
							self.account = account
 | 
				
			||||||
		xml.get_widget('label').set_text(_("Subscription request from %s") % self.jid)
 | 
							xml.get_widget('from_label').set_text(\
 | 
				
			||||||
		xml.get_widget("textview").get_buffer().set_text(txt)
 | 
								_('Subscription request from %s') % self.jid)
 | 
				
			||||||
		xml.signal_connect('on_button_auth_clicked', self.auth)
 | 
							xml.get_widget('message_textview').get_buffer().set_text(text)
 | 
				
			||||||
		xml.signal_connect('on_button_deny_clicked', self.deny)
 | 
							xml.signal_autoconnect(self)
 | 
				
			||||||
		xml.signal_connect('on_button_close_clicked', self.on_close)
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2634,7 +2634,7 @@ on the server as a vCard</property>
 | 
				
			||||||
  </child>
 | 
					  </child>
 | 
				
			||||||
</widget>
 | 
					</widget>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<widget class="GtkWindow" id="Sub_req">
 | 
					<widget class="GtkWindow" id="subscription_request_window">
 | 
				
			||||||
  <property name="border_width">5</property>
 | 
					  <property name="border_width">5</property>
 | 
				
			||||||
  <property name="visible">True</property>
 | 
					  <property name="visible">True</property>
 | 
				
			||||||
  <property name="title" translatable="yes">Subscription request</property>
 | 
					  <property name="title" translatable="yes">Subscription request</property>
 | 
				
			||||||
| 
						 | 
					@ -2658,7 +2658,7 @@ on the server as a vCard</property>
 | 
				
			||||||
      <property name="spacing">0</property>
 | 
					      <property name="spacing">0</property>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      <child>
 | 
					      <child>
 | 
				
			||||||
	<widget class="GtkLabel" id="label">
 | 
						<widget class="GtkLabel" id="from_label">
 | 
				
			||||||
	  <property name="visible">True</property>
 | 
						  <property name="visible">True</property>
 | 
				
			||||||
	  <property name="label" translatable="yes">Subscription request from</property>
 | 
						  <property name="label" translatable="yes">Subscription request from</property>
 | 
				
			||||||
	  <property name="use_underline">False</property>
 | 
						  <property name="use_underline">False</property>
 | 
				
			||||||
| 
						 | 
					@ -2689,7 +2689,7 @@ on the server as a vCard</property>
 | 
				
			||||||
	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 | 
						  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  <child>
 | 
						  <child>
 | 
				
			||||||
	    <widget class="GtkTextView" id="textview">
 | 
						    <widget class="GtkTextView" id="message_textview">
 | 
				
			||||||
	      <property name="visible">True</property>
 | 
						      <property name="visible">True</property>
 | 
				
			||||||
	      <property name="can_focus">True</property>
 | 
						      <property name="can_focus">True</property>
 | 
				
			||||||
	      <property name="editable">False</property>
 | 
						      <property name="editable">False</property>
 | 
				
			||||||
| 
						 | 
					@ -2734,78 +2734,20 @@ on the server as a vCard</property>
 | 
				
			||||||
	  <property name="spacing">20</property>
 | 
						  <property name="spacing">20</property>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  <child>
 | 
						  <child>
 | 
				
			||||||
	    <widget class="GtkButton" id="button_close">
 | 
						    <widget class="GtkButton" id="close_button">
 | 
				
			||||||
	      <property name="visible">True</property>
 | 
						      <property name="visible">True</property>
 | 
				
			||||||
	      <property name="can_default">True</property>
 | 
						      <property name="can_default">True</property>
 | 
				
			||||||
	      <property name="can_focus">True</property>
 | 
						      <property name="can_focus">True</property>
 | 
				
			||||||
 | 
						      <property name="label">gtk-close</property>
 | 
				
			||||||
 | 
						      <property name="use_stock">True</property>
 | 
				
			||||||
	      <property name="relief">GTK_RELIEF_NORMAL</property>
 | 
						      <property name="relief">GTK_RELIEF_NORMAL</property>
 | 
				
			||||||
	      <property name="focus_on_click">True</property>
 | 
						      <property name="focus_on_click">True</property>
 | 
				
			||||||
	      <signal name="clicked" handler="on_button_close_clicked" last_modification_time="Mon, 03 Nov 2003 19:01:49 GMT"/>
 | 
						      <signal name="clicked" handler="on_button_close_clicked" last_modification_time="Mon, 03 Nov 2003 19:01:49 GMT"/>
 | 
				
			||||||
 | 
					 | 
				
			||||||
	      <child>
 | 
					 | 
				
			||||||
		<widget class="GtkAlignment" id="alignment11">
 | 
					 | 
				
			||||||
		  <property name="visible">True</property>
 | 
					 | 
				
			||||||
		  <property name="xalign">0.5</property>
 | 
					 | 
				
			||||||
		  <property name="yalign">0.5</property>
 | 
					 | 
				
			||||||
		  <property name="xscale">0</property>
 | 
					 | 
				
			||||||
		  <property name="yscale">0</property>
 | 
					 | 
				
			||||||
		  <property name="top_padding">0</property>
 | 
					 | 
				
			||||||
		  <property name="bottom_padding">0</property>
 | 
					 | 
				
			||||||
		  <property name="left_padding">0</property>
 | 
					 | 
				
			||||||
		  <property name="right_padding">0</property>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		  <child>
 | 
					 | 
				
			||||||
		    <widget class="GtkHBox" id="hbox15">
 | 
					 | 
				
			||||||
		      <property name="visible">True</property>
 | 
					 | 
				
			||||||
		      <property name="homogeneous">False</property>
 | 
					 | 
				
			||||||
		      <property name="spacing">2</property>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		      <child>
 | 
					 | 
				
			||||||
			<widget class="GtkImage" id="image69">
 | 
					 | 
				
			||||||
			  <property name="visible">True</property>
 | 
					 | 
				
			||||||
			  <property name="stock">gtk-close</property>
 | 
					 | 
				
			||||||
			  <property name="icon_size">4</property>
 | 
					 | 
				
			||||||
			  <property name="xalign">0.5</property>
 | 
					 | 
				
			||||||
			  <property name="yalign">0.5</property>
 | 
					 | 
				
			||||||
			  <property name="xpad">0</property>
 | 
					 | 
				
			||||||
			  <property name="ypad">0</property>
 | 
					 | 
				
			||||||
			</widget>
 | 
					 | 
				
			||||||
			<packing>
 | 
					 | 
				
			||||||
			  <property name="padding">0</property>
 | 
					 | 
				
			||||||
			  <property name="expand">False</property>
 | 
					 | 
				
			||||||
			  <property name="fill">False</property>
 | 
					 | 
				
			||||||
			</packing>
 | 
					 | 
				
			||||||
		      </child>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		      <child>
 | 
					 | 
				
			||||||
			<widget class="GtkLabel" id="label24">
 | 
					 | 
				
			||||||
			  <property name="visible">True</property>
 | 
					 | 
				
			||||||
			  <property name="label" translatable="yes">_Close</property>
 | 
					 | 
				
			||||||
			  <property name="use_underline">True</property>
 | 
					 | 
				
			||||||
			  <property name="use_markup">False</property>
 | 
					 | 
				
			||||||
			  <property name="justify">GTK_JUSTIFY_LEFT</property>
 | 
					 | 
				
			||||||
			  <property name="wrap">False</property>
 | 
					 | 
				
			||||||
			  <property name="selectable">False</property>
 | 
					 | 
				
			||||||
			  <property name="xalign">0.5</property>
 | 
					 | 
				
			||||||
			  <property name="yalign">0.5</property>
 | 
					 | 
				
			||||||
			  <property name="xpad">0</property>
 | 
					 | 
				
			||||||
			  <property name="ypad">0</property>
 | 
					 | 
				
			||||||
			</widget>
 | 
					 | 
				
			||||||
			<packing>
 | 
					 | 
				
			||||||
			  <property name="padding">0</property>
 | 
					 | 
				
			||||||
			  <property name="expand">False</property>
 | 
					 | 
				
			||||||
			  <property name="fill">False</property>
 | 
					 | 
				
			||||||
			</packing>
 | 
					 | 
				
			||||||
		      </child>
 | 
					 | 
				
			||||||
		    </widget>
 | 
					 | 
				
			||||||
		  </child>
 | 
					 | 
				
			||||||
		</widget>
 | 
					 | 
				
			||||||
	      </child>
 | 
					 | 
				
			||||||
	    </widget>
 | 
						    </widget>
 | 
				
			||||||
	  </child>
 | 
						  </child>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  <child>
 | 
						  <child>
 | 
				
			||||||
	    <widget class="GtkButton" id="button_deny">
 | 
						    <widget class="GtkButton" id="deny_button">
 | 
				
			||||||
	      <property name="visible">True</property>
 | 
						      <property name="visible">True</property>
 | 
				
			||||||
	      <property name="can_default">True</property>
 | 
						      <property name="can_default">True</property>
 | 
				
			||||||
	      <property name="can_focus">True</property>
 | 
						      <property name="can_focus">True</property>
 | 
				
			||||||
| 
						 | 
					@ -2876,7 +2818,7 @@ on the server as a vCard</property>
 | 
				
			||||||
	  </child>
 | 
						  </child>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	  <child>
 | 
						  <child>
 | 
				
			||||||
	    <widget class="GtkButton" id="button_auth">
 | 
						    <widget class="GtkButton" id="authorize_button">
 | 
				
			||||||
	      <property name="visible">True</property>
 | 
						      <property name="visible">True</property>
 | 
				
			||||||
	      <property name="can_default">True</property>
 | 
						      <property name="can_default">True</property>
 | 
				
			||||||
	      <property name="can_focus">True</property>
 | 
						      <property name="can_focus">True</property>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue