Commits

Erik Grinaker  committed 5a85d83

don't steal clipboard events from widgets in main window

  • Participants
  • Parent commits 13a32d3

Comments (0)

Files changed (5)

 
 	* don't crash when closing non-modal dialog with escape
 
+	* don't steal clipboard events from widgets in main window
+
 2005-03-18  Erik Grinaker <erikg@codepoet.no>
 
 	* left-align labels in link-buttons (for URLs etc)
 - display non-ascii characters in filenames correctly
 - use fallback folder icons when not found in theme
 - hide any open dialogs when locking the file
+- don't steal clipboard events from widgets in main window
 - update icons on theme change
 - use better lock icon
 - use better stock icons for dialog buttons
   - show complete account tree as a popup-submenu of the applet
   - make library modules more independent, so only a few are imported
 - run unit tests on built libraries instead of installed ones
-- only copy/paste entries with keyboard shortcut when tree has focus
-  (ctrl-c should copy selected label in dataview when focused)
 
 0.5.x:
 - ensure complete UTF-8 support

File configure.ac

 
 dnl check for dependencies
 AC_PROG_CC()
-
 RVL_PYTHON_PATH(2.3)
 RVL_PYTHON_MODULE(Crypto, yes)
 PKG_CHECK_MODULES(PYGTK, pygtk-2.0 >= 2.3.90)

File src/revelation.in

 		# set up callbacks for actions
 		callbacks = {
 			"clip-chain"		: lambda w: self.clip_chain(self.entrystore.get_entry(self.tree.get_active())),
-			"clip-copy"		: lambda w: self.clip_copy(self.tree.get_selected()),
-			"clip-cut"		: lambda w: self.clip_cut(self.tree.get_selected()),
-			"clip-paste"		: lambda w: self.clip_paste(self.entryclipboard.get(), self.tree.get_active()),
+			"clip-copy"		: self.__cb_clip_copy,
+			"clip-cut"		: self.__cb_clip_cut,
+			"clip-paste"		: self.__cb_clip_paste,
 			"entry-add"		: lambda w: self.entry_add(None, self.tree.get_active()),
 			"entry-edit"		: lambda w: self.entry_edit(self.tree.get_active()),
 			"entry-goto"		: lambda w: self.entry_goto(self.tree.get_selected()),
 
 	##### MISC CALLBACKS #####
 
+	def __cb_clip_copy(self, widget, data = None):
+		"Handles copying to the clipboard"
+
+		focuswidget = self.get_focus()
+
+		if focuswidget is self.tree:
+			self.clip_copy(self.tree.get_selected())
+
+		elif isinstance(focuswidget, gtk.Label) or isinstance(focuswidget, gtk.Entry):
+			focuswidget.emit("copy-clipboard")
+
+
+	def __cb_clip_cut(self, widget, data = None):
+		"Handles cutting to clipboard"
+
+		focuswidget = self.get_focus()
+
+		if focuswidget is self.tree:
+			self.clip_cut(self.tree.get_selected())
+
+		elif isinstance(focuswidget, gtk.Entry):
+			focuswidget.emit("cut-clipboard")
+
+
+	def __cb_clip_paste(self, widget, data = None):
+		"Handles pasting from clipboard"
+
+		focuswidget = self.get_focus()
+
+		if focuswidget is self.tree:
+			self.clip_paste(self.entryclipboard.get(), self.tree.get_active())
+
+		elif isinstance(focuswidget, gtk.Entry):
+			focuswidget.emit("paste-clipboard")
+
+
 	def __cb_clip_set(self, widget, data):
 		"Sets data on the clipboars"