Skip to content

Commit

Permalink
Merge pull request #1059 from aravindm711/GSOC2021-AravindMurali
Browse files Browse the repository at this point in the history
GSoC progress update
  • Loading branch information
joernu76 authored Jul 8, 2021
2 parents 7895db8 + 4eecd75 commit 018babe
Show file tree
Hide file tree
Showing 10 changed files with 845 additions and 623 deletions.
274 changes: 165 additions & 109 deletions mslib/msui/_tests/test_mscolab.py

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions mslib/msui/_tests/test_mss_pyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_plugin_csv_read(self, mockopen):
assert self.window.listFlightTracks.count() == 1
assert mockopen.call_count == 0
self.window.last_save_directory = self.sample_path
self.window.actionImportFlightTrackCSV()
self.window.actionImportFlightTrackCSV.trigger()
QtWidgets.QApplication.processEvents()
assert self.window.listFlightTracks.count() == 2
assert mockopen.call_count == 1
Expand All @@ -170,27 +170,29 @@ def test_plugin_csv_write(self, mocksave):
assert self.window.listFlightTracks.count() == 1
assert mocksave.call_count == 0
self.window.last_save_directory = ROOT_DIR
self.window.actionExportFlightTrackCSV()
self.window.actionExportFlightTrackCSV.trigger()
assert mocksave.call_count == 1
assert os.path.exists(self.save_csv)
os.remove(self.save_csv)

@mock.patch("mslib.msui.mss_pyui.get_open_filename", return_value=os.path.join(sample_path, u"example.txt"))
def test_plugin_txt_read(self, mockopen):
self.window.add_import_filter("_TXT", "txt", load_from_txt)
self.window.add_plugin_submenu("_TXT", "txt", plugin_type="Import")
self.window.import_plugins['txt'] = load_from_txt
assert self.window.listFlightTracks.count() == 1
assert mockopen.call_count == 0
self.window.last_save_directory = self.sample_path
self.window.actionImportFlightTrack_TXT()
self.window.actionImportFlightTrack_TXT.trigger()
assert mockopen.call_count == 1
QtWidgets.QApplication.processEvents()
assert self.window.listFlightTracks.count() == 2

@mock.patch("mslib.msui.mss_pyui.get_save_filename", return_value=save_txt)
def test_plugin_txt_write(self, mocksave):
self.window.add_export_filter("_TXT", "txt", save_to_txt)
self.window.add_plugin_submenu("_TXT", "txt", plugin_type="Export")
self.window.export_plugins['txt'] = save_to_txt
self.window.last_save_directory = ROOT_DIR
self.window.actionExportFlightTrack_TXT()
self.window.actionExportFlightTrack_TXT.trigger()
assert mocksave.call_count == 1
QtWidgets.QApplication.processEvents()
assert self.window.listFlightTracks.count() == 1
Expand All @@ -201,9 +203,10 @@ def test_plugin_txt_write(self, mocksave):
return_value=os.path.join(sample_path, u"flitestar.txt"))
def test_plugin_flitestar(self, mockopen):
self.window.last_save_directory = self.sample_path
self.window.add_import_filter("_FliteStar", "txt", load_from_flitestar)
self.window.add_plugin_submenu("_FliteStar", "fls", plugin_type="Import")
self.window.import_plugins['fls'] = load_from_flitestar
assert self.window.listFlightTracks.count() == 1
self.window.actionImportFlightTrack_FliteStar()
self.window.actionImportFlightTrack_FliteStar.trigger()
QtWidgets.QApplication.processEvents()
assert self.window.listFlightTracks.count() == 2
assert mockopen.call_count == 1
230 changes: 98 additions & 132 deletions mslib/msui/mscolab.py

Large diffs are not rendered by default.

240 changes: 117 additions & 123 deletions mslib/msui/mss_pyui.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions mslib/msui/mss_qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def variant_to_float(variant, locale=QtCore.QLocale()):
"ui_mscolab_help_dialog",
"ui_add_project_dialog",
"ui_mscolab_merge_waypoints_dialog",
"ui_mscolab_profile_dialog",
"ui_performance_dockwidget",
"ui_remotesensing_dockwidget",
"ui_satellite_dockwidget",
Expand Down
190 changes: 102 additions & 88 deletions mslib/msui/qt5/ui_mainwindow.py

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions mslib/msui/qt5/ui_mscolab_profile_dialog.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'mslib/msui/ui/ui_mscolab_profile_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!


from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_ProfileWindow(object):
def setupUi(self, ProfileWindow):
ProfileWindow.setObjectName("ProfileWindow")
ProfileWindow.resize(277, 140)
self.gridLayout = QtWidgets.QGridLayout(ProfileWindow)
self.gridLayout.setObjectName("gridLayout")
self.infoGl = QtWidgets.QGridLayout()
self.infoGl.setObjectName("infoGl")
self.emailLabel_2 = QtWidgets.QLabel(ProfileWindow)
self.emailLabel_2.setText("")
self.emailLabel_2.setObjectName("emailLabel_2")
self.infoGl.addWidget(self.emailLabel_2, 1, 1, 1, 1)
self.emailLabel = QtWidgets.QLabel(ProfileWindow)
self.emailLabel.setObjectName("emailLabel")
self.infoGl.addWidget(self.emailLabel, 1, 0, 1, 1)
self.usernameLabel = QtWidgets.QLabel(ProfileWindow)
self.usernameLabel.setObjectName("usernameLabel")
self.infoGl.addWidget(self.usernameLabel, 0, 0, 1, 1)
self.usernameLabel_2 = QtWidgets.QLabel(ProfileWindow)
self.usernameLabel_2.setText("")
self.usernameLabel_2.setObjectName("usernameLabel_2")
self.infoGl.addWidget(self.usernameLabel_2, 0, 1, 1, 1)
self.mscolabURLLabel = QtWidgets.QLabel(ProfileWindow)
self.mscolabURLLabel.setObjectName("mscolabURLLabel")
self.infoGl.addWidget(self.mscolabURLLabel, 2, 0, 1, 1)
self.mscolabURLLabel_2 = QtWidgets.QLabel(ProfileWindow)
self.mscolabURLLabel_2.setText("")
self.mscolabURLLabel_2.setObjectName("mscolabURLLabel_2")
self.infoGl.addWidget(self.mscolabURLLabel_2, 2, 1, 1, 1)
self.gridLayout.addLayout(self.infoGl, 0, 0, 1, 1)
self.gravatarVl = QtWidgets.QVBoxLayout()
self.gravatarVl.setObjectName("gravatarVl")
self.gravatarLabel = QtWidgets.QLabel(ProfileWindow)
self.gravatarLabel.setText("")
self.gravatarLabel.setObjectName("gravatarLabel")
self.gravatarVl.addWidget(self.gravatarLabel, 0, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
self.setGravatarBtn = QtWidgets.QPushButton(ProfileWindow)
self.setGravatarBtn.setObjectName("setGravatarBtn")
self.gravatarVl.addWidget(self.setGravatarBtn, 0, QtCore.Qt.AlignHCenter)
self.gridLayout.addLayout(self.gravatarVl, 0, 1, 2, 1)
self.buttonBox = QtWidgets.QDialogButtonBox(ProfileWindow)
self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
self.buttonBox.setObjectName("buttonBox")
self.gridLayout.addWidget(self.buttonBox, 2, 1, 1, 1, QtCore.Qt.AlignRight)
self.deleteAccountBtn = QtWidgets.QPushButton(ProfileWindow)
self.deleteAccountBtn.setObjectName("deleteAccountBtn")
self.gridLayout.addWidget(self.deleteAccountBtn, 2, 0, 1, 1, QtCore.Qt.AlignLeft)

self.retranslateUi(ProfileWindow)
QtCore.QMetaObject.connectSlotsByName(ProfileWindow)

def retranslateUi(self, ProfileWindow):
_translate = QtCore.QCoreApplication.translate
ProfileWindow.setWindowTitle(_translate("ProfileWindow", "MSColab Profile"))
self.emailLabel.setText(_translate("ProfileWindow", "Email:"))
self.usernameLabel.setText(_translate("ProfileWindow", "Name:"))
self.mscolabURLLabel.setText(_translate("ProfileWindow", "Mscolab:"))
self.setGravatarBtn.setText(_translate("ProfileWindow", "Set Gravatar"))
self.deleteAccountBtn.setText(_translate("ProfileWindow", "Delete Account"))


if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
ProfileWindow = QtWidgets.QDialog()
ui = Ui_ProfileWindow()
ui.setupUi(ProfileWindow)
ProfileWindow.show()
sys.exit(app.exec_())
Loading

0 comments on commit 018babe

Please sign in to comment.