Skip to content

Commit

Permalink
Set attributes according to administrative privileges status
Browse files Browse the repository at this point in the history
The action now has different label, icon and tooltip according to the
administrative privileges status.

Issue: #11
  • Loading branch information
plfiorini committed Feb 3, 2013
1 parent 6c539c6 commit 879e07c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/app/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,16 @@ void MainWindow::createUnlockAction(PreferencesModule *module)
return;

m_unlockAction = new PolkitQt1::Gui::Action(module->administrativeActionId(), this);
m_unlockAction->setIcon(QIcon::fromTheme("changes-allow"));
m_unlockAction->setToolTip(tr("Dialog is locked, click to make changes"));
m_unlockAction->setIcon(QIcon::fromTheme("changes-allow"),
PolkitQt1::Gui::Action::Auth);
m_unlockAction->setText(tr("Unlock"), PolkitQt1::Gui::Action::Auth);
m_unlockAction->setToolTip(tr("Dialog is locked, click to make changes"),
PolkitQt1::Gui::Action::Auth);
m_unlockAction->setText(tr("Lock"), PolkitQt1::Gui::Action::SelfBlocked);
m_unlockAction->setIcon(QIcon::fromTheme("changes-prevent"),
PolkitQt1::Gui::Action::SelfBlocked);
m_unlockAction->setToolTip(tr("Dialog is unlocked, click to prevent further changes"),
PolkitQt1::Gui::Action::SelfBlocked);
m_unlockAction->setTargetPID(QCoreApplication::instance()->applicationPid());
m_toolBar->addAction(m_unlockAction);
connect(m_unlockAction, SIGNAL(triggered()),
Expand Down

0 comments on commit 879e07c

Please sign in to comment.