#include <QFileDialog>
#include <QUrl>
+#include "client.h"
#include "iconloader.h"
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()));
//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);
//}
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());
}
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());
</property>
</widget>
</item>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="awayReasonEnabled" >
- <property name="toolTip" >
- <string>Default away reason</string>
- </property>
- <property name="text" >
- <string>Away Reason:</string>
- </property>
- </widget>
- </item>
<item row="1" column="1" >
<widget class="QLineEdit" name="awayReason" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="toolTip" >
<string>Default away reason</string>
</widget>
</item>
<item row="0" column="0" >
- <widget class="QCheckBox" name="awayNickEnabled" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string>Nick to be used when being away</string>
- </property>
+ <widget class="QLabel" name="awayNickLabel" >
<property name="text" >
<string>Away Nick:</string>
</property>
</widget>
</item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="awayReasonLabel" >
+ <property name="text" >
+ <string>Away Reason:</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
</layout>
<item>
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
- <widget class="QCheckBox" name="detachAwayReasonEnabled" >
- <property name="toolTip" >
- <string>Override default away reason for auto-away on detach</string>
- </property>
+ <widget class="QLabel" name="label_13" >
<property name="text" >
<string>Away Reason:</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="detachAwayReason" >
- <property name="enabled" >
- <bool>false</bool>
- </property>
- <property name="toolTip" >
- <string>Override default away reason for auto-away on detach</string>
- </property>
- </widget>
+ <widget class="QLineEdit" name="detachAwayReason" />
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>detachAwayReasonEnabled</sender>
- <signal>toggled(bool)</signal>
- <receiver>detachAwayReason</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>103</x>
- <y>195</y>
- </hint>
- <hint type="destinationlabel" >
- <x>215</x>
- <y>196</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>awayReasonEnabled</sender>
- <signal>toggled(bool)</signal>
- <receiver>awayReason</receiver>
- <slot>setEnabled(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>97</x>
- <y>107</y>
- </hint>
- <hint type="destinationlabel" >
- <x>195</x>
- <y>104</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>