Esempio n. 1
0
CodeEditor::CodeEditor(const QString &filePath, bool readOnly, QWidget *parent)
	: QWidget(parent), readOnly(readOnly) 
{
	setFilePath(filePath);
	setUi();
	setConnect();
} // CodeEditor
Esempio n. 2
0
// public
CodeEditor::CodeEditor(bool readOnly, QWidget *parent)
	: QWidget(parent), readOnly(readOnly)
{
    fileName = QString("noname.txt"); // 应避免重名
	setUi();
	setConnect();
} // CodeEditor
FlumeSettings::FlumeSettings(QWidget *parent, QString name) :
    QWidget(parent),
    ui(new Ui::FlumeSettings)
{
    ui->setupUi(this);

    ui->tabWidget->setCurrentIndex(0);
    serverName = name;
    setUi(name);

    connect(ui->pushButton_3, &QPushButton::clicked, this, &FlumeSettings::emitRemove);
    connect(ui->pushButton_4, &QPushButton::clicked, this, &FlumeSettings::reset);
    connect(ui->verifyButton, &QPushButton::clicked, this, &FlumeSettings::verifyServer);
    connect(ui->summonMethodBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(setSummonPort(QString)));

    connect(ui->allowFileNameBrowse, &QPushButton::clicked, this, &FlumeSettings::setAllowFileName);
    connect(ui->flexlmLicenseDirectoryBrowse, &QPushButton::clicked, this, &FlumeSettings::setFlexlmLicenseDirectory);
    connect(ui->logDirectoryBrowse, &QPushButton::clicked, this, &FlumeSettings::setLogDirectory);
    connect(ui->portsFileNameBrowse, &QPushButton::clicked, this, &FlumeSettings::setPortsFileName);
    connect(ui->sshFileNameBrowse, &QPushButton::clicked, this, &FlumeSettings::setSshFileName);
    connect(ui->runDirectoryBrowse, &QPushButton::clicked, this, &FlumeSettings::setRunDirectory);
    connect(ui->tempDirectoryBrowse, &QPushButton::clicked, this, &FlumeSettings::setTempDirectory);

    setWindowTitle("Edit Target List");
}
Esempio n. 4
0
void pluginInit( QObject *parent )
{
	auto teamSpeakPlugin = Driver::TeamSpeakPlugin::singleton();

	Log::setSink( teamSpeakPlugin );
	// for debugging purposes
	// Log::setSink( new Log::FileLogger( "C:/temp/tessumod_plugin.log" ) );
	Log::logQtMessages();

	QString dataPath = teamSpeakPlugin->getPluginDataPath();
	QString dataPathNative = QDir::toNativeSeparators( dataPath );
	dllSearchCookie = AddDllDirectory( (wchar_t*)dataPathNative.utf16() );

	auto iniSettingsFile = new Driver::IniSettingsFile( parent );
	auto openALBackend = new Driver::OpenALBackend( dataPath, parent );
	auto openALBackendTest = new Driver::OpenALBackend( dataPath, parent );
	auto openALConfFile = new Driver::OpenALConfFile( dataPath, parent );
	auto wotConnector = new Driver::WotConnector( parent );

	auto userStorage = new Storage::UserStorage( parent );
	auto cameraStorage = new Storage::CameraStorage( parent );
	auto adapterStorage = new Storage::AdapterStorage( parent );
	auto settingsStorage = new Storage::SettingsStorage( iniSettingsFile, parent );

	auto useCaseFactory = new UseCase::UseCaseFactory( parent );
	useCaseFactory->userStorage = userStorage;
	useCaseFactory->cameraStorage = cameraStorage;
	useCaseFactory->settingsStorage = settingsStorage;
	useCaseFactory->adapterStorage = adapterStorage;

	adapterStorage->setAudio( Entity::BuiltInBackend, new Adapter::AudioAdapter( teamSpeakPlugin->createAudioBackend(), dataPath, parent ) );
	adapterStorage->setAudio( Entity::OpenALBackend, new Adapter::AudioAdapter( openALBackend, dataPath, parent ) );
	adapterStorage->setTestAudio( Entity::BuiltInBackend, new Adapter::AudioAdapter( teamSpeakPlugin->createAudioBackend(), dataPath, parent ) );
	adapterStorage->setTestAudio( Entity::OpenALBackend, new Adapter::AudioAdapter( openALBackendTest, dataPath, parent ) );
	adapterStorage->setVoiceChat( new Adapter::VoiceChatAdapter( teamSpeakPlugin, useCaseFactory, parent ) );
	adapterStorage->setGameData( new Adapter::GameDataAdapter( wotConnector, useCaseFactory, parent ) );
	adapterStorage->setUi( new Adapter::UiAdapter( useCaseFactory, openALConfFile, parent ) );

	teamSpeakPlugin->setAudioSink( openALBackend );

	QTimer *setupTimer = new QTimer( parent );
	setupTimer->setSingleShot( true );
	setupTimer->setInterval( 0 );
	setupTimer->start();

	QObject::connect( setupTimer, &QTimer::timeout, [=] {
		teamSpeakPlugin->initialize();
		wotConnector->initialize();
		useCaseFactory->applicationInitialize();
		openALConfFile->start();
	} );
}
Esempio n. 5
0
RbtnSetting::RbtnSetting(QString macroName, bool defaultValue,
          std::function<Validity(bool, QString &)> validator,
          QRadioButton * rbtn,
          WarningBtn * btnWarn)
    : BoolSetting(macroName, defaultValue, validator, btnWarn),
      radioButton(rbtn)
{
    if(!rbtn)
    {
        throw new std::invalid_argument("rbtn cannot be null");
    }

    setUi();
    connect(rbtn, SIGNAL(toggled(bool)),
                     this, SLOT(radioButton_toggled(bool)));
}
Esempio n. 6
0
CbSetting::CbSetting(QString macroName, bool defaultValue,
          std::function<Validity(bool, QString &)> validator,
          QCheckBox * cb,
          WarningBtn * btnWarn)
    : BoolSetting(macroName, defaultValue, validator, btnWarn),
      checkBox(cb)
{
    if(!cb)
    {
        throw new std::invalid_argument("cb cannot be null");
    }

    setUi();
    connect(cb, SIGNAL(stateChanged(int)),
            this, SLOT(checkBox_stateChanged(int)));
}
PathSepSetting::PathSepSetting(QString macroName, QString defaultValue,
                               std::function<Validity(QString, QString &)> validator,
                               QComboBox *cmb,
                               QLineEdit *le,
                               WarningBtn *btnWarn)
    : StrSetting(macroName, defaultValue, validator, btnWarn),
      comboBox(cmb),
      lineEdit(le)
{
    if(!cmb || !le)
    {
        throw new std::invalid_argument("cmb and le cannot be null");
    }

    setUi();
    connect(cmb, SIGNAL(currentIndexChanged(int)),
                     this, SLOT(comboBox_currentIndexChanged(int)));
    connect(le, SIGNAL(textChanged(QString)),
                     this, SLOT(lineEdit_textChanged(QString)));
}
Esempio n. 8
0
connectDialog::connectDialog(QWidget *parent) : QWidget(parent)
{  
    readCfg();
    setUi();
    connect(cancelBtn,SIGNAL(clicked(bool)),this,SLOT(close()));
}
ErrorDialog::ErrorDialog(Ui *parent)
{
    setUi(parent);
    errDlgPtr = this;
    font = NULL;
}