Example #1
0
void WebBridgeRS::writeString(QString fname, QString data){

	std::cerr << "writing file" << std::endl;
    QString fpath = getDownloadDirectory();

    fpath.append("/");
    fpath.append(fname);
    std::cerr << fpath.toStdString() << std::endl;
    QFile outfile(fpath);

	if (outfile.open(QFile::WriteOnly | QFile::Truncate)) {
	    QTextStream out(&outfile);
	    out << data;
		std::cerr << "Writing Worked" << std::endl;
	} else {
		std::cerr << "WRITING FAILED" << std::endl;
	}

}
Example #2
0
void WebBridgeRS::onUrlDownloaded(){
    FileDownloader * fileDownloader = qobject_cast<FileDownloader *>(QObject::sender());

    //QDir::absoluteFilePath()
    QString fpath = getDownloadDirectory();

    fpath.append("/");
    QString urlstring(fileDownloader->url().toString());
    fpath.append(QFileInfo(urlstring).fileName());
    std::cout << fpath.toStdString() << std::endl;
    QFile file(fpath);
    file.open(QIODevice::WriteOnly);

    file.write(fileDownloader->downloadedData());

    // optional, as QFile destructor will already do it:
    file.close();

    std::cout << fileDownloader->downloadedData().data() << std::endl;
    emit urlDownloaded(fpath, urlstring);

}
Example #3
0
ConfigDialog::ConfigDialog( QWidget *parent )
            : Ui_ConfigDialog()
{
    (void)parent;

    setupUi( this );
    
    pageListWidget->item( 4 )->setHidden( true );
   
    connect( cfg_unityEnabled, SIGNAL( toggled( bool ) ), 
             this, SLOT( toggleUnity(bool)) );
    connect( cfg_externalEditorEnabled, SIGNAL( toggled( bool ) ), 
             this, SLOT( toggleUnityEditor( bool ) ) );
    connect( cfg_useIdleTimeout, SIGNAL( toggled( bool ) ),
             this, SLOT( toggleUnityTimeout( bool ) ) );
    connect( filemanagerButton, SIGNAL( pressed() ),
             this, SLOT( getFilemanagerCommand() ) );
             
    connect( editorCommandButton, SIGNAL( pressed() ), 
             this, SLOT( getExternalEditorFile() ) );
    connect( editorSaveLocationButton, SIGNAL( pressed() ), 
             this, SLOT( getEditorSaveLocation() ) );
    connect( downloadDirectoryButton, SIGNAL( pressed() ),
             this, SLOT( getDownloadDirectory() ) );
    connect( buttonBox, SIGNAL( accepted() ), 
             this, SLOT( writeSettings() ) );
    connect( buttonBox, SIGNAL( rejected() ), 
             this, SLOT( close() ) );
    connect( engineerAddButton, SIGNAL( pressed() ), 
             this, SLOT( addEngineer() ) );
    connect( engineerRemoveButton, SIGNAL( pressed() ), 
             this, SLOT( removeEngineer() ) );
    connect( engineerMoveUpButton, SIGNAL( pressed() ),
             this, SLOT( moveEngineerUp() ) );
    connect( engineerMoveDownButton, SIGNAL( pressed() ),
             this, SLOT( moveEngineerDown() ) );
    connect( queueAddButton, SIGNAL( pressed() ), 
             this, SLOT( addQueue() ) );
    connect( queueRemoveButton, SIGNAL( pressed() ), 
             this, SLOT( removeQueue() ) );
    connect( queueMoveUpButton, SIGNAL( pressed() ),
             this, SLOT( moveQueueUp() ) );
    connect( queueMoveDownButton, SIGNAL( pressed() ), 
             this, SLOT( moveQueueDown() ) );
    connect( generalNotificationSoundButton, SIGNAL( pressed() ),
             this, SLOT( getGeneralNotificationSoundFile() ) );
    connect( generalNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playGeneralNotificationSound() ) );
    connect( newPersonalNotificationSoundButton, SIGNAL( pressed() ),
             this, SLOT( getNewPersonalNotificationSoundFile() ) );
    connect( newPersonalNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playNewPersonalNotificationSound() ) );
    connect( updatePersonalNotificationSoundButton, SIGNAL( pressed() ), 
             this, SLOT( getUpdatePersonalNotificationSoundFile() ) );
    connect( updatePersonalNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playUpdatePersonalNotificationSound() ) );
    connect( bomgarNotificationSoundButton, SIGNAL( pressed() ), 
             this, SLOT( getBomgarNotificationSoundFile() ) );
    connect( bomgarNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playBomgarNotificationSound() ) );
    connect( lowNotificationSoundButton, SIGNAL( pressed() ), 
             this, SLOT( getLowNotificationSoundFile() ) );
    connect( lowNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playLowNotificationSound() ) );
    connect( mediumNotificationSoundButton, SIGNAL( pressed() ),
             this, SLOT( getMediumNotificationSoundFile() ) );
    connect( mediumNotificationPlayButton, SIGNAL( pressed() ), 
             this, SLOT( playMediumNotificationSound() ) );
    connect( urgentNotificationSoundButton, SIGNAL( pressed() ),
             this, SLOT( getUrgentNotificationSoundFile() ) );
    connect( urgentNotificationPlayButton, SIGNAL( pressed() ),
             this, SLOT( playUrgentNotificationSound() ) );
    connect( highNotificationSoundButton, SIGNAL( pressed() ),
             this, SLOT( getHighNotificationSoundFile() ) );
    connect( highNotificationPlayButton, SIGNAL( pressed() ),
             this, SLOT( playHighNotificationSound() ) );
    connect( cfg_showSystemTray, SIGNAL( toggled( bool ) ), 
             this, SLOT( toggleSystemTray( bool ) ) );
    connect( cfg_monitorEnabled, SIGNAL( toggled( bool ) ),
             this, SLOT( toggleMonitor( bool ) ) );
    connect( cfg_qbossFeatures, SIGNAL( toggled( bool ) ),
             this, SLOT( toggleQboss( bool ) ) );
    connect( cfg_notificationsDisabled, SIGNAL( toggled( bool ) ), 
             this, SLOT( toggleNotifications( bool ) ) );
    
    connect( cfg_generalNotificationSound, SIGNAL( toggled( bool ) ), 
             cfg_generalNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_generalNotificationSound, SIGNAL( toggled( bool ) ), 
             generalNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_generalNotificationSound, SIGNAL( toggled( bool ) ),
             generalNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_newPersonalNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_newPersonalNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_newPersonalNotificationSound, SIGNAL( toggled( bool ) ),
             newPersonalNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_newPersonalNotificationSound, SIGNAL( toggled( bool ) ),
             newPersonalNotificationPlayButton, SLOT( setEnabled( bool ) ) );

    connect( cfg_updatePersonalNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_updatePersonalNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_updatePersonalNotificationSound, SIGNAL( toggled( bool ) ),
             updatePersonalNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_updatePersonalNotificationSound, SIGNAL( toggled( bool ) ), 
             updatePersonalNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_bomgarNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_bomgarNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_bomgarNotificationSound, SIGNAL( toggled( bool ) ),
             bomgarNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_bomgarNotificationSound, SIGNAL( toggled( bool ) ), 
             bomgarNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_lowNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_lowNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_lowNotificationSound, SIGNAL( toggled( bool ) ),
             lowNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_lowNotificationSound, SIGNAL( toggled( bool ) ), 
             lowNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_mediumNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_mediumNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_mediumNotificationSound, SIGNAL( toggled( bool ) ),
             mediumNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_mediumNotificationSound, SIGNAL( toggled( bool ) ),
             mediumNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_urgentNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_urgentNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_urgentNotificationSound, SIGNAL( toggled( bool ) ),
             urgentNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_urgentNotificationSound, SIGNAL( toggled( bool ) ),
             urgentNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    connect( cfg_highNotificationSound, SIGNAL( toggled( bool ) ),
             cfg_highNotificationSoundFile, SLOT( setEnabled( bool ) ) );
    connect( cfg_highNotificationSound, SIGNAL( toggled( bool ) ),
             highNotificationSoundButton, SLOT( setEnabled( bool ) ) );
    connect( cfg_highNotificationSound, SIGNAL( toggled( bool ) ), 
             highNotificationPlayButton, SLOT( setEnabled( bool ) ) );
    
    cfg_dBServer->setText( Settings::dBServer() );
    cfg_engineer->setText( Settings::engineer() );
    
    cfg_showAppWindow->setChecked( Settings::showAppWindow() );
    cfg_showTabsAtTop->setChecked( Settings::showTabsAtTop() );
    cfg_showSystemTray->setChecked( Settings::showSystemTray() );
    cfg_animateQueue->setChecked( Settings::animateQueue() );
    cfg_animateQmon->setChecked( Settings::animateQmon() );
    cfg_leftMouseButton->setCurrentIndex( Settings::leftMouseButton() );
    cfg_middleMouseButton->setCurrentIndex( Settings::middleMouseButton() );
    cfg_rightMouseButton->setCurrentIndex( Settings::rightMouseButton() );
    
    cfg_monitorEnabled->setChecked( Settings::monitorEnabled() );
    cfg_queuesToMonitor->addItems( Settings::queuesToMonitor() );
    cfg_showEmptyQueues->setChecked( Settings::showEmptyQueues() );
    cfg_monitorPersonalBomgar->setChecked( Settings::monitorPersonalBomgar() );
    cfg_bomgarName->setText( Settings::bomgarName() );
    
    cfg_qbossFeatures->setChecked( Settings::qbossFeatures() );
    cfg_engineerList->addItems( Settings::engineerList() );
    
    cfg_statsEnabled->setChecked( Settings::statsEnabled() );
    
    cfg_unityEnabled->setChecked( Settings::unityEnabled() );
    cfg_otherFileManagerCommand->setText( Settings::otherFileManagerCommand() );
    cfg_showDownloadManager->setChecked( Settings::showDownloadManager() );
    
    cfg_unityPassword->setText( Settings::unityPassword() );
    cfg_useIdleTimeout->setChecked( Settings::useIdleTimeout() );
    cfg_idleTimeoutMinutes->setValue( Settings::idleTimeoutMinutes() );
    cfg_minimumFontSize->setValue( Settings::minimumFontSize() );
    cfg_defaultFontSize->setValue( Settings::defaultFontSize() );
    cfg_externalEditorEnabled->setChecked( Settings::externalEditorEnabled() );
    cfg_editorCommand->setText( Settings::editorCommand() );
    cfg_editorSaveLocation->setText( Settings::editorSaveLocation() );
    cfg_replyFormat->setChecked( Settings::replyFormatEnabled() );
    cfg_replyLinebreak->setValue( Settings::replyFormatLineBreak() );
    cfg_downloadDirectory->setText( Settings::downloadDirectory() );
    cfg_useSrDirectory->setChecked( Settings::useSrDirectory() );
    cfg_autoExtract->setChecked( Settings::autoExtract() );
    cfg_splitSupportconfig->setChecked( Settings::splitSC() );
    cfg_autoNSA->setChecked( Settings::autoNSA() );
    cfg_cleanupDownloadDirectory->setChecked( Settings::cleanupDownloadDirectory() );
        
    cfg_notificationsDisabled->setChecked( Settings::notificationsDisabled() );

    cfg_generalNotificationPopup->setChecked( Settings::generalNotificationPopup() );
    cfg_generalNotificationSound->setChecked( Settings::generalNotificationSound() );
    cfg_generalNotificationSoundFile->setText( Settings::generalNotificationSoundFile() );
    
    cfg_newPersonalNotificationPopup->setChecked( Settings::newPersonalNotificationPopup() );
    cfg_newPersonalNotificationSound->setChecked( Settings::newPersonalNotificationSound() );
    cfg_newPersonalNotificationSoundFile->setText( Settings::newPersonalNotificationSoundFile() );
    
    cfg_updatePersonalNotificationPopup->setChecked( Settings::updatePersonalNotificationPopup() );
    cfg_updatePersonalNotificationSound->setChecked( Settings::updatePersonalNotificationSound() );
    cfg_updatePersonalNotificationSoundFile->setText( Settings::updatePersonalNotificationSoundFile() );
    
    cfg_bomgarNotificationPopup->setChecked( Settings::bomgarNotificationPopup() );
    cfg_bomgarNotificationSound->setChecked( Settings::bomgarNotificationSound() );
    cfg_bomgarNotificationSoundFile->setText( Settings::bomgarNotificationSoundFile() );
    
    cfg_lowNotificationPopup->setChecked( Settings::lowNotificationPopup() );
    cfg_lowNotificationSound->setChecked( Settings::lowNotificationSound() );
    cfg_lowNotificationSoundFile->setText( Settings::lowNotificationSoundFile() );
    
    cfg_mediumNotificationPopup->setChecked( Settings::mediumNotificationPopup() );
    cfg_mediumNotificationSound->setChecked( Settings::mediumNotificationSound() );
    cfg_mediumNotificationSoundFile->setText( Settings::mediumNotificationSoundFile() );
    
    cfg_urgentNotificationPopup->setChecked( Settings::urgentNotificationPopup() );
    cfg_urgentNotificationSound->setChecked( Settings::urgentNotificationSound() );
    cfg_urgentNotificationSoundFile->setText( Settings::urgentNotificationSoundFile() );
    
    cfg_highNotificationPopup->setChecked( Settings::highNotificationPopup() );
    cfg_highNotificationSound->setChecked( Settings::highNotificationSound() );
    cfg_highNotificationSoundFile->setText( Settings::highNotificationSoundFile() );
    
    cfg_generalNotificationSoundFile->setEnabled( Settings::generalNotificationSound() );
    generalNotificationSoundButton->setEnabled( Settings::generalNotificationSound() );
    generalNotificationPlayButton->setEnabled( Settings::generalNotificationSound() );
    
    cfg_newPersonalNotificationSoundFile->setEnabled( Settings::newPersonalNotificationSound() );
    newPersonalNotificationSoundButton->setEnabled( Settings::newPersonalNotificationSound() );
    newPersonalNotificationPlayButton->setEnabled( Settings::newPersonalNotificationSound() );
    
    cfg_updatePersonalNotificationSoundFile->setEnabled( Settings::updatePersonalNotificationSound() );
    updatePersonalNotificationSoundButton->setEnabled( Settings::updatePersonalNotificationSound() );
    updatePersonalNotificationPlayButton->setEnabled( Settings::updatePersonalNotificationSound() );
    
    cfg_bomgarNotificationSoundFile->setEnabled( Settings::bomgarNotificationSound() );
    bomgarNotificationSoundButton->setEnabled( Settings::bomgarNotificationSound() );
    bomgarNotificationPlayButton->setEnabled( Settings::bomgarNotificationSound() );
    
    cfg_lowNotificationSoundFile->setEnabled( Settings::lowNotificationSound() );
    lowNotificationSoundButton->setEnabled( Settings::lowNotificationSound() );
    lowNotificationPlayButton->setEnabled( Settings::lowNotificationSound() );
    
    cfg_mediumNotificationSoundFile->setEnabled( Settings::mediumNotificationSound() );
    mediumNotificationSoundButton->setEnabled( Settings::mediumNotificationSound() );
    mediumNotificationPlayButton->setEnabled( Settings::mediumNotificationSound() );
    
//     cfg_urgentNotificationSoundFile->setEnabled( Settings::urgentNotificationSound() );
    urgentNotificationSoundButton->setEnabled( Settings::urgentNotificationSound() );
    urgentNotificationPlayButton->setEnabled( Settings::urgentNotificationSound() );
    
    cfg_highNotificationSoundFile->setEnabled( Settings::highNotificationSound() );
    highNotificationSoundButton->setEnabled( Settings::highNotificationSound() );
    highNotificationPlayButton->setEnabled( Settings::highNotificationSound() );
    
    toggleSystemTray( Settings::showSystemTray() );
    toggleMonitor( Settings::monitorEnabled() );
    toggleQboss( Settings::qbossFeatures() );
    toggleNotifications( Settings::notificationsDisabled() );
    toggleUnity( Settings::unityEnabled() );
        
    #ifndef USE_PHONON
        
        cfg_highNotificationSound->setVisible( false );
        cfg_highNotificationSoundFile->setVisible( false );
        highNotificationSoundButton->setVisible( false );
        highNotificationPlayButton->setVisible( false );
        
        cfg_urgentNotificationSound->setVisible( false );
        cfg_urgentNotificationSoundFile->setVisible( false );
        urgentNotificationSoundButton->setVisible( false );
        urgentNotificationPlayButton->setVisible( false );
        
        cfg_mediumNotificationSound->setVisible( false );
        cfg_mediumNotificationSoundFile->setVisible( false );
        mediumNotificationSoundButton->setVisible( false );
        mediumNotificationPlayButton->setVisible( false );
        
        cfg_lowNotificationSound->setVisible( false );
        cfg_lowNotificationSoundFile->setVisible( false );
        lowNotificationSoundButton->setVisible( false );
        lowNotificationPlayButton->setVisible( false );
        
        cfg_bomgarNotificationSound->setVisible( false );
        cfg_bomgarNotificationSoundFile->setVisible( false );
        bomgarNotificationSoundButton->setVisible( false );
        bomgarNotificationPlayButton->setVisible( false );
        
        cfg_updatePersonalNotificationSound->setVisible( false );
        cfg_updatePersonalNotificationSoundFile->setVisible( false );
        updatePersonalNotificationSoundButton->setVisible( false );
        updatePersonalNotificationPlayButton->setVisible( false );
        
        cfg_newPersonalNotificationSound->setVisible( false );
        cfg_newPersonalNotificationSoundFile->setVisible( false );
        newPersonalNotificationSoundButton->setVisible( false );
        newPersonalNotificationPlayButton->setVisible( false );
        
        cfg_generalNotificationSound->setVisible( false );
        cfg_generalNotificationSoundFile->setVisible( false );
        generalNotificationSoundButton->setVisible( false );
        generalNotificationPlayButton->setVisible( false );
        
    #endif
    
    getQueueList();
}