jtkorhonen@0: /**************************************************************************** jtkorhonen@30: ** Copyright (C) Jari Korhonen, 2010 (under lgpl) jtkorhonen@0: ****************************************************************************/ jtkorhonen@0: jtkorhonen@0: #ifndef MAINWINDOW_H jtkorhonen@0: #define MAINWINDOW_H jtkorhonen@0: jtkorhonen@0: #include jtkorhonen@0: jtkorhonen@0: #include "hgexpwidget.h" jtkorhonen@0: #include "hgrunner.h" jtkorhonen@0: #include "common.h" jtkorhonen@0: jtkorhonen@0: QT_BEGIN_NAMESPACE jtkorhonen@0: class QAction; jtkorhonen@0: class QMenu; jtkorhonen@0: QT_END_NAMESPACE jtkorhonen@0: jtkorhonen@0: enum HGACTIONS jtkorhonen@0: { jtkorhonen@0: ACT_NONE, jtkorhonen@0: ACT_STAT, jtkorhonen@0: ACT_HEADS, jtkorhonen@0: ACT_PARENTS, jtkorhonen@0: ACT_LOG, jtkorhonen@0: ACT_REMOVE, jtkorhonen@0: ACT_ADD, jtkorhonen@0: ACT_INCOMING, jtkorhonen@0: ACT_PUSH, jtkorhonen@0: ACT_PULL, jtkorhonen@0: ACT_CLONEFROMREMOTE, jtkorhonen@0: ACT_INIT, jtkorhonen@0: ACT_COMMIT, jtkorhonen@0: ACT_ANNOTATE, jtkorhonen@0: ACT_FILEDIFF, jtkorhonen@0: ACT_FOLDERDIFF, jtkorhonen@0: ACT_CHGSETDIFF, jtkorhonen@0: ACT_UPDATE, jtkorhonen@0: ACT_REVERT, jtkorhonen@0: ACT_MERGE, jtkorhonen@0: ACT_RESOLVE_LIST, jtkorhonen@11: ACT_SERVE, jtkorhonen@33: ACT_RESOLVE_MARK, jtkorhonen@33: ACT_RETRY_MERGE, jtkorhonen@34: ACT_TAG, jtkorhonen@36: ACT_HG_IGNORE, jtkorhonen@0: }; jtkorhonen@0: jtkorhonen@0: jtkorhonen@0: class MainWindow : public QMainWindow jtkorhonen@0: { jtkorhonen@0: Q_OBJECT jtkorhonen@0: jtkorhonen@0: public: jtkorhonen@0: MainWindow(); jtkorhonen@0: HgExpWidget *hgExp; jtkorhonen@0: void writeSettings(); jtkorhonen@0: void enableDisableActions(); jtkorhonen@0: jtkorhonen@0: //Paths to remote repo & workfolder jtkorhonen@0: //Local repo is directory "./hg/" under work folder jtkorhonen@0: QString remoteRepoPath; jtkorhonen@0: QString workFolderPath; jtkorhonen@0: jtkorhonen@30: QString remoteRepoMruList[NUM_PATHS_IN_MRU_LIST]; jtkorhonen@30: QString workFolderMruList[NUM_PATHS_IN_MRU_LIST]; jtkorhonen@30: jtkorhonen@0: //User info for commits jtkorhonen@0: QString userInfo; jtkorhonen@0: bool firstStart; jtkorhonen@0: jtkorhonen@0: protected: jtkorhonen@0: void closeEvent(QCloseEvent *event); jtkorhonen@0: void timerEvent(QTimerEvent *event); jtkorhonen@0: jtkorhonen@0: public slots: jtkorhonen@0: void hgStat(); jtkorhonen@0: void tabChanged(int currTab); jtkorhonen@0: jtkorhonen@0: private slots: jtkorhonen@0: void about(); jtkorhonen@0: void hgRemove(); jtkorhonen@0: void hgAdd(); jtkorhonen@0: void hgCommit(); jtkorhonen@0: void hgFileDiff(); jtkorhonen@0: void hgFolderDiff(); jtkorhonen@0: void hgChgSetDiff(); jtkorhonen@0: void hgUpdate(); jtkorhonen@0: void hgRevert(); jtkorhonen@0: void hgMerge(); jtkorhonen@33: void hgRetryMerge(); jtkorhonen@0: void settings(); jtkorhonen@0: void hgCloneFromRemote(); jtkorhonen@0: void hgInit(); jtkorhonen@0: void hgIncoming(); jtkorhonen@0: void hgPush(); jtkorhonen@0: void hgPull(); jtkorhonen@0: void hgUpdateToRev(); jtkorhonen@0: void hgAnnotate(); jtkorhonen@0: void hgResolveList(); jtkorhonen@0: void hgResolveMark(); jtkorhonen@34: void hgTag(); jtkorhonen@11: void hgServe(); jtkorhonen@34: void hgIgnore(); jtkorhonen@0: jtkorhonen@0: private: jtkorhonen@0: void hgHeads(); jtkorhonen@0: void hgParents(); jtkorhonen@0: void hgLog(); jtkorhonen@0: void createActions(); jtkorhonen@0: void connectActions(); jtkorhonen@0: void createMenus(); jtkorhonen@0: void createToolBars(); jtkorhonen@0: void createStatusBar(); jtkorhonen@0: void readSettings(); jtkorhonen@0: void splitChangeSets(QStringList *list, QString hgLogOutput); jtkorhonen@34: int getCommentOrTag(QString& commentOrTag, QString question, QString dlgTitle); jtkorhonen@2: void presentLongStdoutToUser(QString stdo); jtkorhonen@17: void countModifications(QListWidget *workList, int& added, int& modified, int& removed, int& notTracked, jtkorhonen@17: int& selected, jtkorhonen@17: int& selectedAdded, int& selectedModified, int& selectedRemoved, int& selectedNotTracked); jtkorhonen@0: bool isSelectedModified(QListWidget *workList); jtkorhonen@17: bool areAllSelectedUntracked(QListWidget *workList); jtkorhonen@6: bool isSelectedDeletable(QListWidget *workList); jtkorhonen@17: bool areAllSelectedCommitable(QListWidget *workList); jtkorhonen@28: QString listAllUpIpV4Addresses(); jtkorhonen@34: QString filterTag(QString tag); jtkorhonen@0: jtkorhonen@0: //Actions enabled flags jtkorhonen@0: bool remoteRepoActionsEnabled; jtkorhonen@0: bool localRepoActionsEnabled; jtkorhonen@0: jtkorhonen@0: //File menu actions jtkorhonen@0: QAction *hgInitAct; jtkorhonen@0: QAction *hgCloneFromRemoteAct; jtkorhonen@0: QAction *settingsAct; jtkorhonen@0: QAction *exitAct; jtkorhonen@0: jtkorhonen@33: //Repo actions jtkorhonen@0: QAction *hgIncomingAct; jtkorhonen@0: QAction *hgPushAct; jtkorhonen@0: QAction *hgPullAct; jtkorhonen@0: QAction *hgStatAct; jtkorhonen@0: QAction *hgFileDiffAct; jtkorhonen@0: QAction *hgFolderDiffAct; jtkorhonen@0: QAction *hgChgSetDiffAct; jtkorhonen@0: QAction *hgRevertAct; jtkorhonen@0: QAction *hgAddAct; jtkorhonen@0: QAction *hgRemoveAct; jtkorhonen@0: QAction *hgUpdateAct; jtkorhonen@0: QAction *hgCommitAct; jtkorhonen@0: QAction *hgMergeAct; jtkorhonen@33: QAction *hgRetryMergeAct; jtkorhonen@0: QAction *hgUpdateToRevAct; jtkorhonen@0: QAction *hgAnnotateAct; jtkorhonen@0: QAction *hgResolveListAct; jtkorhonen@0: QAction *hgResolveMarkAct; jtkorhonen@34: QAction *hgTagAct; jtkorhonen@34: QAction *hgIgnoreAct; jtkorhonen@11: QAction *hgServeAct; jtkorhonen@0: jtkorhonen@0: //Menus jtkorhonen@0: QMenu *fileMenu; jtkorhonen@0: QMenu *advancedMenu; jtkorhonen@0: QMenu *helpMenu; jtkorhonen@0: jtkorhonen@0: //Help menu actions jtkorhonen@0: QAction *aboutAct; jtkorhonen@0: QAction *aboutQtAct; jtkorhonen@0: jtkorhonen@0: QToolBar *fileToolBar; jtkorhonen@0: QToolBar *repoToolBar; jtkorhonen@0: QToolBar *workFolderToolBar; jtkorhonen@0: jtkorhonen@0: int timerId; jtkorhonen@0: HGACTIONS runningAction; jtkorhonen@0: HgRunner *runner; jtkorhonen@0: jtkorhonen@33: int tabPage; jtkorhonen@0: unsigned char initialFileTypesBits; jtkorhonen@33: bool justMerged; jtkorhonen@0: }; jtkorhonen@0: jtkorhonen@0: #endif