~ubuntu-branches/ubuntu/trusty/krusader/trusty

« back to all changes in this revision

Viewing changes to krusader/Konfigurator/konfigurator.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-08-08 13:47:36 UTC
  • mfrom: (1.2.19 upstream)
  • Revision ID: james.westby@ubuntu.com-20110808134736-8e630ivgd2c3sgg5
Tags: 1:2.4.0~beta1-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
Konfigurator::Konfigurator(bool f, int startPage) : KPageDialog((QWidget *)0),
64
64
        firstTime(f), internalCall(false), sizeX(-1), sizeY(-1)
65
65
{
66
 
    setButtons(KDialog::Help | KDialog::User1 | KDialog::Apply | KDialog::Cancel);
 
66
    setButtons(KDialog::Help | KDialog::Default | KDialog::Reset | KDialog::Apply | KDialog::Close);
67
67
    setDefaultButton(KDialog::Apply);
68
68
    setWindowTitle(i18n("Konfigurator"));
69
 
    setButtonGuiItem(KDialog::User1, KGuiItem(i18n("Defaults")));
70
69
    setWindowModality(Qt::WindowModal);
71
70
 
72
71
    setPlainCaption(i18n("Konfigurator - Creating Your Own Krusader"));
73
72
    setFaceType(KPageDialog::List);
74
73
 
75
 
    setButtonGuiItem(KDialog::Cancel, KGuiItem(i18n("Close")));
76
 
 
77
74
    setHelp("konfigurator");
78
75
 
79
76
    connect(this, SIGNAL(currentPageChanged(KPageWidgetItem *, KPageWidgetItem *)), this, SLOT(slotPageSwitch(KPageWidgetItem *, KPageWidgetItem *)));
80
77
    connect(&restoreTimer, SIGNAL(timeout()), this, SLOT(slotRestorePage()));
81
 
    connect(this, SIGNAL(applyClicked()), this, SLOT(slotApply()));
82
 
    connect(this, SIGNAL(cancelClicked()), this, SLOT(slotCancel())); 
83
 
    connect(this, SIGNAL(user1Clicked()), this, SLOT(slotUser1()));
84
78
 
85
79
    createLayout(startPage);
86
80
 
186
180
    case Apply:
187
181
        emit configChanged(((KonfiguratorPage*)(currentPage()->widget()))->apply());
188
182
        break;
189
 
    case Cancel:
 
183
    case Close:
190
184
        lastPage = currentPage();
191
185
        if (slotPageSwitch(lastPage, lastPage))
192
186
            reject();
193
187
        break;
194
 
    case User1:
 
188
    case Default:
195
189
        ((KonfiguratorPage *)(currentPage()->widget()))->setDefaults();
196
190
        break;
 
191
    case Reset:
 
192
        ((KonfiguratorPage *)(currentPage()->widget()))->loadInitialValues();
 
193
        break;
197
194
    default:
198
195
        KPageDialog::slotButtonClicked(button);
199
196
    }
203
200
{
204
201
    lastPage = currentPage();
205
202
    enableButtonApply(((KonfiguratorPage *)(lastPage->widget()))->isChanged());
 
203
    enableButton(Reset, ((KonfiguratorPage *)(lastPage->widget()))->isChanged());
206
204
}
207
205
 
208
206
bool Konfigurator::slotPageSwitch(KPageWidgetItem *current, KPageWidgetItem *before)