Commit eb668f50 authored by Jean Bréfort's avatar Jean Bréfort

Replace more GtkTable instances.

parent 7902455b
2011-12-27 Jean Brefort <jean.brefort@normalesup.org>
* src/sheet-object-image.c (gnm_soi_assign_to_sheet): fix image life time.
2011-12-25 Morten Welinder <terra@gnome.org>
* src/gutils.c (map_nonascii_digits): Map signs too. Terminate
......
2011-12-27 Jean Brefort <jean.brefort@normalesup.org>
* xlsx-read-drawing.c (xlsx_chart_text_start),
(xlsx_draw_text_run_props): always set a font size.
2011-11-30 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* xlsx-read-docprops.c (xlsx_read_core_keys): use G_VALUE_INIT
......
......@@ -69,6 +69,7 @@ xlsx_chart_text_start (GsfXMLIn *xin, G_GNUC_UNUSED xmlChar const **attrs)
if (!GOG_IS_LABEL (state->cur_obj) && IS_SHEET_OBJECT_GRAPH (state->so) && NULL == state->series) { /* Hmm, why? */
GogObject *label = gog_object_add_by_name (state->cur_obj,
(state->cur_obj == (GogObject *)state->chart) ? "Title" : "Label", NULL);
g_object_set (G_OBJECT (label), "allow-wrap", TRUE, "justification", "center", NULL);
xlsx_chart_push_obj (state, label);
}
}
......@@ -158,13 +159,13 @@ xlsx_draw_text_run_props (GsfXMLIn *xin, xmlChar const **attrs)
/* FIXME: this should be for a text run, not for the full object */
if (GO_IS_STYLED_OBJECT (state->cur_obj) && state->cur_style) {
PangoFontDescription *desc = pango_font_description_new ();
int size;
int size = 1000; /* seems 10*100 is the default */
GOFont const *font;
/* looks like the default font is Calibri, FIXME: import that from file instead */
pango_font_description_set_family (desc, "Calibri");
for (; attrs && *attrs; attrs += 2)
if (attr_int (xin, attrs, "sz", &size))
pango_font_description_set_size (desc, size * PANGO_SCALE / 100);
attr_int (xin, attrs, "sz", &size);
pango_font_description_set_size (desc, size * PANGO_SCALE / 100);
/* FIXME: don't set the size to the whole object, only to the run,
* anyway, this has to wait until we support rich text in chart labels */
font = go_font_new_by_desc (desc);
......
2011-12-27 Jean Brefort <jean.brefort@normalesup.org>
* cell-sort.ui: more GtkTable eradication.
* dao.ui: ditto.
* data-table.ui: ditto.
* delete-cells.ui: ditto.
* dialog-cell-sort.c (dialog_init): ditto.
* dialog-data-table.c (init_entry), (data_table_init): ditto.
2011-12-01 Morten Welinder <terra@gnome.org>
* Makefile.am (embedded-ui.c): use --id-prefix.
......
This diff is collapsed.
This diff is collapsed.
......@@ -19,6 +19,7 @@
<child>
<object class="GtkButton" id="help">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -35,6 +36,7 @@
<child>
<object class="GtkButton" id="cancel">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -51,6 +53,7 @@
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -73,14 +76,18 @@
</packing>
</child>
<child>
<object class="GtkTable" id="table">
<object class="GtkGrid" id="table-grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<property name="row_spacing">12</property>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<object class="GtkLabel" id="row-label">
<property name="visible">True</property>
......@@ -90,8 +97,10 @@
<property name="use_underline">True</property>
</object>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -103,18 +112,12 @@
<property name="use_underline">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">False</property>
......
......@@ -21,6 +21,7 @@
<child>
<object class="GtkButton" id="helpbutton">
<property name="label">gtk-help</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -37,6 +38,7 @@
<child>
<object class="GtkButton" id="cancelbutton">
<property name="label">gtk-cancel</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -53,6 +55,7 @@
<child>
<object class="GtkButton" id="okbutton">
<property name="label">gtk-ok</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
......@@ -76,127 +79,109 @@
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment1">
<object class="GtkGrid" id="delete-cells-grid">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xscale">0</property>
<property name="border_width">12</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkTable" id="table1">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">6</property>
<property name="row_spacing">6</property>
<child>
<object class="GtkRadioButton" id="radio_0">
<property name="label" translatable="yes">Shift cells _left</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_1">
<property name="label" translatable="yes">Shift cells _up</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_2">
<property name="label" translatable="yes">Delete _row(s)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_3">
<property name="label" translatable="yes">Delete _column(s)</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">4</property>
<property name="bottom_attach">5</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Delete Method&lt;/span&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="right_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">5</property>
<property name="x_options"></property>
<property name="y_options"></property>
</packing>
</child>
<property name="xalign">0</property>
<property name="label" translatable="yes">&lt;span weight="bold"&gt;Delete Method&lt;/span&gt;</property>
<property name="use_markup">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_0">
<property name="label" translatable="yes">Shift cells _left</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">12</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_1">
<property name="label" translatable="yes">Shift cells _up</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">12</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_2">
<property name="label" translatable="yes">Delete _row(s)</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">12</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkRadioButton" id="radio_3">
<property name="label" translatable="yes">Delete _column(s)</property>
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="margin_left">12</property>
<property name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">radio_0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
......
......@@ -951,23 +951,22 @@ cb_toggled_case_sensitive (GtkCellRendererToggle *cell,
static void
dialog_init (SortFlowState *state)
{
GtkTable *table;
GtkGrid *grid;
GtkWidget *scrolled;
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
gboolean col_rb;
GnmRange const *range;
table = GTK_TABLE (go_gtk_builder_get_widget (state->gui, "cell_sort_options_table"));
grid = GTK_GRID (go_gtk_builder_get_widget (state->gui, "cell-sort-grid"));
/* setup range entry */
state->range_entry = gnm_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->range_entry,
GNM_EE_SINGLE_RANGE,
GNM_EE_MASK);
gtk_table_attach (table, GTK_WIDGET (state->range_entry),
2, 3, 1, 2,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
gtk_widget_set_hexpand (GTK_WIDGET (state->range_entry), TRUE);
gtk_grid_attach (grid, GTK_WIDGET (state->range_entry),
1, 1, 2, 1);
gnumeric_editable_enters (GTK_WINDOW (state->dialog),
GTK_WIDGET (state->range_entry));
gnm_expr_entry_set_update_policy (state->range_entry, GNM_UPDATE_DISCONTINUOUS);
......@@ -977,22 +976,20 @@ dialog_init (SortFlowState *state)
G_CALLBACK (cb_update_to_new_range), state);
state->locale_selector = GO_LOCALE_SEL (go_locale_sel_new ());
gtk_widget_set_hexpand (GTK_WIDGET (state->locale_selector), TRUE);
gtk_widget_show_all (GTK_WIDGET (state->locale_selector));
gtk_table_attach (table, GTK_WIDGET (state->locale_selector),
2, 3, 5, 6,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
gtk_grid_attach (grid, GTK_WIDGET (state->locale_selector),
1, 5, 2, 1);
table = GTK_TABLE (go_gtk_builder_get_widget (state->gui, "cell_sort_spec_table"));
grid = GTK_GRID (go_gtk_builder_get_widget (state->gui, "cell-sort-spec-grid"));
/* setup add entry */
state->add_entry = gnm_expr_entry_new (state->wbcg, TRUE);
gnm_expr_entry_set_flags (state->add_entry,
GNM_EE_SINGLE_RANGE,
GNM_EE_MASK);
gtk_table_attach (table, GTK_WIDGET (state->add_entry),
1, 2, 2, 3,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
gtk_widget_set_hexpand (GTK_WIDGET (state->add_entry), TRUE);
gtk_grid_attach (grid, GTK_WIDGET (state->add_entry),
0, 5, 1, 1);
gnumeric_editable_enters (GTK_WINDOW (state->dialog),
GTK_WIDGET (state->add_entry));
gtk_widget_show (GTK_WIDGET (state->add_entry));
......@@ -1013,7 +1010,7 @@ dialog_init (SortFlowState *state)
G_CALLBACK (cb_sort_selection_changed), state);
state->header_column = gtk_tree_view_column_new_with_attributes (_("Header"),
gtk_cell_renderer_text_new (),
gtk_cell_renderer_text_new (),
"text", ITEM_HEADER, NULL);
gtk_tree_view_append_column (state->treeview, state->header_column);
......
......@@ -63,16 +63,15 @@ static GnmExprEntry *
init_entry (GnmDialogDataTable *state, int row)
{
GnmExprEntry *gee = gnm_expr_entry_new (state->wbcg, TRUE);
GtkWidget *table = go_gtk_builder_get_widget (state->gui, "table");
GtkWidget *grid = go_gtk_builder_get_widget (state->gui, "table-grid");
g_return_val_if_fail (table != NULL, NULL);
g_return_val_if_fail (grid != NULL, NULL);
gnm_expr_entry_set_flags (gee,
GNM_EE_SINGLE_RANGE | GNM_EE_SHEET_OPTIONAL | GNM_EE_FORCE_REL_REF,
GNM_EE_MASK);
g_object_set (G_OBJECT (gee), "with-icon", TRUE, NULL);
gtk_table_attach (GTK_TABLE (table), GTK_WIDGET (gee), 1, 2,
row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
gtk_grid_attach (GTK_GRID (grid), GTK_WIDGET (gee), 1, row, 1, 1);
return gee;
}
......@@ -92,14 +91,11 @@ cb_data_table_response (GtkWidget *dialog, gint response_id, GnmDialogDataTable
static gboolean
data_table_init (GnmDialogDataTable *state, WBCGtk *wbcg)
{
GtkTable *table;
state->gui = gnm_gtk_builder_new ("data-table.ui", NULL, GO_CMD_CONTEXT (wbcg));
if (state->gui == NULL)
return TRUE;
state->dialog = go_gtk_builder_get_widget (state->gui, "DataTable");
table = GTK_TABLE (go_gtk_builder_get_widget (state->gui, "table"));
state->row_entry = init_entry (state, 0);
state->col_entry = init_entry (state, 1);
......
......@@ -541,7 +541,7 @@ gnm_soi_assign_to_sheet (SheetObject *so, Sheet *sheet)
GOImage *image = go_doc_add_image (doc, NULL, soi->image);
if (soi->image != image) {
g_object_unref (soi->image);
soi->image = image;
soi->image = g_object_ref (image);
}
} else if (soi->name) {
GODoc *doc = GO_DOC (sheet->workbook);
......
2011-12-27 Jean Brefort <jean.brefort@normalesup.org>
* gnm-dao.c (gnm_dao_init), (gnm_dao_new): don't use GtkTable anymore.
2011-11-30 Andreas J. Guelzow <aguelzow@pyrshep.ca>
* gnumeric-expr-entry.c (cb_icon_clicked): use G_VALUE_INIT;
......
......@@ -69,13 +69,12 @@ static void
gnm_dao_init (GnmDao *gdao)
{
GtkWidget *toplevel;
GtkWidget *old_parent;
gdao->gui = gnm_gtk_builder_new ("dao.ui", NULL, NULL);
if (gdao->gui == NULL)
return;
toplevel = go_gtk_builder_get_widget (gdao->gui, "dao_box");
toplevel = go_gtk_builder_get_widget (gdao->gui, "output-grid");
gdao->new_sheet = go_gtk_builder_get_widget (gdao->gui,
"newsheet-button");
......@@ -98,10 +97,8 @@ gnm_dao_init (GnmDao *gdao)
gdao->output_entry = NULL;
gdao->wbcg = NULL;
old_parent = gtk_widget_get_toplevel (toplevel);
gtk_widget_reparent (toplevel, GTK_WIDGET (gdao));
gtk_widget_destroy (old_parent);
gtk_widget_queue_resize (toplevel);
gtk_container_add (GTK_CONTAINER (gdao), toplevel);
// gtk_widget_queue_resize (toplevel);
}
static void
......@@ -232,20 +229,19 @@ GtkWidget *
gnm_dao_new (WBCGtk *wbcg, gchar *inplace_str)
{
GnmDao *gdao = GNM_DAO (g_object_new (GNM_DAO_TYPE, NULL));
GtkTable *table;
GtkGrid *grid;
g_return_val_if_fail (wbcg != NULL, NULL);
gdao->wbcg = wbcg;
/* Create the output range expression entry */
table = GTK_TABLE (go_gtk_builder_get_widget (gdao->gui, "output-table"));
grid = GTK_GRID (go_gtk_builder_get_widget (gdao->gui, "output-grid"));
gdao->output_entry = gnm_expr_entry_new (wbcg, TRUE);
gnm_expr_entry_set_flags (gdao->output_entry,
GNM_EE_SINGLE_RANGE, GNM_EE_MASK);
gtk_table_attach (table, GTK_WIDGET (gdao->output_entry),
2, 3, 3, 4,
GTK_EXPAND | GTK_FILL, 0,
0, 0);
gtk_widget_set_hexpand (GTK_WIDGET (gdao->output_entry), TRUE);
gtk_grid_attach (grid, GTK_WIDGET (gdao->output_entry),
1, 3, 1, 1);
go_atk_setup_label (gdao->output_range,
GTK_WIDGET (gdao->output_entry));
gtk_widget_show (GTK_WIDGET (gdao->output_entry));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment