Browse Source

Save&restore last add-jack configuration, remove "do not use" label

tags/1.9.8
falkTX 7 years ago
parent
commit
00a3effd0b
2 changed files with 50 additions and 91 deletions
  1. +1
    -85
      resources/ui/carla_add_jack.ui
  2. +49
    -6
      source/carla_database.py

+ 1
- 85
resources/ui/carla_add_jack.ui View File

@@ -7,88 +7,13 @@
<x>0</x>
<y>0</y>
<width>418</width>
<height>306</height>
<height>278</height>
</rect>
</property>
<property name="windowTitle">
<string>Add JACK Application</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_16">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/16x16/dialog-warning.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_17">
<property name="text">
<string>Very experimental feature! Do not use!</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_19">
<property name="maximumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../resources.qrc">:/16x16/dialog-warning.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="text">
@@ -162,9 +87,6 @@
<property name="text">
<string>Take control of main applicaton window</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
@@ -294,9 +216,6 @@
<property name="maximum">
<number>64</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
<item row="0" column="4" rowspan="2">
@@ -344,9 +263,6 @@
<property name="maximum">
<number>64</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
<item row="1" column="6">


+ 49
- 6
source/carla_database.py View File

@@ -29,10 +29,10 @@ from subprocess import Popen, PIPE

if config_UseQt5:
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings
from PyQt5.QtWidgets import QDialog, QTableWidgetItem
from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QTableWidgetItem
else:
from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QThread, QSettings
from PyQt4.QtGui import QDialog, QTableWidgetItem
from PyQt4.QtGui import QDialog, QDialogButtonBox, QTableWidgetItem

# ----------------------------------------------------------------------------------------------------------------------
# Imports (Custom)
@@ -1899,8 +1899,20 @@ class JackApplicationW(QDialog):

if False:
# kdevelop likes this :)
host = CarlaHostNull()
self.host = host
self.host = host = CarlaHostNull()

# --------------------------------------------------------------------------------------------------------------
# Load settings

self.loadSettings()

# --------------------------------------------------------------------------------------------------------------
# Set-up connections

self.finished.connect(self.slot_saveSettings)
self.ui.le_command.textChanged.connect(self.slot_commandChanged)

# ------------------------------------------------------------------------------------------------------------------

def getCommandAndFlags(self):
name = self.ui.le_name.text()
@@ -1926,13 +1938,44 @@ class JackApplicationW(QDialog):
chr(baseIntVal+flags))
return (command, name, labelSetup)

# --------------------------------------------------------------------------------------------------------
def loadSettings(self):
settings = QSettings("falkTX", "CarlaAddJackApp")

command = settings.value("Command", "", type=str)
self.ui.le_command.setText(command)
self.ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(len(command) > 0)

self.ui.le_name.setText(settings.value("Name", "", type=str))
self.ui.sb_audio_ins.setValue(settings.value("NumAudioIns", 2, type=int))
self.ui.sb_audio_outs.setValue(settings.value("NumAudioOuts", 2, type=int))
self.ui.sb_midi_ins.setValue(settings.value("NumMidiIns", 0, type=int))
self.ui.sb_midi_outs.setValue(settings.value("NumMidiOuts", 0, type=int))
self.ui.cb_manage_window.setChecked(settings.value("ManageWindow", True, type=bool))

# ------------------------------------------------------------------------------------------------------------------

@pyqtSlot(str)
def slot_commandChanged(self, text):
self.ui.buttonBox.button(QDialogButtonBox.Ok).setEnabled(len(text) > 0)

@pyqtSlot()
def slot_saveSettings(self):
settings = QSettings("falkTX", "CarlaAddJackApp")
settings.setValue("Command", self.ui.le_command.text())
settings.setValue("Name", self.ui.le_name.text())
settings.setValue("NumAudioIns", self.ui.sb_audio_ins.value())
settings.setValue("NumAudioOuts", self.ui.sb_audio_outs.value())
settings.setValue("NumMidiIns", self.ui.sb_midi_ins.value())
settings.setValue("NumMidiOuts", self.ui.sb_midi_outs.value())
settings.setValue("ManageWindow", self.ui.cb_manage_window.isChecked())

# ------------------------------------------------------------------------------------------------------------------

def done(self, r):
QDialog.done(self, r)
self.close()

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

if __name__ == '__main__':


Loading…
Cancel
Save