Skip to content

Commit

Permalink
Finish rs-10c-alfa
Browse files Browse the repository at this point in the history
  • Loading branch information
robert7 committed Jul 13, 2018
2 parents e45c3bf + d029fe2 commit 5c82cb7
Show file tree
Hide file tree
Showing 41 changed files with 524 additions and 548 deletions.
2 changes: 0 additions & 2 deletions NixNote2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ SOURCES += \
dialog/aboutdialog.cpp \
xml/importenex.cpp \
xml/exportdata.cpp \
dialog/logviewer.cpp \
dialog/htmlentitiesdialog.cpp \
qevercloud/exceptions.cpp \
qevercloud/http.cpp \
Expand Down Expand Up @@ -369,7 +368,6 @@ HEADERS += \
dialog/aboutdialog.h \
xml/importenex.h \
xml/exportdata.h \
dialog/logviewer.h \
dialog/htmlentitiesdialog.h \
qevercloud/exceptions.h \
qevercloud/globals.h \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ is needed. The created binary image should work on all ~recent distributions (at
in theory).
Basic docker familiarity with docker is probably quite helpful.

More info in: [DOCKER README](DOCKER-README.md)
More info in: [DOCKER README](docs/DOCKER-README.md)

### Linux - manual build
* Install development dependencies - look in content of [this docker file](development/docker/Dockerfile.ubuntu_xenial)
Expand Down
6 changes: 4 additions & 2 deletions cmdtools/cmdlinetool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ int CmdLineTool::addNote(StartupConfig config) {


EnmlFormatter formatter(config.newNote->content);
config.newNote->content = formatter.rebuildNoteEnml();
formatter.rebuildNoteEnml();
config.newNote->content = formatter.getContent();

bool expectResponse = true;

Expand Down Expand Up @@ -490,7 +491,8 @@ int CmdLineTool::appendNote(StartupConfig config) {


EnmlFormatter formatter(config.newNote->content);
config.newNote->content = formatter.rebuildNoteEnml();
formatter.rebuildNoteEnml();
config.newNote->content = formatter.getContent();

bool expectResponse = true;

Expand Down
104 changes: 0 additions & 104 deletions dialog/logviewer.cpp

This file was deleted.

51 changes: 0 additions & 51 deletions dialog/logviewer.h

This file was deleted.

4 changes: 4 additions & 0 deletions dialog/tabledialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ TableDialog::TableDialog(QWidget *parent) :

rows.setMinimum(1);
rows.setMaximum(30);
rows.setValue(2);

cols.setMinimum(1);
cols.setMaximum(30);
cols.setValue(2);



connect(&unit, SIGNAL(activated(int)), this, SLOT(unitChanged()));
Expand Down
11 changes: 9 additions & 2 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# CHANGELOG

## 2018-07
### #10
* Simplified content of the Help menu. Removed unrelevant items. "Message Log Info" now shows
log file location & instructions.
* Further stabilisation of html cleanup.
* Duplicate note will now mark note as "- copy".
* Added "Simplify html" to clean html garbage e.g. after paste from some web page.
So far only very experimental version. Discards images. Will be improved later.

### #9
* Added **docker build**. Creating binaries ouf of source is now very straightforward.
* Improved reporting and logging of errors (mainly for sync errors). The messages may be now
Expand Down Expand Up @@ -84,8 +92,7 @@
* [Preview](https://www.dropbox.com/sh/62lnikzyf4r0sa2/AADMk-EHBwvBt7G5bOga9tyia?dl=0&preview=RS-3-search-sort-relevance.png)

### #2
* Some note editing and toolbar tweeks (color picker has now restricted list of color; but does'nt really
work correctly yet)
* Some note editing and toolbar tweeks (color picker has now restricted list of colors).

### #1
* Merged master to development
Expand Down
7 changes: 4 additions & 3 deletions DOCKER-README.md → docs/DOCKER-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ rm -rf appdir; mkdir appdir
docker run -v $PROJECTDIR/appdir:/opt/nixnote2/appdir -it nixnote2/xenial /bin/bash

# checkout right branch/pull
cd nixnote2 && git checkout master && git pull
cd nixnote2 && git fetch && git checkout master && git pull
# compile (debug mode)
./development/build-with-qmake.sh /usr debug && ./development/create-AppImage.sh && mv *.AppImage appdir
./development/build-with-qmake.sh /usr debug && ./development/create-AppImage.sh && mv *.AppImage appdir && chmod -R a+rwx appdir
# now terminate session (Ctrl-D), to return to host

ls appdir/*.AppImage # => this one file is your result binary
```

```bash
# more advanced combination with container reuse (after image has been build)
docker run --name nixnote2_xenial -it nixnote2/xenial /bin/bash
docker run --name nixnote2_xenial -v $PROJECTDIR/appdir:/opt/nixnote2/appdir -it nixnote2/xenial /bin/bash

... compile or whatever...

# from other terminal session at host:
Expand Down
13 changes: 2 additions & 11 deletions docs/TODO.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# TODO / Roadmap
## 1

* scratchpad potom "veci na cestu"
ASSERT failure in QList<T>::operator[]: "index out of range", file ../Qt/5.5/gcc_64/include/QtCore/qlist.h, line 518
fish: “./NixNote-2.1.0-alfa8-x86_64.Ap…” terminated by signal SIGABRT (Abort)

* Modify ini file groups for v2.1
* Docker build with ubuntu 14.04 (to support older systems)
* Improve html cleanup
* Better statusbar display on exceptions (shortcuts / 2 part status bar)
* Add release notes dialog
* Change "Message Log" for info box with paths

* Improve html cleanup (in case of further sync problems)
* Add "simplify html"
* Update to Qt 5.11
* Copying images from to note/note seems to destroy the note
Expand All @@ -30,4 +20,5 @@
* Optional removal of diacritics before search and index - currently mixing words with
diacritics and without doesn't work at all
* Improve display with thumbnails
* Maybe: docker build with ubuntu 14.04 (to support older systems)

6 changes: 3 additions & 3 deletions filters/filterengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void FilterEngine::filter(FilterCriteria *newCriteria, QList <qint32> *results)

FilterCriteria *criteria = newCriteria;
if (criteria == nullptr)
criteria = global.filterCriteria[global.filterPosition];
criteria = global.getCurrentCriteria();
else
internalSearch = false;

Expand Down Expand Up @@ -215,7 +215,7 @@ void FilterEngine::filter(FilterCriteria *newCriteria, QList <qint32> *results)
if (internalSearch) {
// Remove any selected notes that are not in the filter.
if (global.filterCriteria.size() > 0) {
FilterCriteria *criteria = global.filterCriteria[global.filterPosition];
FilterCriteria *criteria = global.getCurrentCriteria();
QList <qint32> selectedLids;
criteria->getSelectedNotes(selectedLids);
for (int i = selectedLids.size() - 1; i >= 0; i--) {
Expand Down Expand Up @@ -612,7 +612,7 @@ void FilterEngine::filterNotebook(FilterCriteria *criteria) {
QString stackName = criteria->getNotebook()->text(0);
filterStack(stackName);
} else {
FilterCriteria *criteria = global.filterCriteria[global.filterPosition];
FilterCriteria *criteria = global.getCurrentCriteria();
qint32 notebookLid = criteria->getNotebook()->data(0,Qt::UserRole).toInt();
NotebookTable notebookTable(global.db);
QString notebook;
Expand Down
17 changes: 15 additions & 2 deletions global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,9 @@ void Global::setup(StartupConfig startupConfig, bool guiAvailable) {
settings->beginGroup(INI_GROUP_APPEARANCE);
QString theme = settings->value("themeName", "").toString();
loadTheme(resourceList, colorList, theme);
autoHideEditorToolbar = settings->value("autoHideEditorToolbar", true).toBool();
// note auto-hide doesn't really work well - there are problems with menu appearing when you try
// to select text
autoHideEditorToolbar = settings->value("autoHideEditorToolbar", false).toBool();
settings->endGroup();

minIndexInterval = 5000;
Expand Down Expand Up @@ -301,7 +303,9 @@ QString Global::tagBehavior() {
}


// Append the filter criteria to the filterCriteria queue.
/**
* Append the filter criteria to the filterCriteria queue and adjust filter position.
*/
void Global::appendFilter(FilterCriteria *criteria) {
// First, find out if we're already viewing history. If we are, we
// chop off the end of the history & start a new one
Expand Down Expand Up @@ -1506,3 +1510,12 @@ void Global::setMessage(QString msg, int timeout) {
// sent "setMessage" signal
emit setMessageSignal(msg, timeout);
}

/**
* @return Current filter criteria.
*/
FilterCriteria *Global::getCurrentCriteria() const {
qint32 pos = global.filterPosition;
//QLOG_DEBUG() << "Requesting filter [" << pos << "], count=" << global.filterCriteria.size();
return global.filterCriteria[pos];
}
6 changes: 5 additions & 1 deletion global.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ class IndexRunner;
#define NN_DB_CONNECTION_NAME "nixnote"

// as the upstream is currently defunct main page is the fork
#define NN_GITHUB_PAGE "https://www.github.com/robert7/nixnote2"
#define NN_MAIN_REPO_USER "robert7"
#define NN_MAIN_REPO_NAME "nixnote2"

#define INI_GROUP_APPEARANCE "Appearance"
#define INI_GROUP_COL_HIDDEN_WIDE "ColumnHidden-Wide"
Expand All @@ -140,6 +141,7 @@ class IndexRunner;
#define INI_GROUP_COL_POS_NARROW "ColumnPosition-Narrow"
#define INI_GROUP_COL_WIDTH_NARROW "ColumnWidth-Narrow"
#define INI_GROUP_SAVE_STATE "SaveState"

#define INI_GROUP_DEBUGGING "Debugging"
#define INI_GROUP_SYNC "Sync"
#define INI_GROUP_LOCALE "Locale"
Expand Down Expand Up @@ -415,6 +417,8 @@ class Global : public QObject {
int getAccountId() { return accountId; };
void setAccountId(int accountId) {this->accountId = accountId; };

FilterCriteria* getCurrentCriteria() const;

signals:
// global can send signal about updating status bar
void setMessageSignal(QString msg, int timeout);
Expand Down
2 changes: 1 addition & 1 deletion gui/favoritesview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void FavoritesView::buildSelection() {
void FavoritesView::updateSelection() {
blockSignals(true);

FilterCriteria *criteria = global.filterCriteria[global.filterPosition];
FilterCriteria *criteria = global.getCurrentCriteria();
if (global.filterPosition != filterPosition) {
QList<QTreeWidgetItem*> selectedItems = this->selectedItems();
for (int i=0; i<selectedItems.size(); i++) {
Expand Down
Loading

0 comments on commit 5c82cb7

Please sign in to comment.