Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/TimeCop-work-types-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/TimeCop-work-types.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion l10n/ar.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = خلق

save = حفظ

areYouSureYouWantToDelete = هل أنت متأكد أنك تريد حذف هذا المشروع؟
areYouSureYouWantToDeleteProject = هل أنت متأكد أنك تريد حذف هذا المشروع؟

editTimer = تحرير الموقت

Expand Down
2 changes: 1 addition & 1 deletion l10n/de.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = Erstellen

save = speichern

areYouSureYouWantToDelete = Möchten Sie dieses Projekt wirklich löschen?
areYouSureYouWantToDeleteProject = Möchten Sie dieses Projekt wirklich löschen?

editTimer = Timer bearbeiten

Expand Down
26 changes: 25 additions & 1 deletion l10n/en.flt
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ whatAreYouDoing = What are you doing?

projects = Projects

workTypes = Work Types

export = Export

noProject = (no project)

noWorkType = (no work type)

confirmDelete = Confirm Delete

deleteTimerConfirm = Are you sure you want to delete this timer?
Expand All @@ -38,6 +42,8 @@ to = To

project = Project

workType = Work Type

description = Description

timeH = Time (hours)
Expand All @@ -46,17 +52,25 @@ timeCopEntries = Time Cop Entries ({ $date })

createNewProject = Create New Project

createNewWorkType = Create New Work Type

editProject = Edit Project

editWorkType = Edit Work Type

pleaseEnterAName = Please enter a name

projectName = Project Name

workTypeName = Work Type Name

create = Create

save = Save

areYouSureYouWantToDelete = Are you sure you want to delete this project?
areYouSureYouWantToDeleteProject = Are you sure you want to delete this project?

areYouSureYouWantToDeleteWorkType = Are you sure you want to delete this work type?

editTimer = Edit Timer

Expand All @@ -78,6 +92,10 @@ options = Options

groupTimers = Group Similar Timers Per Day

includeDateRangeInExportFilename = Include Date Range in Export Filename

includeTimeInExportFilename = Include Current Time in Export Filename

columns = Columns

date = Date
Expand Down Expand Up @@ -118,6 +136,12 @@ collapseDays = Collapse Days

autocompleteDescription = Autocomplete Descriptions

defaultFilterStartDateToMonday = Default Filter Start Date to Monday

allowMultipleActiveTimers = Allow Multiple Active Timers

displayProjectNameInTimer = Display Project Name in Timer

hours = Hours

total = Total
Expand Down
2 changes: 1 addition & 1 deletion l10n/es.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = Crear

save = Salvar

areYouSureYouWantToDelete = ¿Estás seguro de que deseas eliminar este proyecto?
areYouSureYouWantToDeleteProject = ¿Estás seguro de que deseas eliminar este proyecto?

editTimer = Editar temporizador

Expand Down
2 changes: 1 addition & 1 deletion l10n/fr.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = Créer

save = sauvegarder

areYouSureYouWantToDelete = Voulez-vous vraiment supprimer ce projet?
areYouSureYouWantToDeleteProject = Voulez-vous vraiment supprimer ce projet?

editTimer = Modifier la minuterie

Expand Down
2 changes: 1 addition & 1 deletion l10n/hi.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = सृजन करना

save = सहेजें

areYouSureYouWantToDelete = क्या आप वाकई इस प्रोजेक्ट को हटाना चाहते हैं?
areYouSureYouWantToDeleteProject = क्या आप वाकई इस प्रोजेक्ट को हटाना चाहते हैं?

editTimer = टाइमर संपादित करें

Expand Down
2 changes: 1 addition & 1 deletion l10n/id.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = Membuat

save = Menyimpan

areYouSureYouWantToDelete = Anda yakin ingin menghapus proyek ini?
areYouSureYouWantToDeleteProject = Anda yakin ingin menghapus proyek ini?

editTimer = Edit Timer

Expand Down
2 changes: 1 addition & 1 deletion l10n/it.flt
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ create = Crea
save = Salva

# tt-hand-translated
areYouSureYouWantToDelete = Sei sicuro di voler cancellare questo progetto?
areYouSureYouWantToDeleteProject = Sei sicuro di voler cancellare questo progetto?

# tt-hand-translated
editTimer = Modifica timer
Expand Down
2 changes: 1 addition & 1 deletion l10n/ja.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = 作成

save = 保存

areYouSureYouWantToDelete = このプロジェクトを削除しますか?
areYouSureYouWantToDeleteProject = このプロジェクトを削除しますか?

editTimer = タイマーを編集

Expand Down
2 changes: 1 addition & 1 deletion l10n/ko.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = 창조하다

save = 저장

areYouSureYouWantToDelete = 이 프로젝트를 삭제 하시겠습니까?
areYouSureYouWantToDeleteProject = 이 프로젝트를 삭제 하시겠습니까?

editTimer = 타이머 편집

Expand Down
2 changes: 1 addition & 1 deletion l10n/pt.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = Crio

save = Salve 

areYouSureYouWantToDelete = Tem certeza de que deseja excluir este projeto?
areYouSureYouWantToDeleteProject = Tem certeza de que deseja excluir este projeto?

editTimer = Editar temporizador

Expand Down
2 changes: 1 addition & 1 deletion l10n/ru.flt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ create = Создать

save = Сохранить

areYouSureYouWantToDelete = Вы уверены, что хотите удалить этот проект?
areYouSureYouWantToDeleteProject = Вы уверены, что хотите удалить этот проект?

editTimer = Редактировать таймер

Expand Down
2 changes: 1 addition & 1 deletion l10n/zh-CN.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = 创建

save = 保存

areYouSureYouWantToDelete = 您确定要删除此项目吗?
areYouSureYouWantToDeleteProject = 您确定要删除此项目吗?

editTimer = 编辑计时器

Expand Down
2 changes: 1 addition & 1 deletion l10n/zh-TW.flt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ create = 創建

save = 保存

areYouSureYouWantToDelete = 您確定要刪除此項目嗎?
areYouSureYouWantToDeleteProject = 您確定要刪除此項目嗎?

editTimer = 編輯計時器

Expand Down
8 changes: 4 additions & 4 deletions lib/blocs/locale/locale_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ part 'locale_state.dart';

class LocaleBloc extends Bloc<LocaleEvent, LocaleState> {
final SettingsProvider settings;

LocaleBloc(this.settings);

@override
LocaleState get initialState => LocaleState(null);

@override
Stream<LocaleState> mapEventToState(
LocaleEvent event,
) async* {
if(event is LoadLocaleEvent) {
if (event is LoadLocaleEvent) {
yield LocaleState(settings.getLocale());
}
else if(event is ChangeLocaleEvent) {
} else if (event is ChangeLocaleEvent) {
settings.setLocale(event.locale);
yield LocaleState(event.locale);
}
Expand Down
9 changes: 7 additions & 2 deletions lib/blocs/locale/locale_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ abstract class LocaleEvent extends Equatable {

class LoadLocaleEvent extends LocaleEvent {
const LoadLocaleEvent();
@override List<Object> get props => [];

@override
List<Object> get props => [];
}

class ChangeLocaleEvent extends LocaleEvent {
final Locale locale;

const ChangeLocaleEvent(this.locale);
@override List<Object> get props => [locale];

@override
List<Object> get props => [locale];
}
2 changes: 2 additions & 0 deletions lib/blocs/locale/locale_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ part of 'locale_bloc.dart';

class LocaleState extends Equatable {
final Locale locale;

const LocaleState(this.locale);

@override
List<Object> get props => [locale];
}
12 changes: 6 additions & 6 deletions lib/blocs/projects/projects_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
// limitations under the License.

import 'dart:async';

import 'package:bloc/bloc.dart';
import 'package:timecop/data_providers/data/data_provider.dart';
import 'package:timecop/models/project.dart';

import './bloc.dart';

class ProjectsBloc extends Bloc<ProjectsEvent, ProjectsState> {
final DataProvider data;

ProjectsBloc(this.data);

@override
Expand All @@ -32,26 +35,23 @@ class ProjectsBloc extends Bloc<ProjectsEvent, ProjectsState> {
if (event is LoadProjects) {
List<Project> projects = await data.listProjects();
yield ProjectsState(projects);
}
else if (event is CreateProject) {
} else if (event is CreateProject) {
Project newProject =
await data.createProject(name: event.name, colour: event.colour);
List<Project> projects =
state.projects.map((project) => Project.clone(project)).toList();
projects.add(newProject);
projects.sort((a, b) => a.name.compareTo(b.name));
yield ProjectsState(projects);
}
else if (event is EditProject) {
} else if (event is EditProject) {
await data.editProject(event.project);
List<Project> projects = state.projects.map((project) {
if (project.id == event.project.id) return Project.clone(event.project);
return Project.clone(project);
}).toList();
projects.sort((a, b) => a.name.compareTo(b.name));
yield ProjectsState(projects);
}
else if (event is DeleteProject) {
} else if (event is DeleteProject) {
await data.deleteProject(event.project);
List<Project> projects = state.projects
.where((p) => p.id != event.project.id)
Expand Down
28 changes: 18 additions & 10 deletions lib/blocs/projects/projects_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,36 @@ abstract class ProjectsEvent extends Equatable {
}

class LoadProjects extends ProjectsEvent {
@override List<Object> get props => [];
@override
List<Object> get props => [];
}

class CreateProject extends ProjectsEvent {
final String name;
final Color colour;

const CreateProject(this.name, this.colour)
: assert(name != null),
assert(colour != null);
@override List<Object> get props => [name, colour];
: assert(name != null),
assert(colour != null);

@override
List<Object> get props => [name, colour];
}

class EditProject extends ProjectsEvent {
final Project project;
const EditProject(this.project)
: assert(project != null);
@override List<Object> get props => [project];

const EditProject(this.project) : assert(project != null);

@override
List<Object> get props => [project];
}

class DeleteProject extends ProjectsEvent {
final Project project;
const DeleteProject(this.project)
: assert(project != null);
@override List<Object> get props => [project];

const DeleteProject(this.project) : assert(project != null);

@override
List<Object> get props => [project];
}
15 changes: 8 additions & 7 deletions lib/blocs/projects/projects_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ import 'package:timecop/models/project.dart';
class ProjectsState extends Equatable {
final List<Project> projects;

ProjectsState(this.projects)
: assert(projects != null);
ProjectsState(this.projects) : assert(projects != null);

static ProjectsState initial() {
return ProjectsState([]);
}

ProjectsState.clone(ProjectsState state)
: this(state.projects);
ProjectsState.clone(ProjectsState state) : this(state.projects);

@override List<Object> get props => [projects];
@override bool get stringify => true;
}
@override
List<Object> get props => [projects];

@override
bool get stringify => true;
}
6 changes: 3 additions & 3 deletions lib/blocs/settings/bloc.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2020 Kenton Hamaluik
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
Loading