1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
| #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@file
@brief This file contains the QDvGrab dialog (i.e A tool for grab videos from Dv Camecorders)
@author Olivier Girard <olivier@openshot.org>
@section LICENSE
Copyright (c) 2014-2015 QDvGrab Team. This file is part of
QDvGrab (http://www.qdvgrab.org), an open-source project
dedicated to delivering high quality video editing and animation solutions
to the world.
QDvGrab is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QDvGrab is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QDVgrab. If not, see <http://www.gnu.org/licenses/>.
"""
#Used to run it
import sys
import os
#Need for path
import os.path
#Need for find library
import shutil
#Need for create command line
import subprocess
#need for display gui
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
#Used for call ui files
from qdvgrabui import Ui_MainWindow
from preferencesui import Ui_Dialog
from kvisoui import Ui_kvisodialog
app_name = "QDvGrab"
app_version = "0.10"
app_author = "Olivier Girard"
author_mail = "olivier@openshot.org"
class QdvGrab(QMainWindow):
def __init__(self):
super(QdvGrab, self).__init__()
self.createWidgets()
self.setupUi()
self.connectActions()
#self.centerScreen()
#def centerScreen(self):
##geometry_window = ""
##self.geometry_window = geometry_window
#if self.geometry_window:
#self.resize(geometry_window[0], geometry_window[1])
#else:
#self.geometry_window = (self.geometry().width(), self.geometry().height())
##size_screen = QDesktopWidget().screenGeometry()
##self.move(((size_screen.width() - geometry_window.width())/2), ((size_screen.height() - geometry_window.height()))/2)
#===========================================================================
def setupUi(self):
pass
#===========================================================================
def createWidgets(self):
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
#===========================================================================
def connectActions(self):
""" Function doing connection not done by Qt Designer """
self.ui.btnacquisitiondv.clicked.connect(self.Recording)
self.ui.btnrecordmpeg.clicked.connect(self.Recording)
self.ui.btnstartrecord.clicked.connect(self.Acquisition)
self.ui.btnpreferences.clicked.connect(self.Preferences)
self.ui.btnhelp.clicked.connect(self.Help)
self.ui.btnquit.clicked.connect(self.Quit)
#===========================================================================
def Recording(self):
""" Run the type of acquisition asked """
pass
#===========================================================================
def Acquisition(self):
""" Run the acquisition process i.e run dvgrab """
pass
#===========================================================================
def Help(self):
""" Call the help webpage """
#pass
windo = Ui_kvisodialog()
#windo = preferencesui()
if windo.exec_():
windo.show()
#===========================================================================
def Quit(self):
""" Close the application """
pass
#===========================================================================
def Preferences(self):
""" Run the Preferences Dialog """
#pass
windo = Ui_Dialog()
if windo.exec_() == QDialog.Accepted:
windo.show()
#===========================================================================
def closeEvent(self, event):
""" function run when the mainwindow is closed """
event.accept()
if __name__ == "__main__":
application = QApplication(sys.argv)
QdvGrab = QdvGrab()
QdvGrab.show()
print("Welcome to QDvGrab {}. \nHope you'll enjoy it. \nPlease report all bugs,"
"features request and comments at {}\n".format(app_version, author_mail))
application.exec_() |
Partager