Projet

Général

Profil

Révision 61556262

Voir les différences:

original.cpp
54 54

  
55 55
    ui->stackedWidget->setCurrentWidget(ui->page);
56 56

  
57
    QDir dir(QDir::homePath() + "/RyXeo-WebPhotoAlbum");
58
    dir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
59
    QFileInfoList list = dir.entryInfoList();
57
    m_baseDir = QDir(QDir::homePath() + "/RyXeo-WebPhotoAlbum");
58
    m_baseDir.setFilter(QDir::Dirs | QDir::NoSymLinks | QDir::NoDotAndDotDot);
59
    QFileInfoList list = m_baseDir.entryInfoList();
60 60
    for(int i = 0; i < list.count(); i++) {
61 61
        QTreeWidgetItem *item = new QTreeWidgetItem(ui->treeWidget);
62 62
        item->setText(0, list.at(i).fileName());
......
220 220

  
221 221
void original::on_action_Nouvel_album_triggered()
222 222
{
223
    bool ok;
224
    QString text = QInputDialog::getText(this, trUtf8("Nom du nouvel album à créer"),
225
                                         trUtf8("Nom du nouvel album à créer"), QLineEdit::Normal,
226
                                         QDir::home().dirName(), &ok);
227
    //Si ce nom n'existe pas déjà ...
223 228
    QTreeWidgetItem *i = new QTreeWidgetItem(ui->treeWidget);
224
    i->setText(0, trUtf8("Nouvel album"));
229
    i->setText(0, text);
230
    QDir d(m_baseDir.absolutePath() + "/" + text);
231
    d.mkpath(d.absolutePath());
225 232
}
226 233

  
227 234
void original::on_treeWidget_itemClicked(QTreeWidgetItem *item, int column)
original.h
32 32
#include <QTreeWidgetItem>
33 33
#include <QListWidgetItem>
34 34
#include <QMenu>
35
#include <QInputDialog>
36

  
35 37

  
36 38
namespace Ui {
37 39
class original;
......
56 58

  
57 59
private:
58 60
    Ui::original *ui;
61
    QDir m_baseDir;
59 62
    QMenu *m_menu;
60 63
};
61 64

  

Formats disponibles : Unified diff

Redmine Appliance - Powered by TurnKey Linux