[Foo2zjs-commits] r69 - hannah
white at alioth.debian.org
white at alioth.debian.org
Thu Sep 27 16:04:20 UTC 2007
Author: white
Date: 2007-09-27 16:04:19 +0000 (Thu, 27 Sep 2007)
New Revision: 69
Modified:
hannah/gui.cpp
hannah/gui.h
Log:
Add way to identify, which buttons are pressed, when clicking the download button
Modified: hannah/gui.cpp
===================================================================
--- hannah/gui.cpp 2007-09-27 11:03:31 UTC (rev 68)
+++ hannah/gui.cpp 2007-09-27 16:04:19 UTC (rev 69)
@@ -81,6 +81,27 @@
mainLayout->addWidget(exitButton, 20, 0);
setMinimumSize(600, 700);
setLayout(mainLayout);
+
+ buttonGroup = new QButtonGroup;
+ buttonGroup->setExclusive(false);
+ buttonGroup->addButton(hp2600Button, 0);
+ buttonGroup->addButton(hp1600Button, 1);
+ buttonGroup->addButton(hp1020Button, 2);
+ buttonGroup->addButton(hp1018Button, 3);
+ buttonGroup->addButton(hp1005Button, 4);
+ buttonGroup->addButton(hp1000Button, 5);
+ buttonGroup->addButton(minolta2530Button, 6);
+ buttonGroup->addButton(minolta2490Button, 7);
+ buttonGroup->addButton(minolta2480Button, 8);
+ buttonGroup->addButton(minolta2430Button, 9);
+ buttonGroup->addButton(minolta2300Button, 10);
+ buttonGroup->addButton(minolta2200Button, 11);
+ buttonGroup->addButton(minoltaproButton, 12);
+ buttonGroup->addButton(samsung3160Button, 13);
+ buttonGroup->addButton(samsung600Button, 14);
+ buttonGroup->addButton(samsung300Button, 15);
+ buttonGroup->addButton(xerox6115Button, 16);
+ buttonGroup->addButton(xerox6110Button, 17);
connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
@@ -138,28 +159,15 @@
void MainWindow::callGetweb()
{
-
-// QObject *parent;
-
- QString string_buttons = "hp2600Button, hp1600Button";
+ QAbstractButton *a;
+ int count = 0;
+ QStringList arguments;
+ arguments << "hp2600" << "hp1600" << "hp1020" << "hp1018" << "hp1005" << "hp1000" << "minolta2530" << "minolta2490" << "minolta2480" << "minolta2430" << "minolta2300" << "minolta2200" << "minoltapro" << "samsung3160" << "samsung600" << "samsung300" << "xerox6115" << "xerox6110";
- QStringList list_buttons;
-
- list_buttons << string_buttons;
- qDebug()<<list_buttons;
-
- QList<QString>::iterator list;
-
-// for(list=list_buttons.begin(); list <list_buttons.end(); ++list) {
-// QCheckBox(list)->setCheckState(Qt::Checked);
-// }
-
-
-/* QString getweb = "/usr/bin/getweb";
-
- QStringList firmware;
-
- QProcess *newCall = new QProcess(parent);
- newCall->start(getweb, firmware);
-*/
+ foreach( a, buttonGroup->buttons() ) {
+ if ( a->isChecked() ) {
+ qDebug()<<arguments.at(count);
+ }
+ count++;
+ }
};
Modified: hannah/gui.h
===================================================================
--- hannah/gui.h 2007-09-27 11:03:31 UTC (rev 68)
+++ hannah/gui.h 2007-09-27 16:04:19 UTC (rev 69)
@@ -9,6 +9,8 @@
#include <QApplication>
#include <QProcess>
#include <QCheckBox>
+#include <QAbstractButton>
+#include <QButtonGroup>
#include <QDebug>
@@ -21,7 +23,7 @@
private:
int state;
-
+
QCheckBox *hp2600Button;
QCheckBox *hp1600Button;
QCheckBox *hp1020Button;
@@ -40,8 +42,9 @@
QCheckBox *samsung300Button;
QCheckBox *xerox6115Button;
QCheckBox *xerox6110Button;
-
+ QButtonGroup *buttonGroup;
+
private slots:
void callGetweb();
void setCheckBoxes(int);
More information about the Foo2zjs-commits
mailing list