From 0319562ffe6f8b0ca97d3eb509b0343f88d2016a Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Tue, 17 Feb 2009 18:22:50 +0100 Subject: [PATCH] disabling away on detach in mono mode. some minor improvement to the away settings --- src/core/coresession.cpp | 2 +- src/qtui/settingspages/identityeditwidget.cpp | 20 ++--- src/qtui/settingspages/identityeditwidget.ui | 76 +++---------------- 3 files changed, 24 insertions(+), 74 deletions(-) diff --git a/src/core/coresession.cpp b/src/core/coresession.cpp index 926fc976..b5ae06c8 100644 --- a/src/core/coresession.cpp +++ b/src/core/coresession.cpp @@ -418,7 +418,7 @@ void CoreSession::clientsDisconnected() { continue; if(identity->detachAwayEnabled() && !me->isAway()) { - if(identity->detachAwayReasonEnabled()) + if(!identity->detachAwayReason().isEmpty()) awayReason = identity->detachAwayReason(); net->setAutoAwayActive(true); net->userInputHandler()->handleAway(BufferInfo(), awayReason); diff --git a/src/qtui/settingspages/identityeditwidget.cpp b/src/qtui/settingspages/identityeditwidget.cpp index d959001a..47345256 100644 --- a/src/qtui/settingspages/identityeditwidget.cpp +++ b/src/qtui/settingspages/identityeditwidget.cpp @@ -26,6 +26,7 @@ #include #include +#include "client.h" #include "iconloader.h" IdentityEditWidget::IdentityEditWidget(QWidget *parent) @@ -43,16 +44,13 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent) connect(ui.realName, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); connect(ui.nicknameList, SIGNAL(itemChanged(QListWidgetItem *)), this, SIGNAL(widgetHasChanged())); connect(ui.awayNick, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); - connect(ui.awayNickEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.awayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); - connect(ui.awayReasonEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.autoAwayEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.autoAwayTime, SIGNAL(valueChanged(int)), this, SIGNAL(widgetHasChanged())); connect(ui.autoAwayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); connect(ui.autoAwayReasonEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.detachAwayEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.detachAwayReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); - connect(ui.detachAwayReasonEnabled, SIGNAL(clicked(bool)), this, SIGNAL(widgetHasChanged())); connect(ui.ident, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); connect(ui.kickReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); connect(ui.partReason, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged())); @@ -67,6 +65,13 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent) //connect(ui.nicknameList, SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(setWidgetStates())); //connect(ui.nicknameList->model(), SIGNAL(rowsInserted(const QModelIndex &, int, int)), this, SLOT(nicklistHasChanged())); + // disabling unused stuff + ui.autoAwayEnabled->hide(); + ui.awayNick->hide(); + ui.awayNickLabel->hide(); + + ui.detachAwayEnabled->setVisible(!Client::internalCore()); + #ifdef HAVE_SSL ui.sslKeyGroupBox->setAcceptDrops(true); ui.sslKeyGroupBox->installEventFilter(this); @@ -104,16 +109,13 @@ void IdentityEditWidget::displayIdentity(CertIdentity *id, CertIdentity *saveId) //} if(ui.nicknameList->count()) ui.nicknameList->setCurrentRow(0); ui.awayNick->setText(id->awayNick()); - ui.awayNickEnabled->setChecked(id->awayNickEnabled()); ui.awayReason->setText(id->awayReason()); - ui.awayReasonEnabled->setChecked(id->awayReasonEnabled()); ui.autoAwayEnabled->setChecked(id->autoAwayEnabled()); ui.autoAwayTime->setValue(id->autoAwayTime()); ui.autoAwayReason->setText(id->autoAwayReason()); ui.autoAwayReasonEnabled->setChecked(id->autoAwayReasonEnabled()); ui.detachAwayEnabled->setChecked(id->detachAwayEnabled()); ui.detachAwayReason->setText(id->detachAwayReason()); - ui.detachAwayReasonEnabled->setChecked(id->detachAwayReasonEnabled()); ui.ident->setText(id->ident()); ui.kickReason->setText(id->kickReason()); ui.partReason->setText(id->partReason()); @@ -133,16 +135,16 @@ void IdentityEditWidget::saveToIdentity(CertIdentity *id) { } id->setNicks(nicks); id->setAwayNick(ui.awayNick->text()); - id->setAwayNickEnabled(ui.awayNickEnabled->isChecked()); + id->setAwayNickEnabled(true); id->setAwayReason(ui.awayReason->text()); - id->setAwayReasonEnabled(ui.awayReasonEnabled->isChecked()); + id->setAwayReasonEnabled(true); id->setAutoAwayEnabled(ui.autoAwayEnabled->isChecked()); id->setAutoAwayTime(ui.autoAwayTime->value()); id->setAutoAwayReason(ui.autoAwayReason->text()); id->setAutoAwayReasonEnabled(ui.autoAwayReasonEnabled->isChecked()); id->setDetachAwayEnabled(ui.detachAwayEnabled->isChecked()); id->setDetachAwayReason(ui.detachAwayReason->text()); - id->setDetachAwayReasonEnabled(ui.detachAwayReasonEnabled->isChecked()); + id->setDetachAwayReasonEnabled(true); id->setIdent(ui.ident->text()); id->setKickReason(ui.kickReason->text()); id->setPartReason(ui.partReason->text()); diff --git a/src/qtui/settingspages/identityeditwidget.ui b/src/qtui/settingspages/identityeditwidget.ui index ba6563c9..52489a4d 100644 --- a/src/qtui/settingspages/identityeditwidget.ui +++ b/src/qtui/settingspages/identityeditwidget.ui @@ -244,20 +244,10 @@ - - - - Default away reason - - - Away Reason: - - - - false + true Default away reason @@ -265,18 +255,19 @@ - - - false - - - Nick to be used when being away - + Away Nick: + + + + Away Reason: + + + @@ -300,24 +291,14 @@ - - - Override default away reason for auto-away on detach - + Away Reason: - - - false - - - Override default away reason for auto-away on detach - - + @@ -784,38 +765,5 @@ Proceeding will cause an unencrypted transfer of your SSL Key and SSL Certificat - - - detachAwayReasonEnabled - toggled(bool) - detachAwayReason - setEnabled(bool) - - - 103 - 195 - - - 215 - 196 - - - - - awayReasonEnabled - toggled(bool) - awayReason - setEnabled(bool) - - - 97 - 107 - - - 195 - 104 - - - - + -- 2.20.1