[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade...
From: |
John Darrington |
Subject: |
[Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade... |
Date: |
Thu, 28 Dec 2006 00:44:45 +0000 |
CVSROOT: /sources/pspp
Module name: pspp
Changes by: John Darrington <jmd> 06/12/28 00:44:45
Modified files:
src/ui/gui : data-editor.c data-editor.glade
syntax-editor-source.c syntax-editor.c
syntax-editor.glade window-manager.c
window-manager.h
Log message:
Added a "Windows" menu, and a "minimise all windows" item.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.glade?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor-source.c?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor.c?cvsroot=pspp&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/syntax-editor.glade?cvsroot=pspp&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/window-manager.c?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/window-manager.h?cvsroot=pspp&r1=1.1&r2=1.2
Patches:
Index: data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- data-editor.c 27 Dec 2006 22:30:06 -0000 1.5
+++ data-editor.c 28 Dec 2006 00:44:45 -0000 1.6
@@ -24,7 +24,7 @@
#include <glade/glade.h>
#include <gtk/gtk.h>
-
+#include "window-manager.h"
#include <gtksheet/gtksheet.h>
#include "helper.h"
@@ -116,7 +116,7 @@
connect_help (de->xml);
- e->window = get_widget_assert (de->xml, "data_editor");
+ e->window = GTK_WINDOW (get_widget_assert (de->xml, "data_editor"));
g_signal_connect (get_widget_assert (de->xml,"file_new_data"),
"activate",
@@ -230,6 +230,11 @@
G_CALLBACK (file_quit), de);
+ g_signal_connect (get_widget_assert (de->xml, "windows_minimise_all"),
+ "activate",
+ G_CALLBACK (minimise_all_windows), NULL);
+
+
select_sheet (de, PAGE_DATA_SHEET);
return de;
Index: data-editor.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.glade,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- data-editor.glade 27 Dec 2006 22:30:06 -0000 1.3
+++ data-editor.glade 28 Dec 2006 00:44:45 -0000 1.4
@@ -207,7 +207,7 @@
<property name="use_underline">True</property>
<child internal-child="image">
- <widget class="GtkImage" id="image41">
+ <widget class="GtkImage" id="image44">
<property name="visible">True</property>
<property name="stock">gtk-find</property>
<property name="icon_size">1</property>
@@ -344,7 +344,7 @@
<signal name="activate" handler="on_go_to_case_activate"
last_modification_time="Mon, 19 Jun 2006 10:29:37 GMT"/>
<child internal-child="image">
- <widget class="GtkImage" id="image42">
+ <widget class="GtkImage" id="image45">
<property name="visible">True</property>
<property name="stock">gtk-jump-to</property>
<property name="icon_size">1</property>
@@ -446,6 +446,29 @@
</child>
<child>
+ <widget class="GtkMenuItem" id="Windows">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Windows</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_Windows_activate"
last_modification_time="Wed, 27 Dec 2006 23:16:44 GMT"/>
+
+ <child>
+ <widget class="GtkMenu" id="Windows_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="windows_minimise_all">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Minimise All
Windows</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_minimiseall_activate"
last_modification_time="Wed, 27 Dec 2006 23:17:26 GMT"/>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
<widget class="GtkMenuItem" id="menuitem5">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
Index: syntax-editor-source.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor-source.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- syntax-editor-source.c 23 Dec 2006 09:03:45 -0000 1.2
+++ syntax-editor-source.c 28 Dec 2006 00:44:45 -0000 1.3
@@ -52,7 +52,7 @@
const struct syntax_editor_source *ses =
(const struct syntax_editor_source *) i;
- return window_name ((struct window_editor *) ses->se);
+ return window_name ((const struct editor_window *) ses->se);
}
Index: syntax-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- syntax-editor.c 27 Dec 2006 22:30:06 -0000 1.10
+++ syntax-editor.c 28 Dec 2006 00:44:45 -0000 1.11
@@ -110,7 +110,7 @@
return ;
}
- gtk_widget_destroy (e->window);
+ gtk_widget_destroy (GTK_WIDGET (e->window));
}
/* Callback for the File->SaveAs menuitem */
@@ -331,7 +331,7 @@
e = (struct editor_window *)se;
- e->window = get_widget_assert (xml, "syntax_editor");
+ e->window = GTK_WINDOW (get_widget_assert (xml, "syntax_editor"));
text_view = get_widget_assert (xml, "syntax_text_view");
se->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view));
se->lexer = lex_create (the_source_stream);
@@ -408,6 +408,13 @@
se);
+ g_signal_connect (get_widget_assert (xml,"windows_minimise_all"),
+ "activate",
+ G_CALLBACK (minimise_all_windows),
+ NULL);
+
+
+
g_object_unref (xml);
g_signal_connect (e->window, "delete-event",
Index: syntax-editor.glade
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/syntax-editor.glade,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- syntax-editor.glade 27 Dec 2006 22:30:06 -0000 1.3
+++ syntax-editor.glade 28 Dec 2006 00:44:45 -0000 1.4
@@ -227,6 +227,28 @@
</child>
<child>
+ <widget class="GtkMenuItem" id="windows">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Windows</property>
+ <property name="use_underline">True</property>
+ <signal name="activate" handler="on_windows_activate"
last_modification_time="Thu, 28 Dec 2006 00:31:09 GMT"/>
+
+ <child>
+ <widget class="GtkMenu" id="windows_menu">
+
+ <child>
+ <widget class="GtkMenuItem" id="windows_minimise_all">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Minimise All
Windows</property>
+ <property name="use_underline">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
<widget class="GtkMenuItem" id="menuitem9">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
Index: window-manager.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/window-manager.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- window-manager.c 24 Dec 2006 23:08:25 -0000 1.2
+++ window-manager.c 28 Dec 2006 00:44:45 -0000 1.3
@@ -1,3 +1,4 @@
+#include <glib.h>
#include "syntax-editor.h"
#include "data-editor.h"
@@ -9,17 +10,48 @@
#include "window-manager.h"
-static int window_count = 0;
+
+/* A list of struct editor_windows */
+static GSList *window_list = NULL;
+
static void
-deregister (GtkObject *o, gpointer data)
+deregister_window (GtkWindow *w, gpointer data)
{
- window_count --;
+ struct editor_window *e = data;
- if ( 0 == window_count )
+ window_list = g_slist_remove (window_list, e);
+
+ if ( g_slist_length (window_list) == 0 )
gtk_main_quit ();
};
+
+static void
+register_window (struct editor_window *e)
+{
+ window_list = g_slist_prepend (window_list, e);
+}
+
+
+static gint
+next_window_id (void)
+{
+ return g_slist_length (window_list);
+}
+
+void
+minimise_all_windows (void)
+{
+ const GSList *i = NULL;
+
+ for (i = window_list; i != NULL ; i = i->next)
+ {
+ struct editor_window *e = i->data;
+ gtk_window_iconify (e->window);
+ }
+}
+
static void set_window_name (struct editor_window *e, const gchar *name );
@@ -48,11 +80,12 @@
gtk_window_set_icon_from_file (GTK_WINDOW (e->window),
PKGDATADIR "/psppicon.png", 0);
- g_signal_connect (e->window, "destroy", G_CALLBACK (deregister), NULL);
+ g_signal_connect (e->window, "destroy",
+ G_CALLBACK (deregister_window), e);
- gtk_widget_show (e->window);
+ register_window (e);
- window_count ++;
+ gtk_widget_show (e->window);
return e;
}
@@ -75,11 +108,11 @@
switch (e->type )
{
case WINDOW_SYNTAX:
- e->name = g_strdup_printf (_("Syntax%d"), window_count);
+ e->name = g_strdup_printf (_("Syntax%d"), next_window_id () );
title = g_strdup_printf (_("%s --- PSPP Syntax Editor"), e->name);
break;
case WINDOW_DATA:
- e->name = g_strdup_printf (_("Untitled%d"), window_count);
+ e->name = g_strdup_printf (_("Untitled%d"), next_window_id () );
title = g_strdup_printf (_("%s --- PSPP Data Editor"), e->name);
break;
default:
@@ -119,13 +152,6 @@
g_free (title);
}
-
-GtkWindow *
-window_toplevel (const struct editor_window *e)
-{
- return GTK_WINDOW (e->window);
-}
-
const gchar *
window_name (const struct editor_window *e)
{
Index: window-manager.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/window-manager.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- window-manager.h 23 Dec 2006 09:03:45 -0000 1.1
+++ window-manager.h 28 Dec 2006 00:44:45 -0000 1.2
@@ -12,7 +12,7 @@
struct editor_window
{
- GtkWidget *window; /* The top level window of the editor */
+ GtkWindow *window; /* The top level window of the editor */
gchar *name; /* The name of this editor */
enum window_type type;
} ;
@@ -20,12 +20,12 @@
struct editor_window * window_create (enum window_type type,
const gchar *name);
-
-GtkWindow * window_toplevel (const struct editor_window *);
-
const gchar * window_name (const struct editor_window *);
void window_set_name_from_filename (struct editor_window *e,
const gchar *filename);
+void minimise_all_windows (void);
+
+
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pspp-cvs] pspp/src/ui/gui data-editor.c data-editor.glade...,
John Darrington <=