Skip to content

Commit

Permalink
rework page info
Browse files Browse the repository at this point in the history
remove old dialog
fix l10n
set titles
add tooltips
  • Loading branch information
Siedlerchr committed Nov 11, 2018
1 parent 7746782 commit 93ac650
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 278 deletions.
234 changes: 0 additions & 234 deletions src/main/java/org/jabref/gui/openoffice/CitationManager.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<TableView fx:id="tvCitations" prefHeight="208.0" prefWidth="662.0">
<columns>
<TableColumn fx:id="colCitation" prefWidth="251.0" text="%Citation" />
<TableColumn fx:id="colExtraInfo" prefWidth="425.0" text="%Extra information" />
<TableColumn fx:id="colExtraInfo" prefWidth="425.0" text="%Extra information (e.g. page number)"/>
</columns>
</TableView>
</content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.jabref.gui.DialogService;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.ValueTableCellFactory;
import org.jabref.logic.l10n.Localization;

import com.airhacks.afterburner.views.ViewLoader;
import com.sun.star.beans.UnknownPropertyException;
Expand Down Expand Up @@ -41,6 +42,8 @@ public ManageCitationsDialogView(OOBibBase ooBase, DialogService dialogService)
}
return null;
});

setTitle(Localization.lang("Manage citations"));
}

@FXML
Expand All @@ -63,7 +66,6 @@ private void initialize() throws NoSuchElementException, WrappedTargetException,
cell.getRowValue().setExtraInfo(cell.getNewValue());
});
colExtraInfo.setCellFactory(TextFieldTableCell.forTableColumn());

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@ public ManageCitationsDialogViewModel(OOBibBase ooBase, DialogService dialogServ
ManageCitationsItemViewModel itemViewModelEntry = ManageCitationsItemViewModel.fromCitationEntry(entry);
citations.add(itemViewModelEntry);
}

}

//TODO: Call store settings after edit commit
//update reference then and call refresh/sync in the background
public void storeSettings() {
List<CitationEntry> ciationEntries = citations.stream().map(ManageCitationsItemViewModel::toCitationEntry).collect(Collectors.toList());
try {
for (CitationEntry entry : ciationEntries) {
Optional<String> pageInfo = entry.getPageInfo();
if (entry.pageInfoChanged() && pageInfo.isPresent()) {
if (pageInfo.isPresent()) {
ooBase.setCustomProperty(entry.getRefMarkName(), pageInfo.get());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import org.jabref.gui.DialogService;
import org.jabref.gui.util.BaseDialog;
import org.jabref.logic.l10n.Localization;
import org.jabref.logic.openoffice.OpenOfficePreferences;
import org.jabref.logic.util.OS;
import org.jabref.preferences.PreferencesService;
Expand Down Expand Up @@ -57,8 +58,8 @@ public ManualConnectDialogView(DialogService dialogService) {
return null;
});

setTitle(Localization.lang("Set connection parameters"));
}

@FXML
private void initialize() {
this.preferences = preferencesService.getOpenOfficePreferences();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<top>
<TableView fx:id="tvStyles" prefHeight="208.0" prefWidth="662.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn fx:id="colName" prefWidth="75.0" text="%Name" />
<TableColumn fx:id="colJournals" prefWidth="75.0" text="%Jorurnals" />
<TableColumn fx:id="colName" prefWidth="75.0" text="%Name"/>
<TableColumn fx:id="colJournals" prefWidth="75.0" text="%Journals" />
<TableColumn fx:id="colFile" prefWidth="75.0" text="%File" />
<TableColumn fx:id="colDeleteIcon" minWidth="60.0" prefWidth="60.0" />
</columns>
</TableView>
</top>
<right>
<Button fx:id="add" alignment="TOP_RIGHT" mnemonicParsing="false" onAction="#addStyleFile" text="%add" BorderPane.alignment="CENTER" />
<Button fx:id="add" alignment="TOP_RIGHT" mnemonicParsing="false" onAction="#addStyleFile" text="%Add style file" BorderPane.alignment="CENTER" />
</right>
<bottom>
<VBox fx:id="vbox" prefHeight="84.0" prefWidth="665.0" BorderPane.alignment="CENTER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public StyleSelectDialogView(DialogService dialogService, StyleLoader loader) {
return null;

});
setTitle(Localization.lang("Style selection"));
}

@FXML
Expand All @@ -89,6 +90,8 @@ private void initialize() {

}).withOnMouseClickedEvent(item -> {
return evt -> viewModel.deleteStyle();
}).withTooltip(item -> {
return Localization.lang("Remove style");
}).install(colDeleteIcon);

edit.setOnAction(e -> viewModel.editStyle());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void addStyleFile() {
preferences.setCurrentStyle(stylePath);
styles.setAll(loadStyles());
} else {
dialogService.showErrorDialogAndWait(Localization.lang("Invalid style selected"));
dialogService.showErrorDialogAndWait(Localization.lang("Invalid style selected"), Localization.lang("You must select a valid style file."));
}
});

Expand Down
Loading

0 comments on commit 93ac650

Please sign in to comment.