~ubuntu-branches/ubuntu/precise/knemo/precise

« back to all changes in this revision

Viewing changes to src/kcm/configdialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-02-22 16:36:22 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222163622-d8i62gy1stn7tydv
Tags: 0.7.0-0ubuntu1
* New upstream release.
* Switch to source format 3.0 (quilt).
* Make knemo depend on libqt4-sql-sqlite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* This file is part of KNemo
2
2
   Copyright (C) 2004, 2005, 2006 Percy Leonhardt <percy@eris23.de>
3
 
   Copyright (C) 2009 John Stamp <jstamp@users.sourceforge.net>
 
3
   Copyright (C) 2009, 2010 John Stamp <jstamp@users.sourceforge.net>
4
4
 
5
5
   KNemo is free software; you can redistribute it and/or modify
6
6
   it under the terms of the GNU Library General Public License as
39
39
 * @author Percy Leonhardt <percy@eris23.de>
40
40
 */
41
41
 
 
42
class StatsRuleModel : public QStandardItemModel
 
43
{
 
44
    Q_OBJECT
 
45
    public:
 
46
        StatsRuleModel( QObject *parent = 0 ) :
 
47
            QStandardItemModel( parent ) {}
 
48
        virtual ~StatsRuleModel() {}
 
49
        void setCalendar( const KCalendarSystem *cal );
 
50
        QModelIndex addRule( const StatsRule &s );
 
51
        void modifyRule( const QModelIndex &index, const StatsRule &s );
 
52
        QList<StatsRule> getRules();
 
53
    private:
 
54
        QString dateText( const StatsRule &s );
 
55
        const KCalendarSystem *mCalendar;
 
56
};
 
57
 
 
58
class WarnModel : public QStandardItemModel
 
59
{
 
60
    Q_OBJECT
 
61
    public:
 
62
        WarnModel( QObject *parent = 0 ) : QStandardItemModel( parent ) {}
 
63
        virtual ~WarnModel() {}
 
64
        QModelIndex addWarn( const WarnRule &w );
 
65
        void modifyWarn( const QModelIndex &index, const WarnRule &warn );
 
66
        QList<WarnRule> getRules();
 
67
    private:
 
68
        QString ruleText( const WarnRule &warn );
 
69
};
 
70
 
42
71
class ConfigDialog : public KCModule
43
72
{
44
73
    Q_OBJECT
74
103
    void iconThemeChanged( int set );
75
104
    void comboHidingChanged( int val );
76
105
    void checkBoxStatisticsToggled( bool on );
77
 
    void checkBoxCustomBillingToggled( bool on );
78
 
    void warnThresholdChanged( double val );
79
 
    void warnUnitsChanged( int val );
80
 
    void warnTypeChanged( int val );
81
 
    void warnRxTxToggled( bool on );
82
 
    void billingStartInputChanged( const QDate& );
83
 
    void billingMonthsInputChanged( int value );
84
106
    void checkBoxStartKNemoToggled( bool on );
85
107
    void colorButtonChanged();
86
108
    void iconFontChanged( const QFont &font );
87
109
    void advancedButtonClicked();
 
110
    void addStatsClicked();
 
111
    void modifyStatsClicked();
 
112
    void removeStatsClicked();
 
113
    void addWarnClicked();
 
114
    void modifyWarnClicked();
 
115
    void removeWarnClicked();
88
116
    void listViewCommandsSelectionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
89
117
    void listViewCommandsChanged( QTreeWidgetItem* item, int column );
90
118
    void moveTips( QListWidget *from, QListWidget *to );
91
119
 
92
120
private:
93
 
    void setMaxDay();
94
121
    void setupToolTipTab();
95
122
    void setupToolTipMap();
96
123
    void updateControls( InterfaceSettings *settings );
99
126
    QString findNameFromIndex( int index );
100
127
    QPixmap textIcon( QString incomingText, QString outgoingText, int status );
101
128
    QPixmap barIcon( int status );
 
129
    void updateWarnText( int oldCount );
102
130
 
103
131
    int mToolTipContent;
104
132
    bool mLock;
105
133
    Ui::ConfigDlg* mDlg;
106
134
    const KCalendarSystem* mCalendar;
107
135
    int mMaxDay;
 
136
    StatsRuleModel *statsModel;
 
137
    WarnModel *warnModel;
108
138
 
109
139
    // Delete this once KCalendarSystem fixed
110
140
    QString mDefaultCalendarType;