Package cx.fbn.nevernote.evernote

Examples of cx.fbn.nevernote.evernote.NoteMetadata


   
    return new Qt.ItemFlags(flags);
  }
 
  public void updateNoteTitleColor(String guid, int color) {
    NoteMetadata m = metaData.get(guid);
    if (m == null) {
      m = new NoteMetadata();
      m.setGuid(guid);
      metaData.put(guid, m);
    }
    if (metaData.containsKey(guid) && metaData.get(guid).getColor() != color) {
      metaData.get(guid).setColor(color)
      layoutChanged.emit();
View Full Code Here


  public void setNoteSynchronized(String guid, boolean value) {
    getNoteTableModel().updateNoteSyncStatus(guid, value);
  }
 
  public void updateNoteTitleColor(String guid, Integer color) {
    NoteMetadata meta = getNoteMetadata().get(guid);
    if (meta != null) {
      noteModel.updateNoteTitleColor(guid, color);
      meta.setColor(color);
      conn.getNoteTable().updateNoteMetadata(meta);
    }
  }
View Full Code Here

          if (booleanValue())
            noteIsDirty=true;
        }
        if (reader.name().equalsIgnoreCase("TitleColor")) {
          if (metaData.get(note.getGuid()) == null) {
            NoteMetadata m = new NoteMetadata();
            m.setColor(intValue());
            metaData.put(note.getGuid(), m);
          } else
            metaData.get(note.getGuid()).setColor(intValue());
        }
      }
View Full Code Here

      else
        verticalHeader().setDefaultSectionSize(Global.largeThumbnailSize.height());
    }
    for (int i=0; i<runner.getNoteIndex().size(); i++) {
      String guid = runner.getNoteIndex().get(i).getGuid();
      NoteMetadata metaInfo = runner.getNoteMetadata().get(guid);
      if (Global.showDeleted == true && !runner.getNoteIndex().get(i).isActive()) {
        proxyModel.addGuid(guid, null);
      }
      if (!Global.showDeleted == true &&
          (runner.getNoteIndex().get(i).isActive() ||
              metaInfo.isPinned())) {   
        proxyModel.addGuid(guid, metaInfo);
      }
    }

    if (!reload) {
      logger.log(logger.EXTREME, "TableView.load() reload starting.");
      proxyModel.filter();
      setSortingEnabled(true);
      logger.log(logger.EXTREME, "TableView.load() leaving reload.");
      return;
    }
    logger.log(logger.EXTREME, "TableView.load() Filling table data from scratch");
 
    for (int i=0; i<runner.getMasterNoteIndex().size(); i++) {
      if (runner.getMasterNoteIndex().get(i) != null) { 
        Note note = runner.getMasterNoteIndex().get(i);
        NoteMetadata meta = runner.getNoteMetadata().get(note.getGuid());
        insertRow(runner.getMasterNoteIndex().get(i), meta, false, i);             
      }
    }
    proxyModel.invalidate();
   
View Full Code Here

    logger.log(logger.HIGH, "Leaving NoteTable.updateNoteGuid");
  }
  // Update a note
  public void updateNote(Note n) {
    logger.log(logger.HIGH, "Entering NoteTable.updateNote");
    NoteMetadata meta = getNoteMetaInformation(n.getGuid());
    String originalGuid = findAlternateGuid(n.getGuid());
    expungeNote(n.getGuid(), true, false);
    addNote(n, false);
    if (n!=null) {
      updateNoteMetadata(meta);
View Full Code Here

  // This is a convenience method to check if a note exists & update/create based upon it
  public void syncNote(Note note) {
    logger.log(logger.HIGH, "Entering NoteTable.syncNote");
    // If we got the note from Evernote we use its
    // metadata instead of the local copy.
    NoteMetadata meta = null;
    if (note.getAttributes() != null && note.getAttributes().getSourceApplication() != null) {
      meta = extractMetadata(note.getAttributes().getSourceApplication());
    } else
      meta = getNoteMetaInformation(note.getGuid());
   
    // Now, if the note exists we simply update it.  Otherwise we
    // add a new note.
    if (exists(note.getGuid())) {
      updateNote(note);
    }
    else
      addNote(note, false);
   
    // If we have metadata, we write it out.
    if (meta != null) {
      meta.setGuid(note.getGuid());
      updateNoteMetadata(meta);
    }
    logger.log(logger.HIGH, "Leaving NoteTable.syncNote");
  }
View Full Code Here

    if (!query.exec("Select guid,titleColor, isDirty, pinned from Note"))
      logger.log(logger.EXTREME, "Note SQL retrieve has failed on getNoteMetaInformation.");

    // Get a list of the notes
    while (query.next()) {
      NoteMetadata note = new NoteMetadata();
      note.setGuid(query.valueString(0));
      note.setColor(query.valueInteger(1));
      note.setDirty(query.valueBoolean(2, false));
      int pinned = query.valueInteger(3);
      if (pinned > 0)
        note.setPinned(true);
      returnValue.put(note.getGuid(), note);
   

    return returnValue;
  }
View Full Code Here

    query.bindValue(":guid", guid);
    query.exec();

    // Get a list of the notes
    while (query.next()) {
      NoteMetadata note = new NoteMetadata();
      note.setGuid(query.valueString(0));
      note.setColor(query.valueInteger(1));
      note.setDirty(query.valueBoolean(2, false));
      int pinned = query.valueInteger(3);
      if (pinned > 0)
        note.setPinned(true);
      return note;
   

    return null;
  }
View Full Code Here

    String consumerKey = "baumgarte:{";
    int startPos = sourceApplication.indexOf(consumerKey);
    if (startPos < 0 )
        return null;
   
    NoteMetadata meta = new NoteMetadata();
    startPos = startPos+consumerKey.length();
   
//    String startString = sourceApplication.substring(0,startPos);
    String metaString = sourceApplication.substring(startPos);
//    String endString = metaString.substring(metaString.indexOf("};"));
    int endPos = metaString.indexOf("};");
    if (endPos > 0)
      metaString = metaString.substring(0,endPos);
   
    String value = parseMetaString(metaString, "titleColor");
    if (value != null)
      meta.setColor(Integer.parseInt(value));
   
    value = parseMetaString(metaString, "pinned");
    if (value != null && value.equals(true))
      meta.setPinned(true);
       
    return meta;
  }
View Full Code Here

  private void notePinned() {
    logger.log(logger.EXTREME, "Entering NeverNote.notePinned()");
    setNoteDirty();

      for (int j=0; j<selectedNoteGUIDs.size(); j++) {
        NoteMetadata meta = listManager.getNoteMetadata().get(selectedNoteGUIDs.get(j));
        boolean pinned = !meta.isPinned();
        meta.setPinned(pinned);   // Toggle the pinned/unpinned
       
        // Update the list & table
        listManager.updateNoteMetadata(meta)
        noteTableView.proxyModel.addGuid(selectedNoteGUIDs.get(j), meta);
      }
View Full Code Here

TOP

Related Classes of cx.fbn.nevernote.evernote.NoteMetadata

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.