10import QtQuick.Controls 
 
   15import org.mauikit.controls as Maui
 
   16import org.mauikit.filebrowsing as FB
 
   17import org.mauikit.imagetools as IT
 
   40    property alias url : _infoModel.url
 
   46    title: _infoModel.fileName
 
   48    spacing: Maui.Style.space.huge
 
   50    signal gpsEdited(var url)
 
   54        Layout.fillWidth: true
 
   55        Layout.preferredHeight: 200
 
 
   56        color: Qt.darker(Maui.Theme.backgroundColor, 1.1)
 
   63            fillMode: Image.PreserveAspectCrop
 
   64            sourceSize.width: width
 
   65            sourceSize.height: height
 
   76                anchors.centerIn: parent
 
   77                text: _infoModel.pixelSize.width + 
" x " +  _infoModel.pixelSize.height
 
   79                padding: 
Maui.Style.defaultPadding
 
   83                    radius: 
Maui.Style.radiusV
 
   92        Layout.fillWidth: 
true 
   95        list.urls: [control.url]
 
  102        property alias key : _keyField.text
 
  103        property alias value : _valueField.text
 
  106        message: 
i18nd(
"mauikitimagetools",
"Editing Exif tag")
 
  113            Layout.fillWidth: 
true 
  114            placeholderText: 
i18nd(
"mauikitimagetools",
"Tag key")
 
  120            Layout.fillWidth: 
true 
  121            placeholderText: 
i18nd(
"mauikitimagetools",
"Tag value")
 
  126            console.log(_editTagDialog.key, _editTagDialog.value)
 
  127            if(_infoModel.editTag(_editTagDialog.key, _editTagDialog.value))
 
  129                _editTagDialog.close()
 
  132                _editTagDialog.alert(
i18nd(
"mauikitimagetools",
"Could not edit the tag"), 2)
 
  138            _editTagDialog.close()
 
  141        function set(key, value)
 
  143            _editTagDialog.key = key
 
  144            _editTagDialog.value = value
 
  145            _editTagDialog.open()
 
  153        property string value
 
  155        title: 
i18n (
"Remove")
 
  156        message: 
i18nd(
"mauikitimagetools",
"Are you sure you want to remove the Exif tag %1?", _removeTagDialog.value)
 
  162            if(_infoModel.removeTag(_removeTagDialog.key))
 
  164                _removeTagDialog.close()
 
  167                _removeTagDialog.alert(i18nd(
"mauikitimagetools",
"Could not remove the tag"), 2)
 
  173            _removeTagDialog.close()
 
  176        function set(key, value)
 
  178            _removeTagDialog.key = key
 
  179            _removeTagDialog.value = value
 
  180            _removeTagDialog.open()
 
  188        title: 
i18n (
"Comment")
 
  193            Layout.fillWidth: 
true 
  194            Layout.preferredHeight: 200
 
  196            text: _infoModel.exifComment
 
  202            _infoModel.setComment(_commentArea.text)
 
  203            _commentDialog.close()
 
  206        onRejected: _commentDialog.close()
 
  221            Maui.Controls.title: placeholderText
 
  222            placeholderText: 
i18n(
"Latitude")
 
  223            validator: DoubleValidator
 
  225                notation: DoubleValidator.StandardNotation
 
  227            Layout.fillWidth: 
true 
  233            placeholderText: 
i18n(
"Longitude")
 
  234            Maui.Controls.title: placeholderText
 
  237            validator: DoubleValidator
 
  239                notation: DoubleValidator.StandardNotation
 
  241            Layout.fillWidth: 
true 
  263            if(_infoModel.setGpsData(_lat.text, _lon.text))
 
  265                control.gpsEdited(control.url)
 
  266                _editTagDialog.close()
 
  269                _editTagDialog.alert(
i18nd(
"mauikitimagetools",
"Could not save the GPS data"), 2)
 
  275            _gpsTagDialog.close()
 
  281        Layout.fillWidth: 
true 
  283        title: 
i18nd(
"mauikitimagetools",
"Details")
 
  284        description: 
i18nd(
"mauikitimagetools",
"File information")
 
  288            model: 
Maui.BaseModel
 
  290                list: IT.PicInfoModel
 
  296            delegate: 
Maui.FlexSectionItem
 
  298                visible: model.value && String(model.value).length > 0
 
  299                label1.text: model.name
 
  300                label2.text: model.value
 
  305                    icon.name: 
"document-edit" 
  306                    onClicked: _editTagDialog.set(model.key, model.value)
 
  312                    icon.name: 
"edit-delete" 
  313                    onClicked: _removeTagDialog.set(model.key, model.value)
 
  320            Layout.fillWidth: 
true 
  324            onClicked: _editTagDialog.open()
 
  330        Layout.fillWidth: 
true 
  332        title: 
i18nd(
"mauikitimagetools",
"Comment & Description")
 
  336            text: _infoModel.exifComment
 
  337            visible: text.length > 0
 
  338            Layout.fillWidth: 
true 
  339            Layout.preferredHeight: 100
 
  345            spacing: 
Maui.Style.defaultSpacing
 
  346            Layout.fillWidth: 
true 
  350                text: 
i18n(
"Add Comment")
 
  351                Layout.fillWidth: true
 
  352                onClicked: _commentDialog.open()
 
  357                text: 
i18n(
"Remove Comment")
 
  358                Layout.fillWidth: true
 
  359                visible: _infoModel.exifComment.length>0
 
  360                onClicked: _infoModel.removeComment()
 
  368        Layout.fillWidth: 
true 
  370        title: 
i18nd(
"mauikitimagetools",
"GPS")
 
  371        description: 
i18nd(
"mauikitimagetools",
"Geolocation tags")
 
  375            visible: _mapLoader.visible
 
  376            label1.text: 
i18n(
"City")
 
  377            label2.text: _infoModel.cityName
 
  382            spacing: 
Maui.Style.defaultSpacing
 
  383            Layout.fillWidth: 
true 
  387                Layout.fillWidth: 
true 
  388                text: 
i18n(
"Set GPS info")
 
  389                onClicked: _gpsTagDialog.open()
 
  395                active: _mapLoader.active
 
  397                Layout.fillWidth: 
true 
  401                    text: 
i18n(
"Remove GPS info")
 
  403                    onClicked: _infoModel.removeGpsData()
 
  413            visible: _infoModel.lat !== 0 &&  _infoModel.lon !== 0
 
  414            Layout.fillWidth: 
true 
  415            Layout.preferredHeight: 400
 
  420                color: 
Maui.Theme.backgroundColor
 
  440                    latitude: _infoModel.lat
 
  441                    longitude:_infoModel.lon
 
  448                    color: 
Maui.Theme.highlightColor
 
  451                Component.onCompleted:
 
  453                    map.addMapItem(
map.circle)
 
Q_SCRIPTABLE CaptureState status()
 
QString i18nd(const char *domain, const char *text, const TYPE &arg...)
 
QString i18n(const char *text, const TYPE &arg...)
 
KIOCORE_EXPORT QStringList list(const QString &fileClass)
 
QString name(StandardAction id)
 
QTextStream & center(QTextStream &stream)
 
QFuture< void > map(Iterator begin, Iterator end, MapFunctor &&function)