Skip to content

Commit

Permalink
Issue 58: Log user events
Browse files Browse the repository at this point in the history
  • Loading branch information
ragaeeb committed Nov 24, 2014
1 parent ed0e077 commit 01e3f1c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 5 deletions.
16 changes: 14 additions & 2 deletions assets/ConversationView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ Page
title: qsTr("Select All") + Retranslate.onLanguageChanged

onTriggered: {
console.log("UserEvent: SelectAllConversationTriggered");

listView.selectAll();
}
},
Expand All @@ -73,7 +75,9 @@ Page
imageSource: "images/ic_copy.png"
enabled: false

onTriggered: {
onTriggered: {
console.log("UserEvent: CopyConversationTriggered");

var result = concatenate();
persist.copyToClipboard(result);
}
Expand All @@ -85,6 +89,7 @@ Page
ActionBar.placement: 'Signature' in ActionBarPlacement ? ActionBarPlacement.Signature : ActionBarPlacement.OnBar

onTriggered: {
console.log("UserEvent: SaveAllTriggered");
sld.show();
}

Expand All @@ -102,6 +107,8 @@ Page
var result = selectedFiles[0];
persist.saveValueFor("output", result, false);

console.log("UserEvent: ConversationSelectFolderSelected", result);

definition.source = "ProgressDialog.qml";
var progress = definition.createObject();
progress.open();
Expand All @@ -125,6 +132,8 @@ Page
enabled: false

onTriggered: {
console.log("UserEvent: ShareActionTriggered");

persist.showBlockingToast( qsTr("Note that BBM has a maximum limit for the length of text that can be inputted into the message field. So if your conversation is too big it may not paste properly.\n\nUse the Range Selector if the message gets truncated."), qsTr("OK") );
iai.data = persist.convertToUtf8( concatenate() );
}
Expand Down Expand Up @@ -243,6 +252,7 @@ Page
]

onTriggered: {
console.log("UserEvent: MessageTapped");
toggleSelection(indexPath);
}

Expand All @@ -268,7 +278,9 @@ Page
selectionMode: ListSelectionMode.Single

onFinished: {
if (result == SystemUiResult.ConfirmButtonSelection)
console.log("UserEvent: OutputFormatChosen", value);

if (value == SystemUiResult.ConfirmButtonSelection)
{
filePicker.format = selectedIndices[0];
filePicker.directories = [ persist.getValueFor("output"), "/accounts/1000/shared/documents"]
Expand Down
12 changes: 12 additions & 0 deletions assets/ExportPane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ NavigationPane
enabled: false

onTriggered: {
console.log("UserEvent: SelectAllTriggered");

listView.multiSelectHandler.active = true;
listView.selectAll();
}
Expand Down Expand Up @@ -75,6 +77,8 @@ NavigationPane
var progress = definition.createObject();
progress.open();

console.log("UserEvent: AccountSelected", selectedValue);

app.getConversationsFor(selectedValue);
persist.saveValueFor("accountId", selectedValue, false);
}
Expand Down Expand Up @@ -176,6 +180,7 @@ NavigationPane
imageSource: "images/menu/ic_export.png"

onTriggered: {
console.log("UserEvent: ExportTxtTriggered");
control.ListItem.view.doExport([ListItemData.conversationId], OutputFormat.TXT)
}
}
Expand All @@ -185,6 +190,7 @@ NavigationPane
imageSource: "images/menu/ic_export_csv.png"

onTriggered: {
console.log("UserEvent: ExportCsvTriggered");
control.ListItem.view.doExport([ListItemData.conversationId], OutputFormat.CSV)
}
}
Expand All @@ -211,6 +217,7 @@ NavigationPane

onFileSelected : {
var result = selectedFiles[0];
console.log("UserEvent: FolderSelected", result);
persist.saveValueFor("output", result, false);

definition.source = "ProgressDialog.qml";
Expand All @@ -234,6 +241,7 @@ NavigationPane
imageSource: "images/menu/ic_export.png"

onTriggered: {
console.log("UserEvent: ExportTxtMultiTriggered");
listView.doExport( listView.getAllSelected(), OutputFormat.TXT );
}
},
Expand All @@ -245,6 +253,7 @@ NavigationPane
imageSource: "images/menu/ic_export_csv.png"

onTriggered: {
console.log("UserEvent: ExportCsvMultiTriggered");
listView.doExport( listView.getAllSelected(), OutputFormat.CSV );
}
}
Expand Down Expand Up @@ -275,6 +284,8 @@ NavigationPane
page.accountId = accountsDropDown.selectedValue;
page.contact = dataModel.data(indexPath);
navigationPane.push(page);

console.log("UserEvent: ConversationTriggered");
}
}

Expand All @@ -285,6 +296,7 @@ NavigationPane
labelText: qsTr("There are no messages found for that specific mailbox.") + Retranslate.onLanguageChanged

onImageTapped: {
console.log("UserEvent: EmptyConversationTapped");
accountsDropDown.expanded = true;
}
}
Expand Down
1 change: 1 addition & 0 deletions assets/InvokedPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Page

onFileSelected : {
var result = selectedFiles[0];
console.log("UserEvent: InvokedFileSelected", result);
app.saveTextData(result, data);

persist.showBlockingToast( qsTr("Successfully saved file: %1").arg(result), qsTr("OK") );
Expand Down
1 change: 1 addition & 0 deletions assets/PurchasePane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ NavigationPane

onTriggered: {
var data = dataModel.data(indexPath);
console.log("UserEvent: PurchaseElementTapped", data.sku);

if (!data.purchased) {
payment.requestPurchase(data.sku, data.title);
Expand Down
22 changes: 19 additions & 3 deletions assets/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Page
imageSource: "images/dropdown/ic_overwrite.png"
value: 1
}

onSelectedValueChanged: {
console.log("UserEvent: DuplicateAction", selectedValue);
}
}

PersistDropDown
Expand Down Expand Up @@ -74,6 +78,10 @@ Page
infoText.text = qsTr("The time will will be appended in front of the messages with a format like 10:15:03.") + Retranslate.onLanguageChanged;
}
}

onSelectedValueChanged: {
console.log("UserEvent: MessageTimeFormat", selectedValue);
}
}

Label {
Expand All @@ -88,7 +96,9 @@ Page

onTextChanged: {
persist.saveValueFor("userName", text);
infoText.text = qsTr("In the output, messages you sent will be prefixed by: %1").arg(text) + Retranslate.onLanguageChanged
infoText.text = qsTr("In the output, messages you sent will be prefixed by: %1").arg(text) + Retranslate.onLanguageChanged

console.log("UserEvent: UserName", text);
}

text: persist.getValueFor("userName")
Expand All @@ -106,7 +116,9 @@ Page
infoText.text = qsTr("Each message will be double-spaced for better readability.") + Retranslate.onLanguageChanged
} else {
infoText.text = qsTr("Each message will be single-spaced.") + Retranslate.onLanguageChanged
}
}

console.log("UserEvent: DoubleSpaceEnabled", checked);
}
}

Expand All @@ -122,7 +134,9 @@ Page
infoText.text = qsTr("Messages will be ordered from most recent to least recent.");
} else {
infoText.text = qsTr("Messages will be ordered from oldest to newest .");
}
}

console.log("UserEvent: LatestFirstEnabled", checked);
}
}

Expand All @@ -139,6 +153,8 @@ Page
} else {
infoText.text = qsTr("Message timestamps will reflect the time they were created on the device.");
}

console.log("UserEvent: UseServerTimestampEnabled", checked);
}
}

Expand Down
8 changes: 8 additions & 0 deletions assets/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ TabbedPane
delegate: Delegate {
source: "ExportPane.qml"
}

onTriggered: {
console.log("UserEvent: ExportTab");
}
}

Tab
Expand All @@ -30,5 +34,9 @@ TabbedPane
delegate: Delegate {
source: "PurchasePane.qml"
}

onTriggered: {
console.log("UserEvent: PurchasePane");
}
}
}

0 comments on commit 01e3f1c

Please sign in to comment.