コード例 #1
0
ファイル: kxneur.cpp プロジェクト: voidptr/xneur-option
KXNeurApp::KXNeurApp()
 : KUniqueApplication()
{
    xnkb = KXNKeyboard::self();
    trayicon = new KXNeurTray();
    setMainWidget( trayicon );
    trayicon->show();

    xneur_pid = 0;
    xnconf = NULL;
    cur_lang = -1;
    prev_lang = -1;
    if ( KXNeurSettings::self()->RunXNeur() )
	xneur_start(); // TODO: проверить старт
    else {
	trayicon->run->setText(i18n("Start xneur daemon"));
	trayicon->run->setIcon("fork");
	trayicon->mode->setEnabled(false);
	xnconf_reload();
    }
    cur_lang = xnkb->getGroupNo();
    refreshLang();
    trayicon->setPixmap(langs[cur_lang]->pic);

    QObject::connect(xnkb, SIGNAL(groupChanged(int)), this, SLOT(groupChange(int)));
    QObject::connect(xnkb, SIGNAL(layoutChanged()), this, SLOT(refreshLang()));
    QObject::connect(trayicon, SIGNAL(clicked()), this, SLOT(setNextLang()));
    QObject::connect(trayicon, SIGNAL(quitSelected()), this, SLOT(slotExit()));
}
コード例 #2
0
ファイル: kxneur.cpp プロジェクト: voidptr/xneur-option
KXNeurApp::KXNeurApp()
 : KUniqueApplication()
// : KApplication()
{
    KGlobal::dirs()->addResourceDir("appdata", ".");
    all_langs = new KConfig("langs", true, true, "appdata");
    all_langs->setGroup("Languages");

    xnkb = KXNKeyboard::self();
    trayicon = new KXNeurTray();
    setMainWidget( trayicon );
    trayicon->show();

    xneur_pid = 0;
    xnconf = NULL;
    cur_lang = -1;
    prev_lang = -1;
    if ( !(KXNeurSettings::self()->RunXNeur() && xneur_start()) ) {
//	printf("start -- ok\n");
//    else {
	trayicon->run->setText(i18n("Start xneur daemon"));
	trayicon->run->setIcon("fork");
	trayicon->mode->setEnabled(false);
	xnconf_reload();
    }
    cur_lang = xnkb->getGroupNo();
    refreshLang();
    trayicon->setPixmap(langs[cur_lang]->pic);

    QObject::connect(xnkb, SIGNAL(groupChanged(int)), this, SLOT(groupChange(int)));
    QObject::connect(xnkb, SIGNAL(layoutChanged()), this, SLOT(refreshLang()));
    QObject::connect(trayicon, SIGNAL(clicked()), this, SLOT(setNextLang()));
    QObject::connect(trayicon, SIGNAL(quitSelected()), this, SLOT(slotExit()));
}
コード例 #3
0
ファイル: settings_widget.cpp プロジェクト: absalan/tdesktop
Widget::Widget(QWidget *parent) {
	refreshLang();
	subscribe(Lang::Current().updated(), [this] { refreshLang(); });

	_inner = setInnerWidget(object_ptr<InnerWidget>(this));
	setCloseClickHandler([]() {
		Ui::hideSettingsAndLayer();
	});
}
コード例 #4
0
ファイル: kxneur.cpp プロジェクト: voidptr/xneur-option
void KXNeurApp::slotPref()
{
    KXNeurConf dlg(this);
    dlg.exec();
    refreshLang();
    trayicon->setPixmap(langs[cur_lang]->pic);
}
コード例 #5
0
ファイル: abstract_box.cpp プロジェクト: Emadpres/tdesktop
AbstractBox::AbstractBox(not_null<Window::LayerStackWidget*> layer, object_ptr<BoxContent> content)
: LayerWidget(layer)
, _layer(layer)
, _content(std::move(content)) {
	subscribe(Lang::Current().updated(), [this] { refreshLang(); });
	_content->setParent(this);
	_content->setDelegate(this);
}
コード例 #6
0
ファイル: kxneur.cpp プロジェクト: voidptr/xneur-option
void KXNeurApp::slotPref()
{
    KXNeurConf dlg(this);

    // bool st = xneur_stop();
    dlg.exec();
    /*if ( st )
	xneur_start();
    else
	printf("without restart\n");*/

    refreshLang();
    trayicon->setPixmap(langs[cur_lang]->pic);
}
コード例 #7
0
ファイル: introcode.cpp プロジェクト: JuanPotato/tdesktop
CodeWidget::CodeWidget(QWidget *parent, Widget::Data *data) : Step(parent, data)
, _noTelegramCode(this, lang(lng_code_no_telegram), st::introLink)
, _code(this, st::introCode, langFactory(lng_code_ph))
, _callTimer(this)
, _callStatus(getData()->callStatus)
, _callTimeout(getData()->callTimeout)
, _callLabel(this, st::introDescription)
, _checkRequest(this) {
	subscribe(Lang::Current().updated(), [this] { refreshLang(); });

	connect(_code, SIGNAL(changed()), this, SLOT(onInputChange()));
	connect(_callTimer, SIGNAL(timeout()), this, SLOT(onSendCall()));
	connect(_checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
	connect(_noTelegramCode, SIGNAL(clicked()), this, SLOT(onNoTelegramCode()));

	_code->setDigitsCountMax(getData()->codeLength);
	setErrorBelowLink(true);

	setTitleText([text = App::formatPhone(getData()->phone)] { return text; });
	updateDescText();
}