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.
This commit is contained in:
parent
23e540bd79
commit
e063c0f3c3
@ -1,3 +1,9 @@
|
||||
ClipIt-v1.2.0-10112010001 - 10 Nov. 2010
|
||||
+ 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.
|
||||
|
||||
ClipIt-v1.1.0-09112010001 - 09 Nov. 2010
|
||||
+ Added: Option to show index numbers in history.
|
||||
+ Fixed: Search window now gets properly focused when launched with the hotkey.
|
||||
|
1
TODO
1
TODO
@ -5,7 +5,6 @@
|
||||
actually use that return value to display an error if there was one.
|
||||
+ Redo Preferences dialog.
|
||||
+ Clean up the code and indent it properly.
|
||||
+ Fix conflict with copying of multimedia content.
|
||||
+ Add "Edit" and "Remove" buttons to the search window and rename
|
||||
it to "Manage Clipboard".
|
||||
+ Move all pop-up and menu functions from main.c to menus.c.
|
||||
|
@ -2,7 +2,7 @@
|
||||
# Autoconf/automake.
|
||||
# -------------------------------------------------------------------------------
|
||||
AC_PREREQ([2.5])
|
||||
AC_INIT([clipit], [1.1.0], [oss@web-tm.com])
|
||||
AC_INIT([clipit], [1.2.0], [oss@web-tm.com])
|
||||
AM_INIT_AUTOMAKE([AC_PACKAGE_TARNAME()], [AC_PACKAGE_VERSION()])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
@ -101,15 +101,33 @@ save_history()
|
||||
}
|
||||
}
|
||||
|
||||
/* Checks if item should be included in history and calls append */
|
||||
void
|
||||
check_and_append(gchar* item)
|
||||
{
|
||||
if (item)
|
||||
{
|
||||
GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
/* Prepend new item */
|
||||
/* Check if we have URIs */
|
||||
gchar **arr = gtk_clipboard_wait_for_uris(clip);
|
||||
if(arr != NULL) {
|
||||
/* We have URIs */
|
||||
if(!prefs.save_uris)
|
||||
return;
|
||||
}
|
||||
g_strfreev(arr);
|
||||
if(!is_excluded(item))
|
||||
{
|
||||
append_item(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Adds item to the end of history */
|
||||
void
|
||||
append_item(gchar* item)
|
||||
{
|
||||
if (item)
|
||||
{
|
||||
/* Prepend new item */
|
||||
if(!is_excluded(item))
|
||||
{
|
||||
history = g_slist_prepend(history, g_strdup(item));
|
||||
/* Shorten history if necessary */
|
||||
GSList* last_possible_element = g_slist_nth(history, prefs.history_limit - 1);
|
||||
@ -122,12 +140,6 @@ append_item(gchar* item)
|
||||
/* Save changes */
|
||||
if (prefs.save_history)
|
||||
save_history();
|
||||
/* This is to fix the wrong behaviour when cuting text instead of copying */
|
||||
GSList* element = g_slist_nth(history, 0);
|
||||
GtkClipboard* clip = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
|
||||
gtk_clipboard_set_text(clip, (gchar*)element->data, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Truncates history to history_limit items */
|
||||
|
@ -34,6 +34,9 @@ read_history();
|
||||
void
|
||||
save_history();
|
||||
|
||||
void
|
||||
check_and_append(gchar* item);
|
||||
|
||||
void
|
||||
append_item(gchar* item);
|
||||
|
||||
|
24
src/main.c
24
src/main.c
@ -77,13 +77,17 @@ item_check(gpointer data)
|
||||
/* Only recover lost contents if there isn't any other type of content in the clipboard */
|
||||
if (!contents)
|
||||
{
|
||||
if(prefs.use_primary)
|
||||
{
|
||||
/* if use_primary is enabled, we restore from primary */
|
||||
gtk_clipboard_set_text(primary, primary_text, -1);
|
||||
/*
|
||||
* in a future version...
|
||||
* GSList* element = g_slist_nth(history, 0);
|
||||
* gtk_clipboard_set_text(clipboard, (gchar*)element->data, -1);
|
||||
* gtk_clipboard_set_text(primary, (gchar*)element->data, -1);
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
/* else, we restore from history */
|
||||
GSList* element = g_slist_nth(history, 0);
|
||||
gtk_clipboard_set_text(primary, (gchar*)element->data, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -106,12 +110,12 @@ item_check(gpointer data)
|
||||
if (prefs.hyperlinks_only && is_hyperlink(primary_text))
|
||||
{
|
||||
delete_duplicate(primary_text);
|
||||
append_item(primary_text);
|
||||
check_and_append(primary_text);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete_duplicate(primary_text);
|
||||
append_item(primary_text);
|
||||
check_and_append(primary_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,12 +152,12 @@ item_check(gpointer data)
|
||||
if (prefs.hyperlinks_only && is_hyperlink(clipboard_text))
|
||||
{
|
||||
delete_duplicate(clipboard_text);
|
||||
append_item(clipboard_text);
|
||||
check_and_append(clipboard_text);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete_duplicate(clipboard_text);
|
||||
append_item(clipboard_text);
|
||||
check_and_append(clipboard_text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,6 +36,7 @@ typedef struct
|
||||
gboolean use_primary; /* Use primary */
|
||||
gboolean synchronize; /* Synchronize copy and primary */
|
||||
gboolean show_indexes; /* Show index numbers in history menu */
|
||||
gboolean save_uris; /* Save URIs in history */
|
||||
|
||||
gboolean save_history; /* Save history */
|
||||
gint history_limit; /* Items in history */
|
||||
|
@ -33,6 +33,7 @@ GtkWidget *copy_check,
|
||||
*primary_check,
|
||||
*synchronize_check,
|
||||
*show_indexes_check,
|
||||
*save_uris_check,
|
||||
*full_hist_check,
|
||||
*history_spin,
|
||||
*history_small,
|
||||
@ -77,6 +78,7 @@ apply_preferences()
|
||||
prefs.use_primary = gtk_toggle_button_get_active((GtkToggleButton*)primary_check);
|
||||
prefs.synchronize = gtk_toggle_button_get_active((GtkToggleButton*)synchronize_check);
|
||||
prefs.show_indexes = gtk_toggle_button_get_active((GtkToggleButton*)show_indexes_check);
|
||||
prefs.save_uris = gtk_toggle_button_get_active((GtkToggleButton*)save_uris_check);
|
||||
prefs.save_history = gtk_toggle_button_get_active((GtkToggleButton*)save_check);
|
||||
prefs.history_limit = gtk_spin_button_get_value_as_int((GtkSpinButton*)history_spin);
|
||||
prefs.small_history = gtk_toggle_button_get_active((GtkToggleButton*)small_check);
|
||||
@ -113,6 +115,7 @@ save_preferences()
|
||||
g_key_file_set_boolean(rc_key, "rc", "use_primary", prefs.use_primary);
|
||||
g_key_file_set_boolean(rc_key, "rc", "synchronize", prefs.synchronize);
|
||||
g_key_file_set_boolean(rc_key, "rc", "show_indexes", prefs.show_indexes);
|
||||
g_key_file_set_boolean(rc_key, "rc", "save_uris", prefs.save_uris);
|
||||
g_key_file_set_boolean(rc_key, "rc", "save_history", prefs.save_history);
|
||||
g_key_file_set_integer(rc_key, "rc", "history_limit", prefs.history_limit);
|
||||
g_key_file_set_boolean(rc_key, "rc", "small_history", prefs.small_history);
|
||||
@ -152,6 +155,7 @@ read_preferences()
|
||||
prefs.use_primary = g_key_file_get_boolean(rc_key, "rc", "use_primary", NULL);
|
||||
prefs.synchronize = g_key_file_get_boolean(rc_key, "rc", "synchronize", NULL);
|
||||
prefs.show_indexes = g_key_file_get_boolean(rc_key, "rc", "show_indexes", NULL);
|
||||
prefs.save_uris = g_key_file_get_boolean(rc_key, "rc", "save_uris", NULL);
|
||||
prefs.save_history = g_key_file_get_boolean(rc_key, "rc", "save_history", NULL);
|
||||
prefs.history_limit = g_key_file_get_integer(rc_key, "rc", "history_limit", NULL);
|
||||
prefs.small_history = g_key_file_get_boolean(rc_key, "rc", "small_history", NULL);
|
||||
@ -609,6 +613,8 @@ show_preferences(gint tab)
|
||||
gtk_box_pack_start((GtkBox*)vbox, synchronize_check, FALSE, FALSE, 0);
|
||||
show_indexes_check = gtk_check_button_new_with_mnemonic(_("S_how indexes in history menu"));
|
||||
gtk_box_pack_start((GtkBox*)vbox, show_indexes_check, FALSE, FALSE, 0);
|
||||
save_uris_check = gtk_check_button_new_with_mnemonic(_("S_ave URIs"));
|
||||
gtk_box_pack_start((GtkBox*)vbox, save_uris_check, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start((GtkBox*)vbox_behavior, frame, FALSE, FALSE, 0);
|
||||
|
||||
/* Build the history frame */
|
||||
@ -917,6 +923,7 @@ show_preferences(gint tab)
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)primary_check, prefs.use_primary);
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)synchronize_check, prefs.synchronize);
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)show_indexes_check, prefs.show_indexes);
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)save_uris_check, prefs.save_uris);
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)save_check, prefs.save_history);
|
||||
gtk_spin_button_set_value((GtkSpinButton*)history_spin, (gdouble)prefs.history_limit);
|
||||
gtk_toggle_button_set_active((GtkToggleButton*)small_check, prefs.small_history);
|
||||
|
@ -33,10 +33,11 @@ G_BEGIN_DECLS
|
||||
#define DEF_USE_PRIMARY FALSE
|
||||
#define DEF_SYNCHRONIZE FALSE
|
||||
#define DEF_SHOW_INDEXES FALSE
|
||||
#define DEF_SAVE_URIS TRUE
|
||||
#define DEF_SAVE_HISTORY TRUE
|
||||
#define DEF_HISTORY_LIMIT 25
|
||||
#define DEF_HISTORY_LIMIT 50
|
||||
#define DEF_SMALL_HISTORY TRUE
|
||||
#define DEF_HISTORY_SMALL 25
|
||||
#define DEF_HISTORY_SMALL 20
|
||||
#define DEF_HYPERLINKS_ONLY FALSE
|
||||
#define DEF_CONFIRM_CLEAR FALSE
|
||||
#define DEF_FULL_HIST_BUTTON FALSE
|
||||
|
Loading…
Reference in New Issue
Block a user