[gnome-utils] Get rid of GtkObject and clean up quit handling
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-utils] Get rid of GtkObject and clean up quit handling
- Date: Sat, 9 Oct 2010 15:44:09 +0000 (UTC)
commit 69f2a233d6df13c9bc4ab82c28187788551cf17a
Author: Paolo Borelli <pborelli gnome org>
Date: Sat Oct 9 16:58:23 2010 +0200
Get rid of GtkObject and clean up quit handling
baobab/data/baobab-main-window.ui | 12 +++++-------
baobab/src/baobab.c | 7 +++++++
baobab/src/baobab.h | 1 +
baobab/src/callbacks.c | 15 +++++++--------
baobab/src/callbacks.h | 2 +-
5 files changed, 21 insertions(+), 16 deletions(-)
---
diff --git a/baobab/data/baobab-main-window.ui b/baobab/data/baobab-main-window.ui
index 55f6215..ca0ecb1 100644
--- a/baobab/data/baobab-main-window.ui
+++ b/baobab/data/baobab-main-window.ui
@@ -62,10 +62,10 @@
<accelerator key="R" modifiers="GDK_CONTROL_MASK"/>
</child>
<child>
- <object class="GtkAction" id="esci1">
+ <object class="GtkAction" id="menuquit">
<property name="stock_id">gtk-quit</property>
- <property name="name">esci1</property>
- <signal handler="on_esci1_activate" last_modification_time="Tue, 05 Jul 2005 08:47:26 GMT" name="activate"/>
+ <property name="name">menuquit</property>
+ <signal handler="on_quit_activate" last_modification_time="Tue, 05 Jul 2005 08:47:26 GMT" name="activate"/>
</object>
</child>
<child>
@@ -160,7 +160,7 @@
<menuitem action="menustop"/>
<menuitem action="menurescan"/>
<separator/>
- <menuitem action="esci1"/>
+ <menuitem action="menuquit"/>
</menu>
<menu action="edit1">
<menuitem action="expand_all"/>
@@ -197,7 +197,6 @@
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
- <signal handler="on_esci1_activate" last_modification_time="Sun, 31 Jul 2005 16:47:41 GMT" name="destroy"/>
<signal handler="on_delete_activate" last_modification_time="Sun, 31 Jul 2005 16:53:49 GMT" name="delete_event"/>
<child>
<object class="GtkVBox" id="vbox1">
@@ -234,8 +233,7 @@
<property name="visible_vertical">True</property>
<property name="is_important">True</property>
<accessibility>
-
- </accessibility>
+ </accessibility>
<signal handler="on_tbscanhome_clicked" last_modification_time="Wed, 23 Aug 2006 12:30:03 GMT" name="clicked"/>
<child internal-child="accessible">
<object class="AtkObject" id="a11y-tbscanhome1">
diff --git a/baobab/src/baobab.c b/baobab/src/baobab.c
index 184847a..f925814 100644
--- a/baobab/src/baobab.c
+++ b/baobab/src/baobab.c
@@ -1241,6 +1241,13 @@ initialize_charts (void)
check_drop_targets (FALSE);
}
+void
+baobab_quit ()
+{
+ baobab_stop_scan ();
+ gtk_main_quit ();
+}
+
static gboolean
start_proc_on_command_line (GFile *file)
{
diff --git a/baobab/src/baobab.h b/baobab/src/baobab.h
index 63b6b73..0b05848 100644
--- a/baobab/src/baobab.h
+++ b/baobab/src/baobab.h
@@ -126,5 +126,6 @@ gboolean baobab_is_excluded_location (GFile *);
void baobab_set_toolbar_visible (gboolean visible);
void baobab_set_statusbar_visible (gboolean visible);
void baobab_set_statusbar (const gchar *);
+void baobab_quit (void);
#endif /* __BAOBAB_H_ */
diff --git a/baobab/src/callbacks.c b/baobab/src/callbacks.c
index f9a1629..1f5b2b9 100644
--- a/baobab/src/callbacks.c
+++ b/baobab/src/callbacks.c
@@ -39,6 +39,12 @@
#include "baobab-chart.h"
void
+on_quit_activate (GtkMenuItem *menuitem, gpointer user_data)
+{
+ baobab_quit ();
+}
+
+void
on_menuscanhome_activate (GtkMenuItem *menuitem, gpointer user_data)
{
baobab_scan_home ();
@@ -57,13 +63,6 @@ on_menuscandir_activate (GtkMenuItem *menuitem, gpointer user_data)
}
void
-on_esci1_activate (GtkObject *menuitem, gpointer user_data)
-{
- baobab_stop_scan ();
- gtk_main_quit ();
-}
-
-void
on_about_activate (GtkMenuItem *menuitem, gpointer user_data)
{
const gchar * const authors[] = {
@@ -192,7 +191,7 @@ gboolean
on_delete_activate (GtkWidget *widget,
GdkEvent *event, gpointer user_data)
{
- on_esci1_activate (NULL, NULL);
+ baobab_quit ();
return TRUE;
}
diff --git a/baobab/src/callbacks.h b/baobab/src/callbacks.h
index 8c1e4ae..699b636 100644
--- a/baobab/src/callbacks.h
+++ b/baobab/src/callbacks.h
@@ -26,6 +26,7 @@
#include <gtk/gtk.h>
#include "baobab-chart.h"
+void on_quit_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_about_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menuscanhome_activate (GtkMenuItem *menuitem, gpointer user_data);
void on_menuallfs_activate (GtkMenuItem *menuitem, gpointer user_data);
@@ -39,7 +40,6 @@ void on_tbstop_clicked (GtkToolButton *toolbutton, gpointer user_data);
void on_tbrescan_clicked (GtkToolButton *toolbutton, gpointer user_data);
void on_radio_allfs_clicked (GtkButton *button, gpointer user_data);
void on_radio_dir_clicked (GtkButton *button, gpointer user_data);
-void on_esci1_activate (GtkObject *object, gpointer user_data);
gboolean on_delete_activate (GtkWidget *widget, GdkEvent *event, gpointer user_data);
void open_file_cb (GtkMenuItem *pmenu, gpointer dummy);
void scan_folder_cb (GtkMenuItem *pmenu, gpointer dummy);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]