mainwindow-full.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. private slots:
  29. void on_actionHelp_triggered();
  30. void on_actionQuit_triggered();
  31. void on_toolActionHelp_triggered();
  32. void on_projects_itemSelectionChanged();
  33. void on_issuesTree_itemSelectionChanged();
  34. void on_projectsRadio_recursive_off_toggled ( bool checked );
  35. void on_projectsRadio_recursive_on_toggled ( bool checked );
  36. void on_issuesFilter_showClosed_yes_toggled ( bool checked );
  37. void on_issuesFilter_showClosed_no_toggled ( bool checked );
  38. void on_issuesFilter_queryType_all_toggled ( bool checked );
  39. void on_issuesFilter_queryType_followed_toggled ( bool checked );
  40. void on_issuesFilter_queryType_fromMe_toggled ( bool checked );
  41. void on_issuesFilter_queryType_toMe_toggled ( bool checked );
  42. void on_issuesFilter_year_currentIndexChanged ( int index );
  43. void on_projectFilter_field_name_textChanged ( const QString &arg1 );
  44. void projects_display();
  45. void projectsShowContextMenu ( const QPoint &pos );
  46. void issuesShowContextMenu ( const QPoint &pos );
  47. void on_issuesFilter_field_name_textChanged ( const QString &arg1 );
  48. void on_issuesFilter_field_assigned_to_currentIndexChanged ( int index );
  49. void on_issuesFilter_field_status_currentIndexChanged ( int index );
  50. private:
  51. Ui::MainWindowFull *ui;
  52. QMutex projects_display_mutex;
  53. QMutex issues_display_mutex;
  54. void issues_display();
  55. void on_resize_centralWidget ( QResizeEvent *event );
  56. void on_resize_navigationDock ( QResizeEvent *event );
  57. void on_resize_filtersDock ( QResizeEvent *event );
  58. void on_resize_issueDock ( QResizeEvent *event );
  59. int navigationDockInitialWidth = 272;
  60. int filtersDockInitialWidth = 175;
  61. int issueDockInitialHeight = 300;
  62. QHash<int, QJsonObject> projects_row2project;
  63. QHash<int, QTreeWidgetItem*> projectItems_projectId2item;
  64. QHash<int, QJsonObject> issues_row2issue;
  65. void project_display_topone ( int pos, QHash<int, bool> &toremove_projects_id );
  66. void project_display_child ( QTreeWidgetItem *parent, QJsonObject child, int level, QHash<int, bool> &toremove_projects_id );
  67. void project_display_recursive ( QTreeWidgetItem *item, QJsonObject project, int level, QHash <int, bool> &toremove_projects_id );
  68. void projectResetIfUpdated ( int project_id, QJsonObject project );
  69. void projectResetRecursive ( int project_id );
  70. void issue_display ( int issue_id );
  71. void setIssuesFilterItems ( QComboBox *box, QHash<int, QJsonObject> table_old, QHash<int, QJsonObject> table, QString keyname );
  72. bool showIssues_showClosed = false;
  73. //QList<QJsonObject> selected_issues;
  74. QTimer *timerUpdateIssues;
  75. QTimer *timerUpdateProjects;
  76. enum issuesFilter_queryType {
  77. IFQT_ALL,
  78. IFQT_TOME,
  79. IFQT_FROMME,
  80. IFQT_FOLLOWED,
  81. };
  82. enum issuesFilter_queryType issuesFilter_queryType = IFQT_ALL;
  83. int issuesFilter_yearIdx = 0;
  84. QMutex projectsDisplayMutex;
  85. QMutex projectsDisplayExceptionMutex;
  86. QTimer projectsDisplayRetryTimer;
  87. QString issuesFilter_field_subjectPart = "";
  88. QHash <int, QJsonObject> issuesFiltered_statuses;
  89. QHash <int, QJsonObject> issuesFiltered_authors;
  90. QHash <int, QJsonObject> issuesFiltered_assignees;
  91. int issuesFilter_field_assignee_id = 0;
  92. int issuesFilter_field_status_id = 0;
  93. void issue_display_field ( QWidget *label, QWidget *field, int pos = -1 );
  94. void issue_display_dateField ( QString field_name, QString field_value );
  95. void issue_display_stringField ( QString field_name, QString field_value );
  96. void issue_display_enumField ( QString field_name, int field_value_id );
  97. void issue_display_dateTimeField ( QString field_name, QString field_value );
  98. void issue_display_assigneeField ( QString field_name, int assignee_user_id );
  99. void issue_display_authorField ( QString field_name, int assignee_user_id, QString author_user_name );
  100. void issue_display_multilineStringField ( QString field_name, QString field_value );
  101. void issue_display_doneRatioField ( QString field_name, QString field_value );
  102. void issue_display_intField ( QString field_name, int field_value );
  103. void issue_display_statusField ( QString field_name, int status_id );
  104. void issue_display_trackerField ( QString field_name, int tracker_id );
  105. void issue_display_projectField ( QString field_name, int project_id );
  106. void issue_display_categoryField ( QString field_name, int category_id );
  107. void issue_display_postproc();
  108. int issue_field_pos;
  109. QHash<int , QPair<QWidget *, QWidget*>> issue_fields;
  110. void issue_clear();
  111. int issue_columns = 3;
  112. int issue_column_cur = 0;
  113. QJsonObject issue;
  114. };
  115. #endif // MAINWINDOWFULL_H