Commits

Michele Lacchia committed e94d46d

Implemented Find and Find&Replace

  • Participants
  • Parent commits 6c36505

Comments (0)

Files changed (12)

 
 # Form implementation generated from reading ui file '/home/miki/pyedit/Ui files/FindDialog.ui'
 #
-# Created: Thu Apr 29 15:35:04 2010
-#      by: PyQt4 UI code generator 4.6
+# Created: Tue May  4 16:53:53 2010
+#      by: PyQt4 UI code generator 4.7.2
 #
 # WARNING! All changes made in this file will be lost!
 
         self.CB_Regexp = QtGui.QCheckBox(self.groupBox)
         self.CB_Regexp.setObjectName("CB_Regexp")
         self.verticalLayout.addWidget(self.CB_Regexp)
+        self.CB_WrapAround = QtGui.QCheckBox(self.groupBox)
+        self.CB_WrapAround.setObjectName("CB_WrapAround")
+        self.verticalLayout.addWidget(self.CB_WrapAround)
         self.verticalLayout_2.addWidget(self.groupBox)
         self.horizontalLayout_2 = QtGui.QHBoxLayout()
         self.horizontalLayout_2.setObjectName("horizontalLayout_2")
 
         self.retranslateUi(Dialog)
         QtCore.QObject.connect(self.ButtonClose, QtCore.SIGNAL("clicked()"), Dialog.reject)
+        QtCore.QObject.connect(self.CB_Regexp, QtCore.SIGNAL("toggled(bool)"), self.CB_WholeWordsOnly.setDisabled)
+        QtCore.QObject.connect(self.CB_Regexp, QtCore.SIGNAL("toggled(bool)"), self.CB_CaseSensitive.setDisabled)
         QtCore.QMetaObject.connectSlotsByName(Dialog)
 
     def retranslateUi(self, Dialog):
         self.CB_CaseSensitive.setText(QtGui.QApplication.translate("Dialog", "Case sensitive", None, QtGui.QApplication.UnicodeUTF8))
         self.CB_WholeWordsOnly.setText(QtGui.QApplication.translate("Dialog", "Whole words only", None, QtGui.QApplication.UnicodeUTF8))
         self.CB_Regexp.setText(QtGui.QApplication.translate("Dialog", "Regular expression", None, QtGui.QApplication.UnicodeUTF8))
+        self.CB_WrapAround.setText(QtGui.QApplication.translate("Dialog", "Wrap around the end of the text", None, QtGui.QApplication.UnicodeUTF8))
         self.ButtonClose.setText(QtGui.QApplication.translate("Dialog", "Close", None, QtGui.QApplication.UnicodeUTF8))
         self.ButtonFind.setText(QtGui.QApplication.translate("Dialog", "Find", None, QtGui.QApplication.UnicodeUTF8))
         self.ButtonFind.setShortcut(QtGui.QApplication.translate("Dialog", "Return", None, QtGui.QApplication.UnicodeUTF8))

FindDialog.pyc

Binary file modified.

FindReplaceDialog.py

 
 # Form implementation generated from reading ui file '/home/miki/pyedit/Ui files/FindReplaceDialog.ui'
 #
-# Created: Thu Apr 29 15:35:15 2010
-#      by: PyQt4 UI code generator 4.6
+# Created: Sat May  8 11:05:09 2010
+#      by: PyQt4 UI code generator 4.7.2
 #
 # WARNING! All changes made in this file will be lost!
 
 class Ui_Dialog(object):
     def setupUi(self, Dialog):
         Dialog.setObjectName("Dialog")
-        Dialog.resize(381, 248)
+        Dialog.resize(435, 273)
         sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
         sizePolicy.setHorizontalStretch(1)
         sizePolicy.setVerticalStretch(0)
         self.CB_Regexp = QtGui.QCheckBox(self.groupBox)
         self.CB_Regexp.setObjectName("CB_Regexp")
         self.verticalLayout.addWidget(self.CB_Regexp)
+        self.CB_WrapAround = QtGui.QCheckBox(self.groupBox)
+        self.CB_WrapAround.setObjectName("CB_WrapAround")
+        self.verticalLayout.addWidget(self.CB_WrapAround)
         self.verticalLayout_2.addWidget(self.groupBox)
         self.horizontalLayout_2 = QtGui.QHBoxLayout()
         self.horizontalLayout_2.setObjectName("horizontalLayout_2")
         self.ButtonClose = QtGui.QPushButton(Dialog)
         self.ButtonClose.setObjectName("ButtonClose")
         self.horizontalLayout_2.addWidget(self.ButtonClose)
-        self.ButtonReplace = QtGui.QPushButton(Dialog)
-        self.ButtonReplace.setObjectName("ButtonReplace")
-        self.horizontalLayout_2.addWidget(self.ButtonReplace)
+        self.ButtonReplaceAll = QtGui.QPushButton(Dialog)
+        self.ButtonReplaceAll.setObjectName("ButtonReplaceAll")
+        self.horizontalLayout_2.addWidget(self.ButtonReplaceAll)
+        self.ButtonReplaceNext = QtGui.QPushButton(Dialog)
+        self.ButtonReplaceNext.setObjectName("ButtonReplaceNext")
+        self.horizontalLayout_2.addWidget(self.ButtonReplaceNext)
         self.verticalLayout_2.addLayout(self.horizontalLayout_2)
 
         self.retranslateUi(Dialog)
         QtCore.QObject.connect(self.ButtonClose, QtCore.SIGNAL("clicked()"), Dialog.reject)
+        QtCore.QObject.connect(self.CB_Regexp, QtCore.SIGNAL("toggled(bool)"), self.CB_WholeWordsOnly.setDisabled)
+        QtCore.QObject.connect(self.CB_Regexp, QtCore.SIGNAL("toggled(bool)"), self.CB_CaseSensitive.setDisabled)
         QtCore.QMetaObject.connectSlotsByName(Dialog)
 
     def retranslateUi(self, Dialog):
         self.CB_CaseSensitive.setText(QtGui.QApplication.translate("Dialog", "Case sensitive", None, QtGui.QApplication.UnicodeUTF8))
         self.CB_WholeWordsOnly.setText(QtGui.QApplication.translate("Dialog", "Whole words only", None, QtGui.QApplication.UnicodeUTF8))
         self.CB_Regexp.setText(QtGui.QApplication.translate("Dialog", "Regular expression", None, QtGui.QApplication.UnicodeUTF8))
+        self.CB_WrapAround.setText(QtGui.QApplication.translate("Dialog", "Wrap around the end of the text", None, QtGui.QApplication.UnicodeUTF8))
         self.ButtonClose.setText(QtGui.QApplication.translate("Dialog", "Close", None, QtGui.QApplication.UnicodeUTF8))
-        self.ButtonReplace.setText(QtGui.QApplication.translate("Dialog", "Replace all", None, QtGui.QApplication.UnicodeUTF8))
-        self.ButtonReplace.setShortcut(QtGui.QApplication.translate("Dialog", "Return", None, QtGui.QApplication.UnicodeUTF8))
+        self.ButtonReplaceAll.setText(QtGui.QApplication.translate("Dialog", "Replace all", None, QtGui.QApplication.UnicodeUTF8))
+        self.ButtonReplaceAll.setShortcut(QtGui.QApplication.translate("Dialog", "Return", None, QtGui.QApplication.UnicodeUTF8))
+        self.ButtonReplaceNext.setText(QtGui.QApplication.translate("Dialog", "Replace next", None, QtGui.QApplication.UnicodeUTF8))
 
 import PyEdit_rc

FindReplaceDialog.pyc

Binary file modified.

MainWindow.pyc

Binary file modified.
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file '/home/miki/pyedit/MainWindow.ui'
+#
+# Created: Sat Apr 24 15:18:43 2010
+#      by: PyQt4 UI code generator 4.6
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore, QtGui
+
+class Ui_MainWindow(object):
+    def setupUi(self, MainWindow):
+        MainWindow.setObjectName("MainWindow")
+        MainWindow.resize(822, 600)
+        icon = QtGui.QIcon()
+        icon.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Textedit.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        MainWindow.setWindowIcon(icon)
+        self.centralwidget = QtGui.QWidget(MainWindow)
+        self.centralwidget.setObjectName("centralwidget")
+        self.gridLayout = QtGui.QGridLayout(self.centralwidget)
+        self.gridLayout.setObjectName("gridLayout")
+        self.Tab = QtGui.QTabBar(self.centralwidget)
+        self.Tab.setShape(QtGui.QTabBar.RoundedNorth)
+        self.Tab.setDocumentMode(False)
+        self.Tab.setTabsClosable(True)
+        self.Tab.setMovable(True)
+        self.Tab.setObjectName("Tab")
+        self.tab = QtGui.QWidget()
+        self.tab.setObjectName("tab")
+        self.verticalLayout = QtGui.QVBoxLayout(self.tab)
+        self.verticalLayout.setObjectName("verticalLayout")
+        self.Text = Qsci.QsciScintilla(self.tab)
+        self.Text.setObjectName("Text")
+        self.verticalLayout.addWidget(self.Text)
+        self.Tab.addTab("")
+        self.gridLayout.addWidget(self.Tab, 0, 0, 1, 1)
+        MainWindow.setCentralWidget(self.centralwidget)
+        self.menubar = QtGui.QMenuBar(MainWindow)
+        self.menubar.setGeometry(QtCore.QRect(0, 0, 822, 27))
+        self.menubar.setObjectName("menubar")
+        self.menuFile = QtGui.QMenu(self.menubar)
+        self.menuFile.setObjectName("menuFile")
+        self.menuEdit = QtGui.QMenu(self.menubar)
+        self.menuEdit.setObjectName("menuEdit")
+        self.menuFind = QtGui.QMenu(self.menubar)
+        self.menuFind.setObjectName("menuFind")
+        self.menu_Help = QtGui.QMenu(self.menubar)
+        self.menu_Help.setObjectName("menu_Help")
+        MainWindow.setMenuBar(self.menubar)
+        self.statusbar = QtGui.QStatusBar(MainWindow)
+        self.statusbar.setObjectName("statusbar")
+        MainWindow.setStatusBar(self.statusbar)
+        self.toolBar = QtGui.QToolBar(MainWindow)
+        self.toolBar.setIconSize(QtCore.QSize(27, 27))
+        self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
+        self.toolBar.setObjectName("toolBar")
+        MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
+        self.actionNew = QtGui.QAction(MainWindow)
+        icon1 = QtGui.QIcon()
+        icon1.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-New-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionNew.setIcon(icon1)
+        self.actionNew.setObjectName("actionNew")
+        self.actionOpen = QtGui.QAction(MainWindow)
+        icon2 = QtGui.QIcon()
+        icon2.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-Open-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionOpen.setIcon(icon2)
+        self.actionOpen.setObjectName("actionOpen")
+        self.actionSave = QtGui.QAction(MainWindow)
+        icon3 = QtGui.QIcon()
+        icon3.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-Save-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionSave.setIcon(icon3)
+        self.actionSave.setObjectName("actionSave")
+        self.actionUndo = QtGui.QAction(MainWindow)
+        icon4 = QtGui.QIcon()
+        icon4.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Undo-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionUndo.setIcon(icon4)
+        self.actionUndo.setObjectName("actionUndo")
+        self.actionRedo = QtGui.QAction(MainWindow)
+        icon5 = QtGui.QIcon()
+        icon5.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Redo-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionRedo.setIcon(icon5)
+        self.actionRedo.setObjectName("actionRedo")
+        self.actionCut = QtGui.QAction(MainWindow)
+        icon6 = QtGui.QIcon()
+        icon6.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Cut-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionCut.setIcon(icon6)
+        self.actionCut.setObjectName("actionCut")
+        self.actionCopy = QtGui.QAction(MainWindow)
+        icon7 = QtGui.QIcon()
+        icon7.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Copy-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionCopy.setIcon(icon7)
+        self.actionCopy.setObjectName("actionCopy")
+        self.actionPaste = QtGui.QAction(MainWindow)
+        icon8 = QtGui.QIcon()
+        icon8.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Paste-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionPaste.setIcon(icon8)
+        self.actionPaste.setObjectName("actionPaste")
+        self.actionSelect_All = QtGui.QAction(MainWindow)
+        icon9 = QtGui.QIcon()
+        icon9.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Select-All-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionSelect_All.setIcon(icon9)
+        self.actionSelect_All.setObjectName("actionSelect_All")
+        self.actionFind = QtGui.QAction(MainWindow)
+        icon10 = QtGui.QIcon()
+        icon10.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Find-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionFind.setIcon(icon10)
+        self.actionFind.setObjectName("actionFind")
+        self.actionReplace = QtGui.QAction(MainWindow)
+        icon11 = QtGui.QIcon()
+        icon11.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Edit-Find-Replace-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionReplace.setIcon(icon11)
+        self.actionReplace.setObjectName("actionReplace")
+        self.actionPrint = QtGui.QAction(MainWindow)
+        icon12 = QtGui.QIcon()
+        icon12.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Printer-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionPrint.setIcon(icon12)
+        self.actionPrint.setObjectName("actionPrint")
+        self.actionSettings = QtGui.QAction(MainWindow)
+        icon13 = QtGui.QIcon()
+        icon13.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Preferences-System-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionSettings.setIcon(icon13)
+        self.actionSettings.setObjectName("actionSettings")
+        self.actionChiudi = QtGui.QAction(MainWindow)
+        icon14 = QtGui.QIcon()
+        icon14.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Window-Close-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionChiudi.setIcon(icon14)
+        self.actionChiudi.setObjectName("actionChiudi")
+        self.actionEsci = QtGui.QAction(MainWindow)
+        icon15 = QtGui.QIcon()
+        icon15.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Application-Exit-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionEsci.setIcon(icon15)
+        self.actionEsci.setObjectName("actionEsci")
+        self.actionSave_as = QtGui.QAction(MainWindow)
+        icon16 = QtGui.QIcon()
+        icon16.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-Save-As-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionSave_as.setIcon(icon16)
+        self.actionSave_as.setObjectName("actionSave_as")
+        self.actionGo_to_line = QtGui.QAction(MainWindow)
+        icon17 = QtGui.QIcon()
+        icon17.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Go-Jump-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionGo_to_line.setIcon(icon17)
+        self.actionGo_to_line.setObjectName("actionGo_to_line")
+        self.actionAbout_PyEdit = QtGui.QAction(MainWindow)
+        icon18 = QtGui.QIcon()
+        icon18.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Help-About-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionAbout_PyEdit.setIcon(icon18)
+        self.actionAbout_PyEdit.setObjectName("actionAbout_PyEdit")
+        self.actionAbout_Qt = QtGui.QAction(MainWindow)
+        icon19 = QtGui.QIcon()
+        icon19.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Help-Faq-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionAbout_Qt.setIcon(icon19)
+        self.actionAbout_Qt.setObjectName("actionAbout_Qt")
+        self.actionPrint_preview = QtGui.QAction(MainWindow)
+        icon20 = QtGui.QIcon()
+        icon20.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-Print-Preview-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionPrint_preview.setIcon(icon20)
+        self.actionPrint_preview.setObjectName("actionPrint_preview")
+        self.actionZoom_in = QtGui.QAction(MainWindow)
+        icon21 = QtGui.QIcon()
+        icon21.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Zoom-In-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionZoom_in.setIcon(icon21)
+        self.actionZoom_in.setObjectName("actionZoom_in")
+        self.actionZoom_out = QtGui.QAction(MainWindow)
+        icon22 = QtGui.QIcon()
+        icon22.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Zoom-Out-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionZoom_out.setIcon(icon22)
+        self.actionZoom_out.setObjectName("actionZoom_out")
+        self.actionDocument_stats = QtGui.QAction(MainWindow)
+        icon23 = QtGui.QIcon()
+        icon23.addPixmap(QtGui.QPixmap(":/__icons__/__icons__/Gnome-Document-Properties-64.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+        self.actionDocument_stats.setIcon(icon23)
+        self.actionDocument_stats.setObjectName("actionDocument_stats")
+        self.menuFile.addAction(self.actionNew)
+        self.menuFile.addAction(self.actionOpen)
+        self.menuFile.addSeparator()
+        self.menuFile.addAction(self.actionSave)
+        self.menuFile.addAction(self.actionSave_as)
+        self.menuFile.addSeparator()
+        self.menuFile.addAction(self.actionPrint)
+        self.menuFile.addAction(self.actionPrint_preview)
+        self.menuFile.addSeparator()
+        self.menuFile.addAction(self.actionChiudi)
+        self.menuFile.addAction(self.actionEsci)
+        self.menuEdit.addAction(self.actionUndo)
+        self.menuEdit.addAction(self.actionRedo)
+        self.menuEdit.addSeparator()
+        self.menuEdit.addAction(self.actionZoom_in)
+        self.menuEdit.addAction(self.actionZoom_out)
+        self.menuEdit.addSeparator()
+        self.menuEdit.addAction(self.actionCut)
+        self.menuEdit.addAction(self.actionCopy)
+        self.menuEdit.addAction(self.actionPaste)
+        self.menuEdit.addSeparator()
+        self.menuEdit.addAction(self.actionSelect_All)
+        self.menuEdit.addSeparator()
+        self.menuEdit.addAction(self.actionSettings)
+        self.menuFind.addAction(self.actionFind)
+        self.menuFind.addAction(self.actionReplace)
+        self.menuFind.addSeparator()
+        self.menuFind.addAction(self.actionGo_to_line)
+        self.menuFind.addSeparator()
+        self.menuFind.addAction(self.actionDocument_stats)
+        self.menu_Help.addAction(self.actionAbout_PyEdit)
+        self.menu_Help.addAction(self.actionAbout_Qt)
+        self.menubar.addAction(self.menuFile.menuAction())
+        self.menubar.addAction(self.menuEdit.menuAction())
+        self.menubar.addAction(self.menuFind.menuAction())
+        self.menubar.addAction(self.menu_Help.menuAction())
+        self.toolBar.addAction(self.actionNew)
+        self.toolBar.addAction(self.actionOpen)
+        self.toolBar.addAction(self.actionSave)
+        self.toolBar.addSeparator()
+        self.toolBar.addAction(self.actionUndo)
+        self.toolBar.addAction(self.actionRedo)
+        self.toolBar.addSeparator()
+        self.toolBar.addAction(self.actionCut)
+        self.toolBar.addAction(self.actionCopy)
+        self.toolBar.addAction(self.actionPaste)
+        self.toolBar.addAction(self.actionSelect_All)
+        self.toolBar.addSeparator()
+        self.toolBar.addAction(self.actionFind)
+        self.toolBar.addAction(self.actionReplace)
+        self.toolBar.addSeparator()
+        self.toolBar.addAction(self.actionPrint)
+        self.toolBar.addAction(self.actionPrint_preview)
+        self.toolBar.addAction(self.actionSettings)
+
+        self.retranslateUi(MainWindow)
+        self.Tab.setCurrentIndex(0)
+        QtCore.QObject.connect(self.actionUndo, QtCore.SIGNAL("triggered()"), self.Text.undo)
+        QtCore.QObject.connect(self.actionRedo, QtCore.SIGNAL("triggered()"), self.Text.redo)
+        QtCore.QObject.connect(self.actionCut, QtCore.SIGNAL("triggered()"), self.Text.cut)
+        QtCore.QObject.connect(self.actionCopy, QtCore.SIGNAL("triggered()"), self.Text.copy)
+        QtCore.QObject.connect(self.actionPaste, QtCore.SIGNAL("triggered()"), self.Text.paste)
+        QtCore.QObject.connect(self.actionSelect_All, QtCore.SIGNAL("triggered()"), self.Text.selectAll)
+        QtCore.QObject.connect(self.actionZoom_in, QtCore.SIGNAL("triggered()"), self.Text.zoomIn)
+        QtCore.QObject.connect(self.actionZoom_out, QtCore.SIGNAL("triggered()"), self.Text.zoomOut)
+        QtCore.QMetaObject.connectSlotsByName(MainWindow)
+
+    def retranslateUi(self, MainWindow):
+        MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "PyEdit 0.1", None, QtGui.QApplication.UnicodeUTF8))
+        self.Tab.setTabText(0, QtGui.QApplication.translate("MainWindow", "Untitled", None, QtGui.QApplication.UnicodeUTF8))
+        self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8))
+        self.menuEdit.setTitle(QtGui.QApplication.translate("MainWindow", "&Edit", None, QtGui.QApplication.UnicodeUTF8))
+        self.menuFind.setTitle(QtGui.QApplication.translate("MainWindow", "F&ind", None, QtGui.QApplication.UnicodeUTF8))
+        self.menu_Help.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8))
+        self.toolBar.setWindowTitle(QtGui.QApplication.translate("MainWindow", "toolBar", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionNew.setText(QtGui.QApplication.translate("MainWindow", "New", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionNew.setToolTip(QtGui.QApplication.translate("MainWindow", "Create a new file", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionNew.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+N", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionOpen.setText(QtGui.QApplication.translate("MainWindow", "Open", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionOpen.setToolTip(QtGui.QApplication.translate("MainWindow", "Open an existing file", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionOpen.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+O", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSave.setText(QtGui.QApplication.translate("MainWindow", "Save", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSave.setToolTip(QtGui.QApplication.translate("MainWindow", "Save the current file", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSave.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+S", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionUndo.setText(QtGui.QApplication.translate("MainWindow", "Undo", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionUndo.setToolTip(QtGui.QApplication.translate("MainWindow", "Undo the last action", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionUndo.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+U", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionRedo.setText(QtGui.QApplication.translate("MainWindow", "Redo", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionRedo.setToolTip(QtGui.QApplication.translate("MainWindow", "Redo the last action", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionRedo.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+R", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCut.setText(QtGui.QApplication.translate("MainWindow", "Cut", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCut.setToolTip(QtGui.QApplication.translate("MainWindow", "Cut selected text", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCut.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+X", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCopy.setText(QtGui.QApplication.translate("MainWindow", "Copy", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCopy.setToolTip(QtGui.QApplication.translate("MainWindow", "Copy the selected text", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionCopy.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+C", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPaste.setText(QtGui.QApplication.translate("MainWindow", "Paste", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPaste.setToolTip(QtGui.QApplication.translate("MainWindow", "Paste the text in clipboard", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPaste.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+V", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSelect_All.setText(QtGui.QApplication.translate("MainWindow", "Select All", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSelect_All.setToolTip(QtGui.QApplication.translate("MainWindow", "Select all the text", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionFind.setText(QtGui.QApplication.translate("MainWindow", "Find", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionFind.setToolTip(QtGui.QApplication.translate("MainWindow", "Look for a string", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionFind.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+F", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionReplace.setText(QtGui.QApplication.translate("MainWindow", "Replace", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPrint.setText(QtGui.QApplication.translate("MainWindow", "Print", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPrint.setToolTip(QtGui.QApplication.translate("MainWindow", "Print the text", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPrint.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+P", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSettings.setText(QtGui.QApplication.translate("MainWindow", "Settings", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionChiudi.setText(QtGui.QApplication.translate("MainWindow", "Chiudi", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionChiudi.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+W", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionEsci.setText(QtGui.QApplication.translate("MainWindow", "Esci", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionEsci.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionSave_as.setText(QtGui.QApplication.translate("MainWindow", "Save as...", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionGo_to_line.setText(QtGui.QApplication.translate("MainWindow", "Go to line", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionAbout_PyEdit.setText(QtGui.QApplication.translate("MainWindow", "About PyEdit", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionAbout_Qt.setText(QtGui.QApplication.translate("MainWindow", "About Qt", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionPrint_preview.setText(QtGui.QApplication.translate("MainWindow", "Print preview", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionZoom_in.setText(QtGui.QApplication.translate("MainWindow", "Zoom in", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionZoom_in.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl++", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionZoom_out.setText(QtGui.QApplication.translate("MainWindow", "Zoom out", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionZoom_out.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+-", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionDocument_stats.setText(QtGui.QApplication.translate("MainWindow", "Document stats", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionDocument_stats.setToolTip(QtGui.QApplication.translate("MainWindow", "Show document statistics", None, QtGui.QApplication.UnicodeUTF8))
+        self.actionDocument_stats.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+T", None, QtGui.QApplication.UnicodeUTF8))
+
+from PyQt4 import Qsci
+import PyEdit_rc

Ui files/FindDialog.ui

     <x>0</x>
     <y>0</y>
     <width>379</width>
-    <height>209</height>
+    <height>234</height>
    </rect>
   </property>
   <property name="windowTitle">
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="CB_WrapAround">
+        <property name="text">
+         <string>Wrap around the end of the text</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
      <item>
       <widget class="QPushButton" name="ButtonFind">
        <property name="text">
-        <string>Find</string>
+        <string>Find next</string>
        </property>
        <property name="shortcut">
         <string>Return</string>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>CB_Regexp</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>CB_WholeWordsOnly</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>117</x>
+     <y>120</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>112</x>
+     <y>103</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>CB_Regexp</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>CB_CaseSensitive</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>135</x>
+     <y>123</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>129</x>
+     <y>85</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>

Ui files/FindReplaceDialog.ui

    <rect>
     <x>0</x>
     <y>0</y>
-    <width>381</width>
-    <height>248</height>
+    <width>435</width>
+    <height>273</height>
    </rect>
   </property>
   <property name="sizePolicy">
         </property>
        </widget>
       </item>
+      <item>
+       <widget class="QCheckBox" name="CB_WrapAround">
+        <property name="text">
+         <string>Wrap around the end of the text</string>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
       </widget>
      </item>
      <item>
-      <widget class="QPushButton" name="ButtonReplace">
+      <widget class="QPushButton" name="ButtonReplaceAll">
        <property name="text">
         <string>Replace all</string>
        </property>
        </property>
       </widget>
      </item>
+     <item>
+      <widget class="QPushButton" name="ButtonReplaceNext">
+       <property name="text">
+        <string>Replace next</string>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
   </layout>
    <slot>reject()</slot>
    <hints>
     <hint type="sourcelabel">
-     <x>130</x>
-     <y>223</y>
+     <x>140</x>
+     <y>262</y>
     </hint>
     <hint type="destinationlabel">
      <x>102</x>
     </hint>
    </hints>
   </connection>
+  <connection>
+   <sender>CB_Regexp</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>CB_WholeWordsOnly</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>110</x>
+     <y>172</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>116</x>
+     <y>151</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>CB_Regexp</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>CB_CaseSensitive</receiver>
+   <slot>setDisabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>83</x>
+     <y>181</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>85</x>
+     <y>131</y>
+    </hint>
+   </hints>
+  </connection>
  </connections>
 </ui>

Ui files/GoLine.ui

+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Dialog</class>
+ <widget class="QDialog" name="Dialog">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>264</width>
+    <height>45</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Fixed" vsizetype="Expanding">
+    <horstretch>0</horstretch>
+    <verstretch>0</verstretch>
+   </sizepolicy>
+  </property>
+  <property name="windowTitle">
+   <string>Go to line</string>
+  </property>
+  <property name="windowIcon">
+   <iconset resource="PyEdit.qrc">
+    <normaloff>:/__icons__/__icons__/Gnome-Go-Jump-64.png</normaloff>:/__icons__/__icons__/Gnome-Go-Jump-64.png</iconset>
+  </property>
+  <layout class="QHBoxLayout" name="horizontalLayout">
+   <item>
+    <widget class="QLineEdit" name="lineEdit">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>1</horstretch>
+       <verstretch>1</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="baseSize">
+      <size>
+       <width>0</width>
+       <height>0</height>
+      </size>
+     </property>
+     <property name="dragEnabled">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources>
+  <include location="PyEdit.qrc"/>
+ </resources>
+ <connections/>
+</ui>

Ui files/MainWindow.ui

      <x>0</x>
      <y>0</y>
      <width>822</width>
-     <height>27</height>
+     <height>25</height>
     </rect>
    </property>
    <widget class="QMenu" name="menuFile">
             ('.py', '.pyw'):'Python',
             ('.rb'):'Ruby',
             ('.p'):'Pascal',
-            ('.h', '.c', '.cpp'):'CPP',
+            ('.h', '.cpp'):'CPP',
+            ('.c'):'CMake',
             ('.htm', '.html'):'HTML',
-            ('.java'):'Java'
+            ('.java'):'Java',
+            ('.xml', '.ui'):'XML'
             }
     curWindowTitle = 'PyEdit 0.1'
     filePath = ''
     f_words = []
     fr_words = []
+    currentDocuments = []
+    currentDocumentsIndex = 0
     def __init__(self):
+    	'''
+    	Setup the QMainWindow with the function setupUi from MainWindow.py and connect Actions with functions
+    	'''
         QtGui.QMainWindow.__init__(self)
         self.setupUi(self)
         self.showMaximized()
         self.Text.setFocus()
         self.Text.zoomIn()
+        self.currentDocuments.append(self.Text)
+        self.Text.setBackspaceUnindents(True)
+        self.Text.setTabIndents(True)
         self.connect(self.actionNew, QtCore.SIGNAL('triggered()'), self.new)
         self.connect(self.actionOpen, QtCore.SIGNAL('triggered()'), self.open_)
         self.connect(self.actionSave_as, QtCore.SIGNAL('triggered()'), self.saveAs)
         self.connect(self.actionSave, QtCore.SIGNAL('triggered()'), self.save)
-        self.connect(self.actionFind, QtCore.SIGNAL('triggered()'), self.find)
-        self.connect(self.actionReplace, QtCore.SIGNAL('triggered()'), self.replace)
-        self.connect(self.Text, QtCore.SIGNAL('textChanged()'), self.changed)
+        self.connect(self.actionFind, QtCore.SIGNAL('triggered()'), self.findDialog)
+        self.connect(self.actionReplace, QtCore.SIGNAL('triggered()'), self.replaceDialog)
+        self.connect(self.Tab, QtCore.SIGNAL('tabCloseRequested(int)'), self.closeTab)
+        self.connect(self.Tab, QtCore.SIGNAL('currentChanged(int)'), self.tabChanged)
+        self.connect(self.Text, QtCore.SIGNAL('modificationChanged(bool)'), self.changed)
         
     def closeEvent(self, event):
+    	'''
+    	Overload the closeEvent, i.e. the function run when the program is closed
+    	'''
         if self.canGo():
             event.accept()
         else:
             event.ignore()
+
+    def closeTab(self, index):
+        '''
+        Close the current tab
+        '''
+        if self.canGo():
+            self.Tab.removeTab(index)
+            del self.currentDocuments[self.currentDocumentsIndex]
+            self.currentDocumentsIndex -= 1
+            self.Text = self.currentDocuments[self.currentDocumentsIndex]
+            self.connectText()
+
+    def tabChanged(self, index):
+        self.currentDocumentsIndex = index
+        self.Text = self.currentDocuments[self.currentDocumentsIndex]
+        self.connectText()
+        self.setTitle()
+
+    def connectText(self):
+        '''
+        Re-connect self.Text when it change
+        '''
+        self.connect(self.Text, QtCore.SIGNAL('modificationChanged(bool)'), self.changed)
         
     def setLexer(self, lang):
+    	'''
+    	Set the lexer for the specified language and set up some settings
+    	'''
         lex = getattr(Qsci, 'QsciLexer%s' % (lang))()
         self.Text.setLexer(lex)
         self.Text.setAutoIndent(True)
         self.Text.setIndentationsUseTabs(False)
         self.Text.setAutoCompletionThreshold(2)
         self.Text.setMarginLineNumbers(1, True)
-        
+
     def canGo(self):
+    	'''
+    	If the text is changed this function asks to save or to close the file without saving
+    	'''
+    	if self.Tab.count() == 0:
+    	    return True
         if self.Text.isModified():
             button = QtGui.QMessageBox.warning(self, self.tr('Save document?'), self.tr('Do you want to save the changes to this document before closing?\n\nIf you don\'t save, your changes will be lost.'), QtGui.QMessageBox.Save | QtGui.QMessageBox.Discard | QtGui.QMessageBox.Cancel)
             if button == QtGui.QMessageBox.Save:
                 return False
         return True
 
-    def changed(self):
-    	tabText = str(self.Tab.tabText(0))
-    	self.Text.setModified(True)
-    	if tabText[0] != '*':
-            self.Tab.setTabText(0, '*'+tabText)
-            self.setWindowTitle('*'+self.curWindowTitle)
+    def changed(self, m):
+    	'''
+    	Add and remove an asterisk if the text changes or is saved
+    	'''
+    	if m:
+    	    self.addAsterisk()
+        else:
+            self.removeAsterisk()
 
     def new(self):
-        if self.canGo():
-            self.Text.clear()
-            self.Text.setModified(False)
-            self.Tab.setTabText(0, 'Untitled')
-            self.setWindowTitle('PyEdit 0.1')
+    	'''
+    	Add a new tab
+    	'''
+    	self.currentDocuments.append(Qsci.QsciScintilla())
+    	self.currentDocumentsIndex += 1
+    	self.Text = self.currentDocuments[self.currentDocumentsIndex]
+        self.Text.setModified(False)
+        self.connectText()
+        self.Tab.setCurrentIndex(self.Tab.addTab(self.Text, 'Untitled'))
+        self.setWindowTitle('PyEdit 0.1')
         
     def open_(self):
+    	'''
+    	Open a file if the current file is saved
+    	'''
         if self.canGo():
-            filePath = QtGui.QFileDialog.getOpenFileName(self, self.tr('Choose a file'), os.getcwd())
+            filePath = QtGui.QFileDialog.getOpenFileName(self, self.tr('Choose a file'), os.getcwd())
             if filePath:
                 self.filePath = str(filePath)
                 self.fileName = os.path.basename(self.filePath)
                 self.curWindowTitle = "%s (%s) - PyEdit" % (self.fileName, os.path.dirname(self.filePath))
+                if str(self.Tab.tabText(self.currentDocumentsIndex)) != 'Untitled':
+                    self.new()
                 self.loadFile()
             
     def save(self):
+    	'''
+    	If the text isn't saved yet, it runs saveAs, else saveFile
+    	'''
         if str(self.Text.text()) == '' or self.filePath == '':
             return self.saveAs()
         self.saveFile()
         
     def saveAs(self):
+    	'''
+    	Save As
+    	'''
         filePath = QtGui.QFileDialog.getSaveFileName(self, self.tr('Choose the file name'), os.getcwd())
         if filePath:
             self.filePath = str(filePath)
             self.setTitle()
 
     def saveFile(self):
+    	'''
+    	Save a file
+    	'''
         file_ = open(self.filePath, 'w')
         file_.write(str(self.Text.text()))
         file_.close()
     	self.Text.setModified(False)
     	self.checkForExtensions()
     	self.removeAsterisk()
-        self.statusbar.showMessage(self.tr('Saved file: «%s»' % (self.filePath)))
+        self.statusbar.showMessage(self.tr(u'Saved file: «%s»' % (self.filePath)))
 
     def loadFile(self):
+    	'''
+    	Load a file (open a file)
+    	'''
         file_ = open(self.filePath, 'r')
         self.Text.insert(file_.read())
         self.checkForExtensions()
         file_.close()
             
     def checkForExtensions(self):
+    	'''
+    	If the file extension is in self.langs, it add the Lexer
+    	'''
         ext = os.path.splitext(self.filePath)[1]
         for extension in self.langs:
                 if ext in extension:
                     break
             
     def setTitle(self):
-        self.Tab.setTabText(0, self.fileName)
+    	'''
+    	Set the title to the window and the tab
+    	'''
+        self.Tab.setTabText(self.currentDocumentsIndex, self.fileName)
         self.setWindowTitle(self.curWindowTitle)
+
+    def addAsterisk(self):
+        tabText = str(self.Tab.tabText(self.currentDocumentsIndex))
+        if tabText[0] != '*':
+            self.Tab.setTabText(self.currentDocumentsIndex, '*'+tabText)
+            self.setWindowTitle('*'+self.curWindowTitle)
             
     def removeAsterisk(self):
-        tabText = str(self.Tab.tabText(0))
+        tabText = str(self.Tab.tabText(self.currentDocumentsIndex))
         if tabText[0] == '*':
             self.setWindowTitle(self.curWindowTitle)
-            self.Tab.setTabText(0, tabText[1:])
+            self.Tab.setTabText(self.currentDocumentsIndex, tabText[1:])
             
-    def find(self):
+    def findDialog(self):
         dialog = Find()
         dialog.exec_()
         
-    def highlightFound(self, string, re, cs, ww):
-        print string, re, cs, ww
-        self.Text.find(string, re, cs, ww)
+    def find(self, string, re, cs, ww, wa):
+        self.Text.findFirst(string, re, cs, ww, wa)
         
-    def replace(self):
+    def replaceDialog(self):
         dialog = Replace()
         dialog.exec_()
-            
+
+    def replaceAll(self, rep, string, re, cs, ww, wa):
+        while self.Text.findFirst(string, re, cs, ww, wa):
+            self.Text.replace(rep)
+
+    def replaceNext(self, rep, string, re, cs, ww, wa):
+        self.Text.findFirst(string, re, cs, ww, wa)
+        self.Text.replace(rep)
+
+
 class Find(QtGui.QDialog, FindDialog):
     def __init__(self):
         QtGui.QDialog.__init__(self)
         self.setupUi(self)
-        self.connect(self.CB_Regexp, QtCore.SIGNAL('toggled(bool)'), self.unCheck)
         self.connect(self.ButtonFind, QtCore.SIGNAL('clicked()'), self.find)
         
-    def unCheck(self, c):
-        self.CB_WholeWordsOnly.setEnabled(not c)
-        self.CB_CaseSensitive.setEnabled(not c)
-        
     def find(self):
-        main.highlightFound(
-                            self.ComboBox.currentText(),
-                            self.CB_Regexp.isChecked(),
-                            self.CB_CaseSensitive.isChecked(),
-                            self.CB_WholeWordsOnly.isChecked(),
-                            )
+        main.find(
+                self.ComboBox.currentText(),
+                self.CB_Regexp.isChecked(),
+                self.CB_CaseSensitive.isChecked(),
+                self.CB_WholeWordsOnly.isChecked(),
+                self.CB_WrapAround.isChecked()
+                )
         
 class Replace(QtGui.QDialog, FindReplaceDialog):
     def __init__(self):
         QtGui.QDialog.__init__(self)
         self.setupUi(self)
-
-
+        self.connect(self.ButtonReplaceAll, QtCore.SIGNAL('clicked()'), self.replaceAll)
+        self.connect(self.ButtonReplaceNext, QtCore.SIGNAL('clicked()'), self.replaceNext)
+        
+    def replaceAll(self):
+        main.replaceAll(
+                self.Replace.currentText(),
+                self.Find.currentText(),
+                self.CB_Regexp.isChecked(),
+                self.CB_CaseSensitive.isChecked(),
+                self.CB_WholeWordsOnly.isChecked(),
+                self.CB_WrapAround.isChecked()
+                )
+                
+    def replaceNext(self):
+        main.replaceNext(
+                self.Find.currentText(),
+                self.Replace.currentText(),
+                self.CB_Regexp.isChecked(),
+                self.CB_CaseSensitive.isChecked(),
+                self.CB_WholeWordsOnly.isChecked(),
+                self.CB_WrapAround.isChecked()
+                )
+    
 
 if __name__ == '__main__':
 	app = QtGui.QApplication(sys.argv)
         self.Text.setIndentationGuides(True)
         self.Text.setIndentationsUseTabs(False)
         self.Text.setAutoCompletionThreshold(2)
-        self.Text.setMarginLineNumbers(0, True)
+        self.Text.setMarginLineNumbers(1, True)
         
     def canGo(self):
         if self.Text.isModified():
             self.setWindowTitle('*'+self.curWindowTitle)
 
     def new(self):
-        if self.canGo():
-            self.Text.clear()
-            self.Text.setModified(False)
-            self.Tab.setTabText(0, 'Untitled')
-            self.setWindowTitle('PyEdit 0.1')
+        self.Text.setModified(False)
+        self.Tab.setCurrentIndex(self.Tab.addTab('Untitled'))
+        self.setWindowTitle('PyEdit 0.1')
         
     def open_(self):
         if self.canGo():
         dialog.exec_()
         
     def highlightFound(self, string, re, cs, ww):
-        print string, re, cs, ww
         self.Text.find(string, re, cs, ww)
         
     def replace(self):
         self.setupUi(self)
 
 
+class TabManager(object):
+    def __init__(self, tab):
+        self.tab = tab
+    def getCurrent(self):
+        return self.tab.currentIndex()
+    def setCurrent(self):
+        pass
+
 
 if __name__ == '__main__':
 	app = QtGui.QApplication(sys.argv)