Search history action shows and hides the dialog #9

wants to merge 55 commits into

2 participants


shantzu, please consider my tiny patch. I think it's more convenient to be able to open and close the "Manage History" dialog with the same hotkey.

Cristian Henzel and others added some commits Nov 9, 2010
Cristian Henzel ClipIt-v1.1.0-09112010001-beta
+ Added: Option to show index numbers in history.
+ Fixed: Search window now gets properly focused when launched with the hotkey.
+ Fixed: Search window is now resizable.
+ Fixed: Double casting when calling 'item_selected'.
+ Fixed: Removed some unnecessary comments and fixed some of the others.
+ Fixed: Moved search dialog and functions to manage.c, as this dialog will
		become "Manage Clipboard" in the next version.
Cristian Henzel ClipIt-v1.2.0-10112010001
+ Added: Option to save URIs (they were actually saved by default before, but
		now you have the option to disable this behaviour).
+ Fixed: Copying files and folders now works again.
+ Fixed: Changed some of the default configuration values.
Cristian Henzel ClipIt-v1.2.1-10112010002
+ Fixed: Fixed OOM bug when copying large chunks of text by limiting
		the history entry to 512KB.
Cristian Henzel ClipIt-v1.2.2-11112010001
+ Fixed: Some small compatibility changes for debian packaging.
Cristian Henzel ClipIt-v1.2.3-11112010002
+ Fixed: Fixed the manpage so it now aligns to the conventions for
		writing Linux man pages.
+ Fixed: Added the "-Wl,--as-needed" flag, so only the needed packages
		are included.
Cristian Henzel ClipIt-v1.2.4-12112010001
+ Fixed: Fixed 2 small omitions from previous changes.
Cristian Henzel ClipIt-v1.2.5-12112010002
+ Fixed: Now using autopoint instead of gettextize to avoid waiting for
		user input.
+ Fixed: Added AM_MAINTAINER_MODE, to get rid of the disable-maintainer-mode
+ Fixed: Fixed a small typo in main.c.
+ Fixed: removed dependency of pthread.h (the pthread_exit function that we
		use is also in glib.h).
Cristian Henzel ClipIt-v1.2.6-12112010003
+ Fixed: Removed reference to pthread.h from
+ Fixed: Set AM_MAINTAINER_MODE to disabled by default.
Cristian Henzel ClipIt-v1.3.0-14112010001
+ Added: Added "Edit" and "Remove" buttons to the "Manage History" dialog.
+ Fixed: Major speed improvements for big history entries while:
		searching through the history;
		populating the "Manage History" dialog;
		generating the popup menus;
	All of these should now be more than 99% faster, at the expense
	of an (at most) 1MB overhead. I think it's worth it, though.
+ Fixed: Fixed a drawing issue with the small history menu when activated
		by clicking on the systray icon.
Cristian Henzel ClipIt-v1.3.1-17112010001
+ Added: Added autostart support for LXDE.
+ Fixed: Fixed problem with "Edit" window not appearing.
Cristian Henzel ClipIt-v1.3.2-22112010001
+ Fixed: Fixed most of the markup and indentation (replaced double spaces
		with tabs).
+ Fixed: Removed clipboard restoring from history, as this seems to cause
		more problems than it solves.
Cristian Henzel ClipIt-v1.3.3-23112010001
+ Fixed: Fixed some more markup.
+ Fixed: Rearranged parts of the Preferences dialog to be cleaner.
+ Fixed: Fixed bug in "Manage History" window not selecting the history
		item properly.
Cristian Henzel ClipIt-v1.3.4-26112010001
+ Fixed: Now we are warning the user that his history is saved in a
		plain text file and ask for his explicit permission
		to save the history.
+ Fixed: When the user disables history saving we also ask if he wants
		to empty the current history file.
+ Fixed: Renamed "Find" menu entry to "Manage history".
+ Fixed: ClipIt now complies to the "XDG Base Directory Specification".
Cristian Henzel ClipIt-v1.3.5-06122010001
+ Added: Added support for "Application Indicator".
+ Fixed: Fixed a couple of typos and indentations.
Cristian Henzel ClipIt-v1.3.6-06122010002
+Fixed: Fixed a small bug when building without indicator support.
Cristian Henzel ClipIt-v1.3.7-12122010001
+ Fixed: Changed E-Mail address and Project website.
+ Fixed: Included all files that get generated by, so
		that now you don't need to run it anymore.
Cristian Henzel ClipIt-v1.3.8-18122010001
+ Fixed: Changed the "old" menu to look exactly like the indicator
+ Fixed: Changed the indicator menu to refresh automatically.
Cristian Henzel ClipIt-v1.3.8-18122010002
+ Fixed: Updated configure script for 1.3.8.
Cristian Henzel ClipIt-v1.3.9-19122010001
+ Fixed: Fixed error while compiling without indicator support.
+ Fixed: Fixed a couple of memory leaks.
Cristian Henzel ClipIt-v1.3.10-21122010001
+ Fixed: Imported fixes from Parcellite 0.9.3 (thanks to Doug Springer).
+ Fixed: Fixed cast warnings when building on x86 machines.
+ Fixed: Fixed build error on ubuntu 11.04.
+ Fixed: Fixed problem with statusicon menu showing double content.
+ Fixed: Fixed problem with clicking the statusicon menu multiple
		times killing the program.
Cristian Henzel ClipIt-v1.3.11-22122010001
+ Fixed: Indicator menu now actually refreshes properly.
+ Fixed: Removed "Full history" and changed the wording in the
		"Preferences" dialog.
+ Fixed: Imported "Select first item in menu" fix from Parcellite 0.9.3.
Cristian Henzel ClipIt-1.3.11-20101224001
+ Fixed: Removed some unneeded files from both the archive and git.
+ Fixed: Changed git versioning scheme.
Cristian Henzel ClipIt-1.3.12-20110228001
+ Fixed: Fixed a typo in the warnings.
+ Fixed: Turned off appindicator because it's buggy.
@CristianHenzel ClipIt-1.3.13-20110503001
+ Fixed: Bug in the indicator code that makes ClipIt crash X under
		certain circumstances.
@CristianHenzel ClipIt-1.4.0-20110506001
+ Added: Added option to automatically paste an entry after selecting it.
+ Fixed: Re-enabled indicator since it should now work properly.
@CristianHenzel ClipIt-1.4.0-20110518001
+ Fixed: Re-enabled indicator support.
+ Added: We are now installing a sepparate icon for clipit (not using it
		yet, though).
+ Added: Search as you type in "Manage history" dialog.
+ Added: 1-0 shortcuts for fast selecting of menu items.
+ Added: Possiblity to select multiple items for deletion in the
		"Manage history" dialog.
@CristianHenzel ClipIt-1.4.0-20110518002
+ Added: Also added 1-0 shortcuts to the history menu.
@CristianHenzel ClipIt-1.4.0-20110520001
+ Fixed: Deleted items are now properly removed from the history.
+ Fixed: Double clicking an item in the "Manage history" dialog now
		properly selects it again.
+ Added: [Enter] (for selecting the item) and [Delete] (for removing
		the item(s)) now works in the "Manage history" dialog.
@CristianHenzel ClipIt-1.4.0-20110520002
+ Fixed: Remove duplicate truncate_history functionality.
+ Added: Added basic history item structure.
@CristianHenzel ClipIt-1.4.0-20110521001
+ Added: We are now using the shipped icon in the systray.
@CristianHenzel ClipIt-1.4.0-20110521003
+ Fixed: Fixed wrong selection behaviour in "Manage history" dialog.
@CristianHenzel ClipIt-1.4.1-20110523001
+ Fixed: Removed some files from git again. You now need to run
		./ first when building from git.
@CristianHenzel ClipIt-1.4.1-20110523002
+ Fixed: Unified indicator and systray menu into a single function.
@CristianHenzel ClipIt-1.4.1-20110523003
+ Fixed: We are now checking if the history should be saved in the
		save_history function itself.
+ Fixed: Indicator menu should now refresh even if "Save history"
		is disabled.
@CristianHenzel ClipIt-1.4.1-20110524001
+ Fixed: Converted history to new data type.
+ Fixed: Fixed all of the remaining warnings.
@CristianHenzel ClipIt-1.4.1-20110525001
+ Fixed: Changed history file to new type.
@CristianHenzel ClipIt-1.4.1-20110525002
+ Fixed: Numpad keys now work for selecting too.
@CristianHenzel ClipIt-1.4.1-20110525003
+ Added: We now also use png icons, if there are any.
@CristianHenzel ClipIt-1.4.1-20110526001
+ Added: Items marked as static are not purged from the history anymore.
@CristianHenzel ClipIt-1.4.1-20110526002
+ Fixed: Simplified add item process.
@CristianHenzel ClipIt-1.4.1-20110526003
+ Fixed: Unified history and tray menu for easier maintenance.
@CristianHenzel ClipIt-1.4.1-20110526004
+ Added: Added option for using right-click menu.
@CristianHenzel ClipIt-1.4.1-20110526005
+ Added: Added options for static items in menu.
@CristianHenzel ClipIt-1.4.1-20110526006
+ Fixed: Fixed display and icon of indicator menu.
+ Fixed: We are now installing the icon to the icontheme instead of
		the pixmaps folder.
@CristianHenzel ClipIt-1.4.1-20110526007
+ Fixed: Fixed a bug in the history saving function.
+ Added: We are now showing static items in the menu.
@CristianHenzel ClipIt-1.4.1-20110526008
+ Fixed: We're not loosing the static flag on existing items anymore.
@CristianHenzel ClipIt-1.4.1-20110527001
+ Fixed: Hidden righ-click menu option when indicator is active and
		disabled the static item spin when static items are not
@CristianHenzel ClipIt-1.4.1-20110527002
+ Fixed: Made executable.
@CristianHenzel ClipIt-1.4.1-20110527003
+ Fixed: Removed some files from git. Again.
@CristianHenzel ClipIt-1.4.1-20110527004
+ Fixed: Typo in src/
@CristianHenzel ClipIt-1.4.1-20110604001
+ Fixed: Removed some more files from git.
@CristianHenzel ClipIt-1.4.2-20110623001
+ Fixed: Bumped version to 1.4.2.
+ Fixed: Changed layout of the ChangeLog file.
Rogutės Sparnuotos Silence glib warnings regarding GOptionFlags.
These warnings:
GLib-WARNING **: goption.c:2168: ignoring no-arg, optional-arg or filename flags (8) on option of type 0
@CristianHenzel Merge pull request #4 from rogutes/glib-warnings
Silence glib warnings regarding GOptionFlags.
@pluton8 pluton8 Search history action shows and hides the dialog
When triggered the first time the dialog is opened. The second time will
close it. And so on.

You have also based this on the master branch, but in the 1.4.2 branch, I have made some changes to check if there is any other window open and raise that one, if it's the case. If you want this implemented, you should rewrite it in the 1.4.2 branch, and check specifically if the preferences dialog is open, before closing it.


I have a trouble checking if the Manage History dialog is the currently active window (not hidden under other windows) in order to close it. I've tried using gtk_window_is_active(), gtk_window_has_toplevel_focus(), gtk_widget_is_focus(), gtk_widget_has_focus(), even gtk_widget_get_visible() methods. None of them worked out. shantzu, could you please give me a hint how to perform such a test?



and sorry for the very late answer. Unfortunately I don't know of an easy way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment