-
Notifications
You must be signed in to change notification settings - Fork 0
/
Add-ModifyDirtbl.R
45 lines (40 loc) · 1.17 KB
/
Add-ModifyDirtbl.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
library(gWidgets2)
options(guiToolkit = "RGtk2")
source('~/pllist.git/StartMyGuiTrimmer.R')
source('~/pllist.git/ProtoConvertH265Func.R')
source('~/pllist.git/EnterStartStop.R') # for galert()
source('~/pllist.git/addStudioToDmfnfo.R') # wrteStudio, getwplsxx function source
source('~/pllist.git/cleanwplsfn.R') # cleanwplsfn
newStudio=''
load('~/mfnfo.RData')
dtbl=as.data.frame(table(mfnfo$studio),stringsAsFactors = FALSE)
sll=select.list(dtbl$Var1,graphics = TRUE)
w=gwindow()
gg=gedit(sll,cont=w,handler=function(h,...){
print(svalue(gg))
.GlobalEnv$newStudio=svalue(gg)
gtkMainQuit()
})
addHandlerDestroy(w,handler=function(h,...) {
gtkMainQuit()
})
focus(gg)=TRUE
gtkMain()
dispose(gg)
if(!newStudio %in% dtbl$Var1){
cnf=gconfirm(paste('Are you sure you want to add',newStudio,'?'))
if(cnf){
ms=subset(mfnfo,studio==sll)[,c('lsst','studio','cmt')]
ms$studio=newStudio
cd('D:/PNMTALL/RPDNClips')
wrStud(ms$lsst,ms$studio)
ofn=ms$lsst
nfn=sub(sll,newStudio,ofn)
rss=file.rename(ofn,nfn)
galert(paste(sum(rss),'Files Renamed'))
}else{
galert('CANCELLED!')
}
}else{
galert('None Found!')
}