Skip to content

Commit

Permalink
Added phone number and last backup date to the info tab
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxiHuHe04 committed Feb 2, 2023
1 parent 4e3e728 commit 61148f3
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import me.maxih.itunes_backup_explorer.api.BackupInfo;
import me.maxih.itunes_backup_explorer.api.BackupManifest;

public class InfoTabController {
Expand All @@ -14,6 +15,8 @@ public class InfoTabController {
@FXML
private TextField infoUUID;
@FXML
private TextField infoPhoneNumber;
@FXML
private Label infoProductType;
@FXML
private Label infoProductVersion;
Expand All @@ -24,9 +27,11 @@ public class InfoTabController {
@FXML
private Label infoVersion;
@FXML
private Label infoDate;
private Label infoCreationDate;
@FXML
private Label infoLastDate;

public void updateInformation(BackupManifest manifest) {
public void updateInformation(BackupManifest manifest, BackupInfo info) {
this.infoDeviceName.setText(manifest.deviceName);
this.infoSerialNumber.setText(manifest.serialNumber);
this.infoUUID.setText(manifest.uniqueDeviceID);
Expand All @@ -35,7 +40,14 @@ public void updateInformation(BackupManifest manifest) {
this.infoBuildVersion.setText(manifest.buildVersion);
this.infoEncrypted.setText(manifest.encrypted ? "yes" : "no");
this.infoVersion.setText(manifest.version);
this.infoDate.setText(manifest.date.toString());
this.infoCreationDate.setText(manifest.date.toString());
if (info == null) {
this.infoPhoneNumber.setText("");
this.infoLastDate.setText("Unknown");
} else {
this.infoPhoneNumber.setText(info.phoneNumber == null ? "" : info.phoneNumber);
this.infoLastDate.setText(info.lastBackupDate.toString());
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void selectBackup(ITunesBackup backup) {
if (selectedBackup != null) sidebarButtons.get(selectedBackup).setSelected(false);
this.selectedBackup = backup;

this.infoTabPageController.updateInformation(backup.manifest);
this.infoTabPageController.updateInformation(backup.manifest, backup.getBackupInfo().orElse(null));

Node selectedTabPage = this.tabPane.getSelectionModel().getSelectedItem().getContent();
if (this.lockedTabPages.contains(selectedTabPage) && !this.tryUnlock())
Expand Down
90 changes: 59 additions & 31 deletions src/main/resources/me/maxih/itunes_backup_explorer/info_tab.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,118 +3,146 @@
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<AnchorPane xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="me.maxih.itunes_backup_explorer.ui.InfoTabController">
<ScrollPane style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<?import javafx.scene.text.*?>

<AnchorPane xmlns="http://javafx.com/javafx/11.0.14-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="me.maxih.itunes_backup_explorer.ui.InfoTabController">
<ScrollPane style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<VBox>
<HBox>
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Device name">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoDeviceName" prefWidth="300.0"/>
<Label fx:id="infoDeviceName" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="10.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Serial number">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<TextField fx:id="infoSerialNumber" editable="false" prefWidth="300.0">
<font>
<Font name="Monospaced Regular" size="11.0"/>
<Font name="Monospaced Regular" size="11.0" />
</font>
</TextField>
</HBox>
<HBox layoutX="10.0" layoutY="37.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Unique device identifier">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<TextField fx:id="infoUUID" editable="false" prefWidth="300.0">
<font>
<Font name="Monospaced Regular" size="11.0" />
</font>
</TextField>
</HBox>
<HBox layoutX="24.0" layoutY="84.0">
<VBox.margin>
<Insets bottom="10.0"/>
</VBox.margin>
<Label prefWidth="150.0" text="Phone number">
<HBox.margin>
<Insets/>
</HBox.margin>
</Label>
<TextField fx:id="infoPhoneNumber" editable="false" prefWidth="300.0">
<font>
<Font name="Monospaced Regular" size="11.0"/>
</font>
</TextField>
</HBox>
<HBox layoutX="10.0" layoutY="64.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Product type">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoProductType" prefWidth="300.0"/>
<Label fx:id="infoProductType" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="91.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Product version">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoProductVersion" prefWidth="300.0"/>
<Label fx:id="infoProductVersion" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="108.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Build version">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoBuildVersion" prefWidth="300.0"/>
<Label fx:id="infoBuildVersion" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="125.0">
<VBox.margin>
<Insets bottom="10.0" top="20.0"/>
<Insets bottom="10.0" top="20.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Encrypted">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoEncrypted" prefWidth="300.0"/>
<Label fx:id="infoEncrypted" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="192.0">
<VBox.margin>
<Insets bottom="10.0"/>
<Insets bottom="10.0" />
</VBox.margin>
<Label prefWidth="150.0" text="Version">
<HBox.margin>
<Insets/>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoVersion" prefWidth="300.0"/>
<Label fx:id="infoVersion" prefWidth="300.0" />
</HBox>
<HBox layoutX="10.0" layoutY="219.0">
<Label prefWidth="150.0" text="Date">
<Label prefWidth="150.0" text="Creation date">
<HBox.margin>
<Insets />
</HBox.margin>
</Label>
<Label fx:id="infoCreationDate" prefWidth="300.0" />
<VBox.margin>
<Insets bottom="10.0" />
</VBox.margin>
</HBox>
<HBox layoutX="24.0" layoutY="272.0">
<VBox.margin>
<Insets/>
</VBox.margin>
<Label prefWidth="150.0" text="Last backup date">
<HBox.margin>
<Insets/>
</HBox.margin>
</Label>
<Label fx:id="infoDate" prefWidth="300.0"/>
<Label fx:id="infoLastDate" prefWidth="300.0"/>
</HBox>
<padding>
<Insets bottom="14.0" left="14.0" right="14.0" top="14.0"/>
<Insets bottom="14.0" left="14.0" right="14.0" top="14.0" />
</padding>
</VBox>
</ScrollPane>
Expand Down

0 comments on commit 61148f3

Please sign in to comment.