[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/ktimetracker
From:       Thorsten Staerk <dev () staerk ! de>
Date:       2010-03-07 12:32:16
Message-ID: 1267965136.583576.2675.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1100380 by tstaerk:

I18N:Re-adding a field to manipulate a task's time relatively.
CCBUGS:226915


 M  +5 -0      edittaskdialog.cpp  
 M  +14 -0     edittaskdialog.h  
 M  +53 -12    edittaskdialog.ui  
 M  +5 -5      task.cpp  
 M  +4 -7      taskview.cpp  


--- trunk/KDE/kdepim/ktimetracker/edittaskdialog.cpp #1100379:1100380
@@ -66,6 +66,11 @@
     return m_ui->tasknamelineedit->text();
 }
 
+QString EditTaskDialog::timeChange()
+{
+    return m_ui->letimechange->text();
+}
+
 void EditTaskDialog::setTask( const QString &name )
 {
     m_ui->tasknamelineedit->setText( name );
--- trunk/KDE/kdepim/ktimetracker/edittaskdialog.h #1100379:1100380
@@ -10,6 +10,19 @@
     class EditTaskDialog;
 }
 
+/**
+ * Class to show a dialog in ktimetracker to enter data about a task.
+ *
+ * Holds task name and auto-tracking virtual desktops.
+ *
+ * Typically this class will be called by a taskview object to enter a new task
+ * or to edit an existing task. After quitting, you can read out task name and all
+ * properties till you delete the object.
+ *
+ * @short Class to show a dialog to enter data about a task
+ * @author Thorsten Staerk
+ */
+
 class EditTaskDialog : public QDialog
 {
     Q_OBJECT
@@ -17,6 +30,7 @@
     EditTaskDialog( TaskView *parent, const QString &caption, DesktopList* \
desktopList = 0 );  ~EditTaskDialog();
     QString taskName();
+    QString timeChange();
     void setTask( const QString &name );
     void status( DesktopList *desktopList) const;
 
--- trunk/KDE/kdepim/ktimetracker/edittaskdialog.ui #1100379:1100380
@@ -16,13 +16,25 @@
   <layout class="QGridLayout" name="gridLayout">
    <item row="0" column="0">
     <widget class="QLabel" name="tasknamelabel">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="text">
       <string>Task Name:</string>
      </property>
     </widget>
    </item>
-   <item row="0" column="1">
+   <item row="0" column="1" colspan="2">
     <widget class="QLineEdit" name="tasknamelineedit">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="whatsThis">
       <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; \
&quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;  \
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; \
/&gt;&lt;style type=&quot;text/css&quot;&gt; @@ -33,7 +45,46 @@
      </property>
     </widget>
    </item>
+   <item row="1" column="0" colspan="3">
+    <widget class="QPushButton" name="edittimespushbutton">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="whatsThis">
+      <string>To change this task's time, you have to edit its event \
history.</string> +     </property>
+     <property name="text">
+      <string>Edit Times</string>
+     </property>
+    </widget>
+   </item>
    <item row="2" column="0" colspan="2">
+    <widget class="QLabel" name="label">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="text">
+      <string>Change time (in minutes, e.g. -60)</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="2">
+    <widget class="QLineEdit" name="letimechange">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" colspan="3">
     <widget class="QGroupBox" name="autotrackinggroupbox">
      <property name="title">
       <string>Auto Tracking</string>
@@ -47,7 +98,7 @@
      <layout class="QGridLayout" name="gridLayout_2"/>
     </widget>
    </item>
-   <item row="3" column="0" colspan="2">
+   <item row="4" column="0" colspan="2">
     <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
@@ -57,16 +108,6 @@
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
-    <widget class="QPushButton" name="edittimespushbutton">
-     <property name="whatsThis">
-      <string>To change this task's time, you have to edit its event \
                history.</string>
-     </property>
-     <property name="text">
-      <string>Edit Times</string>
-     </property>
-    </widget>
-   </item>
   </layout>
  </widget>
  <resources/>
--- trunk/KDE/kdepim/ktimetracker/task.cpp #1100379:1100380
@@ -292,11 +292,6 @@
     mDesktops = desktopList;
 }
 
-void Task::changeTime( long minutes, timetrackerstorage* storage )
-{
-    changeTimes( minutes, minutes, storage);
-}
-
 QString Task::addTime( long minutes )
 {
     kDebug(5970) << "Entering function";
@@ -393,6 +388,11 @@
     kDebug(5970) << "Leaving function";
 }
 
+void Task::changeTime( long minutes, timetrackerstorage* storage )
+{
+    changeTimes( minutes, minutes, storage);
+}
+
 void Task::changeTotalTimes( long minutesSession, long minutes )
 {
     kDebug(5970)
--- trunk/KDE/kdepim/ktimetracker/taskview.cpp #1100379:1100380
@@ -945,14 +945,11 @@
         task->setName(taskName, d->mStorage);
 
         // update session time as well if the time was changed
-        long total, session, totalDiff, sessionDiff;
-        total = totalDiff = session = sessionDiff = 0;
-        DesktopList desktopList;
-        dialog->status(&desktopList);
+        if (!dialog->timeChange().isEmpty())
+        {
+            task->changeTime(dialog->timeChange().toInt(),d->mStorage);
+        }
 
-        if ( totalDiff != 0 || sessionDiff != 0)
-            task->changeTimes( sessionDiff, totalDiff, d->mStorage );
-
         // If all available desktops are checked, disable auto tracking,
         // since it makes no sense to track for every desktop.
         if (desktopList.size() == _desktopTracker->desktopCount())


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic