projects
/
easylist
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1f342eb
)
Added sort alphabetically. Changed Checked bottom to Checked to bottom.
easylist-0.3.9
author
Willem Liu
<willem.liu@gmail.com>
Sun, 26 Sep 2010 16:51:00 +0000
(18:51 +0200)
committer
Willem Liu
<willem.liu@gmail.com>
Sun, 26 Sep 2010 16:51:00 +0000
(18:51 +0200)
debian/changelog
patch
|
blob
|
history
easylist.pro.user
patch
|
blob
|
history
src/mainform.cpp
patch
|
blob
|
history
src/mainform.h
patch
|
blob
|
history
src/mainform.ui
patch
|
blob
|
history
src/mycheckboxcontainer.cpp
patch
|
blob
|
history
src/mycheckboxcontainer.h
patch
|
blob
|
history
diff --git
a/debian/changelog
b/debian/changelog
index
04c223d
..
d132f6b
100755
(executable)
--- a/
debian/changelog
+++ b/
debian/changelog
@@
-1,5
+1,7
@@
easylist (0.3.9) unstable; urgency=low
easylist (0.3.9) unstable; urgency=low
- * Fixed a small bug. When going to Edit list mode the list text is saved to QSettings.
+ * Alphabetical sorting now possible.
+ * Label "Checked bottom" changed to "Checked to bottom".
+ * Automatic display orientation detection now possible.
-- Willem Liu <willem.liu@gmail.com> Tue, 07 Sep 2010 13:56:12 +0200
-- Willem Liu <willem.liu@gmail.com> Tue, 07 Sep 2010 13:56:12 +0200
diff --git
a/easylist.pro.user
b/easylist.pro.user
index
84b0fed
..
7ad3617
100755
(executable)
--- a/
easylist.pro.user
+++ b/
easylist.pro.user
@@
-2,7
+2,7
@@
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">1</value>
+ <value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
diff --git
a/src/mainform.cpp
b/src/mainform.cpp
index
690c94c
..
9584bc0
100755
(executable)
--- a/
src/mainform.cpp
+++ b/
src/mainform.cpp
@@
-12,6
+12,12
@@
MainForm::MainForm(QWidget *parent) :
\r
connect(SystemSettings::getInstance(), SIGNAL(signalKeyboardClosed(bool)), this, SLOT(keyboardClosed(bool)));
\r
\r
\r
connect(SystemSettings::getInstance(), SIGNAL(signalKeyboardClosed(bool)), this, SLOT(keyboardClosed(bool)));
\r
\r
+ ui->actionAuto_Orientation->setChecked(settings->value(AUTO_ORIENTATION).toBool());
\r
+ on_actionAuto_Orientation_triggered();
\r
+
\r
+ ui->actionSort_A_Z->setChecked(settings->value(SORT_A_Z).toBool());
\r
+ on_actionSort_A_Z_triggered();
\r
+
\r
// Set a default value for CHECKED_ITEMS_TO_BOTTOM
\r
if(settings->contains(CHECKED_ITEMS_TO_BOTTOM) == false)
\r
{
\r
// Set a default value for CHECKED_ITEMS_TO_BOTTOM
\r
if(settings->contains(CHECKED_ITEMS_TO_BOTTOM) == false)
\r
{
\r
@@
-35,13
+41,16
@@
MainForm::MainForm(QWidget *parent) :
}
\r
// If keyboard is opened at start. We do landscape mode.
\r
// Otherwise we do what's read from the QSettings.
\r
}
\r
// If keyboard is opened at start. We do landscape mode.
\r
// Otherwise we do what's read from the QSettings.
\r
- if(SystemSettings::getInstance()->getKeyboardClosed() == false)
\r
+ if(ui->actionAuto_Orientation->isChecked() == false)
\r
{
\r
{
\r
- setLandscapeMode(true);
\r
- }
\r
- else
\r
- {
\r
- setLandscapeMode(landscape);
\r
+ if(SystemSettings::getInstance()->getKeyboardClosed() == false)
\r
+ {
\r
+ setLandscapeMode(true);
\r
+ }
\r
+ else
\r
+ {
\r
+ setLandscapeMode(landscape);
\r
+ }
\r
}
\r
\r
// Populate the QStackedWidget. ListForm is set as the current widget.
\r
}
\r
\r
// Populate the QStackedWidget. ListForm is set as the current widget.
\r
@@
-108,13
+117,16
@@
void MainForm::changeWidget(SlideWidget * currentWidget)
void MainForm::keyboardClosed(bool closed)
\r
{
\r
// When keyboard is opened.
\r
void MainForm::keyboardClosed(bool closed)
\r
{
\r
// When keyboard is opened.
\r
- if(closed == false)
\r
- {
\r
- setLandscapeMode(true);
\r
- }
\r
- else
\r
+ if(ui->actionAuto_Orientation->isChecked() == false)
\r
{
\r
{
\r
- setLandscapeMode(landscape);
\r
+ if(closed == false)
\r
+ {
\r
+ setLandscapeMode(true);
\r
+ }
\r
+ else
\r
+ {
\r
+ setLandscapeMode(landscape);
\r
+ }
\r
}
\r
}
\r
\r
}
\r
}
\r
\r
@@
-125,6
+137,7
@@
void MainForm::setLandscapeMode(bool landscape)
tempLandscapeMode = true;
\r
qDebug() << LANDSCAPE;
\r
#ifdef Q_WS_MAEMO_5
\r
tempLandscapeMode = true;
\r
qDebug() << LANDSCAPE;
\r
#ifdef Q_WS_MAEMO_5
\r
+ setAttribute(Qt::WA_Maemo5AutoOrientation, false);
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, false);
\r
#endif
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, true);
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, false);
\r
#endif
\r
@@
-134,6
+147,7
@@
void MainForm::setLandscapeMode(bool landscape)
tempLandscapeMode = false;
\r
qDebug() << PORTRAIT;
\r
#ifdef Q_WS_MAEMO_5
\r
tempLandscapeMode = false;
\r
qDebug() << PORTRAIT;
\r
#ifdef Q_WS_MAEMO_5
\r
+ setAttribute(Qt::WA_Maemo5AutoOrientation, false);
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);
\r
#endif
\r
setAttribute(Qt::WA_Maemo5PortraitOrientation, true);
\r
setAttribute(Qt::WA_Maemo5LandscapeOrientation, false);
\r
#endif
\r
@@
-144,8
+158,10
@@
void MainForm::on_actionRotate_triggered()
{
\r
qDebug() << "Rotate";
\r
\r
{
\r
qDebug() << "Rotate";
\r
\r
- landscape = !tempLandscapeMode;
\r
+ landscape = (width() < height());
\r
settings->setValue(LANDSCAPE, landscape);
\r
settings->setValue(LANDSCAPE, landscape);
\r
+ ui->actionAuto_Orientation->setChecked(false);
\r
+ settings->setValue(AUTO_ORIENTATION, ui->actionAuto_Orientation->isChecked());
\r
setLandscapeMode(landscape);
\r
}
\r
\r
setLandscapeMode(landscape);
\r
}
\r
\r
@@
-175,6
+191,8
@@
void MainForm::closeEvent(QCloseEvent *event)
\r
void MainForm::on_actionAuto_Orientation_triggered()
\r
{
\r
\r
void MainForm::on_actionAuto_Orientation_triggered()
\r
{
\r
+ settings->setValue(AUTO_ORIENTATION, ui->actionAuto_Orientation->isChecked());
\r
+ qDebug() << "Auto orientation" << ui->actionAuto_Orientation->isChecked();
\r
if(ui->actionAuto_Orientation->isChecked())
\r
{
\r
#ifdef Q_WS_MAEMO_5
\r
if(ui->actionAuto_Orientation->isChecked())
\r
{
\r
#ifdef Q_WS_MAEMO_5
\r
@@
-185,9
+203,12
@@
void MainForm::on_actionAuto_Orientation_triggered()
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
-#ifdef Q_WS_MAEMO_5
\r
- setAttribute(Qt::WA_Maemo5AutoOrientation, false);
\r
-#endif
\r
setLandscapeMode(landscape);
\r
}
\r
}
\r
setLandscapeMode(landscape);
\r
}
\r
}
\r
+
\r
+void MainForm::on_actionSort_A_Z_triggered()
\r
+{
\r
+ settings->setValue(SORT_A_Z, ui->actionSort_A_Z->isChecked());
\r
+ MyCheckBoxContainer::getInstance()->setSortAlphabetically(ui->actionSort_A_Z->isChecked());
\r
+}
\r
diff --git
a/src/mainform.h
b/src/mainform.h
index
0155c51
..
6954f66
100755
(executable)
--- a/
src/mainform.h
+++ b/
src/mainform.h
@@
-22,7
+22,9
@@
#define CHECKED_ITEMS_TO_BOTTOM "CheckedItemsToBottom"
#define LANDSCAPE "Landscape"
#define PORTRAIT "Portrait"
#define CHECKED_ITEMS_TO_BOTTOM "CheckedItemsToBottom"
#define LANDSCAPE "Landscape"
#define PORTRAIT "Portrait"
+#define AUTO_ORIENTATION "AutoOrientation"
#define LIST_TEXT "ListText"
#define LIST_TEXT "ListText"
+#define SORT_A_Z "SortAlphabetically"
namespace Ui {
class MainForm;
namespace Ui {
class MainForm;
@@
-55,6
+57,7
@@
protected:
void closeEvent(QCloseEvent *event);
private slots:
void closeEvent(QCloseEvent *event);
private slots:
+ void on_actionSort_A_Z_triggered();
void on_actionAuto_Orientation_triggered();
void on_actionChecked_bottom_triggered();
void on_actionAbout_triggered();
void on_actionAuto_Orientation_triggered();
void on_actionChecked_bottom_triggered();
void on_actionAbout_triggered();
diff --git
a/src/mainform.ui
b/src/mainform.ui
index
3c7b546
..
6a59343
100755
(executable)
--- a/
src/mainform.ui
+++ b/
src/mainform.ui
@@
-53,7
+53,7
@@
</widget>
\r
<widget class="QMenu" name="menuChecked_bottom">
\r
<property name="title">
\r
</widget>
\r
<widget class="QMenu" name="menuChecked_bottom">
\r
<property name="title">
\r
- <string>Checked bottom</string>
\r
+ <string>Checked to bottom</string>
\r
</property>
\r
<addaction name="actionChecked_bottom"/>
\r
</widget>
\r
</property>
\r
<addaction name="actionChecked_bottom"/>
\r
</widget>
\r
@@
-63,6
+63,13
@@
</property>
\r
<addaction name="actionAuto_Orientation"/>
\r
</widget>
\r
</property>
\r
<addaction name="actionAuto_Orientation"/>
\r
</widget>
\r
+ <widget class="QMenu" name="menuSort_A_Z">
\r
+ <property name="title">
\r
+ <string>Sort A-Z</string>
\r
+ </property>
\r
+ <addaction name="actionSort_A_Z"/>
\r
+ </widget>
\r
+ <addaction name="menuSort_A_Z"/>
\r
<addaction name="menuChecked_bottom"/>
\r
<addaction name="menuRotate"/>
\r
<addaction name="menuAuto_Orientation"/>
\r
<addaction name="menuChecked_bottom"/>
\r
<addaction name="menuRotate"/>
\r
<addaction name="menuAuto_Orientation"/>
\r
@@
-83,7
+90,7
@@
<bool>true</bool>
\r
</property>
\r
<property name="text">
\r
<bool>true</bool>
\r
</property>
\r
<property name="text">
\r
- <string>Checked bottom</string>
\r
+ <string>Checked to bottom</string>
\r
</property>
\r
</action>
\r
<action name="actionAuto_Orientation">
\r
</property>
\r
</action>
\r
<action name="actionAuto_Orientation">
\r
@@
-94,6
+101,14
@@
<string>Auto Orientation</string>
\r
</property>
\r
</action>
\r
<string>Auto Orientation</string>
\r
</property>
\r
</action>
\r
+ <action name="actionSort_A_Z">
\r
+ <property name="checkable">
\r
+ <bool>true</bool>
\r
+ </property>
\r
+ <property name="text">
\r
+ <string>Sort A-Z</string>
\r
+ </property>
\r
+ </action>
\r
</widget>
\r
<resources/>
\r
<connections/>
\r
</widget>
\r
<resources/>
\r
<connections/>
\r
diff --git
a/src/mycheckboxcontainer.cpp
b/src/mycheckboxcontainer.cpp
index
5296f17
..
edcab32
100755
(executable)
--- a/
src/mycheckboxcontainer.cpp
+++ b/
src/mycheckboxcontainer.cpp
@@
-8,6
+8,7
@@
MyCheckBoxContainer::MyCheckBoxContainer()
++instances;
\r
qDebug() << "MyCheckBoxContainer instances:" << instances;
\r
sortToBottom = false;
\r
++instances;
\r
qDebug() << "MyCheckBoxContainer instances:" << instances;
\r
sortToBottom = false;
\r
+ sortAlphabetically = false;
\r
}
\r
\r
MyCheckBoxContainer::~MyCheckBoxContainer()
\r
}
\r
\r
MyCheckBoxContainer::~MyCheckBoxContainer()
\r
@@
-29,6
+30,10
@@
MyCheckBoxContainer * MyCheckBoxContainer::getInstance()
void MyCheckBoxContainer::add(QString item)
\r
{
\r
QStringList list = item.split("\n");
\r
void MyCheckBoxContainer::add(QString item)
\r
{
\r
QStringList list = item.split("\n");
\r
+ if(sortAlphabetically)
\r
+ {
\r
+ list.sort();
\r
+ }
\r
foreach(QString item, list)
\r
{
\r
if(item.length() > 0)
\r
foreach(QString item, list)
\r
{
\r
if(item.length() > 0)
\r
@@
-52,6
+57,7
@@
void MyCheckBoxContainer::add(QString item)
\r
void MyCheckBoxContainer::set(QString item)
\r
{
\r
\r
void MyCheckBoxContainer::set(QString item)
\r
{
\r
+ qDebug() << item;
\r
clear();
\r
add(item);
\r
}
\r
clear();
\r
add(item);
\r
}
\r
@@
-77,11
+83,43
@@
void MyCheckBoxContainer::sortCheckedToBottom()
{
\r
if(item->isChecked())
\r
{
\r
{
\r
if(item->isChecked())
\r
{
\r
- tempListChecked.append(item);
\r
+ if(sortAlphabetically)
\r
+ {
\r
+ int size = tempListChecked.size();
\r
+ int pos = 0;
\r
+ for(pos = 0; pos < size; ++pos)
\r
+ {
\r
+ if(tempListChecked[pos]->text() > item->text())
\r
+ {
\r
+ break;
\r
+ }
\r
+ }
\r
+ tempListChecked.insert(pos, item);
\r
+ }
\r
+ else
\r
+ {
\r
+ tempListChecked.append(item);
\r
+ }
\r
}
\r
else
\r
{
\r
}
\r
else
\r
{
\r
- tempList.append(item);
\r
+ if(sortAlphabetically)
\r
+ {
\r
+ int size = tempList.size();
\r
+ int pos = 0;
\r
+ for(pos = 0; pos < size; ++pos)
\r
+ {
\r
+ if(tempList[pos]->text() > item->text())
\r
+ {
\r
+ break;
\r
+ }
\r
+ }
\r
+ tempList.insert(pos, item);
\r
+ }
\r
+ else
\r
+ {
\r
+ tempList.append(item);
\r
+ }
\r
}
\r
}
\r
checkBoxes.clear();
\r
}
\r
}
\r
checkBoxes.clear();
\r
@@
-117,6
+155,10
@@
void MyCheckBoxContainer::uncheckAll()
{
\r
item->setChecked(false);
\r
}
\r
{
\r
item->setChecked(false);
\r
}
\r
+ if(sortAlphabetically)
\r
+ {
\r
+ set(getListText());
\r
+ }
\r
}
\r
\r
void MyCheckBoxContainer::removeChecked()
\r
}
\r
\r
void MyCheckBoxContainer::removeChecked()
\r
@@
-140,6
+182,15
@@
void MyCheckBoxContainer::setSortCheckedToBottom(bool sortToBottom)
sortCheckedToBottom();
\r
}
\r
\r
sortCheckedToBottom();
\r
}
\r
\r
+void MyCheckBoxContainer::setSortAlphabetically(bool sortAlphabetically)
\r
+{
\r
+ this->sortAlphabetically = sortAlphabetically;
\r
+ if(sortAlphabetically)
\r
+ {
\r
+ set(getListText());
\r
+ }
\r
+}
\r
+
\r
void MyCheckBoxContainer::clickedAction()
\r
{
\r
qDebug() << "Clicked a MyCheckBox";
\r
void MyCheckBoxContainer::clickedAction()
\r
{
\r
qDebug() << "Clicked a MyCheckBox";
\r
diff --git
a/src/mycheckboxcontainer.h
b/src/mycheckboxcontainer.h
index
efffb63
..
91f3de6
100755
(executable)
--- a/
src/mycheckboxcontainer.h
+++ b/
src/mycheckboxcontainer.h
@@
-24,6
+24,7
@@
public:
void uncheckAll();
\r
void removeChecked();
\r
void setSortCheckedToBottom(bool sortToBottom);
\r
void uncheckAll();
\r
void removeChecked();
\r
void setSortCheckedToBottom(bool sortToBottom);
\r
+ void setSortAlphabetically(bool sortAlphabetically);
\r
void sortCheckedToBottom();
\r
\r
private:
\r
void sortCheckedToBottom();
\r
\r
private:
\r
@@
-32,6
+33,7
@@
private:
static int instances;
\r
\r
bool sortToBottom;
\r
static int instances;
\r
\r
bool sortToBottom;
\r
+ bool sortAlphabetically;
\r
\r
MyCheckBoxContainer();
\r
signals:
\r
\r
MyCheckBoxContainer();
\r
signals:
\r