Commit ead38955 authored by JodyGoldberg's avatar JodyGoldberg Committed by Jody Goldberg
Browse files

The rest of the Maemo port. From eduardo.lima@indt.org.br


2005-11-14  Jody Goldberg <jody@gnome.org>

	The rest of the Maemo port.
	From eduardo.lima@indt.org.br
	http://bugzilla.gnome.org/show_bug.cgi?id=321073
	* src/Makefile.am
	* src/gnumeric-canvas.c
	* src/gui-file.c
	* src/item-grid.c
	* src/sheet-control-gui.c
	* src/wbc-gtk.c
	* src/wbcg-actions.c
	* src/workbook-control-gui-priv.h
	* src/workbook-control-gui.c : Merge the remaining Maemo/Hildon patches.

2005-11-14  Jody Goldberg <jody@gnome.org>

	* configure.in : bump goffice req to 0.1.2 to get morten's fix.
	  Add a < 0.2.0 to avoid problems when we branch.
	  Disable the DEPRECATED warnings in the stable release.
parent 958d2869
2005-11-14 Jody Goldberg <jody@gnome.org>
The rest of the Maemo port.
From eduardo.lima@indt.org.br
http://bugzilla.gnome.org/show_bug.cgi?id=321073
* src/Makefile.am
* src/gnumeric-canvas.c
* src/gui-file.c
* src/item-grid.c
* src/sheet-control-gui.c
* src/wbc-gtk.c
* src/wbcg-actions.c
* src/workbook-control-gui-priv.h
* src/workbook-control-gui.c : Merge the remaining Maemo/Hildon patches.
2005-11-14 Jody Goldberg <jody@gnome.org>
* configure.in : bump goffice req to 0.1.2 to get morten's fix.
Add a < 0.2.0 to avoid problems when we branch.
Disable the DEPRECATED warnings in the stable release.
2005-11-13 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (cb_hscrollbar_adjust_bounds) : we weren't
extending while at the very top.
(cb_vscrollbar_adjust_bounds) : ditto.
2005-11-13 Jean Brefort <jean.brefort@normalesup.org>
* src/gnumeric-canvas.c: (gnm_canvas_key_press),
......
2005-11-14 Jody Goldberg <jody@gnome.org>
The rest of the Maemo port.
From eduardo.lima@indt.org.br
http://bugzilla.gnome.org/show_bug.cgi?id=321073
* src/Makefile.am
* src/gnumeric-canvas.c
* src/gui-file.c
* src/item-grid.c
* src/sheet-control-gui.c
* src/wbc-gtk.c
* src/wbcg-actions.c
* src/workbook-control-gui-priv.h
* src/workbook-control-gui.c : Merge the remaining Maemo/Hildon patches.
2005-11-14 Jody Goldberg <jody@gnome.org>
* configure.in : bump goffice req to 0.1.2 to get morten's fix.
Add a < 0.2.0 to avoid problems when we branch.
Disable the DEPRECATED warnings in the stable release.
2005-11-13 Jody Goldberg <jody@gnome.org>
* src/sheet-control-gui.c (cb_hscrollbar_adjust_bounds) : we weren't
extending while at the very top.
(cb_vscrollbar_adjust_bounds) : ditto.
2005-11-13 Jean Brefort <jean.brefort@normalesup.org>
* src/gnumeric-canvas.c: (gnm_canvas_key_press),
......
......@@ -19,7 +19,8 @@ You need: Debian package name
libgnomeprint >= 2.8.2 libgnomeprint2.2-dev
libgnomeprintui >= 2.8.2 libgnomeprintui2.2-dev
libgsf >= 1.13.2 libgsf-1-dev
libGOffice >= 0.1.1 libgoffice-1-dev
libgoffice >= 0.1.2 libgoffice-1-dev
libgoffice < 0.2.0 libgoffice-1-dev (0.2.x is for 1.7.x)
libglade >= 2.3.6 libglade2-dev
gnome-xml >= 2.4.12 libxml2-dev
libart >= 2.3.11 libart-2.0-dev
......
......@@ -116,7 +116,8 @@ gnumeric_reqs="
gobject-2.0 >= 2.6.0
gmodule-2.0 >= 2.6.0
libgsf-1 >= 1.13.2
libgoffice-1 >= 0.1.1
libgoffice-1 >= 0.1.2
libgoffice-1 < 0.2.0
libxml-2.0 >= 2.4.12
pango >= 1.8.1
pangoft2 >= 1.8.1
......@@ -210,20 +211,20 @@ GNUMERIC_PLUGIN_LDFLAGS="-avoid-version $GNUMERIC_PLUGIN_LDFLAGS"
AC_SUBST(GNUMERIC_PLUGIN_LDFLAGS)
dnl disable for in stable release, re-enable for development series
CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DPANGO_DISABLE_DEPRECATED"
if test "x$gnumeric_with_gtk" = "xtrue"; then
CFLAGS="$CFLAGS -DGDK_PIXBUF_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DGDK_MULTIHEAD_SAFE"
CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DLIBGLADE_DISABLE_DEPRECATED"
fi
if test "x$gnumeric_with_gnome" = "xtrue"; then
CFLAGS="$CFLAGS -DGNOME_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DBONOBO_DISABLE_DEPRECATED"
CFLAGS="$CFLAGS -DBONOBO_UI_DISABLE_DEPRECATED"
fi
dnl CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DPANGO_DISABLE_DEPRECATED"
dnl if test "x$gnumeric_with_gtk" = "xtrue"; then
dnl CFLAGS="$CFLAGS -DGDK_PIXBUF_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DGDK_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DGDK_MULTIHEAD_SAFE"
dnl CFLAGS="$CFLAGS -DGTK_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DLIBGLADE_DISABLE_DEPRECATED"
dnl fi
dnl if test "x$gnumeric_with_gnome" = "xtrue"; then
dnl CFLAGS="$CFLAGS -DGNOME_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DBONOBO_DISABLE_DEPRECATED"
dnl CFLAGS="$CFLAGS -DBONOBO_UI_DISABLE_DEPRECATED"
dnl fi
# CHECK HILDON
# -------------------------
......@@ -236,7 +237,8 @@ hildon=false
HILDON_CFLAGS=""
HILDON_LIBS=""
AC_ARG_ENABLE(hildon,[ --enable-hildon Turn on hildon ],[
AC_ARG_ENABLE(hildon,
AC_HELP_STRING([--enable-hildon],[Compile with hildon support]),[
if test "x$enableval" = "xyes"; then
hildon=true
fi
......
......@@ -390,29 +390,33 @@ uninstall-hook:
# include conditional files to ensure everything gets distributed no matter
# what the build
EXTRA_DIST = GNOME_Gnumeric-gtk.xml.in \
main-component.c \
$(GNUMERIC_GNOME) README.gnm_float \
EXTRA_DIST = main-component.c \
$(GNUMERIC_GNOME) README.gnm_float \
gnumeric.rc gnm-i18n.h
gtkactiondir=$(gnumeric_datadir)
if USE_HILDON
gtkaction_DATA = GNOME_Gnumeric-gtk.xml
GNOME_Gnumeric-gtk.xml: GNOME_Gnumeric-gtk.xml.in
sed -e 's/ _name *=/ name=/' <$< >$@
EXTRA_DIST += GNOME_Gnumeric-gtk.xml.in
DISTCLEANFILES = GNOME_Gnumeric-gtk.xml
else
gtkaction_DATA = HILDON_Gnumeric-gtk.xml
HILDON_Gnumeric-gtk.xml: HILDON_Gnumeric-gtk.xml.in
sed -e 's/ _name *=/ name=/' <$< >$@
EXTRA_DIST += HILDON_Gnumeric-gtk.xml.in
DISTCLEANFILES = HILDON_Gnumeric-gtk.xml
endif
##check_PROGRAMS += number-match
##number_match_SOURCES = number-match.c formats.c dates.c number-match-test.c
##number_match_LDADD = \
## $(GNOME_LIBDIR) \
## $(GNOMEUI_LIBS) \
## $(GNOME_XML_LIB) \
## $(INTLLIBS)
gtkactiondir=$(gnumeric_datadir)
gtkaction_DATA = GNOME_Gnumeric-gtk.xml
GNOME_Gnumeric-gtk.xml: GNOME_Gnumeric-gtk.xml.in
sed -e 's/ _name *=/ name=/' <$< >$@
## Bonobo requires things to be in a subdir of this form
##bonobo_component_uidir=$(gnumeric_datadir)/gnome-2.0/ui
##bonobo_component_ui_DATA = GNOME_Gnumeric.xml GNOME_Gnumeric_Component.xml
......
......@@ -1927,6 +1927,27 @@ fmt_dialog_init_input_msg_page (FormatState *state)
static void
cb_fmt_dialog_dialog_buttons (GtkWidget *btn, FormatState *state)
{
#if 0
static StyleBorderLocation const bmap_ltr[] = {
STYLE_BORDER_TOP, STYLE_BORDER_BOTTOM,
STYLE_BORDER_LEFT, STYLE_BORDER_RIGHT,
STYLE_BORDER_REV_DIAG, STYLE_BORDER_DIAG,
STYLE_BORDER_HORIZ, STYLE_BORDER_VERT
};
static StyleBorderLocation const bmap_rtl[] = {
STYLE_BORDER_TOP, STYLE_BORDER_BOTTOM,
/* reverse */
STYLE_BORDER_RIGHT, STYLE_BORDER_LEFT,
/* reverse */
STYLE_BORDER_DIAG, STYLE_BORDER_REV_DIAG,
STYLE_BORDER_HORIZ, STYLE_BORDER_VERT
};
StyleBorderLocation const *bmap = bmap_ltr;
if (NULL != state->sheet && state->sheet->text_is_rtl)
bmap = bmap_rtl;
#endif
if (btn == state->apply_button || btn == state->ok_button) {
GnmBorder *borders[STYLE_BORDER_EDGE_MAX];
int i;
......@@ -1965,7 +1986,7 @@ cb_fmt_dialog_dialog_buttons (GtkWidget *btn, FormatState *state)
borders[i] = border_get_mstyle (state, i);
cmd_selection_format (WORKBOOK_CONTROL (state->wbcg),
state->result, borders, NULL);
state->result, borders, NULL);
gnm_style_unref (state->result);
sheet_update (state->sheet);
......
......@@ -5,6 +5,10 @@
* Author:
* Miguel de Icaza (miguel@kernel.org)
* Jody Goldberg (jody@gnome.org)
*
* Port to Maemo:
* Eduardo Lima (eduardo.lima@indt.org.br)
* Renato Araujo (renato.filho@indt.org.br)
*/
#include <gnumeric-config.h>
#include <glib/gi18n.h>
......@@ -505,7 +509,9 @@ gnm_canvas_key_release (GtkWidget *widget, GdkEventKey *event)
static gint
gnm_canvas_focus_in (GtkWidget *widget, GdkEventFocus *event)
{
#ifndef USE_HILDON
gtk_im_context_focus_in (GNM_CANVAS (widget)->im_context);
#endif
return (*GTK_WIDGET_CLASS (parent_klass)->focus_in_event) (widget, event);
}
......
......@@ -6,6 +6,10 @@
* Jon K Hellan (hellan@acm.org)
* Zbigniew Chyla (cyba@gnome.pl)
* Andreas J. Guelzow (aguelzow@taliesin.ca)
*
* Port to Maemo:
* Eduardo Lima (eduardo.lima@indt.org.br)
* Renato Araujo (renato.filho@indt.org.br)
*/
#include <gnumeric-config.h>
#include <glib/gi18n.h>
......@@ -40,6 +44,12 @@
#include <errno.h>
#include <string.h>
#ifdef USE_HILDON
#include <hildon-lgpl/hildon-widgets/hildon-app.h>
#include <hildon-lgpl/hildon-widgets/hildon-appview.h>
#include <hildon-fm/hildon-widgets/hildon-file-chooser-dialog.h>
#endif
typedef struct {
GOCharmapSel *go_charmap_sel;
GtkWidget *charmap_label;
......@@ -95,6 +105,30 @@ gui_wb_view_show (WorkbookControlGUI *wbcg, WorkbookView *wbv)
WorkbookControlGUI *new_wbcg = NULL;
Workbook *tmp_wb = wb_control_workbook (WORKBOOK_CONTROL (wbcg));
#ifdef USE_HILDON
if (workbook_is_dirty (tmp_wb)) {
switch (wbcg_show_save_dialog (wbcg, tmp_wb, FALSE)) {
case GTK_RESPONSE_YES:
case GNM_RESPONSE_SAVE_ALL:
gui_file_save (wbcg, wb_control_view (WORKBOOK_CONTROL (wbcg)));
break;
case GTK_RESPONSE_NO:
case GNM_RESPONSE_DISCARD_ALL:
/* Do nothing */
break;
default: /* CANCEL */
return;
}
}
g_object_ref (wbcg);
g_object_unref (tmp_wb);
wb_control_set_view (WORKBOOK_CONTROL (wbcg), wbv, NULL);
wb_control_init_state (WORKBOOK_CONTROL (wbcg));
#else
if (workbook_is_pristine (tmp_wb)) {
g_object_ref (wbcg);
g_object_unref (tmp_wb);
......@@ -109,6 +143,7 @@ gui_wb_view_show (WorkbookControlGUI *wbcg, WorkbookView *wbv)
wbcg_copy_toolbar_visibility (new_wbcg, wbcg);
}
#endif
sheet_update (wb_view_cur_sheet (wbv));
}
......@@ -214,6 +249,9 @@ gui_file_open (WorkbookControlGUI *wbcg, char const *default_format)
gtk_widget_set_sensitive (GTK_WIDGET (format_combo), opener_default == 0);
file_format_changed_cb (format_combo, &data);
#ifdef USE_HILDON
fsel = GTK_FILE_CHOOSER (hildon_file_chooser_dialog_new (wbcg_toplevel (wbcg), GTK_FILE_CHOOSER_ACTION_OPEN));
#else
fsel = GTK_FILE_CHOOSER
(g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG,
"action", GTK_FILE_CHOOSER_ACTION_OPEN,
......@@ -224,6 +262,7 @@ gui_file_open (WorkbookControlGUI *wbcg, char const *default_format)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK,
NULL);
#endif
gtk_dialog_set_default_response (GTK_DIALOG (fsel), GTK_RESPONSE_OK);
/* Add Templates bookmark */
......@@ -357,6 +396,9 @@ gui_file_save_as (WorkbookControlGUI *wbcg, WorkbookView *wb_view)
}
savers = g_list_sort (savers, file_saver_description_cmp);
#ifdef USE_HILDON
fsel = GTK_FILE_CHOOSER (hildon_file_chooser_dialog_new (wbcg_toplevel (wbcg), GTK_FILE_CHOOSER_ACTION_SAVE));
#else
fsel = GTK_FILE_CHOOSER
(g_object_new (GTK_TYPE_FILE_CHOOSER_DIALOG,
"action", GTK_FILE_CHOOSER_ACTION_SAVE,
......@@ -367,6 +409,8 @@ gui_file_save_as (WorkbookControlGUI *wbcg, WorkbookView *wb_view)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK,
NULL);
#endif
gtk_dialog_set_default_response (GTK_DIALOG (fsel), GTK_RESPONSE_OK);
/* Filters */
......
......@@ -7,6 +7,10 @@
* Authors:
* Miguel de Icaza (miguel@kernel.org)
* Jody Goldberg (jody@gnome.org)
*
* Port to Maemo:
* Eduardo Lima (eduardo.lima@indt.org.br)
* Renato Araujo (renato.filho@indt.org.br)
*/
#include <gnumeric-config.h>
......@@ -892,8 +896,12 @@ item_grid_button_press (ItemGrid *ig, GdkEventButton *event)
NULL);
if ((ig->last_click_time + double_click_time) > event->time &&
wbcg_edit_start (scg->wbcg, FALSE, FALSE))
wbcg_edit_start (scg->wbcg, FALSE, FALSE)) {
#ifdef USE_HILDON
gtk_im_context_focus_in (GNM_CANVAS (canvas)->im_context);
#endif
break;
}
}
ig->last_click_time = event->time;
......
......@@ -591,8 +591,8 @@ static void
cb_hscrollbar_adjust_bounds (GtkRange *range, gdouble new_value)
{
gdouble limit = range->adjustment->upper - range->adjustment->page_size;
if (range->adjustment->upper < SHEET_MAX_COLS && new_value > limit) {
range->adjustment->upper = new_value + range->adjustment->page_size;
if (range->adjustment->upper < SHEET_MAX_COLS && new_value >= limit) {
range->adjustment->upper = new_value + range->adjustment->page_size + 1;
if (range->adjustment->upper > SHEET_MAX_COLS)
range->adjustment->upper = SHEET_MAX_COLS;
gtk_adjustment_changed (range->adjustment);
......@@ -602,8 +602,8 @@ static void
cb_vscrollbar_adjust_bounds (GtkRange *range, gdouble new_value)
{
gdouble limit = range->adjustment->upper - range->adjustment->page_size;
if (range->adjustment->upper < SHEET_MAX_ROWS && new_value > limit) {
range->adjustment->upper = new_value + range->adjustment->page_size;
if (range->adjustment->upper < SHEET_MAX_ROWS && new_value >= limit) {
range->adjustment->upper = new_value + range->adjustment->page_size + 1;
if (range->adjustment->upper > SHEET_MAX_ROWS)
range->adjustment->upper = SHEET_MAX_ROWS;
gtk_adjustment_changed (range->adjustment);
......
......@@ -34,8 +34,9 @@ typedef enum {
} StyleBorderType;
/* The order corresponds to the border_buttons name list
* in dialog_cell_format_impl */
typedef enum _StyleBorderLocation {
* in dialog_cell_format_impl
* STYLE_BORDER_TOP must be 0 */
typedef enum {
STYLE_BORDER_TOP, STYLE_BORDER_BOTTOM,
STYLE_BORDER_LEFT, STYLE_BORDER_RIGHT,
STYLE_BORDER_REV_DIAG, STYLE_BORDER_DIAG,
......@@ -61,12 +62,12 @@ struct _GnmBorder {
gint ref_count;
};
void style_border_unref (GnmBorder *border);
void style_border_unref (GnmBorder *border);
GnmBorder *style_border_ref (GnmBorder *border);
#define style_border_is_blank(b) ((b) == NULL || (b)->line_type == STYLE_BORDER_NONE)
GnmBorder *style_border_none (void);
void style_border_none_set_color (GnmColor *color);
void style_border_none_set_color (GnmColor *color);
GnmBorder *style_border_fetch (StyleBorderType const line_type,
GnmColor *color,
......
......@@ -18,6 +18,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*
* Port to Maemo:
* Eduardo Lima (eduardo.lima@indt.org.br)
* Renato Araujo (renato.filho@indt.org.br)
*/
#include <gnumeric-config.h>
#include "gnumeric.h"
......@@ -60,6 +64,14 @@
#include <errno.h>
#include <string.h>
#ifdef USE_HILDON
#include <gtk/gtktable.h>
#include <gtk/gtktoolbutton.h>
#include <goffice/gtk/go-combo-text.h>
#include <hildon-lgpl/hildon-widgets/hildon-app.h>
#include <hildon-lgpl/hildon-widgets/hildon-appview.h>
#endif
#define CHECK_MENU_UNDERLINES
struct _WBCgtk {
......@@ -171,7 +183,11 @@ wbc_gtk_init_zoom (WBCgtk *gtk)
"name", "Zoom",
"label", _("_Zoom"),
NULL);
#ifdef USE_HILDON
go_action_combo_text_set_width (gtk->zoom, "100000000%");
#else
go_action_combo_text_set_width (gtk->zoom, "10000%");
#endif
for (i = 0; preset_zoom[i] != NULL ; ++i)
go_action_combo_text_add_item (gtk->zoom, preset_zoom[i]);
......@@ -423,8 +439,13 @@ create_undo_redo (WBCgtk *gtk, char const *name, char const *tooltip,
"stock-id", stock_id,
"sensitive", FALSE,
NULL);
#ifdef USE_HILDON
gtk_action_group_add_action (gtk->actions, GTK_ACTION (res));
#else
gtk_action_group_add_action_with_accel (gtk->actions,
GTK_ACTION (res), accel);
#endif
return res;
}
......@@ -803,11 +824,38 @@ wbc_gtk_set_action_label (WorkbookControlGUI const *wbcg,
gboolean sensitive = TRUE;
if (suffix == NULL) {
#ifndef USE_HILDON
suffix = _("Nothing");
#endif
sensitive = FALSE;
}
#ifdef USE_HILDON
text = g_strdup (prefix);
{
/* Set hildon toolbuttons (in)sensitive */
GtkToolbar * toolbar = hildon_appview_get_toolbar (HILDON_APPVIEW (wbcg->toplevel));
GList * l;
for (l = gtk_container_get_children (GTK_CONTAINER (toolbar)); l; l = l->next) {
if (GTK_IS_TOOL_BUTTON (l->data)) {
gchar * label;
g_object_get (l->data, "label", &label, NULL);
if (strstr (label, action) != NULL) {
g_object_set (G_OBJECT (l->data), "sensitive", sensitive, NULL);
g_free(label);
break;
}
g_free(label);
}
}
}
#else
text = g_strdup_printf ("%s : %s", prefix, suffix);
#endif
g_object_set (G_OBJECT (a),
"label", text,
"sensitive", sensitive,
......@@ -1209,9 +1257,18 @@ cb_add_menus_toolbars (G_GNUC_UNUSED GtkUIManager *ui,
{
if (GTK_IS_TOOLBAR (w)) {
WorkbookControlGUI *wbcg = (WorkbookControlGUI *)gtk;
char const *name = gtk_widget_get_name (w);
#ifdef USE_HILDON
if (0 == strcmp (name, "HildonToolbar")) {
hildon_appview_set_toolbar (HILDON_APPVIEW (wbcg->toplevel), GTK_TOOLBAR (w));
gtk_widget_show_all (w);
} else if (0 == strcmp (name, "HildonTopToolbar")) {
gtk_table_attach (GTK_TABLE (wbcg->table), w, 1, 2, 0, 1,
GTK_FILL | GTK_EXPAND , 0, 0, 0);
}
#else
GtkWidget *box = gtk_handle_box_new ();
GtkToggleActionEntry entry;
char const *name = gtk_widget_get_name (w);
char *toggle_name = g_strdup_printf ("ViewMenuToolbar%s", name);
char *tooltip = g_strdup_printf (_("Show/Hide toolbar %s"), _(name));
gboolean visible = gnm_gconf_get_toolbar_visible (name);
......@@ -1256,6 +1313,7 @@ cb_add_menus_toolbars (G_GNUC_UNUSED GtkUIManager *ui,
g_free (tooltip);
g_free (toggle_name);
#endif
} else {
gtk_box_pack_start (GTK_BOX (gtk->menu_zone), w, FALSE, TRUE, 0);
gtk_widget_show_all (w);
......@@ -1378,20 +1436,31 @@ wbc_gtk_init (GObject *obj)
unsigned i;
GError *error = NULL;
wbcg_set_toplevel (wbcg, gtk_window_new (GTK_WINDOW_TOPLEVEL));
g_signal_connect (wbcg->toplevel, "window_state_event",
G_CALLBACK (cb_wbcg_window_state_event),
wbcg);
gtk_window_set_title (wbcg->toplevel, "Gnumeric");
gtk_window_set_wmclass (wbcg->toplevel, "Gnumeric", "Gnumeric");
gtk->menu_zone = gtk_vbox_new (TRUE, 0);
gtk->toolbar_zone = gtk_vbox_new (FALSE, 0);
gtk->everything = gtk_vbox_new (FALSE, 0);
#ifdef USE_HILDON
{ GtkWidget *appview = hildon_appview_new ("Gnumeric");
wbcg->hildon_app = hildon_app_new_with_appview (HILDON_APPVIEW (appview));
wbcg_set_toplevel (wbcg, appview); }
#else
wbcg_set_toplevel (wbcg, gtk_window_new (GTK_WINDOW_TOPLEVEL));
g_signal_connect (wbcg_toplevel (wbcg), "window_state_event",
G_CALLBACK (cb_wbcg_window_state_event),
wbcg);
gtk_box_pack_start (GTK_BOX (gtk->everything),
gtk->menu_zone, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (gtk->everything),
gtk->toolbar_zone, FALSE, TRUE, 0);
#endif
gtk_window_set_title (wbcg_toplevel (wbcg), "Gnumeric");
gtk_window_set_wmclass (wbcg_toplevel (wbcg), "Gnumeric", "Gnumeric");
#ifdef USE_HILDON
gtk_widget_show_all (GTK_WIDGET (wbcg_toplevel (wbcg)));
#endif
#if 0
bonobo_dock_set_client_area (BONOBO_DOCK (gtk->dock), wbcg->table);
#endif
......@@ -1435,10 +1504,14 @@ wbc_gtk_init (GObject *obj)
gtk_ui_manager_insert_action_group (gtk->ui, gtk->permanent_actions, 0);
gtk_ui_manager_insert_action_group (gtk->ui, gtk->actions, 0);
gtk_ui_manager_insert_action_group (gtk->ui, gtk->font_actions, 0);
gtk_window_add_accel_group (wbcg->toplevel,
gtk_window_add_accel_group (wbcg_toplevel (wbcg),
gtk_ui_manager_get_accel_group (gtk->ui));
#ifdef USE_HILDON
uifile = g_build_filename (gnm_sys_data_dir (), "HILDON_Gnumeric-gtk.xml", NULL);
#else
uifile = g_build_filename (gnm_sys_data_dir (), "GNOME_Gnumeric-gtk.xml", NULL);
#endif
if (!gtk_ui_manager_add_ui_from_file (gtk->ui, uifile, &error)) {
g_message ("building menus failed: %s", error->message);
g_error_free (error);
......@@ -1469,6 +1542,20 @@ wbc_gtk_init (GObject *obj)
NULL);
gtk_ui_manager_ensure_update (gtk->ui);
#ifdef USE_HILDON
{
GtkWidget *hildonMenu = GTK_WIDGET (hildon_appview_get_menu (HILDON_APPVIEW (wbcg->toplevel)));
GList *list = gtk_container_get_children (GTK_CONTAINER (gtk->menu_zone));
for (list = gtk_container_get_children (GTK_CONTAINER (list->data)); list; list = list->next) {
gtk_widget_reparent (GTK_WIDGET (list->data), hildonMenu);
}
gtk_widget_show_all (GTK_WIDGET (hildonMenu));
}
#endif
gtk_container_add (GTK_CONTAINER (wbcg->toplevel), gtk->everything);
#ifdef CHECK_MENU_UNDERLINES
......
......@@ -18,6 +18,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*
* Port to Maemo:
* Eduardo Lima (eduardo.lima@indt.org.br)
* Renato Araujo (renato.filho@indt.org.br)
*/
#include <gnumeric-config.h>
#include "gnumeric.h"
......@@ -77,14 +81,51 @@
#include <gsf/gsf-input.h>
#include <string.h>
#ifdef USE_HILDON
#include <wbc-gtk.h>
#include <hildon-lgpl/hildon-widgets/hildon-appview.h>
#include <hildon-widgets/hildon-color-selector.h>
#include <hildon-widgets/hildon-font-selection-dialog.h>
#endif
static GNM_ACTION_DEF (cb_file_new)
{
GdkScreen *screen = gtk_window_get_screen (wbcg_toplevel (wbcg));
Workbook *wb = workbook_new_with_sheets
(gnm_app_prefs->initial_sheet_number);
#ifdef USE_HILDON
WorkbookControl * wbc = (WorkbookControl *) wbcg;
Workbook *tmp_wb = wb_control_workbook (WORKBOOK_CONTROL (wbcg));
if (workbook_is_dirty (tmp_wb)) {
switch (wbcg_show_save_dialog (wbcg, tmp_wb, FALSE)) {
case GTK_RESPONSE_YES:
case GNM_RESPONSE_SAVE_ALL:
gui_file_save (wbcg, wb_control_view (WORKBOOK_CONTROL (wbcg)));
break;
case GTK_RESPONSE_NO:
case GNM_RESPONSE_DISCARD_ALL:
/* Do nothing */
break;