1 /**************************************************************************
3 ** This file is part of Qt Creator
5 ** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
7 ** Contact: Nokia Corporation (qt-info@nokia.com)
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
16 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
32 **************************************************************************/
37 #include <QtGui/QDialog>
40 class QSortFilterProxyModel;
53 /* StashDialog: Non-modal dialog that manages the list of stashes
54 * of the repository. Offers to show, restore, restore to branch
55 * (in case restore fails due to conflicts) on current and
56 * delete on selection/all. */
58 class StashDialog : public QDialog {
61 explicit StashDialog(QWidget *parent = 0);
64 static QString msgRepositoryLabel(const QString &repository);
67 void refresh(const QString &repository, bool force);
70 void changeEvent(QEvent *e);
74 void deleteSelection();
76 void restoreCurrent();
77 void restoreCurrentInBranch();
82 // Prompt dialog for modified repositories. Ask to undo or stash away.
83 enum ModifiedRepositoryAction {
84 ModifiedRepositoryCancel,
85 ModifiedRepositoryStash,
86 ModifiedRepositoryDiscard
89 ModifiedRepositoryAction promptModifiedRepository(const QString &stash);
90 bool promptForRestore(QString *stash, QString *branch /* = 0 */, QString *errorMessage);
91 bool ask(const QString &title, const QString &what, bool defaultButton = true);
92 void warning(const QString &title, const QString &what, const QString &details = QString());
93 int currentRow() const;
94 QList<int> selectedRows() const; \
98 QSortFilterProxyModel *m_proxyModel;
99 QPushButton *m_deleteAllButton;
100 QPushButton *m_deleteSelectionButton;
101 QPushButton *m_showCurrentButton;
102 QPushButton *m_restoreCurrentButton;
103 QPushButton *m_restoreCurrentInBranchButton;
104 QPushButton *m_refreshButton;
105 QString m_repository;
108 } // namespace Internal
111 #endif // STASHDIALOG_H