summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--hieroglyph/version.h.in2
-rw-r--r--src/hgspy.c31
-rw-r--r--src/visualizer.c7
4 files changed, 32 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index e987db0..c1da913 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-06-18 Akira TAGOH <at@gclab.org>
+ * src/hgspy.c (_hgspy_entry_activate_cb): don't send anything
+ if VM isn't running.
+ (main): added visualizer widget into VPaned.
+
+ * src/visualizer.c (hg_memory_visualizer_real_size_request):
+ new function.
+
* src/hgspy.c (_hgspy_file_read_cb): update a prompt.
(_hgspy_entry_activate_cb): echo back the input to the textview.
(_hgspy_insert_text_into_textview): new function.
diff --git a/hieroglyph/version.h.in b/hieroglyph/version.h.in
index 611aca6..0369cd6 100644
--- a/hieroglyph/version.h.in
+++ b/hieroglyph/version.h.in
@@ -29,7 +29,7 @@
G_BEGIN_DECLS
#define HIEROGLYPH_VERSION "@VERSION@"
-#define HIEROGLYPH_UUID "6950e267-0375-4399-9e1d-fc94b6650c21"
+#define HIEROGLYPH_UUID "64936158-07ea-44d3-89f9-11cc27259a38"
const char *__hg_rcsid G_GNUC_UNUSED = "$Rev$";
diff --git a/src/hgspy.c b/src/hgspy.c
index fc1d97f..f9faea7 100644
--- a/src/hgspy.c
+++ b/src/hgspy.c
@@ -572,14 +572,16 @@ _hgspy_entry_activate_cb(GtkWidget *widget,
text = gtk_entry_get_text(entry);
if (text == NULL || text[0] == 0)
return;
- echoback = g_strdup_printf("%s%s\n",
- gtk_label_get_text(GTK_LABEL (spy->prompt)),
- text);
- _hgspy_insert_text_into_textview(spy, echoback, strlen(echoback));
- g_free(echoback);
- spy->statementedit_buffer = g_strdup(text);
+ if (spy->vm) {
+ echoback = g_strdup_printf("%s%s\n",
+ gtk_label_get_text(GTK_LABEL (spy->prompt)),
+ text);
+ _hgspy_insert_text_into_textview(spy, echoback, strlen(echoback));
+ g_free(echoback);
+ spy->statementedit_buffer = g_strdup(text);
+ gtk_widget_set_sensitive(spy->entry, FALSE);
+ }
gtk_entry_set_text(entry, "");
- gtk_widget_set_sensitive(spy->entry, FALSE);
}
static void
@@ -638,6 +640,7 @@ main(int argc,
GModule *module;
HgSpy *spy;
GtkWidget *menubar, *vbox, *none, *table, *label, *hbox, *vbox2, *scrolled, *hbox2;
+ GtkWidget *vpaned, *vbox3;
GtkActionGroup *actions;
GtkActionEntry action_entries[] = {
/* toplevel menu */
@@ -776,10 +779,12 @@ main(int argc,
spy->ui = gtk_ui_manager_new();
vbox = gtk_vbox_new(FALSE, 0);
vbox2 = gtk_vbox_new(FALSE, 0);
+ vbox3 = gtk_vbox_new(FALSE, 0);
hbox = gtk_hbox_new(FALSE, 0);
hbox2 = gtk_hbox_new(FALSE, 0);
table = gtk_table_new(3, 2, FALSE);
scrolled = gtk_scrolled_window_new(NULL, NULL);
+ vpaned = gtk_vpaned_new();
spy->total_vm_size = gtk_entry_new();
spy->used_vm_size = gtk_entry_new();
spy->free_vm_size = gtk_entry_new();
@@ -865,13 +870,15 @@ main(int argc,
gtk_container_add(GTK_CONTAINER (scrolled), spy->textview);
gtk_box_pack_start(GTK_BOX (vbox2), scrolled, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX (hbox2), spy->prompt, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX (hbox2), spy->entry, FALSE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX (vbox2), hbox2, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX (hbox2), spy->entry, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX (vbox2), hbox2, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX (hbox), vbox2, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX (hbox), table, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- gtk_box_pack_end(GTK_BOX (vbox), spy->status, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER (spy->window), vbox);
+ gtk_paned_pack1(GTK_PANED (vpaned), vbox, TRUE, FALSE);
+ gtk_paned_pack2(GTK_PANED (vpaned), hbox, TRUE, FALSE);
+ gtk_box_pack_start(GTK_BOX (vbox3), vpaned, TRUE, TRUE, 0);
+ gtk_box_pack_end(GTK_BOX (vbox3), spy->status, FALSE, FALSE, 0);
+ gtk_container_add(GTK_CONTAINER (spy->window), vbox3);
/* setup signals */
g_signal_connect(spy->visualizer, "pool-updated",
diff --git a/src/visualizer.c b/src/visualizer.c
index 57804c7..ec276d1 100644
--- a/src/visualizer.c
+++ b/src/visualizer.c
@@ -155,13 +155,15 @@ hg_memory_visualizer_real_destroy(GtkObject *object)
}
/* GtkWidget */
-#if 0
static void
hg_memory_visualizer_real_size_request(GtkWidget *widget,
GtkRequisition *requisition)
{
+ GtkWidget *parent = gtk_widget_get_parent(widget);
+
+ requisition->width = widget->requisition.width = parent->requisition.width;
+ requisition->height = widget->requisition.height = parent->requisition.height;
}
-#endif
static void
hg_memory_visualizer_real_size_allocate(GtkWidget *widget,
@@ -323,6 +325,7 @@ hg_memory_visualizer_class_init(HgMemoryVisualizerClass *klass)
widget_class->unrealize = hg_memory_visualizer_real_unrealize;
widget_class->map = hg_memory_visualizer_real_map;
widget_class->unmap = hg_memory_visualizer_real_unmap;
+ widget_class->size_request = hg_memory_visualizer_real_size_request;
widget_class->size_allocate = hg_memory_visualizer_real_size_allocate;
/* initialize HgMemoryVisualizer */