[Foo2zjs-commits] r82 - trunk/hannah
white at alioth.debian.org
white at alioth.debian.org
Fri Sep 28 12:42:23 UTC 2007
Author: white
Date: 2007-09-28 12:42:23 +0000 (Fri, 28 Sep 2007)
New Revision: 82
Modified:
trunk/hannah/gui.cpp
trunk/hannah/gui.h
Log:
Reorganize the creation of the MainWidget into an own method to keep the overview; add first code for the MenuBar;
Modified: trunk/hannah/gui.cpp
===================================================================
--- trunk/hannah/gui.cpp 2007-09-28 11:39:25 UTC (rev 81)
+++ trunk/hannah/gui.cpp 2007-09-28 12:42:23 UTC (rev 82)
@@ -30,97 +30,8 @@
exit(0);
}
- setWindowTitle(tr("Hannah - 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"));
+ createMainWidget();
- 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);
-
- 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);
-
callProgram = new QProcess;
connect(exitButton, SIGNAL(clicked()), qApp, SLOT(quit()));
@@ -129,6 +40,107 @@
connect(downloadButton, SIGNAL(clicked()), this, SLOT(callGetweb()));
};
+void MainWindow::createMainWidget()
+{
+ setWindowTitle(tr("Hannah - 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"));
+ allButton = new QCheckBox(tr("Mark all for download"));
+ downloadButton = new QPushButton(tr("Download marked firmwares"));
+ 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);
+
+ 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);
+
+ QMenuBar *menubar = new QMenuBar;
+ QMenu *menu = new QMenu;
+ menubar->addMenu(menu);
+ QAction *about = new QAction(tr("About Hannah"), this);
+ menu = menubar->addMenu(tr("&Help"));
+ menu->addAction(about);
+};
+
void MainWindow::setCheckBoxes(int state)
{
switch (state) {
Modified: trunk/hannah/gui.h
===================================================================
--- trunk/hannah/gui.h 2007-09-28 11:39:25 UTC (rev 81)
+++ trunk/hannah/gui.h 2007-09-28 12:42:23 UTC (rev 82)
@@ -29,6 +29,9 @@
#include <QCheckBox>
#include <QAbstractButton>
#include <QButtonGroup>
+#include <QAction>
+#include <QMenu>
+#include <QMenuBar>
#include <QDebug>
@@ -42,6 +45,7 @@
private:
int state;
+ void createMainWidget();
QCheckBox *hp2600Button;
QCheckBox *hp1600Button;
QCheckBox *hp1020Button;
@@ -60,7 +64,10 @@
QCheckBox *samsung300Button;
QCheckBox *xerox6115Button;
QCheckBox *xerox6110Button;
+ QCheckBox *allButton;
QButtonGroup *buttonGroup;
+ QPushButton *downloadButton;
+ QPushButton *exitButton;
QProcess *callProgram;
More information about the Foo2zjs-commits
mailing list