diff options
author | Tobias Markmann <tm@ayena.de> | 2014-09-29 08:07:05 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-10-17 20:11:30 (GMT) |
commit | 38b0cb785fea8eae5e48fae56440695fdfd10ee1 (patch) | |
tree | 78bb8ce9a6bcbc397805bcd433b96b3b23994f09 /Swift/QtUI/Roster/QtTreeWidget.h | |
parent | 1722d220533a78e8b2acbcd571631960656e78f8 (diff) | |
download | swift-38b0cb785fea8eae5e48fae56440695fdfd10ee1.zip swift-38b0cb785fea8eae5e48fae56440695fdfd10ee1.tar.bz2 |
Disable online only actions when offline.
Disabling action, menu items and drag 'n' drop which require an online
connection when the user is offline.
Test-Information:
Checked by going offline and checking the relevant actions and menu items.
Change-Id: Iacfa2c9f815d3b9bbad9ca4c2d0d04f95ce9a9e4
Diffstat (limited to 'Swift/QtUI/Roster/QtTreeWidget.h')
-rw-r--r-- | Swift/QtUI/Roster/QtTreeWidget.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidget.h b/Swift/QtUI/Roster/QtTreeWidget.h index cf2f73e..12d34f5 100644 --- a/Swift/QtUI/Roster/QtTreeWidget.h +++ b/Swift/QtUI/Roster/QtTreeWidget.h @@ -33,12 +33,14 @@ class QtTreeWidget : public QTreeView { void setRosterModel(Roster* roster); Roster* getRoster() {return roster_;} void refreshTooltip(); void setMessageTarget(MessageTarget messageTarget); JID jidFromIndex(const QModelIndex& index) const; JID selectedJID() const; + void setOnline(bool isOnline); + public: boost::signal<void (RosterItem*)> onSomethingSelectedChanged; private slots: void handleItemActivated(const QModelIndex&); void handleModelItemExpanded(const QModelIndex&, bool expanded); @@ -51,12 +53,13 @@ class QtTreeWidget : public QTreeView { protected: void dragEnterEvent(QDragEnterEvent* event); void dropEvent(QDropEvent* event); void dragMoveEvent(QDragMoveEvent* event); bool event(QEvent* event); QModelIndexList getSelectedIndexes() const; + bool isOnline() const; private: void drawBranches(QPainter*, const QRect&, const QModelIndex&) const; protected slots: virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous); @@ -68,9 +71,10 @@ class QtTreeWidget : public QTreeView { Roster* roster_; RosterDelegate* delegate_; QtTreeWidgetItem* treeRoot_; SettingsProvider* settings_; bool tooltipShown_; MessageTarget messageTarget_; + bool isOnline_; }; } |