CodeEdit::CodeEdit(QWidget* parent) : QPlainTextEdit(parent) { m_lineNumberWidget = new LineNumberWidget(this,this); connect(ApplicationManager::instance(), SIGNAL(settingsChanged()), this, SLOT(reloadSettings())); connect(this, SIGNAL(blockCountChanged(int)), this, SLOT(updateLineNumberWidgetWidth(int))); connect(this, SIGNAL(updateRequest(const QRect&,int)), this, SLOT(updateLineNumberWidget(const QRect&,int))); updateLineNumberWidgetWidth(0); reloadSettings(); qDebug() << "Initialized CodeEdit instance"; }
gFBDC::gFBDC() { fb=new fbClass; if (!fb->Available()) eFatal("[gFBDC] no framebuffer available"); int xres; int yres; int bpp; fb->getMode(xres, yres, bpp); /* we can only use one of these three modes: */ if (!((xres == 720 && yres == 576) || (xres == 1280 && yres == 720) || (xres == 1920 && yres == 1080))) { /* fallback to a decent default */ xres = 720; yres = 576; } surface.clut.data = 0; setResolution(xres, yres); // default res reloadSettings(); }
void Client::connect() { if(socket) BufferedSocket::putSocket(socket); setAutoReconnect(true); setReconnDelay(120 + Util::rand(0, 60)); reloadSettings(true); setRegistered(false); setMyIdentity(Identity(ClientManager::getInstance()->getMe(), 0)); setHubIdentity(Identity()); try { socket = BufferedSocket::getSocket(separator); socket->addListener(this); socket->connect(address, port, secure, BOOLSETTING(ALLOW_UNTRUSTED_HUBS), true); } catch(const Exception& e) { if(socket) { BufferedSocket::putSocket(socket); socket = 0; } fire(ClientListener::Failed(), this, e.getError()); } updateActivity(); state = STATE_CONNECTING; }
bool SessionHelper::load() { m_settingsItem = new GeneralSettingsItem<Core::SessionHelperSettings>(Settings::General, Icon("view-choose"), QT_TRANSLATE_NOOP("Settings","Chat")); ChatLayer *layer = ChatLayer::instance(); connect(layer,SIGNAL(sessionCreated(qutim_sdk_0_3::ChatSession*)), SLOT(sessionCreated(qutim_sdk_0_3::ChatSession*)) ); m_settingsItem->setOrder(100); Settings::registerItem(m_settingsItem); m_settingsItem->connect(SIGNAL(saved()), this, SLOT(reloadSettings())); reloadSettings(); return true; }
void Client::connect() { if (sock) { BufferedSocket::putSocket(sock); sock = 0; } redirectUrl = Util::emptyString; setAutoReconnect(true); setReconnDelay(120 + Util::rand(0, 60)); reloadSettings(true); setRegistered(false); setMyIdentity(Identity(ClientManager::getInstance()->getMe(), 0)); setHubIdentity(Identity()); setConnectState(STATE_CONNECTING); try { sock = BufferedSocket::getSocket(separator, v4only()); sock->addListener(this); sock->connect(Socket::AddressInfo(address, Socket::AddressInfo::TYPE_URL), port, secure, SETTING(ALLOW_UNTRUSTED_HUBS), true, keyprint /**/); } catch (const Exception& e) { setConnectState(STATE_DISCONNECTED); fire(ClientListener::Failed(), hubUrl, e.getError()); } updateActivity(); }
RemoteDock::RemoteDock(MainWindow* parent) : QDialog(parent), ui(new Ui::RemoteDock), mainWindow(parent), remoteDatabase(parent->getRemote()), remoteModel(new RemoteModel(this, parent->getRemote())) { ui->setupUi(this); // Set up model ui->treeStructure->setModel(remoteModel); // Reload the directory tree when a database upload has finished connect(&remoteDatabase, &RemoteDatabase::uploadFinished, this, &RemoteDock::setNewIdentity); // Whenever a new directory listing has been parsed, check if it was a new root dir and, if so, open the user's directory connect(remoteModel, &RemoteModel::directoryListingParsed, this, &RemoteDock::newDirectoryNode); // When the Preferences link is clicked in the no-certificates-label, open the preferences dialog. For other links than the ones we know, // just open them in a web browser connect(ui->labelNoCert, &QLabel::linkActivated, [this](const QString& link) { if(link == "#preferences") { PreferencesDialog dialog(mainWindow, PreferencesDialog::TabRemote); if(dialog.exec()) mainWindow->reloadSettings(); } else { QDesktopServices::openUrl(QUrl(link)); } }); // Initial setup reloadSettings(); }
void gFBDC::init_gFBDC() { instance=this; fb=new fbClass; if (!fb->Available()) eFatal("no framebuffer available"); fb->SetMode(720, 576, 8); for (int y=0; y<576; y++) // make whole screen transparent memset(fb->lfb+y*fb->Stride(), 0x00, fb->Stride()); pixmap=new gPixmap(); pixmap->x=720; pixmap->y=576; pixmap->bpp=8; pixmap->bypp=1; pixmap->stride=fb->Stride(); pixmap->data=fb->lfb; pixmap->clut.colors=256; pixmap->clut.data=new gRGB[pixmap->clut.colors]; memset(pixmap->clut.data, 0, sizeof(*pixmap->clut.data)*pixmap->clut.colors); reloadSettings(); }
RemoteDatabase::RemoteDatabase() : m_manager(new QNetworkAccessManager), m_configurationManager(new QNetworkConfigurationManager), m_progress(nullptr), m_dbLocal(nullptr) { // Update network configurations connect(m_configurationManager, &QNetworkConfigurationManager::updateCompleted, [this]() { m_manager->setConfiguration(m_configurationManager->defaultConfiguration()); emit networkReady(); }); // Set up SSL configuration m_sslConfiguration = QSslConfiguration::defaultConfiguration(); m_sslConfiguration.setPeerVerifyMode(QSslSocket::VerifyPeer); // Load CA certs from resource file QDir dirCaCerts(":/certs"); QStringList caCertsList = dirCaCerts.entryList(); QList<QSslCertificate> caCerts; for(const QString& caCertName : caCertsList) caCerts += QSslCertificate::fromPath(":/certs/" + caCertName); m_sslConfiguration.setCaCertificates(caCerts); // Load settings and set up some more stuff while doing so reloadSettings(); // Set up signals connect(m_manager, &QNetworkAccessManager::finished, this, &RemoteDatabase::gotReply); connect(m_manager, &QNetworkAccessManager::encrypted, this, &RemoteDatabase::gotEncrypted); connect(m_manager, &QNetworkAccessManager::sslErrors, this, &RemoteDatabase::gotError); }
//------------------------------- void ofxControlPanel::mousePressed(float x, float y, int button){ if( hidden ) return; bool tabButtonPressed = false; if( isInsideRect(x, y, minimizeButton)){ minimize = !minimize; }else if( usingXml && isInsideRect(x, y, saveButton) ){ saveSettings(); saveDown = true; }else if( usingXml && isInsideRect(x, y, restoreButton) ){ reloadSettings(); restoreDown = true; }else if( isInsideRect(x, y, topBar) && bDraggable){ dragging = true; mouseDownPoint.set(x - boundingBox.x, y-boundingBox.y, 0); }else if(!minimize){ for(int i = 0; i < (int) panels.size(); i++){ if( isInsideRect(x, y, panelTabs[i]) ){ selectedPanel = i; tabButtonPressed = true; break; } } } if(minimize == false && tabButtonPressed == false && isInsideRect(x, y, boundingBox) ){ for(int i = 0; i < (int) panels.size(); i++){ if( i == selectedPanel )panels[i]->checkHit( x - hitArea.x, y - hitArea.y, button); } } prevMouse.set(x, y); }
void gFBDC::setMode() { eDebug("FBDC colordepth %d-bit\n", colorDepth); fb->SetMode(720, 576, colorDepth); // make whole screen transparent memset(fb->lfb, 0x00, 576 * fb->Stride()); gPixmap *newpixmap = NULL, *oldpixmap = NULL; newpixmap=new gPixmap(); newpixmap->x = 720; newpixmap->y = 576; newpixmap->bpp = colorDepth; switch (colorDepth) { case 8: newpixmap->bypp = 1; break; case 15: case 16: newpixmap->bypp = 2; break; case 24: case 32: newpixmap->bypp = 4; break; } newpixmap->stride=fb->Stride(); newpixmap->data=fb->lfb; newpixmap->clut.colors=256; newpixmap->clut.data=new gRGB[newpixmap->clut.colors]; memset(newpixmap->clut.data, 0, sizeof(*newpixmap->clut.data)*newpixmap->clut.colors); oldpixmap = pixmap; pixmap = newpixmap; if (oldpixmap) delete oldpixmap; reloadSettings(); }
//------------------------------- bool ofxControlPanel::mousePressed(float x, float y, int button){ if( hidden ) return false; hitSomething = false; bool tabButtonPressed = false; ofRectangle checkRect = boundingBox; if( minimize ){ checkRect.height = topBar.height; } //we do this so people can check if mouse is interacting with panel if( isInsideRect(x, y, checkRect) ){ hitSomething = true; } if( isInsideRect(x, y, minimizeButton)){ minimize = !minimize; }else if( usingXml && isInsideRect(x, y, saveButton) ){ saveSettings(); saveDown = true; printf("saving settings!\n"); }else if( usingXml && isInsideRect(x, y, restoreButton) ){ printf("restoring settings!\n"); reloadSettings(); restoreDown = true; }else if( isInsideRect(x, y, topBar) && bDraggable){ dragging = true; mouseDownPoint.set(x - boundingBox.x, y-boundingBox.y, 0); }else if(!minimize){ int lastSelectedPanel = selectedPanel; for(int i = 0; i < (int) panels.size(); i++){ if( isInsideRect(x, y, panelTabs[i]) ){ selectedPanel = i; if( lastSelectedPanel != selectedPanel ){ bNewPanelSelected = true; }else{ bNewPanelSelected = false; } tabButtonPressed = true; break; } } } if(minimize == false && tabButtonPressed == false && isInsideRect(x, y, boundingBox) ){ for(int i = 0; i < (int) panels.size(); i++){ if( i == selectedPanel ){ elementSelected = panels[i]->checkHit( x - hitArea.x, y - hitArea.y, button); } } } prevMouse.set(x, y); return hitSomething; }
bool BirthdayReminder::load() { reloadSettings(); foreach (Protocol *proto, Protocol::all()) { foreach (Account *account, proto->accounts()) onAccountCreated(account); connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)), SLOT(onAccountCreated(qutim_sdk_0_3::Account*))); }
// prevent m_config_client and m_director_config_client from invoking reloadSettings() multiple times void DirectorCore::multiSyncReloadSettings(void) noexcept { ++m_synchronized_count; if(m_synchronized_count == 2) // ensure fully synchronized to avoid multiple reloads { m_synchronized_count = 0; // reset synch count for next sync reloadSettings(); // actually reload settings } }
gFBDC::gFBDC() { fb=new fbClass; if (!fb->Available()) eFatal("no framebuffer available"); surface.clut.data = 0; setResolution(1280, 720); // default res reloadSettings(); }
void PreferencesDialog::accept() { QFont font = ui.font->currentFont(); font.setPointSize(ui.size->value()); settings.beginGroup("Editor"); settings.setValue("Font", font.toString()); settings.endGroup(); // set font to all TabEditors reloadSettings(); close(); }
Notifyd::Notifyd(QObject* parent) : QObject(parent), mId(0) { m_area = new NotificationArea(); m_settings = new LxQt::Settings("notifications"); reloadSettings(); connect(this, SIGNAL(notificationAdded(uint,QString,QString,QString,QString,int,QStringList,QVariantMap)), m_area->layout(), SLOT(addNotification(uint,QString,QString,QString,QString,int,QStringList,QVariantMap))); connect(this, SIGNAL(notificationClosed(uint, uint)), m_area->layout(), SLOT(removeNotification(uint, uint))); // feedback for original caller connect(m_area->layout(), SIGNAL(notificationClosed(uint,uint)), this, SIGNAL(NotificationClosed(uint,uint))); connect(m_area->layout(), SIGNAL(actionInvoked(uint, QString)), this, SIGNAL(ActionInvoked(uint,QString))); connect(m_settings, SIGNAL(settingsChanged()), this, SLOT(reloadSettings())); }
gFBDC::gFBDC() { instance=this; fb=new fbClass; if (!fb->Available()) eFatal("no framebuffer available"); surface.clut.data = 0; setResolution(720, 576); // default res reloadSettings(); }
void SettingsDialog::on_buttonBox_clicked(QAbstractButton* button) { switch (ui->buttonBox->buttonRole(button)) { case QDialogButtonBox::ApplyRole: applyChanges(); break; case QDialogButtonBox::ResetRole: settings.clear(); reloadSettings(); break; default: break; } }
EditDialog::EditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::EditDialog), currentIndex(QModelIndex()), dataSource(TextBuffer), dataType(Null), isReadOnly(true) { ui->setupUi(this); // Add Ctrl-Enter (Cmd-Enter on OSX) as a shortcut for the Apply button ui->buttonApply->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Return)); ui->buttonApply->setToolTip(ui->buttonApply->toolTip() + " [" + ui->buttonApply->shortcut().toString(QKeySequence::NativeText) + "]"); QHBoxLayout* hexLayout = new QHBoxLayout(ui->editorBinary); hexEdit = new QHexEdit(this); hexLayout->addWidget(hexEdit); hexEdit->setOverwriteMode(false); QHBoxLayout* sciLayout = new QHBoxLayout(ui->editorSci); sciEdit = new DockTextEdit(this); sciLayout->addWidget(sciEdit); QShortcut* ins = new QShortcut(QKeySequence(Qt::Key_Insert), this); connect(ins, SIGNAL(activated()), this, SLOT(toggleOverwriteMode())); connect(ui->editorText, SIGNAL(textChanged()), this, SLOT(updateApplyButton())); connect(hexEdit, SIGNAL(dataChanged()), this, SLOT(updateApplyButton())); connect(sciEdit, SIGNAL(textChanged()), this, SLOT(updateApplyButton())); connect(sciEdit, SIGNAL(textChanged()), this, SLOT(editTextChanged())); // Create shortcuts for the widgets that doesn't have its own print action or printing mechanism. QShortcut* shortcutPrintText = new QShortcut(QKeySequence::Print, ui->editorText, nullptr, nullptr, Qt::WidgetShortcut); connect(shortcutPrintText, &QShortcut::activated, this, &EditDialog::openPrintDialog); // Add actions to editors that have a context menu based on actions. This also activates the shortcuts. ui->editorImage->addAction(ui->actionPrintImage); ui->editorBinary->addAction(ui->actionPrint); ui->editorBinary->addAction(ui->actionCopyHexAscii); mustIndentAndCompact = Settings::getValue("databrowser", "indent_compact").toBool(); ui->buttonIndent->setChecked(mustIndentAndCompact); ui->buttonAutoSwitchMode->setChecked(Settings::getValue("databrowser", "auto_switch_mode").toBool()); reloadSettings(); }
BasketModel::BasketModel(QObject *parent) : QAbstractItemModel(parent) { initRoot(); showPasswords = false; hashPassword = QString(); // иконки recordIcon = QIcon::fromTheme("code-variable"); folderIcon = QIcon::fromTheme("document-open"); folderCloseIcon = QIcon::fromTheme("document-open"); primarySelectMode = false; reloadSettings(); }
void Widget::applySettings() { settings.beginGroup("Service"); settings.setValue("address", ui->serviceAddressEdit->text()); settings.setValue("port", ui->servicePortSpinBox->value()); settings.endGroup(); settings.beginGroup("Capture"); settings.setValue("destdir", ui->destdirEdit->text()); settings.setValue("device_0", ui->device0ComboBox->currentText()); settings.setValue("device_1", ui->device1ComboBox->currentText()); settings.setValue("device_2", ui->device2ComboBox->currentText()); settings.setValue("device_3", ui->device3ComboBox->currentText()); settings.endGroup(); reloadSettings(); }
WindowFacade::WindowFacade(QObject *parent) : QObject(parent) { mainWindow = (MainWindow*)parent; genericWindowFactory = new GenericWindowFactory(parent); compass = new Compass(parent); gameDataContainer = GameDataContainer::Instance(); clientSettings = ClientSettings::getInstance(); settings = HighlightSettings::getInstance(); generalSettings = GeneralSettings::getInstance(); mainLogger = new MainLogger(this); rxRemoveTags.setPattern("<[^>]*>"); writePrompt = true; connect(mainWindow, SIGNAL(profileChanged()), this, SLOT(reloadSettings())); connect(this, SIGNAL(updateWindowSettings()), mainLogger, SLOT(updateSettings())); }
//-------------------------------------------------------------- void testApp::keyPressed(int key){ // if(key <= 49+N_LAYER) { // Top row num key 1 = 49 // editLayer = key-49; // ofLog() << "Set Layer to " << editLayer; // } switch(key) { case '`': setEditMode(!getEditMode()); break; case 'x': resetCurrent(); break; case 'd': debug = !debug; cam->toggleGui(debug); break; case 'z': saveEditted(); break; case 'q': if(debug) editPoly = 0; else editCanvas = 0; break; case 'w': if(debug) editPoly = 1; else editCanvas = 1; break; case 'e': if(debug) editPoly = 2; else editCanvas = 2; break; case 'r': if(debug) editPoly = 3; else editCanvas = 3; break; // case '[': //exportSettings(); break; case ']': reloadSettings(); ofClear(0); break; case 'c': cam->closePoints(editPoly); break; case 'C': cam->resetCircle(); break; case 'f': fullscreen = !fullscreen; ofSetFullscreen(fullscreen); break; case 'v': part->increaseUpper(); break; case 'b': part->decreaseUpper(); break; case 'n': part->increaseLower(); break; case 'm': part->decreaseLower(); break; } }
void Client::connect() { reset_socket(); // [!]IRainman moved to two function: // void Client::on(Failed, const string& aLine) // void Client::disconnect(bool graceLess) clearAvailableBytes(); setAutoReconnect(true); setReconnDelay(120 + Util::rand(0, 60)); const FavoriteHubEntry* fhe = reloadSettings(true); // [!]IRainman fix. resetRegistered(); // [!] resetOp(); // [+] // [-] setMyIdentity(Identity(ClientManager::getInstance()->getMe(), 0)); [-] // [-] setHubIdentity(Identity()); [-] // [~] IRainman fix. state = STATE_CONNECTING; try { #ifdef FLYLINKDC_USE_CS_CLIENT_SOCKET FastLock lock(csSock); // [+] brain-ripper #endif m_client_sock = BufferedSocket::getBufferedSocket(m_separator); m_client_sock->addListener(this); m_client_sock->connect(m_address, m_port, m_secure, BOOLSETTING(ALLOW_UNTRUSTED_HUBS), true); dcdebug("Client::connect() %p\n", (void*)this); } catch (const Exception& e) { state = STATE_DISCONNECTED; fire(ClientListener::Failed(), this, e.getError()); } m_isActivMode = ClientManager::isActive(fhe); // [+] IRainman opt. updateActivity(); }
void Core::init() { // create settings createSettings(); reloadSettings(); // language refreshLanguage(); // kamerzysta kamerzystaSocket = new QTcpSocket(); kamerzystaSocket->setSocketOption(QAbstractSocket::LowDelayOption, 1); kamerzystaSocket->setSocketOption(QAbstractSocket::KeepAliveOption, 0); // network QString strServer = "czat-app.onet.pl"; int iPort = 5015; network = new Network(strServer, iPort); network->start(QThread::InheritPriority); }
SqlExecutionArea::SqlExecutionArea(QWidget* parent, DBBrowserDB* _db) : QWidget(parent), db(_db), ui(new Ui::SqlExecutionArea) { // Create UI ui->setupUi(this); // Create model model = new SqliteTableModel(this, db, Settings::getSettingsValue("db", "prefetchsize").toInt()); ui->tableResult->setModel(model); // Create popup menu for save button menuPopupSave = new QMenu(this); menuPopupSave->addAction(ui->actionExportCsv); menuPopupSave->addAction(ui->actionSaveAsView); ui->buttonSave->setMenu(menuPopupSave); // Load settings reloadSettings(); }
Widget::Widget(QWidget* parent) : QWidget(parent) , ui(new Ui::Widget) , previewsLayout(0) , settings("multicap.ini", QSettings::IniFormat) { ui->setupUi(this); comboBoxes.append(ui->device0ComboBox); comboBoxes.append(ui->device1ComboBox); comboBoxes.append(ui->device2ComboBox); comboBoxes.append(ui->device3ComboBox); QStringList deviceList; deviceList.append(""); for (const QByteArray device: QCamera::availableDevices()) { deviceList.append(device); } devicesModel.setStringList(deviceList); for (int i = 0; i < MaxCamera; i++) { cameras.append(0); comboBoxes[i]->setModel(&devicesModel); } previewsLayout = new QHBoxLayout(ui->previewsGroupBox); ui->previewsGroupBox->setLayout(previewsLayout); for (int i = 0; i < MaxCamera; i++) { QCameraViewfinder* finder = new QCameraViewfinder(ui->previewsGroupBox); finder->setFixedSize(240, 160); previewsLayout->addWidget(finder); } connect(ui->applyButton, SIGNAL(clicked()), SLOT(applySettings())); connect(ui->closeButton, SIGNAL(clicked()), SLOT(close())); reloadSettings(); }
void Client::connect() { if(sock) BufferedSocket::putSocket(sock); setAutoReconnect(true); setReconnDelay(SETTING(RECONNECT_DELAY)); reloadSettings(true); setRegistered(false); setMyIdentity(Identity(ClientManager::getInstance()->getMe(), 0)); setHubIdentity(Identity()); state = STATE_CONNECTING; try { sock = BufferedSocket::getSocket(separator); sock->addListener(this); sock->connect(address, port, secure, BOOLSETTING(ALLOW_UNTRUSTED_HUBS), true); } catch(const Exception& e) { shutdown(); /// @todo at this point, this hub instance is completely useless fire(ClientListener::Failed(), this, e.getError()); } updateActivity(); }
void YabauseThread::initEmulation() { reloadSettings(); mInit = YabauseInit( &mYabauseConf ); SetOSDToggle(showFPS); }
{ reloadSettings(); foreach (Protocol *proto, Protocol::all()) { foreach (Account *account, proto->accounts()) onAccountCreated(account); connect(proto, SIGNAL(accountCreated(qutim_sdk_0_3::Account*)), SLOT(onAccountCreated(qutim_sdk_0_3::Account*))); } connect(&m_notificationTimer, SIGNAL(timeout()), SLOT(onNotificationTimeout())); m_notificationTimer.start(); m_settings = new GeneralSettingsItem<BirthdayReminderSettings>( Settings::Plugin, Icon(QLatin1String("view-calendar-birthday")), QT_TRANSLATE_NOOP("Settings", "Birthday reminder")); m_settings->connect(SIGNAL(saved()), this, SLOT(reloadSettings())); Settings::registerItem(m_settings); return true; } bool BirthdayReminder::unload() { m_notificationTimer.stop(); foreach (Protocol *proto, Protocol::all()) disconnect(proto, 0, this, 0); QHashIterator<Account*, BirthdayUpdater*> itr(m_accounts); while (itr.hasNext()) { itr.next(); itr.value()->deleteLater();