diff options
Diffstat (limited to 'src-qt5')
9 files changed, 50 insertions, 76 deletions
diff --git a/src-qt5/core/libLumina/LDesktopUtils.cpp b/src-qt5/core/libLumina/LDesktopUtils.cpp index 4c87ae22..fe4cfd30 100644 --- a/src-qt5/core/libLumina/LDesktopUtils.cpp +++ b/src-qt5/core/libLumina/LDesktopUtils.cpp @@ -143,6 +143,8 @@ void LDesktopUtils::upgradeFavorites(int){ //fromoldversionnumber void LDesktopUtils::LoadSystemDefaults(bool skipOS){ //Will create the Lumina configuration files based on the current system template (if any) qDebug() << "Loading System Defaults"; + bool skipmime = QFile::exists( QString(getenv("XDG_CONFIG_HOME"))+"/lumina-mimapps.list" ); + qDebug() << " - Skipping mimetype default apps" << skipmime; QStringList sysDefaults; if(!skipOS){ sysDefaults = LUtils::readFile(LOS::AppPrefix()+"etc/luminaDesktop.conf"); } if(sysDefaults.isEmpty() && !skipOS){ sysDefaults = LUtils::readFile(LOS::AppPrefix()+"etc/luminaDesktop.conf.dist"); } @@ -193,18 +195,18 @@ void LDesktopUtils::LoadSystemDefaults(bool skipOS){ if(var=="session_enablenumlock"){ sset = "EnableNumlock="+ istrue; } else if(var=="session_playloginaudio"){ sset = "PlayStartupAudio="+istrue; } else if(var=="session_playlogoutaudio"){ sset = "PlayLogoutAudio="+istrue; } - else if(var=="session_default_terminal"){ + else if(var=="session_default_terminal" && !skipmime){ LXDG::setDefaultAppForMime("application/terminal", val); //sset = "default-terminal="+val; - }else if(var=="session_default_filemanager"){ + }else if(var=="session_default_filemanager" && !skipmime){ LXDG::setDefaultAppForMime("inode/directory", val); //sset = "default-filemanager="+val; //loset = "directory="+val; - }else if(var=="session_default_webbrowser"){ + }else if(var=="session_default_webbrowser" && !skipmime){ //loset = "webbrowser="+val; LXDG::setDefaultAppForMime("x-scheme-handler/http", val); LXDG::setDefaultAppForMime("x-scheme-handler/https", val); - }else if(var=="session_default_email"){ + }else if(var=="session_default_email" && !skipmime){ LXDG::setDefaultAppForMime("application/email",val); //loset = "email="+val; } @@ -225,7 +227,7 @@ void LDesktopUtils::LoadSystemDefaults(bool skipOS){ // -- MIMETYPE DEFAULTS -- tmp = sysDefaults.filter("mime_default_"); - for(int i=0; i<tmp.length(); i++){ + for(int i=0; i<tmp.length() && !skipmime; i++){ if(tmp[i].startsWith("#") || !tmp[i].contains("=") ){ continue; } QString var = tmp[i].section("=",0,0).toLower().simplified(); QString val = tmp[i].section("=",1,1).section("#",0,0).simplified(); diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index bbed6d79..2a1ec783 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -572,7 +572,7 @@ void LSession::SessionEnding(){ // SYSTEM ACCESS //=============== void LSession::LaunchApplication(QString cmd){ - LSession::setOverrideCursor(QCursor(Qt::BusyCursor)); + //LSession::setOverrideCursor(QCursor(Qt::BusyCursor)); ExternalProcess::launch(cmd); //QProcess::startDetached(cmd); } 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 8e0a9d28..e6e89075 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/desktopswitcher/LDesktopSwitcher.cpp @@ -16,7 +16,7 @@ LDesktopSwitcher::LDesktopSwitcher(QWidget *parent, QString id, bool horizontal) label->setAutoRaise(true); label->setToolButtonStyle(Qt::ToolButtonIconOnly); label->setIcon( LXDG::findIcon("format-view-carousel", "preferences-desktop-display") ); - label->setToolTip(QString("Workspace 1")); + label->setToolTip(QString(tr("Workspace 1"))); connect(label, SIGNAL(clicked()), this, SLOT(openMenu())); menu = new QMenu(this); connect(menu, SIGNAL(triggered(QAction*)), this, SLOT(menuActionTriggered(QAction*))); 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 1992db0f..e8df8390 100644 --- a/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp +++ b/src-qt5/core/lumina-desktop/panel-plugins/systemstart/StartMenu.cpp @@ -35,15 +35,15 @@ StartMenu::StartMenu(QWidget *parent) : QWidget(parent), ui(new Ui::StartMenu){ } StartMenu::~StartMenu(){ - + } void StartMenu::UpdateAll(){ //Update all the icons/text on all the pages - + // Update Text ui->retranslateUi(this); - + //Update Icons ui->tool_goto_apps->setIcon(LXDG::findIcon("system-run","")); ui->tool_goto_settings->setIcon(LXDG::findIcon("preferences-system","")); @@ -53,7 +53,7 @@ void StartMenu::UpdateAll(){ ui->tool_goto_logout->setIcon(LXDG::findIcon("system-log-out","")); ui->tool_back->setIcon(LXDG::findIcon("go-previous","")); ui->tool_launch_deskinfo->setIcon(LXDG::findIcon("system-help","")); - + ui->tool_launch_mixer->setIcon( LXDG::findIcon("preferences-desktop-sound","") ); ui->label_bright_icon->setPixmap( LXDG::findIcon("preferences-desktop-brightness","").pixmap(ui->tool_goto_apps->iconSize()) ); ui->label_locale_icon->setPixmap( LXDG::findIcon("preferences-desktop-locale","").pixmap(ui->tool_goto_apps->iconSize()) ); @@ -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(); @@ -156,11 +156,11 @@ void StartMenu::UpdateQuickLaunch(QString path, bool keep){ // ========================== /*void StartMenu::deleteChildren(QWidget *obj){ if(obj->layout()==0){ - for(int i=0; i<obj->children().count(); i++){ - obj->children().at(i)->deleteLater(); + for(int i=0; i<obj->children().count(); i++){ + obj->children().at(i)->deleteLater(); } }else{ - + } }*/ @@ -174,7 +174,7 @@ void StartMenu::ClearScrollArea(QScrollArea *area){ if(area == ui->scroll_favs){ area->takeWidget()->deleteLater(); } - if(area->widget()==0){ + if(area->widget()==0){ area->setWidget( new QWidget(area) ); //create a new widget in the scroll area } if(area->widget()->layout()==0){ @@ -203,7 +203,7 @@ void StartMenu::SortScrollArea(QScrollArea *area){ for(int i=0; i<lay->count(); i++){ items << lay->itemAt(i)->widget()->whatsThis(); } - + items.sort(); //qDebug() << " - Sorted Items:" << items; for(int i=0; i<items.length(); i++){ @@ -223,10 +223,10 @@ void StartMenu::SortScrollArea(QScrollArea *area){ void StartMenu::do_search(QString search, bool force){ search = search.simplified(); //remove unneccesary whitespace - if(search == CSearch && !force){ + if(search == CSearch && !force){ //nothing new - just ensure the page is visible if(ui->stackedWidget->currentWidget()!=ui->page_search ){ ui->stackedWidget->setCurrentWidget(ui->page_search); } - return; + return; }else if(search.isEmpty()){ CSearch.clear(); if(ui->stackedWidget->currentWidget()==ui->page_search ){ on_tool_back_clicked(); } @@ -234,7 +234,7 @@ void StartMenu::do_search(QString search, bool force){ } //Got a search term - check it CSearch = search; //save this for comparison later - qDebug() << "Search for term:" << search; + //qDebug() << "Search for term:" << search; ClearScrollArea(ui->scroll_search); topsearch.clear(); //Now find any items which match the search @@ -275,7 +275,7 @@ void StartMenu::do_search(QString search, bool force){ connect(it, SIGNAL(RemovedShortcut()), this, SLOT(UpdateFavs()) ); connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); - if(i%3==0){ + if(i%3==0){ QApplication::processEvents(); if(searchTimer->isActive()){ return; } //search changed - go ahead and stop here } @@ -305,13 +305,13 @@ bool StartMenu::promptAboutUpdates(bool &skip){ // PRIVATE SLOTS // ======================== void StartMenu::LaunchItem(QString path, bool fix){ - if(path.startsWith("chcat::::")){ + if(path.startsWith("chcat::::")){ ChangeCategory(path.section("::::",1,50)); return; } - qDebug() << "Launching Item:" << path << fix; + //qDebug() << "Launching Item:" << path << fix; if(!path.isEmpty()){ - qDebug() << "Launch Application:" << path; + //qDebug() << "Launch Application:" << path; if( fix && !path.startsWith("lumina-open") ){ LSession::LaunchApplication("lumina-open \""+path+"\""); } else{ LSession::LaunchApplication(path); } emit CloseMenu(); //so the menu container will close @@ -355,7 +355,7 @@ void StartMenu::UpdateApps(){ connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); } } - + }else if(ui->check_apps_showcats->checkState() == Qt::Checked){ //qDebug() << " - Checked"; //Only show categories to start with - and have the user click-into a cat to see apps @@ -378,7 +378,7 @@ void StartMenu::UpdateApps(){ ui->scroll_apps->widget()->layout()->addWidget(it); connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); //Show apps for this cat - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(CCat); + QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value(CCat); for(int i=0; i<apps.length(); i++){ //qDebug() << " - App:" << apps[i].name; ItemWidget *it = new ItemWidget(ui->scroll_apps->widget(), apps[i] ); @@ -390,11 +390,11 @@ void StartMenu::UpdateApps(){ connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); } } - + }else{ //qDebug() << " - Not Checked"; //No categories at all - just alphabetize all the apps - QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All"); + QList<XDGDesktop*> apps = LSession::handle()->applicationMenu()->currentAppHash()->value("All"); CCat.clear(); //Now add all the apps for this category for(int i=0; i<apps.length(); i++){ @@ -407,8 +407,7 @@ void StartMenu::UpdateApps(){ connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); } } - - + } void StartMenu::UpdateFavs(){ @@ -427,31 +426,7 @@ void StartMenu::UpdateFavs(){ else{ tmp = rest; } //everything left over if(type==1){ SortScrollArea(ui->scroll_favs); - //Need to run a special routine for sorting the apps (already in the widget) - //qDebug() << "Sort App Widgets..."; - // Since each app actually might have a different name listed within the file - /*QLayout *lay = ui->scroll_favs->widget()->layout(); - QStringList items; - for(int i=0; i<lay->count(); i++){ - items << lay->itemAt(i)->widget()->whatsThis().toLower(); - } - - items.sort(); - // qDebug() << " - Sorted Items:" << items; - for(int i=0; i<items.length(); i++){ - if(items[i].isEmpty()){ continue; } - //QLayouts are weird in that they can only add items to the end - need to re-insert almost every item - for(int j=0; j<lay->count(); j++){ - //Find this item - if(lay->itemAt(j)->widget()->whatsThis().toLower()==items[i]){ - //Found it - now move it if necessary - //qDebug() << "Found Item:" << items[i] << i << j; - lay->addItem( lay->takeAt(j) ); - break; - } - } - }*/ - + }//end of special app sorting routine tmp.sort(); //Sort alphabetically by name (dirs/files) for(int i=0; i<tmp.length(); i++){ @@ -472,7 +447,6 @@ void StartMenu::UpdateFavs(){ connect(it, SIGNAL(RunItem(QString)), this, SLOT(LaunchItem(QString)) ); connect(it, SIGNAL(toggleQuickLaunch(QString, bool)), this, SLOT(UpdateQuickLaunch(QString, bool)) ); } - //QApplication::processEvents(); } //end loop over types ui->scroll_favs->update(); //qDebug() << "End updateFavs"; @@ -541,7 +515,7 @@ void StartMenu::on_stackedWidget_currentChanged(int val){ } ui->frame_leave_suspend->setVisible( LOS::systemCanSuspend() ); } - + } void StartMenu::catViewChanged(){ @@ -567,7 +541,7 @@ void StartMenu::on_tool_goto_apps_clicked(){ } void StartMenu::on_tool_goto_settings_clicked(){ - ui->stackedWidget->setCurrentWidget(ui->page_settings); + ui->stackedWidget->setCurrentWidget(ui->page_settings); } void StartMenu::on_tool_goto_logout_clicked(){ @@ -585,7 +559,7 @@ void StartMenu::on_tool_launch_controlpanel_clicked(){ } void StartMenu::on_tool_launch_fm_clicked(){ - LaunchItem(QDir::homePath()); + LaunchItem(QDir::homePath()); } void StartMenu::on_tool_launch_store_clicked(){ diff --git a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp index ec425dd9..abb99975 100644 --- a/src-qt5/desktop-utils/lumina-fm/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-fm/MainUI.cpp @@ -139,7 +139,7 @@ void MainUI::OpenDirs(QStringList dirs){ if(DWLIST[j]->id().section("-",1,1).toInt() >= id){ id = DWLIST[j]->id().section("-",1,1).toInt()+1; } } //Create the new DirWidget - DirWidget *DW = new DirWidget("DW-"+QString::number(id), this); + DirWidget *DW = new DirWidget("DW-"+QString::number(id), settings, this); DW->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); ui->BrowserLayout->addWidget(DW); DWLIST << DW; diff --git a/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp b/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp index 3638e2a8..66169019 100644 --- a/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp +++ b/src-qt5/desktop-utils/lumina-fm/OPWidget.cpp @@ -19,7 +19,7 @@ OPWidget::OPWidget(QWidget *parent) : QWidget(parent), ui(new Ui::OPWidget()){ //Now create the widget ui->setupUi(this); ui->tool_close->setIcon( LXDG::findIcon("dialog-close","view-close") ); - ui->tool_showerrors->setIcon(LXDG::findIcon("dialog-warning","")); + ui->tool_showerrors->setIcon(LXDG::findIcon("view-choose","view-preview")); //connect the widget buttons connect(ui->tool_close, SIGNAL(clicked()), this, SLOT(closeWidget()) ); connect(ui->tool_showerrors, SIGNAL(clicked()), this, SLOT(showErrors()) ); @@ -79,7 +79,7 @@ void OPWidget::startOperation(){ starttime = QDateTime::currentMSecsSinceEpoch(); endtime = -1; QTimer::singleShot(0, worker, SLOT(slotStartOperations()) ); - emit starting(this->whatsThis()); + emit starting(this->whatsThis()); } diff --git a/src-qt5/desktop-utils/lumina-fm/TrayUI.h b/src-qt5/desktop-utils/lumina-fm/TrayUI.h index 4210784a..a87e2da8 100644 --- a/src-qt5/desktop-utils/lumina-fm/TrayUI.h +++ b/src-qt5/desktop-utils/lumina-fm/TrayUI.h @@ -27,7 +27,7 @@ public slots: private: QList<OPWidget*> OPS; - + void createOP( FILEOP, QStringList oldF, QStringList newF); private slots: diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp index 78759aa2..8273d09c 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.cpp @@ -28,7 +28,7 @@ #define DEBUG 0 -DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){ +DirWidget::DirWidget(QString objID, QSettings *settings, QWidget *parent) : QWidget(parent), ui(new Ui::DirWidget){ ui->setupUi(this); //load the designer file ID = objID; //Assemble the toolbar for the widget @@ -54,6 +54,7 @@ DirWidget::DirWidget(QString objID, QWidget *parent) : QWidget(parent), ui(new U toolbar->addAction(ui->actionDualColumn); columnActionGroup->addAction(ui->actionDualColumn); toolbar->addAction(ui->actionMenu); + this->settings = settings; //Add the browser widgets RCBW = 0; //right column browser is unavailable initially BW = new BrowserWidget("", this); @@ -340,8 +341,7 @@ void DirWidget::on_tool_zoom_in_clicked(){ size += 16; setThumbnailSize(size); //Now Save the size value as the default for next time - QSettings SET("lumina-desktop","lumina-fm"); - SET.setValue("iconsize", size); + settings->setValue("iconsize", size); } void DirWidget::on_tool_zoom_out_clicked(){ @@ -350,8 +350,7 @@ void DirWidget::on_tool_zoom_out_clicked(){ size -= 16; setThumbnailSize(size); //Now Save the size value as the default for next time - QSettings SET("lumina-desktop","lumina-fm"); - SET.setValue("iconsize", size); + settings->setValue("iconsize", size); } // -- Top Snapshot Buttons diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h index bff8cb74..8dd367df 100644 --- a/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h +++ b/src-qt5/desktop-utils/lumina-fm/widgets/DirWidget2.h @@ -32,7 +32,7 @@ class DirWidget : public QWidget{ Q_OBJECT public: enum DETAILTYPES{ NAME, SIZE, TYPE, DATEMOD, DATECREATE}; - DirWidget(QString objID, QWidget *parent = 0); //needs a unique ID (to distinguish from other DirWidgets) + DirWidget(QString objID, QSettings *settings, QWidget *parent = 0); //needs a unique ID (to distinguish from other DirWidgets) ~DirWidget(); void cleanup(); //called before the browser is closed down @@ -75,6 +75,7 @@ private: QString ID, cBID; //unique ID assigned by the parent, and currently active browser widget QString normalbasedir, snapbasedir, snaprelpath; //for maintaining directory context while moving between snapshots QStringList snapshots, needThumbs, tmpSel; + QSettings *settings; bool canmodify; //The Toolbar and associated items @@ -95,13 +96,11 @@ private: BrowserWidget* currentBrowser(); QStringList currentDirFiles(); //all the "files" available within the current dir/browser - //QProcess *pExtract; - - //OpenWithMenu - QString fileEXT, filePath; - QStringList mimetypes, keys, files; - //QStringList getPreferredApplications(); - + //QProcess *pExtract; + //OpenWithMenu + QString fileEXT, filePath; + QStringList mimetypes, keys, files; + //QStringList getPreferredApplications(); private slots: //UI BUTTONS/Actions |