From df9682835caa4e81e6482a0cd5a03613fbda80eb Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 10 Dec 2013 13:29:38 +0100 Subject: [PATCH] Many changes, reworked some things. --- CMakeLists.txt | 2 ++ .../icons/mini-kfaenza/qtassistant.png | Bin 0 -> 4540 bytes src/core/databasefactory.cpp | 16 ++++++++++++-- src/core/defs.h.in | 5 +---- src/gui/feedmessageviewer.cpp | 3 +++ src/gui/formmain.cpp | 3 +++ src/gui/formmain.h | 2 +- src/gui/messagebox.cpp | 9 ++++++++ src/gui/messagebox.h | 20 ++++++++++++++++++ src/gui/messagesview.cpp | 4 ++++ src/gui/messagesview.h | 1 + src/gui/tabwidget.cpp | 6 ++++++ src/gui/tabwidget.h | 3 +++ 13 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 resources/graphics/icons/mini-kfaenza/qtassistant.png create mode 100644 src/gui/messagebox.cpp create mode 100644 src/gui/messagebox.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 808101a86..4c535dfa2 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/resources/graphics/icons/mini-kfaenza/qtassistant.png b/resources/graphics/icons/mini-kfaenza/qtassistant.png new file mode 100644 index 0000000000000000000000000000000000000000..cffbf476991ce025f2c8382c5404437797070752 GIT binary patch literal 4540 zcmV;t5ku~YP)c7I8xX2{14$GXlj7GtCS$ z)7|rWd;Q+K_nt3*-2L7ArU!##sbAOWd)__U_kHKv&T^HA@aqiv7mdI#8tg#@N-0Ii zAa(N4`MH1qMh1ww>VL14vVbb!0v5mgQeuDr=m8xO39^Mb1}LRmVCX}id)toJyk-06 z>O+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>RIPpL56_A&kp zPHhCcrlLdF)O;(Y3A*C%yz$_@z*0nO;iIW3;0)lRkxkW0w_myWH^)yM8m%@RH|`{K zgONK_n)H2`w{q`KEFTjU?%tXc$_Kgkh9C%^N=Hf>Z`~numb~8F{^i!gH$C^z!okk> zfFA=-14l$evY*Ylz$RcCI0rZz7$*F@|9T%2;I%@+XKpk-S)%bMQBQ$);2a_=r7?2c%3TpGK!2n+d a5c+?>#cnk|$(wlq0000= 0x050000 #include -#elif QT_VERSION >= 0x040600 +#else #include #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 diff --git a/src/gui/feedmessageviewer.cpp b/src/gui/feedmessageviewer.cpp index 1805159f9..6da8bbb34 100644 --- a/src/gui/feedmessageviewer.cpp +++ b/src/gui/feedmessageviewer.cpp @@ -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, diff --git a/src/gui/formmain.cpp b/src/gui/formmain.cpp index fec611fae..ea2c31e48 100755 --- a/src/gui/formmain.cpp +++ b/src/gui/formmain.cpp @@ -1,4 +1,5 @@ #include +#include #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."); } diff --git a/src/gui/formmain.h b/src/gui/formmain.h index bde361439..cd7a35526 100644 --- a/src/gui/formmain.h +++ b/src/gui/formmain.h @@ -76,7 +76,7 @@ class FormMain : public QMainWindow { // Displays various dialogs. void showSettings(); void showAbout(); - + private: Ui::FormMain *m_ui; QMenu *m_trayMenu; diff --git a/src/gui/messagebox.cpp b/src/gui/messagebox.cpp new file mode 100644 index 000000000..8ce123064 --- /dev/null +++ b/src/gui/messagebox.cpp @@ -0,0 +1,9 @@ +#include "gui/messagebox.h" + + +MessageBox::MessageBox(QWidget *parent) : QMessageBox(parent) { +} + +MessageBox::~MessageBox() { + qDebug("Destroying MessageBox instance."); +} diff --git a/src/gui/messagebox.h b/src/gui/messagebox.h new file mode 100644 index 000000000..f67de23d6 --- /dev/null +++ b/src/gui/messagebox.h @@ -0,0 +1,20 @@ +#ifndef MESSAGEBOX_H +#define MESSAGEBOX_H + +#include + + +class MessageBox : public QMessageBox { + Q_OBJECT + + public: + explicit MessageBox(QWidget *parent = 0); + virtual ~MessageBox(); + + signals: + + public slots: + +}; + +#endif // MESSAGEBOX_H diff --git a/src/gui/messagesview.cpp b/src/gui/messagesview.cpp index cd66f6a49..917b08f54 100644 --- a/src/gui/messagesview.cpp +++ b/src/gui/messagesview.cpp @@ -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() { diff --git a/src/gui/messagesview.h b/src/gui/messagesview.h index 146670b6d..380c4cca1 100755 --- a/src/gui/messagesview.h +++ b/src/gui/messagesview.h @@ -51,6 +51,7 @@ class MessagesView : public QTreeView { const QItemSelection &deselected); signals: + void openMessageNewTabRequested(const Message &message); void currentMessageChanged(const Message &message); void currentMessageRemoved(); diff --git a/src/gui/tabwidget.cpp b/src/gui/tabwidget.cpp index 17a3dcd4c..036678cdc 100644 --- a/src/gui/tabwidget.cpp +++ b/src/gui/tabwidget.cpp @@ -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(widget(new_index))->navigateToMessage(message); + return new_index; +} + int TabWidget::addEmptyBrowser() { return addBrowser(false, true); } diff --git a/src/gui/tabwidget.h b/src/gui/tabwidget.h index de14f4b29..784cfd8eb 100644 --- a/src/gui/tabwidget.h +++ b/src/gui/tabwidget.h @@ -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();