Import Debian version 1
hannah-foo2zjs (1:1) unstable; urgency=low
* Initial release. Separated out from foo2zjs package.
(Closes: #449497, #503813, #503814).
Michael Koch authored 14 years ago
Didier Raboud committed 6 years ago
0 | ############################################################################# | |
1 | # Makefile for building: hannah | |
2 | # Generated by qmake (2.01a) (Qt 4.5.2) on: Mi. Aug 19 20:56:33 2009 | |
3 | # Project: hannah.pro | |
4 | # Template: app | |
5 | # Command: /usr/bin/qmake-qt4 -unix -o Makefile hannah.pro | |
6 | ############################################################################# | |
7 | ||
8 | ####### Compiler, tools and options | |
9 | ||
10 | CC = gcc | |
11 | CXX = g++ | |
12 | DEFINES = -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED | |
13 | CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) | |
14 | CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) | |
15 | 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. | |
16 | LINK = g++ | |
17 | LFLAGS = -Wl,-O1 | |
18 | LIBS = $(SUBLIBS) -L/usr/lib -lQtGui -lQtCore -lpthread | |
19 | AR = ar cqs | |
20 | RANLIB = | |
21 | QMAKE = /usr/bin/qmake-qt4 | |
22 | TAR = tar -cf | |
23 | COMPRESS = gzip -9f | |
24 | COPY = cp -f | |
25 | SED = sed | |
26 | COPY_FILE = $(COPY) | |
27 | COPY_DIR = $(COPY) -r | |
28 | INSTALL_FILE = install -m 644 -p | |
29 | INSTALL_DIR = $(COPY_DIR) | |
30 | INSTALL_PROGRAM = install -m 755 -p | |
31 | DEL_FILE = rm -f | |
32 | SYMLINK = ln -sf | |
33 | DEL_DIR = rmdir | |
34 | MOVE = mv -f | |
35 | CHK_DIR_EXISTS= test -d | |
36 | MKDIR = mkdir -p | |
37 | ||
38 | ####### Output directory | |
39 | ||
40 | OBJECTS_DIR = ./ | |
41 | ||
42 | ####### Files | |
43 | ||
44 | SOURCES = gui.cpp \ | |
45 | main.cpp moc_gui.cpp | |
46 | OBJECTS = gui.o \ | |
47 | main.o \ | |
48 | moc_gui.o | |
49 | DIST = /usr/share/qt4/mkspecs/common/g++.conf \ | |
50 | /usr/share/qt4/mkspecs/common/unix.conf \ | |
51 | /usr/share/qt4/mkspecs/common/linux.conf \ | |
52 | /usr/share/qt4/mkspecs/qconfig.pri \ | |
53 | /usr/share/qt4/mkspecs/features/qt_functions.prf \ | |
54 | /usr/share/qt4/mkspecs/features/qt_config.prf \ | |
55 | /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ | |
56 | /usr/share/qt4/mkspecs/features/default_pre.prf \ | |
57 | /usr/share/qt4/mkspecs/features/release.prf \ | |
58 | /usr/share/qt4/mkspecs/features/default_post.prf \ | |
59 | /usr/share/qt4/mkspecs/features/warn_on.prf \ | |
60 | /usr/share/qt4/mkspecs/features/qt.prf \ | |
61 | /usr/share/qt4/mkspecs/features/unix/thread.prf \ | |
62 | /usr/share/qt4/mkspecs/features/moc.prf \ | |
63 | /usr/share/qt4/mkspecs/features/resources.prf \ | |
64 | /usr/share/qt4/mkspecs/features/uic.prf \ | |
65 | /usr/share/qt4/mkspecs/features/yacc.prf \ | |
66 | /usr/share/qt4/mkspecs/features/lex.prf \ | |
67 | /usr/share/qt4/mkspecs/features/include_source_dir.prf \ | |
68 | hannah.pro | |
69 | QMAKE_TARGET = hannah | |
70 | DESTDIR = | |
71 | TARGET = hannah | |
72 | ||
73 | first: all | |
74 | ####### Implicit rules | |
75 | ||
76 | .SUFFIXES: .o .c .cpp .cc .cxx .C | |
77 | ||
78 | .cpp.o: | |
79 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
80 | ||
81 | .cc.o: | |
82 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
83 | ||
84 | .cxx.o: | |
85 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
86 | ||
87 | .C.o: | |
88 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" | |
89 | ||
90 | .c.o: | |
91 | $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" | |
92 | ||
93 | ####### Build rules | |
94 | ||
95 | all: Makefile $(TARGET) | |
96 | ||
97 | $(TARGET): $(OBJECTS) | |
98 | $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) | |
99 | ||
100 | Makefile: hannah.pro /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \ | |
101 | /usr/share/qt4/mkspecs/common/unix.conf \ | |
102 | /usr/share/qt4/mkspecs/common/linux.conf \ | |
103 | /usr/share/qt4/mkspecs/qconfig.pri \ | |
104 | /usr/share/qt4/mkspecs/features/qt_functions.prf \ | |
105 | /usr/share/qt4/mkspecs/features/qt_config.prf \ | |
106 | /usr/share/qt4/mkspecs/features/exclusive_builds.prf \ | |
107 | /usr/share/qt4/mkspecs/features/default_pre.prf \ | |
108 | /usr/share/qt4/mkspecs/features/release.prf \ | |
109 | /usr/share/qt4/mkspecs/features/default_post.prf \ | |
110 | /usr/share/qt4/mkspecs/features/warn_on.prf \ | |
111 | /usr/share/qt4/mkspecs/features/qt.prf \ | |
112 | /usr/share/qt4/mkspecs/features/unix/thread.prf \ | |
113 | /usr/share/qt4/mkspecs/features/moc.prf \ | |
114 | /usr/share/qt4/mkspecs/features/resources.prf \ | |
115 | /usr/share/qt4/mkspecs/features/uic.prf \ | |
116 | /usr/share/qt4/mkspecs/features/yacc.prf \ | |
117 | /usr/share/qt4/mkspecs/features/lex.prf \ | |
118 | /usr/share/qt4/mkspecs/features/include_source_dir.prf \ | |
119 | /usr/lib/libQtGui.prl \ | |
120 | /usr/lib/libQtCore.prl | |
121 | $(QMAKE) -unix -o Makefile hannah.pro | |
122 | /usr/share/qt4/mkspecs/common/g++.conf: | |
123 | /usr/share/qt4/mkspecs/common/unix.conf: | |
124 | /usr/share/qt4/mkspecs/common/linux.conf: | |
125 | /usr/share/qt4/mkspecs/qconfig.pri: | |
126 | /usr/share/qt4/mkspecs/features/qt_functions.prf: | |
127 | /usr/share/qt4/mkspecs/features/qt_config.prf: | |
128 | /usr/share/qt4/mkspecs/features/exclusive_builds.prf: | |
129 | /usr/share/qt4/mkspecs/features/default_pre.prf: | |
130 | /usr/share/qt4/mkspecs/features/release.prf: | |
131 | /usr/share/qt4/mkspecs/features/default_post.prf: | |
132 | /usr/share/qt4/mkspecs/features/warn_on.prf: | |
133 | /usr/share/qt4/mkspecs/features/qt.prf: | |
134 | /usr/share/qt4/mkspecs/features/unix/thread.prf: | |
135 | /usr/share/qt4/mkspecs/features/moc.prf: | |
136 | /usr/share/qt4/mkspecs/features/resources.prf: | |
137 | /usr/share/qt4/mkspecs/features/uic.prf: | |
138 | /usr/share/qt4/mkspecs/features/yacc.prf: | |
139 | /usr/share/qt4/mkspecs/features/lex.prf: | |
140 | /usr/share/qt4/mkspecs/features/include_source_dir.prf: | |
141 | /usr/lib/libQtGui.prl: | |
142 | /usr/lib/libQtCore.prl: | |
143 | qmake: FORCE | |
144 | @$(QMAKE) -unix -o Makefile hannah.pro | |
145 | ||
146 | dist: | |
147 | @$(CHK_DIR_EXISTS) .tmp/hannah1.0.0 || $(MKDIR) .tmp/hannah1.0.0 | |
148 | $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/hannah1.0.0/ && $(COPY_FILE) --parents gui.h .tmp/hannah1.0.0/ && $(COPY_FILE) --parents gui.cpp main.cpp .tmp/hannah1.0.0/ && (cd `dirname .tmp/hannah1.0.0` && $(TAR) hannah1.0.0.tar hannah1.0.0 && $(COMPRESS) hannah1.0.0.tar) && $(MOVE) `dirname .tmp/hannah1.0.0`/hannah1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/hannah1.0.0 | |
149 | ||
150 | ||
151 | clean:compiler_clean | |
152 | -$(DEL_FILE) $(OBJECTS) | |
153 | -$(DEL_FILE) *~ core *.core | |
154 | ||
155 | ||
156 | ####### Sub-libraries | |
157 | ||
158 | distclean: clean | |
159 | -$(DEL_FILE) $(TARGET) | |
160 | -$(DEL_FILE) Makefile | |
161 | ||
162 | ||
163 | mocclean: compiler_moc_header_clean compiler_moc_source_clean | |
164 | ||
165 | mocables: compiler_moc_header_make_all compiler_moc_source_make_all | |
166 | ||
167 | compiler_moc_header_make_all: moc_gui.cpp | |
168 | compiler_moc_header_clean: | |
169 | -$(DEL_FILE) moc_gui.cpp | |
170 | moc_gui.cpp: gui.h | |
171 | /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) gui.h -o moc_gui.cpp | |
172 | ||
173 | compiler_rcc_make_all: | |
174 | compiler_rcc_clean: | |
175 | compiler_image_collection_make_all: qmake_image_collection.cpp | |
176 | compiler_image_collection_clean: | |
177 | -$(DEL_FILE) qmake_image_collection.cpp | |
178 | compiler_moc_source_make_all: | |
179 | compiler_moc_source_clean: | |
180 | compiler_uic_make_all: | |
181 | compiler_uic_clean: | |
182 | compiler_yacc_decl_make_all: | |
183 | compiler_yacc_decl_clean: | |
184 | compiler_yacc_impl_make_all: | |
185 | compiler_yacc_impl_clean: | |
186 | compiler_lex_make_all: | |
187 | compiler_lex_clean: | |
188 | compiler_clean: compiler_moc_header_clean | |
189 | ||
190 | ####### Compile | |
191 | ||
192 | gui.o: gui.cpp gui.h | |
193 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o gui.o gui.cpp | |
194 | ||
195 | main.o: main.cpp gui.h | |
196 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp | |
197 | ||
198 | moc_gui.o: moc_gui.cpp | |
199 | $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_gui.o moc_gui.cpp | |
200 | ||
201 | ####### Install | |
202 | ||
203 | install: FORCE | |
204 | ||
205 | uninstall: FORCE | |
206 | ||
207 | FORCE: | |
208 |
0 | hannah-foo2zjs (1:1) unstable; urgency=low | |
1 | ||
2 | * Initial release. Separated out from foo2zjs package. | |
3 | (Closes: #449497, #503813, #503814). | |
4 | ||
5 | -- Michael Koch <konqueror@gmx.de> Wed, 19 Aug 2009 21:21:46 +0200 |
0 | 7 |
0 | Source: hannah-foo2zjs | |
1 | Section: contrib/text | |
2 | Priority: optional | |
3 | Maintainer: Michael Koch <konqueror@gmx.de> | |
4 | Build-Depends: debhelper (>= 7), libqt4-dev | |
5 | Standards-Version: 3.8.2 | |
6 | ||
7 | Package: hannah-foo2zjs | |
8 | Architecture: any | |
9 | Depends: ${shlibs:Depends}, ${misc:Depends}, foo2zjs, gksu | kdebase-bin (<< 4:4.4.0-1) | kdebase-runtime | ktsuss | sux | |
10 | Conflicts: foo2zjs (<= 20090301dfsg-4) | |
11 | Replaces: foo2zjs (<= 20090301dfsg-4) | |
12 | Description: Graphical firmware downloader for the foo2zjs package | |
13 | Hannah is a graphical firmware downloader for the foo2zjs package. You | |
14 | can select one or more firmware(s) from a list, and let hannah download | |
15 | and install them. | |
16 | . | |
17 | With this software you can potentially install non-free software, so | |
18 | beware of that. |
0 | This package was debianized by Michael Koch <konqueror@gmx.de> on | |
1 | Tue, 11 Aug 2009 22:31:27 +0100. | |
2 | ||
3 | Upstream Authors: | |
4 | Steffen Joeris | |
5 | Michael Koch | |
6 | ||
7 | Copyright: 2007-2009 Steffen Joeris | |
8 | Michael Koch | |
9 | ||
10 | License: | |
11 | ||
12 | This package is free software; you can redistribute it and/or modify | |
13 | it under the terms of the GNU General Public License as published by | |
14 | the Free Software Foundation; version 2 dated June, 1991. | |
15 | ||
16 | This package is distributed in the hope that it will be useful, | |
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | GNU General Public License for more details. | |
20 | ||
21 | On Debian systems, the complete text of the GNU General | |
22 | Public License can be found in `/usr/share/common-licenses/GPL-2'. |
0 | ?package(hannah-foo2zjs):\ | |
1 | needs="X11"\ | |
2 | section="Applications/System/Administration"\ | |
3 | title="Hannah-foo2zjs"\ | |
4 | longtitle="Foo2ZJS Firmware Installer (Hannah)"\ | |
5 | command="/usr/bin/su-to-root -X -c /usr/bin/hannah-foo2zjs" |
0 | #!/usr/bin/make -f | |
1 | # -*- makefile -*- | |
2 | ||
3 | ||
4 | configure: configure-stamp | |
5 | configure-stamp: | |
6 | dh_testdir | |
7 | ||
8 | touch configure-stamp | |
9 | ||
10 | ||
11 | build: build-stamp | |
12 | ||
13 | build-stamp: configure-stamp | |
14 | dh_testdir | |
15 | ||
16 | $(MAKE) | |
17 | ||
18 | touch $@ | |
19 | ||
20 | clean: | |
21 | dh_testdir | |
22 | dh_testroot | |
23 | rm -f build-stamp configure-stamp | |
24 | ||
25 | # Add here commands to clean up after the build process. | |
26 | $(MAKE) clean | |
27 | ||
28 | dh_clean | |
29 | ||
30 | install: build | |
31 | dh_testdir | |
32 | dh_testroot | |
33 | dh_prep | |
34 | dh_installdirs | |
35 | ||
36 | install -m 755 hannah $(CURDIR)/debian/hannah-foo2zjs/usr/bin/hannah-foo2zjs | |
37 | install -m 644 hannah.desktop $(CURDIR)/debian/hannah-foo2zjs/usr/share/applications/hannah-foo2zjs.desktop | |
38 | ||
39 | # Build architecture-independent files here. | |
40 | binary-indep: install | |
41 | # We have nothing to do by default. | |
42 | ||
43 | # Build architecture-dependent files here. | |
44 | binary-arch: install | |
45 | dh_testdir | |
46 | dh_testroot | |
47 | dh_installchangelogs | |
48 | dh_installdocs | |
49 | dh_installexamples | |
50 | dh_installmenu | |
51 | dh_installman | |
52 | dh_link | |
53 | dh_strip | |
54 | dh_compress | |
55 | dh_fixperms | |
56 | dh_installdeb | |
57 | dh_shlibdeps | |
58 | dh_gencontrol | |
59 | dh_md5sums | |
60 | dh_builddeb | |
61 | ||
62 | binary: binary-indep binary-arch | |
63 | .PHONY: build clean binary-indep binary-arch binary install configure |
0 | // Hannah, GUI for downloading specific printer firmware | |
1 | // Copyright (C) 2007 Steffen Joeris <white@debian.org> | |
2 | // | |
3 | // This program is free software; you can redistribute it and/or modify | |
4 | // it under the terms of the GNU General Public License as published by | |
5 | // the Free Software Foundation; either version 2 of the License, or | |
6 | // (at your option) any later version. | |
7 | // | |
8 | // This program is distributed in the hope that it will be useful, | |
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | // GNU General Public License for more details. | |
12 | // | |
13 | // You should have received a copy of the GNU General Public License along | |
14 | // with this program; if not, write to the Free Software Foundation, Inc., | |
15 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | ||
17 | ||
18 | #include "gui.h" | |
19 | ||
20 | MainWindow::MainWindow(QWidget *parent) | |
21 | :QWidget(parent) | |
22 | { | |
23 | int check = QMessageBox::question(this, tr("Hannah - Firmware downloader"), | |
24 | tr("Do you want to download and install potential non-free printer firmware?"), tr("&Yes"), tr("&No"), | |
25 | QString::null, 0, 1); | |
26 | ||
27 | ||
28 | if (! check == 0 ) { | |
29 | exit(0); | |
30 | } | |
31 | ||
32 | createMainWidget(); | |
33 | ||
34 | connect(downloadButton, SIGNAL(clicked()), this, SLOT(callGetweb())); | |
35 | }; | |
36 | ||
37 | void MainWindow::createMainWidget() | |
38 | { | |
39 | setWindowTitle(tr("Hannah - Foo2zjs firmware downloader")); | |
40 | QVBoxLayout *mainLayout = new QVBoxLayout; | |
41 | hp2600Button = new QCheckBox(tr("Download firmware for HP2600")); | |
42 | hp1600Button = new QCheckBox(tr("Download firmware for HP1600")); | |
43 | hp1020Button = new QCheckBox(tr("Download firmware for HP1020")); | |
44 | hp1018Button = new QCheckBox(tr("Download firmware for HP1018")); | |
45 | hp1005Button = new QCheckBox(tr("Download firmware for HP1005")); | |
46 | hp1000Button = new QCheckBox(tr("Download firmware for HP1000")); | |
47 | minolta2530Button = new QCheckBox(tr("Download firmware for Minolta 2530")); | |
48 | minolta2490Button = new QCheckBox(tr("Download firmware for Minolta 2490")); | |
49 | minolta2480Button = new QCheckBox(tr("Download firmware for Minolta 2480")); | |
50 | minolta2430Button = new QCheckBox(tr("Download firmware for Minolta 2430")); | |
51 | minolta2300Button = new QCheckBox(tr("Download firmware for Minolta 2300")); | |
52 | minolta2200Button = new QCheckBox(tr("Download firmware for Minolta 2200")); | |
53 | minoltaproButton = new QCheckBox(tr("Download firmware for Minolta PageWorks/Pro L")); | |
54 | samsung3160Button = new QCheckBox(tr("Download firmware for Samsung CLX-3160")); | |
55 | samsung600Button = new QCheckBox(tr("Download firmware for Samsung CLP-600")); | |
56 | samsung300Button = new QCheckBox(tr("Download firmware for Samsung CLP-300")); | |
57 | xerox6115Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6115")); | |
58 | xerox6110Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6110")); | |
59 | allButton = new QCheckBox(tr("Mark all for download")); | |
60 | downloadButton = new QPushButton(tr("Download marked firmwares")); | |
61 | exitButton = new QPushButton(tr("Exit")); | |
62 | ||
63 | hp2600Button->setFont(QFont("Times", 18)); | |
64 | hp1600Button->setFont(QFont("Times", 18)); | |
65 | hp1020Button->setFont(QFont("Times", 18)); | |
66 | hp1018Button->setFont(QFont("Times", 18)); | |
67 | hp1005Button->setFont(QFont("Times", 18)); | |
68 | hp1000Button->setFont(QFont("Times", 18)); | |
69 | minolta2530Button->setFont(QFont("Times", 18)); | |
70 | minolta2490Button->setFont(QFont("Times", 18)); | |
71 | minolta2480Button->setFont(QFont("Times", 18)); | |
72 | minolta2430Button->setFont(QFont("Times", 18)); | |
73 | minolta2300Button->setFont(QFont("Times", 18)); | |
74 | minolta2200Button->setFont(QFont("Times", 18)); | |
75 | minoltaproButton->setFont(QFont("Times", 18)); | |
76 | samsung3160Button->setFont(QFont("Times", 18)); | |
77 | samsung600Button->setFont(QFont("Times", 18)); | |
78 | samsung300Button->setFont(QFont("Times", 18)); | |
79 | xerox6115Button->setFont(QFont("Times", 18)); | |
80 | xerox6110Button->setFont(QFont("Times", 18)); | |
81 | allButton->setFont(QFont("Times", 18)); | |
82 | downloadButton->setFont(QFont("Times", 18)); | |
83 | exitButton->setFont(QFont("Times", 18)); | |
84 | ||
85 | QMenuBar *menubar = new QMenuBar; | |
86 | QMenu *menu = new QMenu; | |
87 | menubar->addMenu(menu); | |
88 | QAction *about = new QAction(tr("About Hannah"), this); | |
89 | menu = menubar->addMenu(tr("Help")); | |
90 | menu->addAction(about); | |
91 | ||
92 | statusBar = new QStatusBar; | |
93 | ||
94 | mainLayout->addWidget(menubar, 0, 0); | |
95 | mainLayout->addWidget(hp2600Button, 1, 0); | |
96 | mainLayout->addWidget(hp1600Button, 2, 0); | |
97 | mainLayout->addWidget(hp1020Button, 3, 0); | |
98 | mainLayout->addWidget(hp1018Button, 4, 0); | |
99 | mainLayout->addWidget(hp1005Button, 5, 0); | |
100 | mainLayout->addWidget(hp1000Button, 6, 0); | |
101 | mainLayout->addWidget(minolta2530Button, 7, 0); | |
102 | mainLayout->addWidget(minolta2490Button, 8, 0); | |
103 | mainLayout->addWidget(minolta2480Button, 9, 0); | |
104 | mainLayout->addWidget(minolta2430Button, 10, 0); | |
105 | mainLayout->addWidget(minolta2300Button, 11, 0); | |
106 | mainLayout->addWidget(minolta2200Button, 12, 0); | |
107 | mainLayout->addWidget(minoltaproButton, 13, 0); | |
108 | mainLayout->addWidget(samsung3160Button, 14, 0); | |
109 | mainLayout->addWidget(samsung600Button, 15, 0); | |
110 | mainLayout->addWidget(samsung300Button, 16, 0); | |
111 | mainLayout->addWidget(xerox6115Button, 17, 0); | |
112 | mainLayout->addWidget(xerox6110Button, 18, 0); | |
113 | mainLayout->addWidget(allButton, 19, 0); | |
114 | mainLayout->addWidget(statusBar, 20, 0); | |
115 | mainLayout->addWidget(downloadButton, 21, 0); | |
116 | mainLayout->addWidget(exitButton, 22, 0); | |
117 | setMinimumSize(600, 700); | |
118 | setLayout(mainLayout); | |
119 | ||
120 | buttonGroup = new QButtonGroup; | |
121 | buttonGroup->setExclusive(false); | |
122 | buttonGroup->addButton(hp2600Button, 0); | |
123 | buttonGroup->addButton(hp1600Button, 1); | |
124 | buttonGroup->addButton(hp1020Button, 2); | |
125 | buttonGroup->addButton(hp1018Button, 3); | |
126 | buttonGroup->addButton(hp1005Button, 4); | |
127 | buttonGroup->addButton(hp1000Button, 5); | |
128 | buttonGroup->addButton(minolta2530Button, 6); | |
129 | buttonGroup->addButton(minolta2490Button, 7); | |
130 | buttonGroup->addButton(minolta2480Button, 8); | |
131 | buttonGroup->addButton(minolta2430Button, 9); | |
132 | buttonGroup->addButton(minolta2300Button, 10); | |
133 | buttonGroup->addButton(minolta2200Button, 11); | |
134 | buttonGroup->addButton(minoltaproButton, 12); | |
135 | buttonGroup->addButton(samsung3160Button, 13); | |
136 | buttonGroup->addButton(samsung600Button, 14); | |
137 | buttonGroup->addButton(samsung300Button, 15); | |
138 | buttonGroup->addButton(xerox6115Button, 16); | |
139 | buttonGroup->addButton(xerox6110Button, 17); | |
140 | ||
141 | connect(about, SIGNAL(triggered()), this, SLOT(showInfo())); | |
142 | connect(allButton, SIGNAL(stateChanged(int)), this, SLOT(setCheckBoxes(int))); | |
143 | connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit())); | |
144 | }; | |
145 | ||
146 | void MainWindow::showInfo() | |
147 | { | |
148 | QMessageBox::information(this, tr("Hannah-Foo2zjs Firmware Downloader"), | |
149 | tr("This program is developed by the Debian Foo2ZJS maintainers.\n" | |
150 | "It is offered as a convenient method to download the needed\n" | |
151 | "firmware for one of the printers supported by Foo2ZJS. Please feel\n" | |
152 | "free to report any bugs against the foo2zjs package\n" | |
153 | "to the Debian BTS (http://bugs.debian.org).\n" | |
154 | "The program's name is Hannah:\n" | |
155 | "(grapHical interfAce for dowNloading your priNter's firmwAre at Home).\n"), | |
156 | QMessageBox::Ok); | |
157 | }; | |
158 | ||
159 | void MainWindow::setCheckBoxes(int state) | |
160 | { | |
161 | switch (state) { | |
162 | case 2: | |
163 | hp2600Button->setCheckState(Qt::Checked); | |
164 | hp1600Button->setCheckState(Qt::Checked); | |
165 | hp1020Button->setCheckState(Qt::Checked); | |
166 | hp1018Button->setCheckState(Qt::Checked); | |
167 | hp1005Button->setCheckState(Qt::Checked); | |
168 | hp1000Button->setCheckState(Qt::Checked); | |
169 | minolta2530Button->setCheckState(Qt::Checked); | |
170 | minolta2490Button->setCheckState(Qt::Checked); | |
171 | minolta2480Button->setCheckState(Qt::Checked); | |
172 | minolta2430Button->setCheckState(Qt::Checked); | |
173 | minolta2300Button->setCheckState(Qt::Checked); | |
174 | minolta2200Button->setCheckState(Qt::Checked); | |
175 | minoltaproButton->setCheckState(Qt::Checked); | |
176 | samsung3160Button->setCheckState(Qt::Checked); | |
177 | samsung600Button->setCheckState(Qt::Checked); | |
178 | samsung300Button->setCheckState(Qt::Checked); | |
179 | xerox6115Button->setCheckState(Qt::Checked); | |
180 | xerox6110Button->setCheckState(Qt::Checked); | |
181 | break; | |
182 | case 0: | |
183 | hp2600Button->setCheckState(Qt::Unchecked); | |
184 | hp1600Button->setCheckState(Qt::Unchecked); | |
185 | hp1020Button->setCheckState(Qt::Unchecked); | |
186 | hp1018Button->setCheckState(Qt::Unchecked); | |
187 | hp1005Button->setCheckState(Qt::Unchecked); | |
188 | hp1000Button->setCheckState(Qt::Unchecked); | |
189 | minolta2530Button->setCheckState(Qt::Unchecked); | |
190 | minolta2490Button->setCheckState(Qt::Unchecked); | |
191 | minolta2480Button->setCheckState(Qt::Unchecked); | |
192 | minolta2430Button->setCheckState(Qt::Unchecked); | |
193 | minolta2300Button->setCheckState(Qt::Unchecked); | |
194 | minolta2200Button->setCheckState(Qt::Unchecked); | |
195 | minoltaproButton->setCheckState(Qt::Unchecked); | |
196 | samsung3160Button->setCheckState(Qt::Unchecked); | |
197 | samsung600Button->setCheckState(Qt::Unchecked); | |
198 | samsung300Button->setCheckState(Qt::Unchecked); | |
199 | xerox6115Button->setCheckState(Qt::Unchecked); | |
200 | xerox6110Button->setCheckState(Qt::Unchecked); | |
201 | break; | |
202 | default: | |
203 | break; | |
204 | } | |
205 | } | |
206 | ||
207 | void MainWindow::callGetweb() | |
208 | { | |
209 | QAbstractButton *temporary_button; | |
210 | int count = 0; | |
211 | QStringList current_list; | |
212 | current_list << "2600n" << "1600" << "1020" << "1018" << "1005" << "1000" << "2530" << "2490" << "2480" << "2430" << "2300" << "2200" << "cpwl" << "3160" << "600" << "300" << "6115" << "6110"; | |
213 | QStringList arguments; | |
214 | ||
215 | foreach( temporary_button, buttonGroup->buttons() ) { | |
216 | if ( temporary_button->isChecked() ) { | |
217 | arguments << current_list.at(count); | |
218 | } | |
219 | count++; | |
220 | } | |
221 | ||
222 | QString program = "/usr/bin/getweb"; | |
223 | string = arguments.join(" "); | |
224 | callProgram = new QProcess; | |
225 | ||
226 | switch (callProgram->state()) { | |
227 | case 2: | |
228 | QMessageBox::warning(this, tr("Hannah - Firmware downloader 'getweb'"), | |
229 | tr("There is already a firmware download in progress. \n" | |
230 | "Refuse to start another one."), QMessageBox::Ok); | |
231 | break; | |
232 | case 1: | |
233 | QMessageBox::warning(this, tr("Hannah - Firmware downloader 'getweb'"), | |
234 | tr("There is already a firmware download in progress. \n" | |
235 | "Refuse to start another one."), QMessageBox::Ok); | |
236 | break; | |
237 | case 0: | |
238 | callProgram->start(program, arguments); | |
239 | QString message = QString(tr("Downloading firmware for %1").arg(string)); | |
240 | statusBar->showMessage(message); | |
241 | connect(callProgram, SIGNAL(finished(int)), this, SLOT(checkProgram())); | |
242 | break; | |
243 | } | |
244 | }; | |
245 | ||
246 | void MainWindow::checkProgram() | |
247 | { | |
248 | switch ( callProgram->exitCode() ) { | |
249 | case 0: | |
250 | QMessageBox::information(this, tr("Hannah - Firmware downloader"), | |
251 | tr("The firmware for the following printers was downloaded and installed successfully:\n" | |
252 | "%1\n").arg(string), QMessageBox::Ok); | |
253 | statusBar->showMessage(tr("Download and installation finished.")); | |
254 | break; | |
255 | default: | |
256 | QMessageBox::critical(this, tr("Hannah - Firmware downloader"), | |
257 | tr(callProgram->readAllStandardError())); | |
258 | QMessageBox::critical(this, tr("Hannah - Firmware downloader"), | |
259 | tr("Something went wrong during the download and installation process for the following printers:\n" | |
260 | "%1\n").arg(string), QMessageBox::Ok); | |
261 | statusBar->showMessage(tr("An error occured during download and installation process.")); | |
262 | break; | |
263 | } | |
264 | }; |
0 | // Hannah, GUI for downloading specific printer firmware | |
1 | // Copyright (C) 2007 Steffen Joeris <white@debian.org> | |
2 | // | |
3 | // This program is free software; you can redistribute it and/or modify | |
4 | // it under the terms of the GNU General Public License as published by | |
5 | // the Free Software Foundation; either version 2 of the License, or | |
6 | // (at your option) any later version. | |
7 | // | |
8 | // This program is distributed in the hope that it will be useful, | |
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | // GNU General Public License for more details. | |
12 | // | |
13 | // You should have received a copy of the GNU General Public License along | |
14 | // with this program; if not, write to the Free Software Foundation, Inc., | |
15 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | ||
17 | ||
18 | #ifndef GUI_H | |
19 | #define GUI_H | |
20 | ||
21 | #include <QMainWindow> | |
22 | #include <QWidget> | |
23 | #include <QVBoxLayout> | |
24 | #include <QPushButton> | |
25 | #include <QMessageBox> | |
26 | #include <QApplication> | |
27 | #include <QProcess> | |
28 | #include <QCheckBox> | |
29 | #include <QAbstractButton> | |
30 | #include <QButtonGroup> | |
31 | #include <QAction> | |
32 | #include <QMenu> | |
33 | #include <QMenuBar> | |
34 | #include <QStatusBar> | |
35 | ||
36 | class MainWindow : public QWidget | |
37 | { | |
38 | Q_OBJECT | |
39 | ||
40 | public: | |
41 | MainWindow(QWidget *parent = 0); | |
42 | ||
43 | private: | |
44 | int state; | |
45 | void createMainWidget(); | |
46 | QCheckBox *hp2600Button; | |
47 | QCheckBox *hp1600Button; | |
48 | QCheckBox *hp1020Button; | |
49 | QCheckBox *hp1018Button; | |
50 | QCheckBox *hp1005Button; | |
51 | QCheckBox *hp1000Button; | |
52 | QCheckBox *minolta2530Button; | |
53 | QCheckBox *minolta2490Button; | |
54 | QCheckBox *minolta2480Button; | |
55 | QCheckBox *minolta2430Button; | |
56 | QCheckBox *minolta2300Button; | |
57 | QCheckBox *minolta2200Button; | |
58 | QCheckBox *minoltaproButton; | |
59 | QCheckBox *samsung3160Button; | |
60 | QCheckBox *samsung600Button; | |
61 | QCheckBox *samsung300Button; | |
62 | QCheckBox *xerox6115Button; | |
63 | QCheckBox *xerox6110Button; | |
64 | QCheckBox *allButton; | |
65 | QButtonGroup *buttonGroup; | |
66 | QPushButton *downloadButton; | |
67 | QPushButton *exitButton; | |
68 | QStatusBar *statusBar; | |
69 | QProcess *callProgram; | |
70 | QString string; | |
71 | ||
72 | private slots: | |
73 | void callGetweb(); | |
74 | void setCheckBoxes(int); | |
75 | void showInfo(); | |
76 | void checkProgram(); | |
77 | }; | |
78 | ||
79 | #endif // GUI_H |
0 | [Desktop Entry] | |
1 | Name=Foo2ZJS Firmware Installer (Hannah) | |
2 | Exec=/usr/bin/su-to-root -X -c /usr/bin/hannah-foo2zjs | |
3 | Type=Application | |
4 | Comment=Foo2ZJS Firmware Downloader and Installer | |
5 | Terminal=0 | |
6 | Categories=System;Settings; |
0 | ###################################################################### | |
1 | # Automatically generated by qmake (2.01a) Thu Sep 27 01:13:29 2007 | |
2 | ###################################################################### | |
3 | ||
4 | TEMPLATE = app | |
5 | TARGET = | |
6 | DEPENDPATH += . | |
7 | INCLUDEPATH += . | |
8 | ||
9 | # Input | |
10 | HEADERS += gui.h | |
11 | SOURCES += gui.cpp main.cpp |
0 | // Hannah, GUI for downloading specific printer firmware | |
1 | // Copyright (C) 2007 Steffen Joeris <white@debian.org> | |
2 | // | |
3 | // This program is free software; you can redistribute it and/or modify | |
4 | // it under the terms of the GNU General Public License as published by | |
5 | // the Free Software Foundation; either version 2 of the License, or | |
6 | // (at your option) any later version. | |
7 | // | |
8 | // This program is distributed in the hope that it will be useful, | |
9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | // GNU General Public License for more details. | |
12 | // | |
13 | // You should have received a copy of the GNU General Public License along | |
14 | // with this program; if not, write to the Free Software Foundation, Inc., | |
15 | // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
16 | ||
17 | ||
18 | #include "gui.h" | |
19 | ||
20 | int main(int argc, char *argv[]) | |
21 | { | |
22 | QApplication app(argc, argv); | |
23 | MainWindow window; | |
24 | window.show(); | |
25 | return app.exec(); | |
26 | } |