1 from PyQt5
import QtCore, QtWidgets
3 from ost
import LogError
4 from ost
import gui, gfx
10 QtWidgets.QWidget.__init__(self)
11 self.
_line = QtWidgets.QLineEdit(self)
12 self.
_load = QtWidgets.QToolButton(self)
13 self._line.returnPressed.connect(self.
_DoLoad)
14 self._load.clicked.connect(self.
_DoLoad)
15 hbox = QtWidgets.QHBoxLayout(self)
16 hbox.addWidget(self.
_line,1)
17 hbox.addWidget(self.
_load,0)
19 hbox.setContentsMargins(3,3,3,3)
22 self._load.setMenu(self.
_menu)
25 self.setFixedHeight(self._load.height())
26 self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
28 def _RemoteMenu(self):
29 menu = QtWidgets.QMenu()
30 action_group = QtWidgets.QActionGroup(menu)
31 for k,v
in REMOTE_REPOSITORIES.items():
32 action = menu.addAction(v.name)
33 action.setCheckable(
True)
35 action.setChecked(
True)
36 action.setData(QtCore.QVariant(k))
37 action_group.addAction(action)
40 def _UpdateLoadButton(self, current):
41 name = REMOTE_REPOSITORIES[current].name
42 self._load.setText(
'load from %s ' % name)
44 def _ToggleRepo(self, action):
51 for p
in str(self._line.text()).split(
','):
54 split_ids.append(k.strip())
55 self._line.setText(
'')
56 for split_id
in split_ids:
59 except Exception
as e:
65 except Exception
as e:
69 remote_loader_for_panel=
gui.Widget(remote_loader)
70 remote_loader_for_panel.qobject.setSizePolicy(QtWidgets.QSizePolicy.Expanding,
71 QtWidgets.QSizePolicy.Fixed)
72 panels=gui.GostyApp.Instance().perspective.panels
73 panels.AddWidgetToPool(
"Remote Loader",remote_loader_for_panel)
main class for organization and root for the graphical display
graphical rendering of mol::EntityHandle entites