Ejemplo n.º 1
0
void admin::setupAction()
{
    readSettings();
    logList->setColumnWidth(0,60);
    logList->setColumnWidth(1,60);
    logList->setColumnWidth(2,40);
    sysList->setColumnWidth(0,120);

    RefTable->setColumnWidth(0,100);
    RefTable->setColumnWidth(1,180);
    RefTable->setColumnWidth(2,160);
    RefTable->setColumnWidth(3,60);
    RefTable->setColumnWidth(4,60);
    RefTable->setColumnWidth(5,60);
    customsTable->setColumnWidth(0,80);
    customsTable->setColumnWidth(1,190);
    if(settings.value("dbconf").toInt() == 0) {
        s = tr("\nDas Runtime-Flag 'dbconf' steht auf Null.\nDas Flag ist beschaedigt, ");
        s += tr("oder QtLog ist nicht initialisiert\n");
        s += tr("Das Programm schaltet ab");
        QMessageBox::information( this,
                                  tr("QtLog INFO"),
                                  tr(s.toAscii()),
                                  QMessageBox::Ok | QMessageBox::Default,
                                  QMessageBox::NoButton, QMessageBox::NoButton);
        exit(0);
    }
    else {
        openDatabase();
        showTables(1);
    }
    if(settings.value("Val").toInt() == 1) {
        dirsel = 0;
        adifExpCb();
    }
    else if(settings.value("Val").toInt() == 2) {
        dirsel = 1;
        adifImpCb();
    }
    QSqlQuery query;
    qy = "SELECT rigtype FROM wrig";
    query.exec(qy);
    while(query.next()) {
        n = 0;
        comboBoxRig->addItem(query.value(n++).toString());
    }
    qy = "SELECT lid,logging FROM tlocation WHERE logging != ''";
    query.exec(qy);
    while(query.next()) {
        i = 0;
        n = 0;
        i = query.value(n++).toInt();
        comboBoxHome->addItem(query.value(n++).toString());
    }

    comboBoxHome->setCurrentIndex(1);
    SavePathEdit->setText(settings.value("dumpPath").toString());
}
Ejemplo n.º 2
0
// -----------------------------
void admin::setupAction()
{
   readSettings();
   logList->setColumnWidth(0,60);          // Log_name
   logList->setColumnWidth(1,60);          // Einträge
   logList->setColumnWidth(2,40);          // Rel
   
   sysList->setColumnWidth(0,120);
   
   RefTable->setColumnWidth(0,100);        // sys.Name
   RefTable->setColumnWidth(1,100);        // User.Name
   RefTable->setColumnWidth(2,100);        // User_en
   RefTable->setColumnWidth(3,135);        // Adif.Name
   
   //RefTable->setColumnWidth(4,60);
   //RefTable->setColumnWidth(5,60);
   
   customsTable->setColumnWidth(0,80);
   customsTable->setColumnWidth(1,190);
   
   if(settings.value("dbconf").toInt() == 0) {      // liegt ein Fehler vor ?
     s = tr("\nDas Runtime-Flag 'dbconf' steht auf Null.\nDas Flag ist beschaedigt, ");
     s += tr("oder QtLog ist nicht initialisiert\n");
     s += tr("Das Programm schaltet ab");
     QMessageBox::information( this,
         tr("QtLog INFO"),
         tr(s.toAscii()),
         QMessageBox::Ok | QMessageBox::Default,
         QMessageBox::NoButton, QMessageBox::NoButton);
     exit(0);                                       // Abbruch       
   }
   else {
     openDatabase();                                // normaler db_connect   
     showTables(1);                                 // Log + SysTabellen zeigen
   }
   if(settings.value("Val").toInt() == 1) {         // ADIF_Export
       dirsel = 0;                                  // dirselector auf Pfad stellen
       adifExpCb();
   }
   else
    if(settings.value("Val").toInt() == 2) {       // ADIF_Import
       dirsel = 1;                                 // dirselector auf Datei waehlen stellen
       adifImpCb();
    }
   QSqlQuery query;
   qy = "SELECT rigtype FROM wrig";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       comboBoxRig->addItem(query.value(n++).toString());
   }
   qy = "SELECT lid,logging FROM tlocation WHERE logging != ''";
   query.exec(qy);
   while(query.next()) {
       i = 0;
       n = 0;
       i = query.value(n++).toInt();                       // id   
       comboBoxHome->addItem(query.value(n++).toString()); // logging_text
   }
   
   comboBoxHome->setCurrentIndex(1);                          
   SavePathEdit->setText(settings.value("dumpPath").toString());
}