From 46501074b87213935cd1aafdd044b70d330b4647 Mon Sep 17 00:00:00 2001 From: Diego Rubin Date: Mon, 26 Aug 2019 07:31:28 -0300 Subject: [PATCH] adding shortcuts and closes #73 --- README.md | 18 ++++++++-- configure.ac | 4 +-- data/gnomato.ui | 37 ++++++++++++++----- src/win_main.cc | 2 +- src/win_main.h | 96 ++++++++++++++++++++++++------------------------- 5 files changed, 94 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index 9a56436..55acb70 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Pomodoro Technique timer for GNU/Linux. ## Installing -Download the stable tarball [1.1.0](https://github.com/diegorubin/gnomato/releases/download/1.1.0/gnomato-1.1.0.tar.gz) +Download the stable tarball [1.2.0](https://github.com/diegorubin/gnomato/releases/download/1.2.0/gnomato-1.2.0.tar.gz) - tar -zxvf gnomato-1.1.0.tar.gz - cd gnomato-1.1.0 + tar -zxvf gnomato-1.2.0.tar.gz + cd gnomato-1.2.0 ./configure make sudo make install @@ -36,6 +36,18 @@ To generate `configure` script and `Makefiles` execute: autoreconf -vi +## Usage + +### Shortcuts + +- __Crtl+s__: Start/Stop timer +- __Crtl+a__: Open New Task Dialog +- __Crtl+r__: Remove selected task +- __Crtl+d__: Finish selected task +- __Crtl+c__: Cancel selected task +- __Crtl+f__: Filter field focus +- __Crtl+l__: Task list focus + ## Contacting To report bugs send email to rubin.diego[at]gmail.com or diff --git a/configure.ac b/configure.ac index 5a338d6..0f4f323 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ -AC_INIT([Gnomato],[1.0.3],[rubin.diego@gmail.com]) +AC_INIT([Gnomato],[1.2.0],[rubin.diego@gmail.com]) -AM_INIT_AUTOMAKE(gnomato,1.0.3) +AM_INIT_AUTOMAKE(gnomato,1.2.0) AC_PROG_CC AC_PROG_CXX diff --git a/data/gnomato.ui b/data/gnomato.ui index 5b9b14b..b42767f 100644 --- a/data/gnomato.ui +++ b/data/gnomato.ui @@ -1,11 +1,14 @@ - + False 5 dialog + + + False @@ -165,6 +168,9 @@ center-always True dialog + + + False @@ -462,6 +468,9 @@ False 580 320 + + + True @@ -599,10 +608,10 @@ False center True - 0 - 0 00:00 True + 0 + 0 @@ -642,13 +651,15 @@ True - Start + gtk-media-play False 100 30 True True True + True + False @@ -658,12 +669,13 @@ - Restart + gtk-refresh False 100 True True True + True False @@ -716,6 +728,7 @@ True True True + False @@ -730,6 +743,7 @@ True True True + False @@ -867,6 +881,7 @@ True True 200 + True @@ -894,6 +909,7 @@ + @@ -924,6 +940,7 @@ True True True + False @@ -939,6 +956,7 @@ True True True + False @@ -1003,8 +1021,8 @@ True False False - 2.2351741291171123e-10 1 + 2.2351741291171123e-10 False @@ -1021,12 +1039,15 @@ Gnomato dialog Gnomato - 1.0 + 1.2.0 http://diegorubin.com Gnomato Website Diego Rubin - image-missing + help-about gpl-2-0 + + + False diff --git a/src/win_main.cc b/src/win_main.cc index 36c061e..298153c 100644 --- a/src/win_main.cc +++ b/src/win_main.cc @@ -24,7 +24,7 @@ WinMain::WinMain(BaseObjectType *cobject, const Glib::RefPtr &refGlade) - : Gtk::Window(cobject), m_refGlade(refGlade), + : Gtk::ShortcutsWindow(cobject), m_refGlade(refGlade), lblDisplay(0) diff --git a/src/win_main.h b/src/win_main.h index 8dc03c9..65e9031 100644 --- a/src/win_main.h +++ b/src/win_main.h @@ -1,53 +1,52 @@ /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /*! -* win_main.h -* Copyright (C) Diego Rubin 2011 -* -* Gnomato is free software: you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* Gnomato is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -* See the GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License along -* with this program. If not, see . -* -* Author: Diego Rubin -* -*/ + * win_main.h + * Copyright (C) Diego Rubin 2011 + * + * Gnomato is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Gnomato is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + * + * Author: Diego Rubin + * + */ #ifndef _WIN_MAIN_H_ #define _WIN_MAIN_H_ -#include #include -#include +#include #include +#include #include -#include "boost/date_time/posix_time/posix_time.hpp" +#include "boost/date_time/posix_time/posix_time.hpp" +#include "config.h" +#include "dialog_preferences.h" +#include "dialog_task.h" +#include "python_executor.h" #include "task.h" #include "task_list.h" -#include "dialog_task.h" -#include "dialog_preferences.h" -#include "config.h" #include "utils.h" -#include "python_executor.h" using namespace Gtk; using namespace boost::posix_time; const int MINUTE_IN_SECONDS = 60000; -class WinMain: public Gtk::Window -{ +class WinMain : public Gtk::ShortcutsWindow { public: - WinMain(BaseObjectType* cobject, const Glib::RefPtr& refGlade); + WinMain(BaseObjectType *cobject, const Glib::RefPtr &refGlade); virtual ~WinMain(); void on_menu_file_new_task(); @@ -64,25 +63,25 @@ class WinMain: public Gtk::Window Glib::ustring get_cycle(); private: - - class ModelColumns : public Gtk::TreeModel::ColumnRecord - { + class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: - ModelColumns() - { add(id); add(title); } - Gtk::TreeModelColumn id; - Gtk::TreeModelColumn title; + ModelColumns() { + add(id); + add(title); + } + Gtk::TreeModelColumn id; + Gtk::TreeModelColumn title; }; - class TasksView: public Gtk::TreeView - { - + class TasksView : public Gtk::TreeView { + public: - TasksView(BaseObjectType* cobject, const Glib::RefPtr& refGlade); - + TasksView(BaseObjectType *cobject, + const Glib::RefPtr &refGlade); + void set_win_main_ref(WinMain *win_main); Glib::RefPtr m_refGlade; - virtual void on_drag_end(const Glib::RefPtr< Gdk::DragContext >& context); + virtual void on_drag_end(const Glib::RefPtr &context); virtual void on_menu_move_task(); virtual bool on_button_press_event(GdkEventButton *ev); @@ -94,13 +93,13 @@ class WinMain: public Gtk::Window bool showed; bool started; unsigned int time_elapsed; - unsigned int minutes,seconds; + unsigned int minutes, seconds; int cycle_number; Config configs; Task *currentTask; - std::list lists; + std::list lists; // For pomodoro sigc::slot timer; @@ -150,7 +149,7 @@ class WinMain: public Gtk::Window PythonExecutor *pe; - //dialogs + // dialogs DialogTask *dlgTask; AboutDialog *abtDialog; @@ -165,7 +164,7 @@ class WinMain: public Gtk::Window void notify_with_green_icon(const char *message); void notify_with_gray_icon(const char *message); - Task* get_current_task(); + Task *get_current_task(); void inc_current_task(); void execute(string script); void run_python_script(string script); @@ -188,8 +187,8 @@ class WinMain: public Gtk::Window virtual void on_button_finish_clicked(); virtual void on_button_cancel_clicked(); virtual void on_button_clear_list_clicked(); - virtual void on_treeview_tasks_row_activated(const TreeModel::Path& path, - TreeViewColumn* column); + virtual void on_treeview_tasks_row_activated(const TreeModel::Path &path, + TreeViewColumn *column); virtual void on_button_del_task_clicked(); virtual bool on_timeout(int timer_number); virtual bool on_inactive_timeout(int timer_number); @@ -203,7 +202,6 @@ class WinMain: public Gtk::Window // callback methods - window virtual void on_resize(); - }; #endif //__WIN_MAIN_H_