From 3625241ddcf39d90c03e35662a0e289b510fe628 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 22 Jul 2010 12:09:05 +0100 Subject: [PATCH] Show Studios date --- src/mainw.py | 20 ++++++++++++++------ ui/dia_studios.ui | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/src/mainw.py b/src/mainw.py index 2da6cc9..7adf16b 100755 --- a/src/mainw.py +++ b/src/mainw.py @@ -6,8 +6,9 @@ import jack from os import path from functools import partial -from PyQt4.QtCore import QFile, QIODevice, QSize, QTextStream, QTimer, SIGNAL, SLOT -from PyQt4.QtGui import QDialog, QDialogButtonBox +from time import ctime +from PyQt4.QtCore import Qt, QFile, QIODevice, QSize, QTextStream, QTimer, SIGNAL, SLOT +from PyQt4.QtGui import QDialog, QDialogButtonBox, QTableWidgetItem from PyQt4.QtXml import QDomDocument from PyKDE4.kdecore import i18n, KUrl from PyKDE4.kdeui import KAction, KIcon, KMessageBox, KStandardAction, KXmlGuiWindow @@ -447,21 +448,28 @@ class StudiosW(QDialog, ui_dia_studios.Ui_StudiosW): self.setupUi(self) self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) + self.listStudio.setColumnWidth(0, 200) self.connect(self, SIGNAL("accepted()"), self.Done) - self.connect(self.listStudio, SIGNAL("currentRowChanged(int)"), self.checkOkButton) + self.connect(self.listStudio, SIGNAL("currentCellChanged(int, int, int, int)"), self.checkOkButton) list_of_ladish_studios = shared.controlBus.GetStudioList() for i in range(len(list_of_ladish_studios)): - self.listStudio.addItem(str(list_of_ladish_studios[i][0])) + name = QTableWidgetItem(str(list_of_ladish_studios[i][0])) + time = QTableWidgetItem(ctime(float(list_of_ladish_studios[i][1][u'Modification Time']))) + self.listStudio.insertRow(i) + self.listStudio.setItem(i, 0, name) + self.listStudio.setItem(i, 1, time) + + self.listStudio.sortByColumn(0, Qt.AscendingOrder) def Done(self): jack.detach() - shared.controlBus.LoadStudio(str(self.listStudio.item(self.listStudio.currentRow()).text())) + shared.controlBus.LoadStudio(str(self.listStudio.item(self.listStudio.currentRow(), 0).text())) shared.jackBus.StartServer() jack.attach("Klaudia") - def checkOkButton(self, row): + def checkOkButton(self, row, b, c, d): if (row < 0): self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False) else: diff --git a/ui/dia_studios.ui b/ui/dia_studios.ui index b168c95..fe6bcf7 100644 --- a/ui/dia_studios.ui +++ b/ui/dia_studios.ui @@ -22,7 +22,42 @@ - + + + QAbstractItemView::NoEditTriggers + + + false + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + true + + + false + + + + Studio Name + + + + + Modification Time + + + -- 2.11.4.GIT