logtimewindow.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef LOGTIMEWINDOW_H
  2. #define LOGTIMEWINDOW_H
  3. #include <QScrollArea>
  4. #include <QComboBox>
  5. #include "common.h"
  6. #include "redmineitemtree.h"
  7. #include "redmineclass_time_entry.h"
  8. namespace Ui
  9. {
  10. class LogTimeWindow;
  11. }
  12. class LogTimeWindow : public QScrollArea
  13. {
  14. Q_OBJECT
  15. CALLBACK_DISPATCHER ( Redmine, LogTimeWindow, this )
  16. public:
  17. explicit LogTimeWindow ( QWidget *parent = 0 );
  18. ~LogTimeWindow();
  19. QList<QJsonObject> issues_get_byProjectId ( int project_id );
  20. /*
  21. * TODO: the next public stuff (but not slots) should be moved to
  22. * the protected section:
  23. */
  24. RedmineItemTree projects;
  25. RedmineItemTree issues;
  26. int selected_project_id;
  27. QHash<int, QList<QJsonObject>> issues_byProjectId;
  28. QHash<int, QList<QJsonObject>> issuesFiltered_byProjectId;
  29. signals:
  30. void on_destructor();
  31. private slots:
  32. void on_cancel_clicked();
  33. void on_accept_clicked();
  34. void on_issue_itemClicked ( QTreeWidgetItem *item, int column );
  35. void on_issue_itemSelectionChanged();
  36. void on_project_currentIndexChanged ( int index );
  37. void on_issue_doubleClicked ( const QModelIndex &index );
  38. void on_comment_editingFinished();
  39. void on_saveSuccess();
  40. void on_saveTimeout();
  41. void on_saveFailure ( QNetworkReply *reply );
  42. private:
  43. int updateLastLogTime();
  44. void get_time_entries_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  45. QMutex updateProjectsMutex;
  46. QMutex updateIssuesMutex;
  47. int updateIssues();
  48. int updateProjects();
  49. void get_issues_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  50. void issues_display();
  51. void setIssuesFilterItems ( QComboBox *box, QHash<int, QJsonObject> table_old, QHash<int, QJsonObject> table, QString keyname );
  52. void get_projects_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  53. void projects_display();
  54. QMutex projectsDisplayMutex;
  55. QMutex projectsDisplayExceptionMutex;
  56. QTimer projectsDisplayRetryTimer;
  57. QHash<int, int> selected_issues_id;
  58. RedmineClass_TimeEntry timeEntry;
  59. Ui::LogTimeWindow *ui;
  60. };
  61. #endif // LOGTIMEWINDOW_H