[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdereview/metabar
From:       Florian Roth <florian () synatic ! net>
Date:       2005-07-15 7:21:43
Message-ID: 1121412103.851737.27545.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 434731 by roth:

Make layout.html part of themes


 M  +4 -14     metabar.kdevses  
 M  +2 -2      src/Makefile.am  
 M  +6 -6      src/layout.html  
 M  +31 -27    src/metabarwidget.cpp  


--- trunk/kdereview/metabar/metabar.kdevses #434730:434731
@@ -1,30 +1,20 @@
 <?xml version = '1.0' encoding = 'UTF-8'?>
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="4" >
+ <DocsAndViews NumberOfDocuments="2" >
   <Doc0 NumberOfViews="1" \
                URL="file:///home/florian/metabar/metabar/src/metabarwidget.cpp" >
-   <View0 line="103" Type="Source" />
+   <View0 line="329" Type="Source" />
   </Doc0>
   <Doc1 NumberOfViews="1" \
                URL="file:///home/florian/metabar/metabar/src/metabarwidget.h" >
-   <View0 line="69" Type="Source" />
+   <View0 line="88" Type="Source" />
   </Doc1>
-  <Doc2 NumberOfViews="1" \
                URL="file:///home/florian/metabar/metabar/src/configdialog.cpp" >
-   <View0 line="593" Type="Source" />
-  </Doc2>
-  <Doc3 NumberOfViews="1" \
                URL="file:///home/florian/metabar/metabar/src/configdialog.h" >
-   <View0 line="92" Type="Source" />
-  </Doc3>
  </DocsAndViews>
  <pluginList>
   <kdevdebugger>
    <breakpointList/>
   </kdevdebugger>
   <kdevbookmarks>
-   <bookmarks>
-    <bookmark url="/home/florian/metabar/metabar/src/metabar_widget.cpp" >
-     <mark line="619" />
-    </bookmark>
-   </bookmarks>
+   <bookmarks/>
   </kdevbookmarks>
   <kdevvalgrind>
    <executable path="" params="" />
--- trunk/kdereview/metabar/src/Makefile.am #434730:434731
@@ -17,9 +17,9 @@
 metabar_adddir = $(kde_datadir)/konqsidebartng/add
 metabar_add_DATA = metabar_add.desktop
 metabar_datadir = $(kde_datadir)/metabar
-metabar_data_DATA = iconsrc layout.html
+metabar_data_DATA = iconsrc
 metabar_themedir = $(kde_datadir)/metabar/themes/default
-metabar_theme_DATA = default.css
+metabar_theme_DATA = default.css layout.html
 
 noinst_HEADERS = metabarwidget.h protocolplugin.h defaultplugin.h \
 		settingsplugin.h remoteplugin.h httpplugin.h metabarfunctions.h
--- trunk/kdereview/metabar/src/layout.html #434730:434731
@@ -7,37 +7,37 @@
 <body>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="wizard" class="title" \
onClick="this.blur();" href="function://toggle/actions">Actions</a></div><div \
class="headright" /> +  <div class="head"><a i18n image="wizard" class="title" \
onClick="this.blur();" href="function://toggle/actions">Actions</a></div>  <li \
id="actions" expanded="true" style="height:0px">  </li>
 </div>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="run" class="title" \
onClick="this.blur();"  href="function://toggle/open">Open With</a></div><div \
class="headright" /> +  <div class="head"><a i18n image="run" class="title" \
onClick="this.blur();"  href="function://toggle/open">Open With</a></div>  <li \
id="open" expanded="true" style="height:0px">  </li>
 </div>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="bookmark" class="title" \
onClick="this.blur();"  href="function://toggle/bookmarks">Bookmarks</a></div><div \
class="headright" /> +  <div class="head"><a i18n image="bookmark" class="title" \
onClick="this.blur();"  href="function://toggle/bookmarks">Bookmarks</a></div>  <li \
id="bookmarks" expanded="true" style="height:0px">  </li>
 </div>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="browser" class="title" \
onClick="this.blur();"  href="function://toggle/links">Links</a></div><div \
class="headright" /> +  <div class="head"><a i18n image="browser" class="title" \
onClick="this.blur();"  href="function://toggle/links">Links</a></div>  <li \
id="links" expanded="true" style="height:0px">  </li>
 </div>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="messagebox_info" \
class="title" onClick="this.blur();"  \
href="function://toggle/info">Information</a></div><div class="headright" />   +  \
<div class="head"><a i18n image="messagebox_info" class="title" \
onClick="this.blur();"  href="function://toggle/info">Information</a></div>    <li \
id="info" expanded="true" style="height:0px">  </li>
 </div>
 
 <div class="frame">
-  <div class="headleft" /><div class="head"><a i18n image="player_play" \
class="title" onClick="this.blur();"  \
href="function://toggle/preview">Preview</a></div><div class="headright" /> +  <div \
class="head"><a i18n image="player_play" class="title" onClick="this.blur();"  \
href="function://toggle/preview">Preview</a></div>  <li id="preview" expanded="true" \
style="height:0px">  </li>
 </div>
--- trunk/kdereview/metabar/src/metabarwidget.cpp #434730:434731
@@ -121,8 +121,7 @@
   KAction *configAction = new KAction(i18n("Configure %1...").arg("Metabar"), \
"configure", KShortcut(), this, SLOT(slotShowConfig()), html->actionCollection(), \
"configure");  configAction->plug(popup);
 
-  KURL url = KURL(locate("data", "metabar/layout.html"));
-  html->openURL(url);
+  setTheme();
 }
 
 MetabarWidget::~MetabarWidget()
@@ -165,7 +164,7 @@
     }
     
     else if(count == 1){
-      if(newItem){          
+      if(newItem){
         if(newItem->url().isEmpty()){
           return;
         }
@@ -305,21 +304,37 @@
     }
   }
 
-  setTheme();
-
-  QString url = getCurrentURL();
+  config->setGroup("General");
+  QString file = locate("data", \
QString("metabar/themes/%1/default.css").arg(config->readEntry("Theme", "default"))); \
+  if(file.isNull()){ +    file = locate("data", \
QString("metabar/themes/default/default.css")); +  }
   
-  KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL(url), \
                true);
-  KFileItemList list;
-  list.append(item);
+  QFile cssfile(file);
+  if(cssfile.open(IO_ReadOnly)){  
+    QTextStream stream( &cssfile );
+    QString tmp = stream.read();
+    cssfile.close();
+    
+    tmp.replace("./", KURL::fromPathOrURL(file).directory(false));    
+    html->setUserStyleSheet(tmp);
+  }
   
   loadComplete = true;
   html->view()->show();
   
-  setFileItems(list);
+  if(currentItems && !currentItems->isEmpty()){
+    setFileItems(*currentItems, false);
+  }
+  else{
+    QString url = getCurrentURL();
+    KFileItem *item = new KFileItem(KFileItem::Unknown, KFileItem::Unknown, \
KURL(url), true); +    KFileItemList list;
+    list.append(item);
+    setFileItems(list, false);
+  }
+  
   loadLinks();
-  
-  functions->adjustSize("files");
 }
 
 void MetabarWidget::handleURLRequest(const KURL &url, const KParts::URLArgs &args)
@@ -556,23 +571,12 @@
 
 void MetabarWidget::setTheme()
 {
+  loadComplete = false;
+
   config->setGroup("General");
-  QString file = locate("data", \
                QString("metabar/themes/%1/default.css").arg(config->readEntry("Theme", \
                "default")));
-  if(file.isNull()){
-    file = locate("data", QString("metabar/themes/default/default.css"));
-  }
+  QString file = locate("data", \
QString("metabar/themes/%1/layout.html").arg(config->readEntry("Theme", "default"))); \
                
-  QFile cssfile(file);
-  if(!cssfile.open(IO_ReadOnly)){
-    return;
-  }
-
-  QTextStream stream( &cssfile );
-  QString tmp = stream.read();
-  cssfile.close();
-  
-  tmp.replace("./", KURL::fromPathOrURL(file).directory(false));    
-  html->setUserStyleSheet(tmp);
+  html->openURL(KURL(file));
 }
 
 #include "metabarwidget.moc"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic