Mercurial > octave
annotate libgui/src/community-news.h @ 31649:deb553ac2c54
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Dec 2022 15:45:27 -0500 |
parents | 431f80aba37a 29d734430e5f |
children | 5f11de0e7440 |
rev | line source |
---|---|
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29835
diff
changeset
|
3 // Copyright (C) 2011-2022 The Octave Project Developers |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 // This file is part of Octave. |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 // (at your option) any later version. |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
18 // GNU General Public License for more details. |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
23 // |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #if ! defined (octave_community_news_h) |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 #define octave_community_news_h 1 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 #include <QString> |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include <QWidget> |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 class QTextBrowser; |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
33 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
34 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
35 |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 class community_news : public QWidget |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 { |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 Q_OBJECT |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 public: |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 |
31639
ca7d58406f82
eliminate unnecessary uses of octave_qobject in GUI classes
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
42 community_news (int serial); |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
43 |
31639
ca7d58406f82
eliminate unnecessary uses of octave_qobject in GUI classes
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
44 community_news (QWidget *parent = nullptr, |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
45 const QString& base_url = "https://octave.org", |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
46 const QString& page = "community-news.html", |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 int serial = -1); |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 ~community_news (void) = default; |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 public slots: |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 void set_news (const QString& news); |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 void display (void); |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 private: |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 |
31639
ca7d58406f82
eliminate unnecessary uses of octave_qobject in GUI classes
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
59 void construct (const QString& base_url, const QString& page, int serial); |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 QTextBrowser *m_browser; |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 }; |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
63 |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
30690
diff
changeset
|
64 OCTAVE_END_NAMESPACE(octave) |
29835
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
a946d742fb97
allow community news window to be opened from command line
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
66 #endif |