- /*! Remove all bookmarks
+ /*! Removes all bookmarks
*/
- void removeAllBookmark(){
+ void removeAllBookmarks(){
_bookmarks.clear();
}
QWidget::showEvent(e);
}
- void DictManagerWidget::hideEvent(QHideEvent *e)
- {
- QList<CommonDictInterface*> checkedDicts;
+ void DictManagerWidget::saveChanges() {
+
+ #ifndef Q_WS_MAEMO_5
+ if(_save) {
+ #else
+ if(_changed &&
+ QMessageBox::question(this, "Save", "Do you want to save changes?",
+ QMessageBox::Save, QMessageBox::Cancel) == QMessageBox::Save) {
+ #endif
+ QList<CommonDictInterface*> checkedDicts;
- for(int i=0; i<dictListWidget->count(); i++) {
- QListWidgetItem* item = dictListWidget->item(i);
- if(item->checkState() == Qt::Checked) {
- checkedDicts.push_back(dictsHash[item]);
+ for(int i=0; i<dictListWidget->count(); i++) {
+ QListWidgetItem* item = dictListWidget->item(i);
+ if(item->checkState() == Qt::Checked) {
+ checkedDicts.push_back(dictsHash[item]);
+ }
}
+ emit selectedDictionaries(checkedDicts);
}
- Q_EMIT selectedDictionaries(checkedDicts);
-
+ _changed = false;
+ }
+ void DictManagerWidget::hideEvent(QHideEvent *e)
+ {
+ saveChanges();
QWidget::hideEvent(e);
}
//! disabled
void breakSearching();
+ //! Asks for confirmation when user click on "delete all bookmarks"
+ void removeBookmarks();
+
protected:
- /*! When user wants to close application, we first sends signal to stop all
+ /*! When user wants to close application, we first send signal to stop all
ongoing searches.
*/
void closeEvent(QCloseEvent *);
fullScreenToolButton->sizeHint().height()*2);
#endif*/
- searchingProgressBar = new QProgressBar(this);
- //progress bar has minimum and maximum values set to 0, which will effect
-
+ searchingProgressBar = new QProgressBar();
+ //progress bar have minimum and maximum values set to 0, which will effect
//with "I'm alive" bar
searchingProgressBar->setMinimum(0);
searchingProgressBar->setMaximum(0);
QString format = "png";
QString initialPath = QDir::currentPath() + tr("/xdxf.") + format;
- // qDebug()<<initialPath;
- // QPixmap test(":/icons/xdxf.png");
- // qDebug()<<QPixmap(test).save(initialPath,format.toAscii());
- // qDebug()<<QPixmap("/home/jakub/star.jpg").save(initialPath,format.toAscii());
- _infoNote="path=\""+initialPath+"\">"+"\n" + _name + " [" + _langFrom + "-" + _langTo + "] "+ "(" + _type + ")";
+ _infoNote="path=\""+initialPath+"\"> \n" + _name + " [" + _langFrom + "-" + _langTo + "] (" + _type + ")";
dictionaryFile.close();
}