Logo Search packages:      
Sourcecode: harpia version File versions  Download package

def harpia::showimage::ShowImage::__init__ (   self,
  a_ImagePath,
  a_ErrorLog 
)

Creates a window and shows the processed image.

Definition at line 53 of file showimage.py.

00053                                                    :
            """
            Creates a window and shows the processed image.
            """

            self.m_oImagePath = a_ImagePath
00059             self.m_sErrorLog = a_ErrorLog

            self.m_sDefaultExt = ".png"
            self.m_fSizeIncrement = 0.2
            self.m_iMinSize=5
            
            self.m_sDataDir = os.environ['HARPIA_DATA_DIR']
        
            filename = self.m_sDataDir+'glade/showwindow.glade'

            widget_list = [ 'processed_image',  'ShowWindow'      ]

            handlers = [ 'on_btnShowSave_clicked',    'on_btnShowClose_clicked',
                               'on_btnShowZoomIn_clicked',  'on_btnShowZoomOut_clicked',
                               'on_btnShowZoomDefault_clicked'    ]

            top_window = 'ShowWindow'
            
            # Initializes the Gladewindow
            if (self.m_oImagePath == None) or (not os.path.exists(self.m_oImagePath)):
                  print "No Image"
                  self.Window = gtk.Window()
                  self.Window.set_icon_from_file(self.m_sDataDir+"images/harpia_ave.png")
                  self.Window.set_position(gtk.WIN_POS_CENTER)          
                  self.Window.resize(320,240)
                  self.Window.set_title(_("Processed Image"))
                  self.Label = gtk.Label()
            ## Error Loading
                  if self.m_sErrorLog == '' or self.m_sErrorLog == None:
                        self.m_sErrorLog = _("Chain not yet processed, Live Session or unknown error. \n Please try to process active chain again.")
                  t_sErrorText = _("No image found. \n\tLog Error: \n\n") + self.m_sErrorLog
            
                  self.Label.set_text(t_sErrorText)
                  self.Label.show()
                  self.Window.add(self.Label)
                  self.Window.show()


            else:
                  GladeWindow.__init__(self, filename, top_window, widget_list, handlers)
                  #self.glade = gtk.glade.XML("../etc/GladeFiles/showwindow.glade")
                  self.Window = self.widgets['ShowWindow']
                  #self.Image = self.glade.get_widget("processed_image")
                  self.Image = self.widgets['processed_image']
                  self.Window.set_icon_from_file(self.m_sDataDir+"images/harpia_ave.png")
                  self.Window.set_position(gtk.WIN_POS_CENTER)          
                  self.Window.resize(640,480)
                  self.Label = gtk.Label()
                  self.m_oImage = gtk.gdk.pixbuf_new_from_file(self.m_oImagePath)
                  self.m_oOriginalImage = gtk.gdk.pixbuf_new_from_file(self.m_oImagePath)
                  self.Image.set_from_pixbuf(gtk.gdk.pixbuf_new_from_file(self.m_oImagePath))
                  FileReader = file(self.m_oImagePath, "r")
                  self.m_sFileRead = FileReader.read()
                  FileReader.close()

                  self.CurrentHeight = self.m_oOriginalImage.get_height()
                  self.CurrentWidth = self.m_oOriginalImage.get_width()
            
            
      #----------------------------------------------------------------------

      def __del__(self):


Generated by  Doxygen 1.6.0   Back to index