Skip to content

Commit

Permalink
docs: add recipe for scrot
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 22, 2020
1 parent 059fbc3 commit 90d80ff
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/scrots/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_*.png
figshare_PAAm
46 changes: 46 additions & 0 deletions docs/scrots/make_scrots_qg_import_ts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""Screenshots for quick guide import ts (not working automatically)"""
import pathlib
import sys

from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication
from pyjibe.head.main import PyJibe

app = QApplication(sys.argv)

QtCore.QLocale.setDefault(QtCore.QLocale(QtCore.QLocale.C))

mw = PyJibe()


jpkfile = pathlib.Path("figshare_PAAm/PAAm_Compliant_ROI1_force-save-"
+ "2019.10.25-10.42.02.660.jpk-force")


def cleanup_autosave(jpkfile):
"""Remove autosave files"""
path = jpkfile.parent
files = path.glob("*.tsv")
files = [f for f in files if f.name.startswith("pyjibe_")]
[f.unlink() for f in files]


cleanup_autosave(jpkfile=jpkfile)

# build up a session
mw.load_data([jpkfile])

war = mw.subwindows[0].widget()
# unfortunately, this does not grab the popped-up combobox
war.cb_rating_scheme.showPopup()
war.update()
war.repaint()
QApplication.processEvents()
QApplication.processEvents()
war.grab().save("_qg_import_ts.png")

print("Screenshot must be taken manually")
import IPython # noqa: E402
IPython.embed()

mw.close()
2 changes: 1 addition & 1 deletion pyjibe/fd/main.ui
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@
</widget>
</item>
<item alignment="Qt::AlignTop">
<widget class="QWidget" name="widget_3" native="true">
<widget class="QWidget" name="widget_main_controls" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
Expand Down

0 comments on commit 90d80ff

Please sign in to comment.