aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/panel-plugins
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-11-24 19:26:13 +0000
committerWeblate <noreply@weblate.org>2017-11-24 19:26:13 +0000
commit56890dfdacb3272808dfaedee7f4d9208f6d5acc (patch)
tree2da40ddecdc429da1e495b3136d0c9dc61ef56c3 /src-qt5/core/lumina-desktop/panel-plugins
parentTranslated using Weblate (Hungarian) (diff)
parentMerge pull request #512 from schnitzeltony/master (diff)
downloadlumina-56890dfdacb3272808dfaedee7f4d9208f6d5acc.tar.gz
lumina-56890dfdacb3272808dfaedee7f4d9208f6d5acc.tar.bz2
lumina-56890dfdacb3272808dfaedee7f4d9208f6d5acc.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop/panel-plugins')
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp2
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp7
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp6
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp24
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h11
-rw-r--r--src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui45
6 files changed, 66 insertions, 29 deletions
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp
index 1fd819b5..98770f18 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/applauncher/AppLaunchButton.cpp
@@ -16,7 +16,7 @@ AppLaunchButtonPlugin::AppLaunchButtonPlugin(QWidget *parent, QString id, bool h
button->setAutoRaise(true);
button->setToolButtonStyle(Qt::ToolButtonIconOnly);
appfile = id.section("---",0,0).section("::",1,1);
- if(!QFile::exists(appfile) && appfile.endsWith(".desktop")){
+ if(!QFile::exists(appfile) && appfile.endsWith(".desktop")){
//might be a relative path - try to find the file
appfile = LUtils::AppToAbsolute(appfile.section("/",-1) );
}
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
index e6e89075..294b37be 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp
@@ -14,7 +14,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal)
label = new QToolButton(this);
label->setPopupMode(QToolButton::DelayedPopup);
label->setAutoRaise(true);
- label->setToolButtonStyle(Qt::ToolButtonIconOnly);
+ label->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
label->setIcon( LXDG::findIcon("format-view-carousel", "preferences-desktop-display") );
label->setToolTip(QString(tr("Workspace 1")));
connect(label, SIGNAL(clicked()), this, SLOT(openMenu()));
@@ -44,7 +44,7 @@ void LDesktopSwitcher::setNumberOfDesktops(int number) {
Atom atom = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False);
XEvent xevent;
xevent.type = ClientMessage;
- xevent.xclient.type = ClientMessage;
+ xevent.xclient.type = ClientMessage;
xevent.xclient.display = display;
xevent.xclient.window = rootWindow;
xevent.xclient.message_type = atom;
@@ -129,7 +129,7 @@ void LDesktopSwitcher::createMenu() {
int cur = LSession::handle()->XCB->CurrentWorkspace(); //current desktop number
int tot = LSession::handle()->XCB->NumberOfWorkspaces(); //total number of desktops
//qDebug() << "-- vor getCurrentDesktop SWITCH";
- qDebug() << "Virtual Desktops:" << tot << cur;
+ //qDebug() << "Virtual Desktops:" << tot << cur;
menu->clear();
for (int i = 0; i < tot; i++) {
QString name = QString(tr("Workspace %1")).arg( QString::number(i+1) );
@@ -137,6 +137,7 @@ void LDesktopSwitcher::createMenu() {
menu->addAction(newAction(i, name));
}
label->setToolTip(QString(tr("Workspace %1")).arg(QString::number(cur + 1)));
+ label->setText( QString::number(cur+1) );
}
void LDesktopSwitcher::menuActionTriggered(QAction* act) {
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
index 30e82c47..562122ae 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/LStartButton.cpp
@@ -25,10 +25,10 @@ LStartButtonPlugin::LStartButtonPlugin(QWidget *parent, QString id, bool horizon
startmenu = new StartMenu(this);
connect(startmenu, SIGNAL(CloseMenu()), this, SLOT(closeMenu()) );
connect(startmenu, SIGNAL(UpdateQuickLaunch(QStringList)), this, SLOT(updateQuickLaunch(QStringList)));
- menu->setContents(startmenu);
- QRect screenSize = QApplication::desktop()->availableGeometry(this);
- QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(screenSize.width() * 0.2, screenSize.height())).toSize();
+ //QRect screenSize = QApplication::desktop()->availableGeometry(this);
+ QSize saved = LSession::handle()->DesktopPluginSettings()->value("panelPlugs/"+this->type()+"/MenuSize", QSize(0, 0)).toSize();
if(!saved.isNull()){ startmenu->setFixedSize(saved); } //re-load the previously saved value
+ menu->setContents(startmenu);
button->setMenu(menu);
connect(menu, SIGNAL(aboutToHide()), this, SLOT(updateButtonVisuals()) );
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
index c99e2b4b..272bf0fa 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp
@@ -63,7 +63,7 @@ void StartMenu::UpdateAll(){
ui->tool_restart->setIcon(LXDG::findIcon("system-reboot",""));
ui->tool_shutdown->setIcon(LXDG::findIcon("system-shutdown",""));
ui->tool_suspend->setIcon(LXDG::findIcon("system-suspend",""));
-
+
//Update Visibility of system/session/OS options
// -- Control Panel
QString tmp = LOS::ControlPanelShortcut();
@@ -507,6 +507,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){
tmp = LOS::audioVolume();
ui->frame_audio->setVisible(tmp >= 0);
if(tmp >= 0){ ui->slider_volume->setValue(tmp); }
+
}else if(page == ui->page_leave){
if( !ui->frame_leave_system->whatsThis().isEmpty() ){
//This frame is allowed/visible - need to adjust the shutdown detection
@@ -514,6 +515,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){
ui->tool_restart->setEnabled(!updating);
ui->tool_shutdown->setEnabled(!updating);
ui->label_updating->setVisible(updating); //to let the user know *why* they can't shutdown/restart right now
+ ui->tool_restart_updates->setVisible(!updating && !LOS::systemPendingUpdates().isEmpty() );
}
ui->frame_leave_suspend->setVisible( LOS::systemCanSuspend() );
}
@@ -590,17 +592,25 @@ void StartMenu::on_tool_logout_clicked(){
void StartMenu::on_tool_restart_clicked(){
emit CloseMenu();
QCoreApplication::processEvents();
- bool skipupdates = false;
- if( !promptAboutUpdates(skipupdates) ){ return; }
- LSession::handle()->StartReboot(skipupdates);
+ //bool skipupdates = false;
+ //if( !promptAboutUpdates(skipupdates) ){ return; }
+ LSession::handle()->StartReboot(true);
+}
+
+void StartMenu::on_tool_restart_update_clicked(){
+ emit CloseMenu();
+ QCoreApplication::processEvents();
+ //bool skipupdates = false;
+ //if( !promptAboutUpdates(skipupdates) ){ return; }
+ LSession::handle()->StartReboot(false);
}
void StartMenu::on_tool_shutdown_clicked(){
emit CloseMenu();
QCoreApplication::processEvents();
- bool skipupdates = false;
- if( !promptAboutUpdates(skipupdates) ){ return; }
- LSession::handle()->StartShutdown(skipupdates);
+ //bool skipupdates = false;
+ //if( !promptAboutUpdates(skipupdates) ){ return; }
+ LSession::handle()->StartShutdown();
}
void StartMenu::on_tool_suspend_clicked(){
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
index e2dbb273..41bc3ec4 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.h
@@ -73,6 +73,7 @@ private slots:
void on_tool_lock_clicked();
void on_tool_logout_clicked();
void on_tool_restart_clicked();
+ void on_tool_restart_update_clicked();
void on_tool_shutdown_clicked();
void on_tool_suspend_clicked();
@@ -80,17 +81,17 @@ private slots:
void on_slider_volume_valueChanged(int);
void on_tool_launch_mixer_clicked();
void on_tool_mute_audio_clicked();
-
+
//Screen Brightness
void on_slider_bright_valueChanged(int);
-
+
//Workspace
void on_tool_set_nextwkspace_clicked();
void on_tool_set_prevwkspace_clicked();
-
+
//Locale
void on_combo_locale_currentIndexChanged(int);
-
+
//Search
void on_line_search_textEdited(QString);
void startSearch();
@@ -99,7 +100,7 @@ private slots:
signals:
void CloseMenu();
void UpdateQuickLaunch(QStringList);
-
+
};
#endif
diff --git a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui
index d374bfce..500b6559 100644
--- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui
+++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.ui
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>181</width>
- <height>405</height>
+ <width>336</width>
+ <height>466</height>
</rect>
</property>
<property name="windowTitle">
@@ -42,7 +42,7 @@
<item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
- <number>4</number>
+ <number>3</number>
</property>
<widget class="QWidget" name="page_main">
<layout class="QVBoxLayout" name="verticalLayout_2">
@@ -142,8 +142,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>179</width>
- <height>208</height>
+ <width>334</width>
+ <height>102</height>
</rect>
</property>
</widget>
@@ -438,8 +438,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>179</width>
- <height>299</height>
+ <width>334</width>
+ <height>277</height>
</rect>
</property>
</widget>
@@ -1003,6 +1003,31 @@
</widget>
</item>
<item>
+ <widget class="QToolButton" name="tool_restart_updates">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">QToolButton{ background-color: rgba(150,150,0,100); }</string>
+ </property>
+ <property name="text">
+ <string>Update and Restart</string>
+ </property>
+ <property name="icon">
+ <iconset theme="system-reboot"/>
+ </property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextBesideIcon</enum>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="QToolButton" name="tool_shutdown">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -1033,7 +1058,7 @@
<item>
<widget class="QLabel" name="label_updating">
<property name="text">
- <string>(System Performing Updates)</string>
+ <string>(System Preparing Updates)</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@@ -1099,8 +1124,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>167</width>
- <height>345</height>
+ <width>308</width>
+ <height>351</height>
</rect>
</property>
</widget>
bgstack15