logtimewindow.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. private slots:
  30. void on_cancel_clicked();
  31. void on_accept_clicked();
  32. void on_issue_itemClicked ( QTreeWidgetItem *item, int column );
  33. void on_issue_itemSelectionChanged();
  34. void on_project_currentIndexChanged ( int index );
  35. void on_issue_doubleClicked ( const QModelIndex &index );
  36. void on_comment_editingFinished();
  37. void on_saveSuccess();
  38. void on_saveTimeout();
  39. void on_saveFailure ( QNetworkReply *reply );
  40. private:
  41. int updateLastLogTime();
  42. void get_time_entries_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  43. QMutex updateProjectsMutex;
  44. QMutex updateIssuesMutex;
  45. int updateIssues();
  46. int updateProjects();
  47. void get_issues_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  48. void issues_display();
  49. void setIssuesFilterItems ( QComboBox *box, QHash<int, QJsonObject> table_old, QHash<int, QJsonObject> table, QString keyname );
  50. void get_projects_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
  51. void projects_display();
  52. QMutex projectsDisplayMutex;
  53. QMutex projectsDisplayExceptionMutex;
  54. QTimer projectsDisplayRetryTimer;
  55. QHash<int, int> selected_issues_id;
  56. RedmineClass_TimeEntry timeEntry;
  57. Ui::LogTimeWindow *ui;
  58. };
  59. #endif // LOGTIMEWINDOW_H