Warning, file /sdk/cervisia/updateview.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  * Copyright (C) 1999-2002 Bernd Gehrmann <bernd@mail.berlios.de>
0003  * Copyright (c) 2003-2008 André Wöbbeking <Woebbeking@kde.org>
0004  *
0005  * This program is free software; you can redistribute it and/or modify
0006  * it under the terms of the GNU General Public License as published by
0007  * the Free Software Foundation; either version 2 of the License, or
0008  * (at your option) any later version.
0009  *
0010  * This program is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013  * GNU General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU General Public License
0016  * along with this program; if not, write to the Free Software
0017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0018  */
0019 
0020 #ifndef UPDATEVIEW_H
0021 #define UPDATEVIEW_H
0022 
0023 #include <QTreeWidget>
0024 
0025 #include <qlist.h>
0026 
0027 #include "entry.h"
0028 
0029 class KConfig;
0030 
0031 class UpdateView : public QTreeWidget
0032 {
0033     Q_OBJECT
0034 
0035 public:
0036     enum Filter { NoFilter = 0, OnlyDirectories = 1, NoUpToDate = 2, NoRemoved = 4, NoNotInCVS = 8, NoEmptyDirectories = 16 };
0037     enum Action { Add, Remove, Update, UpdateNoAct, Commit };
0038 
0039     explicit UpdateView(KConfig &partConfig, QWidget *parent);
0040 
0041     ~UpdateView() override;
0042 
0043     void setFilter(Filter filter);
0044     Filter filter() const;
0045 
0046     bool hasSingleSelection() const;
0047     void getSingleSelection(QString *filename, QString *revision = 0) const;
0048     /* Returns a list of all marked files and directories */
0049     QStringList multipleSelection() const;
0050     /* Returns a list of all marked files, excluding directories*/
0051     QStringList fileSelection() const;
0052 
0053     void openDirectory(const QString &dirname);
0054     void prepareJob(bool recursive, Action action);
0055 
0056     const QColor &conflictColor() const;
0057     const QColor &localChangeColor() const;
0058     const QColor &remoteChangeColor() const;
0059     const QColor &notInCvsColor() const;
0060 
0061     /**
0062      * @return \c true iff unfoldTree() is active.
0063      */
0064     bool isUnfoldingTree() const;
0065 
0066     void replaceItem(QTreeWidgetItem *, QTreeWidgetItem *);
0067 
0068 signals:
0069     void fileOpened(QString filename);
0070 
0071 public slots:
0072     void unfoldSelectedFolders();
0073     void unfoldTree();
0074     void foldTree();
0075     void finishJob(bool normalExit, int exitStatus);
0076     void processUpdateLine(QString line);
0077 
0078 private slots:
0079     void itemExecuted(QTreeWidgetItem *item, int column);
0080     void itemExpandedSlot(QTreeWidgetItem *item);
0081 
0082 private:
0083     void updateItem(const QString &filename, Cervisia::EntryStatus status, bool isdir);
0084     void rememberSelection(bool recursive);
0085     void syncSelection();
0086     void markUpdated(bool laststage, bool success);
0087 
0088     void updateColors();
0089 
0090     KConfig &m_partConfig;
0091 
0092     Filter filt;
0093     Action act;
0094     QList<QTreeWidgetItem *> relevantSelection;
0095 
0096     QColor m_conflictColor;
0097     QColor m_localChangeColor;
0098     QColor m_remoteChangeColor;
0099     QColor m_notInCvsColor;
0100 
0101     /**
0102      * \c true iff unfoldTree() is active (is needed by UpdateDirItem::setOpen()).
0103      */
0104     bool m_unfoldingTree;
0105 };
0106 
0107 #endif
0108 
0109 // Local Variables:
0110 // c-basic-offset: 4
0111 // End: