[Foo2zjs-commits] r67 - / hannah
white at alioth.debian.org
white at alioth.debian.org
Wed Sep 26 15:09:22 UTC 2007
Author: white
Date: 2007-09-26 15:09:22 +0000 (Wed, 26 Sep 2007)
New Revision: 67
Added:
hannah/
hannah/README
hannah/gui.cpp
hannah/gui.h
hannah/hannah.pro
Removed:
hannah/gui.cpp
hannah/gui.h
Log:
Add hannah.pro file for easy compiling and README for first explanation
Copied: hannah (from rev 62, download-gui)
Added: hannah/README
===================================================================
--- hannah/README (rev 0)
+++ hannah/README 2007-09-26 15:09:22 UTC (rev 67)
@@ -0,0 +1,11 @@
+This is the current playground for hannah.
+To compile, call qmake-qt4 and make.
+Then you can use it by ./hannah
+
+Naming: hannah
+ h (hAlf)
+ a (aUtmated)
+ n (priNter)
+ n (dowNloader)
+ a (firmwAre)
+ h (grapHical-user-interace)
Deleted: hannah/gui.cpp
===================================================================
--- download-gui/gui.cpp 2007-09-26 09:21:17 UTC (rev 62)
+++ hannah/gui.cpp 2007-09-26 15:09:22 UTC (rev 67)
@@ -1,94 +0,0 @@
-#include "gui.h"
-
-MainWindow::MainWindow(QWidget *parent)
- :QWidget(parent)
-{
- int check = QMessageBox::question(this, tr("Firmware downloader"),
- tr("Do you want to proceed? (Fill me with text)"), tr("&Yes"), tr("&No"),
- QString::null, 0, 1);
-
-
- if (! check == 0 ) {
- exit(0);
- }
- qDebug()<<check;
-
- setWindowTitle(tr("Foo2zjs firmware downloader"));
- QVBoxLayout *mainLayout = new QVBoxLayout;
- QPushButton *hp2600Button = new QPushButton(tr("Download firmware for HP2600"));
- QPushButton *hp1600Button = new QPushButton(tr("Download firmware for HP1600"));
- QPushButton *hp1020Button = new QPushButton(tr("Download firmware for HP1020"));
- QPushButton *hp1018Button = new QPushButton(tr("Download firmware for HP1018"));
- QPushButton *hp1005Button = new QPushButton(tr("Download firmware for HP1005"));
- QPushButton *hp1000Button = new QPushButton(tr("Download firmware for HP1000"));
- QPushButton *minolta2530Button = new QPushButton(tr("Download firmware for Minolta 2530"));
- QPushButton *minolta2490Button = new QPushButton(tr("Download firmware for Minolta 2490"));
- QPushButton *minolta2480Button = new QPushButton(tr("Download firmware for Minolta 2480"));
- QPushButton *minolta2430Button = new QPushButton(tr("Download firmware for Minolta 2430"));
- QPushButton *minolta2300Button = new QPushButton(tr("Download firmware for Minolta 2300"));
- QPushButton *minolta2200Button = new QPushButton(tr("Download firmware for Minolta 2200"));
- QPushButton *minoltaproButton = new QPushButton(tr("Download firmware for Minolta PageWorks/Pro L"));
- QPushButton *samsung3160Button = new QPushButton(tr("Download firmware for Samsung CLX-3160"));
- QPushButton *samsung600Button = new QPushButton(tr("Download firmware for Samsung CLP-600"));
- QPushButton *samsung300Button = new QPushButton(tr("Download firmware for Samsung CLP-300"));
- QPushButton *xerox6115Button = new QPushButton(tr("Download firmware for Xerox Phaser 6115"));
- QPushButton *xerox6110Button = new QPushButton(tr("Download firmware for Xerox Phaser 6110"));
- QPushButton *allButton = new QPushButton(tr("Download all mentioned firmwares"));
- QPushButton *exitButton = new QPushButton(tr("Exit"));
-
- hp2600Button->setFont(QFont("Times", 18));
- hp1600Button->setFont(QFont("Times", 18));
- hp1020Button->setFont(QFont("Times", 18));
- hp1018Button->setFont(QFont("Times", 18));
- hp1005Button->setFont(QFont("Times", 18));
- hp1000Button->setFont(QFont("Times", 18));
- minolta2530Button->setFont(QFont("Times", 18));
- minolta2490Button->setFont(QFont("Times", 18));
- minolta2480Button->setFont(QFont("Times", 18));
- minolta2430Button->setFont(QFont("Times", 18));
- minolta2300Button->setFont(QFont("Times", 18));
- minolta2200Button->setFont(QFont("Times", 18));
- minoltaproButton->setFont(QFont("Times", 18));
- samsung3160Button->setFont(QFont("Times", 18));
- samsung600Button->setFont(QFont("Times", 18));
- samsung300Button->setFont(QFont("Times", 18));
- xerox6115Button->setFont(QFont("Times", 18));
- xerox6110Button->setFont(QFont("Times", 18));
- allButton->setFont(QFont("Times", 18));
- exitButton->setFont(QFont("Times", 18));
-
- mainLayout->addWidget(hp2600Button, 0, 0);
- mainLayout->addWidget(hp1600Button, 1, 0);
- mainLayout->addWidget(hp1020Button, 2, 0);
- mainLayout->addWidget(hp1018Button, 3, 0);
- mainLayout->addWidget(hp1005Button, 4, 0);
- mainLayout->addWidget(hp1000Button, 5, 0);
- mainLayout->addWidget(minolta2530Button, 6, 0);
- mainLayout->addWidget(minolta2490Button, 7, 0);
- mainLayout->addWidget(minolta2480Button, 8, 0);
- mainLayout->addWidget(minolta2430Button, 9, 0);
- mainLayout->addWidget(minolta2300Button, 10, 0);
- mainLayout->addWidget(minolta2200Button, 11, 0);
- mainLayout->addWidget(minoltaproButton, 12, 0);
- mainLayout->addWidget(samsung3160Button, 13, 0);
- mainLayout->addWidget(samsung600Button, 14, 0);
- mainLayout->addWidget(samsung300Button, 15, 0);
- mainLayout->addWidget(xerox6115Button, 16, 0);
- mainLayout->addWidget(xerox6110Button, 17, 0);
- mainLayout->addWidget(allButton, 18, 0);
- mainLayout->addWidget(exitButton, 3, 0);
- setMinimumSize(400, 200);
- setLayout(mainLayout);
-
- connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
-};
-
-void MainWindow::callGetweb(QStringList firmware)
-{
- QObject *parent;
-
- QString getweb = "/usr/bin/getweb";
- QProcess *newCall = new QProcess(parent);
-
- newCall->start(getweb, firmware);
-};
Copied: hannah/gui.cpp (from rev 66, download-gui/gui.cpp)
===================================================================
--- hannah/gui.cpp (rev 0)
+++ hannah/gui.cpp 2007-09-26 15:09:22 UTC (rev 67)
@@ -0,0 +1,165 @@
+#include "gui.h"
+
+MainWindow::MainWindow(QWidget *parent)
+ :QWidget(parent)
+{
+ int check = QMessageBox::question(this, tr("Firmware downloader"),
+ tr("Do you want to proceed? (Fill me with text)"), tr("&Yes"), tr("&No"),
+ QString::null, 0, 1);
+
+
+ if (! check == 0 ) {
+ exit(0);
+ }
+
+ setWindowTitle(tr("Foo2zjs firmware downloader"));
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ 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));
+ hp1600Button->setFont(QFont("Times", 18));
+ hp1020Button->setFont(QFont("Times", 18));
+ hp1018Button->setFont(QFont("Times", 18));
+ hp1005Button->setFont(QFont("Times", 18));
+ hp1000Button->setFont(QFont("Times", 18));
+ minolta2530Button->setFont(QFont("Times", 18));
+ minolta2490Button->setFont(QFont("Times", 18));
+ minolta2480Button->setFont(QFont("Times", 18));
+ minolta2430Button->setFont(QFont("Times", 18));
+ minolta2300Button->setFont(QFont("Times", 18));
+ minolta2200Button->setFont(QFont("Times", 18));
+ minoltaproButton->setFont(QFont("Times", 18));
+ samsung3160Button->setFont(QFont("Times", 18));
+ samsung600Button->setFont(QFont("Times", 18));
+ samsung300Button->setFont(QFont("Times", 18));
+ 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);
+ mainLayout->addWidget(hp1600Button, 1, 0);
+ mainLayout->addWidget(hp1020Button, 2, 0);
+ mainLayout->addWidget(hp1018Button, 3, 0);
+ mainLayout->addWidget(hp1005Button, 4, 0);
+ mainLayout->addWidget(hp1000Button, 5, 0);
+ mainLayout->addWidget(minolta2530Button, 6, 0);
+ mainLayout->addWidget(minolta2490Button, 7, 0);
+ mainLayout->addWidget(minolta2480Button, 8, 0);
+ mainLayout->addWidget(minolta2430Button, 9, 0);
+ mainLayout->addWidget(minolta2300Button, 10, 0);
+ mainLayout->addWidget(minolta2200Button, 11, 0);
+ mainLayout->addWidget(minoltaproButton, 12, 0);
+ mainLayout->addWidget(samsung3160Button, 13, 0);
+ mainLayout->addWidget(samsung600Button, 14, 0);
+ mainLayout->addWidget(samsung300Button, 15, 0);
+ mainLayout->addWidget(xerox6115Button, 16, 0);
+ mainLayout->addWidget(xerox6110Button, 17, 0);
+ mainLayout->addWidget(allButton, 18, 0);
+ mainLayout->addWidget(downloadButton, 19, 0);
+ mainLayout->addWidget(exitButton, 20, 0);
+ setMinimumSize(600, 700);
+ setLayout(mainLayout);
+
+ connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
+
+ connect(allButton, SIGNAL(stateChanged(int)), this, SLOT(setCheckBoxes(int)));
+ connect(downloadButton, SIGNAL(clicked()), this, SLOT(callGetweb()));
+};
+
+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 string_buttons = "hp2600Button, hp1600Button";
+
+ 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);
+*/
+};
Deleted: hannah/gui.h
===================================================================
--- download-gui/gui.h 2007-09-26 09:21:17 UTC (rev 62)
+++ hannah/gui.h 2007-09-26 15:09:22 UTC (rev 67)
@@ -1,26 +0,0 @@
-#ifndef GUI_H
-#define GUI_H
-
-#include <QMainWindow>
-#include <QWidget>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QMessageBox>
-#include <QApplication>
-#include <QProcess>
-
-#include <QDebug>
-
-class MainWindow : public QWidget
-{
- Q_OBJECT
-
-public:
- MainWindow(QWidget *parent = 0);
-
-private slots:
- void callGetweb(QStringList);
-
-};
-
-#endif // GUI_H
Copied: hannah/gui.h (from rev 66, download-gui/gui.h)
===================================================================
--- hannah/gui.h (rev 0)
+++ hannah/gui.h 2007-09-26 15:09:22 UTC (rev 67)
@@ -0,0 +1,50 @@
+#ifndef GUI_H
+#define GUI_H
+
+#include <QMainWindow>
+#include <QWidget>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QMessageBox>
+#include <QApplication>
+#include <QProcess>
+#include <QCheckBox>
+
+#include <QDebug>
+
+class MainWindow : public QWidget
+{
+ Q_OBJECT
+
+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
Added: hannah/hannah.pro
===================================================================
--- hannah/hannah.pro (rev 0)
+++ hannah/hannah.pro 2007-09-26 15:09:22 UTC (rev 67)
@@ -0,0 +1,12 @@
+######################################################################
+# Automatically generated by qmake (2.01a) Thu Sep 27 01:13:29 2007
+######################################################################
+
+TEMPLATE = app
+TARGET =
+DEPENDPATH += .
+INCLUDEPATH += .
+
+# Input
+HEADERS += gui.h
+SOURCES += gui.cpp main.cpp
More information about the Foo2zjs-commits
mailing list