diff options
author | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-21 08:33:27 (GMT) |
---|---|---|
committer | Richard Maudsley <richard.maudsley@isode.com> | 2014-01-21 08:33:27 (GMT) |
commit | 4b076bfb2c95106d587949eab99b34e931dc6708 (patch) | |
tree | 0d00b583cc2734120fecffdb95cbb5d6c01ec629 | |
parent | 4bfba6702290ad8edeb8e858bc2847d98d8a57aa (diff) | |
download | swift-4b076bfb2c95106d587949eab99b34e931dc6708.zip swift-4b076bfb2c95106d587949eab99b34e931dc6708.tar.bz2 |
Tweaks to UI.
Change-Id: Ib06dd3e5da78c566b9f8d9f920aa84c1e7b8ef06
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.cpp | 25 | ||||
-rw-r--r-- | Swift/QtUI/QtHighlightEditor.h | 1 |
2 files changed, 22 insertions, 4 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp index 6bbd502..06695ec 100644 --- a/Swift/QtUI/QtHighlightEditor.cpp +++ b/Swift/QtUI/QtHighlightEditor.cpp @@ -21,6 +21,7 @@ #include <Swift/QtUI/QtSettingsProvider.h> #include <QTreeWidgetItem> +#include <QFileDialog> namespace Swift { @@ -217,6 +218,17 @@ void QtHighlightEditor::onDeleteButtonClicked() assert(selectedRow>=0 && selectedRow<ui_.listWidget->count()); delete ui_.listWidget->takeItem(selectedRow); highlightManager_->removeRule(selectedRow); + + if (!ui_.listWidget->count()) { + disableDialog(); + ui_.deleteButton->setEnabled(false); + } else { + if (selectedRow == ui_.listWidget->count()) { + selectRow(ui_.listWidget->count() - 1); + } else { + selectRow(selectedRow); + } + } } void QtHighlightEditor::onCurrentRowChanged(int currentRow) @@ -338,6 +350,11 @@ void QtHighlightEditor::handleContactSuggestionRequested(const QString& text) onContactSuggestionsRequested(stdText); } +void QtHighlightEditor::selectSoundFile() +{ + /* TODO: bring up standard Qt file selector here */ +} + void QtHighlightEditor::selectRow(int row) { for (int i = 0; i < ui_.listWidget->count(); ++i) { @@ -428,12 +445,12 @@ void QtHighlightEditor::ruleToDialog(const HighlightRule& rule) ui_.chatRadio->setEnabled(true); ui_.roomRadio->setEnabled(true); - if (rule.getMatchChat()) { - ui_.chatRadio->setChecked(true); - ui_.roomRadio->setChecked(false); - } else { + if (rule.getMatchMUC()) { ui_.chatRadio->setChecked(false); ui_.roomRadio->setChecked(true); + } else { + ui_.chatRadio->setChecked(true); + ui_.roomRadio->setChecked(false); } ui_.allMsgRadio->setEnabled(true); diff --git a/Swift/QtUI/QtHighlightEditor.h b/Swift/QtUI/QtHighlightEditor.h index 634f637..6d3d42d 100644 --- a/Swift/QtUI/QtHighlightEditor.h +++ b/Swift/QtUI/QtHighlightEditor.h @@ -47,6 +47,7 @@ namespace Swift { void widgetClick(); void disableDialog(); void handleContactSuggestionRequested(const QString& text); + void selectSoundFile(); private: |