123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- #ifndef MAINWINDOWCOMMON_H
- #define MAINWINDOWCOMMON_H
- #include <QMainWindow>
- #include <QTableWidgetSelectionRange>
- #include <QMutex>
- #include "redmineitemtree.h"
- #include "roles.h"
- #include "memberships.h"
- #include "enumerations.h"
- #include "common.h"
- class MainWindowCommon : public QMainWindow
- {
- Q_OBJECT
- public:
- explicit MainWindowCommon ( QWidget *parent = 0 );
- ~MainWindowCommon();
- QList<QJsonObject> issues_get_byProjectId ( int project_id );
- /*
- * TODO: the next public stuff (but not slots) should be moved to
- * the protected section:
- */
- RedmineItemTree projects;
- RedmineItemTree issues;
- protected:
- static const int SORT_DEPTH = 3;
- enum ESortColumn {
- SORT_UNDEFINED = 0,
- SORT_NAME_ASC,
- SORT_NAME_DESC,
- SORT_ASSIGNEE_ASC,
- SORT_ASSIGNEE_DESC,
- SORT_DUE_TO_ASC,
- SORT_DUE_TO_DESC,
- SORT_STATUS_POS_ASC,
- SORT_STATUS_POS_DESC,
- SORT_UPDATED_ON_ASC,
- SORT_UPDATED_ON_DESC,
- SORT_STATUS_ISCLOSED_ASC,
- };
- typedef bool ( *sortfunct_t ) ( const QJsonObject &issue_a, const QJsonObject &issue_b );
- // TODO: deduplicate sortLogicalIndex+sortOrder and sortColumn
- int sortLogicalIndex = -1;
- Qt::SortOrder sortOrder;
- enum ESortColumn sortColumn[SORT_DEPTH];
- QMap <enum ESortColumn, sortfunct_t> sortFunctMap;
- /*
- * TODO: the next protected stuff (but not slots) should be moved to
- * the private section:
- */
- QHash<int, QList<QJsonObject>> issues_byProjectId;
- Roles roles;
- Memberships memberships;
- Enumerations enumerations;
- protected slots:
- int updateEnumerations();
- int updateMemberships();
- int updateProjects();
- int updateIssues();
- int updateRoles();
- signals:
- public slots:
- private:
- /* projects */
- virtual void projects_display();
- virtual void issues_display();
- void get_enumerations_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
- void get_memberships_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
- void get_projects_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
- void get_issues_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
- void get_roles_callback ( QNetworkReply *reply, QJsonDocument *json, void *arg );
- QMutex updateProjectsMutex;
- QMutex updateIssuesMutex;
- };
- #endif // MAINWINDOWCOMMON_H
|