SIM::Account *skypeEditAccount::apply() { kdDebug(14311) << k_funcinfo << endl;//some debug info //first, I need a pointer to that account if (!account()) //it does not exist setAccount(new SkypeAccount(d->protocol));//create a new one SkypeAccount *skype = static_cast<SkypeAccount *>(account());//get the account //set it's values skype->setExcludeConnect(excludeCheck->isChecked());//Save the "exclude from connection" setup skype->launchType = LaunchGroup->selectedId();//get the type how to launch skype if (AuthorCheck->isChecked()) skype->author = AuthorEdit->text();//put there what user wrote else skype->author = "";//nothing unusual skype->setHitchHike(HitchCheck->isChecked());//save the hitch hike mode and activat ethe new value skype->setMarkRead(MarkCheck->isChecked());//set the mark read messages mode and activate it skype->setScanForUnread(ScanCheck->isChecked()); skype->setCallControl(CallCheck->isChecked()); skype->setPings(PingsCheck->isChecked()); skype->setBus(BusGroup->selectedId()); skype->setStartDBus(DBusCheck->isChecked()); skype->setLaunchTimeout(LaunchSpin->value()); skype->setSkypeCommand(CommandEdit->text()); skype->setWaitBeforeConnect(WaitSpin->value()); skype->setLeaveOnExit(LeaveCheck->isChecked()); if (AutoCloseCallCheck->isChecked()) { skype->setCloseWindowTimeout(CloseTimeoutSpin->value()); } else { skype->setCloseWindowTimeout(0); } if (StartCallCommandCheck->isChecked()) { skype->setStartCallCommand(StartCallCommandEdit->text()); } else { skype->setStartCallCommand(""); } skype->setWaitForStartCallCommand(WaitForStartCallCommandCheck->isChecked()); if (EndCallCommandCheck->isChecked()) { skype->setEndCallCommand(EndCallCommandEdit->text()); } else { skype->setEndCallCommand(""); } if (IncomingCommandCheck->isChecked()) { skype->setIncomingCommand(IncomingCommandEdit->text()); } else { skype->setIncomingCommand(""); } skype->setEndCallCommandOnlyForLast(OnlyLastCallCommandCheck->isChecked()); skype->save();//save it to config return skype;//return the account }
Kopete::Account *skypeEditAccount::apply() { kDebug(SKYPE_DEBUG_GLOBAL); //first, I need a pointer to that account if (!account()) //it does not exist setAccount(new SkypeAccount(d->protocol, "Skype" ));//create a new one SkypeAccount *skype = static_cast<SkypeAccount *>(account());//get the account //set it's values skype->setExcludeConnect(widget->excludeCheck->isChecked());//Save the "exclude from connection" setup if ( widget->LaunchNeverRadio->isChecked() )//get the type how to launch skype skype->launchType = 1; else if ( widget->LaunchNeededRadio->isChecked() ) skype->launchType = 0; if (widget->AuthorCheck->isChecked()) skype->author = widget->AuthorEdit->text();//put there what user wrote else skype->author = "";//nothing unusual skype->setHitchHike(widget->HitchCheck->isChecked());//save the hitch hike mode and activat ethe new value skype->setMarkRead(widget->MarkCheck->isChecked());//set the mark read messages mode and activate it skype->setScanForUnread(widget->ScanCheck->isChecked()); skype->setCallControl(widget->CallCheck->isChecked()); skype->setPings(widget->PingsCheck->isChecked()); if ( widget->radioButton4->isChecked() ) skype->setBus(0); else if ( widget->radioButton5->isChecked() ) skype->setBus(1); skype->setLaunchTimeout(widget->LaunchSpin->value()); skype->setSkypeCommand(widget->CommandEdit->text()); skype->setWaitBeforeConnect(widget->WaitSpin->value()); skype->setLeaveOnExit(!widget->LeaveCheck->isChecked()); if (widget->AutoCloseCallCheck->isChecked()) { skype->setCloseWindowTimeout(widget->CloseTimeoutSpin->value()); } else { skype->setCloseWindowTimeout(0); } if (widget->StartCallCommandCheck->isChecked()) { skype->setStartCallCommand(widget->StartCallCommandEdit->text()); } else { skype->setStartCallCommand(""); } skype->setWaitForStartCallCommand(widget->WaitForStartCallCommandCheck->isChecked()); if (widget->EndCallCommandCheck->isChecked()) { skype->setEndCallCommand(widget->EndCallCommandEdit->text()); } else { skype->setEndCallCommand(""); } if (widget->IncomingCommandCheck->isChecked()) { skype->setIncomingCommand(widget->IncomingCommandEdit->text()); } else { skype->setIncomingCommand(""); } skype->setEndCallCommandOnlyForLast(widget->OnlyLastCallCommandCheck->isChecked()); skype->save();//save it to config return skype;//return the account }