Examples of QTreeWidgetItem


Examples of com.trolltech.qt.gui.QTreeWidgetItem

      tagTree.blockSignals(false);
  }
  // Change the icon for a tag
  @SuppressWarnings("unused")
  private void setTagIcon() {
    QTreeWidgetItem currentSelection;
    List<QTreeWidgetItem> selections = tagTree.selectedItems();
    if (selections.size() == 0)
      return;
   
    currentSelection = selections.get(0)
    String guid = currentSelection.text(2);

    QIcon currentIcon = currentSelection.icon(0);
    QIcon icon = conn.getTagTable().getIcon(guid);
    SetIcon dialog;
    if (icon == null) {
      dialog = new SetIcon(currentIcon, saveLastPath);
      dialog.setUseDefaultIcon(true);
    } else {
      dialog = new SetIcon(icon, saveLastPath);
      dialog.setUseDefaultIcon(false);
    }
    dialog.exec();
    if (dialog.okPressed()) {
        saveLastPath = dialog.getPath();
      QIcon newIcon = dialog.getIcon();
      conn.getTagTable().setIcon(guid, newIcon, dialog.getFileType());
      if (newIcon == null)
        newIcon = new QIcon(iconPath+"tag.png");
      currentSelection.setIcon(0, newIcon);
    }
 
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

  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())
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

              return;
    }
   
    List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
        for (int i=selections.size()-1; i>=0; i--) {
          QTreeWidgetItem currentSelection;
        currentSelection = selections.get(i);
          for (int j=0; j<listManager.getSavedSearchIndex().size(); j++) {
            if (listManager.getSavedSearchIndex().get(j).getGuid().equals(currentSelection.text(1))) {
              conn.getSavedSearchTable().expungeSavedSearch(listManager.getSavedSearchIndex().get(j).getGuid(), true);
              listManager.getSavedSearchIndex().remove(j);
              j=listManager.getSavedSearchIndex().size()+1;
            }
          }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      String currentGuid = selectedSavedSearchGUID;
      menuBar.savedSearchEditAction.setEnabled(true);
      menuBar.savedSearchDeleteAction.setEnabled(true);
      menuBar.savedSearchIconAction.setEnabled(true);
      List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
      QTreeWidgetItem currentSelection;
      selectedSavedSearchGUID = "";
      for (int i=0; i<selections.size(); i++) {
        currentSelection = selections.get(i);
        if (currentSelection.text(1).equals(currentGuid)) {
          currentSelection.setSelected(false);
        } else {
          selectedSavedSearchGUID = currentSelection.text(1);
        }
//        i = selections.size() +1;
      }
     
      // There is the potential for no notebooks to be selected if this
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      logger.log(logger.HIGH, "Leaving NeverNote.toggleSavedSearchWindow");
    }
  // Change the icon for a saved search
  @SuppressWarnings("unused")
  private void setSavedSearchIcon() {
    QTreeWidgetItem currentSelection;
    List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
    if (selections.size() == 0)
      return;
   
    currentSelection = selections.get(0)
    String guid = currentSelection.text(1);

    QIcon currentIcon = currentSelection.icon(0);
    QIcon icon = conn.getSavedSearchTable().getIcon(guid);
    SetIcon dialog;
    if (icon == null) {
      dialog = new SetIcon(currentIcon, saveLastPath);
      dialog.setUseDefaultIcon(true);
    } else {
      dialog = new SetIcon(icon, saveLastPath);
      dialog.setUseDefaultIcon(false);
    }
    dialog.exec();
    if (dialog.okPressed()) {
        saveLastPath = dialog.getPath();
      QIcon newIcon = dialog.getIcon();
      conn.getSavedSearchTable().setIcon(guid, newIcon, dialog.getFileType());
      if (newIcon == null)
        newIcon = new QIcon(iconPath+"search.png");
      currentSelection.setIcon(0, newIcon);
    }
 
  }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

       noteIndexUpdated(false);
    }
    // This determines what attribute filter we need, depending upon the selection
    private DateAttributeFilterTable findDateAttributeFilterTable(QTreeWidgetItem w) {
    if (w.parent() != null && w.childCount() > 0) {
      QTreeWidgetItem parent = w.parent();
      if (parent.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Created &&
        w.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Since)
          return Global.createdSinceFilter;
      if (parent.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Created &&
          w.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Before)
              return Global.createdBeforeFilter;
      if (parent.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.LastModified &&
          w.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Since)
              return Global.changedSinceFilter;
        if (parent.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.LastModified &&
            w.data(0,ItemDataRole.UserRole)==AttributeTreeWidget.Attributes.Before)
                  return Global.changedBeforeFilter;
    }
    return null;
    }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

    public void tableSortOrderChanged(Integer column, Integer order) {
     
      // Find what notebook (if any) is selected.  We ignore stacks & the "All Notebooks".
      List<QTreeWidgetItem> selectedNotebook = notebookTree.selectedItems();
      if (selectedNotebook.size() > 0 && !selectedNotebook.get(0).text(0).equalsIgnoreCase("All Notebooks") && !selectedNotebook.get(0).text(2).equalsIgnoreCase("STACK")) {
        QTreeWidgetItem currentSelectedNotebook = selectedNotebook.get(0);
        String notebook;
        notebook = currentSelectedNotebook.text(2);
        conn.getNotebookTable().setSortOrder(notebook, column, order);
      }     
    }
View Full Code Here

Examples of com.trolltech.qt.gui.QTreeWidgetItem

      // pick the first notebook in the list.
      String notebook = null;
      listManager.getNotebookIndex().get(0).getGuid();
      List<QTreeWidgetItem> selectedNotebook = notebookTree.selectedItems();
      if (selectedNotebook.size() > 0 && !selectedNotebook.get(0).text(0).equalsIgnoreCase("All Notebooks") && !selectedNotebook.get(0).text(2).equalsIgnoreCase("STACK")) {
        QTreeWidgetItem currentSelectedNotebook = selectedNotebook.get(0);
        notebook = currentSelectedNotebook.text(2);
      } else {
        boolean found = false;
        List<Notebook> goodNotebooks = new ArrayList<Notebook>();
          for (int i=0; i<listManager.getNotebookIndex().size(); i++) {
            boolean match = false;
            for (int j=0; j<listManager.getArchiveNotebookIndex().size(); j++) {
              if (listManager.getArchiveNotebookIndex().get(j).getGuid().equals(listManager.getNotebookIndex().get(i).getGuid())) {
                match = true;
                j = listManager.getArchiveNotebookIndex().size();
              }
            }
            if (!match)
            //goodNotebooks.add(listManager.getNotebookIndex().get(i).deepCopy());
              goodNotebooks.add((Notebook)Global.deepCopy(listManager.getNotebookIndex().get(i)));
          }
          // Now we have a list of good notebooks, so we can look for the default
           found = false;
           for (int i=0; i<goodNotebooks.size(); i++) {
             if (goodNotebooks.get(i).isDefaultNotebook()) {
               notebook = goodNotebooks.get(i).getGuid();
               found = true;
               i = goodNotebooks.size();
             }
           }
          
           if (goodNotebooks.size() > 0 && !found)
             notebook = goodNotebooks.get(0).getGuid();
    
          if (notebook==null)
            notebook = listManager.getNotebookIndex().get(0).getGuid();       
      }
     
      Note newNote = new Note();
      newNote.setUpdateSequenceNum(0);
      newNote.setGuid(randint);
      newNote.setNotebookGuid(notebook);
      newNote.setTitle("Untitled Note");
      newNote.setContent(noteString.toString());
      newNote.setDeleted(0);
      newNote.setCreated(System.currentTimeMillis());
      newNote.setUpdated(System.currentTimeMillis());
      newNote.setActive(true);
      NoteAttributes na = new NoteAttributes();
      na.setLatitude(0.0);
      na.setLongitude(0.0);
      na.setAltitude(0.0);
      newNote.setAttributes(new NoteAttributes());
    newNote.setTagGuids(new ArrayList<String>());
    newNote.setTagNames(new ArrayList<String>());
     
      // If new notes are to be created based upon the selected tags, then we need to assign the tags
      if (Global.newNoteWithSelectedTags()) { 
        List<QTreeWidgetItem> selections = tagTree.selectedItems();
          QTreeWidgetItem currentSelection;
          for (int i=0; i<selections.size(); i++) {
            currentSelection = selections.get(i);
            newNote.getTagGuids().add(currentSelection.text(2));
            newNote.getTagNames().add(currentSelection.text(0));
          }
      }
     
      conn.getNoteTable().addNote(newNote, true);
      NoteMetadata metadata = new NoteMetadata();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.