Skip to content

Commit

Permalink
Add missing file in git, and prepare 0.3.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoît HERVIER committed Mar 22, 2012
1 parent 7d35374 commit aca4f1a
Show file tree
Hide file tree
Showing 8 changed files with 246 additions and 1 deletion.
48 changes: 48 additions & 0 deletions khtsimpletext/qml/NewFilePage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import "components"
import 'common.js' as Common

Page {
id: root

property string filePath;

tools: commonTools

PageHeader {
id: header
title: 'KhtSimpleText : New File'
subtitle: Common.beautifulPath(filePath);
}

Column {
anchors.top: header.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 12
spacing: 12

Label {
text: "New file"
}

TextField {
id: inputField
anchors.left: parent.left
anchors.right: parent.right
placeholderText: "File name"
}

Button {
anchors.left: parent.left
anchors.right: parent.right
enabled: inputField.text != ""
text: "Create file"
onClicked: {
pageStack.replace(fileEditPage, { filePath: filePath + '/' +inputField.text });
}
}
}
}
51 changes: 51 additions & 0 deletions khtsimpletext/qml/NewFolderPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import "components"
import 'common.js' as Common

Page {
id: root

property string filePath;

tools: commonTools

PageHeader {
id: header
title: 'KhtSimpleText : New Folder'
subtitle: Common.beautifulPath(filePath);
}

Column {
anchors.top: header.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 12
spacing: 12

Label {
text: "New folder"
}

TextField {
id: inputField
anchors.left: parent.left
anchors.right: parent.right
placeholderText: "Folder name"
}

Button {
anchors.left: parent.left
anchors.right: parent.right
enabled: inputField.text != ""
text: "Create folder"
onClicked: {
pageStack.pop();
if (!QmlFileReaderWriter.newFolder(filePath + inputField.text)) {
errorBanner.text = 'An error occur while creating new folder';
errorBanner.show();}
}
}
}
}
51 changes: 51 additions & 0 deletions khtsimpletext/qml/RenamePage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import "components"
import 'common.js' as Common

Page {
id: root

property string filePath;
property string fileName;

tools: commonTools

PageHeader {
id: header
title: 'KhtSimpleText : Rename'
subtitle: Common.beautifulPath(filePath);
}

Column {
anchors.top: header.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: 12
spacing: 12

Label {
text: 'Rename ' + fileName + ' to :'
}

TextField {
id: inputField
anchors.left: parent.left
anchors.right: parent.right
placeholderText: fileName
}

Button {
anchors.left: parent.left
anchors.right: parent.right
enabled: inputField.text != ""
text: "Rename"
onClicked: {
pageStack.pop();
if (!QmlFileReaderWriter.rename(filePath + fileName, filePath + inputField.text))
errorRenameBanner.show();
}
}
}
}
7 changes: 7 additions & 0 deletions khtsimpletext/qml/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function beautifulPath(path) {
var filepath = new String(path);
filepath = filepath.replace('file://', '');
filepath = filepath.replace('/home/user', '~');

return filepath;
}
36 changes: 36 additions & 0 deletions khtsimpletext/qml/components/ItemMenu.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import QtQuick 1.1
import com.nokia.meego 1.0
//import '../common.js' as Common

Menu {
id: itemMenu
visualParent: pageStack

//property PageStack pageStack
property string filePath
property string fileName

MenuLayout {
MenuItem {
text: qsTr("Copy")
enabled: false
onClicked: ;
}
MenuItem {
text: qsTr("Move")
enabled: false
onClicked: ;
}
MenuItem {
text: qsTr("Rename")
onClicked: pageStack.replace(renameFilePage, { filePath: filePath, fileName: fileName });
}
MenuItem {
text: qsTr("Delete")
onClicked: {
deleteQueryDialog.filepath = filePath;
deleteQueryDialog.open();
}
}
}
}
41 changes: 41 additions & 0 deletions khtsimpletext/qml/components/PageHeader.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import QtQuick 1.1
import com.nokia.meego 1.0

Rectangle {
id:header

property alias title: headerlabel.text
property alias subtitle: headerpathlabel.text

anchors.top: parent.top
width:parent.width
height:70
color:'darkgrey'
z:2

Text{
id:headerlabel
anchors.top: parent.top
anchors.right: parent.right
anchors.left: parent.left
anchors.topMargin: 5
anchors.leftMargin: 10
anchors.rightMargin: 50
font { bold: false; family: "Nokia Pure Text"; pixelSize: 30; }
color:"white"
text:'KhtSimpleText'
}

Text{
id:headerpathlabel
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.left: parent.left
anchors.bottomMargin: 5
anchors.leftMargin: 10
anchors.rightMargin: 50
font { bold: false; family: "Nokia Pure Text"; pixelSize: 16; }
color:"#cc6633"
text:''
}
}
11 changes: 11 additions & 0 deletions khtsimpletext_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

"""KhtSimpleText a plain text editor by Khertan"""

import khtsimpletext
import sys

if __name__ == '__main__':
sys.exit(khtsimpletext.KhtSimpleText().exec_())

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
reload(sys).setdefaultencoding("UTF-8")

changelog = '* Implement rename and delete feature in contextual menu * fix package display name'
buildversion = 1
buildversion = '1'

try:
from sdist_maemo import sdist_maemo as _sdist_maemo
Expand Down

0 comments on commit aca4f1a

Please sign in to comment.