ClipIt-1.4.0-20110521001

+ Added: We are now using the shipped icon in the systray.

Changes to be committed:

modified:   ChangeLog
modified:   TODO
modified:   src/history.h
modified:   src/main.c
modified:   src/utils.c
This commit is contained in:
Cristian Henzel 2011-05-21 19:56:46 +03:00
parent 12496f8e93
commit 39640277d8
5 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,6 @@
ClipIt-1.4.0-20110521001 - 21 May. 2011
+ Added: We are now using the shipped icon in the systray.
ClipIt-1.4.0-20110520002 - 20 May. 2011 ClipIt-1.4.0-20110520002 - 20 May. 2011
+ Fixed: Remove duplicate truncate_history functionality. + Fixed: Remove duplicate truncate_history functionality.
+ Added: Added basic history item structure. + Added: Added basic history item structure.

2
TODO
View File

@ -4,6 +4,4 @@
actually use that return value to display an error if there was one. actually use that return value to display an error if there was one.
+ Redo Preferences dialog. + Redo Preferences dialog.
+ Clean up the code and indent it properly. + Clean up the code and indent it properly.
+ Move all pop-up and menu functions from main.c to menus.c.
+ Use the shipped icon in the display.
+ history structure has to be changed in: main.c, manage.c, history.c + history structure has to be changed in: main.c, manage.c, history.c

View File

@ -34,7 +34,7 @@ G_BEGIN_DECLS
typedef struct { typedef struct {
gboolean is_static; gboolean is_static;
char *content; gpointer content;
} history_item; } history_item;
extern GSList *history; extern GSList *history;

View File

@ -44,6 +44,7 @@ static gchar* clipboard_text;
static gchar* synchronized_text; static gchar* synchronized_text;
static GtkClipboard* primary; static GtkClipboard* primary;
static GtkClipboard* clipboard; static GtkClipboard* clipboard;
static char *trayicon_path;
#ifdef HAVE_APPINDICATOR #ifdef HAVE_APPINDICATOR
static AppIndicator *indicator; static AppIndicator *indicator;
static GtkWidget *indicator_menu = NULL; static GtkWidget *indicator_menu = NULL;
@ -195,6 +196,15 @@ static gboolean item_check(gpointer data)
return TRUE; return TRUE;
} }
static void set_icon_paths() {
gchar *pixmap_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_data_dir(), DATA_DIR, "pixmaps", NULL);
gchar *test_path = g_build_path(G_DIR_SEPARATOR_S, pixmap_dir, "trayicon.svg", NULL);
if (g_file_test(test_path, G_FILE_TEST_EXISTS))
trayicon_path = test_path;
else
trayicon_path = g_build_path(G_DIR_SEPARATOR_S, CLIPITPIXMAPSDIR, "trayicon.svg", NULL);
}
/* Thread function called for each action performed */ /* Thread function called for each action performed */
static void *execute_action(void *command) static void *execute_action(void *command)
{ {
@ -937,10 +947,11 @@ static void clipit_init()
/* Create status icon */ /* Create status icon */
if (!prefs.no_icon) if (!prefs.no_icon)
{ {
set_icon_paths();
#ifdef HAVE_APPINDICATOR #ifdef HAVE_APPINDICATOR
create_app_indicator(1); create_app_indicator(1);
#else #else
status_icon = gtk_status_icon_new_from_stock(GTK_STOCK_PASTE); status_icon = gtk_status_icon_new_from_file(trayicon_path);
gtk_status_icon_set_tooltip((GtkStatusIcon*)status_icon, _("Clipboard Manager")); gtk_status_icon_set_tooltip((GtkStatusIcon*)status_icon, _("Clipboard Manager"));
g_signal_connect((GObject*)status_icon, "button_press_event", (GCallback)status_icon_clicked, NULL); g_signal_connect((GObject*)status_icon, "button_press_event", (GCallback)status_icon_clicked, NULL);
#endif #endif

View File

@ -28,11 +28,11 @@
#include "clipit-i18n.h" #include "clipit-i18n.h"
/* Creates program related directories if needed */ /* Creates program related directories if needed */
void void check_dirs()
check_dirs()
{ {
gchar *data_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_data_dir(), DATA_DIR, NULL); gchar *data_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_data_dir(), DATA_DIR, NULL);
gchar *config_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), CONFIG_DIR, NULL); gchar *config_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_config_dir(), CONFIG_DIR, NULL);
gchar *pixmap_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_data_dir(), DATA_DIR, "pixmaps", NULL);
/* Check if data directory exists */ /* Check if data directory exists */
if (!g_file_test(data_dir, G_FILE_TEST_EXISTS)) if (!g_file_test(data_dir, G_FILE_TEST_EXISTS))
{ {
@ -47,9 +47,17 @@ check_dirs()
if (g_mkdir_with_parents(config_dir, 0755) != 0) if (g_mkdir_with_parents(config_dir, 0755) != 0)
g_warning(_("Couldn't create directory: %s\n"), config_dir); g_warning(_("Couldn't create directory: %s\n"), config_dir);
} }
/* Check if pixmap directory exists */
if (!g_file_test(pixmap_dir, G_FILE_TEST_EXISTS))
{
/* Try to make pixmap directory */
if (g_mkdir_with_parents(pixmap_dir, 0755) != 0)
g_warning(_("Couldn't create directory: %s\n"), pixmap_dir);
}
/* Cleanup */ /* Cleanup */
g_free(data_dir); g_free(data_dir);
g_free(config_dir); g_free(config_dir);
g_free(pixmap_dir);
} }
/* Returns TRUE if text is a hyperlink */ /* Returns TRUE if text is a hyperlink */