Package cx.fbn.nevernote.dialog

Examples of cx.fbn.nevernote.dialog.SavedSearchEdit


    //***************************************************************
  // Add a new notebook
  @SuppressWarnings("unused")
  private void addSavedSearch() {
    logger.log(logger.HIGH, "Inside NeverNote.addSavedSearch");
    SavedSearchEdit edit = new SavedSearchEdit();
    edit.setSearchList(listManager.getSavedSearchIndex());
    edit.exec();
 
    if (!edit.okPressed())
      return;
       
    Calendar currentTime = new GregorianCalendar();   
     Long l = new Long(currentTime.getTimeInMillis());
    String randint = new String(Long.toString(l));
 
    SavedSearch search = new SavedSearch();
    search.setUpdateSequenceNum(0);
    search.setGuid(randint);
    search.setName(edit.getName());
    search.setQuery(edit.getQuery());
    search.setFormat(QueryFormat.USER);
    listManager.getSavedSearchIndex().add(search);
    conn.getSavedSearchTable().addSavedSearch(search, true);
    savedSearchIndexUpdated();
    logger.log(logger.HIGH, "Leaving NeverNote.addSavedSearch");
View Full Code Here


  }
  // Edit an existing tag
  @SuppressWarnings("unused")
  private void editSavedSearch() {
    logger.log(logger.HIGH, "Entering NeverNote.editSavedSearch");
    SavedSearchEdit edit = new SavedSearchEdit();
    edit.setTitle(tr("Edit Search"));
    List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
    QTreeWidgetItem currentSelection;
    currentSelection = selections.get(0);
    String guid = currentSelection.text(1);
    SavedSearch s = conn.getSavedSearchTable().getSavedSearch(guid);
    edit.setName(currentSelection.text(0));
    edit.setQuery(s.getQuery());
    edit.setSearchList(listManager.getSavedSearchIndex());
    edit.exec();
 
    if (!edit.okPressed())
      return;
       
    List<SavedSearch> list = listManager.getSavedSearchIndex();
    SavedSearch search = null;
    boolean found = false;
    for (int i=0; i<list.size(); i++) {
      search = list.get(i);
      if (search.getGuid().equals(guid)) {
        i=list.size();
        found = true;
      }
    }
    if (!found)
      return;
    search.setName(edit.getName());
    search.setQuery(edit.getQuery());
    conn.getSavedSearchTable().updateSavedSearch(search, true);
    savedSearchIndexUpdated();
    logger.log(logger.HIGH, "Leaving NeverNote.editSavedSearch");
  }
View Full Code Here

TOP

Related Classes of cx.fbn.nevernote.dialog.SavedSearchEdit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.