From 5638b0cacb7c695053840eab4ffaeda8075acdd4 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 20 May 2007 10:39:26 +0000 Subject: [PATCH] Retrieve paper orientation from page setup dialog and print dialog and transfer it to wxPrintData in GNOME print backend. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46130 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/gnome/gprint.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gtk/gnome/gprint.cpp b/src/gtk/gnome/gprint.cpp index 687a2dc24b..3d569001af 100644 --- a/src/gtk/gnome/gprint.cpp +++ b/src/gtk/gnome/gprint.cpp @@ -156,6 +156,9 @@ public: (GnomePrintConfig *config, const guchar *key, gboolean value), (config, key, value), false ) wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set_length, (GnomePrintConfig *config, const guchar *key, gdouble value, const GnomePrintUnit *unit), (config, key, value, unit), false ) + + wxDL_METHOD_DEFINE( guchar*, gnome_print_config_get, + (GnomePrintConfig *config, const guchar *key), (config, key), NULL ) wxDL_METHOD_DEFINE( gboolean, gnome_print_config_get_length, (GnomePrintConfig *config, const guchar *key, gdouble *val, const GnomePrintUnit **unit), (config, key, val, unit), false ) @@ -264,6 +267,8 @@ void wxGnomePrintLibrary::InitializeMethods() wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_double, success ) wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_int, success ) wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_length, success ) + + wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_get, success ) wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_get_length, success ) wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_print_dialog_new, success ) @@ -301,7 +306,13 @@ wxGnomePrintNativeData::~wxGnomePrintNativeData() bool wxGnomePrintNativeData::TransferTo( wxPrintData &data ) { - // TODO + guchar *res = gs_lgp->gnome_print_config_get( m_config, + (guchar*)(char*)GNOME_PRINT_KEY_PAGE_ORIENTATION ); + if (g_ascii_strcasecmp((const gchar *)res,"R90") == 0) + data.SetOrientation( wxLANDSCAPE ); + else + data.SetOrientation( wxPORTRAIT ); + g_free( res ); return true; } @@ -554,6 +565,8 @@ int wxGnomePrintDialog::ShowModal() return wxID_CANCEL; } + m_printDialogData.GetPrintData().ConvertFromNative(); + gint copies = 1; gboolean collate = false; gs_lgp->gnome_print_dialog_get_copies( (GnomePrintDialog*) m_widget, &copies, &collate ); @@ -696,6 +709,7 @@ int wxGnomePageSetupDialog::ShowModal() if (ret == GTK_RESPONSE_OK) { // Transfer data back to m_pageDialogData + m_pageDialogData.GetPrintData().ConvertFromNative(); // I don't know how querying the last parameter works double ml,mr,mt,mb,pw,ph;