コード例 #1
0
ファイル: parcala.py プロジェクト: mthnzbk/parcala
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Parçala"))
        self.gridLayout = QGridLayout(self)
        
        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 4, 1, 1)

        self.nereyeButton = QPushButton(self)
        self.nereyeButton.setText(self.trUtf8("Nereye"))
        self.nereyeButton.clicked.connect(self.nereye)
        self.gridLayout.addWidget(self.nereyeButton, 2, 4, 1, 1)

        self.parcalaButton = QPushButton(self)
        self.parcalaButton.setText(self.trUtf8("Parçala"))
        self.parcalaButton.clicked.connect(self.parcala)
        self.gridLayout.addWidget(self.parcalaButton, 5, 4, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 4)

        self.nereyeEdit = QLineEdit(self)
        self.nereyeEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.nereyeEdit, 2, 0, 1, 4)

        self.mbLabel = QLabel(self)
        self.mbLabel.setText(self.trUtf8("Mb"))
        self.gridLayout.addWidget(self.mbLabel, 5, 3, 1, 1)

        self.boyutLabel = QLabel(self)
        self.boyutLabel.setText(self.trUtf8("Parçalama Boyutu:"))
        self.gridLayout.addWidget(self.boyutLabel, 5, 1, 1, 1)

        self.mbEdit = QLineEdit(self)
        self.mbEdit.returnPressed.connect(self.parcalaButton.animateClick)
        val = QIntValidator(1, 10000,self)
        self.mbEdit.setValidator(val)
        self.gridLayout.addWidget(self.mbEdit, 5, 2, 1, 1)

        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        spacerItem1 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem1, 1, 1, 1, 1)
        spacerItem2 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem2, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "-")
        self.karaWidget.hide()
コード例 #2
0
ファイル: birlestir.py プロジェクト: mthnzbk/parcala
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Birleştir"))
        self.gridLayout = QGridLayout(self)

        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 3, 1, 1)

        self.nereyeButton = QPushButton(self)
        self.nereyeButton.setText(self.trUtf8("Nereye"))
        self.nereyeButton.clicked.connect(self.nereye)
        self.gridLayout.addWidget(self.nereyeButton, 2, 3, 1, 1)

        self.birlestirButton = QPushButton(self)
        self.birlestirButton.setText(self.trUtf8("Birleştir"))
        self.birlestirButton.clicked.connect(self.birlestir)
        self.gridLayout.addWidget(self.birlestirButton, 5, 3, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 3)

        self.nereyeEdit = QLineEdit(self)
        self.nereyeEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.nereyeEdit, 2, 0, 1, 3)

        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        spacerItem1 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem1, 1, 1, 1, 1)
        spacerItem2 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem2, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "+")
        self.karaWidget.hide()
コード例 #3
0
ファイル: dogrula.py プロジェクト: mthnzbk/parcala
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Doğrula"))

        self.gridLayout = QGridLayout(self)

        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 4, 1, 1)

        self.dogrulaButton = QPushButton(self)
        self.dogrulaButton.setText(self.trUtf8("Doğrula"))
        self.dogrulaButton.clicked.connect(self.dogrula)
        self.gridLayout.addWidget(self.dogrulaButton, 3, 4, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 4)

        self.hashEdit = QLineEdit(self)
        self.hashEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.hashEdit, 3, 2, 1, 1)

        spacerItem = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem, 1, 1, 1, 1)
        
        self.comboBox = QComboBox(self)
        self.comboBox.setMinimumSize(QSize(100, 0))
        self.comboBox.addItem("MD5")
        self.comboBox.addItem("SHA1")
        self.gridLayout.addWidget(self.comboBox, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "=")
        self.karaWidget.hide()
コード例 #4
0
ファイル: dogrula.py プロジェクト: mthnzbk/parcala
class DogrulaDialog(QDialog):
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Doğrula"))

        self.gridLayout = QGridLayout(self)

        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 4, 1, 1)

        self.dogrulaButton = QPushButton(self)
        self.dogrulaButton.setText(self.trUtf8("Doğrula"))
        self.dogrulaButton.clicked.connect(self.dogrula)
        self.gridLayout.addWidget(self.dogrulaButton, 3, 4, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 4)

        self.hashEdit = QLineEdit(self)
        self.hashEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.hashEdit, 3, 2, 1, 1)

        spacerItem = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem, 1, 1, 1, 1)
        
        self.comboBox = QComboBox(self)
        self.comboBox.setMinimumSize(QSize(100, 0))
        self.comboBox.addItem("MD5")
        self.comboBox.addItem("SHA1")
        self.gridLayout.addWidget(self.comboBox, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "=")
        self.karaWidget.hide()

    def nereden(self):
        dosya = QFileDialog.getOpenFileName(self, "", settings().value("Genel/Yol").toString())
        if dosya == "":
            pass
        elif QFile.exists(dosya):
            from os.path import abspath, dirname
            settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))
            self.neredenEdit.setText(dosya)
        else:
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Böyle bir dosya mevcut değil!"))

    def dogrula(self):
        if self.neredenEdit.text() == "":
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Dosya seçmediniz!"))
        else:
            self.karaWidget.show()
            self.karaWidget.start()

    def keyPressEvent(self, event):
        pass

    def resizeEvent(self, event):
        self.karaWidget.setGeometry(0,0, event.size().width(), event.size().height())
コード例 #5
0
ファイル: parcala.py プロジェクト: mthnzbk/parcala
class ParcalaDialog(QDialog):
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Parçala"))
        self.gridLayout = QGridLayout(self)
        
        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 4, 1, 1)

        self.nereyeButton = QPushButton(self)
        self.nereyeButton.setText(self.trUtf8("Nereye"))
        self.nereyeButton.clicked.connect(self.nereye)
        self.gridLayout.addWidget(self.nereyeButton, 2, 4, 1, 1)

        self.parcalaButton = QPushButton(self)
        self.parcalaButton.setText(self.trUtf8("Parçala"))
        self.parcalaButton.clicked.connect(self.parcala)
        self.gridLayout.addWidget(self.parcalaButton, 5, 4, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 4)

        self.nereyeEdit = QLineEdit(self)
        self.nereyeEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.nereyeEdit, 2, 0, 1, 4)

        self.mbLabel = QLabel(self)
        self.mbLabel.setText(self.trUtf8("Mb"))
        self.gridLayout.addWidget(self.mbLabel, 5, 3, 1, 1)

        self.boyutLabel = QLabel(self)
        self.boyutLabel.setText(self.trUtf8("Parçalama Boyutu:"))
        self.gridLayout.addWidget(self.boyutLabel, 5, 1, 1, 1)

        self.mbEdit = QLineEdit(self)
        self.mbEdit.returnPressed.connect(self.parcalaButton.animateClick)
        val = QIntValidator(1, 10000,self)
        self.mbEdit.setValidator(val)
        self.gridLayout.addWidget(self.mbEdit, 5, 2, 1, 1)

        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        spacerItem1 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem1, 1, 1, 1, 1)
        spacerItem2 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem2, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "-")
        self.karaWidget.hide()

    def nereden(self):
        dosya = QFileDialog.getOpenFileName(self, "", settings().value("Genel/Yol").toString())
        if dosya == "":
            pass
        elif QFile.exists(dosya):
            self.neredenEdit.setText(dosya)
            self.nereyeEdit.setText(dosya+".001")
            from os.path import abspath, dirname
            settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))
        else:
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Böyle bir dosya mevcut değil!"))


    def nereye(self):
        dosya = QFileDialog.getSaveFileName(self, "", settings().value("Genel/Yol").toString())
        if not dosya == "":
            if dosya[-3:] == "001":
                self.nereyeEdit.setText(dosya)
                from os.path import abspath, dirname
                settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))
                return
            self.nereyeEdit.setText(dosya+".001")
            from os.path import abspath, dirname
            settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))

    def parcala(self):
        if self.neredenEdit.text() == "":
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Dosya seçmediniz!"))
        elif self.mbEdit.text() == "" or int(self.mbEdit.text()) == 0:
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Dosya boyutu girmediniz!"))
        elif int(self.mbEdit.text()) > QFile(self.neredenEdit.text()).size()/(1024*1024):
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Dosya büyüklüğünden fazla değer girdiniz!"))
        else:
            self.karaWidget.show()
            self.karaWidget.start()

    def keyPressEvent(self, event):
        pass

    def resizeEvent(self, event):
        self.karaWidget.setGeometry(0,0, event.size().width(), event.size().height())
コード例 #6
0
ファイル: birlestir.py プロジェクト: mthnzbk/parcala
class BirlestirDialog(QDialog):
    def __init__(self, ui):
        QDialog.__init__(self, ui)
        self.ui = ui
        self.resize(450, 170)
        self.setMinimumSize(QSize(450, 170))
        self.setMaximumSize(QSize(500, 200))
        self.setWindowTitle(self.trUtf8("Birleştir"))
        self.gridLayout = QGridLayout(self)

        self.neredenButton = QPushButton(self)
        self.neredenButton.setText(self.trUtf8("Nereden"))
        self.neredenButton.clicked.connect(self.nereden)
        self.gridLayout.addWidget(self.neredenButton, 0, 3, 1, 1)

        self.nereyeButton = QPushButton(self)
        self.nereyeButton.setText(self.trUtf8("Nereye"))
        self.nereyeButton.clicked.connect(self.nereye)
        self.gridLayout.addWidget(self.nereyeButton, 2, 3, 1, 1)

        self.birlestirButton = QPushButton(self)
        self.birlestirButton.setText(self.trUtf8("Birleştir"))
        self.birlestirButton.clicked.connect(self.birlestir)
        self.gridLayout.addWidget(self.birlestirButton, 5, 3, 1, 1)

        self.neredenEdit = QLineEdit(self)
        self.neredenEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.neredenEdit, 0, 0, 1, 3)

        self.nereyeEdit = QLineEdit(self)
        self.nereyeEdit.setReadOnly(True)
        self.gridLayout.addWidget(self.nereyeEdit, 2, 0, 1, 3)

        spacerItem = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum)
        self.gridLayout.addItem(spacerItem, 5, 0, 1, 1)
        spacerItem1 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem1, 1, 1, 1, 1)
        spacerItem2 = QSpacerItem(20, 15, QSizePolicy.Minimum, QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem2, 3, 1, 1, 1)

        self.karaWidget = KaraWidget(self, "+")
        self.karaWidget.hide()


    def nereden(self):
        dosya = QFileDialog.getOpenFileName(self, u"", settings().value("Genel/Yol").toString(), self.trUtf8("001 Dosyası (*.001)"))
        if dosya == "":
            pass
        elif QFile.exists(dosya):
            self.neredenEdit.setText(dosya)
            self.nereyeEdit.setText(u"%s"%dosya[:-4])
            from os.path import abspath, dirname
            settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))
        else:
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Böyle bir dosya mevcut değil!"))

    def nereye(self):
        dosya = QFileDialog.getSaveFileName(self, "", settings().value("Genel/Yol").toString())
        if not dosya == "":
            self.nereyeEdit.setText(dosya)
            from os.path import abspath, dirname
            settings().setValue("Genel/Yol", abspath(dirname(str(dosya))))

    def birlestir(self):
        if self.neredenEdit.text() == "":
            QMessageBox.warning(self, self.trUtf8("Hata!"), self.trUtf8("Dosya seçmediniz!"))
        else:
            self.karaWidget.show()
            self.karaWidget.start()

    def keyPressEvent(self, event):
        pass

    def resizeEvent(self, event):
        self.karaWidget.setGeometry(0,0, event.size().width(), event.size().height())