source: src/gui/urlinputdialog.cpp @ 6df32f2

qt5
Last change on this file since 6df32f2 was 6df32f2, checked in by gregor herrmann <gregoa@…>, 10 years ago

Update GPL blurb in source files.

  • Property mode set to 100644
File size: 1.6 KB
RevLine 
[b431d47]1/*
2 * Copyright (C) 2010 Ixonos Plc.
3 *
[6df32f2]4 * This file is part of ConfClerk.
[b431d47]5 *
[6df32f2]6 * ConfClerk is free software: you can redistribute it and/or modify it
[b431d47]7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 2 of the License, or (at your option)
9 * any later version.
10 *
[6df32f2]11 * ConfClerk is distributed in the hope that it will be useful, but
[b431d47]12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
[6df32f2]17 * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
[b431d47]18 */
19#include "urlinputdialog.h"
20
21#include <QFileDialog>
22#include <QPushButton>
23
24UrlInputDialog::UrlInputDialog(QWidget* parent)
25: QDialog(parent)
26{
27    setupUi(this);
28
29    QPushButton* openFile = buttons->addButton("Open File...", QDialogButtonBox::ActionRole);
30
31    connect(openFile, SIGNAL(clicked()), SLOT(openFileClicked()));
32    connect(buttons, SIGNAL(accepted()), SLOT(acceptClicked()));
33    connect(buttons, SIGNAL(rejected()), SLOT(rejectClicked()));
34}
35
36void UrlInputDialog::openFileClicked()
37{
38    QString file = QFileDialog::getOpenFileName(this, "Select Conference Schedule", QString(), "Schedule Files (*.xml);;All Files(*)");
39
40    if (file.isNull()) {
41        return;
42    } else {
43        saved_result = file;
44        done(HaveFile);
45    }
46}
47
48void UrlInputDialog::acceptClicked()
49{
50    saved_result = urlEntry->text();
51    setResult(HaveUrl);
52}
53
54void UrlInputDialog::rejectClicked()
55{
56    setResult(Cancel);
57}
Note: See TracBrowser for help on using the repository browser.