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
<qtcreator>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
- <value type="int">1</value>
+ <value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
\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
}\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
- 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
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
- setLandscapeMode(landscape);\r
+ if(closed == false)\r
+ {\r
+ setLandscapeMode(true);\r
+ }\r
+ else\r
+ {\r
+ setLandscapeMode(landscape);\r
+ }\r
}\r
}\r
\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
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
{\r
qDebug() << "Rotate";\r
\r
- landscape = !tempLandscapeMode;\r
+ landscape = (width() < height());\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
\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
}\r
else\r
{\r
-#ifdef Q_WS_MAEMO_5\r
- setAttribute(Qt::WA_Maemo5AutoOrientation, false);\r
-#endif\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
#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"
namespace Ui {
class MainForm;
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();
</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="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
<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
<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
++instances;\r
qDebug() << "MyCheckBoxContainer instances:" << instances;\r
sortToBottom = false;\r
+ sortAlphabetically = false;\r
}\r
\r
MyCheckBoxContainer::~MyCheckBoxContainer()\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
\r
void MyCheckBoxContainer::set(QString item)\r
{\r
+ qDebug() << item;\r
clear();\r
add(item);\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
- 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
item->setChecked(false);\r
}\r
+ if(sortAlphabetically)\r
+ {\r
+ set(getListText());\r
+ }\r
}\r
\r
void MyCheckBoxContainer::removeChecked()\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 uncheckAll();\r
void removeChecked();\r
void setSortCheckedToBottom(bool sortToBottom);\r
+ void setSortAlphabetically(bool sortAlphabetically);\r
void sortCheckedToBottom();\r
\r
private:\r
static int instances;\r
\r
bool sortToBottom;\r
+ bool sortAlphabetically;\r
\r
MyCheckBoxContainer();\r
signals:\r