~ubuntu-branches/ubuntu/saucy/konsole/saucy-proposed

« back to all changes in this revision

Viewing changes to src/HistorySizeDialog.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 14:29:24 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120606142924-1rekqv6j25lw2k41
Tags: 4:4.8.80-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    Copyright 2007-2008 by Robert Knight <robertknight@gmail.com>
 
3
    Copyright 2012 by Kurt Hindenburg <kurt.hindenburg@gmail.com>
3
4
 
4
5
    This program is free software; you can redistribute it and/or modify
5
6
    it under the terms of the GNU General Public License as published by
23
24
// KDE
24
25
#include <KDialog>
25
26
 
26
 
class QAbstractButton;
27
 
class KIntSpinBox;
 
27
// Konsole
 
28
#include "Enumeration.h"
 
29
 
 
30
namespace Ui
 
31
{
 
32
class HistorySizeDialog;
 
33
}
28
34
 
29
35
namespace Konsole
30
36
{
31
 
 
32
 
/**
33
 
 * A dialog which allows the user to select the number of lines of output
34
 
 * which are remembered for a session.
35
 
 */
36
37
class HistorySizeDialog : public KDialog
37
38
{
38
 
Q_OBJECT
 
39
    Q_OBJECT
39
40
 
40
41
public:
41
 
    /**
42
 
     * Construct a new history size dialog.
43
 
     */
44
 
    HistorySizeDialog( QWidget* parent );
45
 
 
46
 
    /** Specifies the type of history scroll */
47
 
    enum HistoryMode
48
 
    {
49
 
        /**
50
 
         * No history.  Lines of output are lost
51
 
         * as soon as they are scrolled off-screen.
52
 
         */
53
 
        NoHistory,
54
 
        /**
55
 
         * A history which stores up to a fixed number of lines
56
 
         * in memory.
57
 
         */
58
 
        FixedSizeHistory,
59
 
        /**
60
 
         * An 'unlimited' history which stores lines of output in
61
 
         * a file on disk.
62
 
         */
63
 
        UnlimitedHistory
64
 
    };
65
 
 
66
 
 
67
 
    /** Specifies the history mode. */
68
 
    void setMode( HistoryMode mode );
69
 
    /** Returns the history mode chosen by the user. */
70
 
    HistoryMode mode() const;
71
 
    /**
72
 
     * Returns the number of lines of history to remember.
73
 
     * This is only valid when mode() == FixedSizeHistory,
74
 
     * and returns 0 otherwise.
75
 
     */
 
42
    explicit HistorySizeDialog(QWidget* parent = 0);
 
43
    ~HistorySizeDialog();
 
44
 
 
45
    /** See HistorySizeWidget::setMode. */
 
46
    void setMode(Enum::HistoryModeEnum aMode);
 
47
 
 
48
    /** See HistorySizeWidget::mode. */
 
49
    Enum::HistoryModeEnum mode() const;
 
50
 
 
51
    /** See HistorySizeWidget::setLineCount. */
 
52
    void setLineCount(int lines);
 
53
 
 
54
    /** See HistorySizeWidget::lineCount. */
76
55
    int lineCount() const;
77
 
    /** Sets the number of lines for the fixed size history mode. */
78
 
    void setLineCount(int lines);
79
 
 
80
 
signals:
81
 
    /**
82
 
     * Emitted when the user changes the scroll-back mode or line count and
83
 
     * accepts the change by pressing the OK button
84
 
     *
85
 
     * @param mode The current history mode.  This is a value from the HistoryMode enum.
86
 
     * @param lineCount The current line count.  This is only applicable if mode is
87
 
     * FixedSizeHistory
88
 
     */
89
 
    void optionsChanged(int mode , int lineCount);
90
 
 
91
 
private slots:
92
 
 
93
 
    // fires the optionsChanged() signal with the current mode
94
 
    // and line count as arguments
95
 
    void emitOptionsChanged();
96
56
 
97
57
private:
98
 
    QAbstractButton* _noHistoryButton;
99
 
    QAbstractButton* _fixedHistoryButton;
100
 
    QAbstractButton* _unlimitedHistoryButton;
101
 
    KIntSpinBox* _lineCountBox;
102
 
 
103
 
    // 1000 lines was the default in the KDE 3 series
104
 
    static const int defaultLineCount = 1000;
 
58
    Ui::HistorySizeDialog* _ui;
105
59
};
106
 
 
107
60
}
108
61
 
109
62
#endif // HISTORYSIZEDIALOG_H