...
 
Commits (14)
2007-05-03 Jim Krehl <jimmyk@novell.com>
* main-menu/etc/system-items.xbel
* libslab/bookmark-agent.c:
Make sure that display names for main-menu tiles are translated, BNC
#254817.
* main-menu/src/tile-table.c:
Do not allow drag and drop into Recent {Applications,Documents} tables,
BNC #268932.
2007-05-01 Jim Krehl <jimmyk@novell.com>
* main-menu/src/main-menu-ui.c:
Moved double-click debouncing to the button press handler of the panel
button and adjusted the ptr/kbd grabbing design to pass clicks outside
of the main-menu window but inside of the panel button to the panel
button. Fixes BNC #255065.
2007-04-24 Jim Krehl <jimmyk@novell.com>
* main-menu/src/main-menu-ui.c
* libslab/libslab-utils.c
* libslab/libslab-utils.h:
Fix overflows in time arithmetic.
2007-03-29 Jim Krehl <jimmyk@novell.com> 2007-03-29 Jim Krehl <jimmyk@novell.com>
* main-menu/src/main-menu-ui.c: * main-menu/src/main-menu-ui.c:
Only make tiles for local files until remote files can be handled Only make tiles for local files until remote files can be handled
...@@ -52,7 +75,7 @@ ...@@ -52,7 +75,7 @@
* main-menu/src/bookmark-tile-table.h * main-menu/src/bookmark-tile-table.h
* main-menu/src/recent-docs-tile-table.c * main-menu/src/recent-docs-tile-table.c
* main-menu/src/recent-docs-tile-table.h * main-menu/src/recent-docs-tile-table.h
* main-menu/src/tile-table.c * main-menu/src/tile-table.c
* main-menu/src/tile-table.h: * main-menu/src/tile-table.h:
Simplified the TileTable object to make it more generic. Stop loading Simplified the TileTable object to make it more generic. Stop loading
tiles after the table limit has been reached, this is to prevent delays tiles after the table limit has been reached, this is to prevent delays
......
AC_INIT([gnome-main-menu], [0.9.7], []) AC_INIT([gnome-main-menu], [0.9.8], [])
AC_CONFIG_SRCDIR([.]) AC_CONFIG_SRCDIR([.])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
......
...@@ -1030,6 +1030,8 @@ create_app_item (BookmarkAgent *this, const gchar *uri) ...@@ -1030,6 +1030,8 @@ create_app_item (BookmarkAgent *this, const gchar *uri)
GnomeDesktopItem *ditem; GnomeDesktopItem *ditem;
gchar *uri_new = NULL; gchar *uri_new = NULL;
gchar *name;
ditem = libslab_gnome_desktop_item_new_from_unknown_id (uri); ditem = libslab_gnome_desktop_item_new_from_unknown_id (uri);
...@@ -1041,9 +1043,19 @@ create_app_item (BookmarkAgent *this, const gchar *uri) ...@@ -1041,9 +1043,19 @@ create_app_item (BookmarkAgent *this, const gchar *uri)
if (! uri_new) if (! uri_new)
return; return;
if (libslab_strcmp (uri, uri_new)) { name = g_bookmark_file_get_title (priv->store, uri, NULL);
if (! libslab_strcmp (name, "Help"))
g_bookmark_file_set_title (priv->store, uri, _("Help"));
else if (! libslab_strcmp (name, "Lock Screen"))
g_bookmark_file_set_title (priv->store, uri, _("Lock Screen"));
else if (! libslab_strcmp (name, "Logout"))
g_bookmark_file_set_title (priv->store, uri, _("Logout"));
else if (! libslab_strcmp (name, "Shutdown"))
g_bookmark_file_set_title (priv->store, uri, _("Shutdown"));
if (libslab_strcmp (uri, uri_new))
g_bookmark_file_move_item (priv->store, uri, uri_new, NULL); g_bookmark_file_move_item (priv->store, uri, uri_new, NULL);
}
} }
static void static void
...@@ -1123,11 +1135,13 @@ create_dir_item (BookmarkAgent *this, const gchar *uri) ...@@ -1123,11 +1135,13 @@ create_dir_item (BookmarkAgent *this, const gchar *uri)
} }
else if (! strcmp (uri, "DOCUMENTS")) { else if (! strcmp (uri, "DOCUMENTS")) {
path = g_build_filename (g_get_home_dir (), "Documents", NULL); path = g_build_filename (g_get_home_dir (), "Documents", NULL);
name = _("Documents");
uri_new = g_filename_to_uri (path, NULL, NULL); uri_new = g_filename_to_uri (path, NULL, NULL);
g_free (path); g_free (path);
} }
else if (! strcmp (uri, "DESKTOP")) { else if (! strcmp (uri, "DESKTOP")) {
path = g_build_filename (g_get_home_dir (), "Desktop", NULL); path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
name = _("Desktop");
uri_new = g_filename_to_uri (path, NULL, NULL); uri_new = g_filename_to_uri (path, NULL, NULL);
icon = "gnome-fs-desktop"; icon = "gnome-fs-desktop";
g_free (path); g_free (path);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "double-click-detector.h" #include "double-click-detector.h"
#include <gtk/gtksettings.h> #include <gtk/gtksettings.h>
#include <glib/gstdio.h>
#include "libslab-utils.h" #include "libslab-utils.h"
...@@ -89,7 +90,7 @@ double_click_detector_dispose (GObject * obj) ...@@ -89,7 +90,7 @@ double_click_detector_dispose (GObject * obj)
} }
gboolean gboolean
double_click_detector_is_double_click (DoubleClickDetector *this, guint32 event_time, double_click_detector_is_double_click (DoubleClickDetector *this, guint64 event_time,
gboolean auto_update) gboolean auto_update)
{ {
gint32 delta; gint32 delta;
...@@ -113,7 +114,7 @@ double_click_detector_is_double_click (DoubleClickDetector *this, guint32 event_ ...@@ -113,7 +114,7 @@ double_click_detector_is_double_click (DoubleClickDetector *this, guint32 event_
} }
void void
double_click_detector_update_click_time (DoubleClickDetector *this, guint32 event_time) double_click_detector_update_click_time (DoubleClickDetector *this, guint64 event_time)
{ {
if (event_time <= 0) if (event_time <= 0)
event_time = libslab_get_current_time_millis (); event_time = libslab_get_current_time_millis ();
......
...@@ -37,7 +37,7 @@ typedef struct ...@@ -37,7 +37,7 @@ typedef struct
GObject parent_placeholder; GObject parent_placeholder;
guint32 double_click_time; guint32 double_click_time;
guint32 last_click_time; guint64 last_click_time;
} DoubleClickDetector; } DoubleClickDetector;
typedef struct typedef struct
...@@ -49,10 +49,11 @@ GType double_click_detector_get_type (void); ...@@ -49,10 +49,11 @@ GType double_click_detector_get_type (void);
DoubleClickDetector *double_click_detector_new (void); DoubleClickDetector *double_click_detector_new (void);
gboolean double_click_detector_is_double_click (DoubleClickDetector * detector, guint32 event_time, gboolean double_click_detector_is_double_click (DoubleClickDetector * detector, guint64 event_time,
gboolean auto_update); gboolean auto_update);
void double_click_detector_update_click_time (DoubleClickDetector * detector, guint32 event_time); void double_click_detector_update_click_time (DoubleClickDetector * detector, guint64 event_time);
G_END_DECLS G_END_DECLS
#endif /* __DOUBLE_CLICK_DETECTOR_H__ */ #endif /* __DOUBLE_CLICK_DETECTOR_H__ */
...@@ -194,14 +194,14 @@ libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item) ...@@ -194,14 +194,14 @@ libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item)
return retval; return retval;
} }
guint32 guint64
libslab_get_current_time_millis () libslab_get_current_time_millis ()
{ {
GTimeVal t_curr; GTimeVal t_curr;
g_get_current_time (& t_curr); g_get_current_time (& t_curr);
return 1000L * t_curr.tv_sec + t_curr.tv_usec / 1000L; return 1000 * ((guint64) t_curr.tv_sec) + ((guint64) t_curr.tv_usec) / 1000;
} }
gint gint
......
...@@ -13,7 +13,7 @@ GnomeDesktopItem *libslab_gnome_desktop_item_new_from_unknown_id (const gchar *i ...@@ -13,7 +13,7 @@ GnomeDesktopItem *libslab_gnome_desktop_item_new_from_unknown_id (const gchar *i
gboolean libslab_gnome_desktop_item_launch_default (GnomeDesktopItem *item); gboolean libslab_gnome_desktop_item_launch_default (GnomeDesktopItem *item);
gchar *libslab_gnome_desktop_item_get_docpath (GnomeDesktopItem *item); gchar *libslab_gnome_desktop_item_get_docpath (GnomeDesktopItem *item);
gboolean libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item); gboolean libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item);
guint32 libslab_get_current_time_millis (void); guint64 libslab_get_current_time_millis (void);
gint libslab_strcmp (const gchar *a, const gchar *b); gint libslab_strcmp (const gchar *a, const gchar *b);
gint libslab_strlen (const gchar *a); gint libslab_strlen (const gchar *a);
gpointer libslab_get_gconf_value (const gchar *key); gpointer libslab_get_gconf_value (const gchar *key);
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
</info> </info>
</bookmark> </bookmark>
<bookmark href="gnome-screensaver-lock.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z"> <bookmark href="gnome-screensaver-lock.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
<title>Lock Screen</title>
<info> <info>
<metadata owner="http://freedesktop.org"> <metadata owner="http://freedesktop.org">
<mime:mime-type type="application/x-desktop"/> <mime:mime-type type="application/x-desktop"/>
......
...@@ -158,19 +158,21 @@ static void setup_file_tables (MainMenuUI *); ...@@ -158,19 +158,21 @@ static void setup_file_tables (MainMenuUI *);
static void setup_bookmark_agents (MainMenuUI *); static void setup_bookmark_agents (MainMenuUI *);
static void setup_lock_down (MainMenuUI *); static void setup_lock_down (MainMenuUI *);
static void select_page (MainMenuUI *); static void select_page (MainMenuUI *);
static void update_limits (MainMenuUI *); static void update_limits (MainMenuUI *);
static void connect_to_tile_triggers (MainMenuUI *, TileTable *); static void connect_to_tile_triggers (MainMenuUI *, TileTable *);
static void hide_slab_if_urgent_close (MainMenuUI *); static void hide_slab_if_urgent_close (MainMenuUI *);
static void set_search_section_visible (MainMenuUI *); static void set_search_section_visible (MainMenuUI *);
static void set_table_section_visible (MainMenuUI *, TileTable *); static void set_table_section_visible (MainMenuUI *, TileTable *);
static gchar **get_search_argv (const gchar *); static gchar **get_search_argv (const gchar *);
static void reorient_panel_button (MainMenuUI *); static void reorient_panel_button (MainMenuUI *);
static void bind_beagle_search_key (MainMenuUI *); static void bind_beagle_search_key (MainMenuUI *);
static void launch_search (MainMenuUI *); static void launch_search (MainMenuUI *);
static void grab_pointer_and_keyboard (MainMenuUI *, guint32); static void grab_pointer_and_keyboard (MainMenuUI *, guint32);
static void apply_lockdown_settings (MainMenuUI *); static void apply_lockdown_settings (MainMenuUI *);
static gboolean app_is_in_blacklist (const gchar *); static gboolean app_is_in_blacklist (const gchar *);
static void toggle_panel_button (MainMenuUI *);
static void handle_panel_button_button_press (MainMenuUI *, guint64);
static Tile *item_to_user_app_tile (BookmarkItem *, gpointer); static Tile *item_to_user_app_tile (BookmarkItem *, gpointer);
static Tile *item_to_recent_app_tile (BookmarkItem *, gpointer); static Tile *item_to_recent_app_tile (BookmarkItem *, gpointer);
...@@ -181,7 +183,7 @@ static Tile *item_to_system_tile (BookmarkItem *, gpointer); ...@@ -181,7 +183,7 @@ static Tile *item_to_system_tile (BookmarkItem *, gpointer);
static BookmarkItem *app_uri_to_item (const gchar *, gpointer); static BookmarkItem *app_uri_to_item (const gchar *, gpointer);
static BookmarkItem *doc_uri_to_item (const gchar *, gpointer); static BookmarkItem *doc_uri_to_item (const gchar *, gpointer);
static void panel_button_clicked_cb (GtkButton *, gpointer); static void panel_button_toggled_cb (GtkToggleButton *, gpointer);
static gboolean panel_button_button_press_cb (GtkWidget *, GdkEventButton *, gpointer); static gboolean panel_button_button_press_cb (GtkWidget *, GdkEventButton *, gpointer);
static void panel_button_drag_data_rcv_cb (GtkWidget *, GdkDragContext *, gint, gint, static void panel_button_drag_data_rcv_cb (GtkWidget *, GdkDragContext *, gint, gint,
GtkSelectionData *, guint, guint, gpointer); GtkSelectionData *, guint, guint, gpointer);
...@@ -481,8 +483,8 @@ create_panel_button (MainMenuUI *this) ...@@ -481,8 +483,8 @@ create_panel_button (MainMenuUI *this)
GTK_CONTAINER (button_parent), GTK_WIDGET (priv->panel_buttons [i])); GTK_CONTAINER (button_parent), GTK_WIDGET (priv->panel_buttons [i]));
g_signal_connect ( g_signal_connect (
G_OBJECT (priv->panel_buttons [i]), "clicked", G_OBJECT (priv->panel_buttons [i]), "toggled",
G_CALLBACK (panel_button_clicked_cb), this); G_CALLBACK (panel_button_toggled_cb), this);
g_signal_connect ( g_signal_connect (
G_OBJECT (priv->panel_buttons [i]), "button_press_event", G_OBJECT (priv->panel_buttons [i]), "button_press_event",
...@@ -1112,6 +1114,34 @@ app_is_in_blacklist (const gchar *uri) ...@@ -1112,6 +1114,34 @@ app_is_in_blacklist (const gchar *uri)
return blacklisted; return blacklisted;
} }
static void
toggle_panel_button (MainMenuUI *this)
{
MainMenuUIPrivate *priv = PRIVATE (this);
gboolean active = gtk_toggle_button_get_active (priv->panel_button);
gtk_toggle_button_set_active (priv->panel_button, ! active);
}
static void
handle_panel_button_button_press (MainMenuUI *this, guint64 time)
{
MainMenuUIPrivate *priv = PRIVATE (this);
DoubleClickDetector *dcd;
gboolean is_dc;
dcd = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (priv->panel_button),
"double-click-detector"));
is_dc = double_click_detector_is_double_click (dcd, time, TRUE);
if (! is_dc)
toggle_panel_button (this);
}
static void static void
select_page (MainMenuUI *this) select_page (MainMenuUI *this)
{ {
...@@ -1597,51 +1627,27 @@ exit: ...@@ -1597,51 +1627,27 @@ exit:
} }
static void static void
panel_button_clicked_cb (GtkButton *button, gpointer user_data) panel_button_toggled_cb (GtkToggleButton *toggle, gpointer user_data)
{ {
MainMenuUI *this = MAIN_MENU_UI (user_data); MainMenuUIPrivate *priv = PRIVATE (user_data);
MainMenuUIPrivate *priv = PRIVATE (this);
GtkToggleButton *toggle = GTK_TOGGLE_BUTTON (button);
DoubleClickDetector *detector;
GTimeVal t_curr;
guint32 t_curr_ms;
gboolean visible;
detector = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (toggle), "double-click-detector"));
g_get_current_time (& t_curr);
t_curr_ms = 1000 * t_curr.tv_sec + t_curr.tv_usec / 1000;
visible = GTK_WIDGET_VISIBLE (priv->slab_window);
if (! double_click_detector_is_double_click (detector, t_curr_ms, TRUE)) {
if (! visible)
gtk_window_present_with_time (GTK_WINDOW (priv->slab_window), t_curr_ms);
else
gtk_widget_hide (priv->slab_window);
visible = GTK_WIDGET_VISIBLE (priv->slab_window);
}
gtk_toggle_button_set_active (priv->panel_button, visible); if (! GTK_WIDGET_VISIBLE (priv->slab_window))
gtk_window_present_with_time (
GTK_WINDOW (priv->slab_window), gtk_get_current_event_time ());
else
gtk_widget_hide (priv->slab_window);
} }
static gboolean static gboolean
panel_button_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) panel_button_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{ {
MainMenuUIPrivate *priv = PRIVATE (user_data);
if (event->button != 1) if (event->button != 1)
g_signal_stop_emission_by_name (widget, "button_press_event"); g_signal_stop_emission_by_name (widget, "button_press_event");
else if (! gtk_toggle_button_get_active (priv->panel_button)) else {
gtk_toggle_button_set_active (priv->panel_button, TRUE); handle_panel_button_button_press (MAIN_MENU_UI (user_data), event->time);
else
/* do nothing */ ; return TRUE;
}
return FALSE; return FALSE;
} }
...@@ -1839,17 +1845,29 @@ slab_window_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer ...@@ -1839,17 +1845,29 @@ slab_window_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer
MainMenuUI *this = MAIN_MENU_UI (user_data); MainMenuUI *this = MAIN_MENU_UI (user_data);
MainMenuUIPrivate *priv = PRIVATE (this); MainMenuUIPrivate *priv = PRIVATE (this);
GdkWindow *ptr_window; GdkWindow *ptr_window = NULL;
gpointer window_widget = NULL;
ptr_window = gdk_window_at_pointer (NULL, NULL); ptr_window = gdk_window_at_pointer (NULL, NULL);
if (priv->slab_window->window != ptr_window) { if (ptr_window)
gdk_window_get_user_data (ptr_window, & window_widget);
if (priv->slab_window->window != ptr_window && window_widget != priv->panel_button) {
hide_slab_if_urgent_close (this); hide_slab_if_urgent_close (this);
return TRUE; return TRUE;
} }
if (window_widget == priv->panel_button) {
g_signal_stop_emission_by_name (widget, "button_press_event");
handle_panel_button_button_press (this, event->time);
return TRUE;
}
return FALSE; return FALSE;
} }
...@@ -2047,8 +2065,7 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data) ...@@ -2047,8 +2065,7 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
MainMenuUIPrivate *priv = PRIVATE (this); MainMenuUIPrivate *priv = PRIVATE (this);
DoubleClickDetector *detector; DoubleClickDetector *detector;
GTimeVal current_time; guint64 t_curr_ms;
guint32 current_time_millis;
GnomeDesktopItem *ditem; GnomeDesktopItem *ditem;
gchar *ditem_id; gchar *ditem_id;
...@@ -2062,11 +2079,9 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data) ...@@ -2062,11 +2079,9 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
detector = DOUBLE_CLICK_DETECTOR ( detector = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (button), "double-click-detector")); g_object_get_data (G_OBJECT (button), "double-click-detector"));
g_get_current_time (& current_time); t_curr_ms = gtk_get_current_event_time ();
current_time_millis = 1000 * current_time.tv_sec + current_time.tv_usec / 1000;
if (! double_click_detector_is_double_click (detector, current_time_millis, TRUE)) { if (! double_click_detector_is_double_click (detector, t_curr_ms, TRUE)) {
if (GTK_WIDGET (button) == priv->more_buttons [APPS_PAGE]) if (GTK_WIDGET (button) == priv->more_buttons [APPS_PAGE])
ditem_id = libslab_get_gconf_value (APP_BROWSER_GCONF_KEY); ditem_id = libslab_get_gconf_value (APP_BROWSER_GCONF_KEY);
else if (GTK_WIDGET (button) == priv->more_buttons [DOCS_PAGE]) { else if (GTK_WIDGET (button) == priv->more_buttons [DOCS_PAGE]) {
......
...@@ -433,6 +433,9 @@ drag_data_rcv (GtkWidget *widget, GdkDragContext *context, gint x, gint y, ...@@ -433,6 +433,9 @@ drag_data_rcv (GtkWidget *widget, GdkDragContext *context, gint x, gint y,
gint i; gint i;
if (! priv->modifiable)
return;
src_tile = gtk_drag_get_source_widget (context); src_tile = gtk_drag_get_source_widget (context);
if (src_tile && IS_TILE (src_tile)) { if (src_tile && IS_TILE (src_tile)) {
......
2007-05-03 Jim Krehl <jimmyk@novell.com>
* *.po:
Reran make update-po, added string "Desktop" from nautilus.
2007-04-23 Jim Krehl <jimmyk@novell.com>
* {af,ar,bn,gu,hi,mr,sv,ta,xh}.po:
Pulled in corrected translations for string at:
../control-center/etc/control-center.schemas.in.h:13
BNC #266283
2007-04-11 Jim Krehl <jimmyk@novell.com>
* *.po: Updated with missing strings from nautilus project.
2007-04-02 Josep Puigdemont i Casamajó <josep.puigdemont@gmail.com> 2007-04-02 Josep Puigdemont i Casamajó <josep.puigdemont@gmail.com>
* ca.po: Updated Catalan translation. * ca.po: Updated Catalan translation.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.