if (guid.equalsIgnoreCase("STACK"))
stackSelected = true;
QIcon currentIcon = currentSelection.icon(0);
QIcon icon;
SetIcon dialog;
if (!stackSelected && !allNotebookSelected) {
icon = conn.getNotebookTable().getIcon(guid);
if (icon == null) {
dialog = new SetIcon(currentIcon, saveLastPath);
dialog.setUseDefaultIcon(true);
} else {
dialog = new SetIcon(icon, saveLastPath);
dialog.setUseDefaultIcon(false);
}
} else {
if (stackSelected) {
icon = conn.getSystemIconTable().getIcon(currentSelection.text(0), "STACK");
} else {
icon = conn.getSystemIconTable().getIcon(currentSelection.text(0), "ALLNOTEBOOK");
}
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();
if (stackSelected) {
conn.getSystemIconTable().setIcon(currentSelection.text(0), "STACK", newIcon, dialog.getFileType());
if (newIcon == null) {
newIcon = new QIcon(iconPath+"books2.png");
}
currentSelection.setIcon(0,newIcon);
return;
}
if (allNotebookSelected) {
conn.getSystemIconTable().setIcon(currentSelection.text(0), "ALLNOTEBOOK", newIcon, dialog.getFileType());
if (newIcon == null) {
newIcon = new QIcon(iconPath+"notebook-green.png");
}
currentSelection.setIcon(0,newIcon);
return;
}
conn.getNotebookTable().setIcon(guid, newIcon, dialog.getFileType());
if (newIcon == null) {
boolean isPublished = false;;
boolean found = false;
for (int i=0; i<listManager.getNotebookIndex().size() && !found; i++) {
if (listManager.getNotebookIndex().get(i).getGuid().equals(guid)) {