Skip to content

Commit

Permalink
DocumentUploader: Inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pgathogo committed Jun 9, 2022
1 parent 769d3bc commit ad43892
Show file tree
Hide file tree
Showing 4 changed files with 524 additions and 15 deletions.
34 changes: 19 additions & 15 deletions plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

from stdm.ui.wizard.wizard import ConfigWizard

from stdm.ui.document_downloader_win import DocumentDownloader
from stdm.ui.document_uploader import DocumentUploader

from stdm.ui.import_data import ImportData
from stdm.ui.export_data import ExportData
Expand Down Expand Up @@ -1007,8 +1007,8 @@ def loadModules(self):
self.iface.mainWindow()
)

#self.downloadAct = QAction(QIcon(":/plugins/stdm/images/icons/docdownload.png"), \
#QApplication.translate("DownloadAction","Download and Upload Documents"), self.iface.mainWindow())
self.uploadAct = QAction(QIcon(":/plugins/stdm/images/icons/docdownload.png"), \
QApplication.translate("DownloadAction","Upload Scanned Documents"), self.iface.mainWindow())

self.importAct = QAction(QIcon(":/plugins/stdm/images/icons/import.png"), \
QApplication.translate("ImportAction","Import Data"), self.iface.mainWindow())
Expand Down Expand Up @@ -1061,7 +1061,9 @@ def loadModules(self):
self.options_act.triggered.connect(self.on_sys_options)
self.manageAdminUnitsAct.triggered.connect(self.onManageAdminUnits)
self.exportAct.triggered.connect(self.onExportData)
#self.downloadAct.triggered.connect(self.onDownload)

self.uploadAct.triggered.connect(self.onUpload)

self.importAct.triggered.connect(self.onImportData)
self.docDesignerAct.triggered.connect(self.onDocumentDesigner)
self.docGeneratorAct.triggered.connect(self.onDocumentGenerator)
Expand Down Expand Up @@ -1093,8 +1095,8 @@ def loadModules(self):
adminUnitsCnt = ContentGroup.contentItemFromQAction(self.manageAdminUnitsAct)
adminUnitsCnt.code = "770EAC75-2BEC-492E-8703-34674054C246"

#downloadCnt = ContentGroup.contentItemFromQAction(self.downloadAct)
#downloadCnt.code = "bc6e22b1abfd3185d16cd3ba71cd80011ea3186c"
uploadCnt = ContentGroup.contentItemFromQAction(self.uploadAct)
uploadCnt.code = "bc6e22b1abfd3185d16cd3ba71cd80011ea3186c"

importCnt = ContentGroup.contentItemFromQAction(self.importAct)
importCnt.code = "3BBD6347-4A37-45D0-9B41-36D68D2CA4DB"
Expand Down Expand Up @@ -1222,9 +1224,9 @@ def loadModules(self):
self.docGeneratorCntGroup.addContentItem(documentGeneratorCnt)
self.docGeneratorCntGroup.register()

#self.downloadCntGroup = ContentGroup(username, self.downloadAct)
#self.downloadCntGroup.addContentItem(downloadCnt)
#self.downloadCntGroup.register()
self.uploadCntGroup = ContentGroup(username, self.uploadAct)
self.uploadCntGroup.addContentItem(uploadCnt)
self.uploadCntGroup.register()

self.importCntGroup = ContentGroup(username, self.importAct)
self.importCntGroup.addContentItem(importCnt)
Expand Down Expand Up @@ -1310,8 +1312,8 @@ def loadModules(self):
self.menubarLoader.addContent(self._action_separator())
self.toolbarLoader.addContent(self._action_separator())

#self.toolbarLoader.addContent(self.downloadCntGroup)
#self.menubarLoader.addContent(self.downloadCntGroup)
self.toolbarLoader.addContent(self.uploadCntGroup)
self.menubarLoader.addContent(self.uploadCntGroup)

self.toolbarLoader.addContent(self.importCntGroup)
self.menubarLoader.addContent(self.importCntGroup)
Expand Down Expand Up @@ -1805,9 +1807,9 @@ def onDocumentGenerator(self):
)
doc_gen_wrapper.exec_()

def onDownload(self):
doc_downloader = DocumentDownloader(self)
doc_downloader.show()
def onUpload(self):
doc_uploader = DocumentUploader(self)
doc_uploader.show()

def onImportData(self):
"""
Expand Down Expand Up @@ -1998,7 +2000,9 @@ def logout(self):
self.stdmInitToolbar.removeAction(self.usersAct)
self.stdmInitToolbar.removeAction(self.options_act)
self.stdmInitToolbar.removeAction(self.manageAdminUnitsAct)
#self.stdmInitToolbar.removeAction(self.downloadAct)

self.stdmInitToolbar.removeAction(self.uploadAct)

self.stdmInitToolbar.removeAction(self.importAct)
self.stdmInitToolbar.removeAction(self.exportAct)
self.stdmInitToolbar.removeAction(self.docDesignerAct)
Expand Down
Loading

0 comments on commit ad43892

Please sign in to comment.