mainwindow-full.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. #ifndef MAINWINDOWFULL_H
  2. #define MAINWINDOWFULL_H
  3. #include <QTreeWidget>
  4. #include <QTimer>
  5. #include <QComboBox>
  6. #include <mainwindow-common.h>
  7. namespace Ui
  8. {
  9. class MainWindowFull;
  10. }
  11. class MainWindowFull : public MainWindowCommon
  12. {
  13. Q_OBJECT
  14. CALLBACK_DISPATCHER ( Redmine, MainWindowFull, NULL )
  15. public:
  16. explicit MainWindowFull ( QWidget *parent = 0 );
  17. ~MainWindowFull();
  18. bool issue_isFiltered ( QJsonObject issue );
  19. /*
  20. * TODO: the next public stuff should be moved to the private section:
  21. */
  22. QHash<int, int> selected_projects_id;
  23. QHash<int, int> selected_issues_id;
  24. bool showProjectIssues_recursive = false;
  25. QString projectsFilter_namePart = "";
  26. protected:
  27. bool eventFilter ( QObject *obj, QEvent *event );
  28. protected slots:
  29. private slots:
  30. void on_actionHelp_triggered();
  31. void on_actionQuit_triggered();
  32. void on_toolActionHelp_triggered();
  33. void on_projects_itemSelectionChanged();
  34. void on_issuesTree_itemSelectionChanged();
  35. void on_projectsRadio_recursive_off_toggled ( bool checked );
  36. void on_projectsRadio_recursive_on_toggled ( bool checked );
  37. void on_issuesFilter_showClosed_yes_toggled ( bool checked );
  38. void on_issuesFilter_showClosed_no_toggled ( bool checked );
  39. void on_issuesFilter_queryType_all_toggled ( bool checked );
  40. void on_issuesFilter_queryType_followed_toggled ( bool checked );
  41. void on_issuesFilter_queryType_fromMe_toggled ( bool checked );
  42. void on_issuesFilter_queryType_toMe_toggled ( bool checked );
  43. void on_issuesFilter_year_currentIndexChanged ( int index );
  44. void on_projectFilter_field_name_textChanged ( const QString &arg1 );
  45. void projects_display();
  46. void projectsShowContextMenu ( const QPoint &pos );
  47. void issuesShowContextMenu ( const QPoint &pos );
  48. void on_issuesFilter_field_name_textChanged ( const QString &arg1 );
  49. void on_issuesFilter_field_assigned_to_currentIndexChanged ( int index );
  50. void on_issuesFilter_field_status_currentIndexChanged ( int index );
  51. private:
  52. Ui::MainWindowFull *ui;
  53. QMutex projects_display_mutex;
  54. QMutex issues_display_mutex;
  55. void issues_display();
  56. void on_resize_centralWidget ( QResizeEvent *event );
  57. void on_resize_navigationDock ( QResizeEvent *event );
  58. void on_resize_filtersDock ( QResizeEvent *event );
  59. void on_resize_issueDock ( QResizeEvent *event );
  60. int navigationDockInitialWidth = 272;
  61. int filtersDockInitialWidth = 175;
  62. int issueDockInitialHeight = 300;
  63. QHash<int, QJsonObject> projects_row2project;
  64. QHash<int, QTreeWidgetItem*> projectItems_projectId2item;
  65. QHash<int, QJsonObject> issues_row2issue;
  66. void project_display_topone ( int pos, QHash<int, bool> &toremove_projects_id );
  67. void project_display_child ( QTreeWidgetItem *parent, QJsonObject child, int level, QHash<int, bool> &toremove_projects_id );
  68. void project_display_recursive ( QTreeWidgetItem *item, QJsonObject project, int level, QHash <int, bool> &toremove_projects_id );
  69. void projectResetIfUpdated ( int project_id, QJsonObject project );
  70. void projectResetRecursive ( int project_id );
  71. void issue_display ( int issue_id );
  72. void setIssuesFilterItems ( QComboBox *box, QHash<int, QJsonObject> table_old, QHash<int, QJsonObject> table, QString keyname );
  73. bool showIssues_showClosed = false;
  74. //QList<QJsonObject> selected_issues;
  75. QTimer *timerUpdateIssues;
  76. QTimer *timerUpdateProjects;
  77. enum issuesFilter_queryType {
  78. IFQT_ALL,
  79. IFQT_TOME,
  80. IFQT_FROMME,
  81. IFQT_FOLLOWED,
  82. };
  83. enum issuesFilter_queryType issuesFilter_queryType = IFQT_ALL;
  84. int issuesFilter_yearIdx = 0;
  85. QMutex projectsDisplayMutex;
  86. QMutex projectsDisplayExceptionMutex;
  87. QTimer projectsDisplayRetryTimer;
  88. QString issuesFilter_field_subjectPart = "";
  89. QHash <int, QJsonObject> issuesFiltered_statuses;
  90. QHash <int, QJsonObject> issuesFiltered_authors;
  91. QHash <int, QJsonObject> issuesFiltered_assignees;
  92. int issuesFilter_field_assignee_id = 0;
  93. int issuesFilter_field_status_id = 0;
  94. void issue_display_field ( QWidget *label, QWidget *field, int pos = -1 );
  95. void issue_display_dateField ( QString field_name, QString field_value );
  96. void issue_display_stringField ( QString field_name, QString field_value );
  97. void issue_display_enumField ( QString field_name, int field_value_id );
  98. void issue_display_dateTimeField ( QString field_name, QString field_value );
  99. void issue_display_assigneeField ( QString field_name, int assignee_user_id );
  100. void issue_display_authorField ( QString field_name, int assignee_user_id, QString author_user_name );
  101. void issue_display_multilineStringField ( QString field_name, QString field_value );
  102. void issue_display_doneRatioField ( QString field_name, QString field_value );
  103. void issue_display_intField ( QString field_name, int field_value );
  104. void issue_display_statusField ( QString field_name, int status_id );
  105. void issue_display_trackerField ( QString field_name, int tracker_id );
  106. void issue_display_projectField ( QString field_name, int project_id );
  107. void issue_display_categoryField ( QString field_name, int category_id );
  108. void issue_display_postproc();
  109. int issue_field_pos;
  110. QHash<int , QPair<QWidget *, QWidget*>> issue_fields;
  111. void issue_clear();
  112. int issue_columns = 3;
  113. int issue_column_cur = 0;
  114. QJsonObject issue;
  115. void createTrayActions();
  116. QAction *showHideAction;
  117. QAction *quitAction;
  118. QAction *openLogTimeWindowAction;
  119. QAction *openShowTimeWindowAction;
  120. void iconActivated ( QSystemTrayIcon::ActivationReason reason );
  121. };
  122. #endif // MAINWINDOWFULL_H