MCPcopy Create free account
hub / github.com/QNapi/qnapi / frmOptions

Method frmOptions

gui/src/forms/frmoptions.cpp:35–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33#endif
34
35frmOptions::frmOptions(QWidget *parent, Qt::WindowFlags f)
36 : QDialog(parent, f),
37 subtitleFormatsRegistry(LibQNapi::subtitleFormatsRegistry()),
38 enginesRegistry(LibQNapi::subtitleDownloadEngineRegistry()) {
39 ui.setupUi(this);
40
41 ui.cbUiLanguage->setItemData(0, "", Qt::UserRole);
42 ui.cbUiLanguage->setItemData(1, QLocale(QLocale::English).name(),
43 Qt::UserRole);
44 ui.cbUiLanguage->setItemData(2, QLocale(QLocale::Italian).name(),
45 Qt::UserRole);
46 ui.cbUiLanguage->setItemData(3, QLocale(QLocale::Polish).name(),
47 Qt::UserRole);
48 ui.lbUiLangChangeNotice->setVisible(false);
49
50#ifdef Q_OS_MAC
51 ui.cbQuietBatch->hide();
52#endif
53
54#ifndef Q_OS_MAC
55 ui.cbShowDockIcon->hide();
56#endif
57
58#ifdef Q_OS_WIN
59 ui.cbChangePermissions->hide();
60 ui.sbOPerm->hide();
61 ui.sbGPerm->hide();
62 ui.sbUPerm->hide();
63#endif
64
65 QString tlcode;
66 ui.cbLangBackup->addItem("None", QVariant(""));
67 foreach (QString lang, SubtitleLanguage("").listLanguages()) {
68 tlcode = SubtitleLanguage(lang).toTwoLetter();
69 ui.cbLang->addItem(QIcon(QString(":/languages/%1.png").arg(tlcode)), lang,
70 QVariant(tlcode));
71 ui.cbLangBackup->addItem(QIcon(QString(":/languages/%1.png").arg(tlcode)),
72 lang, QVariant(tlcode));
73 }
74
75 setAttribute(Qt::WA_QuitOnClose, false);
76
77 connect(ui.le7zPath, SIGNAL(textChanged(const QString &)), this,
78 SLOT(le7zPathChanged()));
79 connect(ui.pb7zPathSelect, SIGNAL(clicked()), this, SLOT(select7zPath()));
80 connect(ui.leTmpPath, SIGNAL(textChanged(const QString &)), this,
81 SLOT(leTmpPathChanged()));
82 connect(ui.pbTmpPathSelect, SIGNAL(clicked()), this, SLOT(selectTmpPath()));
83
84 connect(ui.twEngines, SIGNAL(itemSelectionChanged()), this,
85 SLOT(twEnginesSelectionChanged()));
86 connect(ui.twEngines, SIGNAL(itemChanged(QTableWidgetItem *)), this,
87 SLOT(twEnginesItemChanged(QTableWidgetItem *)));
88
89 connect(ui.pbMoveUp, SIGNAL(clicked()), this, SLOT(pbMoveUpClicked()));
90 connect(ui.pbMoveDown, SIGNAL(clicked()), this, SLOT(pbMoveDownClicked()));
91 connect(ui.pbEngineConf, SIGNAL(clicked()), this,
92 SLOT(pbEngineConfClicked()));

Callers

nothing calls this directly

Calls 1

nameMethod · 0.80

Tested by

no test coverage detected