...
 
Commits (1)
2007-04-09 Scott Reeves <sreeves@novell.com>
* configure.in
2007-05-11 Scott Reeves <sreeves@novell.com>
* main-menu/src/main-menu-ui.c
* main-menu/src/tile-table.c
* main-menu/etc/system-items.xbel
* libslab/Makefile.am
* Makefile.am:
Fix for BNC#255943
Remove CC from g-m-m since it's now shipped by g-c-c
* configure.in
* libslab/libslab-utils.c
* libslab/libslab-utils.h
* libslab/bookmark-agent.c
* libslab/double-click-detector.c
* libslab/double-click-detector.h:
Merge in SLED10-SP1 branch from it's creation to 05/10/2007 (-r 252:272)
Merged in all changes except for po changes.
2007-03-29 Jim Krehl <jimmyk@novell.com>
* main-menu/src/main-menu-ui.c:
......
......@@ -62,20 +62,10 @@ PKG_CHECK_MODULES(APPLICATION_BROWSER, [ $COMMON_MODULES libpanelapplet-2.0 gnom
AC_SUBST(APPLICATION_BROWSER_CFLAGS)
AC_SUBST(APPLICATION_BROWSER_LIBS)
dnl ==============================================
dnl How to build libslab?
dnl ==============================================
ENABLE_DYNAMIC_LIBSLAB=1
AC_ARG_ENABLE(dynamic-libslab,
AC_HELP_STRING([--enable-dynamic-libslab], [Enable dynamic libslab]),
[ENABLE_DYNAMIC_LIBSLAB=1])
PKG_CHECK_MODULES(CONTROL_CENTER, [ $COMMON_MODULES libpanelapplet-2.0 gnome-desktop-2.0 libgnomeui-2.0 libgnome-menu ])
AM_CONDITIONAL(ENABLE_DYNAMIC_LIBSLAB, test "x$ENABLE_DYNAMIC_LIBSLAB" = "x1")
dnl ==============================================
dnl End: How to build libslab?
dnl ==============================================
AC_SUBST(CONTROL_CENTER_CFLAGS)
AC_SUBST(CONTROL_CENTER_LIBS)
dnl ==============================================
dnl Gconf
......@@ -125,6 +115,8 @@ AC_OUTPUT([
Makefile
application-browser/etc/Makefile
application-browser/src/Makefile
control-center/etc/Makefile
control-center/src/Makefile
libslab/Makefile
libslab/libslab.pc
main-menu/etc/Makefile
......
......@@ -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);
......
......@@ -17,7 +17,7 @@
</metadata>
</info>
</bookmark>
<bookmark href="gnomecc.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
<bookmark href="control-center.desktop" added="2007-01-16T05:53:36Z" modified="2007-01-16T05:53:36Z" visited="2007-01-16T05:53:36Z">
<info>
<metadata owner="http://freedesktop.org">
<mime:mime-type type="application/x-desktop"/>
......@@ -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"/>
......
......@@ -158,19 +158,21 @@ static void setup_file_tables (MainMenuUI *);
static void setup_bookmark_agents (MainMenuUI *);
static void setup_lock_down (MainMenuUI *);
static void select_page (MainMenuUI *);
static void update_limits (MainMenuUI *);
static void connect_to_tile_triggers (MainMenuUI *, TileTable *);
static void hide_slab_if_urgent_close (MainMenuUI *);
static void set_search_section_visible (MainMenuUI *);
static void set_table_section_visible (MainMenuUI *, TileTable *);
static gchar **get_search_argv (const gchar *);
static void reorient_panel_button (MainMenuUI *);
static void bind_beagle_search_key (MainMenuUI *);
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 select_page (MainMenuUI *);
static void update_limits (MainMenuUI *);
static void connect_to_tile_triggers (MainMenuUI *, TileTable *);
static void hide_slab_if_urgent_close (MainMenuUI *);
static void set_search_section_visible (MainMenuUI *);
static void set_table_section_visible (MainMenuUI *, TileTable *);
static gchar **get_search_argv (const gchar *);
static void reorient_panel_button (MainMenuUI *);
static void bind_beagle_search_key (MainMenuUI *);
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);
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);
}
MainMenuUIPrivate *priv = PRIVATE (user_data);
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
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)) {
......