~ubuntu-branches/ubuntu/oneiric/psi/oneiric

« back to all changes in this revision

Viewing changes to src/options/toolbardlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2006-01-20 00:20:36 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060120002036-7nw6yo6totip0ee5
Tags: 0.10-2
* Added upstream changelog (Closes: Bug#327748)
* Mention --no-gpg and --no-gpg-agent in manpage (Closes: Bug#204416)

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
        IconButton *pb_ok = new IconButton( this );
226
226
        hbox->addWidget( pb_ok );
227
227
        pb_ok->setText( tr("&OK") );
228
 
        pb_ok->setIcon( "psi/ok" );
229
228
        connect(pb_ok, SIGNAL(clicked()), SLOT(doApply()));
230
229
        connect(pb_ok, SIGNAL(clicked()), SLOT(accept()));
231
230
 
239
238
        IconButton *pb_cancel = new IconButton( this );
240
239
        hbox->addWidget( pb_cancel );
241
240
        pb_cancel->setText( tr("&Cancel") );
242
 
        pb_cancel->setIcon( "psi/cancel" );
243
241
        connect(pb_cancel, SIGNAL(clicked()), SLOT(reject()));
244
242
 
245
243
        restoreOptions( &option );
317
315
 
318
316
        LookFeelToolbarsUI *d = (LookFeelToolbarsUI *)w;
319
317
        opt->toolbars = o->toolbars;
 
318
        opt->hideMenubar = o->hideMenubar;
320
319
 
321
320
        rebuildToolbarList();
322
321
 
666
665
 
667
666
void ToolbarDlg::doApply()
668
667
{
669
 
        int count = 0;
670
 
        QValueList<Options::ToolbarPrefs>::Iterator it = opt->toolbars["mainWin"].begin();
671
 
        for ( ; it != opt->toolbars["mainWin"].end(); ++it) {
672
 
                if ( (*it).on )
673
 
                        count++;
 
668
        // Check if all toolbars are disabled
 
669
        bool toolbarsVisible = false;
 
670
        QValueList<Options::ToolbarPrefs>::ConstIterator it = opt->toolbars["mainWin"].begin();
 
671
        for ( ; it != opt->toolbars["mainWin"].end() && !toolbarsVisible; ++it) {
 
672
                toolbarsVisible = toolbarsVisible || (*it).on;
674
673
        }
675
674
 
676
675
        // Undar MacOS, we have the toolbar in a menu anyway
677
676
#ifndef Q_WS_MAC
678
 
        if ( !count ) {
 
677
        if ( !toolbarsVisible && opt->hideMenubar) {
679
678
                QMessageBox::warning(this, tr("Warning"),
680
 
                                     tr("You can not disable <i>all</i> toolbars. If you do so, you will be unable to enable them back, when you'll change your mind.\n"
681
 
                                        "<br><br>\n"
682
 
                                        "If you really-really want to disable all toolbars, you need to edit the config.xml file by hand."),
683
 
                                     tr("I understand"));
 
679
                        tr("You can not disable <i>all</i> toolbars <i>and</i> the menubar. If you do so, you will be unable to enable them back, when you'll change your mind.\n"
 
680
                                "<br><br>\n"
 
681
                                "If you really-really want to disable all toolbars and the menubar, you need to edit the config.xml file by hand."),
 
682
                        tr("OK"));
684
683
                return;
685
684
        }
686
685
#endif