Warning, file /sdk/cervisia/resolvedialog.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
0003  *                          bernd@mail.berlios.de
0004  *  Copyright (c) 2003-2004 Christian Loose <christian.loose@hamburg.de>
0005  *
0006  * This program is free software; you can redistribute it and/or modify
0007  * it under the terms of the GNU General Public License as published by
0008  * the Free Software Foundation; either version 2 of the License, or
0009  * (at your option) any later version.
0010  *
0011  * This program is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  * GNU General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
0019  */
0020 
0021 #ifndef RESOLVEDIALOG_H
0022 #define RESOLVEDIALOG_H
0023 
0024 #include <QDialog>
0025 
0026 #include "diffview.h"
0027 #include <QList>
0028 
0029 class QLabel;
0030 class QTextCodec;
0031 class KConfig;
0032 class ResolveItem;
0033 
0034 class ResolveDialog : public QDialog
0035 {
0036     Q_OBJECT
0037 
0038 public:
0039     enum ChooseType { ChA, ChB, ChAB, ChBA, ChEdit };
0040 
0041     explicit ResolveDialog(KConfig &cfg, QWidget *parent = nullptr);
0042     ~ResolveDialog() override;
0043 
0044     bool parseFile(const QString &name);
0045 
0046 protected:
0047     void keyPressEvent(QKeyEvent *e) override;
0048 
0049 private slots:
0050     void backClicked();
0051     void forwClicked();
0052     void aClicked();
0053     void bClicked();
0054     void abClicked();
0055     void baClicked();
0056     void editClicked();
0057     void saveClicked();
0058     void saveAsClicked();
0059     void slotHelp();
0060 
0061 private:
0062     void updateNofN();
0063     void updateHighlight(int newitem);
0064     void choose(ChooseType ch);
0065     void chooseEdit();
0066     void saveFile(const QString &name);
0067     QString readFile();
0068     void addToMergeAndVersionA(const QString &line, DiffView::DiffType type, int &lineNo);
0069     void addToVersionB(const QString &line, DiffView::DiffType type, int &lineNo);
0070     void updateMergedVersion(ChooseType chosen);
0071     QString contentVersionA(const ResolveItem *item) const;
0072     QString contentVersionB(const ResolveItem *item) const;
0073 
0074     QLabel *nofnlabel;
0075     QPushButton *backbutton, *forwbutton;
0076     QPushButton *abutton, *bbutton, *abbutton, *babutton, *editbutton;
0077     DiffView *diff1, *diff2, *merge;
0078 
0079     QList<ResolveItem *> items;
0080     QString fname;
0081     QTextCodec *fcodec;
0082     int markeditem;
0083     KConfig &partConfig;
0084 
0085     QString m_contentMergedVersion;
0086 };
0087 
0088 #endif // RESOLVEDIALOG_H
0089 
0090 // Local Variables:
0091 // c-basic-offset: 4
0092 // End: