From: Norbert Moutarde Date: Tue, 10 Jun 2014 11:16:07 +0000 (+0200) Subject: I've added "hack|action" to call action directly X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=2d09f1c7ae11a885c38a32c8447ce86832b294ce;p=diary-mobile.git I've added "hack|action" to call action directly --- diff --git a/mainwindow.cpp b/mainwindow.cpp index 12934e0..30f74c9 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -346,27 +346,27 @@ void MainWindow::action(const QString &a){ } } void MainWindow::createMenuBar(){ - FileMenu=new QMenu(trUtf8("&File"), this); - FileMenu->addAction(trUtf8("&Start"), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "File|Start"))); - FileMenu->addAction(trUtf8("&Back"), this, SLOT(back()),QKeySequence(trUtf8("Ctrl+B", "File|Back"))); - FileMenu->addAction(trUtf8("&View/Hide menu"), this, SLOT(toggleMenu()), QKeySequence(trUtf8("Ctrl+T", "File|View menu"))); - FileMenu->addAction(trUtf8("sendRAW"), this, SLOT(sendRAW()),QKeySequence(trUtf8("Ctrl+L", "File|Upload"))); - FileMenu->addAction(trUtf8("Reset RAW"), this, SLOT(resetRAW())); - FileMenu->addAction(trUtf8("&Quit"), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit"))); + FileMenu=new QMenu(trUtf8("&File", "top menu"), this); + FileMenu->addAction(trUtf8("&Start", "File|Start"), this, SLOT(start()),QKeySequence(trUtf8("Ctrl+S", "File|Start"))); + FileMenu->addAction(trUtf8("&Back", "File|Back"), this, SLOT(back()),QKeySequence(trUtf8("Ctrl+B", "File|Back"))); + FileMenu->addAction(trUtf8("&View/Hide menu", "File|View/Hide"), this, SLOT(toggleMenu()), QKeySequence(trUtf8("Ctrl+T", "File|View menu"))); + FileMenu->addAction(trUtf8("sendRAW", "File|SendRAW"), this, SLOT(sendRAW()), QKeySequence(trUtf8("Ctrl+L", "File|Upload"))); + FileMenu->addAction(trUtf8("Reset RAW", "File|resetRAW"), this, SLOT(resetRAW()), QKeySequence(trUtf8("Ctrl+E", "File|Reset"))); + FileMenu->addAction(trUtf8("&Quit", "File|Quit"), this, SLOT(quit()),QKeySequence(trUtf8("Ctrl+Q", "File|Quit"))); menuBar()->addMenu(FileMenu); - EditMenu=new QMenu(trUtf8("&Buttons")); - EditMenu->addAction(trUtf8("&Download"), this, SLOT(downloadData()),QKeySequence(trUtf8("Ctrl+W", "Buttons|Downlad"))); - EditMenu->addAction(trUtf8("A&dd"), this, SLOT(addButtonDB()), QKeySequence(trUtf8("Ctrl+D", "Buttons|Add"))); - EditMenu->addAction(trUtf8("Sa&v"), this, SLOT(savButtons()), QKeySequence(trUtf8("Ctrl+V", "Buttons|Save"))); - EditMenu->addAction(trUtf8("Reset"), this, SLOT(resetUi()), QKeySequence(trUtf8("Ctrl+Z", "Buttons|Reset"))); - EditMenu->addAction(trUtf8("&Edit"), this, SLOT(chooseButtonDB()), QKeySequence(trUtf8("Ctrl+E", "Buttons|&Edit"))); + EditMenu=new QMenu(trUtf8("&Buttons", "top menu")); + EditMenu->addAction(trUtf8("&Download", "Buttons|Downlad"), this, SLOT(downloadData()),QKeySequence(trUtf8("Ctrl+W", "Buttons|Downlad"))); + EditMenu->addAction(trUtf8("A&dd", "Buttons|Add"), this, SLOT(addButtonDB()), QKeySequence(trUtf8("Ctrl+D", "Buttons|Add"))); + EditMenu->addAction(trUtf8("Sa&v", "Buttons|Sav"), this, SLOT(savButtons()), QKeySequence(trUtf8("Ctrl+V", "Buttons|Save"))); + EditMenu->addAction(trUtf8("Reset", "Buttons|Reset"), this, SLOT(resetUi()), QKeySequence(trUtf8("Ctrl+Z", "Buttons|Reset"))); + EditMenu->addAction(trUtf8("&Edit", "Buttons|Edit"), this, SLOT(chooseButtonDB()), QKeySequence(trUtf8("Ctrl+E", "Buttons|&Edit"))); menuBar()->addMenu(EditMenu); - HackMenu=new QMenu(trUtf8("&Hack")); - HackMenu->addAction(trUtf8("New entry"), this, SLOT(entry())); - HackMenu->addAction(trUtf8("getButtons"), this, SLOT(getButtons())); - HackMenu->addAction(trUtf8("About Qt"), qApp, SLOT(aboutQt()), QKeySequence(tr("ctrl+H", "Help|About Qt"))); - HackMenu->addAction(trUtf8("C&reate Database"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); - HackMenu->addAction(trUtf8("Download sql"), this, SLOT(tmpdown())); + HackMenu=new QMenu(trUtf8("&Hack", "top menu")); + HackMenu->addAction(trUtf8("New entry", "Hack|Entry"), this, SLOT(entry())); + HackMenu->addAction(trUtf8("Action", "Hack|Action"), this, SLOT(action())); + HackMenu->addAction(trUtf8("About Qt", "Hack|About Qt"), qApp, SLOT(aboutQt()), QKeySequence(trUtf8("ctrl+H", "Help|About Qt"))); + HackMenu->addAction(trUtf8("C&reate Database", "Hack|Create"), this, SLOT(createDB()), QKeySequence(trUtf8("Ctrl+R", "Help|CreateDB"))); + HackMenu->addAction(trUtf8("Download sql", "Hack|download sql"), this, SLOT(tmpdown())); menuBar()->addMenu(HackMenu); } @@ -452,7 +452,7 @@ void MainWindow::firstrun(){ conf->setValue(QString("menu"), QVariant(0)); conf->setValue(QString("download"), QVariant("http://www.nothing2do.eu/ui.sql+")); conf->setValue(QString("userftp"), QVariant("")); - conf->setValue(QString("hostftp"), QVariant("")); + conf->setValue(QString("hostftp"), QVariant("setValue(QString("passftp"), QVariant("")); conf->setValue(QString("start"), QVariant("begin")); conf->setValue(QString("restore"), QVariant("http://www.abc.de/db")); @@ -709,6 +709,7 @@ void MainWindow::readData(const QByteArray &in){ int a=in.count('\n'); QString d=in.split('\n').at(0); qDebug()<<"first line : "<setValue(QString("firstline"), d); for(int i=1; iprepare(d); int b=in.split('\n').at(i).count('$'); @@ -896,7 +897,7 @@ void MainWindow::resizeEvent(QResizeEvent *event) void MainWindow::tmpdown(){ bool ok; QString url=QInputDialog::getText(this, trUtf8("tmp URL", "Title of box where ask for button file's URL"), trUtf8("Enter URL", "Label of box where ask for button file's URL"), QLineEdit::Normal, QString(""), &ok), file="file"; - download(url); + if(!ok)download(url); connect(m, SIGNAL(downloaded()), this, SLOT(readData())); } @@ -930,3 +931,8 @@ void MainWindow::send(const QString & a){ qDebug()<<"net->put : "<