optiondialog.h 3.05 KB
Newer Older
Joachim Eibl's avatar
Joachim Eibl committed
1 2
/*
 *   kdiff3 - Text Diff And Merge Tool
Joachim Eibl's avatar
Joachim Eibl committed
3
 *   Copyright (C) 2002-2007  Joachim Eibl, joachim.eibl at gmx.de
Joachim Eibl's avatar
Joachim Eibl committed
4 5 6 7 8 9 10 11 12 13 14 15 16
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
Joachim Eibl's avatar
Joachim Eibl committed
17
 *   Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
Joachim Eibl's avatar
Joachim Eibl committed
18 19 20 21 22 23
 *
 */

#ifndef OPTION_DIALOG_H
#define OPTION_DIALOG_H

Joachim Eibl's avatar
0.9.93  
Joachim Eibl committed
24 25

#include <kpagedialog.h>
Joachim Eibl's avatar
Joachim Eibl committed
26
#include <QStringList>
Joachim Eibl's avatar
Joachim Eibl committed
27
#include <list>
Joachim Eibl's avatar
Joachim Eibl committed
28
#include <kcmdlineargs.h>
Joachim Eibl's avatar
Joachim Eibl committed
29

30 31
#include "options.h"

Joachim Eibl's avatar
Joachim Eibl committed
32
class OptionItem;
Joachim Eibl's avatar
Joachim Eibl committed
33 34
class OptionCheckBox;
class OptionEncodingComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
35
class OptionLineEdit;
Joachim Eibl's avatar
Joachim Eibl committed
36 37
class KKeyDialog;

Joachim Eibl's avatar
0.9.80  
Joachim Eibl committed
38

Joachim Eibl's avatar
0.9.93  
Joachim Eibl committed
39
class OptionDialog : public KPageDialog
Joachim Eibl's avatar
Joachim Eibl committed
40 41 42 43 44 45 46
{
   Q_OBJECT

public:

    OptionDialog( bool bShowDirMergeSettings, QWidget *parent = 0, char *name = 0 );
    ~OptionDialog( void );
Joachim Eibl's avatar
0.9.93  
Joachim Eibl committed
47
    QString parseOptions( const QStringList& optionList );
Joachim Eibl's avatar
Joachim Eibl committed
48 49
    QString calcOptionHelp();

50
    Options m_options;
Joachim Eibl's avatar
Joachim Eibl committed
51

Joachim Eibl's avatar
0.9.93  
Joachim Eibl committed
52 53
    void saveOptions(KSharedConfigPtr config);
    void readOptions(KSharedConfigPtr config);
Joachim Eibl's avatar
Joachim Eibl committed
54 55 56 57 58

    void setState(); // Must be called before calling exec();

    void addOptionItem(OptionItem*);
    KKeyDialog* m_pKeyDialog;
59
protected Q_SLOTS:
Joachim Eibl's avatar
Joachim Eibl committed
60 61 62
    virtual void slotDefault( void );
    virtual void slotOk( void );
    virtual void slotApply( void );
Joachim Eibl's avatar
Joachim Eibl committed
63

Joachim Eibl's avatar
Joachim Eibl committed
64
    void slotEncodingChanged();
Joachim Eibl's avatar
Joachim Eibl committed
65
    void slotHistoryMergeRegExpTester();
Joachim Eibl's avatar
Joachim Eibl committed
66 67
    void slotIntegrateWithClearCase();
    void slotRemoveClearCaseIntegration();
68
Q_SIGNALS:
Joachim Eibl's avatar
0.9.93  
Joachim Eibl committed
69
    void applyDone();
Joachim Eibl's avatar
Joachim Eibl committed
70 71
private:
    void resetToDefaults();
Joachim Eibl's avatar
0.9.80  
Joachim Eibl committed
72

Joachim Eibl's avatar
Joachim Eibl committed
73
    std::list<OptionItem*> m_optionItemList;
Joachim Eibl's avatar
0.9.80  
Joachim Eibl committed
74

Joachim Eibl's avatar
Joachim Eibl committed
75 76
    OptionCheckBox* m_pSameEncoding;
    OptionEncodingComboBox* m_pEncodingAComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
77
    OptionCheckBox* m_pAutoDetectUnicodeA;
Joachim Eibl's avatar
Joachim Eibl committed
78
    OptionEncodingComboBox* m_pEncodingBComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
79
    OptionCheckBox* m_pAutoDetectUnicodeB;
Joachim Eibl's avatar
Joachim Eibl committed
80
    OptionEncodingComboBox* m_pEncodingCComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
81
    OptionCheckBox* m_pAutoDetectUnicodeC;
Joachim Eibl's avatar
Joachim Eibl committed
82
    OptionEncodingComboBox* m_pEncodingOutComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
83
    OptionCheckBox* m_pAutoSelectOutEncoding;
Joachim Eibl's avatar
Joachim Eibl committed
84
    OptionEncodingComboBox* m_pEncodingPPComboBox;
Joachim Eibl's avatar
Joachim Eibl committed
85 86 87 88 89 90
    OptionCheckBox* m_pHistoryAutoMerge;
    OptionLineEdit* m_pAutoMergeRegExpLineEdit;
    OptionLineEdit* m_pHistoryStartRegExpLineEdit;
    OptionLineEdit* m_pHistoryEntryStartRegExpLineEdit;
    OptionCheckBox* m_pHistoryMergeSorting;
    OptionLineEdit* m_pHistorySortKeyOrderLineEdit;
Joachim Eibl's avatar
Joachim Eibl committed
91 92 93 94 95 96

private:
    void setupFontPage();
    void setupColorPage();
    void setupEditPage();
    void setupDiffPage();
Joachim Eibl's avatar
Joachim Eibl committed
97
    void setupMergePage();
Joachim Eibl's avatar
Joachim Eibl committed
98 99
    void setupDirectoryMergePage();
    void setupKeysPage();
Joachim Eibl's avatar
Joachim Eibl committed
100
    void setupRegionalPage();
Joachim Eibl's avatar
Joachim Eibl committed
101
    void setupIntegrationPage();
Joachim Eibl's avatar
0.9.80  
Joachim Eibl committed
102
    void setupOtherOptions();
Joachim Eibl's avatar
Joachim Eibl committed
103 104 105 106
};



Joachim Eibl's avatar
Joachim Eibl committed
107

Joachim Eibl's avatar
Joachim Eibl committed
108 109 110 111 112 113 114 115
#endif