25 #include <kstandarddirs.h>
26 #include <kconfigdialog.h>
27 #include <qfileinfo.h>
29 #include <knewstuff3/downloaddialog.h>
30 #include <knewstuff3/knewstuffbutton.h>
31 #include <sharedkvtmlfiles.h>
32 #include <keduvocdocument.h>
35 #include <QtCore/QPointer>
40 m_parent = (KConfigDialog*)parent;
42 connect(lviewVocab, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
this, SLOT(slotSelectionChanged(QTreeWidgetItem*)));
44 btnDownloadNew->setIcon(KIcon(
"get-hot-new-stuff"));
57 SharedKvtmlFiles::sortDownloadedFiles();
62 for(
int i = 0; i < m_fileList.size(); i++)
64 QTreeWidgetItem *item =
new QTreeWidgetItem(lviewVocab, 0);
65 item->setText( 0, m_titleList[i] );
66 item->setText( 1, m_commentList[i] );
69 m_parent->enableButtonApply(
true);
72 void VocabSettings::on_btnEdit_clicked()
74 if(lviewVocab->currentItem())
76 int index = m_itemMap[lviewVocab->currentItem()];
78 connect(vocabEdit, SIGNAL(finished(
int)),
this, SLOT(
refreshView()));
83 void VocabSettings::on_btnCreateNew_clicked()
86 connect(vocabEdit, SIGNAL(finished(
int)),
this, SLOT(
refreshView()));
90 void VocabSettings::on_btnDownloadNew_clicked()
92 QPointer<KNS3::DownloadDialog> hotNewStuffdialog =
new KNS3::DownloadDialog(
"kanagram.knsrc" );
93 hotNewStuffdialog->exec();
94 if ( hotNewStuffdialog->changedEntries().size() > 0 ){
98 delete hotNewStuffdialog;
101 void VocabSettings::slotSelectionChanged(QTreeWidgetItem *item)
103 int index = m_itemMap[item];
104 bool writeable = QFileInfo(m_fileList[index]).isWritable();
105 btnEdit->setEnabled(writeable);
108 #include "vocabsettings.moc"
VocabSettings(QWidget *parent)
default constructor
void refreshView()
reload the list of vocabularies from what's on disk
virtual ~VocabSettings()
default destructor
static QString dataLanguage()
Get Set the default translation.