From kde-commits Fri Sep 30 20:38:34 2016 From: Jasem Mutlaq Date: Fri, 30 Sep 2016 20:38:34 +0000 To: kde-commits Subject: [kstars/bleeding] kstars/ekos: Make profile images scalable without keeping aspect ratio, Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147526792701777 Git commit 18580ad8f114a018cdc5f5b8aed4edf151641cd3 by Jasem Mutlaq. Committed on 30/09/2016 at 10:18. Pushed by mutlaqja into branch 'bleeding'. Make profile images scalable without keeping aspect ratio, keep star images= expandable with aspect ratio set. Use icons for Ekos options M +16 -40 kstars/ekos/ekosmanager.cpp M +6 -6 kstars/ekos/ekosmanager.h M +1011 -101 kstars/ekos/ekosmanager.ui http://commits.kde.org/kstars/18580ad8f114a018cdc5f5b8aed4edf151641cd3 diff --git a/kstars/ekos/ekosmanager.cpp b/kstars/ekos/ekosmanager.cpp index c1ebae3..c2baf86 100644 --- a/kstars/ekos/ekosmanager.cpp +++ b/kstars/ekos/ekosmanager.cpp @@ -82,7 +82,7 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(paren= t) = ekosOption =3D NULL; = - focusStarPixmap=3DfocusProfilePixmap=3DguideStarPixmap=3DguideProfileP= ixmap=3DNULL; + focusStarPixmap=3DguideStarPixmap=3DNULL; = mountPI=3DcapturePI=3DfocusPI=3DguidePI=3DNULL; = @@ -114,11 +114,7 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(pa= rent) connect(clearB, SIGNAL(clicked()), this, SLOT(clearLog())); = // Summary - previewPixmap =3D new QPixmap(QPixmap(":/images/noimage.png")); - focusStarFile.open(); - focusProfileFile.open(); - guideStarFile.open(); - guideProfileFile.open(); + previewPixmap =3D new QPixmap(QPixmap(":/images/noimage.png")); = = // Profiles connect(addProfileB, SIGNAL(clicked()), this, SLOT(addProfile())); @@ -137,6 +133,10 @@ EkosManager::EkosManager(QWidget *parent) : QDialog(pa= rent) // Load add driver profiles loadProfiles(); = + // INDI Control Panel and Ekos Options + controlPanelB->setIcon(QIcon::fromTheme("kstars_indi", QIcon(":/icons/= indi.png"))); + optionsB->setIcon(QIcon::fromTheme("configure", QIcon(":/icons/ekos_se= tup.png"))); + // Setup Tab toolsWidget->tabBar()->setTabIcon(0, QIcon(":/icons/ekos_setup.png")); toolsWidget->tabBar()->setTabToolTip(0, i18n("Setup")); @@ -169,9 +169,7 @@ EkosManager::~EkosManager() delete profileModel; = delete previewPixmap; - delete focusStarPixmap; - delete focusProfilePixmap; - delete guideProfilePixmap; + delete focusStarPixmap; = delete guideStarPixmap; } = @@ -198,12 +196,12 @@ void EkosManager::resizeEvent(QResizeEvent *) previewImage->setPixmap(previewPixmap->scaled(previewImage->width(), p= reviewImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation)); if (focusStarPixmap) focusStarImage->setPixmap(focusStarPixmap->scaled(focusStarImage->= width(), focusStarImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransform= ation)); - if (focusProfilePixmap) - focusProfileImage->setPixmap(focusProfilePixmap->scaled(focusProfi= leImage->width(), focusProfileImage->height(), Qt::KeepAspectRatio, Qt::Smo= othTransformation)); + //if (focusProfilePixmap) + //focusProfileImage->setPixmap(focusProfilePixmap->scaled(focusPro= fileImage->width(), focusProfileImage->height(), Qt::KeepAspectRatio, Qt::S= moothTransformation)); if (guideStarPixmap) guideStarImage->setPixmap(guideStarPixmap->scaled(guideStarImage->= width(), guideStarImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransform= ation)); - if (guideProfilePixmap) - guideProfileImage->setPixmap(guideProfilePixmap->scaled(guideProfi= leImage->width(), guideProfileImage->height(), Qt::KeepAspectRatio, Qt::Smo= othTransformation)); + //if (guideProfilePixmap) + //guideProfileImage->setPixmap(guideProfilePixmap->scaled(guidePro= fileImage->width(), guideProfileImage->height(), Qt::KeepAspectRatio, Qt::S= moothTransformation)); = } = @@ -1495,7 +1493,7 @@ void EkosManager::initMount() if (guideProcess) { connect(mountProcess, &Ekos::Mount::newStatus, this, [&](ISD::Tele= scope::TelescopeStatus state){if (state =3D=3D ISD::Telescope::MOUNT_PARKIN= G) - guideProcess->stopGuiding();}, Qt::UniqueConnection); + guideProcess->abort();}, Qt::UniqueConnection); } = } @@ -1560,7 +1558,7 @@ void EkosManager::initGuide() // Parking //connect(captureProcess, SIGNAL(mountParking()), guideProcess, SL= OT(stopGuiding())); connect(mountProcess, &Ekos::Mount::newStatus, this, [&](ISD::Tele= scope::TelescopeStatus state){if (state =3D=3D ISD::Telescope::MOUNT_PARKIN= G) - guideProcess->stopGuiding();}, Qt::UniqueConnection); + guideProcess->abort();}, Qt::UniqueConnection); = } = @@ -1900,22 +1898,11 @@ void EkosManager::updateFocusStarPixmap(QPixmap &st= arPixmap) focusStarPixmap =3D new QPixmap(starPixmap); = focusStarImage->setPixmap(focusStarPixmap->scaled(focusStarImage->widt= h(), focusStarImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformatio= n)); - - focusStarPixmap->save(focusStarFile.fileName(), "PNG", 100); - - focusStarImage->setToolTip(QString("").arg(focusStarFile.fileName())); } = void EkosManager::updateFocusProfilePixmap(QPixmap &profilePixmap) -{ - delete (focusProfilePixmap); - focusProfilePixmap =3D new QPixmap(profilePixmap); - - focusProfileImage->setPixmap(focusProfilePixmap->scaled(focusProfileIm= age->width(), focusProfileImage->height(), Qt::KeepAspectRatio, Qt::SmoothT= ransformation)); - - focusProfilePixmap->save(focusProfileFile.fileName(), "PNG", 100); - - focusProfileImage->setToolTip(QString("").arg(focusPro= fileFile.fileName())); +{ = + focusProfileImage->setPixmap(profilePixmap); } = void EkosManager::setFocusStatus(Ekos::FocusState status) @@ -1969,22 +1956,11 @@ void EkosManager::updateGuideStarPixmap(QPixmap & s= tarPix) guideStarPixmap =3D new QPixmap(starPix); = guideStarImage->setPixmap(guideStarPixmap->scaled(guideStarImage->widt= h(), guideStarImage->height(), Qt::KeepAspectRatio, Qt::SmoothTransformatio= n)); - - guideStarPixmap->save(guideStarFile.fileName(), "PNG", 100); - - guideStarImage->setToolTip(QString("").arg(guideStarFile.fileName())); } = void EkosManager::updateGuideProfilePixmap(QPixmap & profilePix) { - delete (guideProfilePixmap); - guideProfilePixmap =3D new QPixmap(profilePix); - - guideProfileImage->setPixmap(guideProfilePixmap->scaled(guideProfileIm= age->width(), guideProfileImage->height(), Qt::KeepAspectRatio, Qt::SmoothT= ransformation)); - - guideProfilePixmap->save(guideProfileFile.fileName(), "PNG", 100); - - guideProfileImage->setToolTip(QString("").arg(guidePro= fileFile.fileName())); + guideProfileImage->setPixmap(profilePix); } = void EkosManager::setTarget(SkyObject *o) diff --git a/kstars/ekos/ekosmanager.h b/kstars/ekos/ekosmanager.h index df9ec22..4c1b740 100644 --- a/kstars/ekos/ekosmanager.h +++ b/kstars/ekos/ekosmanager.h @@ -279,16 +279,16 @@ private slots: // Focus Summary QProgressIndicator *focusPI; QPixmap *focusStarPixmap; - QPixmap *focusProfilePixmap; - QTemporaryFile focusStarFile; - QTemporaryFile focusProfileFile; + //QPixmap *focusProfilePixmap; + //QTemporaryFile focusStarFile; + //QTemporaryFile focusProfileFile; = // Guide Summary QProgressIndicator *guidePI; QPixmap *guideStarPixmap; - QPixmap *guideProfilePixmap; - QTemporaryFile guideStarFile; - QTemporaryFile guideProfileFile; + //QPixmap *guideProfilePixmap; + //QTemporaryFile guideStarFile; + //QTemporaryFile guideProfileFile; = }; = diff --git a/kstars/ekos/ekosmanager.ui b/kstars/ekos/ekosmanager.ui index 594e4ba..39a94e0 100644 --- a/kstars/ekos/ekosmanager.ui +++ b/kstars/ekos/ekosmanager.ui @@ -7,7 +7,7 @@ 0 0 670 - 624 + 636 @@ -117,6 +117,12 @@ + + + 0 + 0 + + QComboBox::AdjustToContents @@ -202,9 +208,12 @@ Qt::Horizontal + + QSizePolicy::Minimum + - 40 + 1 20 @@ -244,6 +253,12 @@ true + + + 32 + 32 + + Start INDI @@ -254,8 +269,17 @@ false + + + 32 + 32 + + + + INDI Control Panel + - Control Panel... + @@ -264,8 +288,17 @@ true + + + 32 + 32 + + + + Ekos Options + - Options... + @@ -305,6 +338,12 @@ false + + + 32 + 32 + + Connect @@ -315,6 +354,12 @@ false + + + 32 + 32 + + Disconnect @@ -867,7 +912,7 @@ - 3 + 1 3 @@ -922,7 +967,7 @@ - + 1 @@ -939,7 +984,7 @@ - 70 + 150 70 @@ -952,35 +997,188 @@ + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 0 - 0 - 0 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 0 - 0 - 0 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 239 - 240 - 241 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + @@ -993,7 +1191,11 @@ Focus Profile - true + false + + + background-color: qlineargradie= nt(x1:0, y1:0, x2:0, y2:1, + stop:0 lightgray, stop:1 darkgray);<= /string> QFrame::Panel @@ -1001,11 +1203,8 @@ - - :/images/noim= age.png - - false + true Qt::AlignCenter @@ -1029,35 +1228,314 @@ + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 0 - 0 - 0 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 0 - 0 - 0 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 239 - 240 - 241 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + @@ -1067,7 +1545,12 @@ Focus Star - true + false + + + background: qlineargradient(x1:= 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); QFrame::Panel @@ -1075,9 +1558,6 @@ - - :/images/noim= age.png - false @@ -1171,35 +1651,188 @@ + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 0 - 0 - 0 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 0 - 0 - 0 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + + + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + + + - - - 239 - 240 - 241 - + + + + + 211 + 211 + 211 + + + + + 169 + 169 + 169 + + + @@ -1209,7 +1842,11 @@ Guide Profile - true + false + + + background-color: qlineargradie= nt(x1:0, y1:0, x2:0, y2:1, + stop:0 lightgray, stop:1 darkgray);<= /string> QFrame::Panel @@ -1217,11 +1854,8 @@ - - :/images/noim= age.png - - false + true Qt::AlignCenter @@ -1239,35 +1873,314 @@ + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 0 - 0 - 0 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 0 - 0 - 0 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + + + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + + + - - - 239 - 240 - 241 - + + + + + 225 + 225 + 225 + + + + + 221 + 221 + 221 + + + + + 216 + 216 + 216 + + + + + 211 + 211 + 211 + + + @@ -1280,10 +2193,12 @@ Guide Star - true + false - + background: qlineargradient(x1:= 0, y1: 0, x2: 0, y2: 1, + stop: 0 #E1E1E1, stop: 0.4 #DDDDDD, + stop: 0.5 #D8D8D8, stop: 1.0 #D3D3D3); QFrame::Panel @@ -1291,9 +2206,6 @@ - - :/images/noim= age.png - false @@ -1402,8 +2314,6 @@ 1 - - - +