Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-10-13 22:54:48 -0400
committerspingel2009-10-13 22:54:48 -0400
commite0144fbb4c4f43f85ba047f3d77f49654771a5b3 (patch)
treec069217b73bdda9f46d823cc8b3b227e5832c600
parente573929f9e800549ded14bacfe38a0f260592b81 (diff)
downloadorg.eclipse.mylyn.tasks-e0144fbb4c4f43f85ba047f3d77f49654771a5b3.tar.gz
org.eclipse.mylyn.tasks-e0144fbb4c4f43f85ba047f3d77f49654771a5b3.tar.xz
org.eclipse.mylyn.tasks-e0144fbb4c4f43f85ba047f3d77f49654771a5b3.zip
RESOLVED - bug 291084: make time tracking optional and opt-in
https://bugs.eclipse.org/bugs/show_bug.cgi?id=291084
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java16
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java39
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties8
3 files changed, 49 insertions, 14 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
index 73b1f7727..186414be3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/Messages.java
@@ -69,10 +69,26 @@ public class Messages extends NLS {
public static String PlanningPageFactory_Private;
+ public static String PlanningPart_Active_time_in_Product_Label;
+
+ public static String PlanningPart_Active_time_Label;
+
+ public static String PlanningPart_Default_Product;
+
+ public static String PlanningPart_Later;
+
+ public static String PlanningPart_Next_Week;
+
public static String PlanningPart_Personal_Notes;
public static String PlanningPart_Reset_Active_Time;
+ public static String PlanningPart_Scheduled_for_X_Tooltip;
+
+ public static String PlanningPart_This_Week;
+
+ public static String PlanningPart_Today;
+
public static String RichTextAttributeEditor_Viewer_Source;
public static String TaskAttachmentDropListener_Note_that_only_the_first_file_dragged_will_be_attached;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java
index 0e293c852..e96b06cc3 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/PlanningPart.java
@@ -420,10 +420,10 @@ public class PlanningPart extends AbstractLocalEditorPart {
String labelString;
if (MonitorUiPlugin.getDefault().isTrackingOsTime()) {
- labelString = "Active time:";
+ labelString = Messages.PlanningPart_Active_time_Label;
} else {
- String productName = CommonUiUtil.getProductName("Eclipse");
- labelString = NLS.bind("Active time spent in {0}:", productName);
+ String productName = CommonUiUtil.getProductName(Messages.PlanningPart_Default_Product);
+ labelString = NLS.bind(Messages.PlanningPart_Active_time_in_Product_Label, productName);
}
Label label = toolkit.createLabel(activeTimeComposite, labelString);
label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
@@ -638,8 +638,10 @@ public class PlanningPart extends AbstractLocalEditorPart {
DateRange date = getTask().getScheduledForDate();
if (date != null) {
scheduledLabel.setText(getLabel(date));
+ scheduledLabel.setToolTipText(NLS.bind(Messages.PlanningPart_Scheduled_for_X_Tooltip, date.toString()));
} else {
scheduledLabel.setText(""); //$NON-NLS-1$
+ scheduledLabel.setToolTipText(null);
}
if (!scheduledLabel.isVisible()) {
scheduledLabel.setVisible(true);
@@ -655,18 +657,27 @@ public class PlanningPart extends AbstractLocalEditorPart {
}
private String getLabel(DateRange dateRange) {
- if (dateRange.isPresent() && !(dateRange instanceof WeekDateRange)) {
- return "Today";
- }
- if (TaskActivityUtil.getCurrentWeek().includes(dateRange)) {
- return "This Week";
- }
- Calendar endNextWeek = TaskActivityUtil.getCalendar();
- endNextWeek.add(Calendar.DAY_OF_YEAR, 7);
- if (TaskActivityUtil.getNextWeek().includes(dateRange) && dateRange.before(endNextWeek)) {
- return "Next Week";
+ if (dateRange instanceof WeekDateRange) {
+ if (dateRange.includes(TaskActivityUtil.getCalendar())) {
+ return Messages.PlanningPart_This_Week;
+ } else if (TaskActivityUtil.getNextWeek().compareTo(dateRange) == 0) {
+ return Messages.PlanningPart_Next_Week;
+ }
+ } else {
+ if (dateRange.isPresent() && !(dateRange instanceof WeekDateRange)
+ || TasksUiPlugin.getTaskActivityManager().isPastReminder(dateRange, false)) {
+ return Messages.PlanningPart_Today;
+ }
+ if (TaskActivityUtil.getCurrentWeek().includes(dateRange)) {
+ return Messages.PlanningPart_This_Week;
+ }
+ Calendar endNextWeek = TaskActivityUtil.getCalendar();
+ endNextWeek.add(Calendar.DAY_OF_YEAR, 7);
+ if (TaskActivityUtil.getNextWeek().includes(dateRange) && dateRange.before(endNextWeek)) {
+ return Messages.PlanningPart_Next_Week;
+ }
}
- return "Later";
+ return Messages.PlanningPart_Later;
}
protected void fillToolBar(ToolBarManager toolBarManager) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
index 4261552b1..1289c894a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/messages.properties
@@ -36,8 +36,16 @@ DateAttributeEditor_Clear=Clear
PersonalPart_Personal_Planning=Private
PersonAttributeEditor_Insert_My_User_Id_Tooltip=Insert My User ID
PlanningPageFactory_Private=Private
+PlanningPart_Active_time_in_Product_Label=Active time spent in {0}:
+PlanningPart_Active_time_Label=Active time:
+PlanningPart_Default_Product=Eclipse
+PlanningPart_Later=Later
+PlanningPart_Next_Week=Next Week
PlanningPart_Personal_Notes=Notes
PlanningPart_Reset_Active_Time=Reset Active Time
+PlanningPart_Scheduled_for_X_Tooltip=Scheduled for {0}
+PlanningPart_This_Week=This Week
+PlanningPart_Today=Today
RichTextAttributeEditor_Viewer_Source=View Unformatted Text

Back to the top