]> gitweb.hamatoma.de Git - reqt/commitdiff
reditor renamed to reide
authorhama <hama@siduction.net>
Sun, 30 Aug 2015 18:32:04 +0000 (20:32 +0200)
committerhama <hama@siduction.net>
Sun, 30 Aug 2015 18:32:04 +0000 (20:32 +0200)
72 files changed:
appl/reditor/editor.qrc [deleted file]
appl/reditor/icons/action_go.png [deleted file]
appl/reditor/icons/action_paste.png [deleted file]
appl/reditor/icons/arrow_turn_left.png [deleted file]
appl/reditor/icons/bullet_go.png [deleted file]
appl/reditor/icons/cog_edit.png [deleted file]
appl/reditor/icons/database_save.png [deleted file]
appl/reditor/icons/disk.png [deleted file]
appl/reditor/icons/door_in.png [deleted file]
appl/reditor/icons/eye.png [deleted file]
appl/reditor/icons/folder.png [deleted file]
appl/reditor/icons/folder_find.png [deleted file]
appl/reditor/icons/folder_go.png [deleted file]
appl/reditor/icons/folder_magnify.png [deleted file]
appl/reditor/icons/folder_page.png [deleted file]
appl/reditor/icons/layout_add.png [deleted file]
appl/reditor/icons/paste_plain.png [deleted file]
appl/reditor/icons/resultset_next.png [deleted file]
appl/reditor/icons/sitemap_color.png [deleted file]
appl/reditor/icons/table.png [deleted file]
appl/reditor/icons/tables.png [deleted file]
appl/reditor/icons/wand.png [deleted file]
appl/reditor/icons/wrench.png [deleted file]
appl/reditor/main.cpp [deleted file]
appl/reditor/mainwindow.cpp [deleted file]
appl/reditor/mainwindow.hpp [deleted file]
appl/reditor/mainwindow.ui [deleted file]
appl/reditor/project.cpp [deleted file]
appl/reditor/project.hpp [deleted file]
appl/reditor/projectselection.cpp [deleted file]
appl/reditor/projectselection.hpp [deleted file]
appl/reditor/projectselection.ui [deleted file]
appl/reditor/reditor.hpp [deleted file]
appl/reditor/reditor.pro [deleted file]
appl/reditor/workspace.cpp [deleted file]
appl/reditor/workspace.hpp [deleted file]
appl/reide/editor.qrc [new file with mode: 0644]
appl/reide/icons/action_go.png [new file with mode: 0755]
appl/reide/icons/action_paste.png [new file with mode: 0755]
appl/reide/icons/arrow_turn_left.png [new file with mode: 0644]
appl/reide/icons/bullet_go.png [new file with mode: 0644]
appl/reide/icons/cog_edit.png [new file with mode: 0644]
appl/reide/icons/database_save.png [new file with mode: 0644]
appl/reide/icons/disk.png [new file with mode: 0644]
appl/reide/icons/door_in.png [new file with mode: 0644]
appl/reide/icons/eye.png [new file with mode: 0644]
appl/reide/icons/folder.png [new file with mode: 0644]
appl/reide/icons/folder_find.png [new file with mode: 0644]
appl/reide/icons/folder_go.png [new file with mode: 0644]
appl/reide/icons/folder_magnify.png [new file with mode: 0644]
appl/reide/icons/folder_page.png [new file with mode: 0644]
appl/reide/icons/layout_add.png [new file with mode: 0644]
appl/reide/icons/paste_plain.png [new file with mode: 0644]
appl/reide/icons/resultset_next.png [new file with mode: 0644]
appl/reide/icons/sitemap_color.png [new file with mode: 0644]
appl/reide/icons/table.png [new file with mode: 0755]
appl/reide/icons/tables.png [new file with mode: 0755]
appl/reide/icons/wand.png [new file with mode: 0644]
appl/reide/icons/wrench.png [new file with mode: 0644]
appl/reide/main.cpp [new file with mode: 0644]
appl/reide/mainwindow.cpp [new file with mode: 0644]
appl/reide/mainwindow.hpp [new file with mode: 0644]
appl/reide/mainwindow.ui [new file with mode: 0644]
appl/reide/project.cpp [new file with mode: 0644]
appl/reide/project.hpp [new file with mode: 0644]
appl/reide/projectselection.cpp [new file with mode: 0644]
appl/reide/projectselection.hpp [new file with mode: 0644]
appl/reide/projectselection.ui [new file with mode: 0644]
appl/reide/reditor.hpp [new file with mode: 0644]
appl/reide/reide.pro [new file with mode: 0644]
appl/reide/workspace.cpp [new file with mode: 0644]
appl/reide/workspace.hpp [new file with mode: 0644]

diff --git a/appl/reditor/editor.qrc b/appl/reditor/editor.qrc
deleted file mode 100644 (file)
index 3ec8152..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<RCC>
-    <qresource prefix="/main">
-        <file>icons/action_go.png</file>
-        <file>icons/action_paste.png</file>
-        <file>icons/arrow_turn_left.png</file>
-        <file>icons/bullet_go.png</file>
-        <file>icons/cog_edit.png</file>
-        <file>icons/database_save.png</file>
-        <file>icons/disk.png</file>
-        <file>icons/door_in.png</file>
-        <file>icons/eye.png</file>
-        <file>icons/folder_find.png</file>
-        <file>icons/folder_go.png</file>
-        <file>icons/folder_magnify.png</file>
-        <file>icons/folder.png</file>
-        <file>icons/layout_add.png</file>
-        <file>icons/paste_plain.png</file>
-        <file>icons/resultset_next.png</file>
-        <file>icons/sitemap_color.png</file>
-        <file>icons/table.png</file>
-        <file>icons/tables.png</file>
-        <file>icons/wand.png</file>
-        <file>icons/wrench.png</file>
-        <file>icons/folder_page.png</file>
-    </qresource>
-</RCC>
diff --git a/appl/reditor/icons/action_go.png b/appl/reditor/icons/action_go.png
deleted file mode 100755 (executable)
index ef5bfc3..0000000
Binary files a/appl/reditor/icons/action_go.png and /dev/null differ
diff --git a/appl/reditor/icons/action_paste.png b/appl/reditor/icons/action_paste.png
deleted file mode 100755 (executable)
index 60f7841..0000000
Binary files a/appl/reditor/icons/action_paste.png and /dev/null differ
diff --git a/appl/reditor/icons/arrow_turn_left.png b/appl/reditor/icons/arrow_turn_left.png
deleted file mode 100644 (file)
index a3d6c9e..0000000
Binary files a/appl/reditor/icons/arrow_turn_left.png and /dev/null differ
diff --git a/appl/reditor/icons/bullet_go.png b/appl/reditor/icons/bullet_go.png
deleted file mode 100644 (file)
index bc4faa7..0000000
Binary files a/appl/reditor/icons/bullet_go.png and /dev/null differ
diff --git a/appl/reditor/icons/cog_edit.png b/appl/reditor/icons/cog_edit.png
deleted file mode 100644 (file)
index 47b75a4..0000000
Binary files a/appl/reditor/icons/cog_edit.png and /dev/null differ
diff --git a/appl/reditor/icons/database_save.png b/appl/reditor/icons/database_save.png
deleted file mode 100644 (file)
index 44c06dd..0000000
Binary files a/appl/reditor/icons/database_save.png and /dev/null differ
diff --git a/appl/reditor/icons/disk.png b/appl/reditor/icons/disk.png
deleted file mode 100644 (file)
index 99d532e..0000000
Binary files a/appl/reditor/icons/disk.png and /dev/null differ
diff --git a/appl/reditor/icons/door_in.png b/appl/reditor/icons/door_in.png
deleted file mode 100644 (file)
index 41676a0..0000000
Binary files a/appl/reditor/icons/door_in.png and /dev/null differ
diff --git a/appl/reditor/icons/eye.png b/appl/reditor/icons/eye.png
deleted file mode 100644 (file)
index 564a1a9..0000000
Binary files a/appl/reditor/icons/eye.png and /dev/null differ
diff --git a/appl/reditor/icons/folder.png b/appl/reditor/icons/folder.png
deleted file mode 100644 (file)
index 784e8fa..0000000
Binary files a/appl/reditor/icons/folder.png and /dev/null differ
diff --git a/appl/reditor/icons/folder_find.png b/appl/reditor/icons/folder_find.png
deleted file mode 100644 (file)
index c64e2ee..0000000
Binary files a/appl/reditor/icons/folder_find.png and /dev/null differ
diff --git a/appl/reditor/icons/folder_go.png b/appl/reditor/icons/folder_go.png
deleted file mode 100644 (file)
index 34a736f..0000000
Binary files a/appl/reditor/icons/folder_go.png and /dev/null differ
diff --git a/appl/reditor/icons/folder_magnify.png b/appl/reditor/icons/folder_magnify.png
deleted file mode 100644 (file)
index 0a3e798..0000000
Binary files a/appl/reditor/icons/folder_magnify.png and /dev/null differ
diff --git a/appl/reditor/icons/folder_page.png b/appl/reditor/icons/folder_page.png
deleted file mode 100644 (file)
index 1ef6e11..0000000
Binary files a/appl/reditor/icons/folder_page.png and /dev/null differ
diff --git a/appl/reditor/icons/layout_add.png b/appl/reditor/icons/layout_add.png
deleted file mode 100644 (file)
index 6203722..0000000
Binary files a/appl/reditor/icons/layout_add.png and /dev/null differ
diff --git a/appl/reditor/icons/paste_plain.png b/appl/reditor/icons/paste_plain.png
deleted file mode 100644 (file)
index c0490eb..0000000
Binary files a/appl/reditor/icons/paste_plain.png and /dev/null differ
diff --git a/appl/reditor/icons/resultset_next.png b/appl/reditor/icons/resultset_next.png
deleted file mode 100644 (file)
index e252606..0000000
Binary files a/appl/reditor/icons/resultset_next.png and /dev/null differ
diff --git a/appl/reditor/icons/sitemap_color.png b/appl/reditor/icons/sitemap_color.png
deleted file mode 100644 (file)
index c64582b..0000000
Binary files a/appl/reditor/icons/sitemap_color.png and /dev/null differ
diff --git a/appl/reditor/icons/table.png b/appl/reditor/icons/table.png
deleted file mode 100755 (executable)
index 6f794bc..0000000
Binary files a/appl/reditor/icons/table.png and /dev/null differ
diff --git a/appl/reditor/icons/tables.png b/appl/reditor/icons/tables.png
deleted file mode 100755 (executable)
index e88ceb5..0000000
Binary files a/appl/reditor/icons/tables.png and /dev/null differ
diff --git a/appl/reditor/icons/wand.png b/appl/reditor/icons/wand.png
deleted file mode 100644 (file)
index 44ccbf8..0000000
Binary files a/appl/reditor/icons/wand.png and /dev/null differ
diff --git a/appl/reditor/icons/wrench.png b/appl/reditor/icons/wrench.png
deleted file mode 100644 (file)
index 5c8213f..0000000
Binary files a/appl/reditor/icons/wrench.png and /dev/null differ
diff --git a/appl/reditor/main.cpp b/appl/reditor/main.cpp
deleted file mode 100644 (file)
index e11e665..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * main.cpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-#include "reditor.hpp"
-#include <QApplication>
-
-int main(int argc, char *argv[]) {
-       const char* workspace = NULL;
-       const char* project = NULL;
-       for (int ix = 1; ix < argc; ix++) {
-               if (argv[ix][0] == '-') {
-                       if (strcmp(argv[ix], "-w") == 0 && ix < argc - 1) {
-                               workspace = argv[++ix];
-                       } else if (strncmp(argv[ix], "--workspace=", 12) == 0) {
-                               workspace = argv[ix] + 12;
-                       } else if (strcmp(argv[ix], "-p") == 0 && ix < argc - 1) {
-                               project = argv[++ix];
-                       } else if (strncmp(argv[ix], "--project=", 10) == 0) {
-                               workspace = argv[ix] + 10;
-                       }
-               }
-       }
-       QApplication a(argc, argv);
-       ReLogger logger;
-       ReDebugAppender appender;
-       appender.setAutoDelete(false);
-       logger.addAppender(&appender);
-       MainWindow w(workspace, project, &logger);
-       logger.log(LOG_INFO, 1, "start");
-       w.show();
-
-       return a.exec();
-}
diff --git a/appl/reditor/mainwindow.cpp b/appl/reditor/mainwindow.cpp
deleted file mode 100644 (file)
index 17e4bda..0000000
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * mainwindow.cpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#include "reditor.hpp"
-#include "ui_mainwindow.h"
-#include <QFileDialog>
-
-MainWindow::MainWindow(const char* workspace, const char* project,
-    ReLogger* logger, QWidget *parent) :
-           QMainWindow(parent),
-           ui(new Ui::MainWindow),
-           m_project(NULL),
-           m_workspace(NULL),
-           m_logger(logger),
-           m_fileTree(NULL),
-           m_dockProjectTree(NULL) {
-       if (workspace == NULL)
-               workspace = QDir::homePath().toUtf8();
-       changeWorkspace(workspace == NULL ? QDir::homePath() : workspace);
-
-       QString proj(project == NULL ? "" : project);
-       if (project == NULL) {
-               QStringList lastProjects;
-               m_workspace->historyAsList("projects", lastProjects);
-               int ix = 0;
-               while (proj.isEmpty() && ix < lastProjects.size()) {
-                       QFileInfo dir(lastProjects.at(ix));
-                       if (dir.isDir() && dir.isWritable())
-                               proj = lastProjects.at(ix);
-               }
-               if (!proj.isEmpty())
-                       changeProject(proj);
-       }
-
-       ui->setupUi(this);
-       ReEdit* edit = ui->widget;
-#if defined __linux__
-       m_file = new ReFile("/home/hm/editor.txt", false);
-#else
-       m_file = new ReFile("U:\\ws_cpp\\rplqt\\Doxyfile", false);
-#endif
-       edit->setLines(m_file);
-       edit->setCursorLine(0);
-       connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(open()));
-       open();
-}
-
-MainWindow::~MainWindow() {
-       delete ui;
-}
-
-/**
- * Change the current project.
- *
- * @param path the directory containing the project data
- */
-void MainWindow::changeProject(QString path) {
-       delete m_project;
-       if (path.endsWith(OS_SEPARATOR_STR))
-               path.remove(path.size() - 1, 1);
-       m_project = new Project(path, this);
-       int maxEntries = m_workspace->intValue("history.max_projects");
-       m_workspace->addHistoryEntry(Workspace::KEY_HISTORY_PROJECTS, path, ';',
-           maxEntries);
-       if (m_fileTree == NULL) {
-               m_fileTree = new ReFileTree(path, m_logger, this);
-               m_dockProjectTree = new QDockWidget("", this);
-               m_dockProjectTree->setWidget(m_fileTree);
-               addDockWidget(Qt::LeftDockWidgetArea, m_dockProjectTree);
-       }
-       m_fileTree->setPath(path);
-       m_dockProjectTree->setWindowTitle(
-           tr("Project") + " " + ReQStringUtils::nodeOf(path));
-
-}
-
-/**
- * Change the workspace.
- *
- * @param path the directory containing the workspace data
- */
-void MainWindow::changeWorkspace(const QString& path) {
-       delete m_workspace;
-       m_workspace = new Workspace(path, m_logger);
-}
-
-/**
- * Calls the file selection dialog.
- */
-void MainWindow::openFile(const QString& name) {
-       m_file = new ReFile(name, false);
-
-       ReEdit* edit = ui->widget;
-       edit->setLines(m_file);
-       edit->setCursorLine(0);
-       int maxEntries = m_workspace->intValue("history.max_files");
-       m_workspace->addHistoryEntry(Workspace::KEY_HISTORY_FILES, name, ';',
-           maxEntries);
-}
-
-/**
- * Closes the current project.
- */
-void MainWindow::closeProject() {
-       delete m_project;
-       m_project = NULL;
-}
-
-/**
- * Shows the "open project/file dialog".
- */
-void MainWindow::open() {
-       ProjectSelection dialog(this);
-       dialog.exec();
-}
-ReLogger* MainWindow::logger() const {
-       return m_logger;
-}
-
-/**
- * Returns the current workspace.
- *
- * @return the current workspace
- */
-Project* MainWindow::project() const {
-       return m_project;
-}
-
-Workspace* MainWindow::workspace() const {
-       return m_workspace;
-}
-
diff --git a/appl/reditor/mainwindow.hpp b/appl/reditor/mainwindow.hpp
deleted file mode 100644 (file)
index d80c6f9..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * mainwindow.hpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#ifndef MAINWINDOW_HPP
-#define MAINWINDOW_HPP
-
-#include <QMainWindow>
-#ifndef REBASE_HPP
-#include "reditor.hpp"
-#endif
-namespace Ui {
-class MainWindow;
-}
-
-class MainWindow: public QMainWindow {
-       Q_OBJECT
-
-public:
-       explicit MainWindow(const char* workspace, const char* project,
-           ReLogger* logger, QWidget *parent = 0);
-       ~MainWindow();
-       void changeProject(QString path);
-       void changeWorkspace(const QString& path);
-       void closeProject();
-       void openFile(const QString& name);
-       Project* project() const;
-       Workspace* workspace() const;
-       ReLogger* logger() const;
-
-public slots:
-       void open();
-private:
-       Ui::MainWindow *ui;
-       ReFile* m_file;
-       Project* m_project;
-       Workspace* m_workspace;
-       ReLogger* m_logger;
-       ReFileTree* m_fileTree;
-       QDockWidget* m_dockProjectTree;
-};
-
-#endif // MAINWINDOW_HPP
diff --git a/appl/reditor/mainwindow.ui b/appl/reditor/mainwindow.ui
deleted file mode 100644 (file)
index cad587b..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>803</width>
-    <height>642</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>MainWindow</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <widget class="ReEdit" name="widget" native="true"/>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menuBar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>803</width>
-     <height>23</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QToolBar" name="mainToolBar">
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionOpen"/>
-   <addaction name="actionSave"/>
-  </widget>
-  <widget class="QStatusBar" name="statusBar"/>
-  <widget class="QToolBar" name="toolBar">
-   <property name="windowTitle">
-    <string>toolBar</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <action name="actionOpen">
-   <property name="icon">
-    <iconset resource="editor.qrc">
-     <normaloff>:/main/icons/table.png</normaloff>:/main/icons/table.png</iconset>
-   </property>
-   <property name="text">
-    <string>Open</string>
-   </property>
-   <property name="toolTip">
-    <string>Open a file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="actionSave">
-   <property name="icon">
-    <iconset resource="editor.qrc">
-     <normaloff>:/main/icons/disk.png</normaloff>:/main/icons/disk.png</iconset>
-   </property>
-   <property name="text">
-    <string>Save</string>
-   </property>
-   <property name="toolTip">
-    <string>Save the file</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+S</string>
-   </property>
-  </action>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <customwidgets>
-  <customwidget>
-   <class>ReEdit</class>
-   <extends>QWidget</extends>
-   <header>gui/regui.hpp</header>
-   <container>1</container>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="editor.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/appl/reditor/project.cpp b/appl/reditor/project.cpp
deleted file mode 100644 (file)
index ffda4ee..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * project.cpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#include "reditor.hpp"
-
-const char* Project::KEY_HISTORY_OPEN_FILES = "openFiles";
-/**
- * Constructor.
- *
- * @param path         the directory containing the configuration
- * @param logger       the logger
- */
-Project::Project(const QString& path, MainWindow* mainWindow) :
-           ReSettings(path, ".reditor.proj", mainWindow->logger()),
-           m_mainWindow(mainWindow) {
-       QString filename = topOfHistory(KEY_HISTORY_OPEN_FILES);
-       QFileInfo info(filename);
-       if (!filename.isEmpty() && info.exists() && !info.isDir()) {
-               m_mainWindow->openFile(filename);
-       }
-}
-
-/**
- * Opens a file in the project directory.
- *
- * @param filename     the filename relative to the project directory
- */
-void Project::openFile(const QString& filename) {
-       QString full = m_path + OS_SEPARATOR_STR + filename;
-       addHistoryEntry(KEY_HISTORY_OPEN_FILES, filename, ';', 1);
-       m_mainWindow->openFile(full);
-}
-
diff --git a/appl/reditor/project.hpp b/appl/reditor/project.hpp
deleted file mode 100644 (file)
index dc0b267..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * project.hpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#ifndef PROJECT_HPP
-#define PROJECT_HPP
-
-class MainWindow;
-
-class Project: public ReSettings {
-public:
-       static const char* KEY_HISTORY_OPEN_FILES;
-public:
-       Project(const QString& path, MainWindow* mainWindow);
-public:
-       void openFile(const QString& filename);
-
-private:
-       MainWindow* m_mainWindow;
-};
-
-#endif // PROJECT_HPP
diff --git a/appl/reditor/projectselection.cpp b/appl/reditor/projectselection.cpp
deleted file mode 100644 (file)
index 1d7fd72..0000000
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * projectselection.cpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#include "reditor.hpp"
-#include "ui_projectselection.h"
-#include <QFileDialog>
-#include <QMessageBox>
-
-/**
- * Constructor.
- *
- * @param parent               NULL or the parent
- * @param mainWindow   the main window
- */
-ProjectSelection::ProjectSelection(MainWindow* mainWindow, QWidget *parent) :
-           QDialog(parent),
-           ui(new Ui::ProjectSelection),
-           m_mainWindow(mainWindow) {
-       ui->setupUi(this);
-       connect(ui->toolButtonSelectFile, SIGNAL(clicked()), this,
-           SLOT(selectFile()));
-       connect(ui->toolButtonSelectProject, SIGNAL(clicked()), this,
-           SLOT(selectDir()));
-       connect(ui->pushButtonOpen, SIGNAL(clicked()), this, SLOT(open()));
-       connect(ui->lineEditFilterLastFile, SIGNAL(textChanged(QString)), this,
-           SLOT(textChangedFilterFiles(QString)));
-       connect(ui->tableWidgetFiles, SIGNAL(cellEntered(int,int)), this,
-               SLOT(cellEnteredFiles(int, int)));
-       connect(ui->tableWidgetProjects, SIGNAL(cellEntered(int,int)), this,
-               SLOT(cellEnteredProjects(int, int)));
-       Workspace* workspace = mainWindow->workspace();
-       buildTableInfo(workspace, Workspace::KEY_HISTORY_FILES, true, m_files);
-       buildTableInfo(workspace, Workspace::KEY_HISTORY_PROJECTS, false,
-           m_projects);
-       buildTable("", m_files, ui->tableWidgetFiles);
-       buildTable("", m_projects, ui->tableWidgetProjects);
-}
-
-/**
- * Destructor.
- */
-ProjectSelection::~ProjectSelection() {
-       delete ui;
-}
-/**
- * Handles the event cellEntered for the last opened files.
- *
- * @param row  the row of the entered cell
- * @param col  the column of the entered cell
- */
-void ProjectSelection::cellEnteredFiles(int row, int col) {
-       ReUseParameter(col);
-       QString file = fileOfTable(ui->tableWidgetFiles, row);
-       ui->lineEditOpen->setText(file);
-}
-
-/**
- * Handles the event cellEntered for the last opened projects.
- *
- * @param row  the row of the entered cell
- * @param col  the column of the entered cell
- */
-void ProjectSelection::cellEnteredProjects(int row, int col) {
-       ReUseParameter(col);
-       QString file = fileOfTable(ui->tableWidgetProjects, row);
-       ui->lineEditOpen->setText(file);
-}
-
-/**
- * Builds the table from the table using a filter expression.
- *
- * @param filter       a filter expression with wildcards '*'
- * @param lines                the full table info
- * @param table                OUT: will be filled with all lines matching the filter
- */
-void ProjectSelection::buildTable(const QString& filter,
-    const QStringList& lines, QTableWidget* table) {
-       QStringList::const_iterator it;
-       int rowCount = 0;
-       ReMatcher matcher(filter, Qt::CaseInsensitive, true);
-       for (it = lines.cbegin(); it != lines.cend(); ++it) {
-               if (matcher.matches(*it))
-                       rowCount++;
-       }
-       table->setRowCount(rowCount);
-       int row = -1;
-       for (it = lines.cbegin(); it != lines.cend(); ++it) {
-               if (matcher.matches(*it)) {
-                       row++;
-                       QStringList cols = it->split('\t');
-                       for (int col = 0; col < cols.size(); col++) {
-                               QTableWidgetItem* item = table->item(row, col);
-                               if (item != NULL)
-                                       item->setText(cols.at(col));
-                               else {
-                                       item = new QTableWidgetItem(cols.at(col));
-                                       table->setItem(row, col, item);
-                               }
-                       }
-               }
-       }
-}
-
-/**
- * Build the info for a table (last opened files or last opened projects).
- *
- * Note: the table shows a filtered part of this info.
- *
- * @param settings             the history container
- * @param key                  the name of the history entry
- * @param withDate             the file's name is part of the info
- * @param tableContent OUT: the list containing the table info
- */
-void ProjectSelection::buildTableInfo(ReSettings* settings, const char* key,
-    bool withDate, QStringList& tableContent) {
-       QStringList files;
-       settings->historyAsList(key, files);
-       QStringList::const_iterator it;
-       for (it = files.cbegin(); it != files.cend(); ++it) {
-               QFileInfo file(*it);
-               if (file.exists()) {
-                       QString info = file.baseName();
-                       if (withDate)
-                               info.append("\t").append(
-                                   file.lastModified().toString("yyyy.mm.dd/HH:MM:SS"));
-                       info.append("\t").append(file.path());
-                       tableContent.append(info);
-               }
-       }
-}
-
-/**
- * Shows an error message.
- *
- * @param message      message to show
- */
-void ProjectSelection::error(const QString& message) {
-       QMessageBox dialog(QMessageBox::Critical, "Error", message,
-           QMessageBox::Close);
-       dialog.exec();
-}
-
-/**
- * Extracts the full filename of a given table.
- *
- * The node is the first column, the path the last.
- *
- * @param table        the table from which the filename is taken
- * @param row  the row where the filename is
- * @return     the full name of the file in the given row
- */
-QString ProjectSelection::fileOfTable(QTableWidget* table, int row) {
-       int colPath = table->columnCount() - 1;
-       QString file = table->item(row, colPath)->text() + OS_SEPARATOR_STR
-           + table->item(row, 0)->text();
-       return file;
-}
-/**
- * Opens a file or a directory (project directory).
- */
-void ProjectSelection::open() {
-       QString name = ui->lineEditOpen->text();
-       if (name.isEmpty())
-               error("missing filename/project directory");
-       else {
-               QFileInfo file(name);
-               if (!file.exists())
-                       error("does not exists: " + name);
-               else {
-                       if (file.isDir())
-                               m_mainWindow->changeProject(name);
-                       else
-                               m_mainWindow->openFile(name);
-                       close();
-               }
-       }
-}
-
-/**
- * Selects a directory (project directory) with an open dialog.
- */
-void ProjectSelection::selectDir() {
-       QString name = ui->lineEditOpen->text();
-       if (name.isEmpty() && m_mainWindow->project() != NULL)
-               name = m_mainWindow->project()->path();
-       name = QFileDialog::getExistingDirectory(this,
-           tr("Select Project Directory"), name);
-       if (!name.isEmpty()) {
-               ui->lineEditOpen->setText(name);
-               open();
-       }
-}
-
-/**
- * Selects a file with a file open dialog.
- */
-void ProjectSelection::selectFile() {
-       QString name = ui->lineEditOpen->text();
-       name = QFileDialog::getOpenFileName(this, tr("Select File"), name);
-       if (!name.isEmpty()) {
-               ui->lineEditOpen->setText(name);
-               open();
-       }
-}
-
-/**
- * Handles the filter text change for a given table.
- *
- * @param text the filter text
- * @param table        the table which will be filled
- * @param lines        the full (unfiltered) table info
- */
-void ProjectSelection::textChanged(const QString& text, QTableWidget* table,
-    const QStringList& lines) {
-       buildTable(text, lines, table);
-       if (table->rowCount() > 0) {
-               QString file = fileOfTable(table, 0);
-               ui->lineEditOpen->setText(file);
-       }
-}
-
-/**
- * Handles the event "text changed" of the last opened files.
- *
- * @param text the new text
- */
-void ProjectSelection::textChangedFilterFiles(const QString& text) {
-       textChanged(text, ui->tableWidgetFiles, m_files);
-}
-
-/**
- * Handles the event "text changed" of the last opened projects.
- *
- * @param text the new text
- */
-void ProjectSelection::textChangedFilterProjects(const QString& text) {
-       textChanged(text, ui->tableWidgetProjects, m_projects);
-}
diff --git a/appl/reditor/projectselection.hpp b/appl/reditor/projectselection.hpp
deleted file mode 100644 (file)
index ea17c30..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * projectselection.hpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#ifndef PROJECTSELECTION_HPP
-#define PROJECTSELECTION_HPP
-#include "reditor.hpp"
-#include <QDialog>
-#include <QTableWidget>
-namespace Ui {
-class ProjectSelection;
-}
-class MainWindow;
-class ProjectSelection: public QDialog {
-       Q_OBJECT
-
-public:
-       explicit ProjectSelection(MainWindow* mainWindow, QWidget *parent = 0);
-       ~ProjectSelection();
-
-public slots:
-       void open();
-       void selectDir();
-       void selectFile();
-protected:
-       void buildTable(const QString& filter, const QStringList& lines,
-           QTableWidget* table);
-       void buildTableInfo(ReSettings* settings, const char* key, bool withDate,
-           QStringList& tableContent);
-       QString fileOfTable(QTableWidget* table, int row);
-       void textChanged(const QString& text, QTableWidget* table,
-           const QStringList& lines);protected slots:
-       void cellEnteredFiles(int row, int col);
-       void cellEnteredProjects(int row, int col);
-       void textChangedFilterFiles(const QString& text);
-       void textChangedFilterProjects(const QString& text);
-private:
-       void error(const QString& message);
-private:
-       Ui::ProjectSelection *ui;
-       MainWindow* m_mainWindow;
-       QStringList m_files;
-       QStringList m_projects;
-};
-
-#endif // PROJECTSELECTION_HPP
diff --git a/appl/reditor/projectselection.ui b/appl/reditor/projectselection.ui
deleted file mode 100644 (file)
index 8b24b07..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>ProjectSelection</class>
- <widget class="QDialog" name="ProjectSelection">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1034</width>
-    <height>703</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Dialog</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_3">
-   <item>
-    <widget class="QGroupBox" name="groupBox">
-     <property name="maximumSize">
-      <size>
-       <width>16777215</width>
-       <height>75</height>
-      </size>
-     </property>
-     <property name="title">
-      <string>Open new file/project:</string>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_4">
-      <item>
-       <widget class="QLineEdit" name="lineEditOpen">
-        <property name="toolTip">
-         <string>Name of the file/project directory to open</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QPushButton" name="pushButtonOpen">
-        <property name="toolTip">
-         <string>Opens the file/project (Control-O)</string>
-        </property>
-        <property name="text">
-         <string>Open</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QToolButton" name="toolButtonSelectFile">
-        <property name="toolTip">
-         <string>Selects a file wit a file open dialog box (Control-Shift-F)</string>
-        </property>
-        <property name="text">
-         <string>...</string>
-        </property>
-        <property name="shortcut">
-         <string>Ctrl+Shift+F</string>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QToolButton" name="toolButtonSelectProject">
-        <property name="toolTip">
-         <string>Select a project directory with a directory open box (Control-Shift-P)</string>
-        </property>
-        <property name="text">
-         <string>...</string>
-        </property>
-        <property name="shortcut">
-         <string>Ctrl+Shift+P</string>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <widget class="QSplitter" name="splitter">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="handleWidth">
-      <number>3</number>
-     </property>
-     <widget class="QWidget" name="layoutWidget">
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <item>
-          <widget class="QLabel" name="label">
-           <property name="text">
-            <string>Last opened files:</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QLineEdit" name="lineEditFilterLastFile">
-           <property name="toolTip">
-            <string>Filter for last opened files.
-Use wildcards: '*' (any string) and '?' (any character)</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="QTableWidget" name="tableWidgetFiles">
-         <property name="mouseTracking">
-          <bool>true</bool>
-         </property>
-         <property name="editTriggers">
-          <set>QAbstractItemView::NoEditTriggers</set>
-         </property>
-         <property name="columnCount">
-          <number>3</number>
-         </property>
-         <attribute name="horizontalHeaderMinimumSectionSize">
-          <number>1</number>
-         </attribute>
-         <attribute name="horizontalHeaderStretchLastSection">
-          <bool>true</bool>
-         </attribute>
-         <column>
-          <property name="text">
-           <string>File</string>
-          </property>
-         </column>
-         <column>
-          <property name="text">
-           <string>Modified</string>
-          </property>
-         </column>
-         <column>
-          <property name="text">
-           <string>Directory</string>
-          </property>
-         </column>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_5" stretch=""/>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="layoutWidget">
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <widget class="QLabel" name="label_2">
-           <property name="text">
-            <string>Last opened projects:</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QLineEdit" name="lineEditFilterLastProjects">
-           <property name="toolTip">
-            <string>Filter for last opened projects.
-Use wildcards: '*' (any string) and '?' (any character)</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="QTableWidget" name="tableWidgetProjects">
-         <property name="mouseTracking">
-          <bool>true</bool>
-         </property>
-         <property name="columnCount">
-          <number>2</number>
-         </property>
-         <attribute name="horizontalHeaderStretchLastSection">
-          <bool>true</bool>
-         </attribute>
-         <attribute name="verticalHeaderStretchLastSection">
-          <bool>false</bool>
-         </attribute>
-         <column>
-          <property name="text">
-           <string>Name</string>
-          </property>
-         </column>
-         <column>
-          <property name="text">
-           <string>Parent</string>
-          </property>
-         </column>
-        </widget>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_7"/>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
diff --git a/appl/reditor/reditor.hpp b/appl/reditor/reditor.hpp
deleted file mode 100644 (file)
index e606072..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * reditor.hpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#ifndef REDITOR_HPP
-#define REDITOR_HPP
-#include <QDockWidget>
-#include "base/rebase.hpp"
-#include "gui/regui.hpp"
-#include "workspace.hpp"
-#include "project.hpp"
-#include "mainwindow.hpp"
-#include "projectselection.hpp"
-#endif // REDITOR_HPP
-
diff --git a/appl/reditor/reditor.pro b/appl/reditor/reditor.pro
deleted file mode 100644 (file)
index a47db11..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2015-06-03T20:56:48
-#
-#-------------------------------------------------
-
-QT       += core gui
-
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
-
-TARGET = ReEditor
-TEMPLATE = app
-
-INCLUDEPATH += ../..
-
-SOURCES += \
-        ../../gui/ReEdit.cpp \
-        ../../gui/ReStateStorage.cpp \
-        ../../gui/ReSettings.cpp \
-        ../../base/ReFile.cpp \
-        ../../gui/ReFileTree.cpp \
-       mainwindow.cpp \
-       ../../base/ReLogger.cpp \
-       ../../base/ReQStringUtils.cpp \
-       ../../base/ReFileUtils.cpp \
-       ../../base/ReException.cpp \
-       projectselection.cpp \
-       workspace.cpp \
-       project.cpp \
-       main.cpp
-
-
-HEADERS  += mainwindow.hpp \
-        ../../base/rebase.hpp \
-        ../../gui/regui.hpp \
-        ../../gui/ReEdit.hpp \
-       ../../base/ReStringUtils.hpp \
-       ../../base/ReQStringUtils.hpp \
-       ../../base/ReException.hpp \
-       projectselection.hpp \
-       workspace.hpp \
-       project.hpp \
-       reditor.hpp \
-       storage.hpp
-
-FORMS    += mainwindow.ui \
-       projectselection.ui
-
-RESOURCES += \
-        editor.qrc
diff --git a/appl/reditor/workspace.cpp b/appl/reditor/workspace.cpp
deleted file mode 100644 (file)
index 809c011..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * workspace.cpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#include "reditor.hpp"
-
-const char* Workspace::KEY_HISTORY_FILES = "files";
-const char* Workspace::KEY_HISTORY_PROJECTS = "projecs";
-
-/**
- * Constructor.
- *
- * @param path         the directory containing the configuration
- * @param logger       the logger
- */
-Workspace::Workspace(const QString& path, ReLogger* logger) :
-           ReSettings(path, ".reditor.ws", logger) {
-       insertProperty(
-           new ReProperty("editor.tabwidth", QObject::tr("Tabulator width"),
-               QObject::tr("Maximal length of the gap displaying a tabulator"),
-               "4", PT_INT, "[1,16]"));
-       insertProperty(
-           new ReProperty("history.max_projects",
-               QObject::tr("Maximal project entries"),
-               QObject::tr(
-                   "Maximal number of projects in the 'last opened projects'"),
-               "20", PT_INT, "[1,100]"));
-       insertProperty(
-           new ReProperty("history.max_files", QObject::tr("Maximal file entries"),
-               QObject::tr("Maximal number of files in the 'last opened files'"),
-               "20", PT_INT, "[1,100]"));
-}
-
diff --git a/appl/reditor/workspace.hpp b/appl/reditor/workspace.hpp
deleted file mode 100644 (file)
index 8776fed..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * workspace.hpp
- *
- * License: Public Domain
- * You can use and modify this file without any restriction.
- * Do what you want.
- * No warranties and disclaimer of any damages.
- * You also can use this license: http://www.wtfpl.net
- * The latest sources: https://github.com/republib
- */
-
-#ifndef WORKSPACE_HPP
-#define WORKSPACE_HPP
-
-class Workspace: public ReSettings {
-public:
-       static const char* KEY_HISTORY_FILES;
-       static const char* KEY_HISTORY_PROJECTS;
-public:
-       Workspace(const QString& path, ReLogger* logger);
-};
-
-#endif // WORKSPACE_HPP
diff --git a/appl/reide/editor.qrc b/appl/reide/editor.qrc
new file mode 100644 (file)
index 0000000..3ec8152
--- /dev/null
@@ -0,0 +1,26 @@
+<RCC>
+    <qresource prefix="/main">
+        <file>icons/action_go.png</file>
+        <file>icons/action_paste.png</file>
+        <file>icons/arrow_turn_left.png</file>
+        <file>icons/bullet_go.png</file>
+        <file>icons/cog_edit.png</file>
+        <file>icons/database_save.png</file>
+        <file>icons/disk.png</file>
+        <file>icons/door_in.png</file>
+        <file>icons/eye.png</file>
+        <file>icons/folder_find.png</file>
+        <file>icons/folder_go.png</file>
+        <file>icons/folder_magnify.png</file>
+        <file>icons/folder.png</file>
+        <file>icons/layout_add.png</file>
+        <file>icons/paste_plain.png</file>
+        <file>icons/resultset_next.png</file>
+        <file>icons/sitemap_color.png</file>
+        <file>icons/table.png</file>
+        <file>icons/tables.png</file>
+        <file>icons/wand.png</file>
+        <file>icons/wrench.png</file>
+        <file>icons/folder_page.png</file>
+    </qresource>
+</RCC>
diff --git a/appl/reide/icons/action_go.png b/appl/reide/icons/action_go.png
new file mode 100755 (executable)
index 0000000..ef5bfc3
Binary files /dev/null and b/appl/reide/icons/action_go.png differ
diff --git a/appl/reide/icons/action_paste.png b/appl/reide/icons/action_paste.png
new file mode 100755 (executable)
index 0000000..60f7841
Binary files /dev/null and b/appl/reide/icons/action_paste.png differ
diff --git a/appl/reide/icons/arrow_turn_left.png b/appl/reide/icons/arrow_turn_left.png
new file mode 100644 (file)
index 0000000..a3d6c9e
Binary files /dev/null and b/appl/reide/icons/arrow_turn_left.png differ
diff --git a/appl/reide/icons/bullet_go.png b/appl/reide/icons/bullet_go.png
new file mode 100644 (file)
index 0000000..bc4faa7
Binary files /dev/null and b/appl/reide/icons/bullet_go.png differ
diff --git a/appl/reide/icons/cog_edit.png b/appl/reide/icons/cog_edit.png
new file mode 100644 (file)
index 0000000..47b75a4
Binary files /dev/null and b/appl/reide/icons/cog_edit.png differ
diff --git a/appl/reide/icons/database_save.png b/appl/reide/icons/database_save.png
new file mode 100644 (file)
index 0000000..44c06dd
Binary files /dev/null and b/appl/reide/icons/database_save.png differ
diff --git a/appl/reide/icons/disk.png b/appl/reide/icons/disk.png
new file mode 100644 (file)
index 0000000..99d532e
Binary files /dev/null and b/appl/reide/icons/disk.png differ
diff --git a/appl/reide/icons/door_in.png b/appl/reide/icons/door_in.png
new file mode 100644 (file)
index 0000000..41676a0
Binary files /dev/null and b/appl/reide/icons/door_in.png differ
diff --git a/appl/reide/icons/eye.png b/appl/reide/icons/eye.png
new file mode 100644 (file)
index 0000000..564a1a9
Binary files /dev/null and b/appl/reide/icons/eye.png differ
diff --git a/appl/reide/icons/folder.png b/appl/reide/icons/folder.png
new file mode 100644 (file)
index 0000000..784e8fa
Binary files /dev/null and b/appl/reide/icons/folder.png differ
diff --git a/appl/reide/icons/folder_find.png b/appl/reide/icons/folder_find.png
new file mode 100644 (file)
index 0000000..c64e2ee
Binary files /dev/null and b/appl/reide/icons/folder_find.png differ
diff --git a/appl/reide/icons/folder_go.png b/appl/reide/icons/folder_go.png
new file mode 100644 (file)
index 0000000..34a736f
Binary files /dev/null and b/appl/reide/icons/folder_go.png differ
diff --git a/appl/reide/icons/folder_magnify.png b/appl/reide/icons/folder_magnify.png
new file mode 100644 (file)
index 0000000..0a3e798
Binary files /dev/null and b/appl/reide/icons/folder_magnify.png differ
diff --git a/appl/reide/icons/folder_page.png b/appl/reide/icons/folder_page.png
new file mode 100644 (file)
index 0000000..1ef6e11
Binary files /dev/null and b/appl/reide/icons/folder_page.png differ
diff --git a/appl/reide/icons/layout_add.png b/appl/reide/icons/layout_add.png
new file mode 100644 (file)
index 0000000..6203722
Binary files /dev/null and b/appl/reide/icons/layout_add.png differ
diff --git a/appl/reide/icons/paste_plain.png b/appl/reide/icons/paste_plain.png
new file mode 100644 (file)
index 0000000..c0490eb
Binary files /dev/null and b/appl/reide/icons/paste_plain.png differ
diff --git a/appl/reide/icons/resultset_next.png b/appl/reide/icons/resultset_next.png
new file mode 100644 (file)
index 0000000..e252606
Binary files /dev/null and b/appl/reide/icons/resultset_next.png differ
diff --git a/appl/reide/icons/sitemap_color.png b/appl/reide/icons/sitemap_color.png
new file mode 100644 (file)
index 0000000..c64582b
Binary files /dev/null and b/appl/reide/icons/sitemap_color.png differ
diff --git a/appl/reide/icons/table.png b/appl/reide/icons/table.png
new file mode 100755 (executable)
index 0000000..6f794bc
Binary files /dev/null and b/appl/reide/icons/table.png differ
diff --git a/appl/reide/icons/tables.png b/appl/reide/icons/tables.png
new file mode 100755 (executable)
index 0000000..e88ceb5
Binary files /dev/null and b/appl/reide/icons/tables.png differ
diff --git a/appl/reide/icons/wand.png b/appl/reide/icons/wand.png
new file mode 100644 (file)
index 0000000..44ccbf8
Binary files /dev/null and b/appl/reide/icons/wand.png differ
diff --git a/appl/reide/icons/wrench.png b/appl/reide/icons/wrench.png
new file mode 100644 (file)
index 0000000..5c8213f
Binary files /dev/null and b/appl/reide/icons/wrench.png differ
diff --git a/appl/reide/main.cpp b/appl/reide/main.cpp
new file mode 100644 (file)
index 0000000..e11e665
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * main.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+#include "reditor.hpp"
+#include <QApplication>
+
+int main(int argc, char *argv[]) {
+       const char* workspace = NULL;
+       const char* project = NULL;
+       for (int ix = 1; ix < argc; ix++) {
+               if (argv[ix][0] == '-') {
+                       if (strcmp(argv[ix], "-w") == 0 && ix < argc - 1) {
+                               workspace = argv[++ix];
+                       } else if (strncmp(argv[ix], "--workspace=", 12) == 0) {
+                               workspace = argv[ix] + 12;
+                       } else if (strcmp(argv[ix], "-p") == 0 && ix < argc - 1) {
+                               project = argv[++ix];
+                       } else if (strncmp(argv[ix], "--project=", 10) == 0) {
+                               workspace = argv[ix] + 10;
+                       }
+               }
+       }
+       QApplication a(argc, argv);
+       ReLogger logger;
+       ReDebugAppender appender;
+       appender.setAutoDelete(false);
+       logger.addAppender(&appender);
+       MainWindow w(workspace, project, &logger);
+       logger.log(LOG_INFO, 1, "start");
+       w.show();
+
+       return a.exec();
+}
diff --git a/appl/reide/mainwindow.cpp b/appl/reide/mainwindow.cpp
new file mode 100644 (file)
index 0000000..17e4bda
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+ * mainwindow.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include "reditor.hpp"
+#include "ui_mainwindow.h"
+#include <QFileDialog>
+
+MainWindow::MainWindow(const char* workspace, const char* project,
+    ReLogger* logger, QWidget *parent) :
+           QMainWindow(parent),
+           ui(new Ui::MainWindow),
+           m_project(NULL),
+           m_workspace(NULL),
+           m_logger(logger),
+           m_fileTree(NULL),
+           m_dockProjectTree(NULL) {
+       if (workspace == NULL)
+               workspace = QDir::homePath().toUtf8();
+       changeWorkspace(workspace == NULL ? QDir::homePath() : workspace);
+
+       QString proj(project == NULL ? "" : project);
+       if (project == NULL) {
+               QStringList lastProjects;
+               m_workspace->historyAsList("projects", lastProjects);
+               int ix = 0;
+               while (proj.isEmpty() && ix < lastProjects.size()) {
+                       QFileInfo dir(lastProjects.at(ix));
+                       if (dir.isDir() && dir.isWritable())
+                               proj = lastProjects.at(ix);
+               }
+               if (!proj.isEmpty())
+                       changeProject(proj);
+       }
+
+       ui->setupUi(this);
+       ReEdit* edit = ui->widget;
+#if defined __linux__
+       m_file = new ReFile("/home/hm/editor.txt", false);
+#else
+       m_file = new ReFile("U:\\ws_cpp\\rplqt\\Doxyfile", false);
+#endif
+       edit->setLines(m_file);
+       edit->setCursorLine(0);
+       connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(open()));
+       open();
+}
+
+MainWindow::~MainWindow() {
+       delete ui;
+}
+
+/**
+ * Change the current project.
+ *
+ * @param path the directory containing the project data
+ */
+void MainWindow::changeProject(QString path) {
+       delete m_project;
+       if (path.endsWith(OS_SEPARATOR_STR))
+               path.remove(path.size() - 1, 1);
+       m_project = new Project(path, this);
+       int maxEntries = m_workspace->intValue("history.max_projects");
+       m_workspace->addHistoryEntry(Workspace::KEY_HISTORY_PROJECTS, path, ';',
+           maxEntries);
+       if (m_fileTree == NULL) {
+               m_fileTree = new ReFileTree(path, m_logger, this);
+               m_dockProjectTree = new QDockWidget("", this);
+               m_dockProjectTree->setWidget(m_fileTree);
+               addDockWidget(Qt::LeftDockWidgetArea, m_dockProjectTree);
+       }
+       m_fileTree->setPath(path);
+       m_dockProjectTree->setWindowTitle(
+           tr("Project") + " " + ReQStringUtils::nodeOf(path));
+
+}
+
+/**
+ * Change the workspace.
+ *
+ * @param path the directory containing the workspace data
+ */
+void MainWindow::changeWorkspace(const QString& path) {
+       delete m_workspace;
+       m_workspace = new Workspace(path, m_logger);
+}
+
+/**
+ * Calls the file selection dialog.
+ */
+void MainWindow::openFile(const QString& name) {
+       m_file = new ReFile(name, false);
+
+       ReEdit* edit = ui->widget;
+       edit->setLines(m_file);
+       edit->setCursorLine(0);
+       int maxEntries = m_workspace->intValue("history.max_files");
+       m_workspace->addHistoryEntry(Workspace::KEY_HISTORY_FILES, name, ';',
+           maxEntries);
+}
+
+/**
+ * Closes the current project.
+ */
+void MainWindow::closeProject() {
+       delete m_project;
+       m_project = NULL;
+}
+
+/**
+ * Shows the "open project/file dialog".
+ */
+void MainWindow::open() {
+       ProjectSelection dialog(this);
+       dialog.exec();
+}
+ReLogger* MainWindow::logger() const {
+       return m_logger;
+}
+
+/**
+ * Returns the current workspace.
+ *
+ * @return the current workspace
+ */
+Project* MainWindow::project() const {
+       return m_project;
+}
+
+Workspace* MainWindow::workspace() const {
+       return m_workspace;
+}
+
diff --git a/appl/reide/mainwindow.hpp b/appl/reide/mainwindow.hpp
new file mode 100644 (file)
index 0000000..d80c6f9
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * mainwindow.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef MAINWINDOW_HPP
+#define MAINWINDOW_HPP
+
+#include <QMainWindow>
+#ifndef REBASE_HPP
+#include "reditor.hpp"
+#endif
+namespace Ui {
+class MainWindow;
+}
+
+class MainWindow: public QMainWindow {
+       Q_OBJECT
+
+public:
+       explicit MainWindow(const char* workspace, const char* project,
+           ReLogger* logger, QWidget *parent = 0);
+       ~MainWindow();
+       void changeProject(QString path);
+       void changeWorkspace(const QString& path);
+       void closeProject();
+       void openFile(const QString& name);
+       Project* project() const;
+       Workspace* workspace() const;
+       ReLogger* logger() const;
+
+public slots:
+       void open();
+private:
+       Ui::MainWindow *ui;
+       ReFile* m_file;
+       Project* m_project;
+       Workspace* m_workspace;
+       ReLogger* m_logger;
+       ReFileTree* m_fileTree;
+       QDockWidget* m_dockProjectTree;
+};
+
+#endif // MAINWINDOW_HPP
diff --git a/appl/reide/mainwindow.ui b/appl/reide/mainwindow.ui
new file mode 100644 (file)
index 0000000..cad587b
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MainWindow</class>
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>803</width>
+    <height>642</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>MainWindow</string>
+  </property>
+  <widget class="QWidget" name="centralWidget">
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <widget class="ReEdit" name="widget" native="true"/>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>803</width>
+     <height>23</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionOpen"/>
+   <addaction name="actionSave"/>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
+  <widget class="QToolBar" name="toolBar">
+   <property name="windowTitle">
+    <string>toolBar</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <action name="actionOpen">
+   <property name="icon">
+    <iconset resource="editor.qrc">
+     <normaloff>:/main/icons/table.png</normaloff>:/main/icons/table.png</iconset>
+   </property>
+   <property name="text">
+    <string>Open</string>
+   </property>
+   <property name="toolTip">
+    <string>Open a file</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+O</string>
+   </property>
+  </action>
+  <action name="actionSave">
+   <property name="icon">
+    <iconset resource="editor.qrc">
+     <normaloff>:/main/icons/disk.png</normaloff>:/main/icons/disk.png</iconset>
+   </property>
+   <property name="text">
+    <string>Save</string>
+   </property>
+   <property name="toolTip">
+    <string>Save the file</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+S</string>
+   </property>
+  </action>
+ </widget>
+ <layoutdefault spacing="6" margin="11"/>
+ <customwidgets>
+  <customwidget>
+   <class>ReEdit</class>
+   <extends>QWidget</extends>
+   <header>gui/regui.hpp</header>
+   <container>1</container>
+  </customwidget>
+ </customwidgets>
+ <resources>
+  <include location="editor.qrc"/>
+ </resources>
+ <connections/>
+</ui>
diff --git a/appl/reide/project.cpp b/appl/reide/project.cpp
new file mode 100644 (file)
index 0000000..ffda4ee
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * project.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include "reditor.hpp"
+
+const char* Project::KEY_HISTORY_OPEN_FILES = "openFiles";
+/**
+ * Constructor.
+ *
+ * @param path         the directory containing the configuration
+ * @param logger       the logger
+ */
+Project::Project(const QString& path, MainWindow* mainWindow) :
+           ReSettings(path, ".reditor.proj", mainWindow->logger()),
+           m_mainWindow(mainWindow) {
+       QString filename = topOfHistory(KEY_HISTORY_OPEN_FILES);
+       QFileInfo info(filename);
+       if (!filename.isEmpty() && info.exists() && !info.isDir()) {
+               m_mainWindow->openFile(filename);
+       }
+}
+
+/**
+ * Opens a file in the project directory.
+ *
+ * @param filename     the filename relative to the project directory
+ */
+void Project::openFile(const QString& filename) {
+       QString full = m_path + OS_SEPARATOR_STR + filename;
+       addHistoryEntry(KEY_HISTORY_OPEN_FILES, filename, ';', 1);
+       m_mainWindow->openFile(full);
+}
+
diff --git a/appl/reide/project.hpp b/appl/reide/project.hpp
new file mode 100644 (file)
index 0000000..dc0b267
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * project.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef PROJECT_HPP
+#define PROJECT_HPP
+
+class MainWindow;
+
+class Project: public ReSettings {
+public:
+       static const char* KEY_HISTORY_OPEN_FILES;
+public:
+       Project(const QString& path, MainWindow* mainWindow);
+public:
+       void openFile(const QString& filename);
+
+private:
+       MainWindow* m_mainWindow;
+};
+
+#endif // PROJECT_HPP
diff --git a/appl/reide/projectselection.cpp b/appl/reide/projectselection.cpp
new file mode 100644 (file)
index 0000000..1d7fd72
--- /dev/null
@@ -0,0 +1,246 @@
+/*
+ * projectselection.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include "reditor.hpp"
+#include "ui_projectselection.h"
+#include <QFileDialog>
+#include <QMessageBox>
+
+/**
+ * Constructor.
+ *
+ * @param parent               NULL or the parent
+ * @param mainWindow   the main window
+ */
+ProjectSelection::ProjectSelection(MainWindow* mainWindow, QWidget *parent) :
+           QDialog(parent),
+           ui(new Ui::ProjectSelection),
+           m_mainWindow(mainWindow) {
+       ui->setupUi(this);
+       connect(ui->toolButtonSelectFile, SIGNAL(clicked()), this,
+           SLOT(selectFile()));
+       connect(ui->toolButtonSelectProject, SIGNAL(clicked()), this,
+           SLOT(selectDir()));
+       connect(ui->pushButtonOpen, SIGNAL(clicked()), this, SLOT(open()));
+       connect(ui->lineEditFilterLastFile, SIGNAL(textChanged(QString)), this,
+           SLOT(textChangedFilterFiles(QString)));
+       connect(ui->tableWidgetFiles, SIGNAL(cellEntered(int,int)), this,
+               SLOT(cellEnteredFiles(int, int)));
+       connect(ui->tableWidgetProjects, SIGNAL(cellEntered(int,int)), this,
+               SLOT(cellEnteredProjects(int, int)));
+       Workspace* workspace = mainWindow->workspace();
+       buildTableInfo(workspace, Workspace::KEY_HISTORY_FILES, true, m_files);
+       buildTableInfo(workspace, Workspace::KEY_HISTORY_PROJECTS, false,
+           m_projects);
+       buildTable("", m_files, ui->tableWidgetFiles);
+       buildTable("", m_projects, ui->tableWidgetProjects);
+}
+
+/**
+ * Destructor.
+ */
+ProjectSelection::~ProjectSelection() {
+       delete ui;
+}
+/**
+ * Handles the event cellEntered for the last opened files.
+ *
+ * @param row  the row of the entered cell
+ * @param col  the column of the entered cell
+ */
+void ProjectSelection::cellEnteredFiles(int row, int col) {
+       ReUseParameter(col);
+       QString file = fileOfTable(ui->tableWidgetFiles, row);
+       ui->lineEditOpen->setText(file);
+}
+
+/**
+ * Handles the event cellEntered for the last opened projects.
+ *
+ * @param row  the row of the entered cell
+ * @param col  the column of the entered cell
+ */
+void ProjectSelection::cellEnteredProjects(int row, int col) {
+       ReUseParameter(col);
+       QString file = fileOfTable(ui->tableWidgetProjects, row);
+       ui->lineEditOpen->setText(file);
+}
+
+/**
+ * Builds the table from the table using a filter expression.
+ *
+ * @param filter       a filter expression with wildcards '*'
+ * @param lines                the full table info
+ * @param table                OUT: will be filled with all lines matching the filter
+ */
+void ProjectSelection::buildTable(const QString& filter,
+    const QStringList& lines, QTableWidget* table) {
+       QStringList::const_iterator it;
+       int rowCount = 0;
+       ReMatcher matcher(filter, Qt::CaseInsensitive, true);
+       for (it = lines.cbegin(); it != lines.cend(); ++it) {
+               if (matcher.matches(*it))
+                       rowCount++;
+       }
+       table->setRowCount(rowCount);
+       int row = -1;
+       for (it = lines.cbegin(); it != lines.cend(); ++it) {
+               if (matcher.matches(*it)) {
+                       row++;
+                       QStringList cols = it->split('\t');
+                       for (int col = 0; col < cols.size(); col++) {
+                               QTableWidgetItem* item = table->item(row, col);
+                               if (item != NULL)
+                                       item->setText(cols.at(col));
+                               else {
+                                       item = new QTableWidgetItem(cols.at(col));
+                                       table->setItem(row, col, item);
+                               }
+                       }
+               }
+       }
+}
+
+/**
+ * Build the info for a table (last opened files or last opened projects).
+ *
+ * Note: the table shows a filtered part of this info.
+ *
+ * @param settings             the history container
+ * @param key                  the name of the history entry
+ * @param withDate             the file's name is part of the info
+ * @param tableContent OUT: the list containing the table info
+ */
+void ProjectSelection::buildTableInfo(ReSettings* settings, const char* key,
+    bool withDate, QStringList& tableContent) {
+       QStringList files;
+       settings->historyAsList(key, files);
+       QStringList::const_iterator it;
+       for (it = files.cbegin(); it != files.cend(); ++it) {
+               QFileInfo file(*it);
+               if (file.exists()) {
+                       QString info = file.baseName();
+                       if (withDate)
+                               info.append("\t").append(
+                                   file.lastModified().toString("yyyy.mm.dd/HH:MM:SS"));
+                       info.append("\t").append(file.path());
+                       tableContent.append(info);
+               }
+       }
+}
+
+/**
+ * Shows an error message.
+ *
+ * @param message      message to show
+ */
+void ProjectSelection::error(const QString& message) {
+       QMessageBox dialog(QMessageBox::Critical, "Error", message,
+           QMessageBox::Close);
+       dialog.exec();
+}
+
+/**
+ * Extracts the full filename of a given table.
+ *
+ * The node is the first column, the path the last.
+ *
+ * @param table        the table from which the filename is taken
+ * @param row  the row where the filename is
+ * @return     the full name of the file in the given row
+ */
+QString ProjectSelection::fileOfTable(QTableWidget* table, int row) {
+       int colPath = table->columnCount() - 1;
+       QString file = table->item(row, colPath)->text() + OS_SEPARATOR_STR
+           + table->item(row, 0)->text();
+       return file;
+}
+/**
+ * Opens a file or a directory (project directory).
+ */
+void ProjectSelection::open() {
+       QString name = ui->lineEditOpen->text();
+       if (name.isEmpty())
+               error("missing filename/project directory");
+       else {
+               QFileInfo file(name);
+               if (!file.exists())
+                       error("does not exists: " + name);
+               else {
+                       if (file.isDir())
+                               m_mainWindow->changeProject(name);
+                       else
+                               m_mainWindow->openFile(name);
+                       close();
+               }
+       }
+}
+
+/**
+ * Selects a directory (project directory) with an open dialog.
+ */
+void ProjectSelection::selectDir() {
+       QString name = ui->lineEditOpen->text();
+       if (name.isEmpty() && m_mainWindow->project() != NULL)
+               name = m_mainWindow->project()->path();
+       name = QFileDialog::getExistingDirectory(this,
+           tr("Select Project Directory"), name);
+       if (!name.isEmpty()) {
+               ui->lineEditOpen->setText(name);
+               open();
+       }
+}
+
+/**
+ * Selects a file with a file open dialog.
+ */
+void ProjectSelection::selectFile() {
+       QString name = ui->lineEditOpen->text();
+       name = QFileDialog::getOpenFileName(this, tr("Select File"), name);
+       if (!name.isEmpty()) {
+               ui->lineEditOpen->setText(name);
+               open();
+       }
+}
+
+/**
+ * Handles the filter text change for a given table.
+ *
+ * @param text the filter text
+ * @param table        the table which will be filled
+ * @param lines        the full (unfiltered) table info
+ */
+void ProjectSelection::textChanged(const QString& text, QTableWidget* table,
+    const QStringList& lines) {
+       buildTable(text, lines, table);
+       if (table->rowCount() > 0) {
+               QString file = fileOfTable(table, 0);
+               ui->lineEditOpen->setText(file);
+       }
+}
+
+/**
+ * Handles the event "text changed" of the last opened files.
+ *
+ * @param text the new text
+ */
+void ProjectSelection::textChangedFilterFiles(const QString& text) {
+       textChanged(text, ui->tableWidgetFiles, m_files);
+}
+
+/**
+ * Handles the event "text changed" of the last opened projects.
+ *
+ * @param text the new text
+ */
+void ProjectSelection::textChangedFilterProjects(const QString& text) {
+       textChanged(text, ui->tableWidgetProjects, m_projects);
+}
diff --git a/appl/reide/projectselection.hpp b/appl/reide/projectselection.hpp
new file mode 100644 (file)
index 0000000..ea17c30
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * projectselection.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef PROJECTSELECTION_HPP
+#define PROJECTSELECTION_HPP
+#include "reditor.hpp"
+#include <QDialog>
+#include <QTableWidget>
+namespace Ui {
+class ProjectSelection;
+}
+class MainWindow;
+class ProjectSelection: public QDialog {
+       Q_OBJECT
+
+public:
+       explicit ProjectSelection(MainWindow* mainWindow, QWidget *parent = 0);
+       ~ProjectSelection();
+
+public slots:
+       void open();
+       void selectDir();
+       void selectFile();
+protected:
+       void buildTable(const QString& filter, const QStringList& lines,
+           QTableWidget* table);
+       void buildTableInfo(ReSettings* settings, const char* key, bool withDate,
+           QStringList& tableContent);
+       QString fileOfTable(QTableWidget* table, int row);
+       void textChanged(const QString& text, QTableWidget* table,
+           const QStringList& lines);protected slots:
+       void cellEnteredFiles(int row, int col);
+       void cellEnteredProjects(int row, int col);
+       void textChangedFilterFiles(const QString& text);
+       void textChangedFilterProjects(const QString& text);
+private:
+       void error(const QString& message);
+private:
+       Ui::ProjectSelection *ui;
+       MainWindow* m_mainWindow;
+       QStringList m_files;
+       QStringList m_projects;
+};
+
+#endif // PROJECTSELECTION_HPP
diff --git a/appl/reide/projectselection.ui b/appl/reide/projectselection.ui
new file mode 100644 (file)
index 0000000..8b24b07
--- /dev/null
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ProjectSelection</class>
+ <widget class="QDialog" name="ProjectSelection">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1034</width>
+    <height>703</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dialog</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_3">
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="maximumSize">
+      <size>
+       <width>16777215</width>
+       <height>75</height>
+      </size>
+     </property>
+     <property name="title">
+      <string>Open new file/project:</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_4">
+      <item>
+       <widget class="QLineEdit" name="lineEditOpen">
+        <property name="toolTip">
+         <string>Name of the file/project directory to open</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QPushButton" name="pushButtonOpen">
+        <property name="toolTip">
+         <string>Opens the file/project (Control-O)</string>
+        </property>
+        <property name="text">
+         <string>Open</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="toolButtonSelectFile">
+        <property name="toolTip">
+         <string>Selects a file wit a file open dialog box (Control-Shift-F)</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="shortcut">
+         <string>Ctrl+Shift+F</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolButton" name="toolButtonSelectProject">
+        <property name="toolTip">
+         <string>Select a project directory with a directory open box (Control-Shift-P)</string>
+        </property>
+        <property name="text">
+         <string>...</string>
+        </property>
+        <property name="shortcut">
+         <string>Ctrl+Shift+P</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <widget class="QSplitter" name="splitter">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="handleWidth">
+      <number>3</number>
+     </property>
+     <widget class="QWidget" name="layoutWidget">
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QLabel" name="label">
+           <property name="text">
+            <string>Last opened files:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="lineEditFilterLastFile">
+           <property name="toolTip">
+            <string>Filter for last opened files.
+Use wildcards: '*' (any string) and '?' (any character)</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QTableWidget" name="tableWidgetFiles">
+         <property name="mouseTracking">
+          <bool>true</bool>
+         </property>
+         <property name="editTriggers">
+          <set>QAbstractItemView::NoEditTriggers</set>
+         </property>
+         <property name="columnCount">
+          <number>3</number>
+         </property>
+         <attribute name="horizontalHeaderMinimumSectionSize">
+          <number>1</number>
+         </attribute>
+         <attribute name="horizontalHeaderStretchLastSection">
+          <bool>true</bool>
+         </attribute>
+         <column>
+          <property name="text">
+           <string>File</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>Modified</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>Directory</string>
+          </property>
+         </column>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_5" stretch=""/>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="layoutWidget">
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="text">
+            <string>Last opened projects:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="lineEditFilterLastProjects">
+           <property name="toolTip">
+            <string>Filter for last opened projects.
+Use wildcards: '*' (any string) and '?' (any character)</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="QTableWidget" name="tableWidgetProjects">
+         <property name="mouseTracking">
+          <bool>true</bool>
+         </property>
+         <property name="columnCount">
+          <number>2</number>
+         </property>
+         <attribute name="horizontalHeaderStretchLastSection">
+          <bool>true</bool>
+         </attribute>
+         <attribute name="verticalHeaderStretchLastSection">
+          <bool>false</bool>
+         </attribute>
+         <column>
+          <property name="text">
+           <string>Name</string>
+          </property>
+         </column>
+         <column>
+          <property name="text">
+           <string>Parent</string>
+          </property>
+         </column>
+        </widget>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_7"/>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/appl/reide/reditor.hpp b/appl/reide/reditor.hpp
new file mode 100644 (file)
index 0000000..e606072
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * reditor.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef REDITOR_HPP
+#define REDITOR_HPP
+#include <QDockWidget>
+#include "base/rebase.hpp"
+#include "gui/regui.hpp"
+#include "workspace.hpp"
+#include "project.hpp"
+#include "mainwindow.hpp"
+#include "projectselection.hpp"
+#endif // REDITOR_HPP
+
diff --git a/appl/reide/reide.pro b/appl/reide/reide.pro
new file mode 100644 (file)
index 0000000..a47db11
--- /dev/null
@@ -0,0 +1,50 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2015-06-03T20:56:48
+#
+#-------------------------------------------------
+
+QT       += core gui
+
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+
+TARGET = ReEditor
+TEMPLATE = app
+
+INCLUDEPATH += ../..
+
+SOURCES += \
+        ../../gui/ReEdit.cpp \
+        ../../gui/ReStateStorage.cpp \
+        ../../gui/ReSettings.cpp \
+        ../../base/ReFile.cpp \
+        ../../gui/ReFileTree.cpp \
+       mainwindow.cpp \
+       ../../base/ReLogger.cpp \
+       ../../base/ReQStringUtils.cpp \
+       ../../base/ReFileUtils.cpp \
+       ../../base/ReException.cpp \
+       projectselection.cpp \
+       workspace.cpp \
+       project.cpp \
+       main.cpp
+
+
+HEADERS  += mainwindow.hpp \
+        ../../base/rebase.hpp \
+        ../../gui/regui.hpp \
+        ../../gui/ReEdit.hpp \
+       ../../base/ReStringUtils.hpp \
+       ../../base/ReQStringUtils.hpp \
+       ../../base/ReException.hpp \
+       projectselection.hpp \
+       workspace.hpp \
+       project.hpp \
+       reditor.hpp \
+       storage.hpp
+
+FORMS    += mainwindow.ui \
+       projectselection.ui
+
+RESOURCES += \
+        editor.qrc
diff --git a/appl/reide/workspace.cpp b/appl/reide/workspace.cpp
new file mode 100644 (file)
index 0000000..809c011
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * workspace.cpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#include "reditor.hpp"
+
+const char* Workspace::KEY_HISTORY_FILES = "files";
+const char* Workspace::KEY_HISTORY_PROJECTS = "projecs";
+
+/**
+ * Constructor.
+ *
+ * @param path         the directory containing the configuration
+ * @param logger       the logger
+ */
+Workspace::Workspace(const QString& path, ReLogger* logger) :
+           ReSettings(path, ".reditor.ws", logger) {
+       insertProperty(
+           new ReProperty("editor.tabwidth", QObject::tr("Tabulator width"),
+               QObject::tr("Maximal length of the gap displaying a tabulator"),
+               "4", PT_INT, "[1,16]"));
+       insertProperty(
+           new ReProperty("history.max_projects",
+               QObject::tr("Maximal project entries"),
+               QObject::tr(
+                   "Maximal number of projects in the 'last opened projects'"),
+               "20", PT_INT, "[1,100]"));
+       insertProperty(
+           new ReProperty("history.max_files", QObject::tr("Maximal file entries"),
+               QObject::tr("Maximal number of files in the 'last opened files'"),
+               "20", PT_INT, "[1,100]"));
+}
+
diff --git a/appl/reide/workspace.hpp b/appl/reide/workspace.hpp
new file mode 100644 (file)
index 0000000..8776fed
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * workspace.hpp
+ *
+ * License: Public Domain
+ * You can use and modify this file without any restriction.
+ * Do what you want.
+ * No warranties and disclaimer of any damages.
+ * You also can use this license: http://www.wtfpl.net
+ * The latest sources: https://github.com/republib
+ */
+
+#ifndef WORKSPACE_HPP
+#define WORKSPACE_HPP
+
+class Workspace: public ReSettings {
+public:
+       static const char* KEY_HISTORY_FILES;
+       static const char* KEY_HISTORY_PROJECTS;
+public:
+       Workspace(const QString& path, ReLogger* logger);
+};
+
+#endif // WORKSPACE_HPP