Skip to content

Commit

Permalink
fixed bug while opening views in local
Browse files Browse the repository at this point in the history
  • Loading branch information
aravindm711 committed Jul 2, 2021
1 parent 2ea1282 commit 943216b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
5 changes: 4 additions & 1 deletion mslib/msui/mscolab.py
Original file line number Diff line number Diff line change
Expand Up @@ -1286,13 +1286,16 @@ def logout(self):
if self.conn is not None:
self.conn.disconnect()
self.conn = None
# close all hanging window
self.close_external_windows()
self.hide_project_options()

# delete mscolab http_auth settings for the url
if self.mscolab_server_url in self.settings["auth"].keys():
del self.settings["auth"][self.mscolab_server_url]
save_settings_qsettings('mscolab', self.settings)

# activate first item in the open flighttrack list
# activate first local flighttrack after logging out
self.ui.listFlightTracks.setCurrentRow(0)
self.ui.activate_selected_flight_track()

Expand Down
5 changes: 2 additions & 3 deletions mslib/msui/mss_pyui.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,7 @@ def __init__(self, mscolab_data_dir=None, *args):
logging.debug("AttributeError, ImportError Exception %s", error)

self.config_editor = None

# Setting up Local Tab
self.local_active = True
self.new_flight_track_counter = 0

# Reference to the flight track that is currently displayed in the views.
Expand Down Expand Up @@ -627,7 +626,7 @@ def close_selected_flight_track(self):

def create_view_handler(self, _type):
if self.local_active:
self.create_view(_type, self.active_flight_track, self.listFlightTracks)
self.create_view(_type, self.active_flight_track)
else:
self.mscolab.create_view_msc(_type)

Expand Down
11 changes: 10 additions & 1 deletion mslib/msui/qt5/ui_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def setupUi(self, MSSMainWindow):
self.actionShareProject.setObjectName("actionShareProject")
self.actionDeleteProject = QtWidgets.QAction(MSSMainWindow)
self.actionDeleteProject.setObjectName("actionDeleteProject")
self.actionMSColab = QtWidgets.QAction(MSSMainWindow)
self.actionMSColab.setObjectName("actionMSColab")
self.menuFile.addAction(self.actionNewFlightTrack)
self.menuFile.addAction(self.actionOpenFlightTrack)
self.menuFile.addSeparator()
Expand All @@ -183,6 +185,7 @@ def setupUi(self, MSSMainWindow):
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionQuit)
self.menuHelp.addAction(self.actionShortcuts)
self.menuHelp.addAction(self.actionMSColab)
self.menuHelp.addAction(self.actionUpdater)
self.menuHelp.addAction(self.actionOnlineHelp)
self.menuHelp.addAction(self.actionAboutMSUI)
Expand All @@ -205,7 +208,12 @@ def setupUi(self, MSSMainWindow):
self.actionQuit.triggered.connect(MSSMainWindow.close)
QtCore.QMetaObject.connectSlotsByName(MSSMainWindow)
MSSMainWindow.setTabOrder(self.connectBtn, self.userOptionsTb)
MSSMainWindow.setTabOrder(self.userOptionsTb, self.listViews)
MSSMainWindow.setTabOrder(self.userOptionsTb, self.listFlightTracks)
MSSMainWindow.setTabOrder(self.listFlightTracks, self.listViews)
MSSMainWindow.setTabOrder(self.listViews, self.addProjectBtn)
MSSMainWindow.setTabOrder(self.addProjectBtn, self.listProjectsMSC)
MSSMainWindow.setTabOrder(self.listProjectsMSC, self.workLocallyCheckbox)
MSSMainWindow.setTabOrder(self.workLocallyCheckbox, self.serverOptionsCb)

def retranslateUi(self, MSSMainWindow):
_translate = QtCore.QCoreApplication.translate
Expand Down Expand Up @@ -261,6 +269,7 @@ def retranslateUi(self, MSSMainWindow):
self.actionManageUsers.setText(_translate("MSSMainWindow", "&Manage Users"))
self.actionShareProject.setText(_translate("MSSMainWindow", "&Share Project"))
self.actionDeleteProject.setText(_translate("MSSMainWindow", "&Delete Project"))
self.actionMSColab.setText(_translate("MSSMainWindow", "&MSColab"))


if __name__ == "__main__":
Expand Down
11 changes: 11 additions & 0 deletions mslib/msui/ui/ui_mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@
<string>&amp;Help</string>
</property>
<addaction name="actionShortcuts"/>
<addaction name="actionMSColab"/>
<addaction name="actionUpdater"/>
<addaction name="actionOnlineHelp"/>
<addaction name="actionAboutMSUI"/>
Expand Down Expand Up @@ -447,11 +448,21 @@
<string>&amp;Delete Project</string>
</property>
</action>
<action name="actionMSColab">
<property name="text">
<string>&amp;MSColab</string>
</property>
</action>
</widget>
<tabstops>
<tabstop>connectBtn</tabstop>
<tabstop>userOptionsTb</tabstop>
<tabstop>listFlightTracks</tabstop>
<tabstop>listViews</tabstop>
<tabstop>addProjectBtn</tabstop>
<tabstop>listProjectsMSC</tabstop>
<tabstop>workLocallyCheckbox</tabstop>
<tabstop>serverOptionsCb</tabstop>
</tabstops>
<resources/>
<connections>
Expand Down

0 comments on commit 943216b

Please sign in to comment.