From: Mateusz Półrola Date: Tue, 3 Aug 2010 13:57:19 +0000 (+0200) Subject: added package building directories X-Git-Tag: 0.4~114^2~3^2~3 X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;h=b807e8dde6a0256a0f61d008f9e5192023e434c7;p=mdictionary added package building directories --- diff --git a/data/64x64/mdictionary.png b/data/64x64/mdictionary.png new file mode 100644 index 0000000..241ca6d Binary files /dev/null and b/data/64x64/mdictionary.png differ diff --git a/data/mdictionary.desktop b/data/mdictionary.desktop new file mode 100644 index 0000000..c6131cf --- /dev/null +++ b/data/mdictionary.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Categories=Office +Name=mDictionary +Icon=mdictonary +Exec=/usr/bin/mdictionary +X-Maemo-Category=Main + diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..cac9e94 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +mdictionary for Debian +---------------------- + + + + -- Mateusz Polrola , Tue, 3 Aug 2010 13:44:27 +0200 diff --git a/debian/___files b/debian/___files new file mode 100644 index 0000000..d6d1c1c --- /dev/null +++ b/debian/___files @@ -0,0 +1 @@ +mdictionary_0.1-1_i386.deb devel optional diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..631d163 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,3 @@ +mdictionary (1.0.0-2) unstable; urgency=low + * minor bugfixes in debian package + -- unknown Mon, 20 Nov 2007 13:11:00 +0300 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3ed06a9 --- /dev/null +++ b/debian/control @@ -0,0 +1,12 @@ +Source: mdictionary +Section: user/multimedia +Priority: optional +Maintainer: Mateusz Polrola +Build-Depends: debhelper (>= 4.0.0), libqt4-core +Standards-Version: 3.8.0 + +Package: mdictionary +Architecture: any +Depends: ${shlibs:Depends} +Description: Multilanguage dictionary + Long desc diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..0d60794 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Mateusz Polrola on +Tue, 3 Aug 2010 13:44:27 +0200. + +It was downloaded from + +Copyright: + +Upstream Author(s): + +License: + + This package 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; version 2 dated June, 1991. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + diff --git a/debian/dirs b/debian/dirs new file mode 100644 index 0000000..ca882bb --- /dev/null +++ b/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..e69de29 diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..36e4e8a --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +mdictionary_1.0.0-2_i386.deb user/multimedia optional diff --git a/debian/mDictionary/usr/bin/mDictionary b/debian/mDictionary/usr/bin/mDictionary new file mode 100755 index 0000000..400c3dc Binary files /dev/null and b/debian/mDictionary/usr/bin/mDictionary differ diff --git a/debian/mDictionary/usr/bin/mdictionary b/debian/mDictionary/usr/bin/mdictionary new file mode 100755 index 0000000..400c3dc Binary files /dev/null and b/debian/mDictionary/usr/bin/mdictionary differ diff --git a/debian/mDictionary/usr/share/applications/hildon/mDictionary.desktop b/debian/mDictionary/usr/share/applications/hildon/mDictionary.desktop new file mode 100644 index 0000000..4771e34 --- /dev/null +++ b/debian/mDictionary/usr/share/applications/hildon/mDictionary.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Categories=Office +Name=mDictionary +Icon = mdictonary +Exec=/usr/bin/mdictionary +X-Maemo-Category = Main + diff --git a/debian/mDictionary/usr/share/applications/hildon/mdictionary.desktop b/debian/mDictionary/usr/share/applications/hildon/mdictionary.desktop new file mode 100644 index 0000000..4771e34 --- /dev/null +++ b/debian/mDictionary/usr/share/applications/hildon/mdictionary.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Categories=Office +Name=mDictionary +Icon = mdictonary +Exec=/usr/bin/mdictionary +X-Maemo-Category = Main + diff --git a/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mDictionary.png b/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mDictionary.png new file mode 100644 index 0000000..241ca6d Binary files /dev/null and b/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mDictionary.png differ diff --git a/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png b/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png new file mode 100644 index 0000000..241ca6d Binary files /dev/null and b/debian/mDictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png differ diff --git a/debian/mdictionary.substvars b/debian/mdictionary.substvars new file mode 100644 index 0000000..cfd29b1 --- /dev/null +++ b/debian/mdictionary.substvars @@ -0,0 +1 @@ +shlibs:Depends=libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100401), libqt4-gui (>= 4.6.2~git20100401), libstdc++6 (>= 4.2.1) diff --git a/debian/mdictionary/DEBIAN/control b/debian/mdictionary/DEBIAN/control new file mode 100644 index 0000000..d7bda3d --- /dev/null +++ b/debian/mdictionary/DEBIAN/control @@ -0,0 +1,10 @@ +Package: mdictionary +Version: 1.0.0-2 +Architecture: i386 +Maintainer: Mateusz Polrola +Installed-Size: 128 +Depends: libc6 (>= 2.5.0-1), libgcc1 (>= 1:4.2.1), libqt4-core (>= 4.6.2~git20100401), libqt4-gui (>= 4.6.2~git20100401), libstdc++6 (>= 4.2.1) +Section: user/multimedia +Priority: optional +Description: Multilanguage dictionary + Long desc diff --git a/debian/mdictionary/DEBIAN/md5sums b/debian/mdictionary/DEBIAN/md5sums new file mode 100644 index 0000000..db9e51c --- /dev/null +++ b/debian/mdictionary/DEBIAN/md5sums @@ -0,0 +1,6 @@ +d45ee4b6faabfa5b22950fc2ac5390a2 usr/share/doc/mdictionary/README.Debian +149c5fa98facd4cc7d708c96c11fe028 usr/share/doc/mdictionary/copyright +d985aecef87f4ab660ca2d5396aac6ff usr/share/doc/mdictionary/changelog.Debian.gz +35612a2bf496e172d7abcf76c0d8b47b usr/share/applications/hildon/mdictionary.desktop +30a33a60d95c3518fce3cf69a7bfc288 usr/share/icons/hicolor/64x64/apps/mdictionary.png +c125649ba95d59ea878802095c178213 usr/bin/mdictionary diff --git a/debian/mdictionary/usr/bin/mdictionary b/debian/mdictionary/usr/bin/mdictionary new file mode 100755 index 0000000..6445d73 Binary files /dev/null and b/debian/mdictionary/usr/bin/mdictionary differ diff --git a/debian/mdictionary/usr/share/applications/hildon/mdictionary.desktop b/debian/mdictionary/usr/share/applications/hildon/mdictionary.desktop new file mode 100644 index 0000000..c6131cf --- /dev/null +++ b/debian/mdictionary/usr/share/applications/hildon/mdictionary.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Categories=Office +Name=mDictionary +Icon=mdictonary +Exec=/usr/bin/mdictionary +X-Maemo-Category=Main + diff --git a/debian/mdictionary/usr/share/doc/mdictionary/README.Debian b/debian/mdictionary/usr/share/doc/mdictionary/README.Debian new file mode 100644 index 0000000..cac9e94 --- /dev/null +++ b/debian/mdictionary/usr/share/doc/mdictionary/README.Debian @@ -0,0 +1,6 @@ +mdictionary for Debian +---------------------- + + + + -- Mateusz Polrola , Tue, 3 Aug 2010 13:44:27 +0200 diff --git a/debian/mdictionary/usr/share/doc/mdictionary/changelog.Debian.gz b/debian/mdictionary/usr/share/doc/mdictionary/changelog.Debian.gz new file mode 100644 index 0000000..60acc07 Binary files /dev/null and b/debian/mdictionary/usr/share/doc/mdictionary/changelog.Debian.gz differ diff --git a/debian/mdictionary/usr/share/doc/mdictionary/copyright b/debian/mdictionary/usr/share/doc/mdictionary/copyright new file mode 100644 index 0000000..0d60794 --- /dev/null +++ b/debian/mdictionary/usr/share/doc/mdictionary/copyright @@ -0,0 +1,28 @@ +This package was debianized by Mateusz Polrola on +Tue, 3 Aug 2010 13:44:27 +0200. + +It was downloaded from + +Copyright: + +Upstream Author(s): + +License: + + This package 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; version 2 dated June, 1991. + + This package 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 package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + diff --git a/debian/mdictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png b/debian/mdictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png new file mode 100644 index 0000000..241ca6d Binary files /dev/null and b/debian/mdictionary/usr/share/icons/hicolor/64x64/apps/mdictionary.png differ diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b92048f --- /dev/null +++ b/debian/rules @@ -0,0 +1,78 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +APPNAME := mdictionary + +builddir: + mkdir -p builddir + +builddir/Makefile: builddir + cd builddir && qmake-qt4 PREFIX=/usr ../$(APPNAME).pro + + +build: build-stamp + +build-stamp: builddir/Makefile + dh_testdir + cd builddir && $(MAKE) + touch $@ + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + rm -rf builddir + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + cd builddir && $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installexamples +# dh_install +# dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron +# dh_installinfo + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_python +# dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/mdictionary.pro b/mdictionary.pro new file mode 100644 index 0000000..52c41fd --- /dev/null +++ b/mdictionary.pro @@ -0,0 +1,8 @@ +QMAKEVERSION = $$[QMAKE_VERSION] +ISQT4 = $$find(QMAKEVERSION, ^[2-9]) +isEmpty( ISQT4 ) { +error("Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4"); +} + +TEMPLATE = subdirs +SUBDIRS = trunk/src/base/ diff --git a/trunk/src/base/Makefile b/trunk/src/base/Makefile new file mode 100644 index 0000000..338f884 --- /dev/null +++ b/trunk/src/base/Makefile @@ -0,0 +1,321 @@ +############################################################################# +# Makefile for building: mdictionary +# Generated by qmake (2.01a) (Qt 4.6.2) on: wt. sie 3 15:25:40 2010 +# Project: base.pro +# Template: app +# Command: /usr/bin/qmake -unix -o Makefile base.pro +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DDATADIR=\"/usr/share\" -DPKGDATADIR=\"\" -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED +CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) +INCPATH = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. +LINK = g++ +LFLAGS = -Wl,-O1 +LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = $(COPY) +COPY_DIR = $(COPY) -r +STRIP = strip +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = ./ + +####### Files + +SOURCES = gui/main.cpp \ + gui/MainWindow.cpp \ + gui/SearchBarWidget.cpp \ + gui/WordListWidget.cpp \ + gui/TranslationWidget.cpp \ + backbone/backbone.cpp moc_MainWindow.cpp \ + moc_SearchBarWidget.cpp \ + moc_WordListWidget.cpp \ + moc_TranslationWidget.cpp \ + moc_backbone.cpp \ + moc_CommonDictInterface.cpp +OBJECTS = main.o \ + MainWindow.o \ + SearchBarWidget.o \ + WordListWidget.o \ + TranslationWidget.o \ + backbone.o \ + moc_MainWindow.o \ + moc_SearchBarWidget.o \ + moc_WordListWidget.o \ + moc_TranslationWidget.o \ + moc_backbone.o \ + moc_CommonDictInterface.o +DIST = /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + base.pro +QMAKE_TARGET = mdictionary +DESTDIR = +TARGET = mdictionary + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): ui_MainWindow.h $(OBJECTS) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) + +Makefile: base.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ + /usr/share/qt4/mkspecs/common/unix.conf \ + /usr/share/qt4/mkspecs/common/linux.conf \ + /usr/share/qt4/mkspecs/qconfig.pri \ + /usr/share/qt4/mkspecs/features/qt_functions.prf \ + /usr/share/qt4/mkspecs/features/qt_config.prf \ + /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ + /usr/share/qt4/mkspecs/features/default_pre.prf \ + /usr/share/qt4/mkspecs/features/release.prf \ + /usr/share/qt4/mkspecs/features/default_post.prf \ + /usr/share/qt4/mkspecs/features/warn_on.prf \ + /usr/share/qt4/mkspecs/features/qt.prf \ + /usr/share/qt4/mkspecs/features/unix/thread.prf \ + /usr/share/qt4/mkspecs/features/moc.prf \ + /usr/share/qt4/mkspecs/features/resources.prf \ + /usr/share/qt4/mkspecs/features/uic.prf \ + /usr/share/qt4/mkspecs/features/yacc.prf \ + /usr/share/qt4/mkspecs/features/lex.prf \ + /usr/share/qt4/mkspecs/features/include_source_dir.prf \ + /usr/lib/libQtGui.prl \ + /usr/lib/libQtCore.prl + $(QMAKE) -unix -o Makefile base.pro +/usr/share/qt4/mkspecs/common/g++.conf: +/usr/share/qt4/mkspecs/common/unix.conf: +/usr/share/qt4/mkspecs/common/linux.conf: +/usr/share/qt4/mkspecs/qconfig.pri: +/usr/share/qt4/mkspecs/features/qt_functions.prf: +/usr/share/qt4/mkspecs/features/qt_config.prf: +/usr/share/qt4/mkspecs/features/exclusive_builds.prf: +/usr/share/qt4/mkspecs/features/default_pre.prf: +/usr/share/qt4/mkspecs/features/release.prf: +/usr/share/qt4/mkspecs/features/default_post.prf: +/usr/share/qt4/mkspecs/features/warn_on.prf: +/usr/share/qt4/mkspecs/features/qt.prf: +/usr/share/qt4/mkspecs/features/unix/thread.prf: +/usr/share/qt4/mkspecs/features/moc.prf: +/usr/share/qt4/mkspecs/features/resources.prf: +/usr/share/qt4/mkspecs/features/uic.prf: +/usr/share/qt4/mkspecs/features/yacc.prf: +/usr/share/qt4/mkspecs/features/lex.prf: +/usr/share/qt4/mkspecs/features/include_source_dir.prf: +/usr/lib/libQtGui.prl: +/usr/lib/libQtCore.prl: +qmake: FORCE + @$(QMAKE) -unix -o Makefile base.pro + +dist: + @$(CHK_DIR_EXISTS) .tmp/mdictionary1.0.0 || $(MKDIR) .tmp/mdictionary1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/mdictionary1.0.0/ && $(COPY_FILE) --parents gui/MainWindow.h gui/SearchBarWidget.h gui/WordListWidget.h gui/TranslationWidget.h backbone/backbone.h ../includes/translation.h ../includes/settings.h ../includes/CommonDictInterface.h .tmp/mdictionary1.0.0/ && $(COPY_FILE) --parents gui/main.cpp gui/MainWindow.cpp gui/SearchBarWidget.cpp gui/WordListWidget.cpp gui/TranslationWidget.cpp backbone/backbone.cpp .tmp/mdictionary1.0.0/ && $(COPY_FILE) --parents gui/MainWindow.ui .tmp/mdictionary1.0.0/ && (cd `dirname .tmp/mdictionary1.0.0` && $(TAR) mdictionary1.0.0.tar mdictionary1.0.0 && $(COMPRESS) mdictionary1.0.0.tar) && $(MOVE) `dirname .tmp/mdictionary1.0.0`/mdictionary1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/mdictionary1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) Makefile + + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +compiler_moc_header_make_all: moc_MainWindow.cpp moc_SearchBarWidget.cpp moc_WordListWidget.cpp moc_TranslationWidget.cpp moc_backbone.cpp moc_CommonDictInterface.cpp +compiler_moc_header_clean: + -$(DEL_FILE) moc_MainWindow.cpp moc_SearchBarWidget.cpp moc_WordListWidget.cpp moc_TranslationWidget.cpp moc_backbone.cpp moc_CommonDictInterface.cpp +moc_MainWindow.cpp: gui/TranslationWidget.h \ + gui/WordListWidget.h \ + gui/SearchBarWidget.h \ + gui/MainWindow.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gui/MainWindow.h -o moc_MainWindow.cpp + +moc_SearchBarWidget.cpp: gui/SearchBarWidget.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gui/SearchBarWidget.h -o moc_SearchBarWidget.cpp + +moc_WordListWidget.cpp: gui/WordListWidget.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gui/WordListWidget.h -o moc_WordListWidget.cpp + +moc_TranslationWidget.cpp: gui/TranslationWidget.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gui/TranslationWidget.h -o moc_TranslationWidget.cpp + +moc_backbone.cpp: ../includes/CommonDictInterface.h \ + ../includes/translation.h \ + ../includes/settings.h \ + backbone/backbone.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) backbone/backbone.h -o moc_backbone.cpp + +moc_CommonDictInterface.cpp: ../includes/translation.h \ + ../includes/CommonDictInterface.h + /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) ../includes/CommonDictInterface.h -o moc_CommonDictInterface.cpp + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_image_collection_make_all: qmake_image_collection.cpp +compiler_image_collection_clean: + -$(DEL_FILE) qmake_image_collection.cpp +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: ui_MainWindow.h +compiler_uic_clean: + -$(DEL_FILE) ui_MainWindow.h +ui_MainWindow.h: gui/MainWindow.ui + /usr/bin/uic-qt4 gui/MainWindow.ui -o ui_MainWindow.h + +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_moc_header_clean compiler_uic_clean + +####### Compile + +main.o: gui/main.cpp gui/MainWindow.h \ + gui/TranslationWidget.h \ + gui/WordListWidget.h \ + gui/SearchBarWidget.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o gui/main.cpp + +MainWindow.o: gui/MainWindow.cpp gui/MainWindow.h \ + gui/TranslationWidget.h \ + gui/WordListWidget.h \ + gui/SearchBarWidget.h \ + ui_MainWindow.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MainWindow.o gui/MainWindow.cpp + +SearchBarWidget.o: gui/SearchBarWidget.cpp gui/SearchBarWidget.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o SearchBarWidget.o gui/SearchBarWidget.cpp + +WordListWidget.o: gui/WordListWidget.cpp gui/WordListWidget.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o WordListWidget.o gui/WordListWidget.cpp + +TranslationWidget.o: gui/TranslationWidget.cpp gui/TranslationWidget.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o TranslationWidget.o gui/TranslationWidget.cpp + +backbone.o: backbone/backbone.cpp backbone/backbone.h \ + ../includes/CommonDictInterface.h \ + ../includes/translation.h \ + ../includes/settings.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o backbone.o backbone/backbone.cpp + +moc_MainWindow.o: moc_MainWindow.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_MainWindow.o moc_MainWindow.cpp + +moc_SearchBarWidget.o: moc_SearchBarWidget.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_SearchBarWidget.o moc_SearchBarWidget.cpp + +moc_WordListWidget.o: moc_WordListWidget.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_WordListWidget.o moc_WordListWidget.cpp + +moc_TranslationWidget.o: moc_TranslationWidget.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_TranslationWidget.o moc_TranslationWidget.cpp + +moc_backbone.o: moc_backbone.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_backbone.o moc_backbone.cpp + +moc_CommonDictInterface.o: moc_CommonDictInterface.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_CommonDictInterface.o moc_CommonDictInterface.cpp + +####### Install + +install_target: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/bin/ + -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(STRIP) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + +uninstall_target: FORCE + -$(DEL_FILE) "$(INSTALL_ROOT)/usr/bin/$(QMAKE_TARGET)" + -$(DEL_DIR) $(INSTALL_ROOT)/usr/bin/ + + +install_desktop: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/hildon/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + -$(INSTALL_FILE) /scratchbox/users/mateusz/home/mateusz/mdictionary/data/mdictionary.desktop $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +uninstall_desktop: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/hildon/mdictionary.desktop + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/hildon/ + + +install_icon64: first FORCE + @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + -$(INSTALL_FILE) /scratchbox/users/mateusz/home/mateusz/mdictionary/data/64x64/mdictionary.png $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +uninstall_icon64: FORCE + -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/mdictionary.png + -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ + + +install: install_target install_desktop install_icon64 FORCE + +uninstall: uninstall_target uninstall_desktop uninstall_icon64 FORCE + +FORCE: + diff --git a/trunk/src/base/base.pro b/trunk/src/base/base.pro new file mode 100644 index 0000000..6a7de25 --- /dev/null +++ b/trunk/src/base/base.pro @@ -0,0 +1,58 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-08-03T08:54:27 +# +#------------------------------------------------- + +QT += core gui + +TARGET = mdictionary +TEMPLATE = app + + +SOURCES += gui/main.cpp\ + gui/MainWindow.cpp \ + gui/SearchBarWidget.cpp \ + gui/WordListWidget.cpp \ + gui/TranslationWidget.cpp \ + backbone/backbone.cpp + +HEADERS += gui/MainWindow.h \ + gui/SearchBarWidget.h \ + gui/WordListWidget.h \ + gui/TranslationWidget.h \ + backbone/backbone.h \ + ../includes/translation.h \ + ../includes/settings.h \ + ../includes/CommonDictInterface.h + +FORMS += gui/MainWindow.ui + +unix { + #VARIABLES + isEmpty(PREFIX) { + PREFIX = /usr + } + BINDIR = $$PREFIX/bin + DATADIR =$$PREFIX/share + + DEFINES += DATADIR=\\\"$$DATADIR\\\" PKGDATADIR=\\\"$$PKGDATADIR\\\" + + #MAKE INSTALL + + INSTALLS += target desktop icon26 icon48 icon64 + + target.path =$$BINDIR + + desktop.path = $$DATADIR/applications/hildon + desktop.files += ../../../data/$${TARGET}.desktop + + icon26.path = $$DATADIR/icons/hicolor/26x26/apps + icon26.files += ../../../data/26x26/$${TARGET}.png + + icon48.path = $$DATADIR/icons/hicolor/48x48/apps + icon48.files += ../../../data/48x48/$${TARGET}.png + + icon64.path = $$DATADIR/icons/hicolor/64x64/apps + icon64.files += ../../../data/64x64/$${TARGET}.png +} diff --git a/trunk/src/base/gui/MainWindow.cpp b/trunk/src/base/gui/MainWindow.cpp new file mode 100644 index 0000000..6d4975f --- /dev/null +++ b/trunk/src/base/gui/MainWindow.cpp @@ -0,0 +1,37 @@ +#include "MainWindow.h" +#include "ui_MainWindow.h" + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), + ui(new Ui::MainWindow) { + ui->setupUi(this); + setAttribute(Qt::WA_Maemo5StackedWindow); + + searchBarWidget = new SearchBarWidget(); + wordListWidget = new WordListWidget(); + translationWidget = new TranslationWidget(this); + + connect(wordListWidget, SIGNAL(clicked(QModelIndex)), + translationWidget, SLOT(show(QModelIndex))); + + ui->centralWidget->layout()->addWidget(wordListWidget); + ui->centralWidget->layout()->addWidget(searchBarWidget); + + +} + +MainWindow::~MainWindow() { + delete ui; +} + + +void MainWindow::closeEvent(QCloseEvent *event) { + if(searchBarWidget->isSearching()) { + emit stopSearching(); + event->ignore(); + } +} + +void MainWindow::closeOk() { + QMainWindow::close(); +} diff --git a/trunk/src/base/gui/MainWindow.h b/trunk/src/base/gui/MainWindow.h new file mode 100644 index 0000000..596ee4e --- /dev/null +++ b/trunk/src/base/gui/MainWindow.h @@ -0,0 +1,39 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include +#include "TranslationWidget.h" +#include "WordListWidget.h" +#include "SearchBarWidget.h" + +namespace Ui { + class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + +public Q_SLOTS: + void closeOk(); + +Q_SIGNALS: + void stopSearching(); + +protected: + void closeEvent(QCloseEvent *); + + + +private: + Ui::MainWindow *ui; + SearchBarWidget* searchBarWidget; + TranslationWidget* translationWidget; + WordListWidget* wordListWidget; +}; + +#endif // MAINWINDOW_H diff --git a/trunk/src/base/gui/MainWindow.ui b/trunk/src/base/gui/MainWindow.ui new file mode 100644 index 0000000..a9ee0be --- /dev/null +++ b/trunk/src/base/gui/MainWindow.ui @@ -0,0 +1,108 @@ + + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 0 + 0 + 0 + + + + + + + + true + + + + + + + 0 + 0 + 400 + 23 + + + + + + TopToolBarArea + + + false + + + + + + + diff --git a/trunk/src/base/gui/SearchBarWidget.cpp b/trunk/src/base/gui/SearchBarWidget.cpp new file mode 100644 index 0000000..42813f8 --- /dev/null +++ b/trunk/src/base/gui/SearchBarWidget.cpp @@ -0,0 +1,179 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + + +#include "SearchBarWidget.h" +#include + + + +SearchBarWidget::SearchBarWidget(QWidget *parent) : + QWidget(parent) { + + initializeUI(); + + setMaximumHeight(150); + + _isSearching = false; + + connect(searchPushButton, SIGNAL(clicked()), + this, SLOT(searchPushButtonClicked())); + + connect(historyNextToolButton, SIGNAL(clicked()), + this, SLOT(historyNextToolButtonClicked())); + + connect(historyPrevToolButton, SIGNAL(clicked()), + this, SLOT(historyPrevToolButtonClicked())); + + connect(historyShowToolButton, SIGNAL(clicked()), + this, SLOT(historyShowToolButtonClicked())); + + connect(clearSearchWordToolButton, SIGNAL(clicked()), + this, SLOT(clearSearchWordToolButtonClicked())); + +} + +SearchBarWidget::~SearchBarWidget() { + +} + + +void SearchBarWidget::initializeUI() { + horizontalLayout = new QHBoxLayout(); + verticalLayout = new QVBoxLayout(); + + + searchPushButton = new QPushButton(tr("Search")); + searchPushButton->setMinimumWidth(200); + + + searchWordLineEdit = new QLineEdit(); + searchWordLineEdit->setMinimumWidth(350); + //create layout for lineEdit to have clear button on it + QHBoxLayout* lineEditLayout = new QHBoxLayout; + searchWordLineEdit->setLayout(lineEditLayout); + + + clearSearchWordToolButton = new QToolButton(); + clearSearchWordToolButton->setIcon(QIcon("sowa.svg")); + //tool buttons will have size 2 times smaller + clearSearchWordToolButton->setMaximumSize( + clearSearchWordToolButton->sizeHint().width()/2, + clearSearchWordToolButton->sizeHint().height()/2); + + + historyNextToolButton = new QToolButton(); + historyNextToolButton->setIcon(QIcon("sowa.svg")); + historyNextToolButton->setMaximumSize( + historyNextToolButton->sizeHint().width()/2, + historyNextToolButton->sizeHint().height()/2); + + + historyPrevToolButton = new QToolButton(); + historyPrevToolButton->setIcon(QIcon("sowa.svg")); + historyPrevToolButton->setMaximumSize( + historyPrevToolButton->sizeHint().width()/2, + historyPrevToolButton->sizeHint().height()/2); + + + historyShowToolButton = new QToolButton(); + historyShowToolButton->setIcon(QIcon("sowa.svg")); + historyShowToolButton->setMaximumSize( + historyShowToolButton->sizeHint().width()/2, + historyShowToolButton->sizeHint().height()/2); + + + searchingProgressBar = new QProgressBar(); + searchingProgressBar->setMinimum(0); + searchingProgressBar->setMaximum(0); + searchingProgressBar->hide(); + searchingProgressBar->setMaximumHeight(50); + + + + setLayout(verticalLayout); + + verticalLayout->addWidget(searchingProgressBar); + + //adding widgets to layout + horizontalLayout->addWidget(searchWordLineEdit); + horizontalLayout->addWidget(searchPushButton); + horizontalLayout->addWidget(historyPrevToolButton); + horizontalLayout->addWidget(historyShowToolButton); + horizontalLayout->addWidget(historyNextToolButton); + + //adding clear toolButton to textEdit with right alignment + lineEditLayout->addWidget(clearSearchWordToolButton, 0, + Qt::AlignRight | Qt::AlignVCenter); + + verticalLayout->addLayout(horizontalLayout); +} + + +void SearchBarWidget::searchPushButtonClicked() { + if(_isSearching) { + emit stopSearching(); + searchingProgressBar->hide(); + searchPushButton->setText(tr("Search")); + setEnabled(true); + _isSearching = false; + } + else { + emit searchForTranslations(searchWordLineEdit->text()); + searchingProgressBar->show(); + searchPushButton->setText(tr("Stop")); + setEnabled(false); + _isSearching = true; + } +} + +void SearchBarWidget::setEnabled(bool enabled) { + searchWordLineEdit->setEnabled(enabled); + historyNextToolButton->setEnabled(enabled); + historyPrevToolButton->setEnabled(enabled); + historyShowToolButton->setEnabled(enabled); +} + +void SearchBarWidget::historyNextToolButtonClicked() { + +} + +void SearchBarWidget::historyPrevToolButtonClicked() { + +} + +void SearchBarWidget::historyShowToolButtonClicked() { + +} + +void SearchBarWidget::clearSearchWordToolButtonClicked() { + searchWordLineEdit->clear(); +} + +void SearchBarWidget::showHistoryListDialog() { + +} + +bool SearchBarWidget::isSearching() const { + return _isSearching; +} diff --git a/trunk/src/base/gui/SearchBarWidget.h b/trunk/src/base/gui/SearchBarWidget.h new file mode 100644 index 0000000..2d3f727 --- /dev/null +++ b/trunk/src/base/gui/SearchBarWidget.h @@ -0,0 +1,87 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + + +#ifndef SEARCHBARWIDGET_H +#define SEARCHBARWIDGET_H + +#include +#include + + +//! Displays search bar +/*! + Contains line edit field to input word which user would to find, and buttons + to browse search history. +*/ +class SearchBarWidget : public QWidget { + Q_OBJECT +public: + explicit SearchBarWidget(QWidget *parent = 0); + ~SearchBarWidget(); + + //! Returns searching status + /*! If backbone is still searching returns true */ + bool isSearching() const; + +Q_SIGNALS: + //! Requests to search for translation of word passed as parameter + void searchForTranslations(QString); + + //! Request to stop all active searchings + void stopSearching(); + +public Q_SLOTS: + //! Enable or disable search word line edit and history buttons + /*! + While searching it disables only history button and line edit. + Search/Stop button is always enabled + */ + void setEnabled(bool); + +private Q_SLOTS: + void clearSearchWordToolButtonClicked(); + void searchPushButtonClicked(); + void historyPrevToolButtonClicked(); + void historyNextToolButtonClicked(); + void historyShowToolButtonClicked(); + +private: + QLineEdit* searchWordLineEdit; + QToolButton* clearSearchWordToolButton; + QPushButton* searchPushButton; + QToolButton* historyPrevToolButton; + QToolButton* historyNextToolButton; + QToolButton* historyShowToolButton; + QHBoxLayout* horizontalLayout; + QProgressBar* searchingProgressBar; + + QVBoxLayout* verticalLayout; + + bool _isSearching; + + void initializeUI(); + void showHistoryListDialog(); +}; + +#endif // SEARCHBARWIDGET_H diff --git a/trunk/src/base/gui/TranslationWidget.cpp b/trunk/src/base/gui/TranslationWidget.cpp new file mode 100644 index 0000000..cc764c3 --- /dev/null +++ b/trunk/src/base/gui/TranslationWidget.cpp @@ -0,0 +1,50 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "TranslationWidget.h" +#include + +TranslationWidget::TranslationWidget(QWidget *parent) : + QWidget(parent) { + setAttribute(Qt::WA_Maemo5StackedWindow); + setWindowFlags(windowFlags() | Qt::Window); + + initializeUI(); +} + +void TranslationWidget::show(QModelIndex index) { + QWidget::show(); + + qDebug()<data(index); +} + +void TranslationWidget::initializeUI() { + verticalLayout = new QVBoxLayout; + + translationTextEdit = new QTextEdit; + + verticalLayout->addWidget(translationTextEdit); + + setLayout(verticalLayout); +} + diff --git a/trunk/src/base/gui/TranslationWidget.h b/trunk/src/base/gui/TranslationWidget.h new file mode 100644 index 0000000..ca648a2 --- /dev/null +++ b/trunk/src/base/gui/TranslationWidget.h @@ -0,0 +1,49 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef TRANSLATIONWIDGET_H +#define TRANSLATIONWIDGET_H + +#include +#include +#include + +class TranslationWidget : public QWidget { + Q_OBJECT +public: + explicit TranslationWidget(QWidget *parent = 0); + +Q_SIGNALS: + +public Q_SLOTS: + void show(QModelIndex); + +private: + QTextEdit* translationTextEdit; + QVBoxLayout* verticalLayout; + + void initializeUI(); + +}; + +#endif // TRANSLATIONWIDGET_H diff --git a/trunk/src/base/gui/WordListWidget.cpp b/trunk/src/base/gui/WordListWidget.cpp new file mode 100644 index 0000000..104b480 --- /dev/null +++ b/trunk/src/base/gui/WordListWidget.cpp @@ -0,0 +1,68 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "WordListWidget.h" +#include + +WordListWidget::WordListWidget(QWidget *parent) : + QListView(parent) { + wordListModel = new QStringListModel(); + + setModel(wordListModel); + + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + + setAttribute(Qt::WA_Maemo5StackedWindow); +} + +void WordListWidget::addWord(QString word) { + int wordsCount = wordListModel->rowCount(); + + wordListModel->insertRow(wordsCount); + + QModelIndex newWordIndex = wordListModel->index(wordsCount); + + wordListModel->setData(newWordIndex, word); +} + +void WordListWidget::clear() { + int wordsCount = wordListModel->rowCount(); + + for(int i = 0; i < wordsCount; i++) { + wordListModel->removeRow(0); + } +} diff --git a/trunk/src/base/gui/WordListWidget.h b/trunk/src/base/gui/WordListWidget.h new file mode 100644 index 0000000..f971150 --- /dev/null +++ b/trunk/src/base/gui/WordListWidget.h @@ -0,0 +1,47 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef WORDLISTWIDGET_H +#define WORDLISTWIDGET_H + +#include +#include +#include + + +class WordListWidget : public QListView { + Q_OBJECT +public: + explicit WordListWidget(QWidget *parent = 0); + +Q_SIGNALS: + +private Q_SLOTS: + +private: + QStringListModel *wordListModel; + void addWord(QString word); + void clear(); +}; + +#endif // WORDLISTWIDGET_H diff --git a/trunk/src/base/gui/gui/SearchBarWidget.cpp b/trunk/src/base/gui/gui/SearchBarWidget.cpp new file mode 100644 index 0000000..ba3e36d --- /dev/null +++ b/trunk/src/base/gui/gui/SearchBarWidget.cpp @@ -0,0 +1,179 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + + +#include "SearchBarWidget.h" +#include + + + +SearchBarWidget::SearchBarWidget(QWidget *parent) : + QWidget(parent) { + + initializeUI(); + + setMaximumHeight(150); + + isSearching = false; + + connect(searchPushButton, SIGNAL(clicked()), + this, SLOT(searchPushButtonClicked())); + + connect(historyNextToolButton, SIGNAL(clicked()), + this, SLOT(historyNextToolButtonClicked())); + + connect(historyPrevToolButton, SIGNAL(clicked()), + this, SLOT(historyPrevToolButtonClicked())); + + connect(historyShowToolButton, SIGNAL(clicked()), + this, SLOT(historyShowToolButtonClicked())); + + connect(clearSearchWordToolButton, SIGNAL(clicked()), + this, SLOT(clearSearchWordToolButtonClicked())); + +} + +SearchBarWidget::~SearchBarWidget() { + +} + + +void SearchBarWidget::initializeUI() { + horizontalLayout = new QHBoxLayout(); + verticalLayout = new QVBoxLayout(); + + + searchPushButton = new QPushButton(tr("Search")); + searchPushButton->setMinimumWidth(200); + + + searchWordLineEdit = new QLineEdit(); + searchWordLineEdit->setMinimumWidth(350); + //create layout for lineEdit to have clear button on it + QHBoxLayout* lineEditLayout = new QHBoxLayout; + searchWordLineEdit->setLayout(lineEditLayout); + + + clearSearchWordToolButton = new QToolButton(); + clearSearchWordToolButton->setIcon(QIcon("sowa.svg")); + //tool buttons will have size 2 times smaller + clearSearchWordToolButton->setMaximumSize( + clearSearchWordToolButton->sizeHint().width()/2, + clearSearchWordToolButton->sizeHint().height()/2); + + + historyNextToolButton = new QToolButton(); + historyNextToolButton->setIcon(QIcon("sowa.svg")); + historyNextToolButton->setMaximumSize( + historyNextToolButton->sizeHint().width()/2, + historyNextToolButton->sizeHint().height()/2); + + + historyPrevToolButton = new QToolButton(); + historyPrevToolButton->setIcon(QIcon("sowa.svg")); + historyPrevToolButton->setMaximumSize( + historyPrevToolButton->sizeHint().width()/2, + historyPrevToolButton->sizeHint().height()/2); + + + historyShowToolButton = new QToolButton(); + historyShowToolButton->setIcon(QIcon("sowa.svg")); + historyShowToolButton->setMaximumSize( + historyShowToolButton->sizeHint().width()/2, + historyShowToolButton->sizeHint().height()/2); + + + searchingProgressBar = new QProgressBar(); + searchingProgressBar->setMinimum(0); + searchingProgressBar->setMaximum(0); + searchingProgressBar->hide(); + searchingProgressBar->setMaximumHeight(50); + + + + setLayout(verticalLayout); + + verticalLayout->addWidget(searchingProgressBar); + + //adding widgets to layout + horizontalLayout->addWidget(searchWordLineEdit); + horizontalLayout->addWidget(searchPushButton); + horizontalLayout->addWidget(historyPrevToolButton); + horizontalLayout->addWidget(historyShowToolButton); + horizontalLayout->addWidget(historyNextToolButton); + + //adding clear toolButton to textEdit with right alignment + lineEditLayout->addWidget(clearSearchWordToolButton, 0, + Qt::AlignRight | Qt::AlignVCenter); + + verticalLayout->addLayout(horizontalLayout); +} + + +void SearchBarWidget::searchPushButtonClicked() { + if(isSearching) { + emit stopSearching(); + searchingProgressBar->hide(); + searchPushButton->setText(tr("Search")); + setEnabled(true); + isSearching = false; + } + else { + emit searchForTranslations(searchWordLineEdit->text()); + searchingProgressBar->show(); + searchPushButton->setText(tr("Stop")); + setEnabled(false); + isSearching = true; + } +} + +void SearchBarWidget::setEnabled(bool enabled) { + searchWordLineEdit->setEnabled(enabled); + historyNextToolButton->setEnabled(enabled); + historyPrevToolButton->setEnabled(enabled); + historyShowToolButton->setEnabled(enabled); +} + +void SearchBarWidget::historyNextToolButtonClicked() { + +} + +void SearchBarWidget::historyPrevToolButtonClicked() { + +} + +void SearchBarWidget::historyShowToolButtonClicked() { + +} + +void SearchBarWidget::clearSearchWordToolButtonClicked() { + searchWordLineEdit->clear(); +} + +void SearchBarWidget::showHistoryListDialog() { + +} + +bool SearchBarWidget::isSearching() { + return _isSearching; +} diff --git a/trunk/src/base/gui/gui/SearchBarWidget.h b/trunk/src/base/gui/gui/SearchBarWidget.h new file mode 100644 index 0000000..af907b6 --- /dev/null +++ b/trunk/src/base/gui/gui/SearchBarWidget.h @@ -0,0 +1,87 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + + +#ifndef SEARCHBARWIDGET_H +#define SEARCHBARWIDGET_H + +#include +#include + + +//! Displays search bar +/*! + Contains line edit field to input word which user would to find, and buttons + to browse search history. +*/ +class SearchBarWidget : public QWidget { + Q_OBJECT +public: + explicit SearchBarWidget(QWidget *parent = 0); + ~SearchBarWidget(); + + //! Returns searching status + /*! If backbone is still searching returns true */ + bool isSearching(); + +Q_SIGNALS: + //! Requests to search for translation of word passed as parameter + void searchForTranslations(QString); + + //! Request to stop all active searchings + void stopSearching(); + +public Q_SLOTS: + //! Enable or disable search word line edit and history buttons + /*! + While searching it disables only history button and line edit. + Search/Stop button is always enabled + */ + void setEnabled(bool); + +private Q_SLOTS: + void clearSearchWordToolButtonClicked(); + void searchPushButtonClicked(); + void historyPrevToolButtonClicked(); + void historyNextToolButtonClicked(); + void historyShowToolButtonClicked(); + +private: + QLineEdit* searchWordLineEdit; + QToolButton* clearSearchWordToolButton; + QPushButton* searchPushButton; + QToolButton* historyPrevToolButton; + QToolButton* historyNextToolButton; + QToolButton* historyShowToolButton; + QHBoxLayout* horizontalLayout; + QProgressBar* searchingProgressBar; + + QVBoxLayout* verticalLayout; + + bool _isSearching; + + void initializeUI(); + void showHistoryListDialog(); +}; + +#endif // SEARCHBARWIDGET_H diff --git a/trunk/src/base/gui/gui/TranslationWidget.cpp b/trunk/src/base/gui/gui/TranslationWidget.cpp new file mode 100644 index 0000000..562e55e --- /dev/null +++ b/trunk/src/base/gui/gui/TranslationWidget.cpp @@ -0,0 +1,37 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "TranslationWidget.h" +#include + +TranslationWidget::TranslationWidget(QWidget *parent) : + QWidget(parent) { + setAttribute(Qt::WA_Maemo5StackedWindow); + setWindowFlags(windowFlags() | Qt::Window); +} + +void TranslationWidget::show(QModelIndex index) { + QWidget::show(); + + qDebug()<data(index); +} diff --git a/trunk/src/base/gui/gui/TranslationWidget.h b/trunk/src/base/gui/gui/TranslationWidget.h new file mode 100644 index 0000000..8e089c8 --- /dev/null +++ b/trunk/src/base/gui/gui/TranslationWidget.h @@ -0,0 +1,42 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef TRANSLATIONWIDGET_H +#define TRANSLATIONWIDGET_H + +#include +#include + +class TranslationWidget : public QWidget { + Q_OBJECT +public: + explicit TranslationWidget(QWidget *parent = 0); + +Q_SIGNALS: + +public Q_SLOTS: + void show(QModelIndex); + +}; + +#endif // TRANSLATIONWIDGET_H diff --git a/trunk/src/base/gui/gui/WordListWidget.cpp b/trunk/src/base/gui/gui/WordListWidget.cpp new file mode 100644 index 0000000..104b480 --- /dev/null +++ b/trunk/src/base/gui/gui/WordListWidget.cpp @@ -0,0 +1,68 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#include "WordListWidget.h" +#include + +WordListWidget::WordListWidget(QWidget *parent) : + QListView(parent) { + wordListModel = new QStringListModel(); + + setModel(wordListModel); + + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + addWord("ala"); + addWord("ma"); + addWord("kota"); + + setAttribute(Qt::WA_Maemo5StackedWindow); +} + +void WordListWidget::addWord(QString word) { + int wordsCount = wordListModel->rowCount(); + + wordListModel->insertRow(wordsCount); + + QModelIndex newWordIndex = wordListModel->index(wordsCount); + + wordListModel->setData(newWordIndex, word); +} + +void WordListWidget::clear() { + int wordsCount = wordListModel->rowCount(); + + for(int i = 0; i < wordsCount; i++) { + wordListModel->removeRow(0); + } +} diff --git a/trunk/src/base/gui/gui/WordListWidget.h b/trunk/src/base/gui/gui/WordListWidget.h new file mode 100644 index 0000000..d2451b9 --- /dev/null +++ b/trunk/src/base/gui/gui/WordListWidget.h @@ -0,0 +1,46 @@ +/******************************************************************************* + + This file is part of mDictionary. + + mDictionary 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. + + mDictionary 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 mDictionary. If not, see . + + Copyright 2010 Comarch S.A. + +*******************************************************************************/ + +//Created by Mateusz Półrola + +#ifndef WORDLISTWIDGET_H +#define WORDLISTWIDGET_H + +#include +#include +#include + +class WordListWidget : public QListView { + Q_OBJECT +public: + explicit WordListWidget(QWidget *parent = 0); + +Q_SIGNALS: + +private Q_SLOTS: + +private: + QStringListModel *wordListModel; + void addWord(QString word); + void clear(); +}; + +#endif // WORDLISTWIDGET_H diff --git a/trunk/src/base/gui/mDictionary.pro b/trunk/src/base/gui/mDictionary.pro new file mode 100644 index 0000000..9cdbc53 --- /dev/null +++ b/trunk/src/base/gui/mDictionary.pro @@ -0,0 +1,24 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-08-03T08:54:27 +# +#------------------------------------------------- + +QT += core gui + +TARGET = mDictionary +TEMPLATE = app + + +SOURCES += main.cpp\ + MainWindow.cpp \ + gui/SearchBarWidget.cpp \ + gui/WordListWidget.cpp \ + gui/TranslationWidget.cpp + +HEADERS += MainWindow.h \ + gui/SearchBarWidget.h \ + gui/WordListWidget.h \ + gui/TranslationWidget.h + +FORMS += MainWindow.ui diff --git a/trunk/src/base/gui/mDictionary.pro.user b/trunk/src/base/gui/mDictionary.pro.user new file mode 100644 index 0000000..def9def --- /dev/null +++ b/trunk/src/base/gui/mDictionary.pro.user @@ -0,0 +1,249 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Desktop + Qt4ProjectManager.Target.DesktopTarget + 0 + 0 + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Qt w PATH Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/mateusz/mDictionary-build + 4 + 0 + true + + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Qt w PATH Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop + 4 + 0 + true + + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Qt 4.6.3 OpenSource Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop + 6 + 0 + true + + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Qt 4.6.3 OpenSource Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop + 6 + 0 + true + + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + 4.6.2 Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop + 9 + 0 + true + + + + QMake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + 4.6.2 Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop + 9 + 0 + true + + 6 + + mDictionary + Qt4ProjectManager.Qt4RunConfiguration + 2 + + mDictionary.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff --git a/trunk/src/base/gui/main.cpp b/trunk/src/base/gui/main.cpp new file mode 100644 index 0000000..b632575 --- /dev/null +++ b/trunk/src/base/gui/main.cpp @@ -0,0 +1,12 @@ +#include +#include "MainWindow.h" + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; + w.show(); + w.resize(800,480); + + return a.exec(); +} diff --git a/trunk/src/base/mDictionary b/trunk/src/base/mDictionary new file mode 100755 index 0000000..60e7d43 Binary files /dev/null and b/trunk/src/base/mDictionary differ diff --git a/trunk/src/base/mDictionary/MainWindow.cpp b/trunk/src/base/mDictionary/MainWindow.cpp deleted file mode 100644 index 51de694..0000000 --- a/trunk/src/base/mDictionary/MainWindow.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "MainWindow.h" -#include "ui_MainWindow.h" - -MainWindow::MainWindow(QWidget *parent) : - QMainWindow(parent), - ui(new Ui::MainWindow) -{ - ui->setupUi(this); - setAttribute(Qt::WA_Maemo5StackedWindow); - - searchBarWidget = new SearchBarWidget(); - wordListWidget = new WordListWidget(); - translationWidget = new TranslationWidget(this); - - connect(wordListWidget, SIGNAL(clicked(QModelIndex)), translationWidget, SLOT(show(QModelIndex))); - - ui->centralWidget->layout()->addWidget(wordListWidget); - ui->centralWidget->layout()->addWidget(searchBarWidget); - - -} - -MainWindow::~MainWindow() -{ - delete ui; -} diff --git a/trunk/src/base/mDictionary/MainWindow.h b/trunk/src/base/mDictionary/MainWindow.h deleted file mode 100644 index 23edb35..0000000 --- a/trunk/src/base/mDictionary/MainWindow.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include -#include "gui/TranslationWidget.h" -#include "gui/WordListWidget.h" -#include "gui/SearchBarWidget.h" - -namespace Ui { - class MainWindow; -} - -class MainWindow : public QMainWindow -{ - Q_OBJECT - -public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - -protected: - closeEvent(QCloseEvent *); - -private: - Ui::MainWindow *ui; - SearchBarWidget* searchBarWidget; - TranslationWidget* translationWidget; - WordListWidget* wordListWidget; -}; - -#endif // MAINWINDOW_H diff --git a/trunk/src/base/mDictionary/MainWindow.ui b/trunk/src/base/mDictionary/MainWindow.ui deleted file mode 100644 index a9ee0be..0000000 --- a/trunk/src/base/mDictionary/MainWindow.ui +++ /dev/null @@ -1,108 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 400 - 300 - - - - MainWindow - - - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 255 - 255 - 255 - - - - - - - 0 - 0 - 0 - - - - - - - - - 0 - 0 - 0 - - - - - - - 0 - 0 - 0 - - - - - - - - true - - - - - - - 0 - 0 - 400 - 23 - - - - - - TopToolBarArea - - - false - - - - - - - diff --git a/trunk/src/base/mDictionary/gui/SearchBarWidget.cpp b/trunk/src/base/mDictionary/gui/SearchBarWidget.cpp deleted file mode 100644 index ba3e36d..0000000 --- a/trunk/src/base/mDictionary/gui/SearchBarWidget.cpp +++ /dev/null @@ -1,179 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - - -#include "SearchBarWidget.h" -#include - - - -SearchBarWidget::SearchBarWidget(QWidget *parent) : - QWidget(parent) { - - initializeUI(); - - setMaximumHeight(150); - - isSearching = false; - - connect(searchPushButton, SIGNAL(clicked()), - this, SLOT(searchPushButtonClicked())); - - connect(historyNextToolButton, SIGNAL(clicked()), - this, SLOT(historyNextToolButtonClicked())); - - connect(historyPrevToolButton, SIGNAL(clicked()), - this, SLOT(historyPrevToolButtonClicked())); - - connect(historyShowToolButton, SIGNAL(clicked()), - this, SLOT(historyShowToolButtonClicked())); - - connect(clearSearchWordToolButton, SIGNAL(clicked()), - this, SLOT(clearSearchWordToolButtonClicked())); - -} - -SearchBarWidget::~SearchBarWidget() { - -} - - -void SearchBarWidget::initializeUI() { - horizontalLayout = new QHBoxLayout(); - verticalLayout = new QVBoxLayout(); - - - searchPushButton = new QPushButton(tr("Search")); - searchPushButton->setMinimumWidth(200); - - - searchWordLineEdit = new QLineEdit(); - searchWordLineEdit->setMinimumWidth(350); - //create layout for lineEdit to have clear button on it - QHBoxLayout* lineEditLayout = new QHBoxLayout; - searchWordLineEdit->setLayout(lineEditLayout); - - - clearSearchWordToolButton = new QToolButton(); - clearSearchWordToolButton->setIcon(QIcon("sowa.svg")); - //tool buttons will have size 2 times smaller - clearSearchWordToolButton->setMaximumSize( - clearSearchWordToolButton->sizeHint().width()/2, - clearSearchWordToolButton->sizeHint().height()/2); - - - historyNextToolButton = new QToolButton(); - historyNextToolButton->setIcon(QIcon("sowa.svg")); - historyNextToolButton->setMaximumSize( - historyNextToolButton->sizeHint().width()/2, - historyNextToolButton->sizeHint().height()/2); - - - historyPrevToolButton = new QToolButton(); - historyPrevToolButton->setIcon(QIcon("sowa.svg")); - historyPrevToolButton->setMaximumSize( - historyPrevToolButton->sizeHint().width()/2, - historyPrevToolButton->sizeHint().height()/2); - - - historyShowToolButton = new QToolButton(); - historyShowToolButton->setIcon(QIcon("sowa.svg")); - historyShowToolButton->setMaximumSize( - historyShowToolButton->sizeHint().width()/2, - historyShowToolButton->sizeHint().height()/2); - - - searchingProgressBar = new QProgressBar(); - searchingProgressBar->setMinimum(0); - searchingProgressBar->setMaximum(0); - searchingProgressBar->hide(); - searchingProgressBar->setMaximumHeight(50); - - - - setLayout(verticalLayout); - - verticalLayout->addWidget(searchingProgressBar); - - //adding widgets to layout - horizontalLayout->addWidget(searchWordLineEdit); - horizontalLayout->addWidget(searchPushButton); - horizontalLayout->addWidget(historyPrevToolButton); - horizontalLayout->addWidget(historyShowToolButton); - horizontalLayout->addWidget(historyNextToolButton); - - //adding clear toolButton to textEdit with right alignment - lineEditLayout->addWidget(clearSearchWordToolButton, 0, - Qt::AlignRight | Qt::AlignVCenter); - - verticalLayout->addLayout(horizontalLayout); -} - - -void SearchBarWidget::searchPushButtonClicked() { - if(isSearching) { - emit stopSearching(); - searchingProgressBar->hide(); - searchPushButton->setText(tr("Search")); - setEnabled(true); - isSearching = false; - } - else { - emit searchForTranslations(searchWordLineEdit->text()); - searchingProgressBar->show(); - searchPushButton->setText(tr("Stop")); - setEnabled(false); - isSearching = true; - } -} - -void SearchBarWidget::setEnabled(bool enabled) { - searchWordLineEdit->setEnabled(enabled); - historyNextToolButton->setEnabled(enabled); - historyPrevToolButton->setEnabled(enabled); - historyShowToolButton->setEnabled(enabled); -} - -void SearchBarWidget::historyNextToolButtonClicked() { - -} - -void SearchBarWidget::historyPrevToolButtonClicked() { - -} - -void SearchBarWidget::historyShowToolButtonClicked() { - -} - -void SearchBarWidget::clearSearchWordToolButtonClicked() { - searchWordLineEdit->clear(); -} - -void SearchBarWidget::showHistoryListDialog() { - -} - -bool SearchBarWidget::isSearching() { - return _isSearching; -} diff --git a/trunk/src/base/mDictionary/gui/SearchBarWidget.h b/trunk/src/base/mDictionary/gui/SearchBarWidget.h deleted file mode 100644 index af907b6..0000000 --- a/trunk/src/base/mDictionary/gui/SearchBarWidget.h +++ /dev/null @@ -1,87 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - - -#ifndef SEARCHBARWIDGET_H -#define SEARCHBARWIDGET_H - -#include -#include - - -//! Displays search bar -/*! - Contains line edit field to input word which user would to find, and buttons - to browse search history. -*/ -class SearchBarWidget : public QWidget { - Q_OBJECT -public: - explicit SearchBarWidget(QWidget *parent = 0); - ~SearchBarWidget(); - - //! Returns searching status - /*! If backbone is still searching returns true */ - bool isSearching(); - -Q_SIGNALS: - //! Requests to search for translation of word passed as parameter - void searchForTranslations(QString); - - //! Request to stop all active searchings - void stopSearching(); - -public Q_SLOTS: - //! Enable or disable search word line edit and history buttons - /*! - While searching it disables only history button and line edit. - Search/Stop button is always enabled - */ - void setEnabled(bool); - -private Q_SLOTS: - void clearSearchWordToolButtonClicked(); - void searchPushButtonClicked(); - void historyPrevToolButtonClicked(); - void historyNextToolButtonClicked(); - void historyShowToolButtonClicked(); - -private: - QLineEdit* searchWordLineEdit; - QToolButton* clearSearchWordToolButton; - QPushButton* searchPushButton; - QToolButton* historyPrevToolButton; - QToolButton* historyNextToolButton; - QToolButton* historyShowToolButton; - QHBoxLayout* horizontalLayout; - QProgressBar* searchingProgressBar; - - QVBoxLayout* verticalLayout; - - bool _isSearching; - - void initializeUI(); - void showHistoryListDialog(); -}; - -#endif // SEARCHBARWIDGET_H diff --git a/trunk/src/base/mDictionary/gui/TranslationWidget.cpp b/trunk/src/base/mDictionary/gui/TranslationWidget.cpp deleted file mode 100644 index 562e55e..0000000 --- a/trunk/src/base/mDictionary/gui/TranslationWidget.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#include "TranslationWidget.h" -#include - -TranslationWidget::TranslationWidget(QWidget *parent) : - QWidget(parent) { - setAttribute(Qt::WA_Maemo5StackedWindow); - setWindowFlags(windowFlags() | Qt::Window); -} - -void TranslationWidget::show(QModelIndex index) { - QWidget::show(); - - qDebug()<data(index); -} diff --git a/trunk/src/base/mDictionary/gui/TranslationWidget.h b/trunk/src/base/mDictionary/gui/TranslationWidget.h deleted file mode 100644 index 8e089c8..0000000 --- a/trunk/src/base/mDictionary/gui/TranslationWidget.h +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#ifndef TRANSLATIONWIDGET_H -#define TRANSLATIONWIDGET_H - -#include -#include - -class TranslationWidget : public QWidget { - Q_OBJECT -public: - explicit TranslationWidget(QWidget *parent = 0); - -Q_SIGNALS: - -public Q_SLOTS: - void show(QModelIndex); - -}; - -#endif // TRANSLATIONWIDGET_H diff --git a/trunk/src/base/mDictionary/gui/WordListWidget.cpp b/trunk/src/base/mDictionary/gui/WordListWidget.cpp deleted file mode 100644 index 104b480..0000000 --- a/trunk/src/base/mDictionary/gui/WordListWidget.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#include "WordListWidget.h" -#include - -WordListWidget::WordListWidget(QWidget *parent) : - QListView(parent) { - wordListModel = new QStringListModel(); - - setModel(wordListModel); - - addWord("ala"); - addWord("ma"); - addWord("kota"); - addWord("ala"); - addWord("ma"); - addWord("kota"); - addWord("ala"); - addWord("ma"); - addWord("kota"); - addWord("ala"); - addWord("ma"); - addWord("kota"); - addWord("ala"); - addWord("ma"); - addWord("kota"); - - setAttribute(Qt::WA_Maemo5StackedWindow); -} - -void WordListWidget::addWord(QString word) { - int wordsCount = wordListModel->rowCount(); - - wordListModel->insertRow(wordsCount); - - QModelIndex newWordIndex = wordListModel->index(wordsCount); - - wordListModel->setData(newWordIndex, word); -} - -void WordListWidget::clear() { - int wordsCount = wordListModel->rowCount(); - - for(int i = 0; i < wordsCount; i++) { - wordListModel->removeRow(0); - } -} diff --git a/trunk/src/base/mDictionary/gui/WordListWidget.h b/trunk/src/base/mDictionary/gui/WordListWidget.h deleted file mode 100644 index d2451b9..0000000 --- a/trunk/src/base/mDictionary/gui/WordListWidget.h +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - - This file is part of mDictionary. - - mDictionary 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. - - mDictionary 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 mDictionary. If not, see . - - Copyright 2010 Comarch S.A. - -*******************************************************************************/ - -//Created by Mateusz Półrola - -#ifndef WORDLISTWIDGET_H -#define WORDLISTWIDGET_H - -#include -#include -#include - -class WordListWidget : public QListView { - Q_OBJECT -public: - explicit WordListWidget(QWidget *parent = 0); - -Q_SIGNALS: - -private Q_SLOTS: - -private: - QStringListModel *wordListModel; - void addWord(QString word); - void clear(); -}; - -#endif // WORDLISTWIDGET_H diff --git a/trunk/src/base/mDictionary/mDictionary.pro b/trunk/src/base/mDictionary/mDictionary.pro deleted file mode 100644 index 9cdbc53..0000000 --- a/trunk/src/base/mDictionary/mDictionary.pro +++ /dev/null @@ -1,24 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2010-08-03T08:54:27 -# -#------------------------------------------------- - -QT += core gui - -TARGET = mDictionary -TEMPLATE = app - - -SOURCES += main.cpp\ - MainWindow.cpp \ - gui/SearchBarWidget.cpp \ - gui/WordListWidget.cpp \ - gui/TranslationWidget.cpp - -HEADERS += MainWindow.h \ - gui/SearchBarWidget.h \ - gui/WordListWidget.h \ - gui/TranslationWidget.h - -FORMS += MainWindow.ui diff --git a/trunk/src/base/mDictionary/mDictionary.pro.user b/trunk/src/base/mDictionary/mDictionary.pro.user deleted file mode 100644 index def9def..0000000 --- a/trunk/src/base/mDictionary/mDictionary.pro.user +++ /dev/null @@ -1,249 +0,0 @@ - - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - System - - - - ProjectExplorer.Project.Target.0 - - Desktop - Qt4ProjectManager.Target.DesktopTarget - 0 - 0 - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Qt w PATH Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/mateusz/mDictionary-build - 4 - 0 - true - - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Qt w PATH Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop - 4 - 0 - true - - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Qt 4.6.3 OpenSource Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop - 6 - 0 - true - - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - Qt 4.6.3 OpenSource Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop - 6 - 0 - true - - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - 4.6.2 Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop - 9 - 0 - true - - - - QMake - QtProjectManager.QMakeBuildStep - - - - Make - Qt4ProjectManager.MakeStep - false - - - - 2 - - Make - Qt4ProjectManager.MakeStep - true - - clean - - - - 1 - false - - 4.6.2 Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - /home/mateusz/mdictionary/trunk/src/base/mDictionary-build-desktop - 9 - 0 - true - - 6 - - mDictionary - Qt4ProjectManager.Qt4RunConfiguration - 2 - - mDictionary.pro - false - false - - false - false - - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 4 - - diff --git a/trunk/src/base/mDictionary/main.cpp b/trunk/src/base/mDictionary/main.cpp deleted file mode 100644 index b632575..0000000 --- a/trunk/src/base/mDictionary/main.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "MainWindow.h" - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - MainWindow w; - w.show(); - w.resize(800,480); - - return a.exec(); -}