Skip to content

Commit

Permalink
Merge pull request #48 from nsidc/fix_manage
Browse files Browse the repository at this point in the history
Fix manage treeView
  • Loading branch information
hsimonoko committed Feb 4, 2022
2 parents 2db5b80 + 3be2a65 commit 8dce74d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions qgreenland_dowload.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __init__(self, parent=None):
# fill the treeView with the json information
self._fill_tree()

# fill the treeView_manage also at the beginning
self._fill_manage_tree()

# connect the Download button with the download_data method
self.download_button.clicked.connect(self.download_data)

Expand Down Expand Up @@ -163,7 +166,7 @@ def get_server_url(self):
# create an instance of the QGreenlandServer class
qgreenland_server = QGreenlandServer()

# if no server URL hae been chosen warnin the user and open the config
# if no server URL hae been chosen warning the user and open the config
# settings
if not self.settings.value("/QGreenland/server-chosen"):
# get an useful QMesasgeBox
Expand Down Expand Up @@ -201,7 +204,7 @@ def _user_profile_folder(self):

def on_page_changed(self):
"""
enable/disable set as visible/not visible the next button depening
enable/disable set as visible/not visible the next button depending
on different conditions
"""

Expand Down Expand Up @@ -326,7 +329,7 @@ def _fill_tree(self):
if not candidate_indices:
new_parent_item = QStandardItem(parent_text)
new_parent_item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable)
new_parent_item.setCheckState(Qt.Unchecked) # first columun, checkable, checked=0
new_parent_item.setCheckState(Qt.Unchecked) # first column, checkable, checked=0
if parent_item:
parent_item.appendRow([new_parent_item])
else:
Expand Down Expand Up @@ -415,7 +418,7 @@ def _fill_manage_tree(self):
if not candidate_indices:
new_parent_item = QStandardItem(parent_text)
new_parent_item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable | Qt.ItemIsUserCheckable)
new_parent_item.setCheckState(Qt.Unchecked) # first columun, checkable, checked=0
new_parent_item.setCheckState(Qt.Unchecked) # first column, checkable, checked=0
if parent_item:
parent_item.appendRow([new_parent_item])
else:
Expand Down Expand Up @@ -628,7 +631,7 @@ def write_json(self, item_list):
# and is not in the set
if layer['id'] == item and layer['id'] not in layers_in_json:

# get the whole layer information into the dictonary for each layer
# get the whole layer information into the dictionary for each layer
d = layer

# append to the list the dictionary for every item
Expand Down Expand Up @@ -776,7 +779,7 @@ def download_data(self):
# loop in all the assets of the layer and download them
for asset in item:

# get the downloading url from ther server item, the parent and finally the asset
# get the downloading url from the server item, the parent and finally the asset
downloading_url = self.downloading_url + parent + '/' + asset

# create a network request and the corresponding reply object
Expand Down

0 comments on commit 8dce74d

Please sign in to comment.