Skip to content

Commit

Permalink
Fixed issue Razor-qt#645 "Panel plugins settings cleanup"
Browse files Browse the repository at this point in the history
  • Loading branch information
SokoloffA committed Aug 1, 2013
1 parent 2419399 commit b078973
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions razorqt-panel/panel/plugin.cpp
Expand Up @@ -69,6 +69,7 @@ Plugin::Plugin(const RazorPluginInfo &desktopFile, const QString &settingsFile,
mSettingsHash = calcSettingsHash();

setWindowTitle(desktopFile.name());
mName = desktopFile.name();

QStringList dirs;
dirs << QProcessEnvironment::systemEnvironment().value("RAZORPANEL_PLUGIN_PATH").split(":");
Expand Down Expand Up @@ -305,23 +306,23 @@ void Plugin::showEvent(QShowEvent *)
************************************************/
QMenu *Plugin::popupMenu() const
{

QString name = this->name().replace("&", "&&");
QMenu* menu = new QMenu(windowTitle());

if (mPlugin->flags().testFlag(IRazorPanelPlugin::HaveConfigDialog))
{
QAction* configAction = new QAction(tr("Configure"), menu);
QAction* configAction = new QAction(tr("Configure \"%1\"").arg(name), menu);
menu->addAction(configAction);
connect(configAction, SIGNAL(triggered()), this, SLOT(showConfigureDialog()));
}

QAction* moveAction = new QAction(XdgIcon::fromTheme("transform-move"), tr("Move"), menu);
QAction* moveAction = new QAction(XdgIcon::fromTheme("transform-move"), tr("Move \"%1\"").arg(name), menu);
menu->addAction(moveAction);
connect(moveAction, SIGNAL(triggered()), this, SIGNAL(startMove()));

menu->addSeparator();

QAction* removeAction = new QAction(XdgIcon::fromTheme("dialog-close"), tr("Remove"), menu);
QAction* removeAction = new QAction(XdgIcon::fromTheme("dialog-close"), tr("Remove \"%1\"").arg(name), menu);
menu->addAction(removeAction);
connect(removeAction, SIGNAL(triggered()), this, SLOT(requestRemove()));

Expand Down
3 changes: 3 additions & 0 deletions razorqt-panel/panel/plugin.h
Expand Up @@ -76,6 +76,8 @@ class Plugin : public QFrame

QWidget *widget() { return mPluginWidget; }

QString name() const { return mName; }

// For QSS properties ..................
static QColor moveMarkerColor() { return mMoveMarkerColor; }
static void setMoveMarkerColor(QColor color) { mMoveMarkerColor = color; }
Expand Down Expand Up @@ -107,6 +109,7 @@ public slots:
RazorPanel *mPanel;
QByteArray mSettingsHash;
static QColor mMoveMarkerColor;
QString mName;

private slots:
void settingsChanged();
Expand Down

0 comments on commit b078973

Please sign in to comment.