Пример #1
0
FeeCalculator::FeeCalculator()
	: QDialog()
{
	buyPaidLocked=false;
	buyBtcLocked=true;
	buyBtcReceivedLocked=false;
	ui.setupUi(this);
	setWindowFlags(Qt::WindowCloseButtonHint);
	foreach(QDoubleSpinBox* spinBox, findChildren<QDoubleSpinBox*>())new JulySpinBoxFix(spinBox);
#ifdef Q_OS_WIN
	if(QtWin::isCompositionEnabled())QtWin::extendFrameIntoClientArea(this);
#endif
	ui.feeValue->setValue(mainWindow.ui.accountFee->value());

	ui.buyPrice->setValue(mainWindow.ui.marketBuy->value());
	double btcVal=mainWindow.ui.accountUSD->value()/ui.buyPrice->value();
	if(btcVal<0.01)btcVal=1.0;
	ui.buyTotalBtc->setValue(btcVal);

	buyBtcLocked=false;
	buyBtcChanged(ui.buyTotalBtc->value());
	setZeroProfitPrice();
	buyBtcChanged(ui.buyTotalBtc->value());//I'll remove this soon
	setZeroProfitPrice();//and this too

	mainWindow.fillAllBtcLabels(this,currencyAStr);
	mainWindow.fillAllUsdLabels(this,currencyBStr);

	julyTranslator->translateUi(this);

	languageChanged();
	connect(julyTranslator,SIGNAL(languageChanged()),this,SLOT(languageChanged()));
}
Пример #2
0
void LanguageChangeNotifier::subscribe (QObject *subscriber)
{
	if (!instance)
		instance=new LanguageChangeNotifier ();

	connect (instance, SIGNAL (languageChanged ()), subscriber, SLOT (languageChanged ()));
}
Пример #3
0
void BEditEditorModulePrivate::init()
{
    document = 0;
    //
    actCut = new QAction(this);
      actCut->setIcon(BApplication::icon("editcut"));
      actCut->setShortcut(QKeySequence::Cut);
    actCopy = new QAction(this);
      actCopy->setIcon(BApplication::icon("editcopy"));
      actCopy->setShortcut(QKeySequence::Copy);
    actPaste = new QAction(this);
      actPaste->setIcon(BApplication::icon("editpaste"));
      actPaste->setShortcut(QKeySequence::Paste);
    actUndo = new QAction(this);
      actUndo->setIcon(BApplication::icon("undo"));
      actUndo->setShortcut(QKeySequence::Undo);
    actRedo = new QAction(this);
      actRedo->setIcon(BApplication::icon("redo"));
      actRedo->setShortcut(QKeySequence::Redo);
    actSwitchMode = new QAction(this);
      connect(actSwitchMode, SIGNAL(triggered()), this, SLOT(actSwitchModeTriggered()));
    //
    resetSwitchModeAction(false);
    checkActions();
    retranslateUi();
    connect(bApp, SIGNAL(languageChanged()), this, SLOT(retranslateUi()));
}
Пример #4
0
// Initialize the dialog widgets and connect the signals/slots
void SupernovaeDialog::createDialogContent()
{
	ui->setupUi(dialog);
	ui->tabs->setCurrentIndex(0);	
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()),
		this, SLOT(retranslate()));

	// Settings tab / updates group
	connect(ui->internetUpdatesCheckbox, SIGNAL(stateChanged(int)), this, SLOT(setUpdatesEnabled(int)));
	connect(ui->updateButton, SIGNAL(clicked()), this, SLOT(updateJSON()));
	connect(GETSTELMODULE(Supernovae), SIGNAL(updateStateChanged(Supernovae::UpdateState)), this, SLOT(updateStateReceiver(Supernovae::UpdateState)));
	connect(GETSTELMODULE(Supernovae), SIGNAL(jsonUpdateComplete(void)), this, SLOT(updateCompleteReceiver(void)));
	connect(ui->updateFrequencySpinBox, SIGNAL(valueChanged(int)), this, SLOT(setUpdateValues(int)));
	refreshUpdateValues(); // fetch values for last updated and so on
	// if the state didn't change, setUpdatesEnabled will not be called, so we force it
	setUpdatesEnabled(ui->internetUpdatesCheckbox->checkState());

	updateTimer = new QTimer(this);
	connect(updateTimer, SIGNAL(timeout()), this, SLOT(refreshUpdateValues()));
	updateTimer->start(7000);

	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));

	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));

	// About tab
	setAboutHtml();
	StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
	Q_ASSERT(gui);
	ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));

	updateGuiFromSettings();

}
Пример #5
0
void MpcImportWindow::createDialogContent()
{
	ui->setupUi(dialog);

	//Signals
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

	connect(ui->pushButtonAcquire, SIGNAL(clicked()),
	        this, SLOT(acquireObjectData()));
	connect(ui->pushButtonAbortDownload, SIGNAL(clicked()),
	        this, SLOT(abortDownload()));
	connect(ui->pushButtonAdd, SIGNAL(clicked()), this, SLOT(addObjects()));
	connect(ui->pushButtonDiscard, SIGNAL(clicked()),
	        this, SLOT(discardObjects()));

	connect(ui->pushButtonBrowse, SIGNAL(clicked()), this, SLOT(selectFile()));
	connect(ui->comboBoxBookmarks, SIGNAL(currentIndexChanged(QString)),
	        this, SLOT(bookmarkSelected(QString)));

	connect(ui->radioButtonFile, SIGNAL(toggled(bool)),
	        ui->frameFile, SLOT(setVisible(bool)));
	connect(ui->radioButtonURL, SIGNAL(toggled(bool)),
	        ui->frameURL, SLOT(setVisible(bool)));

	connect(ui->radioButtonAsteroids, SIGNAL(toggled(bool)),
	        this, SLOT(switchImportType(bool)));
	connect(ui->radioButtonComets, SIGNAL(toggled(bool)),
	        this, SLOT(switchImportType(bool)));

	connect(ui->pushButtonMarkAll, SIGNAL(clicked()),
	        this, SLOT(markAll()));
	connect(ui->pushButtonMarkNone, SIGNAL(clicked()),
	        this, SLOT(unmarkAll()));

	connect(ui->pushButtonSendQuery, SIGNAL(clicked()),
	        this, SLOT(sendQuery()));
	connect(ui->lineEditQuery, SIGNAL(returnPressed()),
		this, SLOT(sendQuery()));
	connect(ui->pushButtonAbortQuery, SIGNAL(clicked()),
	        this, SLOT(abortQuery()));
	connect(ui->lineEditQuery, SIGNAL(textEdited(QString)),
	        this, SLOT(resetNotFound()));
	//connect(ui->lineEditQuery, SIGNAL(editingFinished()), this, SLOT(sendQuery()));
	connect(countdownTimer, SIGNAL(timeout()), this, SLOT(updateCountdown()));

	QSortFilterProxyModel * filterProxyModel = new QSortFilterProxyModel(this);
	filterProxyModel->setSourceModel(candidateObjectsModel);
	filterProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
	ui->listViewObjects->setModel(filterProxyModel);
	connect(ui->lineEditSearch, SIGNAL(textChanged(const QString&)),
	        filterProxyModel, SLOT(setFilterFixedString(const QString&)));

	loadBookmarks();
	updateTexts();

	resetCountdown();
	resetDialog();
}
Пример #6
0
void ScriptConsole::createDialogContent()
{
	ui->setupUi(dialog);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));

	highlighter = new StelScriptSyntaxHighlighter(ui->scriptEdit->document());
	ui->includeEdit->setText(StelFileMgr::getInstallationDir() + "/scripts");

	ui->quickrunCombo->addItem(q_("quickrun..."));
	ui->quickrunCombo->addItem(q_("selected text"));
	ui->quickrunCombo->addItem(q_("clear text"));
	ui->quickrunCombo->addItem(q_("clear images"));
	ui->quickrunCombo->addItem(q_("natural"));
	ui->quickrunCombo->addItem(q_("starchart"));

	connect(ui->scriptEdit, SIGNAL(cursorPositionChanged()), this, SLOT(rowColumnChanged()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));
	connect(ui->loadButton, SIGNAL(clicked()), this, SLOT(loadScript()));
	connect(ui->saveButton, SIGNAL(clicked()), this, SLOT(saveScript()));
	connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearButtonPressed()));
	connect(ui->preprocessSSCButton, SIGNAL(clicked()), this, SLOT(preprocessScript()));
	connect(ui->runButton, SIGNAL(clicked()), this, SLOT(runScript()));
	connect(ui->stopButton, SIGNAL(clicked()), &StelApp::getInstance().getScriptMgr(), SLOT(stopScript()));
	connect(ui->includeBrowseButton, SIGNAL(clicked()), this, SLOT(includeBrowse()));
	connect(ui->quickrunCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(quickRun(int)));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptRunning()), this, SLOT(scriptStarted()));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptStopped()), this, SLOT(scriptEnded()));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptDebug(const QString&)), this, SLOT(appendLogLine(const QString&)));
	connect(&StelApp::getInstance().getScriptMgr(), SIGNAL(scriptOutput(const QString&)), this, SLOT(appendOutputLine(const QString&)));
	ui->tabs->setCurrentIndex(0);
	ui->scriptEdit->setFocus();
}
Пример #7
0
App::App(QObject *parent) :
    QObject(parent)
{
    Controller *controller = new Controller(this);
    MainWindow *mw = new MainWindow(0);
    mw->hide();

    if (!controller->initAR()) {
        mw->error(tr("Unable to find any usable cameras. "
                  "Check if they are connected"), tr("Camera error"));
        QApplication::quit();
    }

    mw->showFullScreen();
    connect(controller, SIGNAL(setStatus(IplImage*,IplImage*,QList<Model3D*>*)),
            mw, SLOT(setStatus(IplImage*,IplImage*,QList<Model3D*>*)));
    connect(controller, SIGNAL(refresh(int,int)),
            mw, SLOT(refreshValues(int,int)));

    connect(mw, SIGNAL(languageChanged(QLocale::Language)),
            controller, SLOT(setLanguage(QLocale::Language)));
    connect(mw, SIGNAL(nextCamera()),
            controller, SLOT(nextCamera()));
    connect(mw, SIGNAL(toggleDebug()),
            controller, SLOT(toggleDebug()));

}
Пример #8
0
// read from stream
void NebulaMgr::init()
{
	// TODO: mechanism to specify which sets get loaded at start time.
	// candidate methods:
	// 1. config file option (list of sets to load at startup)
	// 2. load all
	// 3. flag in nebula_textures.fab (yuk)
	// 4. info.ini file in each set containing a "load at startup" item
	// For now (0.9.0), just load the default set
	loadNebulaSet("default");

	QSettings* conf = StelApp::getInstance().getSettings();
	Q_ASSERT(conf);

	nebulaFont.setPixelSize(StelApp::getInstance().getSettings()->value("gui/base_font_size", 13).toInt());
	Nebula::texCircle = StelApp::getInstance().getTextureManager().createTexture("textures/neb.png");   // Load circle texture
	Nebula::texOpenCluster = StelApp::getInstance().getTextureManager().createTexture("textures/ocl.png");   // Load open clister marker texture
	Nebula::texGlobularCluster = StelApp::getInstance().getTextureManager().createTexture("textures/gcl.png");   // Load globular clister marker texture
	Nebula::texPlanetNebula = StelApp::getInstance().getTextureManager().createTexture("textures/pnb.png");   // Load planetary nebula marker texture
	texPointer = StelApp::getInstance().getTextureManager().createTexture("textures/pointeur5.png");   // Load pointer texture

	setFlagShow(conf->value("astro/flag_nebula",true).toBool());
	setFlagHints(conf->value("astro/flag_nebula_name",false).toBool());
	setHintsAmount(conf->value("astro/nebula_hints_amount", 3).toFloat());
	setLabelsAmount(conf->value("astro/nebula_labels_amount", 3).toFloat());
	setCircleScale(conf->value("astro/nebula_scale",1.0f).toFloat());	

	updateI18n();
	
	StelApp *app = &StelApp::getInstance();
	connect(app, SIGNAL(languageChanged()), this, SLOT(updateI18n()));
	connect(app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(setStelStyle(const QString&)));
	GETSTELMODULE(StelObjectMgr)->registerStelObjectMgr(this);
}
Пример #9
0
void AngleMeasureDialog::createDialogContent()
{
	am = GETSTELMODULE(AngleMeasure);
	ui->setupUi(dialog);

	// Kinetic scrolling
	kineticScrollingList << ui->aboutTextBrowser;
	StelGui* gui= static_cast<StelGui*>(StelApp::getInstance().getGui());
	enableKineticScrolling(gui->getFlagUseKineticScrolling());
	connect(gui, SIGNAL(flagUseKineticScrollingChanged(bool)), this, SLOT(enableKineticScrolling(bool)));

	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

	ui->useDmsFormatCheckBox->setChecked(am->isDmsFormat());
	connect(ui->useDmsFormatCheckBox, SIGNAL(toggled(bool)), am, SLOT(useDmsFormat(bool)));
	ui->showPositionAngleCheckBox->setChecked(am->isPaDisplayed());
	connect(ui->showPositionAngleCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngle(bool)));
	ui->showPositionAngleHorizontalCheckBox->setChecked(am->isHorPaDisplayed());
	connect(ui->showPositionAngleHorizontalCheckBox, SIGNAL(toggled(bool)), am, SLOT(showPositionAngleHor(bool)));
	ui->showEquatorial_GroupBox->setChecked(am->isEquatorial());
	connect(ui->showEquatorial_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showEquatorial(bool)));
	ui->showHorizontal_GroupBox->setChecked(am->isHorizontal());
	connect(ui->showHorizontal_GroupBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontal(bool)));
	ui->azAltStartOnSkyCheckBox->setChecked(am->isHorizontalStartSkylinked());
	connect(ui->azAltStartOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalStartSkylinked(bool)));
	ui->azAltEndOnSkyCheckBox->setChecked(am->isHorizontalEndSkylinked());
	connect(ui->azAltEndOnSkyCheckBox, SIGNAL(toggled(bool)), am, SLOT(showHorizontalEndSkylinked(bool)));

	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(resetAngleMeasureSettings()));

	setAboutHtml();
}
Пример #10
0
//VOXOX CHANGE by Rolando - 2009.10.23 
QtUMItemManager::QtUMItemManager(CWengoPhone & cWengoPhone, QtUMItemList & qtUMItemList, QObject * parent, QTreeWidget * target)
: QObject(parent),
	_qtUMItemList(qtUMItemList),
	_cWengoPhone(cWengoPhone)
{

	LANGUAGE_CHANGE(this);
	languageChanged();

	_tree		= dynamic_cast<QtUMTreeWidget*>(target);
	_sortItems = true;

	_sortTimerId = -1;
	_showTimerId = -1;
	_canSort	= true;
	_wantSort	= false;
	_canShow	= true;
	_wantShow	= false;
	_initialLoad = false;	//VOXOX - JRT - 2009.04.07 

	SAFE_CONNECT(_tree, SIGNAL(closeCurrentItem(QtUMItem *)), SLOT(closeCurrentItemSlot(QtUMItem *)));//VOXOX CHANGE by Rolando - 2009.08.28 
	SAFE_CONNECT(_tree, SIGNAL(closeCurrentGroup(QtUMGroup *)), SLOT(closeCurrentGroupSlot(QtUMGroup *)));
	SAFE_CONNECT(_tree, SIGNAL(itemLeftClicked( QTreeWidgetItem*, int)), SLOT(itemClickedSlot( QTreeWidgetItem*, int)));//VOXOX CHANGE by Rolando - 2009.08.28 
	SAFE_CONNECT(_tree, SIGNAL(groupLeftClicked( QTreeWidgetItem*, int)), SLOT(groupClickedSlot( QTreeWidgetItem*, int)));//VOXOX CHANGE by Rolando - 2009.08.28 

}
Пример #11
0
void  LanguageSettingsObjectWrapper::setLanguage(const QString& value)
{
	QSettings s;
	s.setValue("UiLanguage", value);
	prefs.locale.language = copy_string(qPrintable(value));
	emit languageChanged(value);
}
Пример #12
0
void EditorSession::setLanguage(Language *language)
{
    if (m_language == language) {
        return;
    }
    m_language = language;
    if (m_skeletonMode) {
        bool found = false;
        if (m_skeleton) {
            int resources = m_resourceManager->courseResources(m_language).count();
            for (int i=0; i < resources; ++i) {
                Course * course = m_resourceManager->course(m_language, i);
                if (course->foreignId() == m_skeleton->id()) {
                    setCourse(course);
                    found = true;
                    break;
                }
            }
        }
        if (!found) {
            setCourse(nullptr);
        }
    }
    else { // not skeleton mode
        if (m_resourceManager->courseResources(m_language).count() > 0) {
            setCourse(m_resourceManager->course(m_language, 0));
        }
    }
    emit languageChanged();
}
Пример #13
0
void XYVirtualKeyboard::switchLanguage()
{
    XYPushButton::chinese = !XYPushButton::chinese;
    languageChanged();
    switchLanguageBtn->update();
    clear_history();
}
void DynamicPluginTemplateWindow::createDialogContent()
{
	ui->setupUi(dialog);

	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
}
Пример #15
0
void GridLinesMgr::init()
{
	QSettings* conf = StelApp::getInstance().getSettings();
	Q_ASSERT(conf);

	setFlagAzimuthalGrid(conf->value("viewing/flag_azimuthal_grid").toBool());
	setFlagEquatorGrid(conf->value("viewing/flag_equatorial_grid").toBool());
	setFlagEquatorJ2000Grid(conf->value("viewing/flag_equatorial_J2000_grid").toBool());
	setFlagEclipticJ2000Grid(conf->value("viewing/flag_ecliptic_J2000_grid").toBool());
	setFlagGalacticGrid(conf->value("viewing/flag_galactic_grid").toBool());
	setFlagEquatorLine(conf->value("viewing/flag_equator_line").toBool());
	setFlagEclipticLine(conf->value("viewing/flag_ecliptic_line").toBool());
	setFlagMeridianLine(conf->value("viewing/flag_meridian_line").toBool());
	setFlagHorizonLine(conf->value("viewing/flag_horizon_line").toBool());
	setFlagGalacticEquatorLine(conf->value("viewing/flag_galactic_equator_line").toBool());
	
	StelApp& app = StelApp::getInstance();
	connect(&app, SIGNAL(colorSchemeChanged(const QString&)), this, SLOT(setStelStyle(const QString&)));
	connect(&app, SIGNAL(languageChanged()), this, SLOT(updateLineLabels()));
	
	QString displayGroup = N_("Display Options");
	addAction("actionShow_Equatorial_Grid", displayGroup, N_("Equatorial grid"), "equatorGridDisplayed", "E");
	addAction("actionShow_Azimuthal_Grid", displayGroup, N_("Azimuthal grid"), "azimuthalGridDisplayed", "Z");
	addAction("actionShow_Ecliptic_Line", displayGroup, N_("Ecliptic line"), "eclipticLineDisplayed", ",");
	addAction("actionShow_Equator_Line", displayGroup, N_("Equator line"), "equatorLineDisplayed", ".");
	addAction("actionShow_Meridian_Line", displayGroup, N_("Meridian line"), "meridianLineDisplayed", ";");
	addAction("actionShow_Horizon_Line", displayGroup, N_("Horizon line"), "horizonLineDisplayed", "H");
	addAction("actionShow_Equatorial_J2000_Grid", displayGroup, N_("Equatorial J2000 grid"), "equatorJ2000GridDisplayed");
	addAction("actionShow_Ecliptic_J2000_Grid", displayGroup, N_("Ecliptic J2000 grid"), "eclipticJ2000GridDisplayed");
	addAction("actionShow_Galactic_Grid", displayGroup, N_("Galactic grid"), "galacticGridDisplayed");
	addAction("actionShow_Galactic_Equator_Line", displayGroup, N_("Galactic equator"), "galacticEquatorLineDisplayed");
}
// Initialize the dialog widgets and connect the signals/slots
void TelescopeConfigurationDialog::createDialogContent()
{
	ui->setupUi(dialog);
	
	//Inherited connect
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(buttonDiscardPressed()));
	connect(dialog, SIGNAL(rejected()), this, SLOT(buttonDiscardPressed()));
	
	//Connect: sender, signal, receiver, member
	connect(ui->radioButtonTelescopeLocal, SIGNAL(toggled(bool)), this, SLOT(toggleTypeLocal(bool)));
	connect(ui->radioButtonTelescopeConnection, SIGNAL(toggled(bool)), this, SLOT(toggleTypeConnection(bool)));
	connect(ui->radioButtonTelescopeVirtual, SIGNAL(toggled(bool)), this, SLOT(toggleTypeVirtual(bool)));
	
	connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(buttonSavePressed()));
	connect(ui->pushButtonDiscard, SIGNAL(clicked()), this, SLOT(buttonDiscardPressed()));
	
	connect(ui->comboBoxDeviceModel, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(deviceModelSelected(const QString&)));
	
	//Setting validators
	ui->lineEditTelescopeName->setValidator(telescopeNameValidator);
	ui->lineEditHostName->setValidator(hostNameValidator);
	ui->lineEditCircleList->setValidator(circleListValidator);
	ui->lineEditSerialPort->setValidator(serialPortValidator);
}
Пример #17
0
bool Translator::loadLanguage(QString &localeString ){
    if (localeString == "C")
        localeString = "en";

    bool isDefault = localeString.left(2) == "en";

    if ( !isDefault ){
        if (!d->qtTranslator.load("qt_" + localeString , QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ) )
            qDebug ( qPrintable(QString("Translator::Can not load Qt Translations for locale %s" ).arg( localeString ) ) );
        else qApp->installTranslator( &d->qtTranslator );
    } else qApp->removeTranslator( &d->qtTranslator );
    bool loaded = false;
    if ( !isDefault )
        loaded = d->appTranslator.load(QString::fromUtf8(":/translations/zmviewer_") +  localeString );
    else loaded = true;
    if ( loaded ){
        if ( !isDefault )
            qApp->installTranslator(&d->appTranslator);
        else qApp->removeTranslator(&d->appTranslator);
        d->userLocale = localeString;
        emit( languageChanged( localeString ) );
    }
    return loaded;

}
Пример #18
0
// Initialize the dialog widgets and connect the signals/slots
void ObservabilityDialog::createDialogContent()
{
	ui->setupUi(dialog);
	ui->tabs->setCurrentIndex(0);
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));

	// Settings:
	connect(ui->Today, SIGNAL(stateChanged(int)), this, SLOT(setTodayFlag(int)));
	connect(ui->AcroCos, SIGNAL(stateChanged(int)), this, SLOT(setAcroCosFlag(int)));
	connect(ui->Opposition, SIGNAL(stateChanged(int)), this, SLOT(setOppositionFlag(int)));
	connect(ui->Goods, SIGNAL(stateChanged(int)), this, SLOT(setGoodDatesFlag(int)));
	connect(ui->FullMoon, SIGNAL(stateChanged(int)), this, SLOT(setFullMoonFlag(int)));
//	connect(ui->Crescent, SIGNAL(stateChanged(int)), this, SLOT(setCrescentMoonFlag(int)));
//	connect(ui->SuperMoon, SIGNAL(stateChanged(int)), this, SLOT(setSuperMoonFlag(int)));

	connect(ui->Red, SIGNAL(sliderMoved(int)), this, SLOT(setRed(int)));
	connect(ui->Green, SIGNAL(sliderMoved(int)), this, SLOT(setGreen(int)));
	connect(ui->Blue, SIGNAL(sliderMoved(int)), this, SLOT(setBlue(int)));
	connect(ui->fontSize, SIGNAL(sliderMoved(int)), this, SLOT(setSize(int)));
	connect(ui->SunAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setAltitude(int)));
	connect(ui->HorizAltitude, SIGNAL(sliderMoved(int)), this, SLOT(setHorizon(int)));

	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->restoreDefaultsButton, SIGNAL(clicked()), this, SLOT(restoreDefaults()));
	connect(ui->saveSettingsButton, SIGNAL(clicked()), this, SLOT(saveSettings()));

	// About tab
	setAboutHtml();
	StelGui* gui = dynamic_cast<StelGui*>(StelApp::getInstance().getGui());
	Q_ASSERT(gui);
	ui->aboutTextBrowser->document()->setDefaultStyleSheet(QString(gui->getStelStyle().htmlStyleSheet));

	updateGuiFromSettings();

}
Пример #19
0
void BOperationProgressDialogPrivate::init()
{
    B_Q(BOperationProgressDialog);
    q->setStretchEnabled(true);
    proxy = new BSignalDelayProxy(250, 500);
    connect(proxy, SIGNAL(triggered()), this, SLOT(update()));
    canCancel = true;
    autoCloseInterval = -1;
    if (Operation) {
        connect(Operation, SIGNAL(finished()), this, SLOT(update()));
        connect(Operation, SIGNAL(error()), this, SLOT(update()));
        connect(Operation, SIGNAL(uploadProgress(qint64, qint64)), proxy, SLOT(trigger()));
        connect(Operation, SIGNAL(downloadProgress(qint64, qint64)), proxy, SLOT(trigger()));
    }
    QWidget *wgt = new QWidget;
      QVBoxLayout *vlt = new QVBoxLayout(wgt);
        lbl = new QLabel;
        vlt->addWidget(lbl);
        pbar = new QProgressBar;
          pbar->setMinimum(0);
        vlt->addWidget(pbar);
    q->setWidget(wgt);
    btn = q->addButton(" ", QDialogButtonBox::RejectRole, this, SLOT(btnClicked()));
    connect(bApp, SIGNAL(languageChanged()), this, SLOT(update()));
    update();
}
Пример #20
0
void FOVWindow::createDialogContent()
{
	fov = GETSTELMODULE(FOV);
	ui->setupUi(dialog);

	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

	populateFOV();

	connect(ui->doubleSpinBoxFOV0, SIGNAL(valueChanged(double)), this, SLOT(updateFOV0(double)));
	connect(ui->doubleSpinBoxFOV1, SIGNAL(valueChanged(double)), this, SLOT(updateFOV1(double)));
	connect(ui->doubleSpinBoxFOV2, SIGNAL(valueChanged(double)), this, SLOT(updateFOV2(double)));
	connect(ui->doubleSpinBoxFOV3, SIGNAL(valueChanged(double)), this, SLOT(updateFOV3(double)));
	connect(ui->doubleSpinBoxFOV4, SIGNAL(valueChanged(double)), this, SLOT(updateFOV4(double)));
	connect(ui->doubleSpinBoxFOV5, SIGNAL(valueChanged(double)), this, SLOT(updateFOV5(double)));
	connect(ui->doubleSpinBoxFOV6, SIGNAL(valueChanged(double)), this, SLOT(updateFOV6(double)));
	connect(ui->doubleSpinBoxFOV7, SIGNAL(valueChanged(double)), this, SLOT(updateFOV7(double)));
	connect(ui->doubleSpinBoxFOV8, SIGNAL(valueChanged(double)), this, SLOT(updateFOV8(double)));
	connect(ui->doubleSpinBoxFOV9, SIGNAL(valueChanged(double)), this, SLOT(updateFOV9(double)));

	connect(ui->pushButtonSave, SIGNAL(clicked()), this, SLOT(saveFOVSettings()));
	connect(ui->pushButtonReset, SIGNAL(clicked()), this, SLOT(resetFOVSettings()));

	updateAboutText();	
}
void SolarSystemEditor::init()
{
	//Get a list of the "default" Solar System objects' names:
	//TODO: Use it as validation for the loading of the plug-in
	if (QFile::exists(defaultSolarSystemFilePath))
	{
		defaultSsoIdentifiers = listAllLoadedObjectsInFile(defaultSolarSystemFilePath);
	}
	else
	{
		//TODO: Better error message
		qDebug() << "Something is horribly wrong:" << QDir::toNativeSeparators(StelFileMgr::getInstallationDir());
		return;
	}

	try
	{
		//Make sure that a user ssystem.ini actually exists
		if (!cloneSolarSystemConfigurationFile())
			return;

		mainWindow = new SolarSystemManagerWindow();
	}
	catch (std::runtime_error &e)
	{
		qWarning() << "init() error: " << e.what();
		return;
	}

	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(updateI18n()));
	isInitialized = true;
}
Пример #22
0
void BOpenSaveEditorModulePrivate::init()
{
    actNewFile = new QAction(this);
      actNewFile->setIcon(BApplication::icon("filenew"));
      actNewFile->setShortcut(QKeySequence::New);
    actOpenFiles = new QAction(this);
      actOpenFiles->setIcon(BApplication::icon("fileopen"));
      actOpenFiles->setShortcut(QKeySequence::Open);
    actReopenFile = new QAction(this);
      actReopenFile->setIcon(BApplication::icon("reload"));
      BTextCodecMenu *mnu = new BTextCodecMenu(BTextCodecMenu::StructuredStyle);
      mnu->setMapping(this, SLOT(codecTriggered(QString)));
      actReopenFile->setMenu(mnu);
    actSaveFile = new QAction(this);
      actSaveFile->setIcon(BApplication::icon("filesave"));
      actSaveFile->setShortcut(QKeySequence::Save);
    actSaveFileAs = new QAction(this);
      actSaveFileAs->setIcon(BApplication::icon("filesaveas"));
    actSaveAllFiles = new QAction(this);
      actSaveAllFiles->setIcon(BApplication::icon("save_all"));
      actSaveAllFiles->setShortcut(QKeySequence("Ctrl+Shift+S"));
    actCloseFile = new QAction(this);
      actCloseFile->setIcon(BApplication::icon("fileclose"));
      actCloseFile->setShortcut(QKeySequence::Close);
    actCloseAllFiles = new QAction(this);
      actCloseAllFiles->setIcon(BApplication::icon("fileclose"));
    mnuFileHistory = new QMenu;
      mnuFileHistory->setIcon(BApplication::icon("history"));
    //
    checkActions();
    retranslateUi();
    connect(bApp, SIGNAL(languageChanged()), this, SLOT(retranslateUi()));
}
Пример #23
0
void BookmarksDialog::createDialogContent()
{
	ui->setupUi(dialog);
	
	//Signals and slots
	connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
	connect(ui->closeStelWindow, SIGNAL(clicked()), this, SLOT(close()));
	connect(ui->TitleBar, SIGNAL(movedTo(QPoint)), this, SLOT(handleMovedTo(QPoint)));

	connect(ui->addBookmarkButton, SIGNAL(clicked()), this, SLOT(addBookmarkButtonPressed()));
	connect(ui->removeBookmarkButton, SIGNAL(clicked()), this, SLOT(removeBookmarkButtonPressed()));
	connect(ui->goToButton, SIGNAL(clicked()), this, SLOT(goToBookmarkButtonPressed()));
	connect(ui->clearBookmarksButton, SIGNAL(clicked()), this, SLOT(clearBookmarksButtonPressed()));
	connect(ui->bookmarksTreeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(selectCurrentBookmark(QModelIndex)));

	connect(ui->clearHighlightsButton, SIGNAL(clicked()), this, SLOT(clearHighlightsButtonPressed()));
	connect(ui->highlightBookmarksButton, SIGNAL(clicked()), this, SLOT(highlightBookrmarksButtonPressed()));

	connect(ui->importBookmarksButton, SIGNAL(clicked()), this, SLOT(importBookmarks()));
	connect(ui->exportBookmarksButton, SIGNAL(clicked()), this, SLOT(exportBookmarks()));

	//Initializing the list of bookmarks
	bookmarksListModel->setColumnCount(ColumnCount);
	setBookmarksHeaderNames();

	ui->bookmarksTreeView->setModel(bookmarksListModel);
	ui->bookmarksTreeView->header()->setSectionsMovable(false);
	ui->bookmarksTreeView->header()->setSectionResizeMode(ColumnName, QHeaderView::ResizeToContents);
	ui->bookmarksTreeView->header()->setStretchLastSection(true);
	ui->bookmarksTreeView->hideColumn(ColumnUUID);

	loadBookmarks();
}
Пример #24
0
FeeCalculator::FeeCalculator()
	: QDialog()
{
	buyPaidLocked=false;
	buyBtcLocked=true;
	buyBtcReceivedLocked=false;
	ui.setupUi(this);
	setAttribute(Qt::WA_DeleteOnClose,true);
	setWindowFlags(Qt::WindowCloseButtonHint);
	Q_FOREACH(QDoubleSpinBox* spinBox, findChildren<QDoubleSpinBox*>())new JulySpinBoxFix(spinBox);

	mainWindow.fillAllBtcLabels(this,baseValues.currentPair.currAStr);
	mainWindow.fillAllUsdLabels(this,baseValues.currentPair.currBStr);
	mainWindow.fixDecimals(this);

	ui.feeValue->setValue(mainWindow.ui.accountFee->value());

    ui.buyPrice->setValue(IndicatorEngine::getValue(baseValues.exchangeName+'_'+baseValues.currentPair.symbol+"_Sell"));
	double btcVal=mainWindow.getAvailableUSD()/ui.buyPrice->value();
	if(btcVal<baseValues.currentPair.tradeVolumeMin)btcVal=baseValues.currentPair.tradeVolumeMin;
	ui.buyTotalBtc->setValue(btcVal);

	ui.buyBtcLayout->addWidget(new JulySpinBoxPicker(ui.buyTotalBtc));
	ui.buyPriceLayout->addWidget(new JulySpinBoxPicker(ui.buyPrice));
	ui.sellPriceLayout->addWidget(new JulySpinBoxPicker(ui.sellPrice));
	ui.feeLayout->addWidget(new JulySpinBoxPicker(ui.feeValue));
	ui.totalPaidLayout->addWidget(new JulySpinBoxPicker(ui.totalPaid));
	ui.receivedLayout->addWidget(new JulySpinBoxPicker(ui.btcReceived));

	buyBtcLocked=false;
	buyBtcChanged(ui.buyTotalBtc->value());
	setZeroProfitPrice();
	buyBtcChanged(ui.buyTotalBtc->value());//I'll remove this soon
	setZeroProfitPrice();//and this too

	ui.singleInstance->setChecked(mainWindow.feeCalculatorSingleInstance);

	julyTranslator.translateUi(this);

	languageChanged();
	connect(&julyTranslator,SIGNAL(languageChanged()),this,SLOT(languageChanged()));

	ui.groupBox->setStyleSheet("QGroupBox {background: rgba(255,255,255,60); border: 1px solid "+baseValues.appTheme.gray.name()+";border-radius: 3px;margin-top: 7px;}");

	if(mainWindow.ui.widgetStaysOnTop->isChecked())ui.widgetStaysOnTop->setChecked(true);
	else setStaysOnTop(false);
}
Пример #25
0
PluginManager::PluginManager(Core *core):
    QObject(core),
    m_core(core),
    m_pluginCore(0)
{
    connect(this, SIGNAL(allLoaded()), SLOT(updateLanguages()));
    connect(m_core, SIGNAL(languageChanged()), SLOT(updateLanguages()));
}
Пример #26
0
void Translator::removeTranslation()
{
    QSettings settings;
    settings.setValue("language", "DEFAULT");
    m_app->removeTranslator(&mQtTranslator);
    mLanguage = DefaultLanguage;
    emit languageChanged();
}
Пример #27
0
void OptionsDialog::setLanguage(int arg)
{
    if (m_language == arg)
        return;

    m_language = arg;
    emit languageChanged(arg);
}
Пример #28
0
	void ModifierConfigWidget::changeEvent(QEvent *event) {
		if (event->type() == QEvent::LanguageChange) {
			languageChanging = true;
			languageChanged();
			languageChanging = false;
		} else
			QWidget::changeEvent(event);
	}
Пример #29
0
MisliDesktopGui::MisliDesktopGui(int argc, char *argv[]) :
    QApplication(argc,argv)
{
    QWidget dummyWidget; //so I can use the static functions below
    misliWindow = NULL;
    translator = NULL;
    clearSettingsOnExit = false;

    int user_reply;

    //Set some creditentials
    setQuitOnLastWindowClosed(false);
    setOrganizationName("p10"); //this is needed for proper settings access in windows
    setApplicationName("misli");
    setApplicationVersion("2.0.0");

    //Construct the splash screen
    splash = new QSplashScreen(QPixmap(":/img/icon.png"));
    splash->show();

    //Init the settings
    settings = new QSettings;

    //Check if there's a series of failed starts and suggest clearing the settings
    if(failedStarts()>=2){
        user_reply = QMessageBox::question(&dummyWidget,tr("Warning"),tr("There have been two unsuccessful starts of the program. Clearing the program settings will probably solve the issue . Persistent program crashes are mostly caused by corrupted notefiles , so you can try to manually narrow out the problematic notefile (remove the notefiles from the work directories one by one). The last one edited is probably the problem (you can try to correct it manually with a text editor to avoid loss of data).\n Do you want to clear the settings?"));

        if(user_reply==QMessageBox::Ok){ //if the user pressed Ok
            settings->clear();
            settings->sync();
            exit(0);
        }
    }
    //Assume we won't start successfully , if we do - the value gets -1-ed on close
    setFailedStarts(failedStarts()+1);

    if(firstProgramStart()){
        QString newLanguage = QInputDialog::getItem(&dummyWidget,tr("Set the language"),tr("Language:/Език:"),QStringList()<<"English"<<"Български",0,false);
        if(newLanguage=="English") setLanguage("en");
        if(newLanguage=="Български") setLanguage("bg");
    }

    updateTranslator();

    //Construct the misli instance class
    misliInstance = new MisliInstance(false);

    //Connections
    connect(this,SIGNAL(languageChanged(QString)),this,SLOT(updateTranslator()));
    connect(this,SIGNAL(aboutToQuit()),this,SLOT(stuffToDoBeforeQuitting()));

    //Start worker thread as soon as the main loop starts (so that we first show the splash screen and then start work)
    workerThread.start();
    misliInstance->loadStoredDirs();
    misliWindow = new MisliWindow(this);
    splash->finish(misliWindow);
    misliWindow->showMaximized();
}
Пример #30
0
void LanguageChangeNotifier::changeEvent (QEvent *event)
{
	if (event->type () == QEvent::LanguageChange)
	{
		emit languageChanged ();
	}
	else
		QWidget::changeEvent (event);
}