[libslab] Remove the use of GnomeApp; use a plain GtkWindow instead
- From: Federico Mena Quintero <federico src gnome org>
- To: svn-commits-list gnome org
- Subject: [libslab] Remove the use of GnomeApp; use a plain GtkWindow instead
- Date: Mon, 29 Jun 2009 17:32:51 +0000 (UTC)
commit 5157956a19ef050266a7d9603a6045c2f976f92c
Author: Federico Mena Quintero <federico novell com>
Date: Mon Jun 29 12:05:55 2009 -0500
Remove the use of GnomeApp; use a plain GtkWindow instead
Signed-off-by: Federico Mena Quintero <federico novell com>
libslab/app-shell-startup.c | 6 +++---
libslab/app-shell.c | 27 ++++++++++++++-------------
libslab/app-shell.h | 8 ++++----
3 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/libslab/app-shell-startup.c b/libslab/app-shell-startup.c
index e0491f1..a6aa800 100644
--- a/libslab/app-shell-startup.c
+++ b/libslab/app-shell-startup.c
@@ -41,7 +41,7 @@ apss_new_instance_cb (BonoboApplication * app, gint argc, char *argv[], gpointer
g_assert (NLD_IS_SEARCH_BAR (section->contents));
search_bar = NLD_SEARCH_BAR (section->contents);
- g_object_get (app_data->main_gnome_app, "visible", &visible, NULL);
+ g_object_get (app_data->main_app, "visible", &visible, NULL);
if (!visible)
{
show_shell (app_data);
@@ -59,10 +59,10 @@ apss_new_instance_cb (BonoboApplication * app, gint argc, char *argv[], gpointer
g_strfreev (results);
/* gdk_x11_window_move_to_current_desktop(window); */
- gdk_x11_window_set_user_time (app_data->main_gnome_app->window, timestamp);
+ gdk_x11_window_set_user_time (app_data->main_app->window, timestamp);
}
- gtk_window_present (GTK_WINDOW (app_data->main_gnome_app));
+ gtk_window_present (GTK_WINDOW (app_data->main_app));
gtk_widget_grab_focus (GTK_WIDGET (search_bar));
return argc;
diff --git a/libslab/app-shell.c b/libslab/app-shell.c
index 05957e7..1f79c4a 100644
--- a/libslab/app-shell.c
+++ b/libslab/app-shell.c
@@ -95,47 +95,48 @@ gboolean regenerate_categories (AppShellData * app_data);
void
hide_shell (AppShellData * app_data)
{
- gtk_window_get_position (GTK_WINDOW (app_data->main_gnome_app),
- &app_data->main_gnome_app_window_x, &app_data->main_gnome_app_window_y);
- /* printf("x:%d, y:%d\n", app_data->main_gnome_app_window_x, app_data->main_gnome_app_window_y); */
+ gtk_window_get_position (GTK_WINDOW (app_data->main_app),
+ &app_data->main_app_window_x, &app_data->main_app_window_y);
+ /* printf("x:%d, y:%d\n", app_data->main_app_window_x, app_data->main_app_window_y); */
/* clear the search bar now so reshowing is fast and flicker free - BNC#283186 */
application_launcher_clear_search_bar (app_data);
- gtk_widget_hide (app_data->main_gnome_app);
+ gtk_widget_hide (app_data->main_app);
}
void
show_shell (AppShellData * app_data)
{
- gtk_widget_show_all (app_data->main_gnome_app);
+ gtk_widget_show_all (app_data->main_app);
if (!app_data->static_actions)
gtk_widget_hide_all (app_data->actions_section); /* don't show unless a launcher is selected */
- if (app_data->main_gnome_app_window_shown_once)
- gtk_window_move (GTK_WINDOW (app_data->main_gnome_app),
- app_data->main_gnome_app_window_x, app_data->main_gnome_app_window_y);
+ if (app_data->main_app_window_shown_once)
+ gtk_window_move (GTK_WINDOW (app_data->main_app),
+ app_data->main_app_window_x, app_data->main_app_window_y);
/* if this is the first time shown, need to clear this handler */
else
shell_window_clear_resize_handler (SHELL_WINDOW (app_data->shell));
- app_data->main_gnome_app_window_shown_once = TRUE;
+ app_data->main_app_window_shown_once = TRUE;
}
gboolean
create_main_window (AppShellData * app_data, const gchar * app_name, const gchar * title,
const gchar * window_icon, gint width, gint height, gboolean hidden)
{
- GtkWidget *main_app = gnome_app_new (app_name, title);
- app_data->main_gnome_app = main_app;
+ GtkWidget *main_app = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ app_data->main_app = main_app;
gtk_widget_set_name (main_app, app_name);
+ gtk_window_set_title (GTK_WINDOW (main_app), title);
/* gtk_window_set_default_size(GTK_WINDOW(main_app), width, height); */
gtk_window_set_icon_name (GTK_WINDOW (main_app), window_icon);
- gnome_app_set_contents (GNOME_APP (main_app), app_data->shell);
+ gtk_container_add (GTK_CONTAINER (main_app), app_data->shell);
g_signal_connect (main_app, "delete-event", G_CALLBACK (main_delete_callback), app_data);
g_signal_connect (main_app, "key-press-event", G_CALLBACK (main_keypress_callback),
app_data);
- gtk_window_set_position (GTK_WINDOW (app_data->main_gnome_app), GTK_WIN_POS_CENTER);
+ gtk_window_set_position (GTK_WINDOW (app_data->main_app), GTK_WIN_POS_CENTER);
if (!hidden)
show_shell (app_data);
gtk_main ();
diff --git a/libslab/app-shell.h b/libslab/app-shell.h
index 2add230..98b502f 100644
--- a/libslab/app-shell.h
+++ b/libslab/app-shell.h
@@ -54,10 +54,10 @@ typedef struct
typedef struct _AppShellData
{
- GtkWidget *main_gnome_app;
- gint main_gnome_app_window_x;
- gint main_gnome_app_window_y;
- gboolean main_gnome_app_window_shown_once;
+ GtkWidget *main_app;
+ gint main_app_window_x;
+ gint main_app_window_y;
+ gboolean main_app_window_shown_once;
GtkWidget *shell;
GtkWidget *groups_section;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]