From b25aeeb74249ed427f6a6be8aa4cf9d643750040 Mon Sep 17 00:00:00 2001 From: Harishankar Date: Wed, 24 Nov 2010 14:27:02 +0530 Subject: [PATCH] First commit First commit of the project. Created and displayed the main application window. --- biaweb_qt | 19 ++++ category_dialog.ui | 94 ++++++++++++++++++++ main_window.py | 17 ++++ main_window.ui | 199 ++++++++++++++++++++++++++++++++++++++++++ ui_category_dialog.py | 52 +++++++++++ ui_main_window.py | 122 ++++++++++++++++++++++++++ 6 files changed, 503 insertions(+) create mode 100755 biaweb_qt create mode 100644 category_dialog.ui create mode 100644 main_window.py create mode 100644 main_window.ui create mode 100644 ui_category_dialog.py create mode 100644 ui_main_window.py diff --git a/biaweb_qt b/biaweb_qt new file mode 100755 index 0000000..320516c --- /dev/null +++ b/biaweb_qt @@ -0,0 +1,19 @@ +#!/usr/bin/env python + +# BiaWeb Website content manager (c) 2010 V.Harishankar +# Main script + +import sys +import PyQt4 +import main_window + +# main function +def main (): + app = PyQt4.QtGui.QApplication (sys.argv) + wnd = main_window.MainWindow () + wnd.show () + sys.exit (app.exec_ ()) + +# run the application +if __name__=="__main__": + main () \ No newline at end of file diff --git a/category_dialog.ui b/category_dialog.ui new file mode 100644 index 0000000..39d2e43 --- /dev/null +++ b/category_dialog.ui @@ -0,0 +1,94 @@ + + + CategoryDialog + + + + 0 + 0 + 487 + 216 + + + + Category + + + + + + Category name + + + + + + + + + + Category description + + + + + + + + + + Stub (directory) + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + CategoryDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + CategoryDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/main_window.py b/main_window.py new file mode 100644 index 0000000..258e0d4 --- /dev/null +++ b/main_window.py @@ -0,0 +1,17 @@ +# BiaWeb Website content manager (c) 2010 V.Harishankar +# Main Window class + +import PyQt4 +import ui_main_window +import sys + +class MainWindow (PyQt4.QtGui.QMainWindow, ui_main_window.Ui_MainWindow): + def __init__ (self): + PyQt4.QtGui.QMainWindow.__init__ (self) + self.setupUi (self) + + def onFileNew (self): + print "New triggered" + + def onFileQuit (self): + sys.exit (0) diff --git a/main_window.ui b/main_window.ui new file mode 100644 index 0000000..662825b --- /dev/null +++ b/main_window.ui @@ -0,0 +1,199 @@ + + + MainWindow + + + + 0 + 0 + 633 + 458 + + + + BiaWeb + + + + + + + Categories + + + + + + + Articles in category + + + + + + + + + + + + + + + 0 + 0 + 633 + 25 + + + + + &File + + + + + + + + + &Category + + + + + + + + &Articles + + + + + + + + &Web + + + + + + + &Help + + + + + + + + + + + + + Open existing site... + + + + + &Quit + + + + + &Add... + + + + + &Edit... + + + + + &Delete + + + + + &Add... + + + + + &Edit... + + + + + &Delete + + + + + Generate &Site... + + + + + Generate Search &Index... + + + + + &About + + + + + &New site... + + + + + &Open site... + + + + + + + actionNew_site + triggered() + MainWindow + onFileNew() + + + -1 + -1 + + + 316 + 228 + + + + + action_Quit + triggered() + MainWindow + onFileQuit() + + + -1 + -1 + + + 316 + 228 + + + + + + onFileNew() + onFileQuit() + + diff --git a/ui_category_dialog.py b/ui_category_dialog.py new file mode 100644 index 0000000..a27f428 --- /dev/null +++ b/ui_category_dialog.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'category_dialog.ui' +# +# Created: Wed Nov 24 14:12:44 2010 +# by: PyQt4 UI code generator 4.7.4 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_CategoryDialog(object): + def setupUi(self, CategoryDialog): + CategoryDialog.setObjectName("CategoryDialog") + CategoryDialog.resize(487, 216) + self.gridLayout = QtGui.QGridLayout(CategoryDialog) + self.gridLayout.setObjectName("gridLayout") + self.label = QtGui.QLabel(CategoryDialog) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + self.category_name = QtGui.QLineEdit(CategoryDialog) + self.category_name.setObjectName("category_name") + self.gridLayout.addWidget(self.category_name, 0, 1, 1, 1) + self.label_2 = QtGui.QLabel(CategoryDialog) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1) + self.category_desc = QtGui.QLineEdit(CategoryDialog) + self.category_desc.setObjectName("category_desc") + self.gridLayout.addWidget(self.category_desc, 1, 1, 1, 1) + self.label_3 = QtGui.QLabel(CategoryDialog) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 2, 0, 1, 1) + self.category_stub = QtGui.QLineEdit(CategoryDialog) + self.category_stub.setObjectName("category_stub") + self.gridLayout.addWidget(self.category_stub, 2, 1, 1, 1) + self.buttonBox = QtGui.QDialogButtonBox(CategoryDialog) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.gridLayout.addWidget(self.buttonBox, 3, 0, 1, 2) + + self.retranslateUi(CategoryDialog) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), CategoryDialog.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), CategoryDialog.reject) + QtCore.QMetaObject.connectSlotsByName(CategoryDialog) + + def retranslateUi(self, CategoryDialog): + CategoryDialog.setWindowTitle(QtGui.QApplication.translate("CategoryDialog", "Category", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("CategoryDialog", "Category name", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("CategoryDialog", "Category description", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("CategoryDialog", "Stub (directory)", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/ui_main_window.py b/ui_main_window.py new file mode 100644 index 0000000..6219cbe --- /dev/null +++ b/ui_main_window.py @@ -0,0 +1,122 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'main_window.ui' +# +# Created: Wed Nov 24 14:22:45 2010 +# by: PyQt4 UI code generator 4.7.4 +# +# 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(633, 458) + self.centralwidget = QtGui.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayout = QtGui.QGridLayout(self.centralwidget) + self.gridLayout.setObjectName("gridLayout") + self.label = QtGui.QLabel(self.centralwidget) + self.label.setObjectName("label") + self.gridLayout.addWidget(self.label, 0, 0, 1, 1) + self.label_2 = QtGui.QLabel(self.centralwidget) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 0, 2, 1, 1) + self.categories_list = QtGui.QListWidget(self.centralwidget) + self.categories_list.setObjectName("categories_list") + self.gridLayout.addWidget(self.categories_list, 1, 0, 1, 1) + self.articles_list = QtGui.QListWidget(self.centralwidget) + self.articles_list.setObjectName("articles_list") + self.gridLayout.addWidget(self.articles_list, 1, 2, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtGui.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 633, 25)) + self.menubar.setObjectName("menubar") + self.menu_File = QtGui.QMenu(self.menubar) + self.menu_File.setObjectName("menu_File") + self.menu_Category = QtGui.QMenu(self.menubar) + self.menu_Category.setObjectName("menu_Category") + self.menu_Articles = QtGui.QMenu(self.menubar) + self.menu_Articles.setObjectName("menu_Articles") + self.menu_Web = QtGui.QMenu(self.menubar) + self.menu_Web.setObjectName("menu_Web") + self.menu_About = QtGui.QMenu(self.menubar) + self.menu_About.setObjectName("menu_About") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtGui.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.actionOpen_DB = QtGui.QAction(MainWindow) + self.actionOpen_DB.setObjectName("actionOpen_DB") + self.action_Quit = QtGui.QAction(MainWindow) + self.action_Quit.setObjectName("action_Quit") + self.action_Add = QtGui.QAction(MainWindow) + self.action_Add.setObjectName("action_Add") + self.action_Edit = QtGui.QAction(MainWindow) + self.action_Edit.setObjectName("action_Edit") + self.action_Delete = QtGui.QAction(MainWindow) + self.action_Delete.setObjectName("action_Delete") + self.action_New = QtGui.QAction(MainWindow) + self.action_New.setObjectName("action_New") + self.action_Edit_2 = QtGui.QAction(MainWindow) + self.action_Edit_2.setObjectName("action_Edit_2") + self.action_Delete_2 = QtGui.QAction(MainWindow) + self.action_Delete_2.setObjectName("action_Delete_2") + self.action_Generate_Site = QtGui.QAction(MainWindow) + self.action_Generate_Site.setObjectName("action_Generate_Site") + self.actionGenerate_Search_Index = QtGui.QAction(MainWindow) + self.actionGenerate_Search_Index.setObjectName("actionGenerate_Search_Index") + self.action_About = QtGui.QAction(MainWindow) + self.action_About.setObjectName("action_About") + self.actionNew_site = QtGui.QAction(MainWindow) + self.actionNew_site.setObjectName("actionNew_site") + self.action_Open_site = QtGui.QAction(MainWindow) + self.action_Open_site.setObjectName("action_Open_site") + self.menu_File.addAction(self.actionNew_site) + self.menu_File.addAction(self.action_Open_site) + self.menu_File.addSeparator() + self.menu_File.addAction(self.action_Quit) + self.menu_Category.addAction(self.action_Add) + self.menu_Category.addAction(self.action_Edit) + self.menu_Category.addAction(self.action_Delete) + self.menu_Articles.addAction(self.action_New) + self.menu_Articles.addAction(self.action_Edit_2) + self.menu_Articles.addAction(self.action_Delete_2) + self.menu_Web.addAction(self.action_Generate_Site) + self.menu_Web.addAction(self.actionGenerate_Search_Index) + self.menu_About.addAction(self.action_About) + self.menubar.addAction(self.menu_File.menuAction()) + self.menubar.addAction(self.menu_Category.menuAction()) + self.menubar.addAction(self.menu_Articles.menuAction()) + self.menubar.addAction(self.menu_Web.menuAction()) + self.menubar.addAction(self.menu_About.menuAction()) + + self.retranslateUi(MainWindow) + QtCore.QObject.connect(self.actionNew_site, QtCore.SIGNAL("triggered()"), MainWindow.onFileNew) + QtCore.QObject.connect(self.action_Quit, QtCore.SIGNAL("triggered()"), MainWindow.onFileQuit) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "BiaWeb", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("MainWindow", "Categories", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Articles in category", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_File.setTitle(QtGui.QApplication.translate("MainWindow", "&File", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_Category.setTitle(QtGui.QApplication.translate("MainWindow", "&Category", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_Articles.setTitle(QtGui.QApplication.translate("MainWindow", "&Articles", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_Web.setTitle(QtGui.QApplication.translate("MainWindow", "&Web", None, QtGui.QApplication.UnicodeUTF8)) + self.menu_About.setTitle(QtGui.QApplication.translate("MainWindow", "&Help", None, QtGui.QApplication.UnicodeUTF8)) + self.actionOpen_DB.setText(QtGui.QApplication.translate("MainWindow", "Open existing site...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Quit.setText(QtGui.QApplication.translate("MainWindow", "&Quit", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Add.setText(QtGui.QApplication.translate("MainWindow", "&Add...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Edit.setText(QtGui.QApplication.translate("MainWindow", "&Edit...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Delete.setText(QtGui.QApplication.translate("MainWindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.action_New.setText(QtGui.QApplication.translate("MainWindow", "&Add...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Edit_2.setText(QtGui.QApplication.translate("MainWindow", "&Edit...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Delete_2.setText(QtGui.QApplication.translate("MainWindow", "&Delete", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Generate_Site.setText(QtGui.QApplication.translate("MainWindow", "Generate &Site...", None, QtGui.QApplication.UnicodeUTF8)) + self.actionGenerate_Search_Index.setText(QtGui.QApplication.translate("MainWindow", "Generate Search &Index...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_About.setText(QtGui.QApplication.translate("MainWindow", "&About", None, QtGui.QApplication.UnicodeUTF8)) + self.actionNew_site.setText(QtGui.QApplication.translate("MainWindow", "&New site...", None, QtGui.QApplication.UnicodeUTF8)) + self.action_Open_site.setText(QtGui.QApplication.translate("MainWindow", "&Open site...", None, QtGui.QApplication.UnicodeUTF8)) + -- 2.20.1