Esempio n. 1
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setupUi(self)
# Set window title to start with
        self.setWindowTitle(programinfo.NAME + " " + programinfo.VERSION )
# First set the menu actions
        self.mnu_action_load_images.triggered.connect(self.loadimages)
        self.action_Quit.triggered.connect(self.quit_application)
        app.aboutToQuit.connect(self.quit_application)
        #--- Extra menu
        self.mnu_action_modifydatetime.triggered.connect(self.modify_datetime)
        self.mnu_action_create_args.triggered.connect(self.create_args)
        self.mnu_action_export_metadata.triggered.connect(self.export_metadata)
        self.mnu_action_remove_metadata.triggered.connect(self.remove_metadata)
        self.mnu_action_date_to_DateTimeOriginal.triggered.connect(self.date_to_datetimeoriginal)
        self.mnu_action_repair_jpg.triggered.connect(self.repair_jpg_metadata)
        self.mnu_action_copytoxmp.triggered.connect(self.copymetadatatoxmp)
        self.mnu_action_renaming.triggered.connect(self.rename_photos)
        #self.mnu_action_define_lens.triggered.connect(self.lensdialog)
        #self.menuExtra.removeAction(self.mnu_action_renaming)
        #--- help menu
        self.mnu_action_pyexiftoolgui_home.triggered.connect(self.open_pyexiftoolgui_homepage)
        self.mnu_action_exiftool.triggered.connect(self.open_exiftool_homepage)
        self.mnu_action_manual.triggered.connect(self.open_manual)
        #self.mnu_action_mapcoordinates_tab.triggered.connect(self.mapcoordinates_help)
        self.mnu_action_license.triggered.connect(self.show_license)
        self.mnu_action_Donate.triggered.connect(self.open_donate_page)
        self.mnu_action_Info.triggered.connect(self.show_about_window)
        # Set extra actions for context menu (others taken from normal menu)
        self.imagereference = QAction("Select photo as reference for \"Extra\" menu", self, triggered = self.reference_image)
        self.displayphoto = QAction("Display selected photo", self, triggered = self.showimage)
# Load several views, buttons, comboboxes, spinboxes and labels from main screen
        self.btn_loadimages.clicked.connect(self.loadimages)
        self.showimagebutton.clicked.connect(self.showimage)
        self.showimagebutton.setEnabled(False)
        self.statusbar.showMessage("")
        self.progressbar.hide()
# Load several buttons from the Edit -> GPS tab
        self.dec2dmsbutton.clicked.connect(self.convertd2dms)
        self.dms2decbutton.clicked.connect(self.convertdms2d)
        self.btn_resetgps.clicked.connect(self.clear_gps_fields)
        self.btn_copy_calc_to_gps.clicked.connect(self.copy_calc_to_gpsinput)
        self.btn_gpshelp.clicked.connect(self.gps_help)
        self.btn_gps_copyfrom.clicked.connect(self.copygpsfromselected)
        self.btn_gps_copyfrom.setEnabled(False)
        self.btn_savegps.clicked.connect(self.savegpsdata)
        self.btn_savegps.setEnabled(False)
        self.btn_mapcoordinates.clicked.connect(self.open_mapcoordinates)
# Load several buttons from the Edit -> EXIF tab
        self.btn_exifhelp.clicked.connect(self.exif_help)
        self.btn_exif_copyfrom.clicked.connect(self.copyexiffromselected)
        self.btn_exif_copyfrom.setEnabled(False)
        self.btn_saveexif.clicked.connect(self.saveexifdata)
        self.btn_saveexif.setEnabled(False)
        self.btn_resetexif.clicked.connect(self.clear_exif_fields)
        self.btn_copy_exif_defaults.clicked.connect(self.exif_defaults)
# Load several buttons from the Edit -> xmp tab
        self.btn_xmphelp.clicked.connect(self.xmp_help)
        self.btn_xmp_copyfrom.clicked.connect(self.copyxmpfromselected)
        self.btn_xmp_copyfrom.setEnabled(False)
        self.btn_savexmp.clicked.connect(self.savexmpdata)
        self.btn_savexmp.setEnabled(False)
        self.btn_resetxmp.clicked.connect(self.clear_xmp_fields)
        self.btn_copy_xmp_defaults.clicked.connect(self.xmp_defaults)
# Load several buttons from the Edit -> GPano tab
        self.btn_gpanohelp.clicked.connect(self.gpano_help)
        self.btn_gpano_copyfrom.clicked.connect(self.copygpanofromselected)
        self.btn_gpano_copyfrom.setEnabled(False)
        self.btn_savegpano.clicked.connect(self.savegpanodata)
        self.btn_savegpano.setEnabled(False)
        self.btn_resetgpano.clicked.connect(self.clear_gpano_fields)
# Load several buttons from the Edit -> Geotagging tab
        self.btn_geotagging_help.clicked.connect(self.geotagging_help)
        self.btn_geotag_img_browse.clicked.connect(self.geotag_source_folder)
        self.btn_geotag_gps_track_browse.clicked.connect(self.geotag_gps_file)
        self.btn_write_geotaginfo.clicked.connect(self.write_geotag_info)
        self.btn_write_geotaginfo.setEnabled(False)
# Load several buttons from the Edit -> lens tab
        self.btn_lenshelp.clicked.connect(self.lens_help)
        self.btn_lens_copyfrom.clicked.connect(self.copylensfromselected)
        self.btn_lens_copyfrom.setEnabled(False)
        self.btn_savelens.clicked.connect(self.savelensdata)
        self.btn_savelens.setEnabled(False)
        self.btn_resetlens.clicked.connect(self.clear_lens_fields)
        self.btn_copy_lens_defaults.clicked.connect(self.lensdialog)
        # For the time being hide the button
        self.btn_copy_lens_defaults.setVisible(False)
# Load several buttons from the Edit -> Your commands tab
        self.btn_yourcommands_clearinput.clicked.connect(self.clear_yourcommands_input)
        self.btn_yourcommands_clearoutput.clicked.connect(self.clear_yourcommands_output)
        self.btn_yourcommands_go.clicked.connect(self.yourcommands_go)
        self.btn_yourcommands_help.clicked.connect(self.yourcommands_help)
# Load several buttons from the Preferences tab
        self.btn_preferences_save.clicked.connect(self.preferences_save)
        self.btn_preferenceshelp.clicked.connect(self.preferences_help)
        self.btn_choose_exiftool.clicked.connect(self.select_exiftool)

#------------------------------------------------------------------------
# Define a few globals and variables
        self.DebugMsg = False
        self.allDebugMsg = False
        self.logging = ""
        self.logtofile = 0
#         self.tmpworkdir = tempfile.gettempdir() +"/pyGPSTtmp"

        self.OSplatform = platform.system()
        petgfunctions.read_config(self)
        # First clean up and recreate our temporary workspace
#        petgfunctions.remove_workspace( self )
#        try:
#        fldr = os.mkdir(self.tmpworkdir)
#        except: 
#        if self.logtofile:
#            logging.info(self.tmpworkdir + " already exists.")

#------------------------------------------------------------------------
# Initialize file paths
        self.realfile_dir  = os.path.dirname(os.path.abspath(__file__))
        self.parent_dir    = os.path.dirname(self.realfile_dir)
        self.ui_dir    = os.path.join(self.realfile_dir, "ui")

#------------------------------------------------------------------------
# Start up functions
#        OSplatform, img_converter, enfuseprg, aisprg = petgfunctions.startup_checks(self)
#            self.OSplatform = OSplatform
        if self.allDebugMsg:
            ret = QMessageBox.about(self, "returned check values", "platform: %s\nconverter: %s\nenfuse: %s\nais: %s" % (OSplatform, img_converter, enfuseprg, aisprg))

        # Startup check for available tools
		# First set exiftoolversion for windows
        self.exiftoolversion = "0.00"
        petgfunctions.tool_check(self)
Esempio n. 2
0
 def preferences_save(self):
     petgfilehandling.write_xml_config(self)
     petgfunctions.tool_check(self)
Esempio n. 3
0
 def preferences_save(self):
     petgfunctions.write_config(self, 0)
     petgfunctions.tool_check(self)
Esempio n. 4
0
 def preferences_save(self):
     petgfilehandling.write_xml_config(self)
     petgfunctions.tool_check(self)