mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-01 02:48:05 +01:00
Many changes, reworked some things.
This commit is contained in:
parent
1e6e5a7f63
commit
df9682835c
@ -245,6 +245,7 @@ set(APP_SOURCES
|
||||
src/gui/feedsview.cpp
|
||||
src/gui/messagesview.cpp
|
||||
src/gui/statusbar.cpp
|
||||
src/gui/messagebox.cpp
|
||||
|
||||
# CORE sources.
|
||||
src/core/debugging.cpp
|
||||
@ -297,6 +298,7 @@ set(APP_HEADERS
|
||||
src/gui/feedsview.h
|
||||
src/gui/messagesview.h
|
||||
src/gui/statusbar.h
|
||||
src/gui/messagebox.h
|
||||
|
||||
# CORE headers.
|
||||
src/core/settings.h
|
||||
|
BIN
resources/graphics/icons/mini-kfaenza/qtassistant.png
Normal file
BIN
resources/graphics/icons/mini-kfaenza/qtassistant.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
@ -127,8 +127,20 @@ QSqlDatabase DatabaseFactory::addConnection(const QString &connection_name) {
|
||||
return initialize(connection_name);
|
||||
}
|
||||
else {
|
||||
return QSqlDatabase::addDatabase(DATABASE_DRIVER,
|
||||
connection_name);
|
||||
QSqlDatabase database = QSqlDatabase::addDatabase(DATABASE_DRIVER,
|
||||
connection_name);
|
||||
QDir db_path(getDatabasePath());
|
||||
QFile db_file(db_path.absoluteFilePath(APP_DB_FILE));
|
||||
|
||||
// Setup database file path.
|
||||
database.setDatabaseName(db_file.fileName());
|
||||
|
||||
if (!database.open()) {
|
||||
qFatal("Database was NOT opened. Delivered error message: '%s'",
|
||||
qPrintable(database.lastError().text()));
|
||||
}
|
||||
|
||||
return database;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#if QT_VERSION >= 0x050000
|
||||
#include <qwebkitglobal.h>
|
||||
#elif QT_VERSION >= 0x040600
|
||||
#else
|
||||
#include <qwebkitversion.h>
|
||||
#endif
|
||||
|
||||
@ -19,10 +19,7 @@
|
||||
#define APP_AUTHORS "@APP_AUTHOR@"
|
||||
#define APP_URL "@APP_URL@"
|
||||
#define APP_VERSION "@APP_VERSION@"
|
||||
|
||||
#if QT_VERSION >= 0x040600
|
||||
#define APP_USERAGENT QString("@APP_NAME@/@APP_VERSION@ (@APP_URL@) on @CMAKE_SYSTEM@; Webkit/") + qWebKitVersion()
|
||||
#endif
|
||||
|
||||
#define TEXT_TITLE_LIMIT 30
|
||||
#define MAX_ZOOM_FACTOR 10.0
|
||||
|
@ -34,6 +34,9 @@ void FeedMessageViewer::createConnections() {
|
||||
m_messagesBrowser, SLOT(clear()));
|
||||
connect(m_messagesView, SIGNAL(currentMessageChanged(Message)),
|
||||
m_messagesBrowser, SLOT(navigateToMessage(Message)));
|
||||
connect(m_messagesView, SIGNAL(openMessageNewTabRequested(Message)),
|
||||
FormMain::getInstance()->m_ui->m_tabWidget,
|
||||
SLOT(addBrowserWithMessage(Message)));
|
||||
|
||||
// Toolbar forwardings.
|
||||
connect(FormMain::getInstance()->m_ui->m_actionSwitchImportanceOfSelectedMessages,
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "gui/formmain.h"
|
||||
#include "gui/formabout.h"
|
||||
@ -146,6 +147,8 @@ void FormMain::display() {
|
||||
}
|
||||
|
||||
void FormMain::onCommitData(QSessionManager &manager) {
|
||||
Q_UNUSED(manager);
|
||||
|
||||
qDebug("OS asked application to commit its data.");
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ class FormMain : public QMainWindow {
|
||||
// Displays various dialogs.
|
||||
void showSettings();
|
||||
void showAbout();
|
||||
|
||||
|
||||
private:
|
||||
Ui::FormMain *m_ui;
|
||||
QMenu *m_trayMenu;
|
||||
|
9
src/gui/messagebox.cpp
Normal file
9
src/gui/messagebox.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include "gui/messagebox.h"
|
||||
|
||||
|
||||
MessageBox::MessageBox(QWidget *parent) : QMessageBox(parent) {
|
||||
}
|
||||
|
||||
MessageBox::~MessageBox() {
|
||||
qDebug("Destroying MessageBox instance.");
|
||||
}
|
20
src/gui/messagebox.h
Normal file
20
src/gui/messagebox.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef MESSAGEBOX_H
|
||||
#define MESSAGEBOX_H
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
|
||||
class MessageBox : public QMessageBox {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MessageBox(QWidget *parent = 0);
|
||||
virtual ~MessageBox();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
};
|
||||
|
||||
#endif // MESSAGEBOX_H
|
@ -183,6 +183,10 @@ void MessagesView::openSelectedSourceMessagesInternally() {
|
||||
|
||||
void MessagesView::openSelectedMessagesInternally() {
|
||||
// TODO: otevre vybrane nactene zpravy v internich tabech
|
||||
|
||||
foreach (const QModelIndex &index, selectionModel()->selectedRows()) {
|
||||
emit openMessageNewTabRequested(m_sourceModel->messageAt(m_proxyModel->mapToSource(index).row()));
|
||||
}
|
||||
}
|
||||
|
||||
void MessagesView::markSelectedMessagesRead() {
|
||||
|
@ -51,6 +51,7 @@ class MessagesView : public QTreeView {
|
||||
const QItemSelection &deselected);
|
||||
|
||||
signals:
|
||||
void openMessageNewTabRequested(const Message &message);
|
||||
void currentMessageChanged(const Message &message);
|
||||
void currentMessageRemoved();
|
||||
|
||||
|
@ -174,6 +174,12 @@ int TabWidget::insertTab(int index, QWidget *widget, const QString &label,
|
||||
return tab_index;
|
||||
}
|
||||
|
||||
int TabWidget::addBrowserWithMessage(const Message &message) {
|
||||
int new_index = addBrowser(false, false);
|
||||
static_cast<WebBrowser*>(widget(new_index))->navigateToMessage(message);
|
||||
return new_index;
|
||||
}
|
||||
|
||||
int TabWidget::addEmptyBrowser() {
|
||||
return addBrowser(false, true);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
|
||||
class CornerButton;
|
||||
class Message;
|
||||
|
||||
class TabWidget : public QTabWidget {
|
||||
Q_OBJECT
|
||||
@ -72,6 +73,8 @@ class TabWidget : public QTabWidget {
|
||||
// Closes all "closable" tabs except the active tab.
|
||||
void closeAllTabsExceptCurrent();
|
||||
|
||||
int addBrowserWithMessage(const Message &message);
|
||||
|
||||
// Adds new WebBrowser tab to global TabWidget.
|
||||
int addEmptyBrowser();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user