48
48
QString s = tr("Makes Psi automatically set your status to \"away\" if your"
49
49
" computer is idle for the specified amount of time.");
50
QWhatsThis::add(d->ck_asAway, s);
51
QWhatsThis::add(d->sb_asAway, s);
50
d->ck_asAway->setWhatsThis(s);
51
d->sb_asAway->setWhatsThis(s);
52
52
s = tr("Makes Psi automatically set your status to \"extended away\" if your"
53
53
" computer is idle for the specified amount of time.");
54
QWhatsThis::add(d->ck_asXa, s);
55
QWhatsThis::add(d->sb_asXa, s);
54
d->ck_asXa->setWhatsThis(s);
55
d->sb_asXa->setWhatsThis(s);
56
56
s = tr("Makes Psi automatically set your status to \"offline\" if your"
57
57
" computer is idle for the specified amount of time."
58
58
" This will disconnect you from the Jabber server.");
61
61
d->sb_asXa->hide();
62
62
d->lb_asXa->hide();
64
QWhatsThis::add(d->ck_asOffline, s);
65
QWhatsThis::add(d->sb_asOffline, s);
64
d->ck_asOffline->setWhatsThis( s);
65
d->sb_asOffline->setWhatsThis( s);
67
QWhatsThis::add(d->te_asMessage,
67
d->te_asMessage->setWhatsThis(
68
68
tr("Specifies an extended message to use if you allow Psi"
69
69
" to set your status automatically. See options above."));
76
76
connect(d->le_sp_priority, SIGNAL(textChanged(const QString&)), SLOT(changeStatusPreset()));
77
77
connect(d->cb_sp_status, SIGNAL(activated(int)), SLOT(changeStatusPreset()));
79
QWhatsThis::add(d->pb_spNew,
79
d->pb_spNew->setWhatsThis(
80
80
tr("Press this button to create a new status message preset."));
81
QWhatsThis::add(d->pb_spDelete,
81
d->pb_spDelete->setWhatsThis(
82
82
tr("Press this button to delete a status message preset."));
83
QWhatsThis::add(d->cb_preset,
83
d->cb_preset->setWhatsThis(
84
84
tr("Use this list to select a status message preset"
85
85
" to view or edit in the box to the bottom."));
86
QWhatsThis::add(d->te_sp,
86
d->te_sp->setWhatsThis(
87
87
tr("You may edit the message here for the currently selected"
88
88
" status message preset in the list to the above."));
89
QWhatsThis::add(d->cb_sp_status,
89
d->cb_sp_status->setWhatsThis(
90
90
tr("Use this to choose the status that will be assigned to this preset"));
91
QWhatsThis::add(d->le_sp_priority,
91
d->le_sp_priority->setWhatsThis(
92
92
tr("Fill in the priority that will be assigned to this preset."
93
93
" If no priority is given, the default account priority will be used."));
95
QWhatsThis::add(d->ck_askOnline,
95
d->ck_askOnline->setWhatsThis(
96
96
tr("Jabber allows you to put extended status messages on"
97
97
" all status types. Normally, Psi does not prompt you for"
98
98
" an extended message when you set your status to \"online\"."
114
114
PsiOptions::instance()->setOption("options.status.auto-away.use-away", d->ck_asAway->isChecked());
115
115
PsiOptions::instance()->setOption("options.status.auto-away.use-not-availible", d->ck_asXa->isChecked());
116
116
PsiOptions::instance()->setOption("options.status.auto-away.use-offline", d->ck_asOffline->isChecked());
117
PsiOptions::instance()->setOption("options.status.auto-away.message", d->te_asMessage->text());
117
PsiOptions::instance()->setOption("options.status.auto-away.message", d->te_asMessage->toPlainText());
120
120
foreach (QString name, deletedPresets) {
148
148
OptStatusUI *d = (OptStatusUI *)w;
150
d->sb_asAway->setMinValue(0);
151
d->sb_asAway->setMaxValue(INT_MAX);
150
d->sb_asAway->setMinimum(0);
151
d->sb_asAway->setMaximum(INT_MAX);
152
152
d->sb_asAway->setValue( PsiOptions::instance()->getOption("options.status.auto-away.away-after").toInt() );
153
d->sb_asXa->setMinValue(0);
154
d->sb_asXa->setMaxValue(INT_MAX);
153
d->sb_asXa->setMinimum(0);
154
d->sb_asXa->setMaximum(INT_MAX);
155
155
d->sb_asXa->setValue( PsiOptions::instance()->getOption("options.status.auto-away.not-availible-after").toInt() );
156
d->sb_asOffline->setMinValue(0);
157
d->sb_asOffline->setMaxValue(INT_MAX);
156
d->sb_asOffline->setMinimum(0);
157
d->sb_asOffline->setMaximum(INT_MAX);
158
158
d->sb_asOffline->setValue( PsiOptions::instance()->getOption("options.status.auto-away.offline-after").toInt() );
159
159
/*if (PsiOptions::instance()->getOption("options.status.auto-away.away-after").toInt() <= 0 )
160
160
PsiOptions::instance()->getOption("options.status.auto-away.use-away").toBool() = false;
256
text = QInputDialog::getText(
256
text = QInputDialog::getText(parentWidget,
257
257
CAP(tr("New Status Preset")),
258
258
tr("Please enter a name for the new status preset:"),
259
QLineEdit::Normal, text, &ok, parentWidget);
259
QLineEdit::Normal, text, &ok);
273
273
newPresets[text].setName(text);
274
d->cb_preset->insertItem(text);
275
d->cb_preset->setCurrentItem(d->cb_preset->count()-1);
274
d->cb_preset->addItem(text);
275
d->cb_preset->setCurrentIndex(d->cb_preset->count()-1);
276
276
selectStatusPreset(d->cb_preset->count()-1);
277
277
d->te_sp->setFocus();
282
282
void OptionsTabStatus::removeStatusPreset()
284
284
OptStatusUI *d = (OptStatusUI *)w;
285
int id = d->cb_preset->currentItem();
285
int id = d->cb_preset->currentIndex();
289
289
emit dataChanged();
291
QString name = d->cb_preset->text(id);
291
QString name = d->cb_preset->itemText(id);
293
293
if (newPresets.contains(name)) {
294
294
newPresets.remove(name);
296
deletedPresets += d->cb_preset->text(id);
297
presets.remove(d->cb_preset->text(id));
296
deletedPresets += d->cb_preset->itemText(id);
297
presets.remove(d->cb_preset->itemText(id));
299
299
d->cb_preset->removeItem(id);
314
314
void OptionsTabStatus::changeStatusPreset()
316
316
OptStatusUI *d = (OptStatusUI *)w;
317
int id = d->cb_preset->currentItem();
317
int id = d->cb_preset->currentIndex();
322
sp.setMessage(d->te_sp->text());
322
sp.setMessage(d->te_sp->toPlainText());
323
323
if (d->le_sp_priority->text().isEmpty())
324
324
sp.clearPriority();
326
326
sp.setPriority(d->le_sp_priority->text().toInt());
327
327
sp.setStatus(d->cb_sp_status->status());
329
QString name = d->cb_preset->text(id);
329
QString name = d->cb_preset->itemText(id);
331
331
sp.setName(name);
332
332
if (newPresets.contains(name)) {