void PmChart::setRecordState(bool record) { liveGroup->newButtonState(liveGroup->pmtimeState(), QmcTime::NormalMode, record); setButtonState(liveGroup->buttonState()); enableUi(); }
// // Note: Called from both Apply and OK on New Chart dialog // Must only called when the changes are definately going to // be applied, so all input validation must be done by now. // Chart *PmChart::acceptNewChart() { bool yAutoScale; double yMin, yMax; QString scheme; int sequence; Chart *cp = new Chart(activeTab(), activeTab()->splitter()); activeGroup->addGadget(cp); activeTab()->addGadget(cp); QString newTitle = my.newchart->title().trimmed(); if (newTitle.isEmpty() == false) cp->changeTitle(newTitle, true); cp->setLegendVisible(my.newchart->legend()); cp->setAntiAliasing(my.newchart->antiAliasing()); cp->setRateConvert(my.newchart->rateConvert()); my.newchart->updateChartPlots(cp); my.newchart->scale(&yAutoScale, &yMin, &yMax); cp->setScale(yAutoScale, yMin, yMax); my.newchart->scheme(&scheme, &sequence); cp->setScheme(scheme, sequence); activeGroup->setupWorldView(); activeTab()->showGadgets(); enableUi(); return cp; }
void PmChart::closeTab() { int index = chartTabWidget->currentIndex(); chartTabWidget->removeTab(index); if (index > 0) index--; setActiveTab(index, false); enableUi(); }
void lemon::reactOnStartedOp() { if (m_view->canStartSelling()) { enableUi(); //disableStartOp(); } else { disableUi(); //enableStartOp(); } }
void PmChart::acceptNewTab() { Tab *tab = new Tab; QString label = my.newtab->labelLineEdit->text().trimmed(); if (my.newtab->isArchiveSource()) tab->init(chartTabWidget, archiveGroup, label); else tab->init(chartTabWidget, liveGroup, label); chartTabWidget->insertTab(tab); enableUi(); }
void lemon::reactOnLogOn() { if (m_view->canStartSelling()) enableUi(); else { disableUi(); QString msg = i18n("Administrator or Supervisor needs to start operation before you can start selling..."); //Show a dialog saying that operations need to be started by admin ??? if (m_view->getLoggedUserRole() == roleBasic ) { KNotification *notify = new KNotification("information", this); notify->setText(msg); QPixmap pixmap = DesktopIcon("dialog-information",48); notify->setPixmap(pixmap); notify->sendEvent(); } } }
void SettingsDialog::reset() { my.chartUnits = QmcTime::Seconds; chartDeltaLineEdit->setText( QmcTime::deltaString(globalSettings.chartDelta, my.chartUnits)); my.loggerUnits = QmcTime::Seconds; loggerDeltaLineEdit->setText( QmcTime::deltaString(globalSettings.loggerDelta, my.loggerUnits)); my.visibleHistory = my.sampleHistory = 0; visibleCounter->setValue(globalSettings.visibleHistory); visibleCounter->setRange(PmChart::minimumPoints(), PmChart::maximumPoints()); visibleSlider->setValue(globalSettings.visibleHistory); visibleSlider->setRange(PmChart::minimumPoints(), PmChart::maximumPoints()); sampleCounter->setValue(globalSettings.sampleHistory); sampleCounter->setRange(PmChart::minimumPoints(), PmChart::maximumPoints()); sampleSlider->setValue(globalSettings.sampleHistory); sampleSlider->setRange(PmChart::minimumPoints(), PmChart::maximumPoints()); defaultBackgroundButton->setColor(QColor(globalSettings.chartBackground)); selectedHighlightButton->setColor(QColor(globalSettings.chartHighlight)); setupSchemeComboBox(); setupSchemePalette(); setupActionsList(); setupFontLists(); setupSavedHostsList(); removeHostButton->setEnabled(globalSettings.savedHosts.size() > 0); startupToolbarCheckBox->setCheckState( globalSettings.initialToolbar ? Qt::Checked : Qt::Unchecked); nativeToolbarCheckBox->setCheckState( globalSettings.nativeToolbar ? Qt::Checked : Qt::Unchecked); toolbarAreasComboBox->setCurrentIndex( globalSettings.toolbarLocation ? 1: 0); enableUi(); }
void PmChart::acceptEditChart() { bool yAutoScale; double yMin, yMax; QString scheme; int sequence; Chart *cp = my.newchart->chart(); QString editTitle = my.newchart->title().trimmed(); if (editTitle.isEmpty() == false && editTitle != cp->title()) cp->changeTitle(editTitle, true); cp->setLegendVisible(my.newchart->legend()); cp->setAntiAliasing(my.newchart->antiAliasing()); cp->setRateConvert(my.newchart->rateConvert()); my.newchart->scale(&yAutoScale, &yMin, &yMax); cp->setScale(yAutoScale, yMin, yMax); my.newchart->updateChartPlots(cp); my.newchart->scheme(&scheme, &sequence); cp->setScheme(scheme, sequence); cp->replot(); cp->show(); enableUi(); }
void SettingsDialog::settingsTab_currentChanged(int) { enableUi(); }
//For a frameless window: KMainWindow(0, Qt::FramelessWindowHint) lemon::lemon() : KXmlGuiWindow(0,Qt::FramelessWindowHint), m_view(new lemonView(this)) { setObjectName(QLatin1String("lemon")); setAcceptDrops(false); // tell the KMainWindow that this is indeed the main widget setCentralWidget(m_view); // then, setup our actions setupActions(); // Add typical actions and save size/toolbars/statusbar statusBar()->show(); //add some info labels to status bar labelUserInfo = new QLabel("::user::"); labelDate = new QLabel(" ::Date:: "); labelTime = new QLabel(" ::Time:: "); labelTransaction = new QLabel(""); QLabel *imageUser = new QLabel("user"); QLabel *imageDate = new QLabel("date"); QLabel *imageTime = new QLabel("time"); QLabel *imageTransaction = new QLabel("trans"); imageUser->setPixmap(DesktopIcon("user-identity", 16)); imageDate->setPixmap(DesktopIcon("view-pim-calendar", 16)); imageTime->setPixmap(DesktopIcon("chronometer", 16)); imageTransaction->setPixmap(DesktopIcon("wallet-open", 16)); updateDate(); statusBar()->addWidget(imageUser); statusBar()->addWidget(labelUserInfo); statusBar()->addWidget(imageDate); statusBar()->addWidget(labelDate); statusBar()->addWidget(imageTime); statusBar()->addWidget(labelTime); statusBar()->addWidget(imageTransaction); statusBar()->addWidget(labelTransaction); connect(m_view, SIGNAL(signalLoggedUser()), SLOT(updateUserName()) ); connect(m_view, SIGNAL(signalNoLoggedUser()), SLOT(updateUserName()) ); connect(m_view, SIGNAL(signalUpdateClock() ), SLOT(updateClock()) ); QTimer::singleShot(500, this, SLOT(hideMenuBar())); // apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar // position, icon size, etc. setAutoSaveSettings(); connect(m_view,SIGNAL(signalChangeStatusbar(const QString&)),this,SLOT(changeStatusbar(const QString&))); connect(m_view,SIGNAL(signalChangeCaption(const QString&)),this, SLOT(changeCaption(const QString&))); connect(m_view, SIGNAL(signalAdminLoggedOn()), this, SLOT(enableConfig())); connect(m_view, SIGNAL(signalAdminLoggedOff()), this, SLOT(disableConfig())); connect(m_view, SIGNAL(signalSupervisorLoggedOn()), this, SLOT(enableConfig())); //new connect(m_view, SIGNAL(signalSupervisorLoggedOff()), this, SLOT(disableConfig())); //new connect(m_view, SIGNAL(signalNoLoggedUser()), this, SLOT(disableUi())); connect(m_view, SIGNAL(signalLoggedUser()), this, SLOT(reactOnLogOn())); connect(m_view, SIGNAL(signalStartedOperation()), this, SLOT(reactOnStartedOp()) ); connect(m_view, SIGNAL(signalUpdateTransactionInfo()), this, SLOT(updateTransaction())); connect(m_view, SIGNAL(signalShowProdGrid()), this, SLOT(triggerGridAction())); connect(m_view, SIGNAL(signalShowDbConfig()), this, SLOT(showDBConfigDialog())); connect(m_view, SIGNAL(signalEnableUI()), this, SLOT(enableUi()) ); connect(m_view, SIGNAL(signalDisableUI()), this, SLOT(disableUi()) ); connect(m_view, SIGNAL(signalEnableStartOperationAction()), this, SLOT(enableStartOp()) ); loadStyle(); disableConfig(); disableUi(); }
void PmChart::activeTabChanged(int index) { if (index < chartTabWidget->size()) setActiveTab(index, false); enableUi(); }
void PmChart::addActiveTab(Tab *tab) { chartTabWidget->insertTab(tab); setActiveTab(chartTabWidget->size() - 1, true); enableUi(); }
void PmChart::closeChart() { activeTab()->deleteCurrent(); enableUi(); }