summaryrefslogtreecommitdiff
path: root/tropical/qt
diff options
context:
space:
mode:
Diffstat (limited to 'tropical/qt')
-rw-r--r--tropical/qt/caldrawer.py3
-rw-r--r--tropical/qt/designer/MainWindow.ui26
-rw-r--r--tropical/qt/eventdrawer.py13
-rw-r--r--tropical/qt/mainwindow.py2
4 files changed, 36 insertions, 8 deletions
diff --git a/tropical/qt/caldrawer.py b/tropical/qt/caldrawer.py
index 1f8245b..12645f9 100644
--- a/tropical/qt/caldrawer.py
+++ b/tropical/qt/caldrawer.py
@@ -218,7 +218,8 @@ class CalDrawerScene(QGraphicsScene):
b=event.button()
if self.mouseOver>=0 and b==Qt.MouseButton.LeftButton:
event.accept()
- self.selection=self.calState.getMonthDays()[self.mouseOver]
+ s=self.calState.getMonthDays()[self.mouseOver]
+ self.calState.setSelection(s[0],s[1],s[2])
event = QEvent(DaySelectedEvent)
QCoreApplication.postEvent(self.parent, event)
diff --git a/tropical/qt/designer/MainWindow.ui b/tropical/qt/designer/MainWindow.ui
index f36edc4..bc8c1a6 100644
--- a/tropical/qt/designer/MainWindow.ui
+++ b/tropical/qt/designer/MainWindow.ui
@@ -54,6 +54,9 @@
<property name="title">
<string>File</string>
</property>
+ <addaction name="actionImport"/>
+ <addaction name="separator"/>
+ <addaction name="actionExit"/>
</widget>
<widget class="QMenu" name="menuAbout">
<property name="title">
@@ -65,6 +68,9 @@
<string>Calendars</string>
</property>
<addaction name="actionCreate"/>
+ <addaction name="actionEdit"/>
+ <addaction name="separator"/>
+ <addaction name="actionVisibility"/>
</widget>
<addaction name="menuFile"/>
<addaction name="menuCalendars"/>
@@ -87,6 +93,26 @@
<string>Create</string>
</property>
</action>
+ <action name="actionEdit">
+ <property name="text">
+ <string>Edit</string>
+ </property>
+ </action>
+ <action name="actionVisibility">
+ <property name="text">
+ <string>Visibility</string>
+ </property>
+ </action>
+ <action name="actionImport">
+ <property name="text">
+ <string>Import</string>
+ </property>
+ </action>
+ <action name="actionExit">
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
diff --git a/tropical/qt/eventdrawer.py b/tropical/qt/eventdrawer.py
index 6b9af44..1d52bb8 100644
--- a/tropical/qt/eventdrawer.py
+++ b/tropical/qt/eventdrawer.py
@@ -24,7 +24,7 @@ class EvtDrawerScene(QGraphicsScene):
self.env=env
self.eventsRect=list()
self.eventsList=list()
- self.setDay(self.env.calState.today())
+ self.calStateChanged()
def drawForeground(self, painter, rect):
self.eventsRect.clear()
@@ -62,9 +62,10 @@ class EvtDrawerScene(QGraphicsScene):
r=self.eventsRect[i]
painter.drawText(r.x(),r.y()+labelH,"Hello event")
- def setDay(self, day):
- self.eventsList=self.env.listEventsOn(day[0],day[1],day[2])
- self.update()
+ def calStateChanged(self):
+ s=self.env.calState.selection
+ self.eventsList=self.env.listEventsOn(s[0],s[1],s[2])
+ self.update()
class EvtDrawer():
@@ -87,5 +88,5 @@ class EvtDrawer():
# self.gv.setSizePolicy(spLeft);
layout.addWidget(self.gv)
- def setDay(self,day):
- self.gs.setDay(day)
+ def calStateChanged(self):
+ self.gs.calStateChanged()
diff --git a/tropical/qt/mainwindow.py b/tropical/qt/mainwindow.py
index 2805683..499b0da 100644
--- a/tropical/qt/mainwindow.py
+++ b/tropical/qt/mainwindow.py
@@ -26,7 +26,7 @@ class MainWindow(QMainWindow):
def event(self, event):
if event.type() == DaySelectedEvent:
- self.evtDrawer.setDay(self.calDrawer.getSelection())
+ self.evtDrawer.calStateChanged()
return QWidget.event(self,event) #super().event(event)
def StartApplication(env):