https://bugs.kde.org/show_bug.cgi?id=463247

himcesjf.p...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |himcesjf.p...@gmail.com

--- Comment #10 from himcesjf.p...@gmail.com ---
In kdeconnect-kde/smsapp/qml/ConversationList.qml, the +New button requires
SmsHelper.isAddressValid() to be true for the button to be enabled. The
SmsHelper.isAddressValid() function can only be called when there is text in
the input field. If there is no text in the input field, then the function will
not be called, and the +New button will remain disabled.

So +New button is enabled when the following conditions are met:
1. There is text in the search field.
2. The text in the search field is a valid phone number (minimum of 3 digits
and maximum upto 15 digits)
3. The device is connected.

Hence, the observed result of +New button appeared greyed out upon opening KDE
Connect > SMS Messages as there is no text in the input field by default upon
opening.


For the expected result of 'When Opening KDE Connect > SMS Messages +New button
is available and can create new SMS Message' --

1. +New button to be available

onEnabledChanged: {
    enabled = true
}

//we want the button to be enabled whenever the application is opened,
regardless of whether the device is connected or not. So, we use the
onEnabledChanged() signal to set the enabled property of the button to true.
Did not use onCreated() signal as the button would only be enabled once, when
the application is first opened. If the device is not connected when the
application is first opened, the button would be disabled.

2. Now that the button is enabled upon opening, too allow creating SMS when the
device is connected, the number is valideate SMS. 

onClicked: {
    if (deviceConnected && SmsHelper.isAddressValid(filter.text)) {
        conversationListModel.createConversationForAddress(filter.text)
        view.currentIndex = 0
    }
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to