[Foo2zjs-commits] r65 - download-gui

white at alioth.debian.org white at alioth.debian.org
Wed Sep 26 14:28:57 UTC 2007


Author: white
Date: 2007-09-26 14:28:57 +0000 (Wed, 26 Sep 2007)
New Revision: 65

Modified:
   download-gui/gui.cpp
   download-gui/gui.h
Log:
Declare the QCheckBox(es) in the header, so that they are accessable by all the private methods, add new method for checking and unchecking all checkboxes, if the mark all box is used

Modified: download-gui/gui.cpp
===================================================================
--- download-gui/gui.cpp	2007-09-26 13:24:56 UTC (rev 64)
+++ download-gui/gui.cpp	2007-09-26 14:28:57 UTC (rev 65)
@@ -14,26 +14,26 @@
 
 	setWindowTitle(tr("Foo2zjs firmware downloader"));
 	QVBoxLayout *mainLayout = new QVBoxLayout;
-	QCheckBox *hp2600Button = new QCheckBox(tr("Download firmware for HP2600"));
-//	QCheckBox *hp2600Button = new QCheckBox(tr("Download firmware for HP2600"));
-	QCheckBox *hp1600Button = new QCheckBox(tr("Download firmware for HP1600"));
-	QCheckBox *hp1020Button = new QCheckBox(tr("Download firmware for HP1020"));
-	QCheckBox *hp1018Button = new QCheckBox(tr("Download firmware for HP1018"));
-	QCheckBox *hp1005Button = new QCheckBox(tr("Download firmware for HP1005"));
-	QCheckBox *hp1000Button = new QCheckBox(tr("Download firmware for HP1000"));
-	QCheckBox *minolta2530Button = new QCheckBox(tr("Download firmware for Minolta 2530"));
-	QCheckBox *minolta2490Button = new QCheckBox(tr("Download firmware for Minolta 2490"));
-	QCheckBox *minolta2480Button = new QCheckBox(tr("Download firmware for Minolta 2480"));
-	QCheckBox *minolta2430Button = new QCheckBox(tr("Download firmware for Minolta 2430"));
-	QCheckBox *minolta2300Button = new QCheckBox(tr("Download firmware for Minolta 2300"));
-	QCheckBox *minolta2200Button = new QCheckBox(tr("Download firmware for Minolta 2200"));
-	QCheckBox *minoltaproButton = new QCheckBox(tr("Download firmware for Minolta PageWorks/Pro L"));
-	QCheckBox *samsung3160Button = new QCheckBox(tr("Download firmware for Samsung CLX-3160"));
-	QCheckBox *samsung600Button = new QCheckBox(tr("Download firmware for Samsung CLP-600"));
-	QCheckBox *samsung300Button = new QCheckBox(tr("Download firmware for Samsung CLP-300"));
-	QCheckBox *xerox6115Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6115"));
-	QCheckBox *xerox6110Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6110"));
-	QPushButton *allButton = new QPushButton(tr("Download marked firmwares"));
+	hp2600Button = new QCheckBox(tr("Download firmware for HP2600"));
+	hp1600Button = new QCheckBox(tr("Download firmware for HP1600"));
+	hp1020Button = new QCheckBox(tr("Download firmware for HP1020"));
+	hp1018Button = new QCheckBox(tr("Download firmware for HP1018"));
+	hp1005Button = new QCheckBox(tr("Download firmware for HP1005"));
+	hp1000Button = new QCheckBox(tr("Download firmware for HP1000"));
+	minolta2530Button = new QCheckBox(tr("Download firmware for Minolta 2530"));
+	minolta2490Button = new QCheckBox(tr("Download firmware for Minolta 2490"));
+	minolta2480Button = new QCheckBox(tr("Download firmware for Minolta 2480"));
+	minolta2430Button = new QCheckBox(tr("Download firmware for Minolta 2430"));
+	minolta2300Button = new QCheckBox(tr("Download firmware for Minolta 2300"));
+	minolta2200Button = new QCheckBox(tr("Download firmware for Minolta 2200"));
+	minoltaproButton = new QCheckBox(tr("Download firmware for Minolta PageWorks/Pro L"));
+	samsung3160Button = new QCheckBox(tr("Download firmware for Samsung CLX-3160"));
+	samsung600Button = new QCheckBox(tr("Download firmware for Samsung CLP-600"));
+	samsung300Button = new QCheckBox(tr("Download firmware for Samsung CLP-300"));
+	xerox6115Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6115"));
+	xerox6110Button = new QCheckBox(tr("Download firmware for Xerox Phaser 6110"));
+	QCheckBox *allButton = new QCheckBox(tr("Mark all for download"));
+	QPushButton *downloadButton = new QPushButton(tr("Download marked firmwares"));
 	QPushButton *exitButton = new QPushButton(tr("Exit"));
 	
 	hp2600Button->setFont(QFont("Times", 18));
@@ -55,6 +55,7 @@
 	xerox6115Button->setFont(QFont("Times", 18));
 	xerox6110Button->setFont(QFont("Times", 18));
 	allButton->setFont(QFont("Times", 18));
+	downloadButton->setFont(QFont("Times", 18));
 	exitButton->setFont(QFont("Times", 18));
 
 	mainLayout->addWidget(hp2600Button, 0, 0);
@@ -76,19 +77,71 @@
 	mainLayout->addWidget(xerox6115Button, 16, 0);
 	mainLayout->addWidget(xerox6110Button, 17, 0);
 	mainLayout->addWidget(allButton, 18, 0);
-	mainLayout->addWidget(exitButton, 3, 0);
+	mainLayout->addWidget(downloadButton, 19, 0);
+	mainLayout->addWidget(exitButton, 20, 0);
         setMinimumSize(600, 700);
         setLayout(mainLayout);
+	
+	connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
 
-	connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+	connect(allButton, SIGNAL(stateChanged(int)), this, SLOT(setCheckBoxes(int)));
 };
 
+void MainWindow::setCheckBoxes(int state)
+{
+	switch (state) {
+		case 2:
+			hp2600Button->setCheckState(Qt::Checked);
+			hp1600Button->setCheckState(Qt::Checked);
+			hp1020Button->setCheckState(Qt::Checked);
+			hp1018Button->setCheckState(Qt::Checked);
+			hp1005Button->setCheckState(Qt::Checked);
+			hp1000Button->setCheckState(Qt::Checked);
+			minolta2530Button->setCheckState(Qt::Checked);
+			minolta2490Button->setCheckState(Qt::Checked);
+			minolta2480Button->setCheckState(Qt::Checked);
+			minolta2430Button->setCheckState(Qt::Checked);
+			minolta2300Button->setCheckState(Qt::Checked);
+			minolta2200Button->setCheckState(Qt::Checked);
+			minoltaproButton->setCheckState(Qt::Checked);
+			samsung3160Button->setCheckState(Qt::Checked);
+			samsung600Button->setCheckState(Qt::Checked);
+			samsung300Button->setCheckState(Qt::Checked);
+			xerox6115Button->setCheckState(Qt::Checked);
+			xerox6110Button->setCheckState(Qt::Checked);
+			break;
+		case 0:
+			hp2600Button->setCheckState(Qt::Unchecked);
+			hp1600Button->setCheckState(Qt::Unchecked);
+			hp1020Button->setCheckState(Qt::Unchecked);
+			hp1018Button->setCheckState(Qt::Unchecked);
+			hp1005Button->setCheckState(Qt::Unchecked);
+			hp1000Button->setCheckState(Qt::Unchecked);
+			minolta2530Button->setCheckState(Qt::Unchecked);
+			minolta2490Button->setCheckState(Qt::Unchecked);
+			minolta2480Button->setCheckState(Qt::Unchecked);
+			minolta2430Button->setCheckState(Qt::Unchecked);
+			minolta2300Button->setCheckState(Qt::Unchecked);
+			minolta2200Button->setCheckState(Qt::Unchecked);
+			minoltaproButton->setCheckState(Qt::Unchecked);
+			samsung3160Button->setCheckState(Qt::Unchecked);
+			samsung600Button->setCheckState(Qt::Unchecked);
+			samsung300Button->setCheckState(Qt::Unchecked);
+			xerox6115Button->setCheckState(Qt::Unchecked);
+			xerox6110Button->setCheckState(Qt::Unchecked);
+			break;
+		default:
+			break;
+		}
+}
+
 void MainWindow::callGetweb()
 {
-	QObject *parent;
 
-	QString getweb = "/usr/bin/getweb";
-	QProcess *newCall = new QProcess(parent);
+//	QObject *parent;
 
+//	QString getweb = "/usr/bin/getweb";
+//	QProcess *newCall = new QProcess(parent);
+
 //	newCall->start(getweb, firmware);
 };

Modified: download-gui/gui.h
===================================================================
--- download-gui/gui.h	2007-09-26 13:24:56 UTC (rev 64)
+++ download-gui/gui.h	2007-09-26 14:28:57 UTC (rev 65)
@@ -19,9 +19,31 @@
 public:
 	MainWindow(QWidget *parent = 0);
 
+private:
+	int state;
+	QCheckBox *hp2600Button;
+	QCheckBox *hp1600Button;
+	QCheckBox *hp1020Button;
+	QCheckBox *hp1018Button;
+	QCheckBox *hp1005Button;
+	QCheckBox *hp1000Button;
+	QCheckBox *minolta2530Button;
+	QCheckBox *minolta2490Button;
+	QCheckBox *minolta2480Button;
+	QCheckBox *minolta2430Button;
+	QCheckBox *minolta2300Button;
+	QCheckBox *minolta2200Button;
+	QCheckBox *minoltaproButton;
+	QCheckBox *samsung3160Button;
+	QCheckBox *samsung600Button;
+	QCheckBox *samsung300Button;
+	QCheckBox *xerox6115Button;
+	QCheckBox *xerox6110Button;
+
+
 private slots:
 	void callGetweb();
-
+	void setCheckBoxes(int);
 };
 
 #endif // GUI_H




More information about the Foo2zjs-commits mailing list