Added base network access manager class.
This commit is contained in:
parent
f1eb5daf7f
commit
1dbd947bc1
@ -175,6 +175,7 @@ set(APP_SOURCES
|
||||
src/core/datetime.cpp
|
||||
src/core/localization.cpp
|
||||
src/core/dynamicshortcuts.cpp
|
||||
src/core/basenetworkaccessmanager.cpp
|
||||
|
||||
# Basic application sources.
|
||||
src/main.cpp
|
||||
@ -200,6 +201,7 @@ set(APP_HEADERS
|
||||
src/gui/dynamicshortcutswidget.h
|
||||
|
||||
# CORE headers.
|
||||
src/core/basenetworkaccessmanager.h
|
||||
)
|
||||
|
||||
# Add form files.
|
||||
|
6
src/core/basenetworkaccessmanager.cpp
Normal file
6
src/core/basenetworkaccessmanager.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "core/basenetworkaccessmanager.h"
|
||||
|
||||
|
||||
BaseNetworkAccessManager::BaseNetworkAccessManager(QObject *parent)
|
||||
: QNetworkAccessManager(parent) {
|
||||
}
|
18
src/core/basenetworkaccessmanager.h
Normal file
18
src/core/basenetworkaccessmanager.h
Normal file
@ -0,0 +1,18 @@
|
||||
#ifndef BASENETWORKACCESSMANAGER_H
|
||||
#define BASENETWORKACCESSMANAGER_H
|
||||
|
||||
#include <QNetworkAccessManager>
|
||||
|
||||
|
||||
class BaseNetworkAccessManager : public QNetworkAccessManager {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit BaseNetworkAccessManager(QObject *parent = 0);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // BASENETWORKACCESSMANAGER_H
|
@ -17,6 +17,7 @@
|
||||
#define APP_CFG_PATH "data/config/config.ini"
|
||||
#define APP_CFG_GUI "gui"
|
||||
#define APP_CFG_GEN "main"
|
||||
#define APP_CFG_PROXY "proxy"
|
||||
#define APP_CFG_CUTS "keyboard"
|
||||
|
||||
#define APP_DB_PATH "data/storage/database.db"
|
||||
|
@ -80,7 +80,6 @@ QString SystemFactory::getAutostartDesktopFileLocation() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO: Finish implementation of SystemFactory auto-start methods.
|
||||
bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
||||
SystemFactory::AutoStartStatus current_status = SystemFactory::getAutoStartStatus();
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include "core/datetime.h"
|
||||
#include "gui/formabout.h"
|
||||
#include "gui/themefactory.h"
|
||||
|
||||
|
||||
FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout) {
|
||||
@ -10,6 +11,7 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout)
|
||||
|
||||
// Set flags and attributes.
|
||||
setWindowFlags(Qt::MSWindowsFixedSizeDialogHint | Qt::Dialog);
|
||||
setWindowIcon(ThemeFactory::fromTheme("help-about"));
|
||||
m_ui->m_lblIcon->setPixmap(QPixmap(APP_ICON_PATH));
|
||||
|
||||
// Load information from embedded text files.
|
||||
@ -74,7 +76,7 @@ FormAbout::FormAbout(QWidget *parent) : QDialog(parent), m_ui(new Ui::FormAbout)
|
||||
"<ul><li><a href=\"mailto://rotter.martinos@gmail.com\">rotter.martinos@gmail</a> ~email</li>"
|
||||
"<li><a href=\"http://www.rssguard.sf.net\">www.rssguard.sf.net</a> ~website</li></ul>"
|
||||
"You can obtain source code for Qonverter from its website."
|
||||
"<br><br><br>Copyright 2011-%1 Martin Rotter</body>").arg(QDateTime::currentDateTime().date().year()));
|
||||
"<br><br><br>Copyright © 2011-%1 Martin Rotter</body>").arg(QDateTime::currentDateTime().date().year()));
|
||||
}
|
||||
|
||||
FormAbout::~FormAbout() {
|
||||
|
@ -67,7 +67,6 @@ void FormMain::prepareMenus() {
|
||||
}
|
||||
|
||||
void FormMain::processExecutionMessage(const QString &message) {
|
||||
// TODO: Implement proper reaction when application is launched more than once.
|
||||
qDebug("Received '%s' execution message from another application instance.",
|
||||
qPrintable(message));
|
||||
display();
|
||||
@ -119,6 +118,9 @@ void FormMain::setupIcons() {
|
||||
// NOTE: Call QIcon::fromTheme for all needed widgets here.
|
||||
m_ui->m_actionSettings->setIcon(ThemeFactory::fromTheme("preferences-system"));
|
||||
m_ui->m_actionQuit->setIcon(ThemeFactory::fromTheme("application-exit"));
|
||||
m_ui->m_actionAboutGuard->setIcon(ThemeFactory::fromTheme("help-about"));
|
||||
m_ui->m_actionImport->setIcon(ThemeFactory::fromTheme("document-import"));
|
||||
m_ui->m_actionExport->setIcon(ThemeFactory::fromTheme("document-export"));
|
||||
}
|
||||
|
||||
void FormMain::createConnections() {
|
||||
|
@ -67,16 +67,11 @@ void FormSettings::onProxyTypeChanged(int index) {
|
||||
QNetworkProxy::ProxyType selected_type = static_cast<QNetworkProxy::ProxyType>(m_ui->m_cmbProxyType->itemData(index).toInt());
|
||||
bool is_proxy_selected = selected_type != QNetworkProxy::NoProxy;
|
||||
|
||||
m_ui->m_txtProxyHost->setVisible(is_proxy_selected);
|
||||
m_ui->m_txtProxyPassword->setVisible(is_proxy_selected);
|
||||
m_ui->m_txtProxyUsername->setVisible(is_proxy_selected);
|
||||
m_ui->m_spinProxyPort->setVisible(is_proxy_selected);
|
||||
m_ui->m_lblProxyHost->setVisible(is_proxy_selected);
|
||||
m_ui->m_lblProxyInfo->setVisible(is_proxy_selected);
|
||||
m_ui->m_lblProxyPassword->setVisible(is_proxy_selected);
|
||||
m_ui->m_lblProxyPort->setVisible(is_proxy_selected);
|
||||
m_ui->m_lblProxyUsername->setVisible(is_proxy_selected);
|
||||
m_ui->m_checkShowPassword->setVisible(is_proxy_selected);
|
||||
m_ui->m_txtProxyHost->setEnabled(is_proxy_selected);
|
||||
m_ui->m_txtProxyPassword->setEnabled(is_proxy_selected);
|
||||
m_ui->m_txtProxyUsername->setEnabled(is_proxy_selected);
|
||||
m_ui->m_spinProxyPort->setEnabled(is_proxy_selected);
|
||||
m_ui->m_checkShowPassword->setEnabled(is_proxy_selected);
|
||||
}
|
||||
|
||||
void FormSettings::loadProxy() {
|
||||
|
@ -43,10 +43,7 @@ int main(int argc, char *argv[]) {
|
||||
// Setup debug output system.
|
||||
qInstallMessageHandler(Debugging::debugHandler);
|
||||
|
||||
// TODO: Finish implementation of QtSingleApplication into RSS Guard.
|
||||
// This primarily concerns slot in FormMain which reacts when application is launched
|
||||
// repeatedly. See 'trivial' example from QtSingleApplication source code for more
|
||||
// information.
|
||||
// Instantiate base application object.
|
||||
QtSingleApplication application(argc, argv);
|
||||
qDebug("Instantiated QtSingleApplication class.");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user