X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fsettingspages%2Fhighlightsettingspage.cpp;h=57bd526dbbeadf1ecd49bcde9f052c320cda0ec3;hp=cbd43d24f82dae2a5585c9c1c71342ea337fe3a3;hb=a113f73e5f8ce89c3df5c42d55528404fc7a2294;hpb=694f9bfbf7f1af19108461c7e00d133e55082bce
diff --git a/src/qtui/settingspages/highlightsettingspage.cpp b/src/qtui/settingspages/highlightsettingspage.cpp
index cbd43d24..57bd526d 100644
--- a/src/qtui/settingspages/highlightsettingspage.cpp
+++ b/src/qtui/settingspages/highlightsettingspage.cpp
@@ -1,21 +1,21 @@
/***************************************************************************
- * Copyright (C) 2005-09 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU Highlight Public License as published by *
+ * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
+ * (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU Highlight Public License for more details. *
+ * GNU General Public License for more details. *
* *
- * You should have received a copy of the GNU Highlight Public License *
+ * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "highlightsettingspage.h"
@@ -41,11 +41,19 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip("Channel: This regular expression determines for which channels the highlight rule works. Leave blank to match any channel. Put ! in the beginning to negate. Case insensitive.");
ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis("Channel: This regular expression determines for which channels the highlight rule works. Leave blank to match any channel. Put ! in the beginning to negate. Case insensitive.");
+#if QT_VERSION < 0x050000
ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
+#else
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
+ ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
+#endif
connect(ui.add, SIGNAL(clicked(bool)), this, SLOT(addNewRow()));
connect(ui.remove, SIGNAL(clicked(bool)), this, SLOT(removeSelectedRows()));
@@ -244,9 +252,7 @@ void HighlightSettingsPage::save()
NotificationSettings notificationSettings;
notificationSettings.setHighlightList(highlightList);
- NotificationSettings::HighlightNickType highlightNickType;
- if (ui.highlightNoNick->isChecked())
- highlightNickType = NotificationSettings::NoNick;
+ NotificationSettings::HighlightNickType highlightNickType = NotificationSettings::NoNick;
if (ui.highlightCurrentNick->isChecked())
highlightNickType = NotificationSettings::CurrentNick;
if (ui.highlightAllNicks->isChecked())
@@ -271,18 +277,18 @@ bool HighlightSettingsPage::testHasChanged()
{
NotificationSettings notificationSettings;
- NotificationSettings::HighlightNickType highlightNickType;
- if (ui.highlightNoNick->isChecked())
- highlightNickType = NotificationSettings::NoNick;
+ NotificationSettings::HighlightNickType highlightNickType = NotificationSettings::NoNick;
if (ui.highlightCurrentNick->isChecked())
highlightNickType = NotificationSettings::CurrentNick;
if (ui.highlightAllNicks->isChecked())
highlightNickType = NotificationSettings::AllNicks;
- if (notificationSettings.highlightNick() != highlightNickType) return true;
- if (notificationSettings.nicksCaseSensitive() != ui.nicksCaseSensitive->isChecked()) return true;
-
- if (notificationSettings.highlightList() != highlightList) return true;
+ if (notificationSettings.highlightNick() != highlightNickType)
+ return true;
+ if (notificationSettings.nicksCaseSensitive() != ui.nicksCaseSensitive->isChecked())
+ return true;
+ if (notificationSettings.highlightList() != highlightList)
+ return true;
return false;
}