[Uludag-commits] r15278 - in trunk/staj-projeleri/Pakito: gui/pspecWgt gui/pspecWgt/dialogs uis/dialogs/COMARDialog uis/dialogs/additionalFileDialog uis/dialogs/historyDialog uis/dialogs/patchDialog uis/dialogs/summaryDialog uis/pspecWidget
uludag-commits at pardus.org.tr
uludag-commits at pardus.org.tr
4 Eyl 2007 Sal 14:14:11 EEST
Author: gokcen.eraslan
Date: Tue Sep 4 14:14:11 2007
New Revision: 15278
Added:
trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/additionalFileDialog.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/additionalFileDialogUI.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/comarDialog.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/comarDialogUI.py
trunk/staj-projeleri/Pakito/uis/dialogs/COMARDialog/
trunk/staj-projeleri/Pakito/uis/dialogs/COMARDialog/comarDialogUI.ui
trunk/staj-projeleri/Pakito/uis/dialogs/additionalFileDialog/
trunk/staj-projeleri/Pakito/uis/dialogs/additionalFileDialog/additionalFileDialogUI.ui
Modified:
trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/patchDialog.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/historyWidget.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/packageWidget.py
trunk/staj-projeleri/Pakito/gui/pspecWgt/sourceWidget.py
trunk/staj-projeleri/Pakito/uis/dialogs/historyDialog/historyDialogUI.ui
trunk/staj-projeleri/Pakito/uis/dialogs/patchDialog/patchDialogUI.ui
trunk/staj-projeleri/Pakito/uis/dialogs/summaryDialog/summaryWidgetUI.ui
trunk/staj-projeleri/Pakito/uis/pspecWidget/packageWidgetUI.ui
trunk/staj-projeleri/Pakito/uis/pspecWidget/sourceWidgetUI.ui
Log:
comar scripts and additional files gui
Modified: trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/patchDialog.py
=================================================================
--- trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/patchDialog.py (original)
+++ trunk/staj-projeleri/Pakito/gui/pspecWgt/dialogs/patchDialog.py Tue Sep 4 14:14:11 2007
@@ -14,6 +14,7 @@
class PatchDialog(PatchDialogUI):
def __init__(self, parent = None, patch = None, name = None):
PatchDialogUI.__init__(self, parent, name)
+ self.realLoc = ""
self.connect(self.btnOk, SIGNAL("clicked()"), self, SLOT("accept()"))
self.connect(self.btnCancel, SIGNAL("clicked()"), self, SLOT("reject()"))
self.connect(self.pbPatch, SIGNAL("clicked()"), self.slotPatch)
@@ -26,6 +27,8 @@
def slotPatch(self):
self.realLoc = KFileDialog.getOpenFileName(QString.null, QString.null, self, i18n("Select Patch File"))
+ if not self.realLoc or str(self.realLoc).strip() == "":
+ return
self.lePatch.setText(os.path.split(str(self.realLoc))[1])
def getResult(self):
Modified: trunk/staj-projeleri/Pakito/gui/pspecWgt/historyWidget.py
=================================================================
--- trunk/staj-projeleri/Pakito/gui/pspecWgt/historyWidget.py (original)
+++ trunk/staj-projeleri/Pakito/gui/pspecWgt/historyWidget.py Tue Sep 4 14:14:11 2007
@@ -26,6 +26,8 @@
self.connect(self.pbBrowseHistory, SIGNAL("clicked()"), self.slotBrowseHistory)
self.connect(self.lvHistory, SIGNAL("executed(QListViewItem *)"), self.slotBrowseHistory)
+ self.lvHistory.setSorting(-1)
+
def addRelease(self, rel, reverse=False):
if not rel.type:
rel.type = ""
Modified: trunk/staj-projeleri/Pakito/gui/pspecWgt/packageWidget.py
=================================================================
--- trunk/staj-projeleri/Pakito/gui/pspecWgt/packageWidget.py (original)
+++ trunk/staj-projeleri/Pakito/gui/pspecWgt/packageWidget.py Tue Sep 4 14:14:11 2007
@@ -4,6 +4,9 @@
from kdeui import *
from kdecore import *
+import os
+import shutil
+
from pisi import specfile as spec
from pisi.dependency import Dependency
from pisi.conflict import Conflict
@@ -13,12 +16,19 @@
from dialogs.summaryDialog import SummaryDialog
from dialogs.dependencyDialog import DependencyDialog
from dialogs.fileDialog import FileDialog
+from dialogs.additionalFileDialog import AdditionalFileDialog
+from dialogs.comarDialog import COMARDialog
class packageWidget(QWidget):
class packageTab(PackageWidgetUI):
- def __init__(self, parent):
+ def __init__(self, parent, filesDir = None, comarDir = None):
PackageWidgetUI.__init__(self, parent)
+ if filesDir:
+ self.filesDir = filesDir
+ if comarDir:
+ self.comarDir = comarDir
+
il = KGlobal.iconLoader()
for w in [self.pbLicense, self.pbIsA, self.pbAddRuntimeDep, self.pbAddSummary, self.pbAddReplaces, self.pbAddFile, self.pbAddAdditional, self.pbAddConflict, self.pbAddCOMAR]:
@@ -58,6 +68,26 @@
self.connect(self.pbBrowseFile, SIGNAL("clicked()"), self.slotBrowseFile)
self.connect(self.lvFiles, SIGNAL("executed(QListViewItem *)"), self.slotBrowseFile)
+ self.connect(self.pbAddAdditional, SIGNAL("clicked()"), self.slotAddAdditional)
+ self.connect(self.pbViewAdditional, SIGNAL("clicked()"), self.slotViewAdditional)
+ self.connect(self.pbRemoveAdditional, SIGNAL("clicked()"), self.slotRemoveAdditional)
+ self.connect(self.pbBrowseAdditional, SIGNAL("clicked()"), self.slotBrowseAdditional)
+ self.connect(self.lvAdditionalFiles, SIGNAL("executed(QListViewItem *)"), self.slotBrowseAdditional)
+
+ self.connect(self.pbAddCOMAR, SIGNAL("clicked()"), self.slotAddCOMAR)
+ self.connect(self.pbViewCOMAR, SIGNAL("clicked()"), self.slotViewCOMAR)
+ self.connect(self.pbRemoveCOMAR, SIGNAL("clicked()"), self.slotRemoveCOMAR)
+ self.connect(self.pbBrowseCOMAR, SIGNAL("clicked()"), self.slotBrowseCOMAR)
+ self.connect(self.lvCOMAR, SIGNAL("executed(QListViewItem *)"), self.slotBrowseCOMAR)
+
+ self.lvSummary.setSorting(-1)
+ self.lvRuntimeDep.setSorting(-1)
+ self.lvReplaces.setSorting(-1)
+ self.lvFiles.setSorting(-1)
+ self.lvAdditionalFiles.setSorting(-1)
+ self.lvConflicts.setSorting(-1)
+ self.lvCOMAR.setSorting(-1)
+
def slotBrowseSummary(self):
lvi = self.lvSummary.selectedItem()
if not lvi:
@@ -183,6 +213,83 @@
lvi.setText(1, res[1])
lvi.setText(2, res[2])
+ def slotAddAdditional(self):
+ dia = AdditionalFileDialog(self)
+ if dia.exec_loop() == QDialog.Rejected:
+ return
+ res = dia.getResult()
+ KListViewItem(self.lvAdditionalFiles, res[0], res[1], res[2], res[3])
+ if not os.path.isdir(self.filesDir):
+ os.mkdir(self.filesDir)
+ shutil.copyfile(res[4], self.filesDir + "/" + res[3])
+
+ def slotRemoveAdditional(self):
+ lvi = self.lvAdditionalFiles.selectedItem()
+ if not lvi:
+ return
+ file = str(lvi.text(3))
+ self.lvAdditionalFiles.takeItem(lvi)
+ filePath = self.filesDir + "/" + file
+ if os.path.isdir(self.filesDir) and os.path.isfile(filePath):
+ os.unlink(filePath)
+
+ def slotBrowseAdditional(self):
+ lvi = self.lvAdditionalFiles.selectedItem()
+ if not lvi:
+ return
+ dia = AdditionalFileDialog(self, [str(lvi.text(0)), str(lvi.text(1)), str(lvi.text(2)), str(lvi.text(3))])
+ if dia.exec_loop() == QDialog.Rejected:
+ return
+ res = dia.getResult()
+ lvi.setText(0, res[0])
+ lvi.setText(1, res[1])
+ lvi.setText(2, res[2])
+ lvi.setText(3, res[3])
+ #TODO: additinal file may be renamed
+
+ def slotViewAdditional(self):
+ lvi = self.lvAdditionalFiles.selectedItem()
+ if not lvi:
+ return
+ os.system("kfmclient exec %s" % self.filesDir + "/" + str(lvi.text(3)))
+
+ def slotAddCOMAR(self):
+ dia = COMARDialog(self)
+ if dia.exec_loop() == QDialog.Rejected:
+ return
+ res = dia.getResult()
+ KListViewItem(self.lvCOMAR, res[0], res[1])
+ if not os.path.isdir(self.comarDir):
+ os.mkdir(self.comarDir)
+ shutil.copyfile(res[2], self.comarDir + "/" + res[1])
+
+ def slotRemoveCOMAR(self):
+ lvi = self.lvCOMAR.selectedItem()
+ if not lvi:
+ return
+ file = str(lvi.text(1))
+ self.lvCOMAR.takeItem(lvi)
+ filePath = self.comarDir + "/" + file
+ if os.path.isdir(self.comarDir) and os.path.isfile(filePath):
+ os.unlink(filePath)
+
+ def slotBrowseCOMAR(self):
+ lvi = self.lvCOMAR.selectedItem()
+ if not lvi:
+ return
+ dia = COMARDialog(self, [str(lvi.text(0)), str(lvi.text(1))])
+ if dia.exec_loop() == QDialog.Rejected:
+ return
+ res = dia.getResult()
+ lvi.setText(0, res[0])
+ lvi.setText(1, res[1])
+
+ def slotViewCOMAR(self):
+ lvi = self.lvCOMAR.selectedItem()
+ if not lvi:
+ return
+ os.system("kfmclient exec %s" % self.comarDir + "/" + str(lvi.text(1)))
+
def fill(self, package):
# general info
self.leName.setText(package.name)
@@ -337,6 +444,11 @@
pageLayout = QVBoxLayout(self, 6, 11)
topLayout = QHBoxLayout(pageLayout, 5)
+ if fileLoc:
+ tempDir = os.path.split(fileLoc)[0]
+ self.filesDir = tempDir + "/files"
+ self.comarDir = tempDir + "/comar"
+
# add/remove package buttons
pbAddPackage = KPushButton(i18n("Add New Package"), self)
pbRemovePackage = KPushButton(i18n("Remove Package"), self)
@@ -352,7 +464,7 @@
self.connect(pbRemovePackage, SIGNAL("clicked()"), self.removePackageSlot)
def addPackage(self, package, focus = False):
- tab = self.packageTab(self.twPackages)
+ tab = self.packageTab(self.twPackages, self.filesDir, self.comarDir)
tab.fill(package)
self.twPackages.addTab(tab, package.name)
if focus:
Modified: trunk/staj-projeleri/Pakito/gui/pspecWgt/sourceWidget.py
=================================================================
--- trunk/staj-projeleri/Pakito/gui/pspecWgt/sourceWidget.py (original)
+++ trunk/staj-projeleri/Pakito/gui/pspecWgt/sourceWidget.py Tue Sep 4 14:14:11 2007
@@ -7,7 +7,6 @@
from pisi import specfile as spec
from pisi.dependency import Dependency
-import os.path
import os
import shutil
@@ -21,9 +20,8 @@
SourceWidgetUI.__init__(self, parent)
if fileLoc:
- self.tempDir = os.path.split(fileLoc)[0]
- self.filesDir = self.tempDir + "/files"
- self.comarDir = self.tempDir + "/comar"
+ tempDir = os.path.split(fileLoc)[0]
+ self.filesDir = tempDir + "/files"
self.lePackager.setPaletteForegroundColor(QColor("black"))
self.lePackager.setPaletteBackgroundColor(QColor("white"))
@@ -79,6 +77,10 @@
self.connect(self.pbLicense, SIGNAL("clicked()"), self.slotLicensePopup)
self.connect(self.licensePopup, SIGNAL("activated(int)"), self.slotLicenseHandle)
+ self.lvSummary.setSorting(-1)
+ self.lvBuildDep.setSorting(-1)
+ self.lvPatches.setSorting(-1)
+
def slotLicensePopup(self):
self.licensePopup.exec_loop(self.pbLicense.mapToGlobal(QPoint(0,0 + self.pbLicense.height())))
@@ -221,6 +223,7 @@
lvi.setText(0, res[0])
lvi.setText(1, res[1])
lvi.setText(2, res[2])
+ #TODO: patch file may be renamed
def slotViewPatch(self):
lvi = self.lvPatches.selectedItem()
Modified: trunk/staj-projeleri/Pakito/uis/dialogs/historyDialog/historyDialogUI.ui
=================================================================
--- trunk/staj-projeleri/Pakito/uis/dialogs/historyDialog/historyDialogUI.ui (original)
+++ trunk/staj-projeleri/Pakito/uis/dialogs/historyDialog/historyDialogUI.ui Tue Sep 4 14:14:11 2007
@@ -174,6 +174,9 @@
<property name="minValue">
<number>1</number>
</property>
+ <property name="maxValue">
+ <number>1000</number>
+ </property>
</widget>
<spacer row="0" column="2">
<property name="name">
@@ -352,6 +355,7 @@
<tabstops>
<tabstop>niRelease</tabstop>
<tabstop>leVersion</tabstop>
+ <tabstop>cbType</tabstop>
<tabstop>teComment</tabstop>
<tabstop>leName</tabstop>
<tabstop>leEmail</tabstop>
Modified: trunk/staj-projeleri/Pakito/uis/dialogs/patchDialog/patchDialogUI.ui
=================================================================
--- trunk/staj-projeleri/Pakito/uis/dialogs/patchDialog/patchDialogUI.ui (original)
+++ trunk/staj-projeleri/Pakito/uis/dialogs/patchDialog/patchDialogUI.ui Tue Sep 4 14:14:11 2007
@@ -93,7 +93,7 @@
</item>
<item>
<property name="text">
- <string>gzip</string>
+ <string>gz</string>
</property>
</item>
<item>
@@ -250,6 +250,15 @@
</widget>
<customwidgets>
</customwidgets>
+<tabstops>
+ <tabstop>niLevel</tabstop>
+ <tabstop>cbType</tabstop>
+ <tabstop>lePatch</tabstop>
+ <tabstop>pbPatch</tabstop>
+ <tabstop>btnHelp</tabstop>
+ <tabstop>btnOk</tabstop>
+ <tabstop>btnCancel</tabstop>
+</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>kdialog.h</includehint>
Modified: trunk/staj-projeleri/Pakito/uis/dialogs/summaryDialog/summaryWidgetUI.ui
=================================================================
--- trunk/staj-projeleri/Pakito/uis/dialogs/summaryDialog/summaryWidgetUI.ui (original)
+++ trunk/staj-projeleri/Pakito/uis/dialogs/summaryDialog/summaryWidgetUI.ui Tue Sep 4 14:14:11 2007
@@ -97,6 +97,13 @@
</widget>
</hbox>
</widget>
+<customwidgets>
+</customwidgets>
+<tabstops>
+ <tabstop>leLanguage</tabstop>
+ <tabstop>leSummary</tabstop>
+ <tabstop>teDescription</tabstop>
+</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klineedit.h</includehint>
Modified: trunk/staj-projeleri/Pakito/uis/pspecWidget/packageWidgetUI.ui
=================================================================
--- trunk/staj-projeleri/Pakito/uis/pspecWidget/packageWidgetUI.ui (original)
+++ trunk/staj-projeleri/Pakito/uis/pspecWidget/packageWidgetUI.ui Tue Sep 4 14:14:11 2007
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>689</width>
- <height>440</height>
+ <width>470</width>
+ <height>373</height>
</rect>
</property>
<property name="caption">
Modified: trunk/staj-projeleri/Pakito/uis/pspecWidget/sourceWidgetUI.ui
=================================================================
--- trunk/staj-projeleri/Pakito/uis/pspecWidget/sourceWidgetUI.ui (original)
+++ trunk/staj-projeleri/Pakito/uis/pspecWidget/sourceWidgetUI.ui Tue Sep 4 14:14:11 2007
@@ -794,12 +794,13 @@
</customwidgets>
<tabstops>
<tabstop>leName</tabstop>
- <tabstop>leIsA</tabstop>
- <tabstop>pbIsA</tabstop>
<tabstop>leHomepage</tabstop>
- <tabstop>lePartOf</tabstop>
<tabstop>leLicense</tabstop>
<tabstop>pbLicense</tabstop>
+ <tabstop>leIsA</tabstop>
+ <tabstop>pbIsA</tabstop>
+ <tabstop>lePartOf</tabstop>
+ <tabstop>lePackager</tabstop>
<tabstop>pbPackager</tabstop>
<tabstop>twSource</tabstop>
<tabstop>leURI</tabstop>
@@ -814,6 +815,10 @@
<tabstop>pbAddPatch</tabstop>
<tabstop>pbRemovePatch</tabstop>
<tabstop>pbBrowsePatch</tabstop>
+ <tabstop>pbAddBuildDep</tabstop>
+ <tabstop>pbRemoveBuildDep</tabstop>
+ <tabstop>pbBrowseBuildDep</tabstop>
+ <tabstop>pbViewPatch</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
Uludag-commits mesaj listesiyle ilgili
daha fazla bilgi