~vcs-imports/xneur/kxneur-dev

« back to all changes in this revision

Viewing changes to src/kxneurconf.cpp

  • Committer: crew
  • Date: 2008-12-02 20:42:03 UTC
  • Revision ID: svn-v4:8587809b-efde-dc11-b4c0-001320bd50b9:kxneur:263
kxneur приведен к текущему состоянию xneur, за исключением 
сохранения пользовательских действий.

Show diffs side-by-side

added added

removed removed

Lines of Context:
448
448
 
449
449
    enable_osd = new QCheckBox(i18n("Enable OSD on XNeur actions"), this);
450
450
    vlayout->addWidget(enable_osd);
 
451
 
 
452
    hlayout = new QHBoxLayout(vlayout);
 
453
    QLabel *label = new QLabel(i18n("OSD Font "), this);
 
454
    hlayout->addWidget(label);
451
455
    osd_font = new QLineEdit(i18n("Use this font for OSD"), this);
452
 
    vlayout->addWidget(osd_font);
 
456
    hlayout->addWidget(osd_font);
 
457
 
 
458
    label = new QLabel(i18n("Use command \"xfontsel -print\" to get new font."), this);
 
459
    vlayout->addWidget(label);
453
460
 
454
461
    grid = new QGrid(2, this);
455
462
    grid->setSpacing(2);
661
668
    keys->insert("Enable Secondary Layout ",     i18n("Enable Secondary Layout "),     QString::null, KeyFromXNConf(7), 0, this, NULL);
662
669
    keys->insert("Enable Thrid Layout ",         i18n("Enable Thrid Layout "),         QString::null, KeyFromXNConf(8), 0, this, NULL);
663
670
    keys->insert("Enable Fourth Layout ",        i18n("Enable Fourth Layout "),        QString::null, KeyFromXNConf(9), 0, this, NULL);
664
 
    // keys->insert("Replace Abbreviation ",        i18n("Replace Abbreviation "),        QString::null, KeyFromXNConf(10), 0, this, NULL);
 
671
    keys->insert("Replace Abbreviation ",        i18n("Replace Abbreviation "),        QString::null, KeyFromXNConf(10), 0, this, NULL);
665
672
 
666
673
    keys_page->keyChooser = new KKeyChooser(keys, keys_page);
667
674
    keys_page->vlayout->addWidget(keys_page->keyChooser);
775
782
    KeyToXNConf(7, keys->shortcut("Enable Secondary Layout "    ).keyCodeQt());
776
783
    KeyToXNConf(8, keys->shortcut("Enable Thrid Layout "        ).keyCodeQt());
777
784
    KeyToXNConf(9, keys->shortcut("Enable Fourth Layout "       ).keyCodeQt());
778
 
    // KeyToXNConf(10, keys->shortcut("Replace Abbreviation "       ).keyCodeQt());
 
785
    KeyToXNConf(10, keys->shortcut("Replace Abbreviation "       ).keyCodeQt());
779
786
 
780
787
 
781
788
    for ( int i = 0 ; i < prog_page->list[0]->numRows() ; i++ )
792
799
    else
793
800
        knapp->xnconf->play_sounds = 0;
794
801
 
795
 
    for ( int i = 0 ; i < MAX_SOUNDS-3 ; i++ ) {
 
802
    for ( int i = 0 ; i < MAX_SOUNDS ; i++ ) {
796
803
        if ( knapp->xnconf->sounds[i].file )
797
804
            free(knapp->xnconf->sounds[i].file);
798
805
        knapp->xnconf->sounds[i].file = qstrdup(snd_page->edit[i]->text().utf8());
799
806
    }
800
807
 
 
808
    if ( osd_page->enable_osd->isChecked() )
 
809
        knapp->xnconf->show_osd = 1;
 
810
    else
 
811
        knapp->xnconf->show_osd = 0;
 
812
 
 
813
    if ( knapp->xnconf->osd_font )
 
814
        free(knapp->xnconf->osd_font);
 
815
    knapp->xnconf->osd_font = qstrdup(osd_page->osd_font->text().utf8());
 
816
 
 
817
    for ( int i = 0 ; i < MAX_OSDS ; i++ ) {
 
818
        if ( knapp->xnconf->osds[i].file )
 
819
            free(knapp->xnconf->osds[i].file);
 
820
        knapp->xnconf->osds[i].file = qstrdup(osd_page->edit[i]->text().utf8());
 
821
    }
 
822
 
801
823
    knapp->xnconf->save(knapp->xnconf);
802
824
    knapp->xnconf->reload(knapp->xnconf);
803
825
 
835
857
    if ( knapp->xnconf->hotkeys[action].modifiers & 0x8 )
836
858
        shc += KKey::QtWIN;
837
859
    int ccc = kc.key2code(knapp->xnconf->hotkeys[action].key);
838
 
    // qDebug("%d : %s == %x -> ", action, knapp->xnconf->hotkeys[action].key, ccc);
 
860
    //qDebug("%d : %s == %x -> ", action, knapp->xnconf->hotkeys[action].key, ccc);
839
861
    shc += ccc;
840
862
    // qDebug("%x\n", shc);
841
863
    orig_keys[action] = shc;