Exemplo n.º 1
0
	def settings(self):
		if self.settings_window is None:
			window = QDialog(self)
			self.settings_window = window
		else: window = self.settings_window
		window = self.settings_window
		window.setWindowTitle('Settings')
		
		window.notelabel = QLabel("Currently these settings are only guaranteed to work prior to loading the first MIDI!\nYou'll have to restart ADLMIDI pyGui to change them again if they stop working. \n\nSorry! This will be fixed soon!")
		window.notelabel.setWordWrap(True)
		window.notelabel.setStyleSheet("font-size: 8pt; border-style: dotted; border-width: 1px; padding: 12px;")
		window.banklabel = QLabel("<B>Choose Instrument Bank</B>")
		window.space     = QLabel("")
		window.optlabel  = QLabel("<B>Options</B>")
		
		window.combo = QComboBox()
		window.combo.addItems(self.banks)
		#window.combo.setMaximumWidth(350)
		window.combo.setMaxVisibleItems(12)
		window.combo.setStyleSheet("combobox-popup: 0;")
		window.combo.setCurrentIndex(int(self.progset.value("sound/bank", 1)))
		window.combo.currentIndexChanged.connect(self.saveSettings)
		
		window.perc		= QCheckBox("Adlib Percussion Instrument Mode")
		#window.perc.stateChanged.connect(self.checkOpts)
		window.tremamp  = QCheckBox("Tremolo Amplification Mode")
		#window.tremamp.stateChanged.connect(self.checkOpts)
		window.vibamp   = QCheckBox("Vibrato Amplification Mode")
		#window.vibamp.stateChanged.connect(self.checkOpts)
		window.modscale = QCheckBox("Scaling of Modulator Volume")
		#window.modscale.stateChanged.connect(self.checkOpts)
		
		window.okButton = QPushButton('OK')
		window.okButton.clicked.connect(window.hide)
		
		vbox = QVBoxLayout()
		vbox.addWidget(window.space)
		vbox.addWidget(window.banklabel)
		vbox.addWidget(window.combo)
		vbox.addWidget(window.space)
		vbox.addWidget(window.optlabel)
		vbox.addWidget(window.perc)
		vbox.addWidget(window.tremamp)
		vbox.addWidget(window.vibamp)
		vbox.addWidget(window.modscale)
		vbox.addWidget(window.notelabel)
		
		hbox = QHBoxLayout()
		hbox.addStretch(1)
		hbox.addWidget(window.okButton)
		
		vbox.addLayout(hbox)
		window.setLayout(vbox) 
		
		window.setFixedSize(530, 369)
		window.show()
		window.activateWindow()
		window.raise_()
Exemplo n.º 2
0
 def add_col(self, a):
     if self.mySQL.do:
         da_2 = QDialog(self.app)
         if self.table_Name != None:
             self.app.ref = True
             da_2.setWindowTitle("Delete Column From %s.%s" %
                                 (self.Data_Name, self.table_Name))
             da_2.setFixedSize(600, 50)
             line_1 = edit.editText()
             but = QPushButton('ADD')
             hbox = QHBoxLayout(da_2)
             for i in (QLabel("New Column: "), line_1, but):
                 hbox.addWidget(i)
             but.clicked.connect(lambda: self.mySQL.add_Tcol(
                 self.Data_Name, self.table_Name, line_1.toPlainText()))
             da_2.exec_()
         else:
             MsgBox_2().showMsg("Select  Table From %s" % self.Data_Name)
     else:
         MsgBox_2().showMsg("Error: Can't Connect to MySQL Server ")
Exemplo n.º 3
0
 def drop_table(self, a):
     if self.mySQL.do:
         if self.Data_Name != None:
             da = QDialog(self.app)
             da.setWindowTitle("%s From %s" % (a.text(), self.Data_Name))
             da.setFixedSize(300, 100)
             form = QFormLayout(da)
             lin = QLineEdit()
             lin.setFont(QFont("", 14))
             but = QPushButton("Delete Table")
             but.clicked.connect(
                 lambda: self.mySQL.drop_table(self.Data_Name, lin.text()))
             form.addRow(QLabel("<h3>Name Table</h3>"), lin)
             form.setSpacing(30)
             form.addRow(but)
             self.app.ref = True
             da.exec_()
         else:
             MsgBox_2().showMsg("Plz Select Database")
     else:
         MsgBox_2().showMsg("Error: Can't Connect to MySQL Server ")
Exemplo n.º 4
0
 def data(self, a):
     if self.mySQL.do:
         di_ac = {
             "Create Database": self.mySQL.create_data,
             "Delete Database": self.mySQL.drop_data,
         }
         da = QDialog(self.app)
         da.setFixedSize(300, 100)
         form = QFormLayout(da)
         lin = QLineEdit()
         lin.setFont(QFont("", 14))
         but = QPushButton("%s" % str(a.text()).split(' ')[0])
         but.clicked.connect(lambda: di_ac[a.text()](lin.text()))
         form.addRow(QLabel("<h3>Name Database</h3>"), lin)
         form.setSpacing(30)
         form.addRow(but)
         da.setWindowTitle("%s" % a.text())
         da.exec_()
         self.app.ref = True
     else:
         MsgBox_2().showMsg("Error: Can't Connect to MySQL Server ")
Exemplo n.º 5
0
 def rm_row(self, a):
     if self.mySQL.do:
         da_2 = QDialog(self.app)
         if self.table_Name != None:
             da_2.setWindowTitle("Delete Row From %s.%s" %
                                 (self.Data_Name, self.table_Name))
             da_2.setFixedSize(400, 50)
             line_1 = QLineEdit()
             line_2 = QLineEdit()
             but = QPushButton('Delete')
             hbox = QHBoxLayout(da_2)
             for i in (QLabel("Delete Where: "), line_1, QLabel("="),
                       line_2, but):
                 hbox.addWidget(i)
             but.clicked.connect(lambda: self.mySQL.delete_Trow(
                 self.Data_Name, self.table_Name,
                 str(line_1.text() + "='%s'" % line_2.text())))
             self.app.ref = True
             da_2.exec_()
         else:
             MsgBox_2().showMsg("Select  Table  From %s" % self.Data_Name)
     else:
         MsgBox_2().showMsg("Error: Can't Connect to MySQL Server ")