diff options
author | James Meyer <james.meyer@operamail.com> | 2009-10-02 22:27:32 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2009-10-02 22:27:32 (GMT) |
commit | 5008c91b9936a76407099023befdee55dcae08d6 (patch) | |
tree | 58cea8c677295719747d4fc2f83ce30942f02f5c | |
parent | b7dd2ea2aee7ecc21928d33405d31ad996a0e7e3 (diff) | |
download | linhes_dev-5008c91b9936a76407099023befdee55dcae08d6.zip |
bld: add menu for system updates, disable search when loading the table
-rw-r--r--[-rwxr-xr-x] | build_tools/bin/bld_resource.py | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/build_tools/bin/bld_resource.py b/build_tools/bin/bld_resource.py index a972224..aaba889 100755..100644 --- a/build_tools/bin/bld_resource.py +++ b/build_tools/bin/bld_resource.py @@ -445,6 +445,7 @@ class run_cmd_thread(QtCore.QThread): self.alive = 0 + class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") @@ -549,7 +550,7 @@ class Ui_MainWindow(object): self.horizontalLayout_5.setSpacing(0) self.horizontalLayout_5.setMargin(0) self.horizontalLayout_5.setObjectName("horizontalLayout_5") - self.tableWidget = TableWidget(self.groupBox_6) + self.tableWidget =TableWidget(self.groupBox_6) self.tableWidget.setAutoFillBackground(True) self.tableWidget.setFrameShape(QtGui.QFrame.StyledPanel) self.tableWidget.setFrameShadow(QtGui.QFrame.Sunken) @@ -1046,6 +1047,8 @@ class Ui_MainWindow(object): self.menuAbout.setObjectName("menuAbout") self.menuRepository_2 = QtGui.QMenu(self.menubar) self.menuRepository_2.setObjectName("menuRepository_2") + self.menuSystem = QtGui.QMenu(self.menubar) + self.menuSystem.setObjectName("menuSystem") MainWindow.setMenuBar(self.menubar) self.actionExit = QtGui.QAction(MainWindow) self.actionExit.setObjectName("actionExit") @@ -1109,6 +1112,14 @@ class Ui_MainWindow(object): self.actionSearch_All_This_includes_ABS.setObjectName("actionSearch_All_This_includes_ABS") self.actionRemove_Group = QtGui.QAction(MainWindow) self.actionRemove_Group.setObjectName("actionRemove_Group") + self.actionRefresh_database = QtGui.QAction(MainWindow) + self.actionRefresh_database.setObjectName("actionRefresh_database") + self.actionInstall_all_updates = QtGui.QAction(MainWindow) + self.actionInstall_all_updates.setObjectName("actionInstall_all_updates") + self.actionSwitch_to_local = QtGui.QAction(MainWindow) + self.actionSwitch_to_local.setObjectName("actionSwitch_to_local") + self.actionSwitch_to_remote = QtGui.QAction(MainWindow) + self.actionSwitch_to_remote.setObjectName("actionSwitch_to_remote") self.menuWelcome.addAction(self.action_Save_make_package_options) self.menuWelcome.addAction(self.actionSave_All_options_including_make_package_option) self.menuWelcome.addSeparator() @@ -1129,12 +1140,19 @@ class Ui_MainWindow(object): self.menuRepository_2.addSeparator() self.menuRepository_2.addSeparator() self.menuRepository_2.addAction(self.actionRemove_Group) + self.menuRepository_2.addSeparator() + self.menuRepository_2.addSeparator() + self.menuSystem.addAction(self.actionRefresh_database) + self.menuSystem.addAction(self.actionInstall_all_updates) + self.menuSystem.addAction(self.actionSwitch_to_local) + self.menuSystem.addAction(self.actionSwitch_to_remote) self.menubar.addAction(self.menuWelcome.menuAction()) self.menubar.addAction(self.menuRepository_2.menuAction()) + self.menubar.addAction(self.menuSystem.menuAction()) self.menubar.addAction(self.menuAbout.menuAction()) self.retranslateUi(MainWindow) - self.tabWidget.setCurrentIndex(0) + self.tabWidget.setCurrentIndex(4) self.tabWidget_2.setCurrentIndex(0) QtCore.QObject.connect(self.actionExit, QtCore.SIGNAL("triggered()"), MainWindow.close) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -1177,6 +1195,7 @@ class Ui_MainWindow(object): #thread to enable table after pkgload is finished QtCore.QObject.connect(self.thread_pkg_load, SIGNAL("pkg_load_finished(bool)"), self.set_repo_box) QtCore.QObject.connect(self.thread_pkg_load, SIGNAL("pkg_load_finished(bool)"), self.print_finished_msg) + #connect up insert item for ABS table QtCore.QObject.connect(self.thread_pkg_load, QtCore.SIGNAL("insertItem_ABS(PyQt_PyObject)"), self.insert_item_ABS) @@ -1258,7 +1277,10 @@ class Ui_MainWindow(object): QtCore.QObject.connect(self.actionReset_UI, QtCore.SIGNAL("triggered()"), self.resetui) QtCore.QObject.connect(self.actionCheck_for_problems, QtCore.SIGNAL("triggered()"), self.repo_check_for_problems) QtCore.QObject.connect(self.actionSearch_current_Repository, QtCore.SIGNAL("triggered()"), self.show_search) - + QtCore.QObject.connect(self.actionRefresh_database, QtCore.SIGNAL("triggered()"), self.updatePacmanDB) + QtCore.QObject.connect(self.actionInstall_all_updates, QtCore.SIGNAL("triggered()"), self.updateSystem) + QtCore.QObject.connect(self.actionSwitch_to_local, QtCore.SIGNAL("triggered()"), self.switch_pacman_to_loca) + QtCore.QObject.connect(self.actionSwitch_to_remote, QtCore.SIGNAL("triggered()"), self.switch_pacman_to_remote) #reload group boxes QtCore.QObject.connect(self.actionReload_Group_packages, QtCore.SIGNAL("triggered()"), self.populate_group_box) @@ -1441,6 +1463,8 @@ class Ui_MainWindow(object): for i in columnlist: self.tableWidget.resizeColumnToContents(i) self.tableWidget_2.resizeColumnToContents(i) + self.enable_table_search(True) + self.enable_table_search_ABS(True) def print_skipped_pkg(self,skipped): self.update_ouputwindow(sepLine) @@ -1471,6 +1495,15 @@ class Ui_MainWindow(object): self.pushButton_9.setEnabled(True) self.enable_go_button() + def enable_table_search(self,Value): + self.lineEdit_21.setEnabled(Value) + self.pushButton.setEnabled(Value) + + def enable_table_search_ABS(self,Value): + self.lineEdit_20.setEnabled(Value) + self.pushButton_2.setEnabled(Value) + + def set_repo_box(self,Value): self.comboBox.setEnabled(Value) self.comboBox_2.setEnabled(Value) @@ -1557,12 +1590,12 @@ class Ui_MainWindow(object): self.tableWidget_2.item(itr,5).setText(pkgdescription) self.updateLCDtotal_ABS() - def populate_pkg_list(self,repo_value): # Populate table on package tab # read in the group file, locate pkgbuild & parse out the items self.update_ouputwindow(sepLine) self.set_repo_box(False) + self.enable_table_search(False) self.tableWidget.clear() self.tableWidget.clearContents() self.tableWidget.setSortingEnabled(False) @@ -1579,6 +1612,7 @@ class Ui_MainWindow(object): # read in the group file, locate pkgbuild & parse out the items self.update_ouputwindow(sepLine) self.set_repo_box(False) + self.enable_table_search_ABS(False) self.tableWidget_2.clear() self.tableWidget_2.clearContents() self.tableWidget_2.setSortingEnabled(False) @@ -2496,6 +2530,26 @@ class Ui_MainWindow(object): self.run_cmd_thread.value_init(runcmd,cmdargs) break + + def updatePacmanDB(self): + runcmd="pacman" + cmdargs=["-Sy"] + self.run_cmd_thread.value_init(runcmd,cmdargs) + + + def updateSystem(self): + runcmd="pacman" + cmdargs=["-Su","--noconfirm"] + self.run_cmd_thread.value_init(runcmd,cmdargs) + + def switch_pacman_to_loca(self): + print "switch to local" + + def switch_pacman_to_remote(self): + print "switch to remote" + + + def save_config_settings(self): from __main__ import settings_dict homedir = os.path.expanduser("~") @@ -2576,7 +2630,6 @@ class Ui_MainWindow(object): #--- - def retranslateUi(self, MainWindow): MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "BLD", None, QtGui.QApplication.UnicodeUTF8)) self.label_22.setText(QtGui.QApplication.translate("MainWindow", "Search Repo", None, QtGui.QApplication.UnicodeUTF8)) @@ -2707,6 +2760,7 @@ class Ui_MainWindow(object): self.menuWelcome.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) self.menuAbout.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) self.menuRepository_2.setTitle(QtGui.QApplication.translate("MainWindow", "Repository", None, QtGui.QApplication.UnicodeUTF8)) + self.menuSystem.setTitle(QtGui.QApplication.translate("MainWindow", "System", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setText(QtGui.QApplication.translate("MainWindow", "Exit", None, QtGui.QApplication.UnicodeUTF8)) self.actionExit.setShortcut(QtGui.QApplication.translate("MainWindow", "Alt+Q", None, QtGui.QApplication.UnicodeUTF8)) self.actionToggle_options.setText(QtGui.QApplication.translate("MainWindow", "Toggle options", None, QtGui.QApplication.UnicodeUTF8)) @@ -2722,7 +2776,7 @@ class Ui_MainWindow(object): self.actionSave_output_window_to_file.setText(QtGui.QApplication.translate("MainWindow", "Save output window to file", None, QtGui.QApplication.UnicodeUTF8)) self.actionUpdate_packages_from_ABS.setText(QtGui.QApplication.translate("MainWindow", "Update ALL packages from ABS", None, QtGui.QApplication.UnicodeUTF8)) self.actionCreate_new_package.setText(QtGui.QApplication.translate("MainWindow", "Create new package", None, QtGui.QApplication.UnicodeUTF8)) - self.actionUpdate_group_list_2.setText(QtGui.QApplication.translate("MainWindow", "Update package group list", None, QtGui.QApplication.UnicodeUTF8)) + self.actionUpdate_group_list_2.setText(QtGui.QApplication.translate("MainWindow", "Regenerate package group list", None, QtGui.QApplication.UnicodeUTF8)) self.actionCheck_for_problems.setText(QtGui.QApplication.translate("MainWindow", "Check for problems", None, QtGui.QApplication.UnicodeUTF8)) self.actionAbout_2.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8)) self.actionHelp_3.setText(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8)) @@ -2740,4 +2794,9 @@ class Ui_MainWindow(object): self.actionSearch_current_Repository.setShortcut(QtGui.QApplication.translate("MainWindow", "Alt+S", None, QtGui.QApplication.UnicodeUTF8)) self.actionSearch_All_This_includes_ABS.setText(QtGui.QApplication.translate("MainWindow", "Search All (This includes ABS)", None, QtGui.QApplication.UnicodeUTF8)) self.actionRemove_Group.setText(QtGui.QApplication.translate("MainWindow", "Remove Group", None, QtGui.QApplication.UnicodeUTF8)) + self.actionRefresh_database.setText(QtGui.QApplication.translate("MainWindow", "Refresh package database", None, QtGui.QApplication.UnicodeUTF8)) + self.actionInstall_all_updates.setText(QtGui.QApplication.translate("MainWindow", "System update", None, QtGui.QApplication.UnicodeUTF8)) + self.actionSwitch_to_local.setText(QtGui.QApplication.translate("MainWindow", "Switch to local", None, QtGui.QApplication.UnicodeUTF8)) + self.actionSwitch_to_remote.setText(QtGui.QApplication.translate("MainWindow", "Switch to remote", None, QtGui.QApplication.UnicodeUTF8)) + |