Skip to content

Commit 40bc994

Browse files
author
Jeremy Bowman
committed
Help file update, more Maemo and usability improvements
1 parent f5a983e commit 40bc994

File tree

9 files changed

+168
-136
lines changed

9 files changed

+168
-136
lines changed

CHANGES

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2010-05-02 JMB Help file update, more Maemo and usability improvements
2+
3+
Updated the English help file to match the current state of the code.
4+
Added a note to the file properties dialog about how to access the column
5+
statistics dialog. Fixed a bug in launching the column statistics dialog
6+
on Fremantle. Fixed the appearance of the password and slideshow dialogs
7+
on Maemo. Added a missing include for PBDialog that might cause compiling
8+
problems on some platforms.
9+
110
2010-04-30 JMB Proper D-Bus support, more bugfixes and Maemo improvements
211

312
Added code to correctly register with D-Bus on Maemo; this allows PortaBase

image/slideshowdialog.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* @param parent This dialog's parent widget
3434
*/
3535
SlideshowDialog::SlideshowDialog(QStringList columns, View *view, QWidget *parent)
36-
: PBDialog(tr("Slideshow"), parent), fullScreen(0)
36+
: PBDialog(tr("Slideshow"), parent, true), fullScreen(0)
3737
{
3838
currentView = view;
3939
QGridLayout *grid = Factory::gridLayout(vbox);

passdialog.cpp

+3-12
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "database.h"
2222
#include "factory.h"
2323
#include "passdialog.h"
24-
#include "pbdialog.h"
2524
#include "encryption/crypto.h"
2625

2726
/**
@@ -32,9 +31,9 @@
3231
* @param parent This dialog's parent widget
3332
*/
3433
PasswordDialog::PasswordDialog(Database *dbase, DialogMode dlgMode, QWidget *parent)
35-
: QQDialog("", parent), db(dbase), mode(dlgMode)
34+
: PBDialog(tr("Password"), parent, true), db(dbase), mode(dlgMode)
3635
{
37-
QGridLayout *grid = Factory::gridLayout(this, true);
36+
QGridLayout *grid = Factory::gridLayout(vbox);
3837
int currentRow = 0;
3938
if (mode == ChangePassword) {
4039
grid->addWidget(new QLabel(tr("Old password") + ":", this), 0, 0);
@@ -57,15 +56,7 @@ PasswordDialog::PasswordDialog(Database *dbase, DialogMode dlgMode, QWidget *par
5756
grid->addWidget(repeatPass, currentRow, 1);
5857
currentRow++;
5958
}
60-
61-
QDialogButtonBox::StandardButtons buttons(QDialogButtonBox::Ok |
62-
QDialogButtonBox::Cancel);
63-
QDialogButtonBox *buttonBox = new QDialogButtonBox(buttons,
64-
Qt::Horizontal, this);
65-
grid->addWidget(buttonBox, currentRow, 0, 2, 1);
66-
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
67-
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
68-
finishConstruction();
59+
finishLayout();
6960
}
7061

7162
/**

passdialog.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* passdialog.h
33
*
4-
* (c) 2003-2004,2009 by Jeremy Bowman <[email protected]>
4+
* (c) 2003-2004,2009-2010 by Jeremy Bowman <[email protected]>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
1616
#ifndef PASSDIALOG_H
1717
#define PASSDIALOG_H
1818

19-
#include "qqutil/qqdialog.h"
19+
#include "pbdialog.h"
2020

2121
class Database;
2222
class QLineEdit;
@@ -26,7 +26,7 @@ class QLineEdit;
2626
* encrypted file, opening an encrypted file, or changing the password on an
2727
* open encrypted file.
2828
*/
29-
class PasswordDialog: public QQDialog
29+
class PasswordDialog: public PBDialog
3030
{
3131
Q_OBJECT
3232
public:

pbdialog.h

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#ifndef PBDIALOG_H
1717
#define PBDIALOG_H
1818

19+
#include <QStringList>
1920
#include "qqutil/qqdialog.h"
2021

2122
class QDialogButtonBox;

portabase.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,8 @@ void PortaBase::viewProperties()
495495
count = filters.count();
496496
message += tr("Filters") + ": " + locale.toString(count) + "\n";
497497
count = db->listEnums().count();
498-
message += tr("Enums") + ": " + locale.toString(count);
498+
message += tr("Enums") + ": " + locale.toString(count) + "\n";
499+
message += tr("For statistics on a particular column, press and hold that column's header for at least half of a second");
499500
QString title = tr("File Properties") + " - " + qApp->applicationName();
500501
QMessageBox mb(title, message, QMessageBox::NoIcon,
501502
QMessageBox::Ok, QMessageBox::NoButton,

resources/help/html/PortaBase.html

+124-104
Large diffs are not rendered by default.

viewdisplay.cpp

+23-14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <QStackedWidget>
2626
#include <QStringList>
2727
#include <QTextDocument>
28+
#include <QTimer>
2829
#include <QToolButton>
2930
#include <QTreeWidget>
3031
#include <QTreeWidgetItem>
@@ -48,8 +49,8 @@
4849
* @param parent This widget's parent widget
4950
*/
5051
ViewDisplay::ViewDisplay(PortaBase *pbase, QWidget *parent) : QWidget(parent),
51-
portabase(pbase), propogateColWidths(false), booleanToggle(false),
52-
paged(true), singleClickShow(true)
52+
portabase(pbase), propogateColWidths(false), pressedHeader(-1),
53+
booleanToggle(false), paged(true), singleClickShow(true)
5354
{
5455
timer.start();
5556
QVBoxLayout *vbox = Factory::vBoxLayout(this, true);
@@ -711,8 +712,8 @@ void ViewDisplay::cellReleased(const QModelIndex &index)
711712
*/
712713
void ViewDisplay::headerPressed(int column)
713714
{
714-
pressedIndex = column;
715-
timer.restart();
715+
pressedHeader = column;
716+
QTimer::singleShot(500, this, SLOT(showStatistics()));
716717
}
717718

718719
/**
@@ -724,13 +725,12 @@ void ViewDisplay::headerPressed(int column)
724725
*/
725726
void ViewDisplay::headerReleased(int column)
726727
{
727-
if (column != pressedIndex) {
728+
if (column != pressedHeader) {
729+
pressedHeader = -1;
728730
return;
729731
}
730-
if (timer.elapsed() > 500) {
731-
showStatistics(column);
732-
}
733732
else {
733+
pressedHeader = -1;
734734
sort(column);
735735
}
736736
}
@@ -772,11 +772,14 @@ void ViewDisplay::sort(int column)
772772
* Show a dialog containing summary statistics for a particular column of
773773
* data. Only values in records matching the current filter are factored
774774
* into the statistics.
775-
*
776-
* @param column The position index of the column to show data for
777775
*/
778-
void ViewDisplay::showStatistics(int column)
776+
void ViewDisplay::showStatistics()
779777
{
778+
if (pressedHeader == -1) {
779+
return;
780+
}
781+
int column = pressedHeader;
782+
pressedHeader = -1;
780783
QStringList stats = model->view()->getStatistics(column);
781784
QString content("<qt><center><b>");
782785
content += model->headerData(column, Qt::Horizontal).toString();
@@ -786,9 +789,15 @@ void ViewDisplay::showStatistics(int column)
786789
content += stats[i] + "<br/>";
787790
}
788791
content += "</qt>";
789-
QMessageBox mb(qApp->applicationName(), content, QMessageBox::NoIcon,
790-
QMessageBox::Ok, QMessageBox::NoButton,
791-
QMessageBox::NoButton, this);
792+
QMessageBox mb(this);
793+
#if defined(Q_WS_MAEMO_5)
794+
mb.setStandardButtons(QMessageBox::Ok|QMessageBox::Cancel);
795+
#else
796+
mb.setStandardButtons(QMessageBox::Ok);
797+
#endif
798+
mb.setText(content);
799+
mb.setWindowTitle(qApp->applicationName());
800+
mb.setWindowModality(Qt::ApplicationModal);
792801
mb.exec();
793802
}
794803

viewdisplay.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public slots:
8282
int selectedRowIndex();
8383
int selectedRowId();
8484
void sort(int column);
85-
void showStatistics(int column);
8685

8786
private slots:
8887
void changePage(int id);
@@ -94,6 +93,7 @@ private slots:
9493
void cellReleased(const QModelIndex &index);
9594
void headerPressed(int column);
9695
void headerReleased(int column);
96+
void showStatistics();
9797
void columnResized(int column, int oldWidth, int newWidth);
9898
void updateButtons(int currentPage, int totalPages);
9999
void matchNewView(View *view);
@@ -113,6 +113,7 @@ private slots:
113113
QToolButton *pageButtons[PAGE_BUTTON_COUNT]; /**< Array of page navigation buttons */
114114
bool propogateColWidths; /**< True if column width resizes are to be passed to the view */
115115
int pressedIndex; /**< Index of the column in which the mouse has been pressed (while waiting for a release) */
116+
int pressedHeader; /**< Index of the column header which has been pressed (while waiting for a release) */
116117
QTime timer; /**< Time elapsed between the last mouse press and release */
117118
bool booleanToggle; /**< True if boolean field values can be toggled by clicking on them in the display */
118119
bool paged; /**< False if all records in the view are always shown on one scrolling page */

0 commit comments

Comments
 (0)