Beispiel #1
0
TabBar::TabBar(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TabBar)
{
    enter
    ui->setupUi(this);
    ui->cmdScrollLeft->hide();
    ui->cmdScrollRight->hide();

    QHBoxLayout *layout = new QHBoxLayout();
    layout->addItem(new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Expanding));
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(2);
    ui->scrollContent->setLayout(layout);

    ui->cmdScrollLeft->hide();
    ui->cmdScrollRight->hide();
    ui->scroll->adjustSize();
    ui->scrollContent->adjustSize();
    updateScrollButtonsVisibility();

    connect(Core::ui(), SIGNAL(createTab(QString, bool)), SLOT(createTab(QString, bool)));
    connect(Core::ui(), SIGNAL(activateTab(QString)), SLOT(activateTab(QString)));
    connect(Core::ui(), SIGNAL(setTabName(QString,QString)), SLOT(setTabName(QString,QString)));
    connect(Core::ui(), SIGNAL(setTabIcon(QString,QString)), SLOT(setTabIcon(QString,QString)));
    connect(Core::ui(), SIGNAL(highlight(QString)), SLOT(highlight(QString)));
    connect(Core::ui(), SIGNAL(closeTab(QString)), SLOT(closeTab(QString)));
    connect(ui->cmdScrollLeft, SIGNAL(clicked()), SLOT(scrollLeft()));
    connect(ui->cmdScrollRight, SIGNAL(clicked()), SLOT(scrollRight()));
    leave
}
Beispiel #2
0
tabCheck::tabCheck(){
	setTabName("tabCheck");
	
	mapAtt["act"] = &tabCheck::act;
	mapAtt["area"] = &tabCheck::area;
	mapAtt["cDesc"] = &tabCheck::cDesc;
	mapAtt["cMoney"] = &tabCheck::cMoney;
	mapAtt["cName"] = &tabCheck::cName;
	mapAtt["cNum"] = &tabCheck::cNum;
	mapAtt["compName"] = &tabCheck::compName;
	mapAtt["cPrice"] = &tabCheck::cPrice;
	mapAtt["cSize"] = &tabCheck::cSize;
	mapAtt["customid"] = &tabCheck::customid;
	mapAtt["facName"] = &tabCheck::facName;
	mapAtt["hDate"] = &tabCheck::hDate;
	mapAtt["hName"] = &tabCheck::hName;
	mapAtt["ID"] = &tabCheck::ID;
	mapAtt["payMode"] = &tabCheck::payMode;
	mapAtt["reciveAdd"] = &tabCheck::reciveAdd;
	mapAtt["reciveMan"] = &tabCheck::reciveMan;
	mapAtt["reciveTel"] = &tabCheck::reciveTel;
	mapAtt["result"] = &tabCheck::result;
	mapAtt["sendName"] = &tabCheck::sendName;
	mapAtt["sendNum"] = &tabCheck::sendNum;
	mapAtt["sendTel"] = &tabCheck::sendTel;
	mapAtt["sendWay"] = &tabCheck::sendWay;
	mapAtt["state"] = &tabCheck::state;
	mapAtt["tabName"] = &tabCheck::tabName;
	mapAtt["userid"] = &tabCheck::userid;
}
Beispiel #3
0
tabTick::tabTick(){
	setTabName("tabTick");
	
	mapAtt["act"] = &tabTick::act;
	mapAtt["cDesc"] = &tabTick::cDesc;
	mapAtt["checkID"] = &tabTick::checkID;
	mapAtt["ID"] = &tabTick::ID;
	mapAtt["pAddress"] = &tabTick::pAddress;
	mapAtt["pBankName"] = &tabTick::pBankName;
	mapAtt["pBankNum"] = &tabTick::pBankNum;
	mapAtt["pCompName"] = &tabTick::pCompName;
	mapAtt["pContacts"] = &tabTick::pContacts;
	mapAtt["pContactsAdd"] = &tabTick::pContactsAdd;
	mapAtt["pContactsTel"] = &tabTick::pContactsTel;
	mapAtt["pFax"] = &tabTick::pFax;
	mapAtt["pMailNum"] = &tabTick::pMailNum;
	mapAtt["pName"] = &tabTick::pName;
	mapAtt["pNum"] = &tabTick::pNum;
	mapAtt["pPrice"] = &tabTick::pPrice;
	mapAtt["pProName"] = &tabTick::pProName;
	mapAtt["pSize"] = &tabTick::pSize;
	mapAtt["pSumPrice"] = &tabTick::pSumPrice;
	mapAtt["pTaxNum"] = &tabTick::pTaxNum;
	mapAtt["result"] = &tabTick::result;
	mapAtt["tabName"] = &tabTick::tabName;
	mapAtt["userid"] = &tabTick::userid;
}
Beispiel #4
0
tabCustom::tabCustom(){
	setTabName("tabCustom");
	
	mapAtt["act"] = &tabCustom::act;
	mapAtt["bankName"] = &tabCustom::bankName;
	mapAtt["bankNum"] = &tabCustom::bankNum;
	mapAtt["bron"] = &tabCustom::bron;
	mapAtt["cName"] = &tabCustom::cName;
	mapAtt["compMode"] = &tabCustom::compMode;
	mapAtt["compName"] = &tabCustom::compName;
	mapAtt["cSize"] = &tabCustom::cSize;
	mapAtt["dispathComp"] = &tabCustom::dispathComp;
	mapAtt["dispathMed1"] = &tabCustom::dispathMed1;
	mapAtt["dispathMed2"] = &tabCustom::dispathMed2;
	mapAtt["facName"] = &tabCustom::facName;
	mapAtt["ID"] = &tabCustom::ID;
	mapAtt["prodName"] = &tabCustom::prodName;
	mapAtt["result"] = &tabCustom::result;
	mapAtt["tabName"] = &tabCustom::tabName;
	mapAtt["taxNum"] = &tabCustom::taxNum;
	mapAtt["tel"] = &tabCustom::tel;
	mapAtt["tickAdd"] = &tabCustom::tickAdd;
	mapAtt["tickComp"] = &tabCustom::tickComp;
	mapAtt["tickTel"] = &tabCustom::tickTel;
	mapAtt["userid"] = &tabCustom::userid;
}
void ScreenTab::setScreen(Screen *screen)
{
    if (_screen == screen)
        return;
    if (_screen && _screen->parent() == this)
        _screen->deleteLater();
    _screen = screen;
    _currentMedia = NULL;
    _desktopMediaPlayer->setScreen(screen);
    emit currentMediaChanged(NULL);
    if (_screen)
    {
        if (!_screen->parent())
            _screen->setParent(this);
        setModel(_screen->getMediaModel());
        ui->randomMediaCheckBox->setChecked(_screen->getRandomEnabled());
        connect(_screen, SIGNAL(randomEnabledChanged(bool)), ui->randomMediaCheckBox, SLOT(setChecked(bool)));
        connect(ui->randomMediaCheckBox, SIGNAL(clicked(bool)), _screen, SLOT(setRandomEnabled(bool)));
//        ui->currentDisplaySpinBox->setValue(_screen->getNumberOfScreen());
//        connect(_screen, SIGNAL(numberOfScreenChanged(int)), ui->currentDisplaySpinBox, SLOT(setValue(int)));
//        connect(ui->currentDisplaySpinBox, SIGNAL(valueChanged(int)), _screen, SLOT(setNumberOfScreen(int)));
        //Установим имя таба
        if (!_screen->getName().isEmpty())
            setTabName(_screen->getName());
        connect(_screen, SIGNAL(nameChanged(QString)), this, SLOT(setTabName(QString)));
        connect(_screen, SIGNAL(dataToSaveChanged()), this, SIGNAL(dataChanged()));
        //Если это не реальный экран, то выключим ненужные кнопки
        if (_screen->getIsRealScreen())
        {
            ui->startPlayingPushButton->setEnabled(true);
            ui->actionStartStopPlaying->setEnabled(true);
//            ui->currentDisplayLabel->setEnabled(true);
//            ui->currentDisplaySpinBox->setEnabled(true);
            ui->addExtensionPushButton->setEnabled(true);
            ui->actionAddExtension->setEnabled(true);
        } else
        {
            ui->startPlayingPushButton->setEnabled(false);
            ui->actionStartStopPlaying->setEnabled(false);
//            ui->currentDisplayLabel->setEnabled(false);
//            ui->currentDisplaySpinBox->setEnabled(false);
            ui->addExtensionPushButton->setEnabled(false);
            ui->actionAddExtension->setEnabled(false);
        }
    }
    emit screenPointerChanged(_screen);
}
DetailTitleMgrView::DetailTitleMgrView(QWidget *parent)
	: TableView(parent)
{
	setViewId(DetailTitleView);
	setTabName(QString::fromLocal8Bit("详细科目管理"));

	createTable();
}
Beispiel #7
0
BankMgrView::BankMgrView(QWidget *parent)
	: TableView(parent)
{
	setViewId(BankAccountView);
	setTabName(QString::fromLocal8Bit("帐户管理"));

	createTable();
}
void ScreenTab::setData(MediaTableModel *screenModel, const QHash<QString, QVariant> screenParams)
{
    if (!screenModel)
        return;
    setModel(screenModel);
    setTabName(screenParams["name"].toString());
    ui->randomMediaCheckBox->setChecked(screenParams["random-enabled"].toBool());
//    ui->currentDisplaySpinBox->setValue(screenParams["screen-number"].toInt());
}
Beispiel #9
0
tabUser::tabUser(){
	setTabName("tabUser");
	
	mapAtt["act"] = &tabUser::act;
	mapAtt["desc"] = &tabUser::desc;
	mapAtt["ID"] = &tabUser::ID;
	mapAtt["password"] = &tabUser::password;
	mapAtt["result"] = &tabUser::result;
	mapAtt["tabName"] = &tabUser::tabName;
	mapAtt["userName"] = &tabUser::userName;
}
Beispiel #10
0
void MainWindow::saveFileAs()
{
    QString tmpPath = QFileDialog::getSaveFileName();
    QFile file(tmpPath);
    if (file.open(QIODevice::WriteOnly|QIODevice::Text)) {
        tabs[currentTab()].path = tmpPath;
        file.write(ui->textEdit->toPlainText().toUtf8());
        MainWindow::setWindowTitle(tabs[currentTab()].path.toUtf8() + " - BenPad");
        tabs[currentTab()].filename = extractFilename(tabs[currentTab()].path);
        setTabName(currentTab(), tabs[currentTab()].filename);
    }
}
Beispiel #11
0
void MainWindow::openFile()
{
    QString tmpPath = QFileDialog::getOpenFileName(this);
    QFile file(tmpPath);
    if(file.open(QIODevice::ReadOnly|QIODevice::Text)) {
        tabs[currentTab()].path = tmpPath;
        QByteArray byteArray = file.readAll();
        tabs[currentTab()].textEdit->setPlainText(byteArray.data());

        MainWindow::setWindowTitle(tabs[currentTab()].path.toUtf8() + " - BenPad");
        tabs[currentTab()].filename = extractFilename(tabs[currentTab()].path);
        setTabName(currentTab(), tabs[currentTab()].filename);
    }
}
Beispiel #12
0
void EdoTabs::popupMenuClickOnTab (const int tabIndex, const String &tabName)
{
	PopupMenu menu;
	menu.addItem (1, T("Rename tab"));
	menu.addItem (2, T("Close tab"));

	const int ret = menu.show();

	if (ret == 1)
	{
		AlertWindow alert (T("New tab name"), T("Set the new tab name"), AlertWindow::InfoIcon);
		alert.addTextEditor (T("edoTabName"), tabName, T("New tab name"), false);
		alert.addButton (T("OK"), 1, KeyPress (KeyPress::returnKey));
		alert.addButton (T("Cancel"), 2);
		const int ret = alert.runModalLoop();
		if (ret == 2)
		{
			return;
		}
		else
		{
			const String newName = alert.getTextEditorContents(EDO_COMPONENT_NAME);
			Component *edoComponent = dynamic_cast<Component*>(getTabContentComponent (tabIndex));
			if (edoComponent!=0)
			{
				edoComponent->setName (newName);
			}

			setTabName (tabIndex, newName);
		}
	}
	if (ret == 2)
	{
		removeTab (tabIndex);
	}
}
Beispiel #13
0
void MainWindow::on_actionNew_File_triggered()
{
    ui->textEdit->clear();
    MainWindow::setWindowTitle("Untitled - BenPad");
    setTabName(currentTab(), "Untitled");
}