void Ide::MainConfig() { package.SetCursor(0); if(package.GetCursor() != 0) return; MainConfigDlg dlg(IdeWorkspace()); for(int i = 0; i < actual.config.GetCount(); i++) { const Package::Config& f = actual.config[i]; dlg.list.Add(f.param, f.name); } if(!dlg.Perform(mainconfigname)) return; actual.config.Clear(); for(int i = 0; i < dlg.list.GetCount(); i++) { Package::Config& f = actual.config.Add(); f.param = dlg.list.Get(i, 0); f.name = dlg.list.Get(i, 1); } SavePackage(); if(dlg.list.IsCursor()) { mainconfigparam = dlg.list.Get(0); mainconfigname = Nvl((String)dlg.list.Get(1), mainconfigparam); MakeTitle(); } SyncMainConfigList(); SetHdependDirs(); MakeTitle(); }
void Ide::SetMain(const String& package) { FlushFile(); SaveWorkspace(); transferfilecache.Clear(); main = package; export_dir = GetHomeDirFile(main); mainconfigname.Clear(); mainconfigparam.Clear(); ScanWorkspace(); LoadFromFile(THISBACK(SerializeWorkspace), WorkspaceFile()); editorsplit.Zoom(0); UpdateFormat(); String e = editfile; editfile.Clear(); MakeTitle(); MakeIcon(); SyncMainConfigList(); AdjustMainConfig(); SyncBuildMode(); SetHdependDirs(); SetBar(); HideBottom(); SyncUsc(); NewCodeBase(); if(IsNull(e)) e = GetFirstFile(); EditFile(e); }
static void getsonginfo(char *fn, char **title, int *length) { PSFINFO *tmp; if((tmp=sexy_getpsfinfo(fn))) { *length=tmp->length; *title=MakeTitle(tmp); sexy_freepsfinfo(tmp); } }
void Ide::SetIdeState(int newstate) { if(newstate != idestate) { if(newstate == BUILDING) build_start_time = GetSysTime(); else { if(idestate == BUILDING && !IsNull(build_start_time)) stat_build_time += int(GetSysTime() - build_start_time); build_start_time = Null; } } idestate = newstate; MakeTitle(); SetBar(); }
void Ide::ToggleReadOnly() { if(CanToggleReadOnly() && IsActiveFile()) { #ifdef PLATFORM_WIN32 FindFile ff(editfile); if(ff && ff.IsReadOnly()) { dword attrib = GetFileAttributes(editfile); attrib &= ~FILE_ATTRIBUTE_READONLY; SetFileAttributes(editfile, attrib); } #endif editor.SetEditable(editor.IsReadOnly()); ActiveFile().readonly = editor.IsReadOnly(); SavePackage(); MakeTitle(); SetBar(); } }
void wxSTEditorFrame::OnSTEState(wxSTEditorEvent &event) { event.Skip(); wxSTEditor *editor = event.GetEditor(); if ( event.HasStateChange(STE_FILENAME | STE_MODIFIED | STE_EDITABLE) ) { if (wxDynamicCast(editor, wxSTEditorFindResultsEditor) == NULL) { wxString title = MakeTitle(editor); if (GetTitle() != title) SetTitle(title); } if (event.HasStateChange(STE_FILENAME) && GetOptions().GetFileHistory()) { if (wxFileExists(event.GetString())) GetOptions().GetFileHistory()->AddFileToHistory( event.GetString() ); } } }
void wxSTEditorFrame::OnNotebookPageChanged(wxNotebookEvent &WXUNUSED(event)) { wxSTEditor *editor = GetEditor(); wxString title; wxSTEditorMenuManager *steMM = GetOptions().GetMenuManager(); if (editor) { title = MakeTitle(editor); if ( steMM && !steMM->HasEnabledEditorItems()) steMM->EnableEditorItems(true, NULL, GetMenuBar(), GetToolBar()); } else { title = m_titleBase; if (steMM && steMM->HasEnabledEditorItems()) steMM->EnableEditorItems(false, NULL, GetMenuBar(), GetToolBar()); } SetTitle(title); }
int protocol_nohttp(struct HTTPrecord *cacheitem,struct Url *url, unsigned *cacheitem_status, XSWAP *cacheitem_writeadr) { char *value; #ifndef CLEMTEST #ifdef OVRL #ifndef XTVERSION //---------------------------------------------------------------- finger: if(!strcmpi(url->protocol,"finger")) //------------------------------------------------------------------------ { //finger to cache *cacheitem_writeadr=Write2Cache(url,cacheitem,1,1); strcpy(cacheitem->mime,"finger/out"); if(xfinger(url,cacheitem,url->user)) { if(GLOBAL.abort) return GOTO_ABORT; UpdateInCache(*cacheitem_writeadr,cacheitem); *cacheitem_status=REMOTE; } else { GLOBAL.reload=0; return GOTO_ABORT; } } else if(!strcmpi(url->protocol,"news") || !strcmpi(url->protocol,"nntp") ) { //finger to cache *cacheitem_writeadr=Write2Cache(url,cacheitem,1,1); if(!url->host[0]) { value=configvariable(&ARACHNEcfg,"NNTPserver",NULL); if(value) { makestr(url->host,value,STRINGSIZE-1); } } if(!url->file[0] || url->file[0]=='/' && !url->file[1]) strcpy(url->file,"LIST"); strcpy(cacheitem->mime,"news/list"); if(xfinger(url,cacheitem,url->file)) { if(GLOBAL.abort) return GOTO_ABORT; UpdateInCache(*cacheitem_writeadr,cacheitem); *cacheitem_status=REMOTE; } else { GLOBAL.reload=0; return GOTO_ABORT; } } //---------------------------------------------------------------- gopher: else if(!strcmpi(url->protocol,"gopher")) //------------------------------------------------------------------------ { char *selector; char dummy[IE_MAXLEN+1]; int plugin=externalprotocol(url->protocol,dummy); if(plugin) return GOTO_EXTERNAL; //finger to cache *cacheitem_writeadr=Write2Cache(url,cacheitem,1,1); selector=&(url->file[1]); if(!url->file[1]) { strcpy(cacheitem->mime,"gopher/1"); } else if(url->file[2]=='/') { sprintf(cacheitem->mime,"gopher/%c",url->file[1]); if(url->file[1]=='7' && !strchr(url->file,'?')) //search return GOTO_TRYPLUGIN; selector=&(url->file[3]); } if(xfinger(url,cacheitem,selector)) { if(GLOBAL.abort) return GOTO_ABORT; UpdateInCache(*cacheitem_writeadr,cacheitem); *cacheitem_status=REMOTE; } else { GLOBAL.reload=0; return GOTO_ABORT; } } else #endif //XTVERSION #endif //statical version //------------------------------------------------------------------- ftp: if(!strcmpi(url->protocol,"ftp")) //------------------------------------------------------------------------ { char *ptr; char dummy[IE_MAXLEN+1]; int plugin=externalprotocol(url->protocol,dummy); if(plugin) return GOTO_EXTERNAL; if(url->user[0] && !url->password[0] && (strcmp(url->host,AUTHENTICATION->host) || strcmp(url->user,AUTHENTICATION->user) || strcmp(AUTHENTICATION->realm,"$ftp"))) { sprintf(cacheitem->locname,"%s%sftplogin.ah",sharepath,GUIPATH); strcpy(AUTHENTICATION->host,url->host); return GOTO_LOCAL_HTML; } ptr=configvariable(&ARACHNEcfg,"UseFTPproxy",NULL); if(ptr && toupper(*ptr)!='N') { char *no4all=configvariable(&ARACHNEcfg,"NoFTPproxy4all",NULL); ptr=configvariable(&ARACHNEcfg,"NoFTPproxy",NULL); if((!ptr || !strstr(strlwr(ptr),strlwr(url->host) )) && (!no4all || !strstr(strlwr(url->host), strlwr(no4all)) ) ) return GOTO_PROXY; } //ftp to cache *cacheitem_writeadr=Write2Cache(url,cacheitem,1,1); if(ftpsession(url,cacheitem,NULL)) { if(GLOBAL.abort) return GOTO_ABORT; UpdateInCache(*cacheitem_writeadr,cacheitem); *cacheitem_status=REMOTE; } else { GLOBAL.reload=0; return GOTO_ABORT; } } //------------------------------------------------------------------ pop3: else if(!strcmpi(url->protocol,"pop3")) //------------------------------------------------------------------------ { char dele=1,log=0; if(!url->host[0]) { value=configvariable(&ARACHNEcfg,"POP3server",NULL); if(value) makestr(url->host,value,STRINGSIZE-1); } if(!url->user[0]) { value=configvariable(&ARACHNEcfg,"POP3username",NULL); if(value) makestr(url->user,value,STRINGSIZE-1); } //Draw title and URL (without password): MakeTitle(MSG_MAILDL); url2str(url,GLOBAL.location); SetInputAtom(&URLprompt,GLOBAL.location); DrawTitle(0); add2history(GLOBAL.location); //Get password and other settings: if(!url->password[0]) { value=configvariable(&ARACHNEcfg,"POP3password",NULL); if(value) makestr(url->password,value,PASSWORDSIZE-1); } value=configvariable(&ARACHNEcfg,"KeepOnServer",NULL); if(value && toupper(*value)=='Y') dele=0; value=configvariable(&ARACHNEcfg,"POP3log",NULL); if(value && toupper(*value)=='Y') log=1; //POP3 download is performed here: if(!xpopdump(url,dele,log)) { sprintf(p->htmlframe[0].cacheitem.locname,"%s%serr_pop3.ah",sharepath,GUIPATH); return GOTO_ERROR; } else if(arachne.scriptline==0) { value=configvariable(&ARACHNEcfg,"AfterPOP3",NULL); if(!value) strcpy(GLOBAL.location,"file://inbox.dgi"); else strcpy(GLOBAL.location,value); GLOBAL.reload=RELOAD_CURRENT_LOCATION; return GOTO_IVEGOTNEWURL; } else return GOTO_READSCRIPT; } //------------------------------------------------------------------ smtp: else if(!strcmpi(url->protocol,"smtp")) //------------------------------------------------------------------------ { char helo=1,log=0; if(!url->host[0]) { value=configvariable(&ARACHNEcfg,"SMTPserver",NULL); if(value) makestr(url->host,value,STRINGSIZE-1); } //!!glennmcc: Feb 13, 2006 -- 'SendHelo' is more logical ;-) value=configvariable(&ARACHNEcfg,"SendHELO",NULL); if(!value || toupper(*value)!='N') helo=1; else helo=0; // value=configvariable(&ARACHNEcfg,"NoHELO",NULL); // if(value && toupper(*value)=='Y') helo=0; //!!glennmcc: end value=configvariable(&ARACHNEcfg,"SMTPlog",NULL); if(value && toupper(*value)=='Y') log=1; //!!glennmcc: begin Nov 09, 2003 --- for Authenticated SMTP //!!glennmcc: Feb 17, 2006 -- moved down below /* value=configvariable(&ARACHNEcfg,"UseAuthSMTP",NULL); if(!value || toupper(*value)!='N') helo=2; */ //!!glennmcc: end //!!glennmcc: begin Apr 30, 2004 --- for Authenticated SMTP value=configvariable(&ARACHNEcfg,"AuthSMTPusername",NULL); //!!glennmcc: Sept 17, 2004 // changed so that "email" will always get used for "mail from" // if(value) makestr(url->user,value,STRINGSIZE-1); if(value) makestr(url->authuser,value,STRINGSIZE-1); //!!glennmcc: end value=configvariable(&ARACHNEcfg,"AuthSMTPpassword",NULL); //!!glennmcc: Feb 17, 2006 -- switch to new variable 'authpassword' if(value) makestr(url->authpassword,value,PASSWORDSIZE-1); //if(value) makestr(url->password,value,STRINGSIZE-1); //!!glennmcc: end //!!glennmcc: Feb 17, 2006 -- switch to new variable 'authpassword' if(strlen(url->authuser)>0 && strlen(url->authpassword)>0 && strstr(configvariable(&ARACHNEcfg,"UseAuthSMTP",NULL),"Yes") ) helo=2; else helo=1; //!!glennmcc: end if(!url->user[0]) { value=configvariable(&ARACHNEcfg,"eMail",NULL); makestr(url->user,value,STRINGSIZE-1); } if(!url->file[0] || !url->file[1] ) //stmp: or smtp:/ { value=configvariable(&ARACHNEcfg,"MailPath",NULL); if(value) { sprintf(url->file,"/%s*.TBS",value); } } //Draw title and URL: MakeTitle(MSG_MAILUP); url2str(url,GLOBAL.location); SetInputAtom(&URLprompt,GLOBAL.location); DrawTitle(0); add2history(GLOBAL.location); //SMTP upload is performed here: if(!xsendmail(url,helo,log)) { sprintf(p->htmlframe[0].cacheitem.locname,"%s%serr_smtp.ah",sharepath,GUIPATH); return GOTO_ERROR; } else if(arachne.scriptline==0) { if(strchr(url->file,'*') || GLOBAL.mailaction & MAIL_OUTBOXNOW) { value=configvariable(&ARACHNEcfg,"AfterSMTP",NULL); if(!value) strcpy(GLOBAL.location,"file://outbox.dgi"); else strcpy(GLOBAL.location,value); GLOBAL.reload=RELOAD_CURRENT_LOCATION; } else { //!!glennmcc: Feb 27, 2005 // since 'smtp:' is not being saved into history, 2 goback()s when we hit // 'send mail now' on any of the mail compose screens ends-up taking us // back one step too far. // Therefore, we only goback once when it's not being sent 'on the spot' if(!strstr(GLOBAL.location,"smtp:")) goback(); //return to mailto: page... //#ifdef NOKEY // goback(); //#endif //!!glennmcc: end goback(); //return to page with <A HREF=mailto:...> tag... GLOBAL.postdata=0; // RAY: This is done automaticaly now for inbox and outbox, // see guivent.c // if(!strcmp(GLOBAL.location,"file://outbox.dgi")) // GLOBAL.reload=RELOAD_CURRENT_LOCATION; // else //Ray: end GLOBAL.reload=NO_RELOAD; } return GOTO_IVEGOTNEWURL; } else return GOTO_READSCRIPT; } else #endif //CLEMTEST //--------------------------------------------------------------- error? return UNKNOWN_PROTOCOL; #ifndef CLEMTEST return CONTINUE_TO_RENDER; #endif //CLEMTEST }
bool Ide::Key(dword key, int count) { dword *k = IdeKeys::AK_DELLINE().key; if(key == k[0] || key == k[1]) { editor.DeleteLine(); return true; } k = IdeKeys::AK_CUTLINE().key; if(key == k[0] || key == k[1]) { editor.CutLine(); return true; } switch(key) { case K_SHIFT_CTRL_UP: case K_SHIFT_CTRL_DOWN: case K_ALT_DELETE: return filelist.Key(key, count); case K_ALT_UP: return filelist.Key(K_UP, 0); case K_ALT_DOWN: return filelist.Key(K_DOWN, 0); case K_ALT_PAGEUP: return package.Key(K_UP, 0); case K_ALT_PAGEDOWN: return package.Key(K_DOWN, 0); case K_CTRL|K_ALT_LEFT: TabsLR(-1); return true; case K_CTRL|K_ALT_RIGHT: TabsLR(1); return true; case K_SHIFT|K_CTRL_O: AddFile(WorkspaceWork::ANY_FILE); return true; case K_CTRL_KEY|K_KEYUP: if(tabi) { tabi = 0; AddLru(); } return true; case K_CTRL_TAB: CycleFiles(); return true; case K_ALT_C|K_SHIFT: CodeBrowser(); return true; case K_ALT_RIGHT: default: if(key >= K_SHIFT_CTRL_0 && key <= K_SHIFT_CTRL_9) { Bookmark& b = bookmark[key - K_SHIFT_CTRL_0]; b.file = editfile; b.pos = editor.GetEditPos(); MakeTitle(); return true; } if(key >= K_CTRL_0 && key <= K_CTRL_9) { GotoBookmark(bookmark[key - K_CTRL_0]); return true; } } return false; }
void Ide::OnMainConfigList() { mainconfigparam = ~mainconfiglist; SetMainConfigList(); MakeTitle(); }