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:
parent
12496f8e93
commit
39640277d8
@ -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
|
||||
+ Fixed: Remove duplicate truncate_history functionality.
|
||||
+ Added: Added basic history item structure.
|
||||
|
2
TODO
2
TODO
@ -4,6 +4,4 @@
|
||||
actually use that return value to display an error if there was one.
|
||||
+ Redo Preferences dialog.
|
||||
+ 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
|
||||
|
@ -34,7 +34,7 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct {
|
||||
gboolean is_static;
|
||||
char *content;
|
||||
gpointer content;
|
||||
} history_item;
|
||||
|
||||
extern GSList *history;
|
||||
|
13
src/main.c
13
src/main.c
@ -44,6 +44,7 @@ static gchar* clipboard_text;
|
||||
static gchar* synchronized_text;
|
||||
static GtkClipboard* primary;
|
||||
static GtkClipboard* clipboard;
|
||||
static char *trayicon_path;
|
||||
#ifdef HAVE_APPINDICATOR
|
||||
static AppIndicator *indicator;
|
||||
static GtkWidget *indicator_menu = NULL;
|
||||
@ -195,6 +196,15 @@ static gboolean item_check(gpointer data)
|
||||
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 */
|
||||
static void *execute_action(void *command)
|
||||
{
|
||||
@ -937,10 +947,11 @@ static void clipit_init()
|
||||
/* Create status icon */
|
||||
if (!prefs.no_icon)
|
||||
{
|
||||
set_icon_paths();
|
||||
#ifdef HAVE_APPINDICATOR
|
||||
create_app_indicator(1);
|
||||
#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"));
|
||||
g_signal_connect((GObject*)status_icon, "button_press_event", (GCallback)status_icon_clicked, NULL);
|
||||
#endif
|
||||
|
12
src/utils.c
12
src/utils.c
@ -28,11 +28,11 @@
|
||||
#include "clipit-i18n.h"
|
||||
|
||||
/* Creates program related directories if needed */
|
||||
void
|
||||
check_dirs()
|
||||
void check_dirs()
|
||||
{
|
||||
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 *pixmap_dir = g_build_path(G_DIR_SEPARATOR_S, g_get_user_data_dir(), DATA_DIR, "pixmaps", NULL);
|
||||
/* Check if data directory 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)
|
||||
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 */
|
||||
g_free(data_dir);
|
||||
g_free(config_dir);
|
||||
g_free(pixmap_dir);
|
||||
}
|
||||
|
||||
/* Returns TRUE if text is a hyperlink */
|
||||
|
Loading…
Reference in New Issue
Block a user