annotate filestatuswidget.h @ 291:2e34e7ee7baf more_information_dialog

Make several operations use the new more-information dialog
author Chris Cannam
date Mon, 21 Feb 2011 15:55:39 +0000
parents 8fd71f570884
children bc39f2e28da8
rev   line source
Chris@88 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@88 2
Chris@88 3 /*
Chris@88 4 EasyMercurial
Chris@88 5
Chris@88 6 Based on HgExplorer by Jari Korhonen
Chris@88 7 Copyright (c) 2010 Jari Korhonen
Chris@244 8 Copyright (c) 2011 Chris Cannam
Chris@244 9 Copyright (c) 2011 Queen Mary, University of London
Chris@88 10
Chris@88 11 This program is free software; you can redistribute it and/or
Chris@88 12 modify it under the terms of the GNU General Public License as
Chris@88 13 published by the Free Software Foundation; either version 2 of the
Chris@88 14 License, or (at your option) any later version. See the file
Chris@88 15 COPYING included with this distribution for more information.
Chris@88 16 */
Chris@88 17
Chris@88 18 #ifndef FILESTATUSWIDGET_H
Chris@88 19 #define FILESTATUSWIDGET_H
Chris@88 20
Chris@92 21 #include "filestates.h"
Chris@88 22
Chris@88 23 #include <QWidget>
Chris@230 24 #include <QList>
Chris@88 25
Chris@88 26 class QLabel;
Chris@88 27 class QListWidget;
Chris@115 28 class QPushButton;
Chris@93 29 class QFileInfo;
Chris@186 30 class ClickableLabel;
Chris@199 31 class QCheckBox;
Chris@88 32
Chris@88 33 class FileStatusWidget : public QWidget
Chris@88 34 {
Chris@88 35 Q_OBJECT
Chris@88 36
Chris@88 37 public:
Chris@88 38 FileStatusWidget(QWidget *parent = 0);
Chris@93 39 ~FileStatusWidget();
Chris@88 40
Chris@88 41 QString localPath() const { return m_localPath; }
Chris@88 42 void setLocalPath(QString p);
Chris@88 43
Chris@88 44 QString remoteURL() const { return m_remoteURL; }
Chris@88 45 void setRemoteURL(QString u);
Chris@88 46
Chris@115 47 QString state() const { return m_state; }
Chris@115 48 void setState(QString b);
Chris@106 49
Chris@92 50 FileStates fileStates() const { return m_fileStates; }
Chris@92 51 void setFileStates(FileStates sp);
Chris@88 52
Chris@95 53 bool haveChangesToCommit() const;
Chris@95 54 bool haveSelection() const;
Chris@90 55
Chris@95 56 QStringList getAllSelectedFiles() const;
Chris@103 57
Chris@95 58 QStringList getSelectedCommittableFiles() const;
Chris@103 59 QStringList getAllCommittableFiles() const;
Chris@103 60
Chris@109 61 QStringList getSelectedRevertableFiles() const;
Chris@109 62 QStringList getAllRevertableFiles() const;
Chris@109 63
Chris@95 64 QStringList getSelectedAddableFiles() const;
Chris@103 65 QStringList getAllAddableFiles() const;
Chris@103 66
Chris@95 67 QStringList getSelectedRemovableFiles() const;
Chris@103 68 QStringList getAllRemovableFiles() const;
Chris@95 69
Chris@163 70 QStringList getSelectedUnresolvedFiles() const;
Chris@163 71 QStringList getAllUnresolvedFiles() const;
Chris@163 72
Chris@95 73 signals:
Chris@95 74 void selectionChanged();
Chris@199 75 void showAllChanged(bool);
Chris@94 76
Chris@94 77 public slots:
Chris@94 78 void clearSelections();
Chris@230 79 void updateWidgets();
Chris@94 80
Chris@95 81 private slots:
Chris@95 82 void itemSelectionChanged();
Chris@186 83 void openButtonClicked();
Chris@95 84
Chris@88 85 private:
Chris@88 86 QString m_localPath;
Chris@186 87 ClickableLabel *m_openButton;
Chris@88 88
Chris@88 89 QString m_remoteURL;
Chris@88 90 QLabel *m_remoteURLLabel;
Chris@106 91
Chris@115 92 QString m_state;
Chris@115 93 QLabel *m_stateLabel;
Chris@115 94
Chris@115 95 QLabel *m_noModificationsLabel;
Chris@106 96
Chris@199 97 QCheckBox *m_showAllFiles;
Chris@199 98
Chris@92 99 FileStates m_fileStates;
Chris@100 100 QMap<FileStates::State, QString> m_simpleLabels;
Chris@100 101 QMap<FileStates::State, QString> m_descriptions;
Chris@94 102 QMap<FileStates::State, QListWidget *> m_stateListMap;
Chris@100 103 QString m_highlightExplanation;
Chris@88 104
Chris@93 105 QFileInfo *m_dateReference;
Chris@95 106 QStringList m_selectedFiles;
Chris@93 107
Chris@230 108 bool m_gridlyLayout;
Chris@230 109 int m_lastGridlyCount;
Chris@230 110 QList<QWidget *> m_boxes;
Chris@230 111 QWidget *m_boxesParent;
Chris@230 112
Chris@230 113 void layoutBoxesGridly(int count);
Chris@230 114 void layoutBoxesLinearly();
Chris@115 115 void updateStateLabel();
Chris@230 116 void setNoModificationsLabelText();
Chris@100 117 QString labelFor(FileStates::State, bool addHighlightExplanation = false);
Chris@100 118 void setLabelFor(QWidget *w, FileStates::State, bool addHighlightExplanation);
Chris@88 119 };
Chris@88 120
Chris@88 121 #endif