1 | /* |
---|
2 | * Copyright (C) 2010 Ixonos Plc. |
---|
3 | * Copyright (C) 2011-2012 Philipp Spitzer, gregor herrmann, Stefan Stahl |
---|
4 | * |
---|
5 | * This file is part of ConfClerk. |
---|
6 | * |
---|
7 | * ConfClerk is free software: you can redistribute it and/or modify it |
---|
8 | * under the terms of the GNU General Public License as published by the Free |
---|
9 | * Software Foundation, either version 2 of the License, or (at your option) |
---|
10 | * any later version. |
---|
11 | * |
---|
12 | * ConfClerk is distributed in the hope that it will be useful, but |
---|
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
---|
14 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
15 | * more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public License along with |
---|
18 | * ConfClerk. If not, see <http://www.gnu.org/licenses/>. |
---|
19 | */ |
---|
20 | #ifndef CONFERENCE_EDITOR_H |
---|
21 | #define CONFERENCE_EDITOR_H |
---|
22 | |
---|
23 | #include "ui_conferenceeditor.h" |
---|
24 | |
---|
25 | #include <QItemSelectionModel> |
---|
26 | |
---|
27 | class ConferenceModel; |
---|
28 | |
---|
29 | /** ConferenceEditor clas is used for managing list of conferences. |
---|
30 | |
---|
31 | That is, selecting an active conference, adding a new conference from URL or |
---|
32 | file, removing a conference, refreshing a conference from URL that is saved in |
---|
33 | the DB. |
---|
34 | |
---|
35 | It does not do anything of this itself, instead emitting controlling signals. |
---|
36 | On the ConferenceEditor creation, they are connected to proper listeners. |
---|
37 | |
---|
38 | \see MainWindow::showConferences() |
---|
39 | */ |
---|
40 | class ConferenceEditor : public QDialog, private Ui::ConferenceEditor { |
---|
41 | Q_OBJECT |
---|
42 | |
---|
43 | public: |
---|
44 | ConferenceEditor(ConferenceModel* model, QWidget* parent); |
---|
45 | virtual ~ConferenceEditor() { } |
---|
46 | signals: |
---|
47 | void haveConferenceSelected(int id); |
---|
48 | void noneConferenceSelected(); |
---|
49 | |
---|
50 | void haveConferenceUrl(const QString& url, int conferenceId); |
---|
51 | void haveConferenceFile(const QString& path, int conferenceId); |
---|
52 | void removeConferenceRequested(int id); |
---|
53 | void changeUrlRequested(int, const QString&); |
---|
54 | |
---|
55 | void wantCurrent(const QModelIndex&, QItemSelectionModel::SelectionFlags); |
---|
56 | public slots: |
---|
57 | void importStarted(); |
---|
58 | void importFinished(const QString& title); |
---|
59 | void conferenceRemoved(); |
---|
60 | void showParsingProgress(int); |
---|
61 | private slots: |
---|
62 | void itemSelected(const QModelIndex& current, const QModelIndex& previous); |
---|
63 | void addClicked(); |
---|
64 | void removeClicked(); |
---|
65 | void changeUrlClicked(); |
---|
66 | void refreshClicked(); |
---|
67 | |
---|
68 | private: |
---|
69 | ConferenceModel* model; |
---|
70 | int selected_id; |
---|
71 | QString import_in_progress_title; |
---|
72 | }; |
---|
73 | |
---|
74 | #endif |
---|