/* * * Function: CommandServer * Description: 系统构造函数 * Return: * Other: * */ CommandServer::CommandServer( void ) { char aczLogIni[128]; int iFd; apr_initialize(); apr_pool_create( &m_pstRoot, NULL ); m_pstSystem = NULL; m_pstProcess = NULL; setupSignals(); #ifndef __hpux if((iFd = open("/dev/tty",O_RDWR)) >= 0) { ioctl( iFd, TIOCNOTTY, NULL ); close( iFd ); } #endif sprintf( aczLogIni, "%s/etc/%s", getenv("ADC_ROOT"), "cmdsvrlog.ini" ); LOG4C_INIT( aczLogIni ); LOG4C_OPEN(); }
void ActionLogView::init() { this->horizontalHeader()->setStretchLastSection( true ); // Растягивание последней секции до размеров виджета this->setSelectionBehavior(QAbstractItemView::SelectRows); // Выделяется вся строка this->horizontalHeader()->setHighlightSections(false); // Заголовки не должны выглядеть нажатыми this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Отключается горизонтальная прокрутка // Установка ширины и высоты окна int dialogWidth=int( 0.8 * (float)(find_object<MainWindow>("mainwindow")->width()) ); int dialogHeight=int( 0.8 * (float)(find_object<MainWindow>("mainwindow")->height()) ); setMinimumWidth( dialogWidth ); setMinimumHeight( dialogHeight ); resize( size() ); // Установка ширины столбцов // this->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Interactive); // Interactive, ResizeToContents this->resizeColumnToContents(0); // Настройка области виджета для кинетической прокрутки setKineticScrollArea( qobject_cast<QAbstractItemView*>(this) ); assemblyContextMenu(); setContextMenuPolicy(Qt::CustomContextMenu); setupSignals(); }
int Tool::execute( cfg::cmd::CommandLine &cmd ) { if (cmd.isSet("set")) { set(); } if (cmd.isSet("debug")) { debug(); } if (cmd.isSet("help")) { printf("%s allowed options\n%s\n", name().c_str(), cmd.desc().c_str()); } else if (cmd.isSet("version")) { printVersion(); } else if (cmd.isSet("build")) { printBuild(); } else if (cmd.isSet("pretend")) { pretend(); } else if (cmd.isSet("defaults")) { defaults(); } else { setupSignals(); // Initialize log system util::log::init(); int result = run( cmd ); // Finalize log system util::log::fin(); return result; } return 0; }
CustomWidgetEditor::CustomWidgetEditor( QWidget *parent, MainWindow *mw ) : CustomWidgetEditorBase( parent, 0, TRUE ), mainWindow( mw ) { connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) ); checkTimer = new QTimer( this ); connect( checkTimer, SIGNAL( timeout() ), this, SLOT( checkWidgetName() ) ); editClass->setEnabled( FALSE ); editHeader->setEnabled( FALSE ); buttonChooseHeader->setEnabled( FALSE ); buttonChoosePixmap->setEnabled( FALSE ); spinWidth->setEnabled( FALSE ); spinHeight->setEnabled( FALSE ); sizeHor->setEnabled( FALSE ); sizeVer->setEnabled( FALSE ); checkContainer->setEnabled( FALSE ); localGlobalCombo->setEnabled( FALSE ); editClass->setValidator( new AsciiValidator( QString(":"), editClass ) ); editSignal->setValidator( new AsciiValidator( TRUE, editSignal ) ); editSlot->setValidator( new AsciiValidator( TRUE, editSignal ) ); editProperty->setValidator( new AsciiValidator( editSignal ) ); editSignal->setEnabled( FALSE ); buttonRemoveSignal->setEnabled( FALSE ); setupDefinition(); setupSignals(); setupSlots(); setupProperties(); }
bool MyProcess::runSync(SCRef rc, QByteArray* ro, QObject* rcv, SCRef buf) { async = false; runCmd = rc; runOutput = ro; receiver = rcv; if (runOutput) runOutput->clear(); setupSignals(); if (!launchMe(runCmd, buf)) return false; QTime t; t.start(); busy = true; // we have to wait here until we exit while (busy) { waitForFinished(20); // suspend 20ms to let OS reschedule if (t.elapsed() > 200) { EM_PROCESS_EVENTS; t.restart(); } } return !isErrorExit; }
void CustomWidgetEditor::loadDescription() { QString fn = KFileDialog::getOpenFileName( QString::null, i18n( "*.cw|Custom-Widget Description\n*|All Files" ), this ); if ( fn.isEmpty() ) return; QFile f( fn ); if ( !f.open( IO_ReadOnly ) ) return; QDomDocument doc; QString errMsg; int errLine; if ( !doc.setContent( &f, &errMsg, &errLine ) ) { qDebug( QString("Parse error: ") + errMsg + QString(" in line %d"), errLine ); return; } QDomElement firstWidget = doc.firstChild().toElement().firstChild().toElement(); while ( firstWidget.tagName() != "customwidgets" ) firstWidget = firstWidget.nextSibling().toElement(); Resource::loadCustomWidgets( firstWidget, 0 ); boxWidgets->clear(); setupDefinition(); setupSignals(); setupSlots(); setupProperties(); }
FileExistsHandleDialog::FileExistsHandleDialog(QWidget *parent) : QDialog(parent), ui(new Ui::FileExistsHandleDialog) { ui->setupUi(this); setupSignals(); }
void init() { serverID.init(); setupSIGTRAPforGDB(); setupCoreSignals(); setupSignals( false ); Logstream::get().addGlobalTee( new RamLog("global") ); }
LEDSendDialog::LEDSendDialog(ChildWindowBase *parent): ChildWindowBase(parent), ui(new Ui::LEDSendDialog) { ui->setupUi(this); setupWidget(); setupSignals(); }
SevenSeg::SevenSeg(Device::pin_t const segmentPins[], bool hasDecimalPoint, connector_t connector) : _hasDecimalPoint(hasDecimalPoint) { setupPins(segmentPins); setupSignals(connector); clear(); }
EditorMultiLineInputDialog::EditorMultiLineInputDialog(QWidget *parent) : QDialog(parent) { sizeCoefficient=1.0; setupUi(); setupSignals(); assembly(); }
ConfigureDialog::ConfigureDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ConfigureDialog) { ui->setupUi(this); setFixedSize(1112,796); setupSignals(); }
EditorTablePropertiesForm::EditorTablePropertiesForm() { directSetAlign=false; setupUi(); setupSignals(); assembly(); }
TreeScreen::TreeScreen(QWidget *parent) : QWidget(parent) { setupActions(); setupUI(); setupModels(); setupSignals(); assembly(); }
ClientNetworkStatusDialog::ClientNetworkStatusDialog(boost::shared_ptr<SingleClient>client, QWidget *parent): QDialog(parent), ui(new Ui::ClientNetworkStatusDialog), m_Client(client) { ui->setupUi(this); setupWidgets(); setupSignals(); }
RealtimeArrangeDialog::RealtimeArrangeDialog(QWidget* parent /* = NULL */): QDialog(parent) { setupUi(this); setupWidget(); setupSignals(); setDevicesNames(); setInputPinNames(); }
FindTableWidget::FindTableWidget(QWidget *parent) : QWidget(parent) { setupUI(); setupModels(); setupSignals(); assembly(); clearAll(); }
FileTransferLogDialog::FileTransferLogDialog(ChildWindowBase *parent) : ChildWindowBase(parent), ui(new Ui::FileTransferLogDialog) { qDebug()<<"begin FileTransferLogDialog"; ui->setupUi(this); setupWidgets(); setupSignals(); }
bool MyProcess::runAsync(SCRef rc, QObject* rcv, SCRef buf) { async = true; runCmd = rc; receiver = rcv; setupSignals(); if (!launchMe(runCmd, buf)) return false; // caller will delete us return true; }
NetworkStatusStatement::NetworkStatusStatement(ChildWindowBase *parent) : ChildWindowBase(parent), ui(new Ui::NetworkStatusStatement) { ui->setupUi(this); // setupModel(); setupWidgets(); setupSignals(); setWindowTitle(tr("客户端网络报表")); }
CameraGroupView::CameraGroupView(boost::shared_ptr<ClientGroup>group, QWidget *parent): QWidget(parent), ui(new Ui::CameraGroupView), m_ClientGroup(group), m_LastWidget(NULL) { ui->setupUi(this); setupPages(); setupSignals(); }
KClipboardSynchronizer::KClipboardSynchronizer(QObject *parent, const char *name) : QObject(parent, name) { s_self = this; KConfigGroup config(KGlobal::config(), "General"); s_sync = config.readBoolEntry("SynchronizeClipboardAndSelection", s_sync); s_reverse_sync = config.readBoolEntry("ClipboardSetSelection", s_reverse_sync); setupSignals(); }
EnterPassword::EnterPassword(int imode, QWidget *parent) : QDialog(parent) { mode=imode; password=""; previousPassword=""; cancelDelay=0; isPasswordTyped=false; setupUI(); setupSignals(); assembly(); }
SendFileProgressWidget::SendFileProgressWidget(boost::shared_ptr<SingleClient>client, FileTransfer* fileTransfer, QWidget *parent) :QWidget(parent), ui(new Ui::SendFileProgressWidget), m_Client(client), m_FileTransfer(fileTransfer), m_SendFile(fileTransfer->getFilePath()), m_LastSendedSize(0), m_ElapsedTime(0) { ui->setupUi(this); setupWidgets(); setupSignals(); }
VtkColorTable::VtkColorTable(QWidget * parent) : QWidget(parent) { setupUi(this); colorFunction = vtkColorTransferFunction::New(); editingCell = QPoint(-1, -1); setupSignals(); //mainTable Aesthetics mainTable->setColumnWidth(0, 70); for (int a = 1; a <= 4; a++) mainTable->setColumnWidth(a, 40); mainTable->setSelectionBehavior(QAbstractItemView::SelectRows); }
void CustomWidgetEditor::currentWidgetChanged( QListBoxItem *i ) { checkTimer->stop(); checkWidgetName(); MetaDataBase::CustomWidget *w = findWidget( i ); if ( !i || !w ) { buttonChooseHeader->setEnabled( FALSE ); editClass->setEnabled( FALSE ); editHeader->setEnabled( FALSE ); buttonChoosePixmap->setEnabled( FALSE ); spinWidth->setEnabled( FALSE ); spinHeight->setEnabled( FALSE ); localGlobalCombo->setEnabled( FALSE ); sizeHor->setEnabled( FALSE ); sizeVer->setEnabled( FALSE ); checkContainer->setEnabled( FALSE ); return; } buttonChooseHeader->setEnabled( TRUE ); editClass->setEnabled( TRUE ); editHeader->setEnabled( TRUE ); buttonChoosePixmap->setEnabled( TRUE ); spinWidth->setEnabled( TRUE ); spinHeight->setEnabled( TRUE ); localGlobalCombo->setEnabled( TRUE ); sizeHor->setEnabled( TRUE ); sizeVer->setEnabled( TRUE ); checkContainer->setEnabled( TRUE ); editClass->blockSignals( TRUE ); editClass->setText( w->className ); editClass->blockSignals( FALSE ); editHeader->setText( w->includeFile ); localGlobalCombo->setCurrentItem( (int)w->includePolicy ); if ( w->pixmap ) previewPixmap->setPixmap( *w->pixmap ); else previewPixmap->setText( "" ); spinWidth->setValue( w->sizeHint.width() ); spinHeight->setValue( w->sizeHint.height() ); sizeHor->setCurrentItem( size_type_to_int( w->sizePolicy.horData() ) ); sizeVer->setCurrentItem( size_type_to_int( w->sizePolicy.verData() ) ); checkContainer->setChecked( w->isContainer ); setupSignals(); setupSlots(); setupProperties(); }
void AgoApp::setup() { setupLogging(); setupAgoConnection(); setupSignals(); setupApp(); setupIoThread(); //Send event app is started //This is useful to monitor app (most of the time systemd restarts app before agosystem find it has crashed) //And it fix enhancement #143 qpid::types::Variant::Map content; content["process"] = appShortName; //no internalid specified, processname is in event content agoConnection->emitEvent("", "event.monitoring.processstarted", content); }
CurvePresenter::CurvePresenter(CurveModel* model, CurveView* view, QObject* parent): QObject{parent}, m_model{model}, m_view{view}, m_commandDispatcher{iscore::IDocument::documentFromObject(*model)->commandStack()}, m_selectionDispatcher{iscore::IDocument::documentFromObject(*model)->selectionStack()} { // For each segment in the model, create a segment and relevant points in the view. // If the segment is linked to another, the point is shared. setupView(); setupContextMenu(); setupSignals(); m_sm = new CurveStateMachine{*this, this}; }
PlaylistsWidget::PlaylistsWidget( QWidget *parent ) : QWidget( parent ) { this->tabwidget = new QTabWidget(); this->tabwidget->setMovable( true ); QHBoxLayout *layout = new QHBoxLayout(); layout->addWidget( this->tabwidget ); this->setLayout( layout ); manager = new QNetworkAccessManager(); setupSignals(); this->requestPlaylistsStatus(); }
RecordTableScreen::RecordTableScreen(QWidget *parent) : QWidget(parent) { // Инициализируется контроллер списка записей recordTableController=new RecordTableController(this); recordTableController->setObjectName("recordTableController"); setupActions(); recordTableController->init(); setupUI(); setupSignals(); assembly(); }