[#14 state:fixed] Added a Export to XHTML menu to the Qt port of DG.

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40109
This commit is contained in:
hsoft 2009-09-01 16:40:29 +00:00
parent d8f9a3f054
commit 44ecae2657
2 changed files with 36 additions and 3 deletions

View File

@ -7,9 +7,9 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license
from PyQt4.QtCore import Qt, QCoreApplication, QProcess, SIGNAL
from PyQt4.QtCore import Qt, QCoreApplication, QProcess, SIGNAL, QUrl
from PyQt4.QtGui import (QMainWindow, QMenu, QPixmap, QIcon, QToolButton, QLabel, QHeaderView,
QMessageBox, QInputDialog, QLineEdit, QItemSelectionModel)
QMessageBox, QInputDialog, QLineEdit, QItemSelectionModel, QDesktopServices)
from hsutil.misc import nonone
@ -200,7 +200,17 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def directoriesTriggered(self):
self.app.show_directories()
def exportTriggered(self):
h = self.resultsView.header()
column_ids = []
for i in range(len(self.app.data.COLUMNS)):
if not h.isSectionHidden(i):
column_ids.append(str(i))
exported_path = self.app.export_to_xhtml(column_ids)
url = QUrl.fromLocalFile(exported_path)
QDesktopServices.openUrl(url)
def makeReferenceTriggered(self):
self.app.make_reference(self.resultsView.selectedDupes())

View File

@ -121,6 +121,7 @@
</property>
<addaction name="actionScan"/>
<addaction name="separator"/>
<addaction name="actionExport"/>
<addaction name="actionClearIgnoreList"/>
<addaction name="separator"/>
<addaction name="actionQuit"/>
@ -416,6 +417,11 @@
<string>Check for Update</string>
</property>
</action>
<action name="actionExport">
<property name="text">
<string>Export To XHTML</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
@ -876,6 +882,22 @@
</hint>
</hints>
</connection>
<connection>
<sender>actionExport</sender>
<signal>triggered()</signal>
<receiver>MainWindow</receiver>
<slot>exportTriggered()</slot>
<hints>
<hint type="sourcelabel">
<x>-1</x>
<y>-1</y>
</hint>
<hint type="destinationlabel">
<x>314</x>
<y>256</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>directoriesTriggered()</slot>
@ -907,5 +929,6 @@
<slot>aboutTriggered()</slot>
<slot>registerTrigerred()</slot>
<slot>checkForUpdateTriggered()</slot>
<slot>exportTriggered()</slot>
</slots>
</ui>