Commit afe36d58 authored by Hugo Hörnquist's avatar Hugo Hörnquist

Kassa option to disable double click

add
> double_click true
to the config file to reenable it.

It unfortunaly also disabled enter to buy.
parent a886e54d
......@@ -40,6 +40,7 @@ Widget::Widget(QWidget *parent) :
QString port = "/dev/ttyACM0";
QString db_name = HOME + "/.stupan/stupan.db";
this->double_click_enabled = false;
QFile settingsFile(HOME + "/.stupan/config");
if (settingsFile.open(QFile::ReadOnly | QFile::Text)) {
......@@ -54,6 +55,8 @@ Widget::Widget(QWidget *parent) :
port = keyvalue.at(1);
else if (keyvalue.at(0) == "database")
db_name = keyvalue.at(1);
else if (keyvalue.at(0) == "double_click")
this->double_click_enabled = keyvalue.at(1) == "true";
}
}
......@@ -200,10 +203,14 @@ void Widget::on_altSellButton_clicked()
*/
void Widget::on_productList_activated(const QModelIndex& /*index*/)
{
if (ui->bigBuyList->isEnabled() && ui->bigBuyList->model()->rowCount() != 0)
add_product_bigBuy();
else
just_sell_it();
if (this->double_click_enabled) {
if (ui->bigBuyList->isEnabled()
&& ui->bigBuyList->model()->rowCount() != 0) {
add_product_bigBuy();
} else {
just_sell_it();
}
}
}
void Widget::on_searchEdit_textEdited(const QString& arg1)
......
......@@ -60,6 +60,7 @@ private:
int amount_of_products_last_buy;
char* port_name;
bool double_click_enabled;
QVariant lastDrainageId;
QTimer* drainageTimer;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment