[Workman-svn] SF.net SVN: workman:[38] trunk/src
An unobtrusive time-tracking program for self-employed people
Status: Pre-Alpha
Brought to you by:
jmsilva
|
From: <jm...@us...> - 2011-10-21 00:53:18
|
Revision: 38
http://workman.svn.sourceforge.net/workman/?rev=38&view=rev
Author: jmsilva
Date: 2011-10-21 00:53:11 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
- Tab order fixes
- Dummy wizard
- Dummy time worked in main window
Modified Paths:
--------------
trunk/src/gui/main_window.py
trunk/src/gui/new_project.ui
trunk/src/gui/start_session.ui
trunk/src/gui/wizard.ui
trunk/src/workman.py
Added Paths:
-----------
trunk/src/gui/wizard.py
Modified: trunk/src/gui/main_window.py
===================================================================
--- trunk/src/gui/main_window.py 2011-10-21 00:52:55 UTC (rev 37)
+++ trunk/src/gui/main_window.py 2011-10-21 00:53:11 UTC (rev 38)
@@ -106,9 +106,12 @@
self.__setStartButton(True)
self.trayIcon.setContextMenu(self.regularMenu)
#TODO: Show some info about the session in the text
- self.trayIcon.showMessage(self.tr("Work session ended."),
- self.tr("The work session has ended"))
+ self.trayIcon.showMessage(self.tr("Work session ended"),
+ self.tr("The work session has ended."))
self.show()
+ else:
+ self.trayIcon.showMessage(self.tr("End of session canceled"),
+ self.tr("Time is still being tracked"))
def startBreak(self, showMessage = True):
Modified: trunk/src/gui/new_project.ui
===================================================================
--- trunk/src/gui/new_project.ui 2011-10-21 00:52:55 UTC (rev 37)
+++ trunk/src/gui/new_project.ui 2011-10-21 00:53:11 UTC (rev 38)
@@ -23,28 +23,28 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QFormLayout" name="formLayout">
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Project name</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QLineEdit" name="projectNameBox">
<property name="toolTip">
<string>Enter the project's name here</string>
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Project description</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QTextEdit" name="descriptionBox">
<property name="toolTip">
<string>Enter an optional description for this project</string>
@@ -57,14 +57,14 @@
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Employer</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="1" column="1">
<widget class="QComboBox" name="employerChoice">
<property name="toolTip">
<string>The employer you are working for</string>
@@ -86,9 +86,9 @@
</layout>
</widget>
<tabstops>
+ <tabstop>employerChoice</tabstop>
<tabstop>projectNameBox</tabstop>
<tabstop>descriptionBox</tabstop>
- <tabstop>employerChoice</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources>
Modified: trunk/src/gui/start_session.ui
===================================================================
--- trunk/src/gui/start_session.ui 2011-10-21 00:52:55 UTC (rev 37)
+++ trunk/src/gui/start_session.ui 2011-10-21 00:53:11 UTC (rev 38)
@@ -156,6 +156,15 @@
</item>
</layout>
</widget>
+ <tabstops>
+ <tabstop>employerChoice</tabstop>
+ <tabstop>projectChoice</tabstop>
+ <tabstop>fixedTimeButton</tabstop>
+ <tabstop>sessionEndTime</tabstop>
+ <tabstop>fixedWorkButton</tabstop>
+ <tabstop>timeEdit</tabstop>
+ <tabstop>buttonBox</tabstop>
+ </tabstops>
<resources>
<include location="res.qrc"/>
</resources>
Added: trunk/src/gui/wizard.py
===================================================================
--- trunk/src/gui/wizard.py (rev 0)
+++ trunk/src/gui/wizard.py 2011-10-21 00:53:11 UTC (rev 38)
@@ -0,0 +1,65 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Workman - A time tracking program for self-employed people
+# Copyright (C) 2009 João Miguel Ferreira da Silva
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+from PyQt4 import QtGui, QtCore
+from gui.compiled_ui import Ui_Wizard
+'''
+Created on 2009/12/21
+
+@author: João Miguel Ferreira da Silva
+'''
+class WizardStartPage(QtGui.QWizardPage):
+ def __init__(self):
+ QtGui.QWizardPage.__init__(self)
+
+
+ def nextId(self):
+ button = self.findChild(
+ QtGui.QRadioButton, 'projectNoButton')
+
+ if button.isChecked():
+ return -1
+
+ return 1
+
+ def raiseCompleteChanged(self):
+ button = self.findChild(
+ QtGui.QRadioButton, 'projectNoButton')
+ if button.isChecked():
+ self.setFinalPage(True)
+ else:
+ self.setFinalPage(False)
+ self.emit(QtCore.SIGNAL('completeChanged()'))
+
+
+
+
+
+class Wizard(QtGui.QWizard, Ui_Wizard):
+
+ def __init__(self):
+ QtGui.QWizard.__init__(self)
+ self.setupUi(self)
+
+
+
+
+if __name__ == '__main__':
+ import sys
+ QtGui.QApplication(sys.argv)
+ Wizard().exec_()
\ No newline at end of file
Modified: trunk/src/gui/wizard.ui
===================================================================
--- trunk/src/gui/wizard.ui 2011-10-21 00:52:55 UTC (rev 37)
+++ trunk/src/gui/wizard.ui 2011-10-21 00:53:11 UTC (rev 38)
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>508</width>
- <height>314</height>
+ <height>397</height>
</rect>
</property>
<property name="windowTitle">
@@ -20,7 +20,7 @@
<property name="locale">
<locale language="English" country="UnitedStates"/>
</property>
- <widget class="QWizardPage" name="startPage">
+ <widget class="WizardStartPage" name="startPage">
<property name="title">
<string>Welcome</string>
</property>
@@ -105,20 +105,19 @@
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="projectNameBox">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="toolTip">
<string>The name of the project you want to create</string>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="employerLabel">
- <property name="text">
- <string>Employer</string>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="employerChoice">
+ <property name="enabled">
+ <bool>false</bool>
</property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QComboBox" name="employerChoice">
<property name="toolTip">
<string>The employer for this project</string>
</property>
@@ -134,6 +133,27 @@
</item>
</widget>
</item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Description</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QTextEdit" name="textEdit">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="employerLabel">
+ <property name="text">
+ <string>Employer</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>
@@ -147,7 +167,10 @@
</widget>
</item>
<item>
- <widget class="QRadioButton" name="radioButton">
+ <widget class="QRadioButton" name="sessionYesButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>&Yes</string>
</property>
@@ -157,7 +180,10 @@
</widget>
</item>
<item>
- <widget class="QRadioButton" name="radioButton_2">
+ <widget class="QRadioButton" name="sessionNoButton">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>&No</string>
</property>
@@ -184,8 +210,61 @@
</layout>
</widget>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>WizardStartPage</class>
+ <extends>QWizardPage</extends>
+ <header>wizard.h</header>
+ <container>1</container>
+ <slots>
+ <slot>raiseCompleteChanged()</slot>
+ </slots>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>projectYesButton</tabstop>
+ <tabstop>projectNoButton</tabstop>
+ <tabstop>projectNameBox</tabstop>
+ <tabstop>textEdit</tabstop>
+ <tabstop>employerChoice</tabstop>
+ <tabstop>sessionYesButton</tabstop>
+ <tabstop>sessionNoButton</tabstop>
+ </tabstops>
<resources>
<include location="res.qrc"/>
</resources>
- <connections/>
+ <connections>
+ <connection>
+ <sender>projectNoButton</sender>
+ <signal>clicked()</signal>
+ <receiver>startPage</receiver>
+ <slot>raiseCompleteChanged()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>63</x>
+ <y>211</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>82</x>
+ <y>301</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>projectYesButton</sender>
+ <signal>clicked()</signal>
+ <receiver>startPage</receiver>
+ <slot>raiseCompleteChanged()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>138</x>
+ <y>179</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>198</x>
+ <y>266</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
</ui>
Modified: trunk/src/workman.py
===================================================================
--- trunk/src/workman.py 2011-10-21 00:52:55 UTC (rev 37)
+++ trunk/src/workman.py 2011-10-21 00:53:11 UTC (rev 38)
@@ -133,23 +133,24 @@
employerItem = QtGui.QStandardItem(modelEmployerName)
projectItem = QtGui.QStandardItem(modelProjectName)
descriptionItem = QtGui.QStandardItem(modelDescription)
- return [projectItem, employerItem, descriptionItem]
+ timeWorkedItem = QtGui.QStandardItem(
+ self.projectItemModel.tr("Time worked goes here"))
+ return [projectItem, employerItem, descriptionItem, timeWorkedItem]
def getProjectItemModel(self):
if self.projectItemModel is None:
self.projectItemModel = QtGui.QStandardItemModel()
self.projectItemModel.setHorizontalHeaderLabels(
[self.projectItemModel.tr("Project"),
- self.projectItemModel.tr("Employer"),
- self.projectItemModel.tr("Description")])
+ self.projectItemModel.tr("Employer"),
+ self.projectItemModel.tr("Description"),
+ self.projectItemModel.tr("Time worked")])
-
for i in self.employers.values():
for j in i.projects.values():
self.projectItemModel.appendRow(
self.__newItemModelRow(
- i.name, j.name, j.description))
-
+ i.name, j.name, j.description))
return self.projectItemModel
else:
@@ -159,8 +160,11 @@
if __name__ == '__main__':
from gui.main_window import MainWindow
+ from gui.wizard import Wizard
QtGui.QApplication(sys.argv)
- data = DataStore(None)
+ data = DataStore(None)
+ y = Wizard()
+ y.exec_()
x = MainWindow(data)
x.show()
sys.exit(QtGui.qApp.exec_())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|