Exemplo n.º 1
0
bool DB::createTable(){
    /*resetuję bazę*/
    QMessageBox msgB;
    msgB.addButton(QMessageBox::Ok);
    msgB.addButton(QMessageBox::Cancel);
    msgB.setText(UTF("Czy na pewno chcesz zresetować bazę danych?"));
    int ret = msgB.exec();
    if (ret != QMessageBox::Ok){
        return false;
    }

    QSqlQuery query;
    query.exec("DROP TABLE quotes");
    query.exec("CREATE TABLE quotes (id int primary key, "
               "quotation TEXT)");
    query.exec("INSERT INTO quotes VALUES(101, 'Jakis pierwszy cytat.')");
    query.exec("INSERT INTO quotes VALUES(102, 'Jakis drugi cytat.')");
    query.exec("INSERT INTO quotes VALUES(103, 'Jakis trzeci cytat.')");
    query.exec("INSERT INTO quotes VALUES(104, 'Jakis czwarty cytat.')");
    query.exec("INSERT INTO quotes VALUES(105, 'Jakis piaty cytat.')");
    query.exec(UTF("INSERT INTO quotes VALUES(106, 'Jakis szósty cytat.')"));
    query.exec("INSERT INTO quotes VALUES(107, 'Jakis siódmy cytat.')");
    query.exec("INSERT INTO quotes VALUES(108, 'Jakis ósmy cytat.')");
    query.exec("INSERT INTO quotes VALUES(109, 'Jakis dziewiaty cytat.')");
    query.exec("INSERT INTO quotes VALUES(111, 'Jakis dziesiaty cytat.')");

    return true;
}
Exemplo n.º 2
0
bool DB::createConnection()
{
    data = QSqlDatabase::addDatabase("QSQLITE");
    data.setHostName("localhost");
    data.setDatabaseName(DBNAME);
    if (!data.open()) {
        QMessageBox::critical(0, UTF("Nie można otworzyć bazy!"),
            UTF("Broblemy z otworzeniem bazy danych!"), QMessageBox::Cancel);
        return false;
    }
    return true;
}
Exemplo n.º 3
0
// s_Path = "[Gmail]/Sent"
// ATTENTION: s_Path is case sensitive!
// If you never call this function the default folder is "INBOX".
void cImap::SelectFolder(const wstring s_Path)
{
    try
    {
        if (mi_Folder && ms_Folder == s_Path)
            return; // already selected

        Connect();

        if (s_Path.find('\\') != string::npos)
            throw exception("Please use slashes instead of backslashes in folder paths!");

        utility::path i_Path = utility::path::fromString('/', UTF(s_Path));
        ref<net::folder> i_NewFolder = mi_Store->getFolder(i_Path);

        i_NewFolder->open(net::folder::MODE_READ_WRITE); // this creates a new connection to the server

        if (mi_Folder)
            mi_Folder->close(true);

        mi_Folder = i_NewFolder;
        ms_Folder = s_Path;
    }
    catch (...)
    {
        // http://stackoverflow.com/questions/21346400/destructors-not-executed-no-stack-unwinding-when-exception-is-thrown
        throw;
    }
}
Exemplo n.º 4
0
// u16_Server = hostname of SMTP server
// u16_Port   = 0 to use the default port, otherwise the user defined port
// e_Security = The encryption mode
// If the server sends a certificate that is not signed with a root certificate:
// b_AllowInvalidCerts = true  -> only write an ERROR to the Trace output.
// b_AllowInvalidCerts = false -> throw an exception and do not send the email.
// u16_ResIdCert = The IDR identifier in the RCDATA Resources of RootCA.txt. (IDR_ROOT_CA)
cSmtp::cSmtp(const wchar_t* u16_Server, vmime_uint16 u16_Port, cCommon::eSecurity e_Security, 
             bool  b_AllowInvalidCerts, vmime_uint16 u16_ResIdCert)
{
    ms_Server      = UTF(u16_Server);
    mu16_Port      = u16_Port;
    me_Security    = e_Security;
    mu16_ResIdCert = u16_ResIdCert;
    mb_AllowInvalidCerts = b_AllowInvalidCerts;
}
Exemplo n.º 5
0
void MainClientWindow::btnNewPressed()
{
    ui->quoteArea->setHtml(UTF("<p style=\"color=green;font-size=larger;\"><Ładowanie.../p>"));
    QString q = UTF("Pusty cytat");
    try
    {
        q = client->getQuote(boost::bind(progressSetter, ui->progressBar, _1));

    }
    catch (errnoException& e)
    {
        ui->quoteArea->setHtml("<p style=\"color:red;\">" + e.to_str() + "</p>");
        ui->progressBar->setValue(ui->progressBar->minimum());
        return ;
    }

    ui->quoteArea->setHtml(q);
}
Exemplo n.º 6
0
void cSmtp::SetAuthData(const wchar_t* u16_User, const wchar_t* u16_Password)
{
    ms_User     = UTF(u16_User);
    ms_Password = UTF(u16_Password);
}
Exemplo n.º 7
0
void cPop3::SelectFolder(const wstring s_Path)
{
	try
    {
		Connect();
		
		mi_Inbox = mi_Store->getFolder(vmime::net::folder::path(vmime::net::folder::path::component(UTF(s_Path))));
		mi_Inbox->open(net::folder::MODE_READ_WRITE);
	}
	catch(...)
	{
		throw;
	}

}
Exemplo n.º 8
0
 const utfchar* Author()     { return UTF("Bj�rn Olievier"); };
Exemplo n.º 9
0
 const utfchar* Version()    { return UTF("1"); };
Exemplo n.º 10
0
 const utfchar* Name()       { return UTF("WaveOut output plugin"); };
Exemplo n.º 11
0
	const utfchar* Author(){
		return UTF("Daniel �nnerby");
	};
Exemplo n.º 12
0
	const utfchar* Name(){
		return UTF("Taglib 1.5 plugin");
	};