Browse Source

Add menu option to show/hide time panel, closes #161

tags/1.9.6
falkTX 9 years ago
parent
commit
f667e4efe5
2 changed files with 35 additions and 13 deletions
  1. +10
    -4
      resources/ui/carla_host.ui
  2. +25
    -9
      source/carla_host.py

+ 10
- 4
resources/ui/carla_host.ui View File

@@ -144,7 +144,7 @@
<x>0</x>
<y>0</y>
<width>870</width>
<height>19</height>
<height>20</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
@@ -217,6 +217,7 @@
<property name="title">
<string>&amp;Settings</string>
</property>
<addaction name="act_settings_show_time_panel"/>
<addaction name="act_settings_show_toolbar"/>
<addaction name="act_settings_show_meters"/>
<addaction name="act_settings_show_keyboard"/>
@@ -730,9 +731,6 @@
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="text">
<string>Show &amp;Toolbar</string>
</property>
@@ -793,6 +791,14 @@
<string>Show External</string>
</property>
</action>
<action name="act_settings_show_time_panel">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>Show Time Panel</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>


+ 25
- 9
source/carla_host.py View File

@@ -220,11 +220,9 @@ class HostWindow(QMainWindow):
# ----------------------------------------------------------------------------------------------------
# Set up GUI (panels)

self.fPanelTime = CarlaPanelTime(host, self)
self.fPanelTime.setEnabled(False)

if not host.isPlugin:
QTimer.singleShot(0, self.fPanelTime.show)
self.ui.panelTime = CarlaPanelTime(host, self)
self.ui.panelTime.setEnabled(False)
self.ui.panelTime.adjustSize()

# ----------------------------------------------------------------------------------------------------
# Set up GUI (rack)
@@ -345,6 +343,7 @@ class HostWindow(QMainWindow):
self.ui.act_canvas_save_image.triggered.connect(self.slot_canvasSaveImage)
self.ui.act_canvas_arrange.setEnabled(False) # TODO, later

self.ui.act_settings_show_time_panel.toggled.connect(self.slot_showTimePanel)
self.ui.act_settings_show_meters.toggled.connect(self.slot_showCanvasMeters)
self.ui.act_settings_show_keyboard.toggled.connect(self.slot_showCanvasKeyboard)
self.ui.act_settings_configure.triggered.connect(self.slot_configureCarla)
@@ -366,6 +365,7 @@ class HostWindow(QMainWindow):

self.ui.miniCanvasPreview.miniCanvasMoved.connect(self.slot_miniCanvasMoved)

self.ui.panelTime.finished.connect(self.slot_timePanelClosed)
self.ui.tabWidget.currentChanged.connect(self.slot_tabChanged)

self.scene.scaleChanged.connect(self.slot_canvasScaleChanged)
@@ -607,7 +607,7 @@ class HostWindow(QMainWindow):
self.ui.act_file_save.setEnabled(True)
self.ui.act_file_save_as.setEnabled(True)

self.fPanelTime.setEnabled(True)
self.ui.panelTime.setEnabled(True)

self.startTimers()

@@ -631,7 +631,7 @@ class HostWindow(QMainWindow):
self.ui.act_file_save.setEnabled(False)
self.ui.act_file_save_as.setEnabled(False)

self.fPanelTime.setEnabled(False)
self.ui.panelTime.setEnabled(False)

# --------------------------------------------------------------------------------------------------------
# Plugins
@@ -1217,8 +1217,11 @@ class HostWindow(QMainWindow):
settings = QSettings()

settings.setValue("Geometry", self.saveGeometry())
settings.setValue("TimePanelGeometry", self.ui.panelTime.saveGeometry())

#settings.setValue("SplitterState", self.ui.splitter.saveState())
settings.setValue("ShowToolbar", self.ui.toolBar.isVisible())
settings.setValue("ShowTimePanel", self.ui.panelTime.isVisible())
settings.setValue("ShowToolbar", self.ui.toolBar.isVisible())

diskFolders = []

@@ -1237,6 +1240,11 @@ class HostWindow(QMainWindow):

if firstTime:
self.restoreGeometry(settings.value("Geometry", ""))
self.ui.panelTime.restoreGeometry(settings.value("TimePanelGeometry", ""))

showTimePanel = settings.value("ShowTimePanel", True, type=bool)
self.ui.act_settings_show_time_panel.setChecked(showTimePanel)
self.ui.panelTime.setVisible(showTimePanel)

showToolbar = settings.value("ShowToolbar", True, type=bool)
self.ui.act_settings_show_toolbar.setChecked(showToolbar)
@@ -1306,6 +1314,10 @@ class HostWindow(QMainWindow):
# --------------------------------------------------------------------------------------------------------
# Settings (menu actions)

@pyqtSlot(bool)
def slot_showTimePanel(self, yesNo):
self.ui.panelTime.setVisible(yesNo)

@pyqtSlot(bool)
def slot_showCanvasMeters(self, yesNo):
self.ui.peak_in.setVisible(yesNo)
@@ -1538,6 +1550,10 @@ class HostWindow(QMainWindow):
# --------------------------------------------------------------------------------------------------------
# Misc

@pyqtSlot()
def slot_timePanelClosed(self):
self.ui.act_settings_show_time_panel.setChecked(False)

@pyqtSlot(int)
def slot_tabChanged(self, index):
if index != 1:
@@ -1709,7 +1725,7 @@ class HostWindow(QMainWindow):

def idleFast(self):
self.host.engine_idle()
self.fPanelTime.refreshTransport()
self.ui.panelTime.refreshTransport()

if self.fPluginCount == 0 or self.fCurrentlyRemovingAllPlugins:
return


Loading…
Cancel
Save