...
 
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>
* main-menu/src/main-menu-ui.c:
Only make tiles for local files until remote files can be handled
......
AC_INIT([gnome-main-menu], [0.9.7], [])
AC_INIT([gnome-main-menu], [0.9.8], [])
AC_CONFIG_SRCDIR([.])
AC_CONFIG_HEADERS([config.h])
......
......@@ -1030,6 +1030,8 @@ create_app_item (BookmarkAgent *this, const gchar *uri)
GnomeDesktopItem *ditem;
gchar *uri_new = NULL;
gchar *name;
ditem = libslab_gnome_desktop_item_new_from_unknown_id (uri);
......@@ -1041,9 +1043,19 @@ create_app_item (BookmarkAgent *this, const gchar *uri)
if (! uri_new)
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);
}
}
static void
......@@ -1123,11 +1135,13 @@ create_dir_item (BookmarkAgent *this, const gchar *uri)
}
else if (! strcmp (uri, "DOCUMENTS")) {
path = g_build_filename (g_get_home_dir (), "Documents", NULL);
name = _("Documents");
uri_new = g_filename_to_uri (path, NULL, NULL);
g_free (path);
}
else if (! strcmp (uri, "DESKTOP")) {
path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
name = _("Desktop");
uri_new = g_filename_to_uri (path, NULL, NULL);
icon = "gnome-fs-desktop";
g_free (path);
......
......@@ -21,6 +21,7 @@
#include "double-click-detector.h"
#include <gtk/gtksettings.h>
#include <glib/gstdio.h>
#include "libslab-utils.h"
......@@ -89,7 +90,7 @@ double_click_detector_dispose (GObject * obj)
}
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)
{
gint32 delta;
......@@ -113,7 +114,7 @@ double_click_detector_is_double_click (DoubleClickDetector *this, guint32 event_
}
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)
event_time = libslab_get_current_time_millis ();
......
......@@ -37,7 +37,7 @@ typedef struct
GObject parent_placeholder;
guint32 double_click_time;
guint32 last_click_time;
guint64 last_click_time;
} DoubleClickDetector;
typedef struct
......@@ -49,10 +49,11 @@ GType double_click_detector_get_type (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);
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
#endif /* __DOUBLE_CLICK_DETECTOR_H__ */
......@@ -194,14 +194,14 @@ libslab_gnome_desktop_item_open_help (GnomeDesktopItem *item)
return retval;
}
guint32
guint64
libslab_get_current_time_millis ()
{
GTimeVal 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
......
......@@ -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);
gchar *libslab_gnome_desktop_item_get_docpath (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_strlen (const gchar *a);
gpointer libslab_get_gconf_value (const gchar *key);
......
......@@ -44,6 +44,7 @@
</info>
</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">
<title>Lock Screen</title>
<info>
<metadata owner="http://freedesktop.org">
<mime:mime-type type="application/x-desktop"/>
......
......@@ -171,6 +171,8 @@ static void launch_search (MainMenuUI *);
static void grab_pointer_and_keyboard (MainMenuUI *, guint32);
static void apply_lockdown_settings (MainMenuUI *);
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_recent_app_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 *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 void panel_button_drag_data_rcv_cb (GtkWidget *, GdkDragContext *, gint, gint,
GtkSelectionData *, guint, guint, gpointer);
......@@ -481,8 +483,8 @@ create_panel_button (MainMenuUI *this)
GTK_CONTAINER (button_parent), GTK_WIDGET (priv->panel_buttons [i]));
g_signal_connect (
G_OBJECT (priv->panel_buttons [i]), "clicked",
G_CALLBACK (panel_button_clicked_cb), this);
G_OBJECT (priv->panel_buttons [i]), "toggled",
G_CALLBACK (panel_button_toggled_cb), this);
g_signal_connect (
G_OBJECT (priv->panel_buttons [i]), "button_press_event",
......@@ -1112,6 +1114,34 @@ app_is_in_blacklist (const gchar *uri)
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
select_page (MainMenuUI *this)
{
......@@ -1597,51 +1627,27 @@ exit:
}
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 (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);
MainMenuUIPrivate *priv = PRIVATE (user_data);
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);
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);
visible = GTK_WIDGET_VISIBLE (priv->slab_window);
}
gtk_toggle_button_set_active (priv->panel_button, visible);
}
static gboolean
panel_button_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
MainMenuUIPrivate *priv = PRIVATE (user_data);
if (event->button != 1)
g_signal_stop_emission_by_name (widget, "button_press_event");
else if (! gtk_toggle_button_get_active (priv->panel_button))
gtk_toggle_button_set_active (priv->panel_button, TRUE);
else
/* do nothing */ ;
else {
handle_panel_button_button_press (MAIN_MENU_UI (user_data), event->time);
return TRUE;
}
return FALSE;
}
......@@ -1839,17 +1845,29 @@ slab_window_button_press_cb (GtkWidget *widget, GdkEventButton *event, gpointer
MainMenuUI *this = MAIN_MENU_UI (user_data);
MainMenuUIPrivate *priv = PRIVATE (this);
GdkWindow *ptr_window;
GdkWindow *ptr_window = NULL;
gpointer window_widget = 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);
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;
}
......@@ -2047,8 +2065,7 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
MainMenuUIPrivate *priv = PRIVATE (this);
DoubleClickDetector *detector;
GTimeVal current_time;
guint32 current_time_millis;
guint64 t_curr_ms;
GnomeDesktopItem *ditem;
gchar *ditem_id;
......@@ -2062,11 +2079,9 @@ more_buttons_clicked_cb (GtkButton *button, gpointer user_data)
detector = DOUBLE_CLICK_DETECTOR (
g_object_get_data (G_OBJECT (button), "double-click-detector"));
g_get_current_time (& current_time);
current_time_millis = 1000 * current_time.tv_sec + current_time.tv_usec / 1000;
t_curr_ms = gtk_get_current_event_time ();
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])
ditem_id = libslab_get_gconf_value (APP_BROWSER_GCONF_KEY);
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,
gint i;
if (! priv->modifiable)
return;
src_tile = gtk_drag_get_source_widget (context);
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>
* 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.