Added multiple list support.
authorWillem Liu <willem.liu@gmail.com>
Wed, 20 Oct 2010 22:48:46 +0000 (00:48 +0200)
committerWillem Liu <willem.liu@gmail.com>
Wed, 20 Oct 2010 22:48:46 +0000 (00:48 +0200)
debian/changelog
easylist.pro.user
src/editform.cpp
src/editform.h
src/listform.cpp
src/listform.h
src/mainform.cpp
src/mainform.h
src/mainform.ui
src/src.pro
src/systemsettings.h

index b3c09cd..d30c88f 100755 (executable)
@@ -1,35 +1,42 @@
-easylist (0.3.14) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
+
+  * Support for multiple lists.
+  * Changed order of menu items.
+
+ -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 13:56:12 +0200
+
+easylist (0.3.15) unstable; urgency=low
 
   * Changed control description.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 13:56:12 +0200
 
-easylist (0.3.13) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Changed changelog to include all previous version changes.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 13:56:12 +0200
 
-easylist (0.3.12) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Fixed sorting problem.
 
  -- Willem Liu <willem.liu@gmail.com>  Thu, 29 Sep 2010 03:12:00 +0200
 
-easylist (0.3.11) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Fixed Sort A-Z bug. Caused list to disappear when turned on with option "Checked To Bottom" turned off.
 
  -- Willem Liu <willem.liu@gmail.com>  Thu, 29 Sep 2010 03:11:00 +0200
 
-easylist (0.3.10) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Alphabetical sorting now ignores case.
   * Checked items now have grey text instead of white and are striked through.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 28 Sep 2010 17:12:00 +0200
 
-easylist (0.3.9) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Alphabetical sorting now possible.
   * Label "Checked bottom" changed to "Checked to bottom".
@@ -37,7 +44,7 @@ easylist (0.3.9) unstable; urgency=low
 
  -- Willem Liu <willem.liu@gmail.com>  Sun, 26 Sep 2010 17:43:00 +0200
 
-easylist (0.3.5) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Significantly changed the source code.
   * Divided in multiple classes.
@@ -46,37 +53,37 @@ easylist (0.3.5) unstable; urgency=low
 
  -- Willem Liu <willem.liu@gmail.com>  Wed, 22 Sep 2010 22:46:00 +0200
 
-easylist (0.3.4) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Now supports sorting checked items to bottom of the list.
 
  -- Willem Liu <willem.liu@gmail.com>  Thu, 16 Sep 2010 13:43:00 +0200
 
-easylist (0.3.1) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Initial Release.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 11:56:00 +0200
 
-easylist (0.3.0) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Changed binary version number.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 11:56:00 +0200
 
-easylist (0.2) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Added optify file.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 11:56:00 +0200
 
-easylist (0.1) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Initial Release.
 
  -- Willem Liu <willem.liu@gmail.com>  Tue, 07 Sep 2010 11:56:00 +0200
 
-easylist (0.0.1) unstable; urgency=low
+easylist (0.3.15) unstable; urgency=low
 
   * Initial Release.
 
index e2585b6..ca76aed 100755 (executable)
@@ -27,7 +27,9 @@
      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Make</value>
      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
-     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+     <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+      <value type="QString">-j</value>
+     </valuelist>
      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
     </valuemap>
     <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">2</value>
@@ -46,7 +48,7 @@
     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
-    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.14-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.15-build-desktop</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">20</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
@@ -80,7 +82,7 @@
     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
-    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.14-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.15-build-desktop</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">20</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">2</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Debug</value>
     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
-    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.14</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.15</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">27</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
      <valuelist key="Qt4ProjectManager.BuildStep.MaemoPackage.LocalFiles" type="QVariantList">
-      <value type="QString">C:/dev/cpp/easylist-0.3.14/src/easylist.desktop</value>
-      <value type="QString">C:/dev/cpp/easylist-0.3.14/src/data/26x26/easylist.png</value>
-      <value type="QString">C:/dev/cpp/easylist-0.3.14/src/data/40x40/easylist.png</value>
-      <value type="QString">C:/dev/cpp/easylist-0.3.14/src/data/48x48/easylist.png</value>
-      <value type="QString">C:/dev/cpp/easylist-0.3.14/src/data/64x64/easylist.png</value>
+      <value type="QString">C:/dev/cpp/easylist-0.3.15/src/easylist.desktop</value>
+      <value type="QString">C:/dev/cpp/easylist-0.3.15/src/data/26x26/easylist.png</value>
+      <value type="QString">C:/dev/cpp/easylist-0.3.15/src/data/40x40/easylist.png</value>
+      <value type="QString">C:/dev/cpp/easylist-0.3.15/src/data/48x48/easylist.png</value>
+      <value type="QString">C:/dev/cpp/easylist-0.3.15/src/data/64x64/easylist.png</value>
      </valuelist>
      <value key="Qt4ProjectManager.BuildStep.MaemoPackage.Modified" type="bool">false</value>
      <value key="Qt4ProjectManager.BuildStep.MaemoPackage.RemoteExe" type="QString">/opt/easylist/bin/easylist</value>
       <value type="QString">/usr/share/icons/hicolor/48x48/apps/easylist.png</value>
       <value type="QString">/usr/share/icons/hicolor/64x64/apps/easylist.png</value>
      </valuelist>
-     <value key="Version Number" type="QString">0.3.14</value>
+     <value key="Version Number" type="QString">0.3.15</value>
     </valuemap>
     <value key="ProjectExplorer.BuildConfiguration.BuildStepsCount" type="int">3</value>
     <valuemap key="ProjectExplorer.BuildConfiguration.CleanStep.0" type="QVariantMap">
     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Release</value>
     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
-    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.14</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">C:/dev/cpp/easylist-0.3.15</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">27</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
     <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">false</value>
index 8e90c62..a5dc6e5 100755 (executable)
@@ -18,17 +18,18 @@ EditForm::~EditForm()
 void EditForm::shown()\r
 {\r
     ui->textEdit->setText(MyCheckBoxContainer::getInstance()->getListText());\r
+    ui->textEdit->setFocus(Qt::ActiveWindowFocusReason);\r
 }\r
 \r
 void EditForm::on_savePushButton_clicked()\r
 {\r
     qDebug() << "Save";\r
     settings->setValue(LIST_TEXT, ui->textEdit->toPlainText());\r
-    emit signalSavePushButtonClicked(this);\r
+    emit signalNavigate(0);\r
 }\r
 \r
 void EditForm::on_cancelPushButton_clicked()\r
 {\r
     qDebug() << "Cancel";\r
-    emit signalCancelPushButtonClicked(this);\r
+    emit signalNavigate(0);\r
 }\r
index 33ed842..80225c9 100755 (executable)
@@ -6,10 +6,7 @@
 #include <QSettings>\r
 #include "mycheckboxcontainer.h"\r
 #include "slidewidget.h"\r
-\r
-#define WILLEM_LIU "WillemLiu"\r
-#define EASY_LIST "easylist"\r
-#define LIST_TEXT "ListText"\r
+#include "globals.h"\r
 \r
 namespace Ui {\r
     class EditForm;\r
@@ -31,8 +28,7 @@ private:
     QSettings * settings;\r
 \r
 signals:\r
-    void signalSavePushButtonClicked(SlideWidget * thisWidget);\r
-    void signalCancelPushButtonClicked(SlideWidget * thisWidget);\r
+    void signalNavigate(int step);\r
 \r
 private slots:\r
     void on_cancelPushButton_clicked();\r
index 33ae4b4..57984f7 100755 (executable)
@@ -41,7 +41,7 @@ void ListForm::addCheckBoxes()
 void ListForm::on_editListPushButton_clicked()\r
 {\r
     settings->setValue(LIST_TEXT, MyCheckBoxContainer::getInstance()->getListText());\r
-    emit signalEditListPushButtonTriggered(this);\r
+    emit signalNavigate(1);\r
 }\r
 \r
 void ListForm::on_uncheckAllPushButton_clicked()\r
index 4d0f2c6..69b7a20 100755 (executable)
@@ -6,10 +6,7 @@
 #include "mycheckboxcontainer.h"\r
 #include "systemsettings.h"\r
 #include "slidewidget.h"\r
-\r
-#define WILLEM_LIU "WillemLiu"\r
-#define EASY_LIST "easylist"\r
-#define LIST_TEXT "ListText"\r
+#include "globals.h"\r
 \r
 namespace Ui {\r
     class ListForm;\r
@@ -30,7 +27,7 @@ private:
 \r
     Ui::ListForm *ui;\r
 signals:\r
-    void signalEditListPushButtonTriggered(SlideWidget * thisWidget);\r
+    void signalNavigate(int step);\r
 \r
 private slots:\r
     void on_clearCheckedPushButton_clicked();\r
index 9584bc0..b21cbcc 100755 (executable)
@@ -56,16 +56,20 @@ MainForm::MainForm(QWidget *parent) :
     // Populate the QStackedWidget. ListForm is set as the current widget.\r
     listForm = new ListForm(this);\r
     editForm = new EditForm(this);\r
+    chooseListForm = new ChooseListForm(this);\r
 \r
     connect(listForm, SIGNAL(signalTransitionOutFinished()), this, SLOT(stateOutFinished()));\r
-    connect(listForm, SIGNAL(signalEditListPushButtonTriggered(SlideWidget*)), this, SLOT(changeWidget(SlideWidget*)));\r
+    connect(listForm, SIGNAL(signalNavigate(int)), this, SLOT(changeWidget(int)));\r
 \r
     connect(editForm, SIGNAL(signalTransitionOutFinished()), this, SLOT(stateOutFinished()));\r
-    connect(editForm, SIGNAL(signalCancelPushButtonClicked(SlideWidget*)), this, SLOT(changeWidget(SlideWidget*)));\r
-    connect(editForm, SIGNAL(signalSavePushButtonClicked(SlideWidget*)), this, SLOT(changeWidget(SlideWidget*)));\r
+    connect(editForm, SIGNAL(signalNavigate(int)), this, SLOT(changeWidget(int)));\r
+\r
+    connect(chooseListForm, SIGNAL(signalTransitionOutFinished()), this, SLOT(stateOutFinished()));\r
+    connect(chooseListForm, SIGNAL(signalNavigate(int)), this, SLOT(changeWidget(int)));\r
 \r
     ui->stackedWidget->addWidget(listForm);\r
     ui->stackedWidget->addWidget(editForm);\r
+    ui->stackedWidget->addWidget(chooseListForm);\r
     ui->stackedWidget->setCurrentWidget(listForm);\r
 }\r
 \r
@@ -84,8 +88,9 @@ void MainForm::stateOutFinished()
     newWidget->shown();\r
 }\r
 \r
-void MainForm::changeWidget(SlideWidget * currentWidget)\r
+void MainForm::changeWidget(int step)\r
 {\r
+    SlideWidget * currentWidget = dynamic_cast<SlideWidget * >(ui->stackedWidget->currentWidget());\r
     currentWidget->initStates();\r
     int currentIndex = ui->stackedWidget->indexOf(currentWidget);\r
     // Because all widgets are started with StateOut as initial state, we\r
@@ -94,23 +99,8 @@ void MainForm::changeWidget(SlideWidget * currentWidget)
     // is never set to StateIn.\r
     currentWidget->setStateIn();\r
     qDebug() << "Current widget index" << currentIndex;\r
-    if(currentIndex < ui->stackedWidget->count()-1)\r
-    {\r
-        newIndex = currentIndex+1;\r
-        currentWidget->setStateOut();\r
-    }\r
-    else\r
-    {\r
-        if(ui->stackedWidget->count() > 0)\r
-        {\r
-            newIndex = 0;\r
-            currentWidget->setStateOut();\r
-        }\r
-        else\r
-        {\r
-            qDebug() << "StackedWidget does not have any widgets";\r
-        }\r
-    }\r
+    newIndex = step;\r
+    currentWidget->setStateOut();\r
     qDebug() << "New widget index" << newIndex;\r
 }\r
 \r
@@ -212,3 +202,8 @@ void MainForm::on_actionSort_A_Z_triggered()
     settings->setValue(SORT_A_Z, ui->actionSort_A_Z->isChecked());\r
     MyCheckBoxContainer::getInstance()->setSortAlphabetically(ui->actionSort_A_Z->isChecked());\r
 }\r
+\r
+void MainForm::on_actionLists_triggered()\r
+{\r
+    changeWidget(2);\r
+}\r
index 6954f66..d0ab819 100755 (executable)
@@ -4,6 +4,7 @@
 #include <QMainWindow>
 #include <QSettings>
 #include <QDebug>
+#include <QDialog>
 #include <QMessageBox>
 #include <QStateMachine>
 #include <QState>
 #include "slidewidget.h"
 #include "listform.h"
 #include "editform.h"
+#include "chooselistform.h"
 #include "systemsettings.h"
 #include "mycheckboxcontainer.h"
-
-#define WILLEM_LIU "WillemLiu"
-#define EASY_LIST "easylist"
-#define DBUS_KEYBOARD_SLIDE "/org/freedesktop/Hal/devices/platform_slide"
-#define CHECKED_ITEMS_TO_BOTTOM "CheckedItemsToBottom"
-#define LANDSCAPE "Landscape"
-#define PORTRAIT "Portrait"
-#define AUTO_ORIENTATION "AutoOrientation"
-#define LIST_TEXT "ListText"
-#define SORT_A_Z "SortAlphabetically"
+#include "globals.h"
 
 namespace Ui {
     class MainForm;
@@ -42,7 +35,7 @@ public:
 
 public slots:
     void keyboardClosed(bool closed);
-    void changeWidget(SlideWidget * currentWidget);
+    void changeWidget(int step);
     void stateOutFinished();
 private:
     QSettings *settings;
@@ -53,10 +46,12 @@ private:
 
     ListForm * listForm;
     EditForm * editForm;
+    ChooseListForm * chooseListForm;
 protected:
     void closeEvent(QCloseEvent *event);
 
 private slots:
+    void on_actionLists_triggered();
     void on_actionSort_A_Z_triggered();
     void on_actionAuto_Orientation_triggered();
     void on_actionChecked_bottom_triggered();
index 6a59343..dce1e8c 100755 (executable)
     </property>\r
     <addaction name="actionSort_A_Z"/>\r
    </widget>\r
+   <widget class="QMenu" name="menuList">\r
+    <property name="title">\r
+     <string>Lists...</string>\r
+    </property>\r
+    <addaction name="actionLists"/>\r
+   </widget>\r
+   <addaction name="menuList"/>\r
+   <addaction name="menuAuto_Orientation"/>\r
    <addaction name="menuSort_A_Z"/>\r
    <addaction name="menuChecked_bottom"/>\r
    <addaction name="menuRotate"/>\r
-   <addaction name="menuAuto_Orientation"/>\r
    <addaction name="menuAbout"/>\r
   </widget>\r
   <action name="actionRotate">\r
     <string>Sort A-Z</string>\r
    </property>\r
   </action>\r
+  <action name="actionLists">\r
+   <property name="text">\r
+    <string>Lists...</string>\r
+   </property>\r
+  </action>\r
  </widget>\r
  <resources/>\r
  <connections/>\r
index 3adc624..db52035 100755 (executable)
@@ -20,7 +20,8 @@ SOURCES += main.cpp\
     systemsettings.cpp \\r
     listform.cpp \\r
     editform.cpp \\r
-    slidewidget.cpp\r
+    slidewidget.cpp \\r
+    chooselistform.cpp\r
 \r
 HEADERS  +=\\r
         mycheckbox.h \\r
@@ -29,12 +30,15 @@ HEADERS  +=\
     systemsettings.h \\r
     listform.h \\r
     editform.h \\r
-    slidewidget.h\r
+    slidewidget.h \\r
+    chooselistform.h \\r
+    globals.h\r
 \r
 FORMS    += \\r
     mainform.ui \\r
     listform.ui \\r
-    editform.ui\r
+    editform.ui \\r
+    chooselistform.ui\r
 \r
 CONFIG += mobility\r
 \r
index 32a1d18..6669115 100755 (executable)
@@ -5,8 +5,7 @@
 #include <QDebug>
 #include <QtDBus/QDBusConnection>
 #include <QtDBus/QDBusInterface>
-
-#define DBUS_KEYBOARD_SLIDE "/org/freedesktop/Hal/devices/platform_slide"
+#include "globals.h"
 
 class SystemSettings : public QObject
 {