File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88 * Added ` is_connected ` method
99
1010* New ` widgets ` module:
11- * New ` DataLabConnectionDialog ` class:
11+ * New ` ConnectionDialog ` class:
1212 * Ready-to-use dialog box to connect to a DataLab server
13- * ` from cdlclient.widgets import DataLabConnectionDialog `
13+ * ` from cdlclient.widgets import ConnectionDialog `
1414 * See example in ` cdlclient/tests/connect_dialog.py `
1515
1616## Version 0.4.0 ##
Original file line number Diff line number Diff line change 1010# guitest: show
1111
1212from guidata .qthelpers import qt_app_context
13+ from qtpy import QtWidgets as QW
1314
1415from cdlclient import SimpleRemoteProxy
15- from cdlclient .widgets import DataLabConnectionDialog
16+ from cdlclient .widgets import ConnectionDialog
1617
1718
1819def test_dialog ():
1920 """Test connection dialog"""
2021 proxy = SimpleRemoteProxy ()
2122 with qt_app_context ():
22- dlg = DataLabConnectionDialog (proxy .connect )
23- dlg .exec ()
23+ dlg = ConnectionDialog (proxy .connect )
24+ if dlg .exec ():
25+ QW .QMessageBox .information (None , "Connection" , "Successfully connected" )
26+ else :
27+ QW .QMessageBox .critical (None , "Connection" , "Connection failed" )
2428
2529
2630if __name__ == "__main__" :
Original file line number Diff line number Diff line change 2525from cdlclient import SimpleRemoteProxy
2626from cdlclient .tests .remoteclient_base import AbstractClientWindow
2727from cdlclient .tests .remoteclient_unit import multiple_commands
28- from cdlclient .widgets import DataLabConnectionDialog
28+ from cdlclient .widgets import ConnectionDialog
2929
3030APP_NAME = "Remote client test"
3131
@@ -73,7 +73,7 @@ def init_cdl(self):
7373 """Open DataLab test"""
7474 if self .cdl is None :
7575 self .cdl : SimpleRemoteProxy = SimpleRemoteProxy ()
76- connect_dlg = DataLabConnectionDialog (self .cdl .connect , self )
76+ connect_dlg = ConnectionDialog (self .cdl .connect , self )
7777 ok = connect_dlg .exec ()
7878 if ok :
7979 self .host .log ("✨ Initialized DataLab connection ✨" )
Original file line number Diff line number Diff line change 1111"""
1212
1313# pylint: disable=unused-import
14- from cdlclient .widgets .connection import DataLabConnectionDialog
14+ from cdlclient .widgets .connection import ConnectionDialog
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def run(self) -> None:
4343 self .SIG_CONNECTION_KO .emit ()
4444
4545
46- class DataLabConnectionDialog (QW .QDialog ):
46+ class ConnectionDialog (QW .QDialog ):
4747 """DataLab Connection dialog
4848
4949 Args:
@@ -125,5 +125,5 @@ def fake_connect():
125125 # raise ConnectionRefusedError("Connection refused")
126126
127127 with qt_app_context ():
128- dlg = DataLabConnectionDialog (fake_connect )
128+ dlg = ConnectionDialog (fake_connect )
129129 dlg .exec ()
Original file line number Diff line number Diff line change @@ -28,3 +28,9 @@ objects.
2828
2929.. autoclass :: cdlclient.simplemodel.ImageObj
3030 :members:
31+
32+ Connection dialog
33+ ^^^^^^^^^^^^^^^^^
34+
35+ .. autoclass :: cdlclient.widgets.ConnectionDialog
36+ :members:
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ DataLab Simple Client (``cdlclient`` package) is a Python library providing a
1313remote proxy to a DataLab application (server). It allows to use DataLab
1414features from a remote computer, and/or from a third-party application.
1515
16+ It also provides widgets to embed DataLab features in a Qt application
17+ (connection dialog, etc.). For this particular use case, the library relies
18+ on `QtPy `_.
19+
1620.. figure :: _static/plotpy-stack-powered.png
1721 :align: center
1822
@@ -44,6 +48,7 @@ Copyrights and licensing
4448.. _PlotPyStack : https://github.com/PlotPyStack
4549.. _guidata : https://pypi.python.org/pypi/guidata
4650.. _PlotPy : https://pypi.python.org/pypi/PlotPy
51+ .. _QtPy : https://pypi.python.org/pypi/QtPy
4752.. _PyPI : https://pypi.python.org/pypi/DataLab
4853.. _Home : https://github.com/Codra-Ingenierie-Informatique/DataLabSimpleClient/
4954.. _Documentation : https://cdlapp.readthedocs.io/
Original file line number Diff line number Diff line change @@ -85,3 +85,19 @@ class (on the section "Remote control").
8585.. _XML-RPC : https://docs.python.org/3/library/xmlrpc.html
8686
8787.. _Spyder : https://www.spyder-ide.org/
88+
89+
90+ Connection dialog
91+ ^^^^^^^^^^^^^^^^^
92+
93+ The DataLab Simple Client package provides a connection dialog that may be used
94+ to connect to a running DataLab instance. It is exposed by the
95+ :py:class: `cdlclient.widgets.ConnectionDialog ` class.
96+
97+ .. figure :: /images/shots/connect_dialog.png
98+
99+ Screenshot of connection dialog (``cdlclient.widgets.ConnectionDialog ``)
100+
101+ Example of use:
102+
103+ .. literalinclude :: ../cdlclient/tests/connect_dialog.py
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ cd %SCRIPTPATH%\..
1818set PATH = C:\Program Files\HTML Help Workshop;C:\Program Files (x86)\HTML Help Workshop;%PATH%
1919sphinx-build -b latex doc build\doc
2020cd build\doc
21- pdflatex %LIBNAME% .tex
21+ pdflatex -interaction=nonstopmode -quiet %LIBNAME% .tex
22+ @ REM Build again to fix table of contents
23+ pdflatex -interaction=nonstopmode -quiet %LIBNAME% .tex
2224start %LIBNAME% .pdf
2325call %FUNC% EndOfScript
You can’t perform that action at this time.
0 commit comments