From f5811b8ee1c22e829bb7e78cc328652cb8e0b5cf Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Tue, 17 Mar 2026 09:00:05 +0100 Subject: [PATCH] removed print button, cleanup last Gtk3 porting issues --- src/data/Drawable.py | 1 - src/gui/DamarisGUI.py | 321 +++++++----------------------------------- src/gui/damaris.glade | 15 -- src/gui/damaris.xml | 13 -- 4 files changed, 49 insertions(+), 301 deletions(-) diff --git a/src/data/Drawable.py b/src/data/Drawable.py index ff387f0..8ea4bc4 100644 --- a/src/data/Drawable.py +++ b/src/data/Drawable.py @@ -76,7 +76,6 @@ class Drawable: "Sets a channel to a certain plot-style" if channel in self.styles: print("Drawable Warning: Style key \"%s\" will be overwritten with \"%s\"" % (str(channel), str(value))) - self.styles[channel] = str(value) diff --git a/src/gui/DamarisGUI.py b/src/gui/DamarisGUI.py index c9a24c9..54ce07d 100644 --- a/src/gui/DamarisGUI.py +++ b/src/gui/DamarisGUI.py @@ -25,8 +25,6 @@ gi.require_version('GtkSource', '3.0') from gi.repository import GObject as gobject import sqlite3,uuid -#gobject.threads_init( ) - from gi.repository import Gtk as gtk gtk_version_missmatch = gtk.check_version( 3, 0, 0 ) @@ -35,10 +33,6 @@ if gtk_version_missmatch: from gi.repository import Gdk as gdk -#gdk.threads_init( ) - -#import gtk.glade - from gi.repository import GtkSource as gtksourceview2 gobject.type_register(gtksourceview2.View) @@ -62,9 +56,6 @@ max_points_to_display = 0 import matplotlib.axes import matplotlib.figure -#for printing issues -if hasattr( gtk, "PrintOperation" ): - import matplotlib.backends.backend_cairo # import our own stuff from damaris.gui import ExperimentWriter, ExperimentHandling @@ -219,8 +210,7 @@ class DamarisGUI: self.statusbar_init( ) #connect event handlers - eventhandlers = {"on_toolbar_print_button_clicked": self.print_button_switch, - "on_toolbar_run_button_clicked": self.start_experiment, + eventhandlers = {"on_toolbar_run_button_clicked": self.start_experiment, "on_toolbar_pause_button_toggled": self.pause_experiment, "on_toolbar_stop_button_clicked": self.stop_experiment, "on_doc_menu_activate": self.show_doc_menu, @@ -242,7 +232,6 @@ class DamarisGUI: "on_config_load_button_clicked": self.config.load_config_handler, "on_backend_executable_browse_button_clicked": self.config.browse_backend_executable_dialog, "on_fontbutton_font_set": self.config.set_script_font_handler, - "on_printer_setup_button_clicked": self.config.printer_setup_handler, "on_display_autoscaling_checkbutton_toggled": self.monitor.display_autoscaling_toggled, "on_display_statistics_checkbutton_toggled": self.monitor.display_statistics_toggled, "on_display_x_scaling_combobox_changed": self.monitor.display_scaling_changed, @@ -336,7 +325,7 @@ class DamarisGUI: question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL, gtk.STOCK_NO, gtk.ResponseType.NO, gtk.STOCK_YES, gtk.ResponseType.YES)) + buttons=("_Cancel", gtk.ResponseType.CANCEL, "_No", gtk.ResponseType.NO, "_Yes", gtk.ResponseType.YES)) question.set_markup("The Experiment Script has been changed. Save changes?") response = question.run() @@ -357,7 +346,7 @@ class DamarisGUI: question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL, gtk.STOCK_NO, gtk.ResponseType.NO, gtk.STOCK_YES, gtk.ResponseType.YES)) + buttons=("_Cancel", gtk.ResponseType.CANCEL, "_No", gtk.ResponseType.NO, "_Yes", gtk.ResponseType.YES)) question.set_markup("The Result Script has been changed. Save changes?") response = question.run() @@ -387,7 +376,7 @@ class DamarisGUI: question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.ERROR, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_OK, gtk.ResponseType.OK)) + buttons=("_Understood!", gtk.ResponseType.OK)) question.set_markup("Experiment still running, can not close DAMARIS!") response = question.run() @@ -822,7 +811,7 @@ class DamarisGUI: last_backup -= 1 os.rename( self.dump_filename, dump_filename_pattern % 0 ) if cummulated_size > (1 << 30): - print("Warning: the cummulated backups size of '%s' is %d MByte" % (self.dump_filename, + print("Warning: the cumulated backups size of '%s' is %d MByte" % (self.dump_filename, cummulated_size / (1 << 20))) # init is finnished now @@ -990,53 +979,6 @@ class DamarisGUI: r.quit_flag.set( ) self.state = DamarisGUI.Stop_State - def print_button_switch( self, widget ): - """ - decides what to print... and prints, layout is done by responsible class - """ - if not hasattr( gtk, "PrintOperation" ): - return - - # copied and modified from pygtk-2.10.1/examples/pygtk-demo/demos/print_editor.py - - print_ = gtk.PrintOperation( ) - - # will come from config - settings = None - if settings is not None: - print_.set_print_settings( settings ) - - page_setup = None - if page_setup is not None: - print_.set_default_page_setup( page_setup ) - - - #print_.set_property("allow_async",True) - current_page = self.main_notebook.get_current_page( ) - print_data = { } - if current_page in [ 0, 1 ]: - print_.connect( "begin_print", self.sw.begin_print, print_data ) - print_.connect( "draw_page", self.sw.draw_page, print_data ) - elif current_page == 2: - print_.connect( "begin_print", self.monitor.begin_print, print_data ) - print_.connect( "draw_page", self.monitor.draw_page, print_data ) - else: - return - - try: - res = print_.run( gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, self.main_window ) - except gobject.GError as ex: - error_dialog = gtk.MessageDialog( self.main_window, - gtk.DIALOG_DESTROY_WITH_PARENT, - gtk._MESSAGE_ERROR, - gtk.BUTTONS_CLOSE, - ("Error printing file:\n%s" % str( ex )) ) - error_dialog.connect( "response", gtk.Widget.destroy ) - error_dialog.show( ) - else: - if res == gtk.PRINT_OPERATION_RESULT_APPLY: - settings = print_.get_print_settings( ) - def documentation_init( self ): self.doc_urls = { @@ -1526,7 +1468,6 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda """ helpful tab and return key functions """ - #print "keypress", event.state, event.keyval if event.state & gdk.ModifierType.CONTROL_MASK != 0: if event.keyval == gdk.keyval_from_name( "s" ): # save buffer @@ -1631,10 +1572,11 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=gtk.BUTTONS_NONE) - question.add_button(gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL) - question.add_button(gtk.STOCK_NO, gtk.ResponseType.NO) - question.add_button(gtk.STOCK_YES, gtk.ResponseType.YES) + buttons=("_Yes", gtk.ResponseType.YES, + "_No", gtk.ResponseType.NO, + "_Cancel", gtk.ResponseType.CANCEL)) + + question.set_markup("The file has been changed. Save changes?") response = question.run() @@ -1653,7 +1595,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda script_filename = os.path.abspath( file_name ) if not os.access( script_filename, os.R_OK ): - outer_space.show_error_dialog( "File I/O Error", "Cannot read from file %s" % script_filename ) + self.outer_space.show_error_dialog( "File I/O Error", "Cannot read from file %s" % script_filename ) return True script_string = script_widget.load_file_as_unicode( script_filename ) @@ -1672,8 +1614,8 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda dialog = gtk.FileChooserDialog( title=open_dialog_title, parent=parent_window, action=gtk.FileChooserAction.OPEN, - buttons=(gtk.STOCK_OPEN, gtk.ResponseType.OK, gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL) - ) + buttons=("_Open", gtk.ResponseType.OK, "_Cancel", gtk.ResponseType.CANCEL) + ) dialog.set_default_response( gtk.ResponseType.OK ) dialog.set_select_multiple( False ) # Event-Handler for responce-signal (when one of the button is pressed) @@ -1740,7 +1682,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda question = gtk.MessageDialog(parent=script_widget.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_YES, gtk.ResponseType.YES, gtk.STOCK_NO, gtk.ResponseType.NO)) + buttons=("_Yes", gtk.ResponseType.YES, "_No", gtk.ResponseType.NO)) question.set_markup("The file already exists. Do you want to overwrite the existing file and delete its contents?") response = question.run() @@ -1772,8 +1714,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda dialog = gtk.FileChooserDialog( title=dialog_title, parent=parent_window, action=gtk.FileChooserAction.SAVE, - buttons=( - gtk.STOCK_SAVE, gtk.ResponseType.OK, gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL) ) + buttons=("_Save", gtk.ResponseType.OK, "_Cancel", gtk.ResponseType.CANCEL) ) dialog.set_default_response( gtk.ResponseType.OK ) dialog.set_select_multiple( False ) @@ -1897,7 +1838,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda dialog = gtk.Dialog(title="Search", parent=self.xml_gui.get_object("main_window"), flags=0, - buttons=(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE, "Find last", -1, "Find next", 1)) + buttons=("_Close", gtk.ResponseType.CLOSE, "Find last", -1, "Find next", 1)) cont = dialog.get_content_area() markedstring = "" @@ -1933,7 +1874,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda dialog.connect("response", response, self, textbox) dialog.set_resizable(False) - dialog.show_all() + dialog.show() if startit is not None and endit is not None: if current_page == 0: @@ -1956,7 +1897,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_YES, gtk.ResponseType.YES, gtk.STOCK_NO, gtk.ResponseType.NO, gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL)) + buttons=("_Yes", gtk.ResponseType.YES, "_No", gtk.ResponseType.NO, "_Cancel", gtk.ResponseType.CANCEL)) question.set_markup("The file has been changed. Save changes?") response = question.run() @@ -1974,7 +1915,7 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda question = gtk.MessageDialog(parent=self.xml_gui.get_object( "main_window"), type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_YES, gtk.ResponseType.YES, gtk.STOCK_NO, gtk.ResponseType.NO, gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL)) + buttons=("_Yes", gtk.ResponseType.YES, "_No", gtk.ResponseType.NO, "_Cancel", gtk.ResponseType.CANCEL)) question.set_markup("The file has been changed. Save changes?") response = question.run() @@ -1989,83 +1930,6 @@ get_job_id get_description set_description get_xdata get_ydata set_xdate set_yda self.res_script_filename = None self.set_toolbuttons_status( ) - def begin_print( self, operation, context, print_data ): - """ - layout of all pages - """ - # copied and modified from pygtk-2.10.1/examples/pygtk-demo/demos/print_editor.py - - # Determining the tab which is currently open - current_page = self.main_notebook.get_current_page( ) - script = "" - # get script text - if current_page == 0: - script = self.get_scripts( )[ 0 ] - elif current_page == 1: - script = self.get_scripts( )[ 1 ] - - width = context.get_width( ) - height = context.get_height( ) - layout = context.create_pango_layout( ) - layout.set_font_description( pango.FontDescription( "Monospace 12" ) ) - layout.set_width( int( width * pango.SCALE ) ) - layout.set_text( script ) - num_lines = layout.get_line_count( ) - - page_breaks = [ ] - page_height = 0 - - for line in range( num_lines ): - layout_line = layout.get_line( line ) - ink_rect, logical_rect = layout_line.get_extents( ) - lx, ly, lwidth, lheight = logical_rect - line_height = lheight / 1024.0 - if page_height + line_height > height: - page_breaks.append( line ) - page_height = 0 - page_height += line_height - - operation.set_n_pages( len( page_breaks ) + 1 ) - print_data[ "page_breaks" ] = page_breaks - print_data[ "layout" ] = layout - - def draw_page( self, operation, context, page_nr, print_data ): - """ - render a single page - """ - # copied and modified from pygtk-2.10.1/examples/pygtk-demo/demos/print_editor.py - assert isinstance( print_data[ "page_breaks" ], list ) - if page_nr == 0: - start = 0 - else: - start = print_data[ "page_breaks" ][ page_nr - 1 ] - - try: - end = print_data[ "page_breaks" ][ page_nr ] - except IndexError: - end = print_data[ "layout" ].get_line_count( ) - - cr = context.get_cairo_context( ) - - cr.set_source_rgb( 0, 0, 0 ) - - i = 0 - start_pos = 0 - iter = print_data[ "layout" ].get_iter( ) - while 1: - if i >= start: - line = iter.get_line( ) - _, logical_rect = iter.get_line_extents( ) - lx, ly, lwidth, lheight = logical_rect - baseline = iter.get_baseline( ) - if i == start: - start_pos = ly / 1024.0; - cr.move_to( lx / 1024.0, baseline / 1024.0 - start_pos ) - cr.show_layout_line( line ) - i += 1 - if not (i < end and iter.next_line( )): - break - class ConfigTab: """ @@ -2100,9 +1964,6 @@ class ConfigTab: self.config_data_pool_comprate = self.xml_gui.get_object( "CompRatio" ) self.config_info_textview = self.xml_gui.get_object( "info_textview" ) self.config_script_font_button = self.xml_gui.get_object( "script_fontbutton" ) - self.config_printer_setup_button = self.xml_gui.get_object( "printer_setup_button" ) - if not hasattr( gtk, "print_run_page_setup_dialog" ): - self.config_printer_setup_button.set_sensitive( False ) # insert version informations components_text = """ @@ -2112,8 +1973,7 @@ glib version %(glib)s python version %(python)s matplotlib version %(matplotlib)s, %(matplotlib_backend)s numpy version %(numpy)s -pytables version %(pytables)s, using %(pytables_libs)s -pygtk version %(pygtk)s +pytables version %(pytables)s, using: %(pytables_libs)s pygobject version %(pygobject)s """ if hasattr( gobject, "glib_version" ): @@ -2135,15 +1995,14 @@ pygobject version %(pygobject)s components_versions = { "os": platform.platform( ), - "gtk": gtk._version, + "gtk": "{}.{}.{}".format(gtk.MAJOR_VERSION, gtk.MINOR_VERSION, gtk.MICRO_VERSION), "glib": glib_version, "python": sys.version, "matplotlib": matplotlib.__version__, "matplotlib_backend": FigureCanvas.__name__[ 12: ], "numpy": numpy_version, - "pytables": tables.get_pytables_version( ), + "pytables": tables.__version__, "pytables_libs": "", - "pygtk": gtk._version, "pygobject": pygobject_version } @@ -2151,14 +2010,14 @@ pygobject version %(pygobject)s # find compression extensions for combo box and write version numbers # list is taken from ValueError output of tables.which_lib_version("") model = self.config_data_pool_complib.get_model( ) - for libname in ('hdf5', 'zlib', 'lzo', 'ucl', 'bzip2'): + for libname in ('hdf5', 'zlib', 'lzo', 'blosc'): version_info = None try: version_info = tables.which_lib_version( libname ) except ValueError: continue if version_info: - components_versions[ "pytables_libs" ] += "\n %s: %s" % (libname, str( version_info )) + components_versions[ "pytables_libs" ] += "\n * %s: %s" % (libname, str( version_info[1] )) if libname != "hdf5": # a compression library, add it to combo box if isinstance( model, gtk.ListStore ): @@ -2272,22 +2131,6 @@ pygobject version %(pygobject)s if data_handling_textview: data_handling_textview.modify_font( pango.FontDescription( font ) ) - def printer_setup_handler( self, widget ): - """ - changes to printer setup - """ - if not (hasattr( gtk, "PrintSettings" ) and hasattr( gtk, "print_run_page_setup_dialog" )): - return - if not hasattr( self, "printer_setup" ): - self.printer_setup = gtk.PrintSettings( ) - - if not hasattr( self, "page_setup" ): - self.page_setup = None - - self.page_setup = gtk.print_run_page_setup_dialog( self.xml_gui.get_object( "main_window" ), - self.page_setup, self.printer_setup ) - - def browse_backend_executable_dialog( self, widget ): """ do the open file dialog @@ -2302,14 +2145,13 @@ pygobject version %(pygobject)s script_widget.config_backend_executable_entry.set_text( file_name ) return True - parent_window = self.xml_gui.get_object( "main_window" ) dialog = gtk.FileChooserDialog( title=backend_filename_dialog_title, parent=parent_window, action=gtk.FileChooserAction.OPEN, - buttons=(gtk.STOCK_OPEN, + buttons=("_Open", gtk.ResponseType.OK, - gtk.STOCK_CANCEL, + "_Cancel", gtk.ResponseType.CANCEL) ) dialog.set_default_response( gtk.ResponseType.OK ) dialog.set_select_multiple( False ) @@ -2859,7 +2701,7 @@ class MonitorWidgets: question = gtk.MessageDialog(parent=parentfordialog, type=gtk.MessageType.WARNING, flags=gtk.DialogFlags.MODAL, - buttons=(gtk.STOCK_YES, gtk.ResponseType.YES, gtk.STOCK_NO, gtk.ResponseType.NO)) + buttons=("_Yes", gtk.ResponseType.YES, "_No", gtk.ResponseType.NO)) question.set_markup("The file already exists. Do you want to overwrite the existing file and delete its contents?") response = question.run() @@ -2883,8 +2725,7 @@ class MonitorWidgets: dialog = gtk.FileChooserDialog( title=dialog_title, parent=self.main_window, action=gtk.FileChooserAction.SAVE, - buttons=( - gtk.STOCK_SAVE, gtk.ResponseType.OK, gtk.STOCK_CANCEL, gtk.ResponseType.CANCEL) ) + buttons=("_Save", gtk.ResponseType.OK, "_Cancel", gtk.ResponseType.CANCEL) ) dialog.set_default_response( gtk.ResponseType.OK ) dialog.set_current_name( data_to_save[ 0 ] ) @@ -2956,13 +2797,10 @@ class MonitorWidgets: self.measurementresultgraph = None elif self.measurementresultgraph is not None: # clear errorbars - #self.matplot_axes.lines.remove( self.measurementresultgraph[ 0 ] ) self.measurementresultgraph[0].remove() for line in self.measurementresultgraph[ 1 ]: - #self.matplot_axes.lines.remove( l ) line.remove() for line in self.measurementresultgraph[ 2 ]: - #self.matplot_axes.collections.remove( l ) line.remove() self.measurementresultgraph = None self.matplot_axes.clear( ) @@ -2971,7 +2809,6 @@ class MonitorWidgets: self.graphen = [ ] elif self.graphen: for line in self.graphen: - #self.matplot_axes.lines.remove( line ) line.remove() self.graphen = [ ] self.matplot_axes.clear( ) @@ -3121,26 +2958,27 @@ class MonitorWidgets: else: self.matplot_axes.set_ylabel( "" ) - # Any variables to be set? - # if False: - # if isinstance(in_result, Accumulation): - # descriptions = in_result.common_descriptions - # elif isinstance(in_result, ADC_Result): - # descriptions = in_result.description - # else: pass - # actual_config = self.config.get() - # if (descriptions is not None) : #--markusro - # print actual_config['pretty_descriptions'] - # pass - # description_string = "" - # for key in descriptions.keys(): - # description_string += "%s = %s\n" % (key,descriptions[key]) - # self.matplot_axes.text(0.7,0.95, description_string[:-1], - # size=8, - # transform=self.matplot_axes.transAxes, - # va='top', - # backgroundcolor='white') - # + # Any variables to be drawn on plot + if True: + descriptions = None + if isinstance(in_result, Accumulation): + descriptions = in_result.common_descriptions + elif isinstance(in_result, ADC_Result): + descriptions = in_result.description + else: + pass + #actual_config = self.config.get() + if (descriptions is not None): + #print(actual_config['pretty_descriptions']) + description_string = "" + for key in descriptions.keys(): + description_string += "%s = %s\n" % (key,descriptions[key]) + self.matplot_axes.text(0.8,0.95, description_string[:-1], + size=10, + transform=self.matplot_axes.transAxes, + va='top', + backgroundcolor='white') + # Draw it! self.matplot_canvas.draw_idle( ) del in_result @@ -3258,67 +3096,6 @@ class MonitorWidgets: return self.update_display( ) - def begin_print( self, operation, context, print_data ): - """ - layout of one page with matplotlib graph - """ - operation.set_n_pages( 1 ) - - - def draw_page( self, operation, context, page_nr, print_data ): - """ - render a single page - """ - # copied and modified from pygtk-2.10.1/examples/pygtk-demo/demos/print_editor.py - - if page_nr != 0: - return - - # check page dimensions - # all lengths in inch: name *_in - page_setup = context.get_page_setup( ) - dpi = context.get_dpi_x( ) - if dpi != context.get_dpi_y( ): - print("draw_page: dpi_x!=dpi_y, I am not prepared for that") - freewidth_in = float( context.get_width( ) ) / dpi - freeheight_in = float( context.get_height( ) ) / dpi - fc = self.matplot_canvas.switch_backends( matplotlib.backends.backend_cairo.FigureCanvasCairo ) - fc.figure.dpi.set( dpi ) - orig_w_in, orig_h_in = fc.figure.get_size_inches( ) - orig_f_color = fc.figure.get_facecolor( ) - orig_e_color = fc.figure.get_edgecolor( ) - - # scale to maximum - fc.figure.set_facecolor( "w" ) - fc.figure.set_edgecolor( "w" ) - - # maximum scale with constant aspect - scale = min( freewidth_in / orig_w_in, freeheight_in / orig_h_in ) - fc.figure.set_size_inches( orig_w_in * scale, orig_h_in * scale ) - width_in_points, height_in_points = orig_w_in * dpi * scale, orig_h_in * dpi * scale - renderer = matplotlib.backends.backend_cairo.RendererCairo( fc.figure.dpi ) - renderer.width = width_in_points - renderer.height = height_in_points - # centered picture - renderer.matrix_flipy = cairo.Matrix( yy=-1, xx=1, - y0=page_setup.get_top_margin( gtk.UNIT_POINTS ) + ( - height_in_points + freeheight_in * dpi) / 2.0, - x0=page_setup.get_left_margin( gtk.UNIT_POINTS ) + ( - freewidth_in * dpi - width_in_points) / 2.0 ) - - renderer.set_ctx_from_surface( context.get_cairo_context( ).get_target( ) ) - # unfortunateley there is need for extra treatment of text - renderer.ctx.translate( - page_setup.get_left_margin( gtk.UNIT_POINTS ) + (freewidth_in * dpi - width_in_points) / 2.0, - page_setup.get_top_margin( gtk.UNIT_POINTS ) - height_in_points / 2.0 + freeheight_in * dpi / 2.0 ) - renderer.ctx.save( ) # important! there will be no effect of previous statement without save - fc.figure.draw( renderer ) - - # restore the figure's settings - fc.figure.set_size_inches( orig_w_in, orig_h_in ) - fc.figure.set_facecolor( orig_f_color ) - fc.figure.set_edgecolor( orig_e_color ) - class ScriptInterface: """ diff --git a/src/gui/damaris.glade b/src/gui/damaris.glade index f0bb206..568f65a 100644 --- a/src/gui/damaris.glade +++ b/src/gui/damaris.glade @@ -1389,21 +1389,6 @@ ppm - True - - - True - True - Printer Setup - True - 0 - - - - False - False - - diff --git a/src/gui/damaris.xml b/src/gui/damaris.xml index bf43f33..45fa134 100644 --- a/src/gui/damaris.xml +++ b/src/gui/damaris.xml @@ -1868,19 +1868,6 @@ Public License instead of this License. True - - - True - True - Printer Setup - True - - - - False - False - -