-rw-r--r-- | noncore/apps/keyz-cfg/cfgdlg.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/keyz-cfg/cfgdlg.h | 2 | ||||
-rw-r--r-- | noncore/apps/keyz-cfg/main.cpp | 12 |
3 files changed, 11 insertions, 9 deletions
diff --git a/noncore/apps/keyz-cfg/cfgdlg.cpp b/noncore/apps/keyz-cfg/cfgdlg.cpp index 863f21e..3965198 100644 --- a/noncore/apps/keyz-cfg/cfgdlg.cpp +++ b/noncore/apps/keyz-cfg/cfgdlg.cpp @@ -1,42 +1,44 @@ #include <qdir.h> #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <unistd.h> #include "cfgdlg.h" -CfgDlg::CfgDlg(QWidget* parent, CfgFile* cf, QApplication* app):QDialog(parent), cfile(cf), application(app) { +CfgDlg::CfgDlg(QWidget* parent, CfgFile* cf, QApplication* app, bool mod): + QDialog(parent, "CfgDlg", mod), cfile(cf), application(app) { + setCaption(tr("keyz configurator")); QGridLayout* gl = new QGridLayout(this, 7, 5, 5, 5); QLabel* flabel = new QLabel("Available Keymaps", this); files = new QListBox(this); QPushButton* addButton = new QPushButton(">>", this); //add->setText("Add"); connect(addButton, SIGNAL(clicked()), this, SLOT(add())); QLabel* klabel = new QLabel("Selected Keymaps", this); keymaps = new QListBox(this); connect(keymaps, SIGNAL(highlighted(const QString&)), this, SLOT(keymapHighlighted(const QString&))); QPushButton* delButton = new QPushButton("<<", this); //del->setText("Delete"); connect(delButton, SIGNAL(clicked()), this, SLOT(del())); QPushButton* slabelButton = new QPushButton("Set Label", this); //apply->setText("Apply"); connect(slabelButton, SIGNAL(clicked()), this, SLOT(setLabel())); QLabel* l = new QLabel("Label", this); label = new QLineEdit(this); QLabel* adlabel = new QLabel("Auto Repeat Delay (ms)", this); QLabel* aplabel = new QLabel("Auto Repeat Period (ms)", this); ad = new QSpinBox(50, 5000, 5, this); ap = new QSpinBox(0, 5000, 5, this); - + // QLabel* adms = new QLabel("ms", this); // QLabel* apms = new QLabel("ms", this); // QCheckBox* enable = new QCheckBox("Enable", t); gl->setColStretch(0, 1); gl->setColStretch(1, 1); gl->setColStretch(3, 1); gl->setColStretch(4, 1); gl->setRowStretch(3, 1); gl->addMultiCellWidget(flabel, 0, 0, 0, 1); gl->addMultiCellWidget(klabel, 0, 0, 3, 4); diff --git a/noncore/apps/keyz-cfg/cfgdlg.h b/noncore/apps/keyz-cfg/cfgdlg.h index 16732ee..cbefdf1 100644 --- a/noncore/apps/keyz-cfg/cfgdlg.h +++ b/noncore/apps/keyz-cfg/cfgdlg.h @@ -5,25 +5,25 @@ #include <qlayout.h> #include <qcheckbox.h> #include <qspinbox.h> #include <qdialog.h> #include <qapplication.h> #include "cfgfile.h" class CfgDlg : public QDialog { Q_OBJECT public: - CfgDlg(QWidget* parent, CfgFile* cfile, QApplication *); + CfgDlg(QWidget* parent, CfgFile* cfile, QApplication *, bool b = false); virtual ~CfgDlg(); protected: CfgFile* cfile; QApplication* application; QMap<QString, QString> m; QListBox* files; QListBox* keymaps; QLineEdit* label; QSpinBox* ap; diff --git a/noncore/apps/keyz-cfg/main.cpp b/noncore/apps/keyz-cfg/main.cpp index 55cc23e..4615562 100644 --- a/noncore/apps/keyz-cfg/main.cpp +++ b/noncore/apps/keyz-cfg/main.cpp @@ -1,22 +1,22 @@ #include <stdio.h> #include <qpe/qpeapplication.h> +#include <qlayout.h> #include <qmainwindow.h> #include "cfgdlg.h" int main( int argc, char **argv ) { QPEApplication app(argc, argv); CfgFile cfile; CfgParser cp; cp.load(QPEApplication::qpeDir()+"/share/zkb/zkb.xml", cfile); - QMainWindow m; - CfgDlg c(&m, &cfile, &app); - app.showMainWidget(&m); - m.hide(); - c.showMaximized(); - int ret = app.exec(); + CfgDlg c(0, &cfile, &app, true); + + + app.showMainWidget(&c); + int ret = QPEApplication::execDialog(&c); return ret; } |