示例#1
0
int main(int argc, char *argv[])
{
    QApplication    application(argc, argv);
    QMessageBox     msgBox;

    // Creating application's main window and a dispatcher object for communicating
    // between GUI and SkypeKit callbacks.

    mainForm            = new MainWindow();
    dispatcher          = new QSKSignalDispatcher();
    dispatcher->ConnectToUI();


    // Prefilling login credential input fields from command-line
    if (argc == 3) { mainForm->prefillLogin(argv[1], argv[2]); };

    // Attempting to programmatically start runtime.
    // Note that QProcess::startDetached leaves the shell terminal open on desktop.
    // For demp application this is ok - for production apps you might want go for other
    // methods of starting the runtime process. On Windows, ShellExecute will give you
    // an option to run a program with SW_HIDE switch, for example.

    QProcess runtime;
    if (!runtime.startDetached(runtimePath))
    {
        QMessageBox msgBox;
        msgBox.setText("ERROR: Unable to execute " + runtimePath);
        msgBox.exec();
    }
    else
    {
        skype = new QSKSkype();
        TransportInterface::Status skypeStatus;

        char* keyBuf = 0;
        getKeyPair (keyBuf);
        skypeStatus = skype->init(keyBuf, "127.0.0.1", 8963);

        if (skypeStatus != TransportInterface::OK)
        {
            msgBox.setText("ERROR: Could not connect to SkypeKit runtime. Are you using correct .pem file?");
            msgBox.exec();
        }
        else
        {
            skype->start();
            mainForm->on_EnableCallBtn(false);
            mainForm->show();
            application.exec();
        };

        skype->stop();
        delete skype;
    };
};
void ConfigurationManager::retrieveEntries()
{
	std::vector<KeyType> storageKeys = storage->listKeys();
	
	for(std::vector<KeyType>::const_iterator iter = storageKeys.begin(); iter != storageKeys.end(); ++iter)
	{
		KeyValueRecord record = storage->retrieve(*iter);
		
		entries->insert(std::make_pair(getKeyPair(record.first), record.second));
	}
}
示例#3
0
static CMapNode nextCNode(char * line) {
  CMapNode cnode;
  int eqSign = getKeyPair(line);

  if (!eqSign) printErr("Keyword required in line: ", line, 4);
  if (eqSign < strlen(line)) {
    cnode = mallocCNode();
    cnode->keyword = getKeyword(line, eqSign);
    cnode->value = getValue(line, eqSign);
    return cnode;
  }
  return NULL;
}
示例#4
0
void SkypeFunctions::initialize(){

    // At this point the SDK runtime should be already up and running.
    skype = new MySkype();

    if (!getKeyPair())
        throw SkypeException("Can't initialize. (getKeyPair)\n");

    skype->init(keyBuf, inetAddr, portNum, "streamlog.txt");

    if (!skype->start())
        throw SkypeException("Can't initialize. (start)\n");

}