diff options
author | mkaay <mkaay@mkaay.de> | 2010-05-01 22:13:59 +0200 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-05-01 22:13:59 +0200 |
commit | 1cbd4effe10fbaa18a938975d54048f8e1c1f700 (patch) | |
tree | 47085cd606d540c11cca584ce56954d6ac77e1b0 /module/gui/PackageDock.py | |
parent | gui captcha fix (diff) | |
download | pyload-1cbd4effe10fbaa18a938975d54048f8e1c1f700.tar.xz |
moved gui to http://bitbucket.org/mkaay/pyload-gui
Diffstat (limited to 'module/gui/PackageDock.py')
-rw-r--r-- | module/gui/PackageDock.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py deleted file mode 100644 index fec5466c2..000000000 --- a/module/gui/PackageDock.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -""" - This program 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. - - This program 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 this program; if not, see <http://www.gnu.org/licenses/>. - - @author: mkaay -""" - -from PyQt4.QtCore import * -from PyQt4.QtGui import * - -class NewPackageDock(QDockWidget): - def __init__(self): - QDockWidget.__init__(self, _("New Package")) - self.setObjectName("New Package Dock") - self.widget = NewPackageWindow(self) - self.setWidget(self.widget) - self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) - self.hide() - - def slotDone(self): - view = self.widget.view - count = view.topLevelItemCount() - ids = [] - for i in range(count): - item = view.topLevelItem(i) - if item: - ids.append(item.data(0, Qt.UserRole).toInt()[0]) - self.emit(SIGNAL("done"), self.widget.nameInput.text(), ids) - view.clear() - self.hide() - -class NewPackageWindow(QWidget): - def __init__(self, dock): - QWidget.__init__(self) - self.dock = dock - self.setLayout(QGridLayout()) - layout = self.layout() - - nameLabel = QLabel(_("Name")) - nameInput = QLineEdit() - - linksLabel = QLabel(_("Links in this Package")) - linkView = QTreeWidget() - linkView.setSelectionBehavior(QAbstractItemView.SelectRows) - linkView.setSelectionMode(QAbstractItemView.ExtendedSelection) - linkView.setColumnCount(1) - linkView.setHeaderLabels(["Name"]) - linkView.setDragEnabled(True) - linkView.setDragDropMode(QAbstractItemView.DragDrop) - linkView.setDropIndicatorShown(True) - linkView.setAcceptDrops(True) - linkView.setDragDropOverwriteMode(True) - - self.view = linkView - self.nameInput = nameInput - - save = QPushButton(_("Create")) - - layout.addWidget(nameLabel, 0, 0) - layout.addWidget(nameInput, 0, 1) - layout.addWidget(linksLabel, 1, 0, 1, 2) - layout.addWidget(linkView, 2, 0, 1, 2) - layout.addWidget(save, 3, 0, 1, 2) - - self.connect(save, SIGNAL("clicked()"), self.dock.slotDone) |