import com.trolltech.qt.gui.QPixmap;
import com.trolltech.qt.gui.QPrintDialog;
import com.trolltech.qt.gui.QPrinter;
-import com.trolltech.qt.gui.QProgressBar;
import com.trolltech.qt.gui.QSizePolicy;
import com.trolltech.qt.gui.QSizePolicy.Policy;
import com.trolltech.qt.gui.QSpinBox;
import cx.fbn.nevernote.gui.TagTreeWidget;
import cx.fbn.nevernote.gui.Thumbnailer;
import cx.fbn.nevernote.gui.TrashTreeWidget;
+import cx.fbn.nevernote.gui.controls.QuotaProgressBar;
import cx.fbn.nevernote.sql.DatabaseConnection;
import cx.fbn.nevernote.sql.WatchFolderRecord;
import cx.fbn.nevernote.threads.IndexRunner;
public QToolBar toolBar; // The tool bar under the menu
QComboBox searchField; // search filter bar on the toolbar;
boolean searchPerformed = false; // Search was done?
- QProgressBar quotaBar; // The current quota usage
+ QuotaProgressBar quotaBar; // The current quota usage
ApplicationLogger logger;
List<String> selectedNotebookGUIDs; // List of notebook GUIDs
searchField.setDuplicatesEnabled(false);
searchField.editTextChanged.connect(this,"searchFieldTextChanged(String)");
- quotaBar = new QProgressBar();
+ quotaBar = new QuotaProgressBar();
// Setup the thumbnail viewer
thumbnailViewer = new ThumbnailViewer();
noteTableView.resetViewport.connect(this, "scrollToCurrentGuid()");
noteTableView.doubleClicked.connect(this, "listDoubleClick()");
listManager.trashSignal.countChanged.connect(trashTree, "updateCounts(Integer)");
+
+ quotaBar.setMouseClickAction(menuBar.accountAction);
+
trashTree.load();
trashTree.itemSelectionChanged.connect(this, "trashTreeSelection()");
trashTree.setEmptyAction(menuBar.emptyTrashAction);
--- /dev/null
+package cx.fbn.nevernote.gui.controls;
+
+import com.trolltech.qt.gui.QAction;
+import com.trolltech.qt.gui.QMouseEvent;
+import com.trolltech.qt.gui.QProgressBar;
+
+/**
+ * Progress bar for showing remaining space for this month in evernote account
+ *
+ * @author danil
+ *
+ */
+public class QuotaProgressBar extends QProgressBar {
+
+ private QAction mouseClickAction;
+
+ public QuotaProgressBar() {
+ setMouseTracking(true);
+ }
+
+ @Override
+ protected void mouseReleaseEvent(QMouseEvent arg__1) {
+ super.mouseReleaseEvent(arg__1);
+
+ mouseClickAction.trigger();
+ }
+
+ public void setMouseClickAction(QAction mouseClickAction) {
+ this.mouseClickAction = mouseClickAction;
+ }
+
+ public QAction getMouseClickAction() {
+ return mouseClickAction;
+ }
+}