EditOnekeyDialog::EditOnekeyDialog(){ //初始化变量 textArea = new QTextEdit(this); textArea->setFixedWidth(400); okButton = new QPushButton(QStringLiteral("确定")); cancelButton = new QPushButton(QStringLiteral("取消")); connect(okButton, SIGNAL(clicked()), this, SLOT(updateIni())); connect(cancelButton, SIGNAL(clicked()), this, SLOT(hide())); okButton->setFixedSize(okButton->sizeHint().width(), okButton->sizeHint().height()); cancelButton->setFixedSize(cancelButton->sizeHint().width(), cancelButton->sizeHint().height()); //读取文件内容 QFile onekeyFile("ini/onekeySub.ini"); if (!onekeyFile.open(QIODevice::ReadOnly | QIODevice::Text)){ QMessageBox::information(this, QStringLiteral("错误"), QStringLiteral("打开onekeySub.ini发生错误")); abort(); } QTextStream in(&onekeyFile); in >> text; textArea->setPlainText(text); onekeyFile.close(); //按钮布局 QHBoxLayout *buttonLayout = new QHBoxLayout(); buttonLayout->addWidget(okButton); buttonLayout->addWidget(cancelButton); //整体布局 QVBoxLayout *mainLayout = new QVBoxLayout(); mainLayout->addWidget(textArea); mainLayout->addLayout(buttonLayout); setLayout(mainLayout); //设置 setWindowTitle(QStringLiteral("一键订阅列表")); setModal(true); hide(); }
BOOL install(PINSTALLDATA pid, HWND hprgs) { BOOL rc = FALSE; ULONG csteps; ULONG i = 0; // inizializza file log startProcessing(pid, hprgs); // calcola numero passi da eseguire if (!(csteps = instinstcsteps(pid))) goto end; // se programma preferenze aperto lo chiude if (!instcloseprefapp(pid, &i, hprgs, csteps)) goto end; // modifica os2.ini if (!instaddprfitems(pid, &i, hprgs, csteps)) goto end; // cancella file obsoleti if (!instdelobsolete(pid, &i, hprgs, csteps)) goto end; // copia file e smartwin.dll if (!instcopyfiles(pid, &i, hprgs, csteps)) goto end; // copia albero bitmap if (!instcopytree(pid, &i, hprgs, csteps)) goto end; // crea oggetti if (!instcreatobjs(pid, &i, hprgs, csteps)) goto end; // if needed update the ini file updateIni(); rc = TRUE; end: // scrive file log, mostra messaggio termine e riabilita controlli endProcessing(pid, hprgs, rc); return rc; }