QString Changelog::parseChangelogFile(QString filename) { QFile changelog(filename); changelog.open(QIODevice::ReadOnly); QTextStream c(&changelog); QString text; while(!c.atEnd()) { QString line = c.readLine(); if(line.startsWith("#")) continue; if(line.startsWith("Version")) { text.append(QString("<h4>Rockbox Utility %1</h4>").arg(line.remove("Version"))); line = c.readLine(); text.append("<ul>"); while(line.startsWith("*")) { QString t = line.remove(QRegExp("^\\*")); t.replace(QRegExp("FS#(\\d+)"), "<a href='http://www.rockbox.org/tracker/task/\\1'>FS#\\1</a>"); text.append(QString("<li>%1</li>").arg(t)); line = c.readLine(); if(line.startsWith("#")) line = c.readLine(); } text.append("</ul>"); } } changelog.close(); return text; }
static inline uint8_t sclass_univ_delete_entry(uint8_t nleng,const uint8_t *name,uint16_t esclassid) { uint32_t sclassid,fsclassid; if (sclass_name_check(nleng,name)==0) { return MFS_ERROR_EINVAL; } fsclassid = 0; for (sclassid=1 ; fsclassid==0 && sclassid<firstneverused ; sclassid++) { if (sclasstab[sclassid].nleng==nleng && memcmp(sclasstab[sclassid].name,name,nleng)==0) { fsclassid = sclassid; } } if (fsclassid==0) { return MFS_ERROR_NOSUCHCLASS; } if (fsclassid<FIRSTSCLASSID) { return MFS_ERROR_EPERM; } if (sclasstab[fsclassid].files>0 || sclasstab[fsclassid].directories>0) { return MFS_ERROR_CLASSINUSE; } if (esclassid!=0 && fsclassid!=esclassid) { return MFS_ERROR_MISMATCH; } sclasstab[fsclassid].nleng = 0; if (esclassid==0) { changelog("%"PRIu32"|SCDEL(%s):%"PRIu32,main_time(),changelog_escape_name(nleng,name),fsclassid); } else { meta_version_inc(); } return MFS_STATUS_OK; }
static inline uint8_t sclass_univ_rename_entry(uint8_t oldnleng,const uint8_t *oldname,uint8_t newnleng,const uint8_t *newname,uint16_t esclassid) { uint32_t sclassid,fsclassid; if (sclass_name_check(oldnleng,oldname)==0 || sclass_name_check(newnleng,newname)==0) { return MFS_ERROR_EINVAL; } fsclassid = 0; for (sclassid=1 ; fsclassid==0 && sclassid<firstneverused ; sclassid++) { if (sclasstab[sclassid].nleng==oldnleng && memcmp(sclasstab[sclassid].name,oldname,oldnleng)==0) { fsclassid = sclassid; } } if (fsclassid==0) { return MFS_ERROR_NOSUCHCLASS; } if (fsclassid<FIRSTSCLASSID) { return MFS_ERROR_EPERM; } if (esclassid!=0 && fsclassid!=esclassid) { return MFS_ERROR_MISMATCH; } for (sclassid=1 ; sclassid<firstneverused ; sclassid++) { if (sclasstab[sclassid].nleng==newnleng && memcmp(sclasstab[sclassid].name,newname,newnleng)==0) { return MFS_ERROR_CLASSEXISTS; } } sclasstab[fsclassid].nleng = newnleng; memcpy(sclasstab[fsclassid].name,newname,newnleng); if (esclassid==0) { changelog("%"PRIu32"|SCREN(%s,%s):%"PRIu32,main_time(),changelog_escape_name(oldnleng,oldname),changelog_escape_name(newnleng,newname),fsclassid); } else { meta_version_inc(); } return MFS_STATUS_OK; }
void DownloadManager::setChangelog(const QString &nChangelog) { if (nChangelog != m_changelog) { m_changelog = nChangelog; #ifdef QT_DEBUG qDebug() << "Changed changelog to" << m_changelog; #endif emit changelogChanged(changelog()); } }
void masterconn_metachanges_log(masterconn *eptr,const uint8_t *data,uint32_t length) { char line[1024]; uint64_t version; if (length==1 && data[0]==0x55) { fs_storeall(1); return; } if (length<10) { syslog(LOG_NOTICE,"MATOML_METACHANGES_LOG - wrong size (%"PRIu32"/9+data)",length); eptr->mode = KILL; return; } if (data[0]!=0xFF) { syslog(LOG_NOTICE,"MATOML_METACHANGES_LOG - wrong packet"); eptr->mode = KILL; return; } if (data[length-1]!='\0') { syslog(LOG_NOTICE,"MATOML_METACHANGES_LOG - invalid string"); eptr->mode = KILL; return; } data++; version = get64bit(&data); if (version<currentlogversion) { syslog(LOG_WARNING, "get old change: %"PRIu64":%"PRIu64", ignore",currentlogversion,version-1); return; } if (currentlogversion>0 && version>currentlogversion) { syslog(LOG_WARNING, "some changes lost: [%"PRIu64"-%"PRIu64"], download metadata again",currentlogversion,version-1); masterconn_metadownloadinit(); return; } if (version == fs_getversion()) { changelog(version, "%s", (const char*)data); currentlogversion = version+1; sprintf(line, ": %s\n", data); if (restore_line("(live changelog)", version, line)!=STATUS_OK) { syslog(LOG_WARNING, "replay change log failed: version=%"PRIu64", download metadata again",version); masterconn_metadownloadinit(); } else if (fs_getversion() != version+1) { syslog(LOG_WARNING, "restored version not match: %"PRIu64"!=%"PRIu64", download metadata again",fs_getversion(),version+1); masterconn_metadownloadinit(); } } else { syslog(LOG_WARNING, "version not match: %"PRIu64"!=%"PRIu64", download metadata again",fs_getversion(),version); masterconn_metadownloadinit(); } }
static inline void sclass_make_changelog(uint16_t sclassid,uint8_t new_flag) { uint32_t i,j; char chlogstr[CHLOGSTRSIZE]; int chlogstrleng; chlogstrleng=0; for (i=0 ; i<sclasstab[sclassid].create_labelscnt ; i++) { for (j=0 ; j<MASKORGROUP ; j++) { if (chlogstrleng<CHLOGSTRSIZE) { chlogstrleng += snprintf(chlogstr+chlogstrleng,CHLOGSTRSIZE-chlogstrleng,"%"PRIu32",",sclasstab[sclassid].create_labelmasks[i][j]); } } } for (i=0 ; i<sclasstab[sclassid].keep_labelscnt ; i++) { for (j=0 ; j<MASKORGROUP ; j++) { if (chlogstrleng<CHLOGSTRSIZE) { chlogstrleng += snprintf(chlogstr+chlogstrleng,CHLOGSTRSIZE-chlogstrleng,"%"PRIu32",",sclasstab[sclassid].keep_labelmasks[i][j]); } } } for (i=0 ; i<sclasstab[sclassid].arch_labelscnt ; i++) { for (j=0 ; j<MASKORGROUP ; j++) { if (chlogstrleng<CHLOGSTRSIZE) { chlogstrleng += snprintf(chlogstr+chlogstrleng,CHLOGSTRSIZE-chlogstrleng,"%"PRIu32",",sclasstab[sclassid].arch_labelmasks[i][j]); } } } if (chlogstrleng>0) { chlogstr[chlogstrleng-1]='\0'; } else { chlogstr[0]='-'; chlogstr[1]='\0'; } changelog("%"PRIu32"|SCSET(%s,%"PRIu8",W%"PRIu8",K%"PRIu8",A%"PRIu8",%"PRIu8",%"PRIu16",%"PRIu8",%s):%"PRIu16,main_time(),changelog_escape_name(sclasstab[sclassid].nleng,sclasstab[sclassid].name),new_flag,sclasstab[sclassid].create_labelscnt,sclasstab[sclassid].keep_labelscnt,sclasstab[sclassid].arch_labelscnt,sclasstab[sclassid].create_mode,sclasstab[sclassid].arch_delay,sclasstab[sclassid].admin_only,chlogstr,sclassid); }
__declspec(dllexport) int ExtConfigure(void **ctxp, void* dummy, int argc, char *argv[]){ int typeNicovideoE = TRUE; if(0 < (unsigned)dummy && (unsigned)dummy < 0x0400){ argv = (char **)argc; argc = (int)dummy; typeNicovideoE = FALSE; } int i; //ログ FILE* log = fopen("[log]vhext.txt", "w+"); char linebuf[128]; char *ver="1.67.7.01b"; snprintf(linebuf,63,"%s\nBuild %s %s\n",ver,__DATE__,__TIME__); if(log == NULL){ puts(linebuf); puts("[framehook/init]failed to open logfile.\n"); fflush(log); return -1; }else{ fputs(linebuf,log); fputs("[framehook/init]initializing..\n",log); fflush(log); } //必要な設定があるかの確認 fprintf(log,"[framehook/init]called with argc = %d\n",argc); fflush(log); for(i=0;i<argc;i++){ fprintf(log,"[framehook/init]arg[%2d] = %s\n",i,argv[i]); fflush(log); } //セッティング取得。 SETTING setting; if(init_setting(log,&setting,argc,argv,ver,typeNicovideoE)){ fputs("[framehook/init]initialized settings.\n",log); fflush(log); }else{ fputs("[framehook/init]failed to initialize settings.\n",log); fflush(log); return -2; } log = changelog(log, &setting); //ライブラリなどの初期化 if(init(log)){ fputs("[framehook/init]initialized libs.\n",log); fflush(log); }else{ fputs("[framehook/init]failed to initialize libs.\n",log); fflush(log); return -3; } /*コンテキストの設定*/ *ctxp = malloc(sizeof(ContextInfo)); if(*ctxp == NULL){ fputs("[framehook/init]failed to malloc for context.\n",log); fflush(log); return -5; } ContextInfo* ci = (ContextInfo*)*ctxp; memset(ci, (int)NULL, sizeof(ContextInfo)); ci->log = log; fflush(log); if(initData(&ci->data,log,&setting)){ fputs("[framehook/init]initialized context.\n",log); fputs("[framehook/init]initialized.\n",log); fflush(log); return 0; }else{ fputs("[framehook/init]failed to initialize context.\n",log); fflush(log); return -4; } }
static inline void flock_lock_remove(lock *l) { if (l->state==STATE_ACTIVE) { changelog("%"PRIu32"|FLOCK(%"PRIu32",%"PRIu32",%"PRIu64",U)",main_time(),l->parent->inode,l->sessionid,l->owner); } flock_do_lock_remove(l); }
static inline void flock_lock_inode_attach(lock *l) { if (l->state==STATE_ACTIVE) { changelog("%"PRIu32"|FLOCK(%"PRIu32",%"PRIu32",%"PRIu64",%c)",main_time(),l->parent->inode,l->sessionid,l->owner,l->ltype==LTYPE_READER?'R':'W'); } flock_do_lock_inode_attach(l); }
void update( const Plasma::DataEngine::Data &data ) { providerType = data["type"].toString(); uiProviderData.type->setText( providerType ); state = data["state"].toString(); stateData = data["stateData"].toHash(); uiProviderData.state->setText( stateData["statusMessage"].toString() ); // Hide all widgets except for the status message for erroneous providers // because the other fields are empty const bool hasError = state == QLatin1String("error"); uiProviderData.icon->setVisible( !hasError ); uiProviderData.version->setVisible( !hasError ); uiProviderData.line->setVisible( !hasError ); uiProviderData.lblUrl->setVisible( !hasError ); uiProviderData.url->setVisible( !hasError ); uiProviderData.lblAuthor->setVisible( !hasError ); uiProviderData.author->setVisible( !hasError ); uiProviderData.lblType->setVisible( !hasError ); uiProviderData.type->setVisible( !hasError ); uiProviderData.lblFileName->setVisible( !hasError ); uiProviderData.fileName->setVisible( !hasError ); uiProviderData.lblFeatures->setVisible( !hasError ); uiProviderData.features->setVisible( !hasError ); uiProviderData.lblDescription->setVisible( !hasError ); uiProviderData.description->setVisible( !hasError ); const QString type = data["type"].toString(); if ( type != QLatin1String("GTFS") ) { uiProviderData.lblGtfsFeed->hide(); uiProviderData.gtfsFeed->hide(); uiProviderData.importGtfsFeedButton->hide(); uiProviderData.updateGtfsDatabaseButton->hide(); uiProviderData.deleteGtfsDatabaseButton->hide(); uiProviderData.progressBar->hide(); } else { // Is a GTFS provider const QString feedUrl = data["feedUrl"].toString(); uiProviderData.lblGtfsFeed->show(); uiProviderData.gtfsFeed->show(); if ( state == QLatin1String("ready") ) { uiProviderData.importGtfsFeedButton->setEnabled( false ); uiProviderData.deleteGtfsDatabaseButton->setEnabled( true ); feedSizeInBytes = stateData["gtfsDatabaseSize"].toInt(); uiProviderData.gtfsFeed->setText( i18nc("@info:label", "<a href='%1'>%1</a>,<nl/>%2 disk space used", feedUrl, KGlobal::locale()->formatByteSize(feedSizeInBytes)) ); } else { uiProviderData.importGtfsFeedButton->setEnabled( state == QLatin1String("gtfs_feed_import_pending") ); uiProviderData.deleteGtfsDatabaseButton->setEnabled( false ); uiProviderData.gtfsFeed->setText( i18nc("@info:label", "<a href='%1'>%1</a>", feedUrl) ); } if ( state == QLatin1String("importing_gtfs_feed") ) { uiProviderData.progressBar->setValue( stateData["progress"].toInt() ); uiProviderData.progressBar->show(); } else { uiProviderData.progressBar->hide(); } } // Set the tooltip for the "Delete GTFS Database" button also if it gets hidden, // because ServiceProviderDataDialog may use this tooltip for it's own (dialog) button uiProviderData.deleteGtfsDatabaseButton->setToolTip( i18nc("@info:tooltip", "<title>Delete GTFS Database</title>" "<para>The GTFS database contains all data imported from the GTFS " "feed. If you delete the database now the GTFS feed needs to be " "imported again to make this service provider usable again.</para>" "<para>By deleting the database %1 disk space get freed.</para>", KGlobal::locale()->formatByteSize(feedSizeInBytes) ) ); if ( !options.testFlag(ServiceProviderDataWidget::ShowDatabaseControlButtons) ) { uiProviderData.lblOperations->hide(); uiProviderData.importGtfsFeedButton->hide(); uiProviderData.updateGtfsDatabaseButton->hide(); uiProviderData.deleteGtfsDatabaseButton->hide(); } uiProviderData.serviceProviderName->setText(data["name"].toString() ); uiProviderData.version->setText( i18nc("@info/plain", "Version %1", data["version"].toString()) ); uiProviderData.url->setUrl( data["url"].toString() ); uiProviderData.url->setText( QString("<a href='%1'>%1</a>").arg( data["url"].toString()) ); uiProviderData.fileName->setUrl( data["fileName"].toString() ); uiProviderData.fileName->setText( QString("<a href='%1'>%1</a>").arg( data["fileName"].toString()) ); QString scriptFileName = data["scriptFileName"].toString(); if ( scriptFileName.isEmpty() ) { uiProviderData.lblScriptFileName->setVisible( false ); uiProviderData.scriptFileName->setVisible( false ); } else { uiProviderData.lblScriptFileName->setVisible( true ); uiProviderData.scriptFileName->setVisible( true ); uiProviderData.scriptFileName->setUrl( scriptFileName ); uiProviderData.scriptFileName->setText( QString("<a href='%1'>%1</a>") .arg(scriptFileName) ); } if ( data["email"].toString().isEmpty() ) { uiProviderData.author->setText( data["author"].toString() ); } else { uiProviderData.author->setText( QString("<a href='mailto:%2'>%1</a> (%3)") .arg(data["author"].toString()) .arg(data["email"].toString()) .arg(data["shortAuthor"].toString()) ); uiProviderData.author->setToolTip( i18nc("@info", "Write an email to <email address='%2'>%1</email> (%3)", data["author"].toString(), data["email"].toString(), data["shortAuthor"].toString()) ); } uiProviderData.description->setText( data["description"].toString() ); uiProviderData.features->setText( data["featureNames"].toStringList().join(", ") ); QStringList changelogEntries = data["changelog"].toStringList(); if ( changelogEntries.isEmpty() ) { uiProviderData.lblChangelog->hide(); uiProviderData.changelog->hide(); } else { QString changelog("<ul style='margin-left:-20;'>"); foreach ( const QString &entry, changelogEntries ) { int pos = entry.indexOf(':'); if ( pos == -1 ) { changelog.append( QString("<li>%1</li>").arg(entry) ); } else { QString e = entry; changelog.append( QString("<li><span style='font-style: italic;'>%1</li>") .arg(e.insert(pos + 1, QLatin1String("</span>"))) ); } } changelog.append( QLatin1String("</ul>") ); uiProviderData.changelog->setHtml( changelog ); }
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted) { QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension... ACTION->setStatusTip(statusTip); ACTION->setObjectName(icon); // TODO: Set What's This Context Help to statusTip for now so there is some infos there. // Make custom whats this context help popup with more descriptive help than just // the status bar/tip one liner(short but not real long) with a hyperlink in the custom popup // at the bottom to open full help file description. Ex: like wxPython AGW's SuperToolTip. ACTION->setWhatsThis(statusTip); // TODO: Finish All Commands ... <.< if (icon == "donothing") connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing())); else if(icon == "new") { ACTION->setShortcut(QKeySequence::New); connect(ACTION, SIGNAL(triggered()), this, SLOT(newFile())); } else if(icon == "open") { ACTION->setShortcut(QKeySequence::Open); connect(ACTION, SIGNAL(triggered()), this, SLOT(openFile())); } else if(icon == "save") { ACTION->setShortcut(QKeySequence::Save); connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile())); } else if(icon == "saveas") { ACTION->setShortcut(QKeySequence::SaveAs); connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile())); } else if(icon == "print") { ACTION->setShortcut(QKeySequence::Print); connect(ACTION, SIGNAL(triggered()), this, SLOT(print())); } else if(icon == "designdetails") { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails())); } else if(icon == "exit") { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit())); } else if(icon == "cut") { ACTION->setShortcut(QKeySequence::Cut); connect(ACTION, SIGNAL(triggered()), this, SLOT(cut())); } else if(icon == "copy") { ACTION->setShortcut(QKeySequence::Copy); connect(ACTION, SIGNAL(triggered()), this, SLOT(copy())); } else if(icon == "paste") { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); } else if(icon == "windowcascade") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade())); else if(icon == "windowtile") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile())); else if(icon == "windowclose") { ACTION->setShortcut(QKeySequence::Close); connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow())); } else if(icon == "windowcloseall") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); else if(icon == "windownext") { ACTION->setShortcut(QKeySequence::NextChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); } else if(icon == "windowprevious") { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); } else if(icon == "help") connect(ACTION, SIGNAL(triggered()), this, SLOT(help())); else if(icon == "changelog") connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog())); else if(icon == "tipoftheday") connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay())); else if(icon == "about") connect(ACTION, SIGNAL(triggered()), this, SLOT(about())); else if(icon == "whatsthis") connect(ACTION, SIGNAL(triggered()), this, SLOT(whatsThisContextHelp())); else if(icon == "icon16") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16())); else if(icon == "icon24") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24())); else if(icon == "icon32") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32())); else if(icon == "icon48") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48())); else if(icon == "icon64") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64())); else if(icon == "icon128") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128())); else if(icon == "settingsdialog") connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog())); else if(icon == "undo") connect(ACTION, SIGNAL(triggered()), this, SLOT(undo())); else if(icon == "redo") connect(ACTION, SIGNAL(triggered()), this, SLOT(redo())); else if(icon == "makelayercurrent") connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive())); else if(icon == "layers") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager())); else if(icon == "layerprevious") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious())); else if(icon == "textbold") { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool))); }
QAction *MainWindow::createAction(const QString icon, const QString toolTip, const QString statusTip, bool scripted) { QAction *ACTION = new QAction(QIcon("icons/" + getSettingsGeneralIconTheme() + "/" + icon + ".png"), toolTip, this); //TODO: Qt4.7 wont load icons without an extension... ACTION->setStatusTip(statusTip); ACTION->setObjectName(icon); // TODO: Finish All Commands ... <.< if (icon == "donothing") connect(ACTION, SIGNAL(triggered()), this, SLOT(doNothing())); else if(icon == "new") { ACTION->setShortcut(QKeySequence::New); connect(ACTION, SIGNAL(triggered()), this, SLOT(newfile())); } else if(icon == "open") { ACTION->setShortcut(QKeySequence::Open); connect(ACTION, SIGNAL(triggered()), this, SLOT(openfile())); } else if(icon == "save") { ACTION->setShortcut(QKeySequence::Save); connect(ACTION, SIGNAL(triggered()), this, SLOT(savefile())); } else if(icon == "saveas") { ACTION->setShortcut(QKeySequence::SaveAs); connect(ACTION, SIGNAL(triggered()), this, SLOT(saveasfile())); } else if(icon == "print") { ACTION->setShortcut(QKeySequence::Print); connect(ACTION, SIGNAL(triggered()), this, SLOT(print())); } else if(icon == "close") { ACTION->setShortcut(QKeySequence::Close); connect(ACTION, SIGNAL(triggered()), this, SLOT(onCloseWindow())); } else if(icon == "designdetails") { ACTION->setShortcut(QKeySequence("Ctrl+D")); connect(ACTION, SIGNAL(triggered()), this, SLOT(designDetails())); } else if(icon == "exit") { ACTION->setShortcut(QKeySequence("Ctrl+Q")); connect(ACTION, SIGNAL(triggered()), this, SLOT(exit())); } else if(icon == "cut") { ACTION->setShortcut(QKeySequence::Cut); connect(ACTION, SIGNAL(triggered()), this, SLOT(cut())); } else if(icon == "copy") { ACTION->setShortcut(QKeySequence::Copy); connect(ACTION, SIGNAL(triggered()), this, SLOT(copy())); } else if(icon == "paste") { ACTION->setShortcut(QKeySequence::Paste); connect(ACTION, SIGNAL(triggered()), this, SLOT(paste())); } else if(icon == "windowcascade") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(cascade())); else if(icon == "windowtile") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(tile())); else if(icon == "windowcloseall") connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(closeAllSubWindows())); else if(icon == "windownext") { ACTION->setShortcut(QKeySequence::NextChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activateNextSubWindow())); } else if(icon == "windowprevious") { ACTION->setShortcut(QKeySequence::PreviousChild); connect(ACTION, SIGNAL(triggered()), mdiArea, SLOT(activatePreviousSubWindow())); } else if(icon == "help") connect(ACTION, SIGNAL(triggered()), this, SLOT(help())); else if(icon == "changelog") connect(ACTION, SIGNAL(triggered()), this, SLOT(changelog())); else if(icon == "tipoftheday") connect(ACTION, SIGNAL(triggered()), this, SLOT(tipOfTheDay())); else if(icon == "about") connect(ACTION, SIGNAL(triggered()), this, SLOT(about())); else if(icon == "aboutQt") connect(ACTION, SIGNAL(triggered()), qApp, SLOT(aboutQt())); else if(icon == "icon16") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon16())); else if(icon == "icon24") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon24())); else if(icon == "icon32") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon32())); else if(icon == "icon48") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon48())); else if(icon == "icon64") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon64())); else if(icon == "icon128") connect(ACTION, SIGNAL(triggered()), this, SLOT(icon128())); else if(icon == "settingsdialog") connect(ACTION, SIGNAL(triggered()), this, SLOT(settingsDialog())); else if(icon == "undo") connect(ACTION, SIGNAL(triggered()), this, SLOT(undo())); else if(icon == "redo") connect(ACTION, SIGNAL(triggered()), this, SLOT(redo())); else if(icon == "makelayercurrent") connect(ACTION, SIGNAL(triggered()), this, SLOT(makeLayerActive())); else if(icon == "layers") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerManager())); else if(icon == "layerprevious") connect(ACTION, SIGNAL(triggered()), this, SLOT(layerPrevious())); else if(icon == "textbold") { ACTION->setCheckable(true); connect(ACTION, SIGNAL(toggled(bool)), this, SLOT(setTextBold(bool))); }
static inline uint8_t sclass_univ_duplicate_entry(uint8_t oldnleng,const uint8_t *oldname,uint8_t newnleng,const uint8_t *newname,uint16_t essclassid,uint16_t edsclassid) { uint32_t sclassid,fssclassid,fdsclassid; uint32_t i; if (sclass_name_check(oldnleng,oldname)==0 || sclass_name_check(newnleng,newname)==0 || (essclassid==0 && edsclassid>0) || (edsclassid==0 && essclassid>0)) { return MFS_ERROR_EINVAL; } fssclassid = 0; for (sclassid=1 ; fssclassid==0 && sclassid<firstneverused ; sclassid++) { if (sclasstab[sclassid].nleng==oldnleng && memcmp(sclasstab[sclassid].name,oldname,oldnleng)==0) { fssclassid = sclassid; } } if (fssclassid==0) { return MFS_ERROR_NOSUCHCLASS; } if (essclassid!=0 && fssclassid!=essclassid) { return MFS_ERROR_MISMATCH; } fdsclassid = 0; for (sclassid=1 ; sclassid<firstneverused ; sclassid++) { if (sclasstab[sclassid].nleng==newnleng && memcmp(sclasstab[sclassid].name,newname,newnleng)==0) { return MFS_ERROR_CLASSEXISTS; } if (sclasstab[sclassid].nleng==0 && fdsclassid==0) { fdsclassid = sclassid; } } if (fdsclassid==0) { if (firstneverused==MAXSCLASS) { return MFS_ERROR_CLASSLIMITREACH; } fdsclassid = firstneverused; firstneverused++; } if (edsclassid!=0 && fdsclassid!=edsclassid) { return MFS_ERROR_MISMATCH; } sclasstab[fdsclassid].nleng = newnleng; memcpy(sclasstab[fdsclassid].name,newname,newnleng); sclasstab[fdsclassid].admin_only = sclasstab[fssclassid].admin_only; sclasstab[fdsclassid].create_mode = sclasstab[fssclassid].create_mode; sclasstab[fdsclassid].create_labelscnt = sclasstab[fssclassid].create_labelscnt; for (i=0 ; i<sclasstab[fssclassid].create_labelscnt ; i++) { memcpy(sclasstab[fdsclassid].create_labelmasks[i],sclasstab[fssclassid].create_labelmasks[i],MASKORGROUP*sizeof(uint32_t)); } sclasstab[fdsclassid].has_create_labels = sclasstab[fssclassid].has_create_labels; sclasstab[fdsclassid].keep_labelscnt = sclasstab[fssclassid].keep_labelscnt; for (i=0 ; i<sclasstab[fssclassid].keep_labelscnt ; i++) { memcpy(sclasstab[fdsclassid].keep_labelmasks[i],sclasstab[fssclassid].keep_labelmasks[i],MASKORGROUP*sizeof(uint32_t)); } sclasstab[fdsclassid].has_keep_labels = sclasstab[fssclassid].has_keep_labels; sclasstab[fdsclassid].arch_labelscnt = sclasstab[fssclassid].arch_labelscnt; for (i=0 ; i<sclasstab[fssclassid].arch_labelscnt ; i++) { memcpy(sclasstab[fdsclassid].arch_labelmasks[i],sclasstab[fssclassid].arch_labelmasks[i],MASKORGROUP*sizeof(uint32_t)); } sclasstab[fdsclassid].has_arch_labels = sclasstab[fssclassid].has_arch_labels; sclasstab[fdsclassid].arch_delay = sclasstab[fssclassid].arch_delay; if (essclassid==0 && edsclassid==0) { changelog("%"PRIu32"|SCDUP(%s,%s):%"PRIu32",%"PRIu32,main_time(),changelog_escape_name(oldnleng,oldname),changelog_escape_name(newnleng,newname),fssclassid,fdsclassid); } else { meta_version_inc(); } return MFS_STATUS_OK; }