diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-13 15:26:24 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-07-09 14:01:41 (GMT) |
commit | f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285 (patch) | |
tree | 01cf807b2ad59f5ea6504fd28d12e0f994e2f907 /Swift/QtUI/QtHighlightEditor.h | |
parent | 8e03583fe21bcd5e0025da81d8f4a34ed05cd058 (diff) | |
download | swift-f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285.zip swift-f2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285.tar.bz2 |
Reworked highlight rules dialog. Added support for highlighting individual words in messages.
Change-Id: I378fa69077c29008db4ef7c2265e5212924bc2ce
Diffstat (limited to 'Swift/QtUI/QtHighlightEditor.h')
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.h b/Swift/QtUI/QtHighlightEditor.h new file mode 100644 index 0000000..c7db464 --- /dev/null +++ b/Swift/QtUI/QtHighlightEditor.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2012 Maciej Niedzielski + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +/* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <Swift/Controllers/HighlightRule.h> +#include <Swift/Controllers/UIInterfaces/HighlightEditorWindow.h> +#include <Swift/QtUI/ui_QtHighlightEditor.h> + +namespace Swift { + + class QtSettingsProvider; + class QtSuggestingJIDInput; + class QtWebKitChatView; + + class QtHighlightEditor : public QWidget, public HighlightEditorWindow { + Q_OBJECT + + public: + QtHighlightEditor(QtSettingsProvider* settings, QWidget* parent = NULL); + virtual ~QtHighlightEditor(); + + virtual void show(); + virtual void setHighlightManager(HighlightManager* highlightManager); + virtual void setContactSuggestions(const std::vector<Contact::ref>& suggestions); + + private slots: + void colorOtherSelect(); + void colorCustomSelect(); + void soundOtherSelect(); + void soundCustomSelect(); + void onNewButtonClicked(); + void onDeleteButtonClicked(); + void onCurrentRowChanged(int currentRow); + void onApplyButtonClick(); + void onCancelButtonClick(); + void onOkButtonClick(); + void setChildWidgetStates(); + void widgetClick(); + void disableDialog(); + void handleContactSuggestionRequested(const QString& text); + void selectSoundFile(); + + private: + void handleOnUserSelected(const JID& jid); + void populateList(); + void updateChatPreview(); + void selectRow(int row); + int getSelectedRow() const; + HighlightRule ruleFromDialog(); + void ruleToDialog(const HighlightRule& rule); + + Ui::QtHighlightEditor ui_; + QtSettingsProvider* settings_; + HighlightManager* highlightManager_; + QtSuggestingJIDInput* jid_; + int previousRow_; + }; + +} |