2015-09-24 10:33:02 +03:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
2018-05-31 12:19:07 +03:00
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
2015-09-24 10:33:02 +03:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
|
|
|
*/
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
#include "pluginsourcedialog.h"
|
2015-09-24 10:33:02 +03:00
|
|
|
|
2020-04-30 10:53:43 +03:00
|
|
|
#include "gui/utils.h"
|
2018-06-14 12:54:23 +03:00
|
|
|
#include "ui_pluginsourcedialog.h"
|
2017-04-11 15:35:10 +03:00
|
|
|
|
2020-12-28 06:59:36 +03:00
|
|
|
#define SETTINGS_KEY(name) "SearchPluginSourceDialog/" name
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
PluginSourceDialog::PluginSourceDialog(QWidget *parent)
|
2015-09-24 10:33:02 +03:00
|
|
|
: QDialog(parent)
|
2020-12-28 06:59:36 +03:00
|
|
|
, m_ui(new Ui::PluginSourceDialog)
|
|
|
|
, m_storeDialogSize(SETTINGS_KEY("Size"))
|
2015-09-24 10:33:02 +03:00
|
|
|
{
|
2017-04-11 15:35:10 +03:00
|
|
|
m_ui->setupUi(this);
|
2015-09-24 10:33:02 +03:00
|
|
|
setAttribute(Qt::WA_DeleteOnClose);
|
2017-12-03 10:32:58 +03:00
|
|
|
|
2020-12-28 06:59:36 +03:00
|
|
|
Utils::Gui::resize(this, m_storeDialogSize);
|
2015-09-24 10:33:02 +03:00
|
|
|
show();
|
|
|
|
}
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
PluginSourceDialog::~PluginSourceDialog()
|
2017-04-11 15:35:10 +03:00
|
|
|
{
|
2020-12-28 06:59:36 +03:00
|
|
|
m_storeDialogSize = size();
|
2017-04-11 15:35:10 +03:00
|
|
|
delete m_ui;
|
|
|
|
}
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
void PluginSourceDialog::on_localButton_clicked()
|
2015-09-24 10:33:02 +03:00
|
|
|
{
|
|
|
|
emit askForLocalFile();
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
|
2018-06-14 12:54:23 +03:00
|
|
|
void PluginSourceDialog::on_urlButton_clicked()
|
2015-09-24 10:33:02 +03:00
|
|
|
{
|
|
|
|
emit askForUrl();
|
|
|
|
close();
|
|
|
|
}
|