developing the feature to backup
This commit is contained in:
parent
29c3ff5fe3
commit
109ea9f0fb
|
@ -26,6 +26,7 @@ from help import *
|
|||
from iconglossary import *
|
||||
from connect import *
|
||||
import sys
|
||||
import shutil
|
||||
from time import strftime, localtime, gmtime
|
||||
import time
|
||||
import os
|
||||
|
@ -125,6 +126,10 @@ class MyForm(QtGui.QMainWindow):
|
|||
# FILE MENU and other buttons
|
||||
QtCore.QObject.connect(self.ui.actionExit, QtCore.SIGNAL(
|
||||
"triggered()"), self.quit)
|
||||
#mj
|
||||
QtCore.QObject.connect(self.ui.actionBackup, QtCore.SIGNAL(
|
||||
"triggered()"), self.click_actionBackup)
|
||||
#mj
|
||||
QtCore.QObject.connect(self.ui.actionManageKeys, QtCore.SIGNAL(
|
||||
"triggered()"), self.click_actionManageKeys)
|
||||
QtCore.QObject.connect(self.ui.actionDeleteAllTrashedMessages, QtCore.SIGNAL(
|
||||
|
@ -1123,6 +1128,16 @@ class MyForm(QtGui.QMainWindow):
|
|||
return
|
||||
sqlStoredProcedure('deleteandvacuume')
|
||||
|
||||
def click_actionBackup(self):
|
||||
#mj
|
||||
#d = os.path.dirname(f)
|
||||
if not os.path.exists('./Backup'):
|
||||
os.makedirs('./Backup')
|
||||
|
||||
shutil.copyfile('C:\\Users\\mjha\\Dropbox\\semester Three\\software_engineering\\paper\\1988Hare.pdf','./Backup/1988.pdf')
|
||||
return
|
||||
|
||||
|
||||
def click_actionRegenerateDeterministicAddresses(self):
|
||||
self.regenerateAddressesDialogInstance = regenerateAddressesDialog(
|
||||
self)
|
||||
|
|
|
@ -457,9 +457,20 @@ class Ui_MainWindow(object):
|
|||
self.actionManageKeys = QtGui.QAction(MainWindow)
|
||||
self.actionManageKeys.setCheckable(False)
|
||||
self.actionManageKeys.setEnabled(True)
|
||||
#mj
|
||||
self.actionBackup = QtGui.QAction(MainWindow)
|
||||
self.actionBackup.setCheckable(False)
|
||||
self.actionBackup.setEnabled(True)
|
||||
#mj end
|
||||
icon = QtGui.QIcon.fromTheme(_fromUtf8("dialog-password"))
|
||||
self.actionManageKeys.setIcon(icon)
|
||||
self.actionManageKeys.setObjectName(_fromUtf8("actionManageKeys"))
|
||||
#mj
|
||||
icon = QtGui.QIcon.fromTheme(_fromUtf8("dialog-password"))
|
||||
self.actionBackup.setIcon(icon)
|
||||
self.actionBackup.setObjectName(_fromUtf8("actionBackup"))
|
||||
self.actionExit = QtGui.QAction(MainWindow)
|
||||
#mj end
|
||||
self.actionExit = QtGui.QAction(MainWindow)
|
||||
icon = QtGui.QIcon.fromTheme(_fromUtf8("application-exit"))
|
||||
self.actionExit.setIcon(icon)
|
||||
|
@ -488,6 +499,9 @@ class Ui_MainWindow(object):
|
|||
icon = QtGui.QIcon.fromTheme(_fromUtf8("contact-new"))
|
||||
self.actionJoinChan.setIcon(icon)
|
||||
self.actionJoinChan.setObjectName(_fromUtf8("actionJoinChan"))
|
||||
#mj
|
||||
self.menuFile.addAction(self.actionBackup)
|
||||
#mj
|
||||
self.menuFile.addAction(self.actionManageKeys)
|
||||
self.menuFile.addAction(self.actionDeleteAllTrashedMessages)
|
||||
self.menuFile.addAction(self.actionRegenerateDeterministicAddresses)
|
||||
|
@ -631,6 +645,9 @@ class Ui_MainWindow(object):
|
|||
self.menuHelp.setTitle(_translate("MainWindow", "Help", None))
|
||||
self.actionImport_keys.setText(_translate("MainWindow", "Import keys", None))
|
||||
self.actionManageKeys.setText(_translate("MainWindow", "Manage keys", None))
|
||||
#mj
|
||||
self.actionBackup.setText(_translate("MainWindow", "Backup/Restore", None))
|
||||
#mj
|
||||
self.actionExit.setText(_translate("MainWindow", "Quit", None))
|
||||
self.actionExit.setShortcut(_translate("MainWindow", "Ctrl+Q", None))
|
||||
self.actionHelp.setText(_translate("MainWindow", "Help", None))
|
||||
|
|
|
@ -1063,6 +1063,7 @@ p, li { white-space: pre-wrap; }
|
|||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionManageKeys"/>
|
||||
<addaction name="actionBackup"/>
|
||||
<addaction name="actionDeleteAllTrashedMessages"/>
|
||||
<addaction name="actionRegenerateDeterministicAddresses"/>
|
||||
<addaction name="actionJoinChan"/>
|
||||
|
@ -1114,6 +1115,24 @@ p, li { white-space: pre-wrap; }
|
|||
<string>Manage keys</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionBackup">
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset theme="dialog-password">
|
||||
<normaloff/>
|
||||
</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manage keys</string>
|
||||
</property>
|
||||
</action>
|
||||
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
<iconset theme="application-exit">
|
||||
|
|
Reference in New Issue
Block a user