@Action public void doSave() { System.out.println("doSave"); if (!isValidSettings()) { return; } String jobName = userPanel.getAccountName() + "@" + userPanel.getHostName(); Job jobToSave = this.job; Config c; if (jobToSave == null) { DavRepo davRepo = new DavRepo(); List<Root> roots = new ArrayList<Root>(); List<Repo> repos = new ArrayList<Repo>(); repos.add(davRepo); jobToSave = new Job(jobName, repos, roots); jobToSave.setConfig(config); davRepo.setJob(jobToSave); config.getJobs().add(jobToSave); c = config; } else { c = jobToSave.getConfig(); } scanService.cancelScan(); // if scanning, cancel it so new changes can take effect String accPath = c.getMediaLoungePath(userPanel.getAccountName()); userPanel.save(accPath, jobToSave); backupLocations1.save("", jobToSave); jobToSave.getConfig().save(); scanService.scan(); _(QueueManager.class).setPaused(false); doClose(); }
private String getNextScanText() { long nextScanTime = scanService.delayUntilNextScanSecs() * 1000 + System.currentTimeMillis(); Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(nextScanTime); String nextScan = pad2(cal.get(Calendar.HOUR_OF_DAY)) + ":" + pad2(cal.get(Calendar.MINUTE)); return nextScan; }
/** Creates new form QueueView */ public QueueView( ScanService scanService, EventManager eventManager, QueueManager queueProcessor, Queue queue, Repo repo) { this.queue = queue; this.scanService = scanService; this.repo = repo; this.queueProcessor = queueProcessor; this.eventManager = eventManager; this.setTitle("Queue: " + repo.getDescription()); initComponents(); TableUtils.setTimeColumn(tblQueue, "Started"); TableUtils.setTimeColumn(tblQueue, "Completed"); // TableRowSorter rowSorter = new TableRowSorter( tblQueue.getModel()); // tblQueue.setRowSorter( rowSorter ); File scanDir = scanService.getCurrentScanDir(); if (scanDir != null) { lblCurrentDirVal.setText(scanDir.getAbsolutePath()); } eventManager.registerEventListener(this, ScanDirEvent.class); eventManager.registerEventListener(this, ScanEvent.class); eventManager.registerEventListener(this, QueueProcessEvent.class); ImageIcon imageIcon = new ImageIcon(getClass().getResource("/logo16x16.png"), ""); setIconImage(imageIcon.getImage()); showNextScan(); initCurrent(); }