Skip to content

Commit

Permalink
permanently save last used directory
Browse files Browse the repository at this point in the history
next version is 1.4
  • Loading branch information
mistic100 committed Jan 6, 2014
1 parent c3efd51 commit 8eeda1a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ UMWP Autochanger is a little tool for [UltraMon](http://www.realtimesoft.com/ult
* randomly and periodically change the wallpaper of all your monitors,
* manage sets of wallpapers, allowing you to quickly change which images are used.

Version : 1.4-SNAPSHOT
Release date : ??/??/2014
Version : 1.4
Release date : 06/01/2014
Author : Damien "Mistic" Sorel
Website : http://www.strangeplanet.fr/work/umwp-autochanger
License : GNU General Public License Version 3
Expand Down Expand Up @@ -63,8 +63,9 @@ You will need Qt 4.8.4 and libqxt 0.6.2


## Changelog
* 1.4 (??/??/2014)
* [1.4 (06/01/2014)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.4)
* new: more flexibility for hot keys + new hotkeys for refresh, start/pause, show/hide
* new: permanently save last used directory

* [1.3 (03/12/2013)](http://www.strangeplanet.fr/work/umwp-autochanger/download.php?ver=1.3)
* new: can choose the type of wallpaper ('monitor' or 'desktop') and the style ('center', 'tile', 'stretch', 'stretch proportional')
Expand Down
10 changes: 7 additions & 3 deletions src/mainwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ MainWidget::MainWidget(QWidget* _parent, Controller* _poCtrl) : QWidget(_parent)
{
ui->setupUi(this);

m_sLastDir = QDir::homePath();
m_poCtrl = _poCtrl;

connect(m_poCtrl, SIGNAL(listChanged(bool)), this, SLOT(slotUpdateList(bool)));
Expand Down Expand Up @@ -101,13 +100,18 @@ QList<int> MainWidget::aiGetSelectedIndexes()
*/
void MainWidget::on_m_poButtonAdd_clicked()
{
QString sDirname = QFileDialog::getExistingDirectory(this, tr("Add"), m_sLastDir);
QString sLastDir = m_poCtrl->settings()->sParam("last_dir");
if (sLastDir.isEmpty())
{
sLastDir = QDir::homePath();
}
QString sDirname = QFileDialog::getExistingDirectory(this, tr("Add"), sLastDir);

if (!sDirname.isEmpty())
{
QDir oDir(sDirname);
oDir.cdUp();
m_sLastDir = oDir.absolutePath();
m_poCtrl->settings()->vSetParam("last_dir", oDir.absolutePath());

sDirname.replace('/', '\\');
m_poCtrl->vAddSet(sDirname);
Expand Down
1 change: 0 additions & 1 deletion src/mainwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class MainWidget : public QWidget
private:
Ui::MainWidget* ui;
Controller* m_poCtrl;
QString m_sLastDir;

public:
MainWidget(QWidget* _parent, Controller* _poCtrl);
Expand Down
1 change: 1 addition & 0 deletions src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Settings::Settings()
m_options["msgcount"] = 0;
m_options["use_hotkeys"] = false;
m_options["show_notifications"] = true;
m_options["last_dir"] = QVariant();

m_hotkeys["refresh"] = Hotkey();
m_hotkeys["startpause"] = Hotkey();
Expand Down

0 comments on commit 8eeda1a

Please sign in to comment.