Пример #1
0
 void ContainerWindow::onKeyPressed(MyGUI::Widget *_sender, MyGUI::KeyCode _key, MyGUI::Char _char)
 {
     if (_key == MyGUI::KeyCode::Space)
         onCloseButtonClicked(mCloseButton);
     if (_key == MyGUI::KeyCode::Return || _key == MyGUI::KeyCode::NumpadEnter)
         onTakeAllButtonClicked(mTakeButton);
 }
Пример #2
0
void ShredDialog::initConnect()
{
    connect(select_btn, SIGNAL(clicked()), this, SLOT(onSelectButtonClicked()));
    connect(shred_btn, SIGNAL(clicked()), this, SLOT(onShredButtonClicked()));
    connect(cacel_btn, SIGNAL(clicked()), this, SLOT(onCacelButtonClicked()));
//    connect(title_bar, SIGNAL(showMinDialog()), this, SLOT(onMinButtonClicked()));
    connect(title_bar,SIGNAL(closeDialog()), this, SLOT(onCloseButtonClicked()));
}
Пример #3
0
int TabBar::addTab(const QString &AText)
{
    TabBarItem *item = new TabBarItem(this);
    item->setText(AText);
    item->setCloseable(FTabsCloseable);
    FItems.append(item);
    layout()->addWidget(item);
    connect(item,SIGNAL(closeButtonClicked()),SLOT(onCloseButtonClicked()));

    int index = FItems.indexOf(item);
    if (index == 0)
        setCurrentIndex(index);

    return index;
}
Пример #4
0
void ShutterToolMainWindow::makeConnections()
{
	connect( model(), SIGNAL(aodShutterControlConnected(bool)), this, SLOT(enableAutomaticShuttersOpenGUI(bool)) );
	connect( model(), SIGNAL(shuttersConnected(bool)), this, SLOT(enableShutterControlGUI(bool)) );
	connect( model(), SIGNAL(preInjectionControlsDisabled()), this, SLOT(onInjection()) );
	connect( model(), SIGNAL(postInjectionControlsEnabled()), this, SLOT(onPostInjection()) );

	connect( enableAutomaticShuttersOpenButton_, SIGNAL(clicked()), this, SLOT(onEnableButtonClicked()) );
	connect( disableAutomaticShuttersOpenButton_, SIGNAL(clicked()), this, SLOT(onDisableButtonClicked()) );

	connect( openShuttersButton_, SIGNAL(clicked()), this, SLOT(onOpenButtonClicked()) );
	connect( closeShuttersButton_, SIGNAL(clicked()), this, SLOT(onCloseButtonClicked()) );

	connect( model(), SIGNAL(shuttersOpen()), this, SLOT(onModelOpened()) );
	connect( model(), SIGNAL(shuttersClosed()), this, SLOT(onModelClosed()) );
	connect( model(), SIGNAL(shuttersBetween()), this, SLOT(onModelBetween()) );
}
Пример #5
0
LogWindowModal::LogWindowModal(const QString& log, QWidget* parent)
    : QDialog(parent)
    , _mainLayout(0)
    , _textBrowser(0)
    , _buttonBox(0)
{

    _mainLayout = new QVBoxLayout(this);
    _mainLayout->setContentsMargins(0, 0, 0, 0);

    _textBrowser = new QTextBrowser(this);
    _textBrowser->setOpenExternalLinks(true);
    _textBrowser->setPlainText(log);
    _mainLayout->addWidget(_textBrowser);

    _buttonBox = new DialogButtonBox(QDialogButtonBox::StandardButtons(QDialogButtonBox::Close), Qt::Horizontal, this);
    QObject::connect( _buttonBox, SIGNAL(rejected()), this, SLOT(onCloseButtonClicked()) );
    _mainLayout->addWidget(_buttonBox);
}
Пример #6
0
LogWindow::LogWindow(QWidget* parent)
    : QWidget(parent, Qt::Dialog | Qt::WindowStaysOnTopHint)
    , _mainLayout(0)
    , _textBrowser(0)
    , _clearButton(0)
{
    setWindowTitle( tr("Error Log") );

    _mainLayout = new QVBoxLayout(this);
    _mainLayout->setContentsMargins(0, 0, 0, 0);

    _textBrowser = new QTextBrowser(this);
    _textBrowser->setOpenExternalLinks(true);
    _mainLayout->addWidget(_textBrowser);

    _buttonBox = new DialogButtonBox(QDialogButtonBox::StandardButtons(QDialogButtonBox::Close), Qt::Horizontal, this);

    _clearButton = new Button( tr("&Clear") );
    _clearButton->setFocusPolicy(Qt::TabFocus);
    _buttonBox->addButton(_clearButton, QDialogButtonBox::ResetRole);
    QObject::connect( _clearButton, SIGNAL(clicked()), this, SLOT(onClearButtonClicked()) );
    QObject::connect( _buttonBox, SIGNAL(rejected()), this, SLOT(onCloseButtonClicked()) );
    _mainLayout->addWidget(_buttonBox);
}
Пример #7
0
AMDataSourcesEditor::AMDataSourcesEditor(AMScanSetModel* model, QWidget *parent) :
		QWidget(parent)
{
	detailEditor_ = 0;
	if (objectName().isEmpty())
		setObjectName(QString::fromUtf8("AMDataSourcesEditor"));
	resize(317, 230);
	QSizePolicy localSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
	localSizePolicy.setHorizontalStretch(0);
	localSizePolicy.setVerticalStretch(0);
	localSizePolicy.setHeightForWidth(sizePolicy().hasHeightForWidth());
	setSizePolicy(localSizePolicy);
	verticalLayout_ = new QVBoxLayout();
	verticalLayout_->setObjectName(QString::fromUtf8("verticalLayout"));
	scanSetView_ = new QTreeView();
	scanSetView_->setObjectName(QString::fromUtf8("scanSetView_"));
	scanSetView_->setAlternatingRowColors(true);

	verticalLayout_->addWidget(scanSetView_);

	addAnalysisToolButtonLayout_ = new QHBoxLayout();
	addAnalysisToolButtonLayout_->setObjectName(QString::fromUtf8("addAnalysisToolButtonLayout_"));
	addAnalysisToolButtonLayout_->setContentsMargins(12, 0, 12, -1);
	addDataSourceButton_ = new QToolButton();
	addDataSourceButton_->setObjectName(QString::fromUtf8("addDataSourceButton_"));

	addAnalysisToolButtonLayout_->addWidget(addDataSourceButton_);

	horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

	addAnalysisToolButtonLayout_->addItem(horizontalSpacer_2);


	verticalLayout_->addLayout(addAnalysisToolButtonLayout_);

	analysisDetailsLayout_ = new QGridLayout();
	analysisDetailsLayout_->setObjectName(QString::fromUtf8("analysisDetailsLayout_"));
	analysisDetailsLayout_->setContentsMargins(-1, 0, -1, -1);
	nameEdit_ = new QLineEdit();
	nameEdit_->setObjectName(QString::fromUtf8("nameEdit_"));
	nameEdit_->setFrame(false);

	analysisDetailsLayout_->addWidget(nameEdit_, 0, 1, 1, 1);

	descriptionLabel_ = new QLabel();
	descriptionLabel_->setObjectName(QString::fromUtf8("descriptionLabel_"));
	descriptionLabel_->setStyleSheet(QString::fromUtf8("font: bold \"Lucida Grande\";\n"
"color: rgb(121,121,121);"));
	descriptionLabel_->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);

	analysisDetailsLayout_->addWidget(descriptionLabel_, 1, 0, 1, 1);

	descriptionEdit_ = new QLineEdit();
	descriptionEdit_->setObjectName(QString::fromUtf8("descriptionEdit_"));
	descriptionEdit_->setFrame(false);

	analysisDetailsLayout_->addWidget(descriptionEdit_, 1, 1, 1, 1);

	nameLabel_ = new QLabel();
	nameLabel_->setObjectName(QString::fromUtf8("nameLabel_"));
	nameLabel_->setStyleSheet(QString::fromUtf8("font: bold \"Lucida Grande\";\n"
"color: rgb(121,121,121);"));
	nameLabel_->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);

	analysisDetailsLayout_->addWidget(nameLabel_, 0, 0, 1, 1);


	verticalLayout_->addLayout(analysisDetailsLayout_);

	lineBreak_ = new QFrame();
	lineBreak_->setObjectName(QString::fromUtf8("lineBreak_"));
	lineBreak_->setFrameShape(QFrame::HLine);
	lineBreak_->setFrameShadow(QFrame::Sunken);

	verticalLayout_->addWidget(lineBreak_);

	detailEditorLayout_ = new QVBoxLayout();
	detailEditorLayout_->setObjectName(QString::fromUtf8("detailEditorLayout_"));

	verticalLayout_->addLayout(detailEditorLayout_);

	setWindowTitle(QApplication::translate("AMDataSourcesEditor", "Form", 0, QApplication::UnicodeUTF8));
	addDataSourceButton_->setText(QApplication::translate("AMDataSourcesEditor", "Add Analysis Tool", 0, QApplication::UnicodeUTF8));
	descriptionLabel_->setText(QApplication::translate("AMDataSourcesEditor", "description", 0, QApplication::UnicodeUTF8));
	nameLabel_->setText(QApplication::translate("AMDataSourcesEditor", "name", 0, QApplication::UnicodeUTF8));

	// Modify and adjust UI components
	nameEdit_->setReadOnly(true);	// you can't edit existing data source names.
	// When making new names for data sources, they better be mathematically sound variable names (No spaces, alphabetic character at beginning, no funky symbols, etc...)
	nameEdit_->setValidator(new QRegExpValidator(QRegExp("[A-Za-z_]\\w*"), this));



	// apply 'close item' boxes onto the list of data sources
	itemDelegate_ = new AMCloseItemDelegate();
	itemDelegate_->setCloseButtonsEnabled(true);
	connect(itemDelegate_, SIGNAL(closeButtonClicked(QModelIndex)), this, SLOT(onCloseButtonClicked(QModelIndex)));
	scanSetView_->setItemDelegate(itemDelegate_);

	// apply the existing scan set model to the data source list view:
	model_ = model;
	scanSetView_->setModel(model_);
	connect(scanSetView_->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), this, SLOT(onSetViewIndexChanged(QModelIndex,QModelIndex)));

	// don't show the drop-down arrows for scans. (Saves a bit of room inside the list of channels.)
	scanSetView_->setRootIsDecorated(false);

	addDataSourceButton_->setDisabled(true);
	connect(addDataSourceButton_, SIGNAL(clicked()), this, SLOT(onAddDataSourceButtonClicked()));

	editingNewDataSourceName_ =  false;
	nameOfAnalysisBlockToBeAdded_ = "";

	connect(descriptionEdit_, SIGNAL(editingFinished()), this, SLOT(descriptionEditingFinished()));

	showAllDataSources_ = false;
	scanSetView_->setContextMenuPolicy(Qt::CustomContextMenu);
	connect(scanSetView_, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenuRequested(QPoint)));

	setLayout(verticalLayout_);
}
AMDirectorySynchronizerDialog::AMDirectorySynchronizerDialog(const QString &side1Directory, const QString &side2Directory, const QString &side1DirectoryName, const QString &side2DirectoryName, QWidget *parent) :
	QDialog(parent)
{
	delaySeconds_ = 0;
	delayCountdown_ = 0;

	side1Directory_ = side1Directory;
	side2Directory_ = side2Directory;

	side1DirectoryName_ = side1DirectoryName;
	side2DirectoryName_ = side2DirectoryName;

	closeOnCompletion_ = false;
	timedWarningOnCompletion_ = false;
	lastCompareResult_ = AMRecursiveDirectoryCompare::NotYetRun;

	QVBoxLayout* mainLayout = new QVBoxLayout();

	singleFileProgressBar_ = new QProgressBar();
	singleFileProgressBar_->setRange(0, 100);
	singleFileLabel_ = new QLabel();

	overallTransferProgressBar_ = new QProgressBar();
	overallTransferProgressBar_->setRange(0, 100);
	overallTransferLabel_ = new QLabel();

	currentCopyFileLabel_ = new QLabel();

	errorTextEdit_ = new QTextEdit();
	errorTextEdit_->setReadOnly(true);
	errorCloseButton_ = new QPushButton("Close");
	errorCloseButton_->setVisible(false);
	successfulSync_ = false;

	progressTextEdit_ = new QTextEdit();
	progressTextEdit_->setReadOnly(true);

	fileListingEdit_ = new QTextEdit();
	fileListingEdit_->setReadOnly(true);

	feedbackStackWidget_ = new AMVerticalStackWidget();
	feedbackStackWidget_->addItem("Files", fileListingEdit_);
	feedbackStackWidget_->addItem("Progress", progressTextEdit_);
	feedbackStackWidget_->addItem("Errors", errorTextEdit_);
	feedbackStackWidget_->collapseItem(0);
	feedbackStackWidget_->collapseItem(1);
	feedbackStackWidget_->collapseItem(2);

	prepareButton_ = new QPushButton("Prepare");
	startButton_ = new QPushButton("Start");
	QHBoxLayout *buttonsHL = new QHBoxLayout();
	buttonsHL->addSpacing(0);
	buttonsHL->addWidget(prepareButton_);
	buttonsHL->addWidget(startButton_);

	QHBoxLayout *singleFileHL = new QHBoxLayout();
	singleFileHL->addWidget(singleFileProgressBar_, Qt::AlignCenter);
	QHBoxLayout *overallTransferHL = new QHBoxLayout();
	overallTransferHL->addWidget(overallTransferProgressBar_, Qt::AlignCenter);

	QGridLayout *gridLayout = new QGridLayout();
	gridLayout->addLayout(singleFileHL, 0, 0, 1, 9, Qt::AlignCenter);
	gridLayout->addWidget(singleFileLabel_, 0, 10, 1, 1, Qt::AlignRight);
	gridLayout->addLayout(overallTransferHL, 1, 0, 1, 9, Qt::AlignCenter);
	gridLayout->addWidget(overallTransferLabel_, 1, 10, 1, 1, Qt::AlignRight);

	mainStatusLabel_ = new QLabel("Synchronize Directories, press Prepare or Start to continue.");
	mainLayout->addWidget(mainStatusLabel_);

	mainLayout->addLayout(gridLayout);
	mainLayout->addWidget(currentCopyFileLabel_);

	mainLayout->addLayout(buttonsHL);
	mainLayout->addWidget(feedbackStackWidget_);
	mainLayout->addWidget(errorCloseButton_, Qt::AlignCenter);


	setLayout(mainLayout);
	synchronizer_ = new AMDirectorySynchronizer(side1Directory_, side2Directory_);
	synchronizer_->setSide1DirectorName(side1DirectoryName_);
	synchronizer_->setSide2DirectorName(side2DirectoryName_);
	synchronizer_->setAllowSide1Creation(true);

	connect(synchronizer_, SIGNAL(copyCompleted()), this, SLOT(onSynchronizerComplete()));
	connect(synchronizer_, SIGNAL(copyFailed()), this, SLOT(onSynchronizerComplete()));
	connect(synchronizer_, SIGNAL(errorMessagesChanged(const QString&)), this, SLOT(onSynchronizerErrorTextChanged(const QString&)));
	connect(synchronizer_, SIGNAL(progressMessagesChanged(QString)), this, SLOT(onSynchronizerProgressTextChanged(QString)));
	connect(synchronizer_, SIGNAL(progressChanged(int,int,int)), this, SLOT(onProgressChanged(int,int,int)));
	connect(synchronizer_, SIGNAL(currentCopyFileChanged(QString)), this, SLOT(onCurrentCopyFileChanged(QString)));

	connect(errorCloseButton_, SIGNAL(clicked()), this, SLOT(onCloseButtonClicked()));

	connect(prepareButton_, SIGNAL(clicked()), this, SLOT(onPrepareButtonClicked()));
	connect(startButton_, SIGNAL(clicked()), this, SLOT(onStartButtonClicked()));

	startButton_->setDefault(false);
	errorCloseButton_->setDefault(false);
	prepareButton_->setDefault(true);

	setModal(true);
}