Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add infopanel to show current LV2 path #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 95 additions & 61 deletions resources/ui/mod_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,67 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QGroupBox" name="group_sdk">
<property name="title">
<string>MOD SDK</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="l_sdk_details">
<property name="text">
<string>details here</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="hl_sdk">
<item>
<widget class="QPushButton" name="b_sdk_start">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="b_sdk_stop">
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tb_sdk">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_sdk">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_sdk_status">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QWidget" name="area_title" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
Expand Down Expand Up @@ -121,7 +182,20 @@
</layout>
</widget>
</item>
<item row="0" column="1" rowspan="4">
<item row="5" column="0">
<spacer name="spacer_bottom">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>268</width>
<height>219</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="1" rowspan="6">
<widget class="QTabWidget" name="tab_logs">
<property name="currentIndex">
<number>0</number>
Expand Down Expand Up @@ -303,14 +377,29 @@
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="group_sdk">
<item row="3" column="0">
<widget class="QGroupBox" name="group_info">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="title">
<string>MOD SDK</string>
<string>Environment</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="l_sdk_details">
<widget class="QLabel" name="label_information">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>details here</string>
</property>
Expand All @@ -319,64 +408,9 @@
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="hl_sdk">
<item>
<widget class="QPushButton" name="b_sdk_start">
<property name="text">
<string>Start</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="b_sdk_stop">
<property name="text">
<string>Stop</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="tb_sdk">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::RightArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_sdk">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="l_sdk_status">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="spacer_bottom">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>268</width>
<height>219</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
Expand Down
7 changes: 6 additions & 1 deletion source/mod-panel
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ class PanelWindow(QMainWindow):
self.fStoppingSDK = True
self.fProccessSDK.terminate()

def setInformation(self, info):
self.ui.label_information.setText(info)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add an empty line after this and the code separator

# ------------------------------------------------------------------------------------------------------------
# Main

Expand All @@ -456,18 +458,21 @@ if __name__ == '__main__':
# --------------------------------------------------------------------------------------------------------
# Set-up workdir environment as LV2_PATH, if relevant

if os.getenv("LV2_PATH") is None:
lv2_path = os.getenv("LV2_PATH")
if lv2_path is None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lv2_path and LV2_PATH point to the same thing here, best to just use LV2_PATH as single var

WORKDIR = os.getenv("WORKDIR", os.path.expanduser("~/mod-workdir"))
LV2_PATH = os.path.join(WORKDIR, "x86_64", "plugins")
if os.path.exists(LV2_PATH):
os.environ["LV2_PATH"] = LV2_PATH
lv2_path = LV2_PATH

# --------------------------------------------------------------------------------------------------------
# Create and show GUI

gui = PanelWindow()
gui.show()

gui.setInformation("<b>LV2 path:</b><br/>" + "<br/>".join(lv2_path.split(":")))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call should be done before show.
better yet, pass it as argument to the class constructor.

# --------------------------------------------------------------------------------------------------------
# App-Loop

Expand Down