mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-10 00:20:54 +08:00
added man pages for utils.
lots of gmdb2 work. added statistics collection.
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
extern GtkWidget *app;
|
||||
extern MdbHandle *mdb;
|
||||
|
||||
GladeXML *debugwin_xml;
|
||||
GList *debug_list = NULL;
|
||||
|
||||
#define LINESZ 77
|
||||
|
||||
@@ -134,6 +134,88 @@ GtkWidget *textview;
|
||||
}
|
||||
}
|
||||
void
|
||||
gmdb_debug_jump_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkTextView *textview;
|
||||
GtkTextMark *mark;
|
||||
GtkTextBuffer *txtbuffer;
|
||||
GtkTextIter start, end;
|
||||
GtkWidget *entry;
|
||||
gchar *text;
|
||||
gchar page[12];
|
||||
gchar digits[4][3];
|
||||
gchar *hex_digit;
|
||||
int i, num_digits = 0;
|
||||
|
||||
textview = (GtkTextView *) glade_xml_get_widget (xml, "debug_textview");
|
||||
txtbuffer = gtk_text_view_get_buffer(textview);
|
||||
if (!gtk_text_buffer_get_selection_bounds(txtbuffer, &start, &end)) {
|
||||
/* FIX ME -- replace with text in status bar */
|
||||
fprintf(stderr, "Nothing selected\n");
|
||||
return;
|
||||
}
|
||||
text = g_strdup(gtk_text_buffer_get_text(txtbuffer, &start, &end, FALSE));
|
||||
fprintf(stderr, "selected text = %s\n",text);
|
||||
hex_digit = strtok(text, " ");
|
||||
strcpy(page, "0x");
|
||||
do {
|
||||
if (strlen(hex_digit)>2) {
|
||||
fprintf(stderr, "Not a hex value\n");
|
||||
return;
|
||||
}
|
||||
strcpy(digits[num_digits++],hex_digit);
|
||||
} while (num_digits < 4 && (hex_digit = strtok(NULL," ")));
|
||||
for (i=num_digits-1;i>=0;i--) {
|
||||
strcat(page, digits[i]);
|
||||
}
|
||||
g_free(text);
|
||||
fprintf(stderr, "going to page %s\n",page);
|
||||
entry = glade_xml_get_widget (xml, "debug_entry");
|
||||
gtk_entry_set_text(GTK_ENTRY(entry),page);
|
||||
gmdb_debug_display_cb(w, xml);
|
||||
}
|
||||
void
|
||||
gmdb_debug_jump_msb_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkTextView *textview;
|
||||
GtkTextMark *mark;
|
||||
GtkTextBuffer *txtbuffer;
|
||||
GtkTextIter start, end;
|
||||
GtkWidget *entry;
|
||||
gchar *text;
|
||||
gchar page[12];
|
||||
gchar digits[4][3];
|
||||
gchar *hex_digit;
|
||||
int i, num_digits = 0;
|
||||
|
||||
textview = (GtkTextView *) glade_xml_get_widget (xml, "debug_textview");
|
||||
txtbuffer = gtk_text_view_get_buffer(textview);
|
||||
if (!gtk_text_buffer_get_selection_bounds(txtbuffer, &start, &end)) {
|
||||
/* FIX ME -- replace with text in status bar */
|
||||
fprintf(stderr, "Nothing selected\n");
|
||||
return;
|
||||
}
|
||||
text = g_strdup(gtk_text_buffer_get_text(txtbuffer, &start, &end, FALSE));
|
||||
fprintf(stderr, "selected text = %s\n",text);
|
||||
hex_digit = strtok(text, " ");
|
||||
strcpy(page, "0x");
|
||||
do {
|
||||
if (strlen(hex_digit)>2) {
|
||||
fprintf(stderr, "Not a hex value\n");
|
||||
return;
|
||||
}
|
||||
strcpy(digits[num_digits++],hex_digit);
|
||||
} while (num_digits < 4 && (hex_digit = strtok(NULL," ")));
|
||||
for (i=0;i<num_digits;i++) {
|
||||
strcat(page, digits[i]);
|
||||
}
|
||||
g_free(text);
|
||||
fprintf(stderr, "going to page %s\n",page);
|
||||
entry = glade_xml_get_widget (xml, "debug_entry");
|
||||
gtk_entry_set_text(GTK_ENTRY(entry),page);
|
||||
gmdb_debug_display_cb(w, xml);
|
||||
}
|
||||
void
|
||||
gmdb_debug_display_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
int page;
|
||||
@@ -309,6 +391,37 @@ GtkCTreeNode *node;
|
||||
gmdb_debug_add_item(store, parent, str, offset+4, offset+7);
|
||||
}
|
||||
void
|
||||
gmdb_debug_dissect_index2(GtkTreeStore *store, GtkTreeIter *parent, char *fbuf, int offset)
|
||||
{
|
||||
gchar str[100];
|
||||
GtkCTreeNode *node;
|
||||
int mod=0;
|
||||
unsigned char flags;
|
||||
gchar flagstr[100]; /* If adding flags increase this */
|
||||
|
||||
snprintf(str, 100, "Column mask");
|
||||
gmdb_debug_add_item(store, parent, str, offset, offset+29);
|
||||
snprintf(str, 100, "Unknown");
|
||||
gmdb_debug_add_item(store, parent, str, offset+30, offset+33);
|
||||
snprintf(str, 100, "Root index page");
|
||||
gmdb_debug_add_item(store, parent, str, offset+34, offset+37);
|
||||
flags = fbuf[offset+38];
|
||||
if (flags & MDB_IDX_UNIQUE) {
|
||||
strcat(flagstr, "Unique"); mod++;
|
||||
}
|
||||
if (flags & MDB_IDX_IGNORENULLS) {
|
||||
if (mod) strcat(flagstr, ",");
|
||||
strcat(flagstr, "Ignore Nulls"); mod++;
|
||||
}
|
||||
if (flags & MDB_IDX_REQUIRED) {
|
||||
if (mod) strcat(flagstr, ",");
|
||||
strcat(flagstr, "Required");
|
||||
}
|
||||
if (!mod) strcpy(flagstr, "None");
|
||||
snprintf(str, 100, "Index Flags (%s)", flagstr);
|
||||
gmdb_debug_add_item(store, parent, str, offset+38, offset+38);
|
||||
}
|
||||
void
|
||||
gmdb_debug_add_page_ptr(GtkTreeStore *store, GtkTreeIter *parent, char *fbuf, const char *label, int offset)
|
||||
{
|
||||
gchar str[100];
|
||||
@@ -334,6 +447,7 @@ int i;
|
||||
snprintf(str, 100, "Num columns: %u", num_cols);
|
||||
gmdb_debug_add_item(store, parent, str, offset, offset);
|
||||
bitmask_sz = ((num_cols-1) / 8) + 1;
|
||||
printf("bitmask_sz %d\n", bitmask_sz);
|
||||
var_cols_loc = end - bitmask_sz;
|
||||
var_cols = fbuf[var_cols_loc];
|
||||
fixed_end = offset + fbuf[var_cols_loc - 1] - 1; /* work even if 0 b/c of EOD */
|
||||
@@ -357,6 +471,20 @@ int i;
|
||||
snprintf(str, 100, "Null mask");
|
||||
gmdb_debug_add_item(store, parent, str, var_cols_loc + 1, end);
|
||||
}
|
||||
void
|
||||
gmdb_debug_dissect_index_pg(GtkTreeStore *store, char *fbuf, int offset, int len)
|
||||
{
|
||||
gchar str[100];
|
||||
guint32 tdef;
|
||||
|
||||
snprintf(str, 100, "Page free space: %u",
|
||||
get_uint16(&fbuf[offset+2]));
|
||||
gmdb_debug_add_item(store, NULL, str, offset+2, offset+3);
|
||||
tdef = get_uint32(&fbuf[offset+4]);
|
||||
snprintf(str, 100, "Parents TDEF page: 0x%06x (%lu)", tdef,tdef);
|
||||
gmdb_debug_add_item(store, NULL, str, offset+4, offset+7);
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_debug_dissect_leaf_pg(GtkTreeStore *store, char *fbuf, int offset, int len)
|
||||
{
|
||||
@@ -484,7 +612,7 @@ GtkTreeIter *node, *container;
|
||||
for (i=0;i<num_idx;i++) {
|
||||
snprintf(str, 100, "Index %d", i+1);
|
||||
node = gmdb_debug_add_item(store, container, str, newbase+(i*39), newbase+(i*39)+38);
|
||||
//gmdb_debug_dissect_index2(store, container, fbuf, newbase+(i*39));
|
||||
gmdb_debug_dissect_index2(store, node, fbuf, newbase+(i*39));
|
||||
}
|
||||
newbase += num_idx * 39;
|
||||
container = gmdb_debug_add_item(store, NULL, "Index definition 2", -1, -1);
|
||||
@@ -528,7 +656,7 @@ gchar str[100];
|
||||
gmdb_debug_dissect_tabledef_pg(store, fbuf, 0, len);
|
||||
break;
|
||||
case 0x03:
|
||||
//gmdb_debug_dissect_dbpage(store, fbuf, 1, len);
|
||||
gmdb_debug_dissect_index_pg(store, fbuf, 0, len);
|
||||
break;
|
||||
case 0x04:
|
||||
gmdb_debug_dissect_leaf_pg(store, fbuf, 0, len);
|
||||
@@ -623,9 +751,26 @@ void
|
||||
gmdb_debug_close_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkWidget *win;
|
||||
|
||||
debug_list = g_list_remove(debug_list, xml);
|
||||
win = glade_xml_get_widget (xml, "debug_window");
|
||||
if (win) gtk_widget_destroy(win);
|
||||
return FALSE;
|
||||
}
|
||||
void
|
||||
gmdb_debug_close_all()
|
||||
{
|
||||
GladeXML *xml;
|
||||
GtkWidget *win;
|
||||
|
||||
while (xml = g_list_nth_data(debug_list, 0)) {
|
||||
printf("fetching %ld from list\n", xml);
|
||||
win = glade_xml_get_widget (xml, "debug_window");
|
||||
debug_list = g_list_remove(debug_list, xml);
|
||||
if (win) gtk_widget_destroy(win);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gmdb_debug_new_cb(GtkWidget *w, gpointer *data)
|
||||
{
|
||||
@@ -633,12 +778,15 @@ GtkTextView *textview;
|
||||
guint32 page;
|
||||
GtkWidget *entry, *mi, *button, *debugwin;
|
||||
gchar text[20];
|
||||
GladeXML *debugwin_xml;
|
||||
|
||||
/* load the interface */
|
||||
debugwin_xml = glade_xml_new("gladefiles/gmdb-debug.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(debugwin_xml);
|
||||
|
||||
debug_list = g_list_append(debug_list, debugwin_xml);
|
||||
|
||||
/* set signals with user data, anyone know how to do this in glade? */
|
||||
entry = glade_xml_get_widget (debugwin_xml, "debug_entry");
|
||||
g_signal_connect (G_OBJECT (entry), "activate",
|
||||
@@ -647,7 +795,22 @@ gchar text[20];
|
||||
mi = glade_xml_get_widget (debugwin_xml, "close_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_debug_close_cb), debugwin_xml);
|
||||
|
||||
button = glade_xml_get_widget (debugwin_xml, "close_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (gmdb_debug_close_cb), debugwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (debugwin_xml, "menu_page");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_debug_jump_cb), debugwin_xml);
|
||||
mi = glade_xml_get_widget (debugwin_xml, "menu_page_msb");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_debug_jump_msb_cb), debugwin_xml);
|
||||
|
||||
button = glade_xml_get_widget (debugwin_xml, "jump_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (gmdb_debug_jump_cb), debugwin_xml);
|
||||
|
||||
button = glade_xml_get_widget (debugwin_xml, "debug_button");
|
||||
g_signal_connect (G_OBJECT (button), "clicked",
|
||||
G_CALLBACK (gmdb_debug_display_cb), debugwin_xml);
|
||||
|
||||
@@ -156,4 +156,6 @@ void
|
||||
gmdb_file_close_cb(GtkWidget *button, gpointer data)
|
||||
{
|
||||
gmdb_reset_widgets();
|
||||
gmdb_debug_close_all();
|
||||
gmdb_sql_close_all();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,22 @@
|
||||
<child>
|
||||
<widget class="GtkMenu" id="file1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="new1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_NEW_ITEM</property>
|
||||
<property name="label" translatable="yes">_New</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="gmdb_debug_new_cb" last_modification_time="Fri, 03 Jan 2003 13:11:43 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="separator1">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="close_menu">
|
||||
<property name="visible">True</property>
|
||||
@@ -48,6 +64,58 @@
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="view1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_VIEW_TREE</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenu" id="view1_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="menu_back">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Back</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_forward">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_NEW_ITEM</property>
|
||||
<property name="label" translatable="yes">_Forward</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu_forward_activate" last_modification_time="Fri, 03 Jan 2003 15:27:51 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="separator2">
|
||||
<property name="visible">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="menu_page">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Selected Page</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="menu_page_msb">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Selected Page (_MSB)</property>
|
||||
<property name="use_underline">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkMenuItem" id="help1">
|
||||
<property name="visible">True</property>
|
||||
@@ -60,7 +128,7 @@
|
||||
<widget class="GtkImageMenuItem" id="about1">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock_item">GNOMEUIINFO_MENU_ABOUT_ITEM</property>
|
||||
<signal name="activate" handler="gmdb_about_cb" last_modification_time="Sat, 21 Dec 2002 18:17:10 GMT"/>
|
||||
<signal name="activate" handler="gmdb_about_cb" last_modification_time="Fri, 03 Jan 2003 13:11:09 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
@@ -79,6 +147,80 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="BonoboDockItem" id="bonobodockitem2">
|
||||
<property name="visible">True</property>
|
||||
<property name="shadow_type">GTK_SHADOW_OUT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkToolbar" id="toolbar1">
|
||||
<property name="border_width">1</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
|
||||
<property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
|
||||
<property name="tooltips">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="button4">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-new</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="clicked" handler="gmdb_debug_new_cb" last_modification_time="Fri, 03 Jan 2003 13:12:52 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="back_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">New File</property>
|
||||
<property name="label">gtk-go-back</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="new_group">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="forward_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Open File</property>
|
||||
<property name="label">gtk-go-forward</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="jump_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-jump-to</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="button" id="close_button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Save File</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="new_group">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="placement">BONOBO_DOCK_TOP</property>
|
||||
<property name="band">1</property>
|
||||
<property name="position">0</property>
|
||||
<property name="offset">0</property>
|
||||
<property name="behavior">BONOBO_DOCK_ITEM_BEH_EXCLUSIVE</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
@@ -87,20 +229,19 @@
|
||||
|
||||
<child>
|
||||
<widget class="GtkFrame" id="frame1">
|
||||
<property name="border_width">8</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="label_xalign">0</property>
|
||||
<property name="label_yalign">0.5</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox3">
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">12</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label3">
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page Number</property>
|
||||
<property name="use_underline">False</property>
|
||||
@@ -185,10 +326,35 @@
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
<widget class="GtkHPaned" id="hpaned1">
|
||||
<property name="visible">True</property>
|
||||
<property name="homogeneous">False</property>
|
||||
<property name="spacing">0</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="debug_treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow2">
|
||||
@@ -200,82 +366,26 @@
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkViewport" id="viewport1">
|
||||
<widget class="GtkTextView" id="debug_textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="shadow_type">GTK_SHADOW_IN</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHPaned" id="hpaned1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTreeView" id="debug_treeview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="headers_visible">False</property>
|
||||
<property name="rules_hint">False</property>
|
||||
<property name="reorderable">False</property>
|
||||
<property name="enable_search">True</property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkScrolledWindow" id="scrolledwindow4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
|
||||
<property name="shadow_type">GTK_SHADOW_NONE</property>
|
||||
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkTextView" id="debug_textview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap_mode">GTK_WRAP_NONE</property>
|
||||
<property name="cursor_visible">True</property>
|
||||
<property name="pixels_above_lines">0</property>
|
||||
<property name="pixels_below_lines">0</property>
|
||||
<property name="pixels_inside_wrap">0</property>
|
||||
<property name="left_margin">0</property>
|
||||
<property name="right_margin">0</property>
|
||||
<property name="indent">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="justification">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap_mode">GTK_WRAP_NONE</property>
|
||||
<property name="cursor_visible">True</property>
|
||||
<property name="pixels_above_lines">0</property>
|
||||
<property name="pixels_below_lines">0</property>
|
||||
<property name="pixels_inside_wrap">0</property>
|
||||
<property name="left_margin">0</property>
|
||||
<property name="right_margin">0</property>
|
||||
<property name="indent">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="shrink">True</property>
|
||||
<property name="resize">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
@@ -30,8 +30,7 @@ typedef struct GMdbSQLWindow {
|
||||
GList *history;
|
||||
} GMdbSQLWindow;
|
||||
|
||||
GList *window_list;
|
||||
GladeXML *sqlwin_xml;
|
||||
GList *sql_list;
|
||||
|
||||
extern GtkWidget *app;
|
||||
extern MdbHandle *mdb;
|
||||
@@ -39,20 +38,25 @@ extern MdbSQL *sql;
|
||||
|
||||
void gmdb_sql_tree_populate(MdbHandle *mdb, GladeXML *xml);
|
||||
|
||||
/* callbacks */
|
||||
#if 0
|
||||
gint
|
||||
gmdb_sql_close_cb(GtkList *list, GtkWidget *w, GMdbSQLWindow *sqlwin)
|
||||
void
|
||||
gmdb_sql_close_all()
|
||||
{
|
||||
window_list = g_list_remove(window_list, sql);
|
||||
g_free(sql);
|
||||
return FALSE;
|
||||
GladeXML *xml;
|
||||
GtkWidget *win;
|
||||
|
||||
while (xml = g_list_nth_data(sql_list, 0)) {
|
||||
win = glade_xml_get_widget (xml, "sql_window");
|
||||
sql_list = g_list_remove(sql_list, xml);
|
||||
if (win) gtk_widget_destroy(win);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* callbacks */
|
||||
void
|
||||
gmdb_sql_close_cb(GtkWidget *w, GladeXML *xml)
|
||||
{
|
||||
GtkWidget *win;
|
||||
sql_list = g_list_remove(sql_list, xml);
|
||||
win = glade_xml_get_widget (xml, "sql_window");
|
||||
if (win) gtk_widget_destroy(win);
|
||||
}
|
||||
@@ -71,7 +75,7 @@ GtkTreeStore *store;
|
||||
GtkTreeView *tree;
|
||||
GtkTreeIter *iter, iter2;
|
||||
|
||||
tree = (GtkTreeView *) glade_xml_get_widget(sqlwin_xml, "sql_treeview");
|
||||
tree = (GtkTreeView *) glade_xml_get_widget(xml, "sql_treeview");
|
||||
select = gtk_tree_view_get_selection(GTK_TREE_VIEW (tree));
|
||||
store = (GtkTreeStore *) gtk_tree_view_get_model(tree);
|
||||
gtk_tree_selection_get_selected (select, NULL, &iter2);
|
||||
@@ -221,12 +225,15 @@ gmdb_sql_new_cb(GtkWidget *w, gpointer data)
|
||||
{
|
||||
GtkTargetEntry src;
|
||||
GtkWidget *mi, *but;
|
||||
GladeXML *sqlwin_xml;
|
||||
|
||||
/* load the interface */
|
||||
sqlwin_xml = glade_xml_new("gladefiles/gmdb-sql.glade", NULL, NULL);
|
||||
/* connect the signals in the interface */
|
||||
glade_xml_signal_autoconnect(sqlwin_xml);
|
||||
|
||||
sql_list = g_list_append(sql_list, sqlwin_xml);
|
||||
|
||||
mi = glade_xml_get_widget (sqlwin_xml, "close_menu");
|
||||
g_signal_connect (G_OBJECT (mi), "activate",
|
||||
G_CALLBACK (gmdb_sql_close_cb), sqlwin_xml);
|
||||
@@ -290,7 +297,7 @@ int i;
|
||||
MdbCatalogEntry *entry;
|
||||
GtkTreeIter *iter1, *iter2;
|
||||
|
||||
GtkWidget *tree = glade_xml_get_widget(sqlwin_xml, "sql_treeview");
|
||||
GtkWidget *tree = glade_xml_get_widget(xml, "sql_treeview");
|
||||
GtkTreeStore *store = (GtkTreeStore *) gtk_tree_view_get_model(GTK_TREE_VIEW(tree));
|
||||
|
||||
/* loop over each entry in the catalog */
|
||||
|
||||
Reference in New Issue
Block a user