/***************************************************************************
- * 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"
+#include "client.h"
#include "qtui.h"
#include "uisettings.h"
#include <QHeaderView>
HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
- : SettingsPage(tr("Interface"), tr("Highlight"), parent)
+ : SettingsPage(tr("Interface"), tr("Local Highlights"), parent)
{
ui.setupUi(this);
ui.highlightTable->verticalHeader()->hide();
ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setToolTip("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> in the beginning to negate. Case insensitive.");
ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis("<b>Channel</b>: This regular expression determines for which <b>channels</b> the highlight rule works. Leave blank to match any channel. Put <b>!</b> 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()));
void HighlightSettingsPage::defaults()
{
- ui.highlightCurrentNick->setChecked(true);
+ ui.highlightNoNick->setChecked(true);
ui.nicksCaseSensitive->setChecked(false);
emptyTable();
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())
{
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;
}