Exemplo n.º 1
0
 def selection_layer_in_db_or_not(self): #this is not used, it might be if using layer_styles stored in the db
     sql = r"""select name from sqlite_master where name = 'layer_styles'"""
     result = utils.sql_load_fr_db(sql)[1]
     if len(result)==0:#if it is an old database w/o styles
         update_db = utils.askuser("YesNo","""Your database was created with plugin version < 1.1 when layer styles were not stored in the database. You can update this database to the new standard with layer styles (symbols, colors, labels, input forms etc) stored in the database. This will increase plugin stability and multi-user experience but it will also change the layout of all your forms for entering data into the database. Anyway, an update of the database is recommended. Do you want to add these layer styles now?""",'Update database with layer styles?')
         if update_db.result == 1:
             from create_db import AddLayerStyles
             AddLayerStyles(self.settingsdict['database'])
             self.add_layers_new_method()
         else:
             self.add_layers_old_method()
     else:
         self.add_layers_new_method()