Use QProcess::errorString instead
[nomnom.git] / src / feed / nfeeddialog.h
blobe2dd3c14ad529cc389ccad1f643b657f5ffede24
1 /* NomNom
2 * Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com>
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef nfeeddialog_h
19 #define nfeeddialog_h
21 #include <QDialog>
23 class QButtonGroup;
24 class QListWidget;
25 class QComboBox;
26 class QGroupBox;
27 class QLineEdit;
28 class QToolBox;
29 class QSpinBox;
30 class QLabel;
32 namespace nn
35 class NFeedDialog : public QDialog
37 Q_OBJECT
38 public:
39 static void m_info(QWidget*, const QString&);
40 public:
41 NFeedDialog(QWidget *parent, const QString&);
42 public:
43 QString selected() const;
44 QString errmsg() const;
45 protected:
46 void done(int);
47 private:
48 bool foreachWidget();
49 private slots:
50 void parse(QStringList);
51 void selected(QString);
52 signals:
53 void parsed();
54 private:
55 QToolBox *_toolbox;
56 QString _selected;
59 class NFeedWidget : public QWidget
61 Q_OBJECT
62 public:
63 NFeedWidget(QWidget *parent);
64 protected:
65 virtual void init() = 0;
66 // Friends
67 friend class NFeedDialog;
70 class NFeedInfo : public NFeedWidget
72 Q_OBJECT
73 public:
74 NFeedInfo(const QString&, QWidget *parent=NULL);
75 protected:
76 virtual void init();
77 private slots:
78 void enableRange(bool state=true);
79 void typeChanged(int); // Feed type
80 void modeChanged(int); // "Get all" or "specified range"
81 void parse();
82 void reset();
83 signals:
84 void parse(QStringList);
85 private:
86 QGroupBox *_rangeGroup;
87 QComboBox *_typeCombo;
88 QLineEdit *_identEdit;
89 QButtonGroup *_bgroup;
90 QSpinBox *_indexSpin;
91 QLabel *_identLabel;
92 QSpinBox *_maxSpin;
93 QString _umphPath;
96 class NFeedItems : public NFeedWidget
98 Q_OBJECT
99 public:
100 NFeedItems(QWidget *parent=NULL);
101 protected:
102 virtual void init();
103 public slots:
104 void itemSelected();
105 void update();
106 signals:
107 void selected(QString);
108 private:
109 QListWidget *_list;
112 } // namespace nn
114 #endif
116 /* vim: set ts=2 sw=2 tw=72 expandtab: */