From b6edf96d32850ec0939896a08eda96e63be51d63 Mon Sep 17 00:00:00 2001 From: Martin Thompson Date: Mon, 17 Nov 2008 20:37:25 +0000 Subject: [PATCH] Got some text in the "choosing area" bzr-revno: 94 --- openlp/plugins/mediamanageritem.py | 22 ++++++++++++++------ openlp/plugins/test/test_mediamanageritem.py | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/mediamanageritem.py b/openlp/plugins/mediamanageritem.py index cc75fe7fa..157b3551d 100644 --- a/openlp/plugins/mediamanageritem.py +++ b/openlp/plugins/mediamanageritem.py @@ -21,6 +21,7 @@ class ToolbarButton(QtGui.QToolButton): self.setToolTip(QtGui.QApplication.translate("main_window", tooltiptext, None, QtGui.QApplication.UnicodeUTF8)) self.setText(QtGui.QApplication.translate("main_window", tooltiptext, None, QtGui.QApplication.UnicodeUTF8)) self.setStatusTip(QtGui.QApplication.translate("main_window", statustip, None, QtGui.QApplication.UnicodeUTF8)) + # xxx button events class MediaManagerItem(QtGui.QWidget): log=logging.getLogger("MediaMgrItem") @@ -30,30 +31,39 @@ class MediaManagerItem(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.log.info("init") - self.setGeometry(QtCore.QRect(0, 0, 267, 609)) -# self.setObjectName("%sPage"%self.name) self.icon = QtGui.QIcon() self.icon.addPixmap(QtGui.QPixmap(self.iconname), QtGui.QIcon.Normal, QtGui.QIcon.Off) - self.setGeometry(QtCore.QRect(0,0,267,609)) self.Layout = QtGui.QVBoxLayout(self) self.Layout.setSpacing(0) self.Layout.setMargin(0) -# self.Layout.setObjectName("Layout") # setup toolbar self.Toolbar = QtGui.QWidget(self) -# self.Toolbar.setObjectName("%sToolbar"%self.name) self.ToolbarLayout = QtGui.QHBoxLayout(self.Toolbar) self.ToolbarLayout.setSpacing(0) self.ToolbarLayout.setMargin(0) -# self.ToolbarLayout.setObjectName("%sToolbarLayout"%self.name) self.log.info("Adding toolbar item") self.ToolbarButtons=[] self.ToolbarButtons.append(ToolbarButton(self, "LoadItem", ":/images/image_load.png", "Load something", "Load something in")) self.ToolbarButtons.append(ToolbarButton(self, "DeleteItem", ":/images/image_delete.png", "Delete something", "Delete something from")) + # add somewhere for "choosing" to happen + self.choose_area=QtGui.QWidget(self) + self.Layout.addWidget(self.choose_area) + self.choose_area.text="Stuff and Nonsense" + + def paintEvent(self, evt): + paint = QtGui.QPainter()#self.choose_area) + paint.begin(self) + paint.setPen(QtGui.QColor(168, 34, 3)) + paint.setFont(QtGui.QFont('Decorative', 10)) + paint.drawText(evt.rect(), QtCore.Qt.AlignCenter, self.choose_area.text) + paint.end() + + + # add items # self.LoadItem = QtGui.QToolButton(self.Toolbar) # icon17 = QtGui.QIcon() diff --git a/openlp/plugins/test/test_mediamanageritem.py b/openlp/plugins/test/test_mediamanageritem.py index d71a70271..ca9777d04 100644 --- a/openlp/plugins/test/test_mediamanageritem.py +++ b/openlp/plugins/test/test_mediamanageritem.py @@ -25,7 +25,7 @@ class TestMediaManager: self.app = QtGui.QApplication([]) logging.info ("App is " + str(self.app)) self.main_window = QtGui.QMainWindow() - self.main_window.resize(800, 600) + self.main_window.resize(200, 600) # self.StatusBar = QtGui.QStatusBar(self.main_window) # self.StatusBar.setObjectName("StatusBar") # self.main_window.setStatusBar(self.StatusBar) @@ -60,6 +60,7 @@ class TestMediaManager: log.info("Start") i1=MediaManagerItem() i2=MediaManagerItem() + i2.choose_area.text="More Stuff" log.info("i1"+str(i1)) log.info("i2"+str(i2)) self.MediaToolBox.addItem(i1, i1.icon, "Test1")