more fixes to handling of the resolution chosen in GTK print dialog (patch 1864504)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -261,6 +261,14 @@ bool wxGtkPrintNativeData::TransferTo( wxPrintData &data )
|
|||||||
if(!m_config)
|
if(!m_config)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
int resolution = gtk_print_settings_get_resolution(m_config);
|
||||||
|
if ( resolution > 0 )
|
||||||
|
{
|
||||||
|
// if resolution is explicitly set, use it
|
||||||
|
data.SetQuality(resolution);
|
||||||
|
}
|
||||||
|
else // use more vague "quality"
|
||||||
|
{
|
||||||
GtkPrintQuality quality = gtk_print_settings_get_quality(m_config);
|
GtkPrintQuality quality = gtk_print_settings_get_quality(m_config);
|
||||||
if (quality == GTK_PRINT_QUALITY_HIGH)
|
if (quality == GTK_PRINT_QUALITY_HIGH)
|
||||||
data.SetQuality(wxPRINT_QUALITY_HIGH);
|
data.SetQuality(wxPRINT_QUALITY_HIGH);
|
||||||
@@ -270,6 +278,7 @@ bool wxGtkPrintNativeData::TransferTo( wxPrintData &data )
|
|||||||
data.SetQuality(wxPRINT_QUALITY_DRAFT);
|
data.SetQuality(wxPRINT_QUALITY_DRAFT);
|
||||||
else
|
else
|
||||||
data.SetQuality(wxPRINT_QUALITY_MEDIUM);
|
data.SetQuality(wxPRINT_QUALITY_MEDIUM);
|
||||||
|
}
|
||||||
|
|
||||||
data.SetNoCopies(gtk_print_settings_get_n_copies(m_config));
|
data.SetNoCopies(gtk_print_settings_get_n_copies(m_config));
|
||||||
|
|
||||||
@@ -892,6 +901,12 @@ void wxGtkPrinter::BeginPrint(wxPrintout *printout, GtkPrintOperation *operation
|
|||||||
wxPrintData printdata = GetPrintDialogData().GetPrintData();
|
wxPrintData printdata = GetPrintDialogData().GetPrintData();
|
||||||
wxGtkPrintNativeData *native = (wxGtkPrintNativeData*) printdata.GetNativeData();
|
wxGtkPrintNativeData *native = (wxGtkPrintNativeData*) printdata.GetNativeData();
|
||||||
|
|
||||||
|
// We need to update printdata with the new data from the dialog and we
|
||||||
|
// have to do this here because this method needs this new data and we
|
||||||
|
// cannot update it earlier
|
||||||
|
native->SetPrintConfig(gtk_print_operation_get_print_settings(operation));
|
||||||
|
printdata.ConvertFromNative();
|
||||||
|
|
||||||
SetPrintContext(context);
|
SetPrintContext(context);
|
||||||
native->SetPrintContext( context );
|
native->SetPrintContext( context );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user