Commits

Erik Grinaker committed 784a991

fixed some bugs introduced during development

Comments (0)

Files changed (7)

 
 	* merged the ui module into the widget module
 
+	* fixed some bugs introduced during development
+
 2004-08-07  Erik Grinaker <erikg@codepoet.no>
 
 	* minor code cleanups
 		# check the entry fields
 		items = [ entry.name, entry.description ]
 
-		if self.namedesc:
+		if self.namedesc == gtk.FALSE:
 			for field in entry.get_fields():
 				if field.value != "":
 					items.append(field.value)

src/lib/datahandler/fpm.py

 		size = self.blocksize * blocks
 
 		# add noise
-		data = data + "\x00" + self.string_random(size - len(data))
+		data += "\x00" + self.string_random(size - len(data) - 1)
 
 		# rotate and encrypt field
 		data = self.__rotate_field(data)
 		scrambled = ""
 		for block in range(blocks):
 			for offset in range(self.blocksize):
-				scrambled = scrambled + data[offset * blocks + block]
+				scrambled += data[offset * blocks + block]
 
 		return scrambled
 

src/lib/datahandler/netrc.py

 
 			# only export entries which have a hostname, username and password
 			if not entry.has_field(revelation.entry.FIELD_GENERIC_HOSTNAME) or not entry.has_field(revelation.entry.FIELD_GENERIC_USERNAME) or not entry.has_field(revelation.entry.FIELD_GENERIC_PASSWORD):
+				iter = entrystore.iter_traverse_next(iter)
 				continue
 
 			hostname = entry.get_field(revelation.entry.FIELD_GENERIC_HOSTNAME).value
 			password = entry.get_field(revelation.entry.FIELD_GENERIC_PASSWORD).value
 
 			if hostname == "" or username == "" or password == "":
+				iter = entrystore.iter_traverse_next(iter)
 				continue
 
 

src/lib/dialog.py

 		Hig.__init__(
 			self, parent, "Export to insecure file?",
 			"The file format you have chosen is not encrypted. If anyone has access to the file, they will be able to read your passwords.",
-			gtk.STOCK_DIALOG_WARNING, [ [ gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL ], [ revelation.stock.STOCK_EXPORT, gtk.RESPONSE_OK ] ]
+			gtk.STOCK_DIALOG_WARNING, [ [ gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL ], [ revelation.stock.STOCK_EXPORT, gtk.RESPONSE_OK ] ], 0
 		)
 
 
 
 		entry = revelation.widget.Entry()
 		entry.set_visibility(gtk.FALSE)
+		entry.set_max_length(32)
 		entry.connect("changed", self.__cb_entry_changed)
 		self.sect_passwords.add_inputrow(name, entry)
 

src/lib/widget.py

 		"Clears the data view"
 
 		# only clear if containing an entry, or if forced
-		if force == gtk.FALSE or self.entry is None:
+		if force == gtk.FALSE and self.entry is None:
 			return
 
 		self.entry = None
 			("/Edit/sep3",		None,			None,					None,							0,	"<Separator>"),
 			("/Edit/_Find...",	"<Control>F",		"Search for an entry",			lambda w,d: self.entry_find(),				0,	"<StockItem>",	gtk.STOCK_FIND),
 			("/Edit/Find Ne_xt",	"<Control>G",		"Find the next search match",		lambda w,d: self.__entry_find(self, revelation.data.SEARCH_NEXT),	0,	"<Item>"),
-			("/Edit/Find Pre_vious",	"<Shift><Control>G",		"Find the previous search match",	lambda w: self.__entry_find(self, revelation.data.SEARCH_PREV),	0,	"<Item>"),
+			("/Edit/Find Pre_vious",	"<Shift><Control>G",		"Find the previous search match",	lambda w,d: self.__entry_find(self, revelation.data.SEARCH_PREV),	0,	"<Item>"),
 			("/Edit/sep4",		None,			None,					None,							0,	"<Separator>"),
 			("/Edit/_Select All",	"<Control>A",		"Select all entries",			lambda w,d: self.tree.select_all(),			0,	"<Item>"),
 			("/Edit/_Deselect All",	"<Shift><Control>A",	"Deselect all entries",			lambda w,d: self.tree.unselect_all(),			0,	"<Item>"),
 			self.statusbar.set_status("Open failed")
 			revelation.dialog.Error(
 				self, "Invalid file format",
-				"The file '" + datafile.file + "' is not a valid data file."
+				"The file '" + datafile.file + "' contains invalid data."
 			).run()
 
 		except revelation.entry.EntryError:
 			self.statusbar.set_status("Open failed")
 			revelation.dialog.Error(
 				self, "Unknown data",
-				"The file '" + datafile.file + "' contained unknown data. It may have been created by a future version of Revelation, try upgrading to a newer version."
+				"The file '" + datafile.file + "' contains unknown data. It may have been created by a future version of Revelation, try upgrading to a newer version."
 			).run()
 
 		except revelation.datahandler.VersionError:
 			raise
 
 
-
 	def __file_save(self, datafile):
 		"Saves data to a file"