Example #1
0
void ConvertToSupergroupBox::keyPressEvent(QKeyEvent *e) {
    if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
        onConvert();
    } else {
        AbstractBox::keyPressEvent(e);
    }
}
Example #2
0
ConvertToSupergroupBox::ConvertToSupergroupBox(ChatData *chat) : AbstractBox(st::boxWideWidth)
    , _chat(chat)
    , _text(100)
    , _note(100)
    , _convert(this, lang(lng_profile_convert_confirm), st::defaultBoxButton)
    , _cancel(this, lang(lng_cancel), st::cancelBoxButton) {
    QStringList text;
    text.push_back(lang(lng_profile_convert_feature1));
    text.push_back(lang(lng_profile_convert_feature2));
    text.push_back(lang(lng_profile_convert_feature3));
    text.push_back(lang(lng_profile_convert_feature4));

    textstyleSet(&st::boxTextStyle);
    _text.setText(st::boxTextFont, text.join('\n'), _confirmBoxTextOptions);
    _note.setText(st::boxTextFont, lng_profile_convert_warning(lt_bold_start, textcmdStartSemibold(), lt_bold_end, textcmdStopSemibold()), _confirmBoxTextOptions);
    _textWidth = st::boxWideWidth - st::boxPadding.left() - st::boxButtonPadding.right();
    _textHeight = _text.countHeight(_textWidth);
    setMaxHeight(st::boxTitleHeight + _textHeight + st::boxPadding.bottom() + _note.countHeight(_textWidth) + st::boxButtonPadding.top() + _convert.height() + st::boxButtonPadding.bottom());
    textstyleRestore();

    connect(&_convert, SIGNAL(clicked()), this, SLOT(onConvert()));
    connect(&_cancel, SIGNAL(clicked()), this, SLOT(onClose()));

    prepare();
}
Example #3
0
void ConvertWindow::onConvertAll() {
	QMessageBox::StandardButton ret = QMessageBox::question(
							this,
							tr("Are You Sure?"),
							tr("This will convert all ove files under current folder to MusicXml fils, \n are you sure?"),
							QMessageBox::Ok | QMessageBox::Cancel,
							QMessageBox::Cancel);

	if (ret == QMessageBox::Ok) {
		convertAll_ = true;

		onConvert();
	}
}
Example #4
0
void ConvertWindow::createToolbarAndMenu() {
	// action
	exitAction_ = new QAction(tr("E&xit"), this);
	exitAction_->setShortcut(tr("Ctrl+Q"));
	exitAction_->setStatusTip(tr("Exit the application"));
	connect(exitAction_, SIGNAL(triggered()), this, SLOT(close()));

	aboutAction_ = new QAction(tr("&About"), this);
	aboutAction_->setStatusTip(tr("Show the application's About box"));
	connect(aboutAction_, SIGNAL(triggered()), this, SLOT(onAbout()));

	aboutQtAction_ = new QAction(tr("About Qt"), this);
	aboutQtAction_->setStatusTip(tr("Show Qt's About box"));
	connect(aboutQtAction_, SIGNAL(triggered()), this, SLOT(onAboutQt()));

        convertAction_ = new QAction(QIcon(":/save.xml.png"), tr("Convert"), this);
	convertAction_->setShortcut(tr("F5"));
	convertAction_->setStatusTip(tr("Convert to MusicXml file"));
	connect(convertAction_, SIGNAL(triggered()), this, SLOT(onConvert()));

        convertAllAction_ = new QAction(QIcon(":/save.xmls.png"), tr("Convert All"), this);
	convertAllAction_->setShortcut(tr("F6"));
	convertAllAction_->setStatusTip(tr("Convert all to MusicXml file"));
	connect(convertAllAction_, SIGNAL(triggered()), this, SLOT(onConvertAll()));

	// menu
	fileMenu_ = menuBar()->addMenu(tr("&File"));
	fileMenu_->addAction(convertAction_);
	fileMenu_->addAction(convertAllAction_);
	fileMenu_->addAction(exitAction_);

	menuBar()->addSeparator();

	helpMenu = menuBar()->addMenu(tr("&Help"));
	helpMenu->addAction(aboutAction_);

	ui_.toolBar->addAction(convertAction_);
	ui_.toolBar->addAction(convertAllAction_);
}
Example #5
0
void ConvertWindow::processOveFileSlot(const QString& path) {
	if (!convertXmlThread_->isRunning()) {
		currentFile_ = path;
		onConvert();
	}
}