Exemplo n.º 1
0
iota::iota(QWidget * parent) : QMainWindow(parent),
    settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);
    n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n);
    setFont(font);

    connect(ButtonEnde, SIGNAL(clicked()), this, SLOT(goExit()));
    connect(wLineEdit, SIGNAL(textEdited(QString)), this, SLOT(wLineEditCb(QString)));
    connect(iotaList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *,int)), this, SLOT(iotaListClickedCb(QTreeWidgetItem *,int)));
    connect(ButtonBack, SIGNAL(clicked()), this, SLOT(backCb()));
    connect(ButtonUpdate, SIGNAL(clicked()), this, SLOT(updateCb()));
    connect(ButtonNeu, SIGNAL(clicked()), this, SLOT(neuCb()));
    connect(iotaBox, SIGNAL(currentIndexChanged(int)), this, SLOT(iotaBoxChangedCb(int)));
    readSettings();
    //db = QSqlDatabase::addDatabase(settings.value("qsqlDatabase").toString());
    db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName(settings.value("host").toString());
    db.setDatabaseName(settings.value("dbname").toString());
    db.setUserName(settings.value("dbuser").toString());
    db.setPassword(settings.value("dbpasswd").toString());
    if(!db.open()) {
        qDebug() << "usrDB_FEHLER - " << db.lastError();
    }
    iotaList->clear();
    iotaList->setColumnWidth(0,80);
    iotaList->setColumnWidth(1,120);
    qy = "SELECT * FROM tiota ORDER by iota";
    showIota(qy);
}
Exemplo n.º 2
0
// ----------------------------------------------------
// zeige Erfolg oder Fehler
// ----------------------------------------------------
bool rigctl::showSuccess(QString freq)
{
    int status = QMessageBox::question( this,              // frage ok alles ok
                 tr("HamLib"),
                 tr("\nRx - %1 Herz\n\n"
                    "Ist die Frequenz Anzeige richtig ?\n\n"
                    "Bei 'Yes', wird beim Logging und Contestlogging\nimmer Rigcontrol gestartet.")
                 .arg(freq),
                 QMessageBox::Yes|QMessageBox::Default,
                 QMessageBox::No|QMessageBox::Escape,
                 QMessageBox::NoButton);
        if(status != QMessageBox::Yes) {
          qy = "DELETE FROM wproz WHERE proz='HamLib'";    // lösche wrigctl
          QSqlQuery query(qy); 
          return false;
        }
 
        Retry = editRetry->text().toInt();                 // setzt timer interval
        Runing = 1;                                        // ready for runing
        settings.setValue("RigPid",editPid->text());
        qy = "UPDATE wproz set runing=1 WHERE proz='HamLib'"; 
        QSqlQuery query(qy); 
        updateFlg = 1;
        goExit();
        return true;                                       // daemon wird jetzt gepollt
}
Exemplo n.º 3
0
void iota::keyPressEvent( QKeyEvent * event )
{
    switch ( event->key() ) {
    case Qt::Key_F10 :
        goExit();
        break;
    }
}
Exemplo n.º 4
0
void awdst::keyPressEvent( QKeyEvent * event )
{
   switch ( event->key() ) {
     case Qt::Key_F10 :                           
             goExit();
           break;
    default : break;
   }
}
Exemplo n.º 5
0
// Aufruf vom Button_Stop
// -----------------------------------------------------
void rigctl::goStop()
{
   qy = "UPDATE wproz SET runing=0 WHERE proz='HamLib'";
   QSqlQuery query(qy); 
  
   updateFlg = 2;                                     // timer->stop, polling = 0 setzen
   Retry = 0;

   goExit();
}
Exemplo n.º 6
0
// Child windows functions
void MainWindow::createChildWindows()
{
	currentRecipient = ALL_FRIENDS_ID;

	// Creating drawing window
	drawingWindow = new DrawingWindow(this);

	connect(drawingWindow, SIGNAL(clipartWindowRequest()), this, SLOT(onShowClipart()));
	connect(drawingWindow, SIGNAL(messageSent()), this, SLOT(onMessageSent()));
	connect(drawingWindow, SIGNAL(replyChanged()), tvWidget, SLOT(replyChanged()));
	
	drawingWindow->updatePosition(this);

	historyWindow = new HistoryWindow(this);
	historyWindow->setTvWidget(tvWidget);

	connect(historyWindow, SIGNAL(beginOfPreview(const MessageKey &)), tvWidget, SLOT(showHistoryMessage(const MessageKey &)));
	connect(historyWindow, SIGNAL(endOfPreview()), tvWidget, SLOT(stopShowingHistory()));
	connect(historyWindow, SIGNAL(clicked(const MessageKey &)), tvWidget, SLOT(scrollToMessage(const MessageKey &)));
	connect(historyWindow, SIGNAL(deleteMessages(const QList<MessageKey> &)), tvWidget, SLOT(deleteMessages(const QList<MessageKey> &)));
	connect(historyWindow, SIGNAL(saveMessage()), tvWidget, SLOT(saveMessage()));
	connect(historyWindow, SIGNAL(copyMessage()), tvWidget, SLOT(copyMessage()));

	connect(tvWidget, SIGNAL(publishRequest(const MessageKey &)), historyWindow, SLOT(publishMessage(const MessageKey &)));

	historyWindow->updatePosition(this);

	contactList = new NewContactListWindow(this);
	contactList->updatePosition(this);
	contactList->initAutoUpdater(&autoUpdater);
	
	// Connect menu signals
	connect(contactList, SIGNAL(goOnline()), this, SLOT(relogon()));
	connect(contactList, SIGNAL(goOffline()), this, SLOT(offline()));
	connect(contactList, SIGNAL(goLogout()), this, SLOT(logout()));
	connect(contactList, SIGNAL(goExit()), this, SLOT(shutDown()));
	connect(contactList, SIGNAL(contactSelected(qint32)), this, SLOT(onContactSelected(qint32)));
	connect(contactList, SIGNAL(contactImageDrop(qint32, const QImage &)), this, SLOT(onContactImageDrop(qint32, const QImage &)));
	connect(contactList, SIGNAL(soundStateChanged(const bool)), this, SLOT(onSoundStateChanged(const bool)));
	connect(contactList, SIGNAL(unreadContacts(int)), contactListButton, SLOT(update(int)));
#ifdef Q_WS_MAC
    connect(contactList, SIGNAL(unreadContacts(int)), DockIconHandler::instance(), SLOT(unreadCountChanged(int)));
#endif
	connect(contactList, SIGNAL(historyCleared()), tvWidget, SLOT(reload()));

	connect(welcomeWidget, SIGNAL(showProfileDialog()), contactList, SLOT(onShowProfileDialog()));
	connect(welcomeWidget, SIGNAL(showFindFriendsDialog()), contactList, SLOT(onShowFindDialog()));
}
Exemplo n.º 7
0
admin::admin(QWidget * parent) : QMainWindow(parent),
    settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);
    n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n);
    setFont(font);
    connect(actionEnde, SIGNAL(triggered(bool)), this, SLOT(goExit()));
    connect(actionAdif_Export, SIGNAL(triggered(bool)), this, SLOT(adifExpCb()));
    connect(actionAdif_Import, SIGNAL(triggered(bool)), this, SLOT(adifImpCb()));
    connect(actionDump, SIGNAL(triggered(bool)), this, SLOT(dumpCb()));
    connect(actionRefNamen, SIGNAL(triggered(bool)), this, SLOT(refNamenCb()));
    connect(actionHilfe, SIGNAL(triggered(bool)), this, SLOT(getHilfeCb()));
    connect(pushButtonEnde, SIGNAL(clicked()), this, SLOT(goExit()));
    connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackedWidgetCb(int)));
    connect(checkBoxLog, SIGNAL(pressed()), this, SLOT(toggelLogBoxCb()));
    connect(checkBoxDb, SIGNAL(pressed()), this, SLOT(toggelDbBoxCb()));
    connect(checkBoxQslMode, SIGNAL(pressed()), this, SLOT(toggelQslModeCb()));

    connect(logList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(logListCb(QTreeWidgetItem*,int)));
    connect(sysList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(sysListCb(QTreeWidgetItem*,int)));
    connect(RefTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateRefItemCb(QTableWidgetItem*)));
    connect(RefTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(saveValCb(QTableWidgetItem*)));
    connect(customsTable, SIGNAL(itemChanged(QTableWidgetItem*)), this, SLOT(updateCustomItemCb(QTableWidgetItem*)));
    connect(customsTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(saveValCb(QTableWidgetItem*)));
    connect(ButtonDumpDir, SIGNAL(clicked()), this, SLOT(getSaveDirCb()));
    connect(ButtonAdifDir, SIGNAL(clicked()), this, SLOT(getAdifDirCb()));
    connect(ButtonDump, SIGNAL(clicked()), this, SLOT(dbDump()));
    connect(ButtonRestore, SIGNAL(clicked()), this, SLOT(dbRestore()));
    connect(ButtonAdifExport, SIGNAL(clicked()), this, SLOT(adifExport()));
    connect(ButtonAdifImport, SIGNAL(clicked()), this, SLOT(adifImport()));
    s = settings.value("dbname").toString();
    s += " Rel.: ";
    s += RELEASE;

    label_db->setText(s);
    label_dbase->setText(s);
    dirsel = 0;
    setupAction();
    lItem = 0;
    sItem = 0;
    udpSocket = new QUdpSocket(this);
    ltreeWidget = logList;
}
Exemplo n.º 8
0
//extern DirMngr dirMngr;
qsldb::qsldb(QWidget * parent) : QMainWindow(parent),
settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);
    int n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n);
    setFont(font);
    connect(ButtonExit, SIGNAL(clicked()), this, SLOT(goExit()));
    connect(cardList, SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, SLOT(cardListClicked(QTreeWidgetItem*,int)));
    connect(lineEdit, SIGNAL(textChanged(QString)), this, SLOT(searchQslCardCb(QString)));
    connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(searchQslCardCB()));
    path =  QDir::homePath();                      
    s = path+"/log/icon/AuthGuaranteed.gif";
    label->setPixmap(QPixmap(s));
    label->adjustSize();
    s = path+"/log/icon/dl1hbd.jpg";
    cardLabel->setPixmap(QPixmap(s));
    cardLabel->adjustSize();
    s = settings.value("host").toString();
    strcpy(host,s.toAscii());
    s = settings.value("dbname").toString();
    strcpy(dbname,s.toAscii());
    s = settings.value("dbuser").toString();
    strcpy(dbuser,s.toAscii());
    s = settings.value("dbpasswd").toString();
    strcpy(dbpasswd,s.toAscii());
    db = new Connection( host, dbname, dbuser, dbpasswd );
    labeldbInfo->setText(db->GetConnectInfo());
 
    cardList->setColumnWidth(0,80);   
    cardList->setColumnWidth(1,100);  
    cardList->setColumnWidth(2,60);   
    cardList->setColumnWidth(3,60);   
    cardList->setColumnWidth(4,50);   
    udpSocket = new QUdpSocket(this);                    
    udpSocket->bind(QHostAddress::LocalHost,45508);
    connect(udpSocket, SIGNAL(readyRead()), this, SLOT(processPendingDatagram()));
    pcount = 0;
    logFile = settings.value("Logfile").toString();
    qy = "SELECT qcall,qsoday,cband,cmode,qsl,qsocid FROM "+logFile+"card";
    showQslCards(qy);
    lineEdit->setFocus(); 
}
Exemplo n.º 9
0
void qsldb::processPendingDatagram()
{
   while(udpSocket->hasPendingDatagrams()) {
     datagram.resize(udpSocket->pendingDatagramSize());
     QHostAddress sender;
     quint16 senderPort;
     udpSocket->readDatagram(datagram.data(),datagram.size(),&sender, &senderPort);
     i = datagram.indexOf (",",0);
     QByteArray Left = datagram.left(i);           
     QByteArray Mid = datagram.mid(i+1);           
     int com = Left.toInt();                       
     s = Mid;                                      
     if(com == 1)                                  
        viewCard( s, 0 );
     else
      if(com == -1)
       goExit();
  }
}
Exemplo n.º 10
0
awdst::awdst(QWidget * parent) : QMainWindow(parent),
settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);
    n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n); 			
    setFont(font);
    connect(actionExit, SIGNAL(triggered(bool)), this, SLOT(goExit()));
    connect(actionDxStatus, SIGNAL(triggered(bool)), this, SLOT(getDxStatus()));
    connect(actionJahresMode, SIGNAL(triggered(bool)), this, SLOT(getModeAktivitaet()));
    connect(actionJahresBand, SIGNAL(triggered(bool)), this, SLOT(getBandAktivitaet()));
    connect(actionMakeDxStatusList, SIGNAL(triggered(bool)), this, SLOT(makedxccStatusListAc()));
    connect(actionAwardDLD, SIGNAL(triggered(bool)), this, SLOT(awStatusDldAc()));
    connect(actionAwardIOTA, SIGNAL(triggered(bool)), this, SLOT(awStatusIotaAc()));
    connect(actionHilfe, SIGNAL(triggered(bool)), this, SLOT(getHilfeAc()));
    connect(checkBoxBand, SIGNAL(clicked()), this, SLOT(checkBoxBandCb()));
    connect(ButtonEnde, SIGNAL(clicked()), this, SLOT(goExit()));
    //db = QSqlDatabase::addDatabase(settings.value("qsqlDatabase").toString());
    db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName(settings.value("host").toString());      
    db.setDatabaseName(settings.value("dbname").toString());
    db.setUserName(settings.value("dbuser").toString());
    db.setPassword(settings.value("dbpasswd").toString());
    if(!db.open()) {
       qDebug() << "usrDB_FEHLER - " << db.lastError();     
    }

    readSettings();
    DxLabelCall->setText(settings.value("Call").toString());
    labelLogBook->setText(settings.value("logfile").toString());
    logFile = settings.value("Logfile").toString();

    QSqlQuery query;
    qy = "SELECT mode FROM wmode WHERE work != 0 ORDER by work";
    query.exec(qy);
    n = 0;
    while(query.next()) {                                
      i = 0;
      BoxMode->insertItem(n, query.value(i).toString()); 
    }

    
    n = 4;
    qy = "SELECT band,mband FROM wband WHERE work != 0 ORDER BY work";  
    query.exec(qy);
    hcount = query.size();
    while(query.next()) {
      i = 0;
      s = query.value(i++).toString();           
     ms = query.value(i++).toString();           
      toMband.insert(s,ms);                      
      toSband.insert(ms,s);                      
      StatusList->headerItem()->setText(n,ms);
      StatusList->setColumnWidth(n++,45);
      bandlist.append(s);                        
    }
    qy = "SELECT atype FROM wawdlist WHERE aset !='0' ORDER BY aset";
    query.exec(qy);
    n = 0;
    while(query.next())                          
      BoxAwd->insertItem(n++, query.value(0).toString());  
    BoxAwd->setCurrentIndex(settings.value("BoxAwd").toString().toInt()); 
    s = settings.value("Val").toString();
    if(s.compare("0") == 0 ) {
      n = BoxMode->findText("SSB");
      BoxMode->setCurrentIndex (n);
      getDxStatus();                             
    }
    else
    if(s.compare("1") == 0 ) {
       n = BoxMode->findText("CW");
       BoxMode->setCurrentIndex (n);
       getDxStatus();                             
    }
    else
    if(s.compare("2") == 0 )                     
       getModeAktivitaet(); 
    else
    if(s.compare("3") == 0 )                     
       getBandAktivitaet();
    else
    if(s.compare("4") == 0 ) {                   
      n = BoxAwd->findText("DLD");               
      BoxAwd->setCurrentIndex (n);
      awStatusDLD("DLD");
    }
    else
    if(s.compare("5") == 0 ) {                   
      n = BoxAwd->findText("IOTA");              
      BoxAwd->setCurrentIndex (n);
      awStatusIOTA("IOTA");
    }
    connect(BoxMode, SIGNAL(currentIndexChanged(QString)), this, SLOT(setDxModeCb(QString)));
    connect(BoxAwd, SIGNAL(currentIndexChanged(QString)), this, SLOT(BoxAwdCb(QString)));
}
Exemplo n.º 11
0
dxspot::dxspot(QWidget * parent) : QMainWindow(parent),
settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);
    int n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n);
    setFont(font);
    
    connect(actionChose, SIGNAL(triggered(bool)), this, SLOT(getNodes()));
    connect(ButtonReturn, SIGNAL(clicked()), this, SLOT(buttonReturnCb()));
    connect(ButtonExit, SIGNAL(clicked()), this, SLOT(goExit()));
    connect(ButtonSendSpot, SIGNAL(clicked()), this, SLOT(sendSpotCb()));
    connect(ButtonSpot, SIGNAL(clicked()), this, SLOT(sendSpotTextCb()));
    connect(ButtonAnnounce, SIGNAL(clicked()), this, SLOT(sendAnnounceTextCb()));
    
    stackedWidget->setCurrentIndex(0);
    spotList->setColumnWidth(0,95);  
    spotList->setColumnWidth(1,90);  
    spotList->setColumnWidth(2,100); 
    spotList->setColumnWidth(3,300); 
    spotList->setColumnWidth(4,100); 
 
    
    //db = QSqlDatabase::addDatabase(settings.value("qsqlDatabase").toString());
    db = QSqlDatabase::addDatabase("QMYSQL");
    db.setHostName(settings.value("host").toString());                         
    db.setDatabaseName(settings.value("dbname").toString());
    db.setUserName(settings.value("dbuser").toString());
    db.setPassword(settings.value("dbpasswd").toString());
    if(!db.open()) {
       qDebug() << db.lastError();           
    }
    
    //s = settings.value("Breite").toString();       
    //t = settings.value("Laenge").toString();
    //distanz.setHomeCoordinaten(s,t);
    distanz.setHomeCoordinaten(settings.value("Breite").toString(),settings.value("Laenge").toString());
    
    BoxSpots->clear();
    QSqlQuery query;  
    qy = "SELECT rangeval,descript FROM wspotsparm WHERE sel=1";
    query.exec(qy);
    i = 0;
    while(query.next()) {
       s = query.value(0).toString();        
       t = query.value(1).toString();        
       BoxSpots->insertItem(i++,t);
       RangeDes.insert(t,s);                 
    }
    
    BoxCustom->clear();
    qy = "SELECT rangeval,descript FROM wspotsparm WHERE sel=2";
    query.exec(qy);
    i = 0;
    while(query.next()) {
       s = query.value(0).toString();        
       t = query.value(1).toString();        
       BoxCustom->insertItem(i++,t);
       CustomDes.insert(t,s);                
    }
    
    qy = "SELECT urlstr,fetchd,count,ranged FROM wspotnodes WHERE run = 1";
    query.exec(qy);
    query.next();
    urlSpot = query.value(0).toString();                          
    urlSpot += "/"+query.value(1).toString();                     
    urlSpot += "?count="+query.value(2).toString();               
    urlSpot += "&range="+getRangeVal(query.value(3).toString());  
    BoxSpots->setCurrentIndex(BoxSpots->findText(query.value(3).toString()));
     
    if(query.value(1).toString().indexOf("DxSpots") != -1) {
       BoxSpots->setPalette( QPalette(QColor(180, 210, 200)));   
       BoxCustom->setCurrentIndex(BoxCustom->findText("-"));     
    }
    connect(BoxSpots, SIGNAL(currentIndexChanged(QString)), this, SLOT(spotsCb(QString)));
    connect(BoxCustom, SIGNAL(currentIndexChanged(QString)), this, SLOT(customCb(QString)));
    connect(spotList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(spotListClicked(QTreeWidgetItem*,int)));
    connect(ButtonF2, SIGNAL(pressed()), this, SLOT(writeForAddQso()));
    connect(lineEditSpotCall, SIGNAL(textEdited(QString)), this, SLOT(callUpperCb(QString)));
    
    udpSocket = new QUdpSocket(this);                           
    
    udpSocket = new QUdpSocket(this);                    
    udpSocket->bind(QHostAddress::LocalHost,45464);      
    connect(udpSocket, SIGNAL(readyRead()), this, SLOT (processPendingDatagram()));
    
    connect(&manager, SIGNAL(finished(QNetworkReply*)), SLOT(downloadFinished(QNetworkReply*)));
    
    dxtimer = new QTimer(this);              
    connect(dxtimer, SIGNAL(timeout()), this, SLOT(scanDxCall()));
   
    ntimer = new QTimer(this); 
    connect(ntimer,SIGNAL(timeout()), this, SLOT(getSpots()));   
    ntimer->start(100);                                          
    xcnt = 0;
    timerflg = 1;                                                
    urlFlg = 0;                                                  
}
Exemplo n.º 12
0
// constructor
// ------------------------------------------------------------------
rigctl::rigctl(QWidget * parent) : QDialog(parent),
settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
    setupUi(this);

    int n = settings.value("FontSize").toString().toInt();
    QFont font;
    font.setPointSize(n);
    setFont(font);
    
    connect(ButtonESC, SIGNAL(pressed()), this, SLOT(goExit()));
    connect(ButtonHilfe, SIGNAL(pressed()), this, SLOT(goHilfe()));
    connect(ButtonRigList, SIGNAL(pressed()), this, SLOT(showRigList()));
    connect(ButtonInit, SIGNAL(pressed()), this, SLOT(hamlibServerInit()));
    connect(ButtonStart, SIGNAL(pressed()), this, SLOT(goStart()));
    connect(ButtonStop, SIGNAL(pressed()), this, SLOT(goStop()));
    connect(buttonReturn, SIGNAL(pressed()), this, SLOT(showRigPage()));
    connect(InterfaceBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(intefaceBoxChanged(QString)));
    connect(wrigList, SIGNAL(itemClicked(QTreeWidgetItem *,int)), this, SLOT(itemClickedCb(QTreeWidgetItem *,int)));
    
    tcpSocket = new QTcpSocket(this);              // tspSocket
    connect(tcpSocket, SIGNAL(connected()), this, SLOT(sentCommand()));
    connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readRigReply()));
    connect(tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
                                            this, SLOT(displayError(QAbstractSocket::SocketError)));     
    QString home = getenv("HOME");                 // lade alle devices
    s = "ls /dev/ttyS* > "+home+"/.qtlog/rigstatus";
    i = system(s.toAscii());                       // suche device ttyS0 .. n
    home += "/.qtlog/rigstatus";                   // prüfe rigstatus
    QFile iniFile(home);
    iniFile.open(QIODevice::ReadOnly);
    QTextStream istream( &iniFile);                // lese device_file
       
    RigDevBox->clear();
    PttBitDevBox->clear();
    i = 0;
    while(istream.atEnd() != true) {               // RigBox_dev füllen
       s = istream.readLine(0);
       RigDevBox->insertItem(i,s);
       PttBitDevBox->insertItem(i++,s);
    }
    iniFile.close();
         
    home = getenv("HOME"); 
    s = "ls /dev/ttyU* > "+home+"/.qtlog/rigstatus";
    n = system(s.toAscii());                       // suche device ttyUSB0 .. n
    home += "/.qtlog/rigstatus";
    QFile inuFile(home);
    inuFile.open(QIODevice::ReadOnly);
    QTextStream iustream( &inuFile);               // oeffne device_file
    while(iustream.atEnd() != true) {
      s = iustream.readLine(0);
      RigDevBox->insertItem(i,s);                  // alle vorhndenen USB0 .. n devices übenehmen
      PttBitDevBox->insertItem(i++,s);
    }
    inuFile.close();
    
    Retry = 0;
    Runing = 0;
    r = 0;
    Runing = -1;
    i = getRigModell();                                      // lade alle Rig_Modelle
    
    if(i != 0) {                                             // falls hamlib installiert ist - lade Rig_Modelle
      if(settings.value("RigPid").toString().count() != 0) { // und Rig configuriert wurde
       QSqlQuery query;                                      // hole config_parameter_discriptor
       qy = "SELECT * FROM wproz WHERE rigpid='"+settings.value("RigPid").toString()+"'";
       query.exec(qy);
       while(query.next()) {
          proz = query.value(r++).toString();              // proz
          owner = query.value(r++).toString();             // owner
          editRig->setText(query.value(r++).toString());   // Rig
          editPid->setText(query.value(r++).toString());   // Pid
          editRetry->setText(query.value(r++).toString()); // retry
          Retry = editRetry->text().toInt();
          i = RigDevBox->findText(query.value(r++).toString());
          RigDevBox->setCurrentIndex(i);                   // Rig_device_Box
          i = BaudBox->findText(query.value(r++).toString());
          BaudBox->setCurrentIndex(i);                     // Baud_device_box
	  // -
          i = InterfaceBox->findText(query.value(r++).toString()); // FAM_Interface ONE
          InterfaceBox->setCurrentIndex(i);
          i = PttBitDevBox->findText(query.value(r++).toString());
          PttBitDevBox->setCurrentIndex(i);                // PTT_device_Box
          editRts->setText(query.value(r++).toString());   // RTS = OFF
          editDtr->setText(query.value(r++).toString());   // DTR = OFF
          editCts->setText(query.value(r++).toString());   // CTS = OFF
	  // -
          if(InterfaceBox->currentText().compare("NO") == 0) {
            PttBitDevBox->setEnabled(FALSE);
            editRts->setEnabled(FALSE);
            editDtr->setEnabled(FALSE);
            editCts->setEnabled(FALSE);
          }
          editHost->setText(query.value(r++).toString());  // localhost
          editPort->setText(query.value(r++).toString());  // port
          Runing = query.value(r).toInt();                 // runing_bit
        }
      }
     
      updateFlg = 0;                                      // alles ok
      if( Runing == -1 )
         ButtonInit->setPalette( QPalette(QColor(180, 210, 200)));  // grün
      else
       if( Runing )
          ButtonStop->setPalette( QPalette(QColor(180, 210, 200))); // STOP grün
       else
         ButtonStart->setPalette( QPalette(QColor(180, 210, 200))); // grün
    }
    else 
       QTimer::singleShot(10, this, SLOT(hlibNoInstalled()));       // Hamlib nicht installiert
}
Exemplo n.º 13
0
confMode::confMode(QWidget * parent) : QDialog(parent),
settings(QSettings::IniFormat, QSettings::UserScope,"QtLog", "qtlog")
{
   setupUi(this);
   n = settings.value("FontSize").toString().toInt();
   QFont font;
   font.setPointSize(n); 			
   setFont(font);
   
   connect(pushButtonExit, SIGNAL(clicked()), this, SLOT(goExit()));
   connect(bandList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(bandListCb(QTreeWidgetItem*,int)));
   connect(modeList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(modeListCb(QTreeWidgetItem*,int)));
   connect(pwrList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(pwrListCb(QTreeWidgetItem*,int)));
   connect(lineList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(lineListCb(QTreeWidgetItem*,int)));
   connect(awdList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(awdListCb(QTreeWidgetItem*,int)));
   connect(customsList, SIGNAL(itemClicked(QTreeWidgetItem*,int)), this, SLOT(customsListCb(QTreeWidgetItem*,int)));
   connect(rigList, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(rigListCb(QTreeWidgetItem*,int)));
   connect(ButtonHilfe, SIGNAL(clicked()), this, SLOT(getHilfeModeCb()));
   connect(SavePushButton, SIGNAL(clicked()), this, SLOT(SaveConfValues()));
   connect(NewPushButton, SIGNAL(clicked()), this, SLOT(NewAwdValues()));
   connect(RigSavePushButton, SIGNAL(clicked()), this, SLOT(RigSaveButton()));
   connect(RigClearPushButton, SIGNAL(clicked()), this, SLOT(RigClearButton()));
   
    // Band
   bandList->setColumnWidth(0,70);  // Band
   bandList->setColumnWidth(1,40);  // Set
   bandList->setColumnWidth(2,80);  // myBand
   bandList->setColumnWidth(3,70);  // Frequenz
   bandList->setColumnWidth(4,60);  // Band>Rig
   // Mode
   modeList->setColumnWidth(0,30);  // Set
   modeList->setColumnWidth(1,40);  // Mode
   // PWR
   pwrList->setColumnWidth(0,30);   // Set
   pwrList->setColumnWidth(1,40);   // Wort
   pwrList->setColumnWidth(2,60);   // PWR
   // Verbindungs_Arten
   lineList->setColumnWidth(0,30);  // set
   lineList->setColumnWidth(1,80);  // Mode
   // AWD_Typen
   awdList->setColumnWidth(0,40);   // aset
   awdList->setColumnWidth(1,80);   // atyp
   // customs_Felder
   customsList->setColumnWidth(0,80);   // custom_db_feld
   customsList->setColumnWidth(1,140);  // user_feld_name
   // Rig_List
   rigList->setColumnWidth(0,80);    // trans
   rigList->setColumnWidth(1,250);   // trans
   rigList->setColumnWidth(2,250);   // ant
   rigList->setColumnWidth(3,200);   // Linux
   QSqlQuery query;
   // Band
   qy = "SELECT band,work,mband,freq,brig FROM wband";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(bandList);
       item->setText(i++,query.value(n++).toString());    // band
       item->setText(i++,query.value(n++).toString());    // work
       item->setText(i++,query.value(n++).toString());    // myband
       item->setText(i++,query.value(n++).toString());    // freq
       item->setText(i++,query.value(n++).toString());    // Band -> Rig
   }
   // Mode
   qy = "SELECT * FROM wmode ORDER BY work DESC";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(modeList);
       item->setText(i++,query.value(n++).toString());     // work
       item->setText(i++,query.value(n++).toString());     // mode
   }
    // PWR
   qy = "SELECT * FROM wpwr";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(pwrList);
       item->setText(i++,query.value(n++).toString());    // pwr
       item->setText(i++,query.value(n++).toString());    // work
       item->setText(i++,query.value(n++).toString());    // watt
   }
   //
   qy = "SELECT * FROM wline ";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(lineList);
       item->setText(i++,query.value(n++).toString());    // id
       item->setText(i++,query.value(n++).toString());    // line
   }
   // AWD
   qy = "SELECT aset,atype FROM wawdlist ORDER BY id";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(awdList);
       item->setText(i++,query.value(n++).toString());    // aset
       item->setText(i++,query.value(n++).toString());    // atype
   }
    // customs
   qy = "SELECT dbfield,refnam FROM refnamen WHERE dbfield LIKE 'custom%'";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(customsList);
       item->setText(i++,query.value(n++).toString());    // db_feld
       item->setText(i++,query.value(n++).toString());    // user_name
   }
    // Rig
   qy = "SELECT * FROM wrig";
   query.exec(qy);
   while(query.next()) {
       n = 0;
       i = 0;
       QTreeWidgetItem *item = new QTreeWidgetItem(rigList);
       item->setText(i++,query.value(n++).toString());     // rigtype
       item->setText(i++,query.value(n++).toString());     // trans
       item->setText(i++,query.value(n++).toString());     // ant
       item->setText(i++,query.value(n++).toString());     // op
       item->setText(i++,query.value(n++).toString());     // spez
   }
   NewPushButton->hide();
   rtreeWidget = bandList;
   customId1 = 0;
   customId2 = 0;
   BandSetLineEdit->setFocus();
   
   LineNameEdit->setEnabled(FALSE);                // sperren 
   AwdSetLineEdit->setEnabled(FALSE);              // sperren
   NameTypeLineEdit->setEnabled(FALSE);            // sperren
   tabWidget->setCurrentIndex(settings.value("Val").toInt());
   if(settings.value("Val").toInt() == 1) {
       QPalette palette7;
       QBrush brush8(QColor(237, 255, 183, 255));  // GELB/grün
       palette7.setBrush(QPalette::Active, QPalette::Base, brush8);
       awdList->setPalette(palette7);
   }
   
   connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentIndexchangedCb(int)));
}